From 90a5459775bd5fdc3f42ad211471ec59b0c6fe98 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 16 Feb 2022 12:16:57 -0500 Subject: [PATCH 001/584] test: Rewrite "Pattern match failure" in UPLC --- ...e.signatory.dev=true.termcont.bench.golden | 2 +- ...le.signatory.dev=true.termcont.uplc.golden | 2 +- ...ple.signatory.dev=true.haskell.uplc.golden | 2 +- plutarch-test/plutarch-test.cabal | 2 ++ plutarch-test/src/Plutarch/ApiSpec.hs | 21 ++++++------ plutarch-test/src/Plutarch/Test.hs | 32 ++++++++++++++++--- 6 files changed, 42 insertions(+), 19 deletions(-) diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden index 33f6ffc2d..bb9ed0c33 100644 --- a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden +++ b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden @@ -1 +1 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} \ No newline at end of file +0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":369} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden index 7c786aef0..670119686 100644 --- a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden +++ b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden @@ -1 +1 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden index fd936ba65..670119686 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden @@ -1 +1 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:44:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 463738a2c..23de90803 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -78,11 +78,13 @@ common deps , bytestring , filepath , generics-sop + , megaparsec , plutarch , plutarch-benchmark , plutus-core , plutus-ledger-api , plutus-tx + , replace-megaparsec , sydtest , sydtest-discover , tasty diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index 156a6f34a..db50c3131 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -188,18 +188,15 @@ checkSignatoryCont = plam $ \ph ctx' -> checkSignatoryTermCont :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) checkSignatoryTermCont = plam $ \ph ctx' -> unTermCont $ do ctx <- tcont $ pletFields @["txInfo", "purpose"] ctx' - tcont (pmatch $ hrecField @"purpose" ctx) >>= \case - PSpending _ -> do - let signatories = pfield @"signatories" # hrecField @"txInfo" ctx - pure $ - pif - (pelem # pdata ph # pfromData signatories) - -- Success! - (pconstant ()) - -- Signature not present. - perror - _ -> - pure $ ptraceError "checkSignatoryCont: not a spending tx" + PSpending _ <- tcont $ pmatch $ hrecField @"purpose" ctx + let signatories = pfield @"signatories" # hrecField @"txInfo" ctx + pure $ + pif + (pelem # pdata ph # pfromData signatories) + -- Success! + (pconstant ()) + -- Signature not present. + perror getFields :: Term s (PData :--> PBuiltinList PData) getFields = phoistAcyclic $ plam $ \addr -> psndBuiltin #$ pasConstr # addr diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 6dbf04cee..37eaeab14 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -20,12 +20,13 @@ module Plutarch.Test ( PlutarchGolden (All, Bench, PrintTerm), ) where -import Control.Monad (when) +import Control.Monad (void, when) import qualified Data.Aeson.Text as Aeson import Data.Kind (Type) import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy as TL +import Data.Void (Void) import System.FilePath import Test.Syd ( Expectation, @@ -44,6 +45,9 @@ import Plutarch.Benchmark (benchmarkScript') import Plutarch.Bool (PBool (PTrue)) import Plutarch.Evaluate (evaluateScript) import qualified Plutus.V1.Ledger.Scripts as Scripts +import Replace.Megaparsec +import qualified Text.Megaparsec as M +import qualified Text.Megaparsec.Char as M {- | Like `shouldBe` but but for Plutarch terms @@ -74,7 +78,27 @@ psucceeds p = Left _ -> expectationFailure $ "Term failed to evaluate" Right _ -> pure () -{- Like `printTerm` but evaluates the term beforehand. +{- Like `printTerm` but eliminates non-deterministic parts in UPLC. + +-} +printTermDeterministic :: ClosedTerm a -> String +printTermDeterministic p = + rewriteFailMsgToBeDeterministic $ printTerm p + where + rewriteFailMsgToBeDeterministic = + streamEdit ghcPatternMatchMsg id + ghcPatternMatchMsg :: M.Parsec Void String String + ghcPatternMatchMsg = do + -- What's being replaced. + void $ + M.between + (M.string "\"Pattern match failure") + (M.string "\"") + (M.many $ M.anySingleBut '"') + -- The replacement + pure "\"Pattern match failure...\"" + +{- Like `printTermDeterministic` but evaluates the term beforehand. All evaluation failures are treated as equivalent to a `perror`. Plutus does not provide an accurate way to tell if the program evalutes to `Error` or not; @@ -84,7 +108,7 @@ psucceeds p = printTermEvaluated :: ClosedTerm a -> String printTermEvaluated p = case evaluateScript (compile p) of - Left _ -> printTerm perror + Left _ -> printTermDeterministic perror Right (_, _, x) -> printScript x {- | Asserts that the term evaluates successfully with the given trace sequence @@ -178,7 +202,7 @@ goldens pg ps = do it "uplc" $ pureGoldenTextFile ("goldens" name <> ".uplc.golden") $ multiGolden ps $ \p -> - T.pack $ printTerm p + T.pack $ printTermDeterministic p it "uplc.eval" $ let evaluateds = flip fmap ps $ \(s, p) -> (s, printTermEvaluated p) in pureGoldenTextFile ("goldens" name <> ".uplc.eval.golden") $ From 8f0ef97bb864cdd83f62db0f4c5e4066ef5a2b37 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 16 Feb 2022 13:06:19 -0500 Subject: [PATCH 002/584] WIP term rewrite --- ...e.signatory.dev=true.termcont.bench.golden | 2 +- ...le.signatory.dev=true.haskell.bench.golden | 2 +- plutarch-test/src/Plutarch/Test.hs | 43 ++++++++++++++----- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden index bb9ed0c33..69a50fe95 100644 --- a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden +++ b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden @@ -1 +1 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":369} \ No newline at end of file +0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":322} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden index 5bf28846b..69a50fe95 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden @@ -1 +1 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":382} \ No newline at end of file +0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":322} \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 37eaeab14..f8d8c0c43 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -45,9 +45,12 @@ import Plutarch.Benchmark (benchmarkScript') import Plutarch.Bool (PBool (PTrue)) import Plutarch.Evaluate (evaluateScript) import qualified Plutus.V1.Ledger.Scripts as Scripts +import PlutusCore.Default import Replace.Megaparsec import qualified Text.Megaparsec as M import qualified Text.Megaparsec.Char as M +import UntypedPlutusCore +import qualified UntypedPlutusCore as UPLC {- | Like `shouldBe` but but for Plutarch terms @@ -83,20 +86,38 @@ psucceeds p = -} printTermDeterministic :: ClosedTerm a -> String printTermDeterministic p = - rewriteFailMsgToBeDeterministic $ printTerm p + printScript $ rewrite $ compile p + +rewriteFailMsgToBeDeterministic :: String -> String +rewriteFailMsgToBeDeterministic = + streamEdit ghcPatternMatchMsg id where - rewriteFailMsgToBeDeterministic = - streamEdit ghcPatternMatchMsg id ghcPatternMatchMsg :: M.Parsec Void String String ghcPatternMatchMsg = do -- What's being replaced. - void $ - M.between - (M.string "\"Pattern match failure") - (M.string "\"") - (M.many $ M.anySingleBut '"') + s <- M.string "Pattern match failure" + void $ M.takeRest -- The replacement - pure "\"Pattern match failure...\"" + pure $ s <> "..." + +-- TODO: refactor +rewrite :: Scripts.Script -> Scripts.Script +rewrite (Scripts.Script (Program ann ver term)) = + Scripts.Script (Program ann ver (go term)) + where + go :: UPLC.Term DeBruijn DefaultUni DefaultFun () -> UPLC.Term DeBruijn DefaultUni DefaultFun () + go = \case + (Apply ann (Force fann (Builtin ann' builtin)) (Constant ann1 (Some (ValueOf DefaultUniString s)))) -> + (Apply ann (Force fann (Builtin ann' builtin)) (Constant ann1 (someValueOf DefaultUniString $ T.pack . rewriteFailMsgToBeDeterministic . T.unpack $ s))) + LamAbs ann name t -> + LamAbs ann name (go t) + Apply ann t1 t2 -> + Apply ann (go t1) (go t2) + Force ann t -> + Force ann (go t) + Delay ann t -> + Delay ann (go t) + x -> x {- Like `printTermDeterministic` but evaluates the term beforehand. @@ -107,7 +128,7 @@ printTermDeterministic p = -} printTermEvaluated :: ClosedTerm a -> String printTermEvaluated p = - case evaluateScript (compile p) of + case evaluateScript (rewrite $ compile p) of Left _ -> printTermDeterministic perror Right (_, _, x) -> printScript x @@ -212,7 +233,7 @@ goldens pg ps = do it "bench" $ pureGoldenTextFile ("goldens" name <> ".bench.golden") $ multiGolden ps $ \p -> - TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ compile p + TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ rewrite $ compile p multiGolden :: forall a. [(String, a)] -> (a -> T.Text) -> Text multiGolden xs f = From b582ae3dcf65300c1013598be00f6295d80402a7 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 16 Feb 2022 13:46:02 -0500 Subject: [PATCH 003/584] Refactor, and actually filter for Trace --- plutarch-test/plutarch-test.cabal | 2 + plutarch-test/src/Plutarch/Test.hs | 71 ++++--------------- .../src/Plutarch/Test/Deterministic.hs | 50 +++++++++++++ 3 files changed, 65 insertions(+), 58 deletions(-) create mode 100644 plutarch-test/src/Plutarch/Test/Deterministic.hs diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 23de90803..6095114b9 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -98,6 +98,7 @@ library import: c, deps hs-source-dirs: src exposed-modules: Plutarch.Test + other-modules: Plutarch.Test.Deterministic executable plutarch-test import: c, deps @@ -123,6 +124,7 @@ executable plutarch-test Plutarch.RecursionSpec Plutarch.StringSpec Plutarch.Test + Plutarch.Test.Deterministic Plutarch.TraceSpec Plutarch.UnitSpec Spec diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index f8d8c0c43..69b887961 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -20,13 +20,12 @@ module Plutarch.Test ( PlutarchGolden (All, Bench, PrintTerm), ) where -import Control.Monad (void, when) +import Control.Monad (when) import qualified Data.Aeson.Text as Aeson import Data.Kind (Type) import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy as TL -import Data.Void (Void) import System.FilePath import Test.Syd ( Expectation, @@ -44,13 +43,8 @@ import Plutarch import Plutarch.Benchmark (benchmarkScript') import Plutarch.Bool (PBool (PTrue)) import Plutarch.Evaluate (evaluateScript) +import Plutarch.Test.Deterministic (compileD) import qualified Plutus.V1.Ledger.Scripts as Scripts -import PlutusCore.Default -import Replace.Megaparsec -import qualified Text.Megaparsec as M -import qualified Text.Megaparsec.Char as M -import UntypedPlutusCore -import qualified UntypedPlutusCore as UPLC {- | Like `shouldBe` but but for Plutarch terms @@ -81,56 +75,17 @@ psucceeds p = Left _ -> expectationFailure $ "Term failed to evaluate" Right _ -> pure () -{- Like `printTerm` but eliminates non-deterministic parts in UPLC. - --} -printTermDeterministic :: ClosedTerm a -> String -printTermDeterministic p = - printScript $ rewrite $ compile p - -rewriteFailMsgToBeDeterministic :: String -> String -rewriteFailMsgToBeDeterministic = - streamEdit ghcPatternMatchMsg id - where - ghcPatternMatchMsg :: M.Parsec Void String String - ghcPatternMatchMsg = do - -- What's being replaced. - s <- M.string "Pattern match failure" - void $ M.takeRest - -- The replacement - pure $ s <> "..." - --- TODO: refactor -rewrite :: Scripts.Script -> Scripts.Script -rewrite (Scripts.Script (Program ann ver term)) = - Scripts.Script (Program ann ver (go term)) - where - go :: UPLC.Term DeBruijn DefaultUni DefaultFun () -> UPLC.Term DeBruijn DefaultUni DefaultFun () - go = \case - (Apply ann (Force fann (Builtin ann' builtin)) (Constant ann1 (Some (ValueOf DefaultUniString s)))) -> - (Apply ann (Force fann (Builtin ann' builtin)) (Constant ann1 (someValueOf DefaultUniString $ T.pack . rewriteFailMsgToBeDeterministic . T.unpack $ s))) - LamAbs ann name t -> - LamAbs ann name (go t) - Apply ann t1 t2 -> - Apply ann (go t1) (go t2) - Force ann t -> - Force ann (go t) - Delay ann t -> - Delay ann (go t) - x -> x - -{- Like `printTermDeterministic` but evaluates the term beforehand. +{- Like `evaluateScript` but doesn't fail. Also returns `Script`. All evaluation failures are treated as equivalent to a `perror`. Plutus does not provide an accurate way to tell if the program evalutes to `Error` or not; see https://github.com/input-output-hk/plutus/issues/4270 - -} -printTermEvaluated :: ClosedTerm a -> String -printTermEvaluated p = - case evaluateScript (rewrite $ compile p) of - Left _ -> printTermDeterministic perror - Right (_, _, x) -> printScript x +evaluateScriptAlways :: Scripts.Script -> Scripts.Script +evaluateScriptAlways script = + case evaluateScript script of + Left _ -> compile perror + Right (_, _, x) -> x {- | Asserts that the term evaluates successfully with the given trace sequence @@ -223,17 +178,17 @@ goldens pg ps = do it "uplc" $ pureGoldenTextFile ("goldens" name <> ".uplc.golden") $ multiGolden ps $ \p -> - T.pack $ printTermDeterministic p + T.pack $ printScript $ compileD p it "uplc.eval" $ - let evaluateds = flip fmap ps $ \(s, p) -> (s, printTermEvaluated p) - in pureGoldenTextFile ("goldens" name <> ".uplc.eval.golden") $ - multiGolden evaluateds T.pack + pureGoldenTextFile ("goldens" name <> ".uplc.eval.golden") $ + multiGolden ps $ \p -> + T.pack $ printScript $ evaluateScriptAlways $ compileD p -- Golden test for Plutus benchmarks when (hasBenchGolden pg) $ it "bench" $ pureGoldenTextFile ("goldens" name <> ".bench.golden") $ multiGolden ps $ \p -> - TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ rewrite $ compile p + TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ compileD p multiGolden :: forall a. [(String, a)] -> (a -> T.Text) -> Text multiGolden xs f = diff --git a/plutarch-test/src/Plutarch/Test/Deterministic.hs b/plutarch-test/src/Plutarch/Test/Deterministic.hs new file mode 100644 index 000000000..c246b7a8e --- /dev/null +++ b/plutarch-test/src/Plutarch/Test/Deterministic.hs @@ -0,0 +1,50 @@ +{-# LANGUAGE ImpredicativeTypes #-} + +module Plutarch.Test.Deterministic (compileD) where + +import Control.Monad (void) +import qualified Data.Text as T +import Data.Void (Void) +import Plutarch (ClosedTerm, compile) +import qualified Plutus.V1.Ledger.Scripts as Scripts +import PlutusCore.Default +import Replace.Megaparsec (streamEdit) +import qualified Text.Megaparsec as M +import qualified Text.Megaparsec.Char as M +import UntypedPlutusCore (Program (Program), Term (Apply, Builtin, Constant, Delay, Force, LamAbs)) +import qualified UntypedPlutusCore as UPLC + +{- Like `compile`, but the result is deterministic -} +compileD :: ClosedTerm a -> Scripts.Script +compileD = rewrite . compile + +-- TODO: refactor +rewrite :: Scripts.Script -> Scripts.Script +rewrite (Scripts.Script (Program ann ver term)) = + Scripts.Script (Program ann ver (go term)) + where + go :: UPLC.Term name DefaultUni DefaultFun () -> UPLC.Term name DefaultUni DefaultFun () + go = \case + (Apply ann b@(Force _ (Builtin _ Trace)) (Constant ann1 (Some (ValueOf DefaultUniString s)))) -> + (Apply ann b (Constant ann1 (someValueOf DefaultUniString $ T.pack . rewriteFailMsgToBeDeterministic . T.unpack $ s))) + LamAbs ann name t -> + LamAbs ann name (go t) + Apply ann t1 t2 -> + Apply ann (go t1) (go t2) + Force ann t -> + Force ann (go t) + Delay ann t -> + Delay ann (go t) + x -> x + +rewriteFailMsgToBeDeterministic :: String -> String +rewriteFailMsgToBeDeterministic = + streamEdit ghcPatternMatchMsg id + where + ghcPatternMatchMsg :: M.Parsec Void String String + ghcPatternMatchMsg = do + -- What's being replaced. + s <- M.string "Pattern match failure" + void $ M.takeRest + -- The replacement + pure $ s <> "..." From c456789966e070a7fd92590b3566cb50fd2232c0 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 16 Feb 2022 13:59:50 -0500 Subject: [PATCH 004/584] Introduce walkScript, and fix 8.10 failure --- .../src/Plutarch/Test/Deterministic.hs | 80 ++++++++++++------- 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test/Deterministic.hs b/plutarch-test/src/Plutarch/Test/Deterministic.hs index c246b7a8e..76a8ee3df 100644 --- a/plutarch-test/src/Plutarch/Test/Deterministic.hs +++ b/plutarch-test/src/Plutarch/Test/Deterministic.hs @@ -2,49 +2,67 @@ module Plutarch.Test.Deterministic (compileD) where -import Control.Monad (void) import qualified Data.Text as T import Data.Void (Void) import Plutarch (ClosedTerm, compile) import qualified Plutus.V1.Ledger.Scripts as Scripts -import PlutusCore.Default +import PlutusCore.Default ( + DefaultFun (Trace), + DefaultUni (DefaultUniString), + Some (Some), + ValueOf (ValueOf), + someValueOf, + ) import Replace.Megaparsec (streamEdit) import qualified Text.Megaparsec as M import qualified Text.Megaparsec.Char as M -import UntypedPlutusCore (Program (Program), Term (Apply, Builtin, Constant, Delay, Force, LamAbs)) +import UntypedPlutusCore ( + Program (Program), + Term (Apply, Builtin, Constant, Delay, Force, LamAbs), + ) import qualified UntypedPlutusCore as UPLC {- Like `compile`, but the result is deterministic -} compileD :: ClosedTerm a -> Scripts.Script -compileD = rewrite . compile +compileD p = rewriteTraces $ compile p --- TODO: refactor -rewrite :: Scripts.Script -> Scripts.Script -rewrite (Scripts.Script (Program ann ver term)) = - Scripts.Script (Program ann ver (go term)) +{- Rewrite the string used by `Trace` so that the script becomes deterministic. -} +rewriteTraces :: Scripts.Script -> Scripts.Script +rewriteTraces = + walkScript $ \term -> do + -- Replace the 's' in `trace s`. + Apply () b@(Force _ (Builtin _ Trace)) (Constant () (Some (ValueOf DefaultUniString s))) <- pure term + let s' = T.pack . streamEdit ghcPatternMatchReplacement id . T.unpack $ s + pure $ Apply () b (Constant () (someValueOf DefaultUniString $ s')) where - go :: UPLC.Term name DefaultUni DefaultFun () -> UPLC.Term name DefaultUni DefaultFun () - go = \case - (Apply ann b@(Force _ (Builtin _ Trace)) (Constant ann1 (Some (ValueOf DefaultUniString s)))) -> - (Apply ann b (Constant ann1 (someValueOf DefaultUniString $ T.pack . rewriteFailMsgToBeDeterministic . T.unpack $ s))) - LamAbs ann name t -> - LamAbs ann name (go t) - Apply ann t1 t2 -> - Apply ann (go t1) (go t2) - Force ann t -> - Force ann (go t) - Delay ann t -> - Delay ann (go t) - x -> x + ghcPatternMatchReplacement :: M.Parsec Void String String + ghcPatternMatchReplacement = do + -- What's being replaced (which is varying). + s <- M.string "Pattern match failure" <* M.takeRest + -- The replacement (which is constant) + pure $ s <> "..." -rewriteFailMsgToBeDeterministic :: String -> String -rewriteFailMsgToBeDeterministic = - streamEdit ghcPatternMatchMsg id +{- Walk the Plutus script, transforming matching terms -} +walkScript :: + forall term. + (term ~ UPLC.Term UPLC.DeBruijn DefaultUni DefaultFun ()) => + (term -> Maybe term) -> + Scripts.Script -> + Scripts.Script +walkScript f (Scripts.Script (Program ann ver term)) = + Scripts.Script (Program ann ver (go term)) where - ghcPatternMatchMsg :: M.Parsec Void String String - ghcPatternMatchMsg = do - -- What's being replaced. - s <- M.string "Pattern match failure" - void $ M.takeRest - -- The replacement - pure $ s <> "..." + go :: term -> term + go term = + case f term of + Just term' -> term' + Nothing -> case term of + LamAbs ann name t -> + LamAbs ann name (go t) + Apply ann t1 t2 -> + Apply ann (go t1) (go t2) + Force ann t -> + Force ann (go t) + Delay ann t -> + Delay ann (go t) + x -> x From ea98c2edc8ed805bc520e066048fd2b130f72678 Mon Sep 17 00:00:00 2001 From: Karl Gandhi Date: Wed, 16 Feb 2022 21:10:03 +0000 Subject: [PATCH 005/584] added more comments to api vi contexts --- Plutarch/Api/V1/Contexts.hs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 7299b6ae3..5fccbcc5e 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -34,21 +34,22 @@ import Plutarch.Lift ( ) import Plutarch.Prelude +-- | A pending transaction. This is the view as seen by the validator script. newtype PTxInfo (s :: S) = PTxInfo ( Term s ( PDataRecord - '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) - , "outputs" ':= PBuiltinList (PAsData PTxOut) - , "fee" ':= PValue - , "mint" ':= PValue - , "dcert" ':= PBuiltinList (PAsData PDCert) - , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) - , "validRange" ':= PPOSIXTimeRange - , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) + '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- ^ Transaction inputs + , "outputs" ':= PBuiltinList (PAsData PTxOut) -- ^ Transaction outputs + , "fee" ':= PValue -- ^ The fee paid by this transaction. + , "mint" ':= PValue -- ^ The value minted by the transaction. + , "dcert" ':= PBuiltinList (PAsData PDCert) -- ^ Digests of the certificates included in this transaction. + , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- ^ Staking withdrawals + , "validRange" ':= PPOSIXTimeRange -- ^ The valid range for the transaction. + , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) -- ^ Signatories attesting that they all signed the tx. , "data" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) - , "id" ':= PTxId + , "id" ':= PTxId -- ^ The hash of the pending transaction. ] ) ) @@ -62,6 +63,7 @@ newtype PTxInfo (s :: S) instance PUnsafeLiftDecl PTxInfo where type PLifted PTxInfo = Plutus.TxInfo deriving via (DerivePConstantViaData Plutus.TxInfo PTxInfo) instance (PConstant Plutus.TxInfo) +-- | Script context consists of the script purpose and the pending transaction info. newtype PScriptContext (s :: S) = PScriptContext ( Term @@ -83,7 +85,7 @@ instance PUnsafeLiftDecl PScriptContext where type PLifted PScriptContext = Plut deriving via (DerivePConstantViaData Plutus.ScriptContext PScriptContext) instance (PConstant Plutus.ScriptContext) -- General types, used by V1 and V2 - +-- | The purpose of the script that is currently running data PScriptPurpose (s :: S) = PMinting (Term s (PDataRecord '["_0" ':= PCurrencySymbol])) | PSpending (Term s (PDataRecord '["_0" ':= PTxOutRef])) From f400ba66be2205157041bddbde2ae4fa03a82a57 Mon Sep 17 00:00:00 2001 From: Karl Gandhi Date: Wed, 16 Feb 2022 21:11:09 +0000 Subject: [PATCH 006/584] added more comments to api v1 tx --- Plutarch/Api/V1/Tx.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index dcd9a52fd..574a82b90 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -40,6 +40,7 @@ newtype PTxId (s :: S) instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId deriving via (DerivePConstantViaData Plutus.TxId PTxId) instance (PConstant Plutus.TxId) +-- | Reference to a transaction output with a index referencing which of the outputs is being referred to. newtype PTxOutRef (s :: S) = PTxOutRef ( Term @@ -60,6 +61,7 @@ newtype PTxOutRef (s :: S) instance PUnsafeLiftDecl PTxOutRef where type PLifted PTxOutRef = Plutus.TxOutRef deriving via (DerivePConstantViaData Plutus.TxOutRef PTxOutRef) instance (PConstant Plutus.TxOutRef) +-- | A input of a pending transaction. newtype PTxInInfo (s :: S) = PTxInInfo ( Term @@ -80,6 +82,7 @@ newtype PTxInInfo (s :: S) instance PUnsafeLiftDecl PTxInInfo where type PLifted PTxInInfo = Plutus.TxInInfo deriving via (DerivePConstantViaData Plutus.TxInInfo PTxInInfo) instance (PConstant Plutus.TxInInfo) +-- | A transaction output. This consists of a target address, value and maybe a datum hash newtype PTxOut (s :: S) = PTxOut ( Term From 4b1018360ca53652811ee9cd7d70fe10171150ad Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 16 Feb 2022 17:12:28 -0500 Subject: [PATCH 007/584] Get rid of replace-megaparsec --- plutarch-test/plutarch-test.cabal | 2 -- plutarch-test/src/Plutarch/Test/Deterministic.hs | 16 +++++----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 6095114b9..ec10593cc 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -78,13 +78,11 @@ common deps , bytestring , filepath , generics-sop - , megaparsec , plutarch , plutarch-benchmark , plutus-core , plutus-ledger-api , plutus-tx - , replace-megaparsec , sydtest , sydtest-discover , tasty diff --git a/plutarch-test/src/Plutarch/Test/Deterministic.hs b/plutarch-test/src/Plutarch/Test/Deterministic.hs index 76a8ee3df..ad844658e 100644 --- a/plutarch-test/src/Plutarch/Test/Deterministic.hs +++ b/plutarch-test/src/Plutarch/Test/Deterministic.hs @@ -3,7 +3,6 @@ module Plutarch.Test.Deterministic (compileD) where import qualified Data.Text as T -import Data.Void (Void) import Plutarch (ClosedTerm, compile) import qualified Plutus.V1.Ledger.Scripts as Scripts import PlutusCore.Default ( @@ -13,9 +12,6 @@ import PlutusCore.Default ( ValueOf (ValueOf), someValueOf, ) -import Replace.Megaparsec (streamEdit) -import qualified Text.Megaparsec as M -import qualified Text.Megaparsec.Char as M import UntypedPlutusCore ( Program (Program), Term (Apply, Builtin, Constant, Delay, Force, LamAbs), @@ -32,15 +28,13 @@ rewriteTraces = walkScript $ \term -> do -- Replace the 's' in `trace s`. Apply () b@(Force _ (Builtin _ Trace)) (Constant () (Some (ValueOf DefaultUniString s))) <- pure term - let s' = T.pack . streamEdit ghcPatternMatchReplacement id . T.unpack $ s + let s' = replaceGhcPatternMatch s pure $ Apply () b (Constant () (someValueOf DefaultUniString $ s')) where - ghcPatternMatchReplacement :: M.Parsec Void String String - ghcPatternMatchReplacement = do - -- What's being replaced (which is varying). - s <- M.string "Pattern match failure" <* M.takeRest - -- The replacement (which is constant) - pure $ s <> "..." + replaceGhcPatternMatch = \case + (T.stripPrefix "Pattern match failure" -> Just _) -> + "Pattern match failure..." + x -> x {- Walk the Plutus script, transforming matching terms -} walkScript :: From 5b72dfd9e4251be0c81728fc471f044d9f810bb5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 17 Feb 2022 16:54:00 -0500 Subject: [PATCH 008/584] Add goldenSpec, with monadic syntax for goldens --- plutarch-test/plutarch-test.cabal | 9 +- plutarch-test/src/Plutarch/BoolSpec.hs | 34 +++---- plutarch-test/src/Plutarch/IntegerSpec.hs | 19 ++-- plutarch-test/src/Plutarch/Test.hs | 22 ++--- .../src/Plutarch/Test/Deterministic.hs | 17 +++- plutarch-test/src/Plutarch/Test/Golden.hs | 88 +++++++++++++++++++ plutarch-test/src/Plutarch/Test/ListSyntax.hs | 30 +++++++ 7 files changed, 170 insertions(+), 49 deletions(-) create mode 100644 plutarch-test/src/Plutarch/Test/Golden.hs create mode 100644 plutarch-test/src/Plutarch/Test/ListSyntax.hs diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index c903ead95..60ea612fb 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -78,6 +78,7 @@ common deps , bytestring , filepath , generics-sop + , mtl , plutarch , plutarch-benchmark , plutus-core @@ -95,11 +96,13 @@ library import: c, deps hs-source-dirs: src exposed-modules: Plutarch.Test - other-modules: Plutarch.Test.Deterministic + other-modules: + Plutarch.Test.Deterministic + Plutarch.Test.Golden + Plutarch.Test.ListSyntax executable plutarch-test import: c, deps - type: exitcode-stdio-1.0 main-is: Main.hs hs-source-dirs: src @@ -123,6 +126,8 @@ executable plutarch-test Plutarch.StringSpec Plutarch.Test Plutarch.Test.Deterministic + Plutarch.Test.Golden + Plutarch.Test.ListSyntax Plutarch.TraceSpec Plutarch.UnitSpec Spec diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index 9ef154a67..99f105e35 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -10,31 +10,23 @@ spec :: Spec spec = do describe "bool" $ do describe "pnot" $ do - goldens - All - [ ("lam", popaque pnot) - , ("app", popaque $ pnot #$ pcon PTrue) - ] + goldenSpec $ do + "lam" #> pnot + "app" #> pnot #$ pcon PTrue it "true" $ (pnot #$ pcon PTrue) #@?= pcon PFalse it "false" $ (pnot #$ pcon PFalse) #@?= pcon PTrue describe "pand" $ do - goldens - All - [ ("tf", pcon PTrue #&& pcon PFalse) - , ("ft", pcon PFalse #&& pcon PTrue) - , ("tt", pcon PTrue #&& pcon PTrue) - , ("ff", pcon PFalse #&& pcon PFalse) - ] - it "tf" $ (pcon PTrue #&& pcon PFalse) #@?= pcon PFalse - it "ft" $ (pcon PFalse #&& pcon PTrue) #@?= pcon PFalse - it "tt" $ (pcon PTrue #&& pcon PTrue) #@?= pcon PTrue - it "ff" $ (pcon PFalse #&& pcon PFalse) #@?= pcon PFalse + goldenSpec $ do + "tf" #> pcon PTrue #&& pcon PFalse + "ft" #> pcon PFalse #&& pcon PTrue + "tt" #> pcon PTrue #&& pcon PTrue + "ff" #> pcon PFalse #&& pcon PFalse describe "laziness" $ do - let p1 = pand # pcon PFalse # pdelay perror - p2 = pcon PFalse #&& perror - goldens All [("pand", popaque p1), ("op", popaque p2)] - it "pand" $ passert $ pnot # pforce p1 - it "op" $ passert $ pnot # p2 + goldenSpec $ do + "pand" #> pand # pcon PFalse # pdelay perror + "op" #> pcon PFalse #&& perror + it "pand" $ passert $ pnot # pforce (pand # pcon PFalse # pdelay perror) + it "op" $ passert $ pnot # (pcon PFalse #&& perror) it "pand.perror" $ do pfails $ pand # pcon PFalse # perror pfails $ pand # pcon PTrue # perror diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/src/Plutarch/IntegerSpec.hs index e7fd275f9..5b74e4fb4 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/src/Plutarch/IntegerSpec.hs @@ -10,16 +10,15 @@ spec :: Spec spec = do describe "int" $ do describe "examples" $ do - goldens - All - [ ("add1", popaque add1) - , ("add1Hoisted", popaque add1Hoisted) - , ("example1", popaque example1) - , ("example2", popaque example2) - , ("fib", popaque fib) - , ("fib.app.9", popaque $ fib # 9) - , ("uglyDouble", popaque uglyDouble) - ] + goldenSpec $ do + "add1" #> add1 + "add1Hoisted" #> add1Hoisted + "example1" #> example1 + "example2" #> example2 + "fib" #> fib + "fib.app" #\ do + "9" #> fib # 9 + "uglyDouble" #> uglyDouble add1 :: Term s (PInteger :--> PInteger :--> PInteger) add1 = plam $ \x y -> x + y + 1 diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index d86d56ad5..6dc886a6d 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -17,12 +17,15 @@ module Plutarch.Test ( -- `goldens`. golden, goldens, + (#>), + (#\), + goldenSpec, PlutarchGolden (All, Bench, PrintTerm), getGoldenFilePrefix, goldenFilePath, ) where -import Control.Monad (when) +import Control.Monad.Writer import qualified Data.Aeson.Text as Aeson import Data.Kind (Type) import Data.Text (Text) @@ -45,7 +48,8 @@ import Plutarch import Plutarch.Benchmark (benchmarkScript') import Plutarch.Bool (PBool (PTrue)) import Plutarch.Evaluate (evaluateScript) -import Plutarch.Test.Deterministic (compileD) +import Plutarch.Test.Deterministic (compileD, evaluateScriptAlways) +import Plutarch.Test.Golden import qualified Plutus.V1.Ledger.Scripts as Scripts {- | @@ -77,18 +81,6 @@ psucceeds p = Left _ -> expectationFailure $ "Term failed to evaluate" Right _ -> pure () -{- Like `evaluateScript` but doesn't fail. Also returns `Script`. - - All evaluation failures are treated as equivalent to a `perror`. Plutus does - not provide an accurate way to tell if the program evalutes to `Error` or not; - see https://github.com/input-output-hk/plutus/issues/4270 --} -evaluateScriptAlways :: Scripts.Script -> Scripts.Script -evaluateScriptAlways script = - case evaluateScript script of - Left _ -> compile perror - Right (_, _, x) -> x - {- | Asserts that the term evaluates successfully with the given trace sequence See also: `plutarchDevFlagDescribe` @@ -134,6 +126,8 @@ pfails p = do Left _ -> pure () Right _ -> expectationFailure $ "Term succeeded" +-- TODO: All the code below will be deleted, in favour of Golden.hs + {- Whether to run all or a particular golden test Typically you want to use `All` -- this produces printTerm and benchmark diff --git a/plutarch-test/src/Plutarch/Test/Deterministic.hs b/plutarch-test/src/Plutarch/Test/Deterministic.hs index ad844658e..c8d018cba 100644 --- a/plutarch-test/src/Plutarch/Test/Deterministic.hs +++ b/plutarch-test/src/Plutarch/Test/Deterministic.hs @@ -1,9 +1,10 @@ {-# LANGUAGE ImpredicativeTypes #-} -module Plutarch.Test.Deterministic (compileD) where +module Plutarch.Test.Deterministic (compileD, evaluateScriptAlways) where import qualified Data.Text as T -import Plutarch (ClosedTerm, compile) +import Plutarch (ClosedTerm, compile, perror) +import Plutarch.Evaluate (evaluateScript) import qualified Plutus.V1.Ledger.Scripts as Scripts import PlutusCore.Default ( DefaultFun (Trace), @@ -18,6 +19,18 @@ import UntypedPlutusCore ( ) import qualified UntypedPlutusCore as UPLC +{- Like `evaluateScript` but doesn't fail. Also returns `Script`. + + All evaluation failures are treated as equivalent to a `perror`. Plutus does + not provide an accurate way to tell if the program evalutes to `Error` or not; + see https://github.com/input-output-hk/plutus/issues/4270 +-} +evaluateScriptAlways :: Scripts.Script -> Scripts.Script +evaluateScriptAlways script = + case evaluateScript script of + Left _ -> compile perror + Right (_, _, x) -> x + {- Like `compile`, but the result is deterministic -} compileD :: ClosedTerm a -> Scripts.Script compileD p = rewriteTraces $ compile p diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs new file mode 100644 index 000000000..20d65da03 --- /dev/null +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -0,0 +1,88 @@ +module Plutarch.Test.Golden ( + goldenSpec, + (#>), + (#\), +) where + +import qualified Data.Aeson.Text as Aeson +import Data.Text (Text) +import qualified Data.Text as T +import qualified Data.Text.Lazy as TL +import System.FilePath +import Test.Syd ( + Spec, + TestDefM, + describe, + getTestDescriptionPath, + it, + pureGoldenTextFile, + ) + +import Data.Kind (Type) +import Data.List.NonEmpty (nonEmpty) +import Data.Maybe (fromMaybe) +import Data.Semigroup (sconcat) +import Data.String (IsString) +import Plutarch +import Plutarch.Benchmark (benchmarkScript') +import Plutarch.Test.Deterministic (compileD, evaluateScriptAlways) +import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) + +data GoldenValue = GoldenValue + { goldenValueUplcPreEval :: Text + , goldenValueUplcPostEval :: Text + , goldenValueBench :: Text + } + deriving stock (Eq) + +mkGoldenValue :: ClosedTerm a -> GoldenValue +mkGoldenValue p = + GoldenValue + (T.pack $ printScript $ compileD p) + (T.pack $ printScript $ evaluateScriptAlways $ compileD p) + (TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ compileD p) + +{- The key used in the .golden files containing multiple golden values -} +newtype GoldenKey = GoldenKey Text + deriving newtype (Eq, Show, Ord, IsString) + +instance Semigroup GoldenKey where + GoldenKey s1 <> GoldenKey s2 = GoldenKey $ s1 <> "." <> s2 + +goldenPath :: FilePath -> GoldenKey -> FilePath +goldenPath baseDir (GoldenKey k) = + baseDir T.unpack k <> ".golden" + +{- Group multiple goldens values in the same file -} +combineGoldens :: [(GoldenKey, Text)] -> Text +combineGoldens xs = + T.intercalate "\n" $ + (\(GoldenKey k, v) -> k <> " " <> v) <$> xs + +(#>) :: GoldenKey -> ClosedTerm a -> ListSyntax (GoldenKey, GoldenValue) +(#>) k v = listSyntaxAdd (k, mkGoldenValue v) +infixr 0 #> + +(#\) :: GoldenKey -> ListSyntax (GoldenKey, GoldenValue) -> ListSyntax (GoldenKey, GoldenValue) +(#\) = listSyntaxAddSubList + +goldenSpec :: ListSyntax (GoldenKey, GoldenValue) -> Spec +goldenSpec map = do + name <- currentGoldenKey + let bs = runListSyntax map + let goldenPathWith k = goldenPath "goldens" $ name <> k + describe "golden" $ do + it "uplc" $ + pureGoldenTextFile (goldenPathWith "uplc") $ + combineGoldens $ fmap goldenValueUplcPreEval <$> bs + it "uplc.eval" $ + pureGoldenTextFile (goldenPathWith "uplc.eval") $ + combineGoldens $ fmap goldenValueUplcPostEval <$> bs + it "bench" $ + pureGoldenTextFile (goldenPathWith "bench") $ + combineGoldens $ fmap goldenValueBench <$> bs + +currentGoldenKey :: forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey +currentGoldenKey = do + testAncestors <- fmap (drop 1 . reverse) $ getTestDescriptionPath + pure $ sconcat $ fmap GoldenKey $ fromMaybe (error "empty list") $ nonEmpty $ testAncestors diff --git a/plutarch-test/src/Plutarch/Test/ListSyntax.hs b/plutarch-test/src/Plutarch/Test/ListSyntax.hs new file mode 100644 index 000000000..f60923cee --- /dev/null +++ b/plutarch-test/src/Plutarch/Test/ListSyntax.hs @@ -0,0 +1,30 @@ +module Plutarch.Test.ListSyntax ( + ListSyntax, + runListSyntax, + listSyntaxAdd, + listSyntaxAddSubList, +) where + +import Control.Monad (void) +import Control.Monad.Writer (Writer, execWriter, tell) + +listSyntaxAddSubList :: Semigroup k => k -> ListSyntax (k, v) -> ListSyntax (k, v) +listSyntaxAddSubList name m = + void $ + flip traverse (runListSyntax m) $ \(k, v) -> do + let k' = name <> k + listSyntaxAdd (k', v) + +newtype ListSyntaxM elem a = ListSyntax {unListSyntax :: Writer [elem] a} + deriving newtype (Functor, Applicative, Monad) + +type ListSyntax elem = ListSyntaxM elem () + +runListSyntax :: ListSyntax elem -> [elem] +runListSyntax = + execWriter . unListSyntax + +listSyntaxAdd :: elem -> ListSyntax elem +listSyntaxAdd = ListSyntax . tell . one + where + one x = [x] From 6896f59fa7d06fb28b109d081186124dd8c14510 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 18 Feb 2022 11:39:35 -0500 Subject: [PATCH 009/584] Use HasCallStack --- plutarch-test/src/Plutarch/Test/Golden.hs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 20d65da03..1e2e2ec0d 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -20,9 +20,10 @@ import Test.Syd ( import Data.Kind (Type) import Data.List.NonEmpty (nonEmpty) -import Data.Maybe (fromMaybe) +import qualified Data.List.NonEmpty as NE import Data.Semigroup (sconcat) import Data.String (IsString) +import GHC.Stack (HasCallStack) import Plutarch import Plutarch.Benchmark (benchmarkScript') import Plutarch.Test.Deterministic (compileD, evaluateScriptAlways) @@ -66,11 +67,11 @@ infixr 0 #> (#\) :: GoldenKey -> ListSyntax (GoldenKey, GoldenValue) -> ListSyntax (GoldenKey, GoldenValue) (#\) = listSyntaxAddSubList -goldenSpec :: ListSyntax (GoldenKey, GoldenValue) -> Spec +goldenSpec :: HasCallStack => ListSyntax (GoldenKey, GoldenValue) -> Spec goldenSpec map = do name <- currentGoldenKey let bs = runListSyntax map - let goldenPathWith k = goldenPath "goldens" $ name <> k + goldenPathWith k = goldenPath "goldens" $ name <> k describe "golden" $ do it "uplc" $ pureGoldenTextFile (goldenPathWith "uplc") $ @@ -82,7 +83,12 @@ goldenSpec map = do pureGoldenTextFile (goldenPathWith "bench") $ combineGoldens $ fmap goldenValueBench <$> bs -currentGoldenKey :: forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey +currentGoldenKey :: HasCallStack => forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey currentGoldenKey = do - testAncestors <- fmap (drop 1 . reverse) $ getTestDescriptionPath - pure $ sconcat $ fmap GoldenKey $ fromMaybe (error "empty list") $ nonEmpty $ testAncestors + fmap nonEmpty getTestDescriptionPath >>= \case + Nothing -> error "cannot use currentGoldenKey from top-level spec" + Just anc -> + case nonEmpty (NE.drop 1 . NE.reverse $ anc) of + Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" + Just path -> + pure $ sconcat $ fmap GoldenKey path From f16ba54bcee159b624ef045650bfe1f722680d72 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 18 Feb 2022 11:40:38 -0500 Subject: [PATCH 010/584] Reorganize int.examples.fib --- plutarch-test/goldens/int.examples.bench.golden | 2 +- plutarch-test/goldens/int.examples.uplc.eval.golden | 2 +- plutarch-test/goldens/int.examples.uplc.golden | 2 +- plutarch-test/src/Plutarch/IntegerSpec.hs | 7 ++++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/plutarch-test/goldens/int.examples.bench.golden b/plutarch-test/goldens/int.examples.bench.golden index 2928e8042..e4f61a84e 100644 --- a/plutarch-test/goldens/int.examples.bench.golden +++ b/plutarch-test/goldens/int.examples.bench.golden @@ -2,6 +2,6 @@ add1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} add1Hoisted {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} example1 {"exBudgetCPU":2057973,"exBudgetMemory":3710,"scriptSizeBytes":34} example2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":21} -fib {"exBudgetCPU":416922,"exBudgetMemory":1500,"scriptSizeBytes":72} +fib.lam {"exBudgetCPU":416922,"exBudgetMemory":1500,"scriptSizeBytes":72} fib.app.9 {"exBudgetCPU":187876376,"exBudgetMemory":433318,"scriptSizeBytes":75} uglyDouble {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.uplc.eval.golden b/plutarch-test/goldens/int.examples.uplc.eval.golden index 4a5acccef..94d064400 100644 --- a/plutarch-test/goldens/int.examples.uplc.eval.golden +++ b/plutarch-test/goldens/int.examples.uplc.eval.golden @@ -2,6 +2,6 @@ add1 (program 1.0.0 (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1)) add1Hoisted (program 1.0.0 (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1)) example1 (program 1.0.0 55) example2 (program 1.0.0 (\i0 -> i1 (\i0 -> addInteger i1 1) (\i0 -> subtractInteger i1 1))) -fib (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 1)) ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 2)))))))))) +fib.lam (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 1)) ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 2)))))))))) fib.app.9 (program 1.0.0 34) uglyDouble (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.uplc.golden b/plutarch-test/goldens/int.examples.uplc.golden index ebf5e4031..41ef79cf6 100644 --- a/plutarch-test/goldens/int.examples.uplc.golden +++ b/plutarch-test/goldens/int.examples.uplc.golden @@ -2,6 +2,6 @@ add1 (program 1.0.0 (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1)) add1Hoisted (program 1.0.0 (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1)) example1 (program 1.0.0 ((\i0 -> addInteger (i1 12 32) (i1 5 4)) (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1))) example2 (program 1.0.0 (\i0 -> i1 (\i0 -> addInteger i1 1) (\i0 -> subtractInteger i1 1))) -fib (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2)))))))))) (force ifThenElse))) +fib.lam (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2)))))))))) (force ifThenElse))) fib.app.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) 9) (force ifThenElse))) uglyDouble (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/src/Plutarch/IntegerSpec.hs index 5b74e4fb4..49579a9f3 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/src/Plutarch/IntegerSpec.hs @@ -15,9 +15,10 @@ spec = do "add1Hoisted" #> add1Hoisted "example1" #> example1 "example2" #> example2 - "fib" #> fib - "fib.app" #\ do - "9" #> fib # 9 + "fib" #\ do + "lam" #> fib + "app" #\ do + "9" #> fib # 9 "uglyDouble" #> uglyDouble add1 :: Term s (PInteger :--> PInteger :--> PInteger) From 9be0d31b42312c59bf0f73b2a311f2bc2922c483 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 18 Feb 2022 11:44:43 -0500 Subject: [PATCH 011/584] Rename to pgoldenSpec for consistency --- plutarch-test/src/Plutarch/BoolSpec.hs | 6 +++--- plutarch-test/src/Plutarch/IntegerSpec.hs | 2 +- plutarch-test/src/Plutarch/Test.hs | 2 +- plutarch-test/src/Plutarch/Test/Golden.hs | 24 ++++++++++++++++++++--- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index 99f105e35..127428a3f 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -10,19 +10,19 @@ spec :: Spec spec = do describe "bool" $ do describe "pnot" $ do - goldenSpec $ do + pgoldenSpec $ do "lam" #> pnot "app" #> pnot #$ pcon PTrue it "true" $ (pnot #$ pcon PTrue) #@?= pcon PFalse it "false" $ (pnot #$ pcon PFalse) #@?= pcon PTrue describe "pand" $ do - goldenSpec $ do + pgoldenSpec $ do "tf" #> pcon PTrue #&& pcon PFalse "ft" #> pcon PFalse #&& pcon PTrue "tt" #> pcon PTrue #&& pcon PTrue "ff" #> pcon PFalse #&& pcon PFalse describe "laziness" $ do - goldenSpec $ do + pgoldenSpec $ do "pand" #> pand # pcon PFalse # pdelay perror "op" #> pcon PFalse #&& perror it "pand" $ passert $ pnot # pforce (pand # pcon PFalse # pdelay perror) diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/src/Plutarch/IntegerSpec.hs index 49579a9f3..1010903b2 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/src/Plutarch/IntegerSpec.hs @@ -10,7 +10,7 @@ spec :: Spec spec = do describe "int" $ do describe "examples" $ do - goldenSpec $ do + pgoldenSpec $ do "add1" #> add1 "add1Hoisted" #> add1Hoisted "example1" #> example1 diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 6dc886a6d..6a10ffc6d 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -19,7 +19,7 @@ module Plutarch.Test ( goldens, (#>), (#\), - goldenSpec, + pgoldenSpec, PlutarchGolden (All, Bench, PrintTerm), getGoldenFilePrefix, goldenFilePath, diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 1e2e2ec0d..2a62a8f05 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -1,5 +1,5 @@ module Plutarch.Test.Golden ( - goldenSpec, + pgoldenSpec, (#>), (#\), ) where @@ -67,8 +67,26 @@ infixr 0 #> (#\) :: GoldenKey -> ListSyntax (GoldenKey, GoldenValue) -> ListSyntax (GoldenKey, GoldenValue) (#\) = listSyntaxAddSubList -goldenSpec :: HasCallStack => ListSyntax (GoldenKey, GoldenValue) -> Spec -goldenSpec map = do +{- Create golden specs for pre/post-eval UPLC and benchmarks. + + A *single* golden file will be created (for each metric) for all the programs + in the given tree. + + For example, + ``` + pgoldenSpec $ do + "foo" #> pconstant 42 + "bar" #\ do + "qux" #> pconstant "Hello" + ``` + + Will create three golden files -- uplc.golden, uplc.eval.golden and + bench.golden -- each containing three lines one for each program above. + Hierarchy is represented by intercalating with a dot; for instance, the key + for 'qux' will be "bar.qux". +-} +pgoldenSpec :: HasCallStack => ListSyntax (GoldenKey, GoldenValue) -> Spec +pgoldenSpec map = do name <- currentGoldenKey let bs = runListSyntax map goldenPathWith k = goldenPath "goldens" $ name <> k From 76dc92ea3ae0f5e4b7daaa2a37821ef688c5ebbf Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 18 Feb 2022 11:47:42 -0500 Subject: [PATCH 012/584] Use '@' instead of '#' ... Because Plutarch uses '#', and test framework already has operators prefixed with '@'. --- plutarch-test/src/Plutarch/BoolSpec.hs | 16 ++++++++-------- plutarch-test/src/Plutarch/IntegerSpec.hs | 18 +++++++++--------- plutarch-test/src/Plutarch/Test.hs | 4 ++-- plutarch-test/src/Plutarch/Test/Golden.hs | 20 ++++++++++---------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index 127428a3f..bf066d83a 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -11,20 +11,20 @@ spec = do describe "bool" $ do describe "pnot" $ do pgoldenSpec $ do - "lam" #> pnot - "app" #> pnot #$ pcon PTrue + "lam" @> pnot + "app" @> pnot #$ pcon PTrue it "true" $ (pnot #$ pcon PTrue) #@?= pcon PFalse it "false" $ (pnot #$ pcon PFalse) #@?= pcon PTrue describe "pand" $ do pgoldenSpec $ do - "tf" #> pcon PTrue #&& pcon PFalse - "ft" #> pcon PFalse #&& pcon PTrue - "tt" #> pcon PTrue #&& pcon PTrue - "ff" #> pcon PFalse #&& pcon PFalse + "tf" @> pcon PTrue #&& pcon PFalse + "ft" @> pcon PFalse #&& pcon PTrue + "tt" @> pcon PTrue #&& pcon PTrue + "ff" @> pcon PFalse #&& pcon PFalse describe "laziness" $ do pgoldenSpec $ do - "pand" #> pand # pcon PFalse # pdelay perror - "op" #> pcon PFalse #&& perror + "pand" @> pand # pcon PFalse # pdelay perror + "op" @> pcon PFalse #&& perror it "pand" $ passert $ pnot # pforce (pand # pcon PFalse # pdelay perror) it "op" $ passert $ pnot # (pcon PFalse #&& perror) it "pand.perror" $ do diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/src/Plutarch/IntegerSpec.hs index 1010903b2..dbdff2671 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/src/Plutarch/IntegerSpec.hs @@ -11,15 +11,15 @@ spec = do describe "int" $ do describe "examples" $ do pgoldenSpec $ do - "add1" #> add1 - "add1Hoisted" #> add1Hoisted - "example1" #> example1 - "example2" #> example2 - "fib" #\ do - "lam" #> fib - "app" #\ do - "9" #> fib # 9 - "uglyDouble" #> uglyDouble + "add1" @> add1 + "add1Hoisted" @> add1Hoisted + "example1" @> example1 + "example2" @> example2 + "fib" @\ do + "lam" @> fib + "app" @\ do + "9" @> fib # 9 + "uglyDouble" @> uglyDouble add1 :: Term s (PInteger :--> PInteger :--> PInteger) add1 = plam $ \x y -> x + y + 1 diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 6a10ffc6d..9fca57b28 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -17,8 +17,8 @@ module Plutarch.Test ( -- `goldens`. golden, goldens, - (#>), - (#\), + (@>), + (@\), pgoldenSpec, PlutarchGolden (All, Bench, PrintTerm), getGoldenFilePrefix, diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 2a62a8f05..e620464df 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -1,7 +1,7 @@ module Plutarch.Test.Golden ( pgoldenSpec, - (#>), - (#\), + (@>), + (@\), ) where import qualified Data.Aeson.Text as Aeson @@ -60,12 +60,12 @@ combineGoldens xs = T.intercalate "\n" $ (\(GoldenKey k, v) -> k <> " " <> v) <$> xs -(#>) :: GoldenKey -> ClosedTerm a -> ListSyntax (GoldenKey, GoldenValue) -(#>) k v = listSyntaxAdd (k, mkGoldenValue v) -infixr 0 #> +(@>) :: GoldenKey -> ClosedTerm a -> ListSyntax (GoldenKey, GoldenValue) +(@>) k v = listSyntaxAdd (k, mkGoldenValue v) +infixr 0 @> -(#\) :: GoldenKey -> ListSyntax (GoldenKey, GoldenValue) -> ListSyntax (GoldenKey, GoldenValue) -(#\) = listSyntaxAddSubList +(@\) :: GoldenKey -> ListSyntax (GoldenKey, GoldenValue) -> ListSyntax (GoldenKey, GoldenValue) +(@\) = listSyntaxAddSubList {- Create golden specs for pre/post-eval UPLC and benchmarks. @@ -75,9 +75,9 @@ infixr 0 #> For example, ``` pgoldenSpec $ do - "foo" #> pconstant 42 - "bar" #\ do - "qux" #> pconstant "Hello" + "foo" @> pconstant 42 + "bar" @\ do + "qux" @> pconstant "Hello" ``` Will create three golden files -- uplc.golden, uplc.eval.golden and From 5957c1ae9cbf44f9aeb3fbe46880efdc2292be26 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 18 Feb 2022 14:06:06 -0500 Subject: [PATCH 013/584] Extend syntax to do asserts/shouldBe in the same place --- plutarch-test/src/Plutarch/BoolSpec.hs | 16 ++++---- plutarch-test/src/Plutarch/Test.hs | 1 + plutarch-test/src/Plutarch/Test/Golden.hs | 50 +++++++++++++++++++++-- 3 files changed, 55 insertions(+), 12 deletions(-) diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index bf066d83a..742a261bd 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -17,16 +17,16 @@ spec = do it "false" $ (pnot #$ pcon PFalse) #@?= pcon PTrue describe "pand" $ do pgoldenSpec $ do - "tf" @> pcon PTrue #&& pcon PFalse - "ft" @> pcon PFalse #&& pcon PTrue - "tt" @> pcon PTrue #&& pcon PTrue - "ff" @> pcon PFalse #&& pcon PFalse + "tf" @> pcon PTrue #&& pcon PFalse @-> pshouldBe (pcon PFalse) + "ft" @> pcon PFalse #&& pcon PTrue @-> pshouldBe (pcon PFalse) + "tt" @> pcon PTrue #&& pcon PTrue @-> passert + "ff" @> pcon PFalse #&& pcon PFalse @-> pshouldBe (pcon PFalse) describe "laziness" $ do pgoldenSpec $ do - "pand" @> pand # pcon PFalse # pdelay perror - "op" @> pcon PFalse #&& perror - it "pand" $ passert $ pnot # pforce (pand # pcon PFalse # pdelay perror) - it "op" $ passert $ pnot # (pcon PFalse #&& perror) + "pand" @> pand # pcon PFalse # pdelay perror @-> \p -> + passert $ pnot # pforce p + "op" @> pcon PFalse #&& perror @-> \p -> + passert $ pnot # p it "pand.perror" $ do pfails $ pand # pcon PFalse # perror pfails $ pand # pcon PTrue # perror diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 9fca57b28..08f6e8847 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -19,6 +19,7 @@ module Plutarch.Test ( goldens, (@>), (@\), + (@->), pgoldenSpec, PlutarchGolden (All, Bench, PrintTerm), getGoldenFilePrefix, diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index e620464df..37770e3e6 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -1,7 +1,10 @@ +{-# LANGUAGE ImpredicativeTypes #-} + module Plutarch.Test.Golden ( pgoldenSpec, (@>), (@\), + (@->), ) where import qualified Data.Aeson.Text as Aeson @@ -10,6 +13,7 @@ import qualified Data.Text as T import qualified Data.Text.Lazy as TL import System.FilePath import Test.Syd ( + Expectation, Spec, TestDefM, describe, @@ -18,14 +22,17 @@ import Test.Syd ( pureGoldenTextFile, ) +import Control.Monad (forM_, unless) import Data.Kind (Type) import Data.List.NonEmpty (nonEmpty) import qualified Data.List.NonEmpty as NE +import Data.Maybe (mapMaybe) import Data.Semigroup (sconcat) import Data.String (IsString) import GHC.Stack (HasCallStack) import Plutarch import Plutarch.Benchmark (benchmarkScript') +import Plutarch.Internal (Term (Term, asRawTerm)) import Plutarch.Test.Deterministic (compileD, evaluateScriptAlways) import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) @@ -33,15 +40,41 @@ data GoldenValue = GoldenValue { goldenValueUplcPreEval :: Text , goldenValueUplcPostEval :: Text , goldenValueBench :: Text + , goldenValueExpectation :: Maybe Expectation } - deriving stock (Eq) -mkGoldenValue :: ClosedTerm a -> GoldenValue -mkGoldenValue p = +{- Class of types that represent `GoldenValue` + + This class exists for syntatic sugar provided by (@->) (via `TermExpectation`). +-} +class HasGoldenValue a where + mkGoldenValue :: a -> GoldenValue + +mkGoldenValue' :: ClosedTerm a -> Maybe Expectation -> GoldenValue +mkGoldenValue' p mexp = GoldenValue (T.pack $ printScript $ compileD p) (T.pack $ printScript $ evaluateScriptAlways $ compileD p) (TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ compileD p) + mexp + +instance HasGoldenValue (Term s a) where + mkGoldenValue p = mkGoldenValue' (unsafeClosedTerm p) Nothing + +{- A `Term` paired with its evaluation expectation + + Example: + >>> TermExpectation (pcon PTrue) $ \p -> pshouldBe (pcon PTrue) + +-} +data TermExpectation s a = TermExpectation (Term s a) (Term s a -> Expectation) + +(@->) :: Term s a -> (ClosedTerm a -> Expectation) -> TermExpectation s a +(@->) p f = TermExpectation p (\p' -> f $ unsafeClosedTerm p') +infixr 1 @-> + +instance HasGoldenValue (TermExpectation s a) where + mkGoldenValue (TermExpectation p f) = mkGoldenValue' (unsafeClosedTerm p) (Just $ f p) {- The key used in the .golden files containing multiple golden values -} newtype GoldenKey = GoldenKey Text @@ -60,7 +93,7 @@ combineGoldens xs = T.intercalate "\n" $ (\(GoldenKey k, v) -> k <> " " <> v) <$> xs -(@>) :: GoldenKey -> ClosedTerm a -> ListSyntax (GoldenKey, GoldenValue) +(@>) :: HasGoldenValue v => GoldenKey -> v -> ListSyntax (GoldenKey, GoldenValue) (@>) k v = listSyntaxAdd (k, mkGoldenValue v) infixr 0 @> @@ -100,6 +133,11 @@ pgoldenSpec map = do it "bench" $ pureGoldenTextFile (goldenPathWith "bench") $ combineGoldens $ fmap goldenValueBench <$> bs + let asserts = flip mapMaybe bs $ \(_, b) -> do + goldenValueExpectation b + unless (null asserts) $ do + it "asserts" $ do + forM_ asserts id currentGoldenKey :: HasCallStack => forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey currentGoldenKey = do @@ -110,3 +148,7 @@ currentGoldenKey = do Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" Just path -> pure $ sconcat $ fmap GoldenKey path + +-- Because, we need a function with this signature. +unsafeClosedTerm :: Term s a -> ClosedTerm a +unsafeClosedTerm t = Term $ asRawTerm t From aafa65e249b109bb380ee3dd065089be6ed6b6d4 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 10:06:21 -0500 Subject: [PATCH 014/584] Add passertNot --- plutarch-test/src/Plutarch/BoolSpec.hs | 26 ++++++++++---------------- plutarch-test/src/Plutarch/Test.hs | 7 ++++++- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index 742a261bd..510c5f9c6 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -32,23 +32,17 @@ spec = do pfails $ pand # pcon PTrue # perror pfails $ pcon PTrue #&& perror describe "por" $ do - goldens - All - [ ("tf", pcon PTrue #|| pcon PFalse) - , ("ft", pcon PFalse #|| pcon PTrue) - , ("tt", pcon PTrue #|| pcon PTrue) - , ("ff", pcon PFalse #|| pcon PFalse) - ] - it "tf" $ (pcon PTrue #|| pcon PFalse) #@?= pcon PTrue - it "ft" $ (pcon PFalse #|| pcon PTrue) #@?= pcon PTrue - it "tt" $ (pcon PTrue #|| pcon PTrue) #@?= pcon PTrue - it "ff" $ (pcon PFalse #|| pcon PFalse) #@?= pcon PFalse + pgoldenSpec $ do + "tf" @> pcon PTrue #|| pcon PFalse @-> passert + "ft" @> pcon PFalse #|| pcon PTrue @-> passert + "tt" @> pcon PTrue #|| pcon PTrue @-> passert + "ff" @> pcon PFalse #|| pcon PFalse @-> passertNot describe "laziness" $ do - let p1 = por # pcon PTrue # pdelay perror - p2 = pcon PTrue #|| perror - goldens All [("por", popaque p1), ("op", popaque p2)] - it "por" $ passert $ pforce p1 - it "op" $ passert p2 + pgoldenSpec $ do + "por" @> por # pcon PTrue # pdelay perror @-> \p -> + passert (pforce p) + "op" @> pcon PTrue #|| perror @-> \p -> + passert p it "pand.perror" $ do pfails $ por # pcon PFalse # perror pfails $ por # pcon PTrue # perror diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 08f6e8847..4abb55b67 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -5,6 +5,7 @@ module Plutarch.Test ( -- | Plutarch specific `Expectation` operators passert, + passertNot, pfails, psucceeds, ptraces, @@ -47,7 +48,7 @@ import Test.Syd ( import Plutarch import Plutarch.Benchmark (benchmarkScript') -import Plutarch.Bool (PBool (PTrue)) +import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evaluateScript) import Plutarch.Test.Deterministic (compileD, evaluateScriptAlways) import Plutarch.Test.Golden @@ -75,6 +76,10 @@ pshouldBe x y = do passert :: ClosedTerm a -> Expectation passert p = p #@?= pcon PTrue +{- Asserts the term to be false -} +passertNot :: ClosedTerm a -> Expectation +passertNot p = p #@?= pcon PFalse + {- Asserts the term evaluates successfully without failing -} psucceeds :: ClosedTerm a -> Expectation psucceeds p = From 81c16ed68b0a3f8c3ffe9722eaf4646c055f4831 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 10:41:04 -0500 Subject: [PATCH 015/584] Port List and String spec --- plutarch-test/goldens/list.fun.bench.golden | 12 +++ .../goldens/list.fun.uplc.eval.golden | 12 +++ plutarch-test/goldens/list.fun.uplc.golden | 12 +++ plutarch-test/goldens/list.type.bench.golden | 3 + .../goldens/list.type.uplc.eval.golden | 3 + plutarch-test/goldens/list.type.uplc.golden | 3 + plutarch-test/goldens/str.bench.golden | 5 ++ plutarch-test/goldens/str.uplc.eval.golden | 5 ++ plutarch-test/goldens/str.uplc.golden | 5 ++ plutarch-test/src/Plutarch/ListSpec.hs | 83 ++++++++----------- plutarch-test/src/Plutarch/StringSpec.hs | 25 +++--- 11 files changed, 106 insertions(+), 62 deletions(-) create mode 100644 plutarch-test/goldens/list.fun.bench.golden create mode 100644 plutarch-test/goldens/list.fun.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.fun.uplc.golden create mode 100644 plutarch-test/goldens/list.type.bench.golden create mode 100644 plutarch-test/goldens/list.type.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.type.uplc.golden create mode 100644 plutarch-test/goldens/str.bench.golden create mode 100644 plutarch-test/goldens/str.uplc.eval.golden create mode 100644 plutarch-test/goldens/str.uplc.golden diff --git a/plutarch-test/goldens/list.fun.bench.golden b/plutarch-test/goldens/list.fun.bench.golden new file mode 100644 index 000000000..537bd0ec2 --- /dev/null +++ b/plutarch-test/goldens/list.fun.bench.golden @@ -0,0 +1,12 @@ +pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} +pnull.nonempty {"exBudgetCPU":16261571,"exBudgetMemory":40093,"scriptSizeBytes":85} +pconcat.identity {"exBudgetCPU":2054437,"exBudgetMemory":7000,"scriptSizeBytes":64} +pmap.eg {"exBudgetCPU":29309216,"exBudgetMemory":77312,"scriptSizeBytes":99} +pmap.identity {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":54} +pfilter.1 {"exBudgetCPU":35949366,"exBudgetMemory":87322,"scriptSizeBytes":115} +pfilter.2 {"exBudgetCPU":30925386,"exBudgetMemory":83312,"scriptSizeBytes":110} +pzipWith {"exBudgetCPU":46106600,"exBudgetMemory":119104,"scriptSizeBytes":120} +pfoldl.primed.nonempty {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} +pfoldl.primed.empty {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} +pfoldl.primed.nonempty {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} +pfoldl.primed.empty {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} \ No newline at end of file diff --git a/plutarch-test/goldens/list.fun.uplc.eval.golden b/plutarch-test/goldens/list.fun.uplc.eval.golden new file mode 100644 index 000000000..9a177ad7f --- /dev/null +++ b/plutarch-test/goldens/list.fun.uplc.eval.golden @@ -0,0 +1,12 @@ +pnull.empty (program 1.0.0 True) +pnull.nonempty (program 1.0.0 True) +pconcat.identity (program 1.0.0 (\i0 -> \i0 -> i2 0 (\i0 -> \i0 -> force i1))) +pmap.eg (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) +pmap.identity (program 1.0.0 (\i0 -> \i0 -> force i1)) +pfilter.1 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) +pfilter.2 (program 1.0.0 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) +pzipWith (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) +pfoldl.primed.nonempty (program 1.0.0 -55) +pfoldl.primed.empty (program 1.0.0 0) +pfoldl.primed.nonempty (program 1.0.0 -55) +pfoldl.primed.empty (program 1.0.0 0) \ No newline at end of file diff --git a/plutarch-test/goldens/list.fun.uplc.golden b/plutarch-test/goldens/list.fun.uplc.golden new file mode 100644 index 000000000..34565c7ef --- /dev/null +++ b/plutarch-test/goldens/list.fun.uplc.golden @@ -0,0 +1,12 @@ +pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) +pnull.nonempty (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 i2 (i4 i1)) (delay i3)) i2) ((\i0 -> i2 i1 (\i0 -> \i0 -> force i1)) 0) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +pmap.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1))) +pfilter.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +pfilter.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +pzipWith (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i11 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) +pfoldl.primed.nonempty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.primed.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.primed.nonempty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.primed.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.type.bench.golden b/plutarch-test/goldens/list.type.bench.golden new file mode 100644 index 000000000..bd37603c4 --- /dev/null +++ b/plutarch-test/goldens/list.type.bench.golden @@ -0,0 +1,3 @@ +phead {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} +ptail {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} +pmatch {"exBudgetCPU":5579001,"exBudgetMemory":14120,"scriptSizeBytes":64} \ No newline at end of file diff --git a/plutarch-test/goldens/list.type.uplc.eval.golden b/plutarch-test/goldens/list.type.uplc.eval.golden new file mode 100644 index 000000000..d56f978c6 --- /dev/null +++ b/plutarch-test/goldens/list.type.uplc.eval.golden @@ -0,0 +1,3 @@ +phead (program 1.0.0 1) +ptail (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))))))) +pmatch (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/list.type.uplc.golden b/plutarch-test/goldens/list.type.uplc.golden new file mode 100644 index 000000000..79e740165 --- /dev/null +++ b/plutarch-test/goldens/list.type.uplc.golden @@ -0,0 +1,3 @@ +phead (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) +ptail (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) +pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> i2) (delay error))) \ No newline at end of file diff --git a/plutarch-test/goldens/str.bench.golden b/plutarch-test/goldens/str.bench.golden new file mode 100644 index 000000000..be9aabb74 --- /dev/null +++ b/plutarch-test/goldens/str.bench.golden @@ -0,0 +1,5 @@ +eq {"exBudgetCPU":389284,"exBudgetMemory":901,"scriptSizeBytes":18} +semigroup.laws.id.1 {"exBudgetCPU":659376,"exBudgetMemory":1302,"scriptSizeBytes":24} +semigroup.laws.id.2 {"exBudgetCPU":659376,"exBudgetMemory":1302,"scriptSizeBytes":23} +semigroup.concat {"exBudgetCPU":572057,"exBudgetMemory":1003,"scriptSizeBytes":35} +semigroup.mempty {"exBudgetCPU":388284,"exBudgetMemory":901,"scriptSizeBytes":14} \ No newline at end of file diff --git a/plutarch-test/goldens/str.uplc.eval.golden b/plutarch-test/goldens/str.uplc.eval.golden new file mode 100644 index 000000000..ca90e11c5 --- /dev/null +++ b/plutarch-test/goldens/str.uplc.eval.golden @@ -0,0 +1,5 @@ +eq (program 1.0.0 True) +semigroup.laws.id.1 (program 1.0.0 True) +semigroup.laws.id.2 (program 1.0.0 True) +semigroup.concat (program 1.0.0 True) +semigroup.mempty (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/str.uplc.golden b/plutarch-test/goldens/str.uplc.golden new file mode 100644 index 000000000..6ec6d23da --- /dev/null +++ b/plutarch-test/goldens/str.uplc.golden @@ -0,0 +1,5 @@ +eq (program 1.0.0 ((\i0 -> equalsString i1 i1) "foo")) +semigroup.laws.id.1 (program 1.0.0 ((\i0 -> equalsString (appendString "" i1) i1) "foo")) +semigroup.laws.id.2 (program 1.0.0 ((\i0 -> equalsString i1 (appendString "" i1)) "foo")) +semigroup.concat (program 1.0.0 (equalsString (appendString "foo" "bar") "foobar")) +semigroup.mempty (program 1.0.0 ((\i0 -> equalsString i1 i1) "")) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ListSpec.hs b/plutarch-test/src/Plutarch/ListSpec.hs index 9a0c503d7..b71899a61 100644 --- a/plutarch-test/src/Plutarch/ListSpec.hs +++ b/plutarch-test/src/Plutarch/ListSpec.hs @@ -14,52 +14,41 @@ spec = do describe "list" $ do let xs10 :: Term _ (PList PInteger) xs10 = integerList [1 .. 10] - describe "pmatch" $ do - let p = pmatch (integerList [1, 3, 1]) $ \_ -> perror - golden PrintTerm p - describe "phead" $ do - let p = phead # xs10 - golden All p - it "works" $ passert $ p #== 1 - describe "ptail" $ do - let p = ptail # xs10 - golden All p - it "works" $ passert $ p #== integerList [2 .. 10] - describe "pnull" $ do - let p0 = pnull # integerList [] - p1 = pnull # xs10 - goldens All [("p0", p0), ("p1", p1)] - it "empty" $ passert p0 - it "nonempty" $ passert $ pnot # p1 - describe "pconcat" $ do - describe "identity" $ do + describe "type" . pgoldenSpec $ do + "phead" @> phead # xs10 @-> pshouldBe (pconstant @PInteger 1) + "ptail" @> ptail # xs10 @-> pshouldBe (integerList [2 .. 10]) + let matchP = pmatch (integerList [1, 3, 1]) $ \case + PSNil -> perror + PSCons x _ -> x + "pmatch" @> matchP @-> pshouldBe (pconstant @PInteger 1) + describe "fun" . pgoldenSpec $ do + "pnull" @\ do + "empty" @> pnull # (integerList []) @-> passert + "nonempty" @> pnot # (pnull # xs10) @-> passert + "pconcat" @\ do let xs :: Term s (PList PInteger) xs = psingleton # (fromInteger @(Term _ PInteger) 0) - p = pconcat # xs # pnil - golden All p - it "works" $ passert $ p #== xs - describe "pmap" $ do - let p = pmap # (plam $ \x -> x + x) # xs10 - golden All p - it "eg" $ passert $ p #== (integerList $ fmap (* 2) [1 .. 10]) - it "identity" $ passert $ pmap @PList # (plam $ \(x :: Term _ PInteger) -> x) # pnil #== pnil - describe "pfilter" $ do - let p1 = pfilter # (plam $ \x -> pmod # x # 2 #== 0) # xs10 - p2 = pfilter # (plam $ \x -> 5 #< x) # xs10 - goldens All [("p1", p1), ("p2", p2)] - it "p1" $ passert $ p1 #== integerList [2, 4, 6, 8, 10] - it "p2" $ passert $ p2 #== integerList [6 .. 10] - describe "pzipWith" $ do - let p = pzipWith' (+) # xs10 # xs10 - golden All p - it "works" $ passert $ p #== integerList (fmap (* 2) [1 .. 10]) - describe "pfoldl" $ do - let p1 = pfoldl # plam (-) # 0 # xs10 - p1' = pfoldl' (-) # 0 # xs10 - p2 = pfoldl # plam (-) # 0 # integerList [] - p2' = pfoldl' (-) # 0 # integerList [] - goldens All [("p1", p1), ("p1'", p1'), ("p2", p2), ("p2'", p2)] - it "nonempty" $ passert $ p1 #== pconstant (foldl (-) 0 [1 .. 10]) - it "nonempty'" $ passert $ p1' #== pconstant (foldl (-) 0 [1 .. 10]) - it "empty" $ passert $ p2 #== pconstant 0 - it "empty'" $ passert $ p2' #== pconstant 0 + "identity" @> pconcat # xs # pnil @-> pshouldBe xs + "pmap" @\ do + "eg" @> pmap # (plam $ \x -> x + x) # xs10 + @-> pshouldBe (integerList $ fmap (* 2) [1 .. 10]) + "identity" @> pmap @PList # (plam $ \(x :: Term _ PInteger) -> x) # pnil + @-> pshouldBe (pnil @PList) + "pfilter" @\ do + "1" @> pfilter # (plam $ \x -> pmod # x # 2 #== 0) # xs10 + @-> pshouldBe (integerList [2, 4, 6, 8, 10]) + "2" @> pfilter # (plam $ \x -> 5 #< x) # xs10 + @-> pshouldBe (integerList [6 .. 10]) + "pzipWith" @> pzipWith' (+) # xs10 # xs10 + @-> pshouldBe (integerList (fmap (* 2) [1 .. 10])) + "pfoldl" @\ do + "primed" @\ do + "nonempty" @> pfoldl' (-) # 0 # xs10 + @-> pshouldBe (pconstant @PInteger (foldl (-) 0 [1 .. 10])) + "empty" @> pfoldl' (-) # 0 # integerList [] + @-> pshouldBe (pconstant @PInteger 0) + "primed" @\ do + "nonempty" @> pfoldl # plam (-) # 0 # xs10 + @-> pshouldBe (pconstant @PInteger (foldl (-) 0 [1 .. 10])) + "empty" @> pfoldl # plam (-) # 0 # integerList [] + @-> pshouldBe (pconstant @PInteger 0) diff --git a/plutarch-test/src/Plutarch/StringSpec.hs b/plutarch-test/src/Plutarch/StringSpec.hs index 902db728b..d2129c10f 100644 --- a/plutarch-test/src/Plutarch/StringSpec.hs +++ b/plutarch-test/src/Plutarch/StringSpec.hs @@ -8,18 +8,13 @@ import Plutarch.Test spec :: Spec spec = do describe "str" $ do - describe "eq" $ do - let p = "foo" #== pconstant @PString "foo" - golden All p - it "works" $ passert p - describe "semigroup" $ do - let s1 = pconstant @PString "foo" - s2 = pconstant @PString "bar" - golden All $ s1 <> s2 - it "laws" $ do - passert $ (mempty <> s1) #== s1 - passert $ s1 #== (mempty <> s1) - it "concats" $ do - passert $ s1 <> s2 #== pconstant @PString "foobar" - it "mempty" $ do - passert $ mempty #== pconstant @PString "" + pgoldenSpec $ do + "eq" @> "foo" #== pconstant @PString "foo" @-> passert + "semigroup" @\ do + let s1 = pconstant @PString "foo" + s2 = pconstant @PString "bar" + "laws" @\ do + "id.1" @> (mempty <> s1) #== s1 @-> passert + "id.2" @> s1 #== (mempty <> s1) @-> passert + "concat" @> s1 <> s2 #== pconstant @PString "foobar" @-> passert + "mempty" @> mempty #== pconstant @PString "" @-> passert From c45572c5a4ebdd41386d3e1f001e6b7f059176f6 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 10:54:45 -0500 Subject: [PATCH 016/584] Add `(@==)` as convenient alias Because we write `@-> pshouldBe ...` *almost all* the time. --- plutarch-test/goldens/bytestring.bench.golden | 10 +++ .../goldens/bytestring.uplc.eval.golden | 10 +++ plutarch-test/goldens/bytestring.uplc.golden | 10 +++ plutarch-test/src/Plutarch/BoolSpec.hs | 7 ++- plutarch-test/src/Plutarch/ByteStringSpec.hs | 63 ++++++++----------- plutarch-test/src/Plutarch/ListSpec.hs | 26 ++++---- plutarch-test/src/Plutarch/Test.hs | 9 +++ plutarch-test/src/Plutarch/Test/Golden.hs | 4 ++ 8 files changed, 85 insertions(+), 54 deletions(-) create mode 100644 plutarch-test/goldens/bytestring.bench.golden create mode 100644 plutarch-test/goldens/bytestring.uplc.eval.golden create mode 100644 plutarch-test/goldens/bytestring.uplc.golden diff --git a/plutarch-test/goldens/bytestring.bench.golden b/plutarch-test/goldens/bytestring.bench.golden new file mode 100644 index 000000000..2403928ab --- /dev/null +++ b/plutarch-test/goldens/bytestring.bench.golden @@ -0,0 +1,10 @@ +empty {"exBudgetCPU":350820,"exBudgetMemory":901,"scriptSizeBytes":14} +phexByteStr {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":19} +plengthByteStr {"exBudgetCPU":496379,"exBudgetMemory":805,"scriptSizeBytes":17} +pconsBS {"exBudgetCPU":1381637,"exBudgetMemory":2113,"scriptSizeBytes":33} +pindexByteStr {"exBudgetCPU":298965,"exBudgetMemory":601,"scriptSizeBytes":16} +psliceByteStr {"exBudgetCPU":363511,"exBudgetMemory":801,"scriptSizeBytes":22} +eq {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":16} +semigroup.concats {"exBudgetCPU":546438,"exBudgetMemory":602,"scriptSizeBytes":17} +semigroup.laws.id.1 {"exBudgetCPU":867011,"exBudgetMemory":1302,"scriptSizeBytes":22} +semigroup.laws.id.2 {"exBudgetCPU":867011,"exBudgetMemory":1302,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.uplc.eval.golden b/plutarch-test/goldens/bytestring.uplc.eval.golden new file mode 100644 index 000000000..f675e1599 --- /dev/null +++ b/plutarch-test/goldens/bytestring.uplc.eval.golden @@ -0,0 +1,10 @@ +empty (program 1.0.0 True) +phexByteStr (program 1.0.0 True) +plengthByteStr (program 1.0.0 True) +pconsBS (program 1.0.0 True) +pindexByteStr (program 1.0.0 2) +psliceByteStr (program 1.0.0 #afde5b) +eq (program 1.0.0 True) +semigroup.concats (program 1.0.0 #1234) +semigroup.laws.id.1 (program 1.0.0 True) +semigroup.laws.id.2 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.uplc.golden b/plutarch-test/goldens/bytestring.uplc.golden new file mode 100644 index 000000000..e111d8201 --- /dev/null +++ b/plutarch-test/goldens/bytestring.uplc.golden @@ -0,0 +1,10 @@ +empty (program 1.0.0 ((\i0 -> equalsByteString i1 i1) #)) +phexByteStr (program 1.0.0 ((\i0 -> equalsByteString i1 i1) #42abdfc9)) +plengthByteStr (program 1.0.0 (equalsInteger (lengthOfByteString #012f) 2)) +pconsBS (program 1.0.0 ((\i0 -> equalsInteger (lengthOfByteString (consByteString 91 i1)) (addInteger 1 (lengthOfByteString i1))) #48fcd1)) +pindexByteStr (program 1.0.0 (indexByteString #4102af 1)) +psliceByteStr (program 1.0.0 (sliceByteString 2 3 #4102afde5b2a)) +eq (program 1.0.0 ((\i0 -> equalsByteString i1 i1) #12)) +semigroup.concats (program 1.0.0 (appendByteString #12 #34)) +semigroup.laws.id.1 (program 1.0.0 ((\i0 -> equalsByteString (appendByteString # i1) i1) #12)) +semigroup.laws.id.2 (program 1.0.0 ((\i0 -> equalsByteString i1 (appendByteString # i1)) #12)) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index 510c5f9c6..bf6dca34a 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -8,6 +8,7 @@ import Plutarch.Test spec :: Spec spec = do + -- TODO: remove the `it`s describe "bool" $ do describe "pnot" $ do pgoldenSpec $ do @@ -17,10 +18,10 @@ spec = do it "false" $ (pnot #$ pcon PFalse) #@?= pcon PTrue describe "pand" $ do pgoldenSpec $ do - "tf" @> pcon PTrue #&& pcon PFalse @-> pshouldBe (pcon PFalse) - "ft" @> pcon PFalse #&& pcon PTrue @-> pshouldBe (pcon PFalse) + "tf" @> pcon PTrue #&& pcon PFalse @-> passertNot + "ft" @> pcon PFalse #&& pcon PTrue @-> passertNot "tt" @> pcon PTrue #&& pcon PTrue @-> passert - "ff" @> pcon PFalse #&& pcon PFalse @-> pshouldBe (pcon PFalse) + "ff" @> pcon PFalse #&& pcon PFalse @-> passertNot describe "laziness" $ do pgoldenSpec $ do "pand" @> pand # pcon PFalse # pdelay perror @-> \p -> diff --git a/plutarch-test/src/Plutarch/ByteStringSpec.hs b/plutarch-test/src/Plutarch/ByteStringSpec.hs index 3d2d4d92c..69c30b5ad 100644 --- a/plutarch-test/src/Plutarch/ByteStringSpec.hs +++ b/plutarch-test/src/Plutarch/ByteStringSpec.hs @@ -8,44 +8,31 @@ import Plutarch.Test spec :: Spec spec = do - describe "bytestring" $ do - it "empty" $ - passert $ mempty #== phexByteStr "" - describe "phexByteStr" $ do - let a :: [String] = ["42", "ab", "df", "c9"] - p = pconstant @PByteString (BS.pack $ map readByte a) #== phexByteStr (concat a) - golden Bench p - it "relation" $ passert p - describe "plengthByteStr" $ do - let p = (plengthBS # phexByteStr "012f") #== 2 - golden All p - it "works" $ passert p - describe "pconsBS" $ do - let xs = phexByteStr "48fCd1" - p = (plengthBS #$ pconsBS # 91 # xs) #== (1 + plengthBS # xs) - golden All p - it "works" $ passert p - describe "pindexByteStr" $ do - let p = (pindexBS # phexByteStr "4102af" # 1) #== pconstant @PInteger 0x02 - golden All p - it "works" $ passert p - describe "psliceByteStr" $ do - let p = (psliceBS # 2 # 3 # phexByteStr "4102afde5b2a") #== phexByteStr "afde5b" - golden All p - it "works" $ passert p - describe "eq" $ do - let p = phexByteStr "12" #== phexByteStr "12" - golden All p - it "works" $ passert p - describe "semigroup" $ do - let s1 = phexByteStr "12" - s2 = phexByteStr "34" - golden All $ s1 <> s2 - it "laws" $ do - passert $ (mempty <> s1) #== s1 - passert $ s1 #== (mempty <> s1) - it "concats" $ do - passert $ s1 <> s2 #== phexByteStr "1234" + describe "bytestring" . pgoldenSpec $ do + "empty" @> mempty #== phexByteStr "" @-> passert + "phexByteStr" + @> ( let a :: [String] = ["42", "ab", "df", "c9"] + in pconstant @PByteString (BS.pack $ map readByte a) #== phexByteStr (concat a) + ) + @-> passert + "plengthByteStr" @> (plengthBS # phexByteStr "012f") #== 2 @-> passert + "pconsBS" + @> ( let xs = phexByteStr "48fCd1" + in (plengthBS #$ pconsBS # 91 # xs) #== (1 + plengthBS # xs) + ) + @-> passert + "pindexByteStr" @> (pindexBS # phexByteStr "4102af" # 1) + @== pconstant @PInteger 0x02 + "psliceByteStr" @> (psliceBS # 2 # 3 # phexByteStr "4102afde5b2a") + @== phexByteStr "afde5b" + "eq" @> phexByteStr "12" #== phexByteStr "12" @-> passert + let s1 = phexByteStr "12" + s2 = phexByteStr "34" + "semigroup" @\ do + "concats" @> s1 <> s2 @== (phexByteStr "1234") + "laws" @\ do + "id.1" @> (mempty <> s1) #== s1 @-> passert + "id.2" @> s1 #== (mempty <> s1) @-> passert {- | Interpret a byte. diff --git a/plutarch-test/src/Plutarch/ListSpec.hs b/plutarch-test/src/Plutarch/ListSpec.hs index b71899a61..eff188001 100644 --- a/plutarch-test/src/Plutarch/ListSpec.hs +++ b/plutarch-test/src/Plutarch/ListSpec.hs @@ -15,12 +15,12 @@ spec = do let xs10 :: Term _ (PList PInteger) xs10 = integerList [1 .. 10] describe "type" . pgoldenSpec $ do - "phead" @> phead # xs10 @-> pshouldBe (pconstant @PInteger 1) - "ptail" @> ptail # xs10 @-> pshouldBe (integerList [2 .. 10]) + "phead" @> phead # xs10 @== pconstant @PInteger 1 + "ptail" @> ptail # xs10 @== integerList [2 .. 10] let matchP = pmatch (integerList [1, 3, 1]) $ \case PSNil -> perror PSCons x _ -> x - "pmatch" @> matchP @-> pshouldBe (pconstant @PInteger 1) + "pmatch" @> matchP @== pconstant @PInteger 1 describe "fun" . pgoldenSpec $ do "pnull" @\ do "empty" @> pnull # (integerList []) @-> passert @@ -28,27 +28,27 @@ spec = do "pconcat" @\ do let xs :: Term s (PList PInteger) xs = psingleton # (fromInteger @(Term _ PInteger) 0) - "identity" @> pconcat # xs # pnil @-> pshouldBe xs + "identity" @> pconcat # xs # pnil @== xs "pmap" @\ do "eg" @> pmap # (plam $ \x -> x + x) # xs10 - @-> pshouldBe (integerList $ fmap (* 2) [1 .. 10]) + @== (integerList $ fmap (* 2) [1 .. 10]) "identity" @> pmap @PList # (plam $ \(x :: Term _ PInteger) -> x) # pnil - @-> pshouldBe (pnil @PList) + @== pnil @PList "pfilter" @\ do "1" @> pfilter # (plam $ \x -> pmod # x # 2 #== 0) # xs10 - @-> pshouldBe (integerList [2, 4, 6, 8, 10]) + @== integerList [2, 4, 6, 8, 10] "2" @> pfilter # (plam $ \x -> 5 #< x) # xs10 - @-> pshouldBe (integerList [6 .. 10]) + @== integerList [6 .. 10] "pzipWith" @> pzipWith' (+) # xs10 # xs10 - @-> pshouldBe (integerList (fmap (* 2) [1 .. 10])) + @== (integerList (fmap (* 2) [1 .. 10])) "pfoldl" @\ do "primed" @\ do "nonempty" @> pfoldl' (-) # 0 # xs10 - @-> pshouldBe (pconstant @PInteger (foldl (-) 0 [1 .. 10])) + @== pconstant @PInteger (foldl (-) 0 [1 .. 10]) "empty" @> pfoldl' (-) # 0 # integerList [] - @-> pshouldBe (pconstant @PInteger 0) + @== pconstant @PInteger 0 "primed" @\ do "nonempty" @> pfoldl # plam (-) # 0 # xs10 - @-> pshouldBe (pconstant @PInteger (foldl (-) 0 [1 .. 10])) + @== pconstant @PInteger (foldl (-) 0 [1 .. 10]) "empty" @> pfoldl # plam (-) # 0 # integerList [] - @-> pshouldBe (pconstant @PInteger 0) + @== pconstant @PInteger 0 diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 4abb55b67..e9285f054 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -21,6 +21,7 @@ module Plutarch.Test ( (@>), (@\), (@->), + (@==), pgoldenSpec, PlutarchGolden (All, Bench, PrintTerm), getGoldenFilePrefix, @@ -132,6 +133,11 @@ pfails p = do Left _ -> pure () Right _ -> expectationFailure $ "Term succeeded" +{- Convenient alias for `@-> pshouldBe x` -} +(@==) :: Term s a -> ClosedTerm a -> TermExpectation s a +(@==) p x = p @-> pshouldBe x +infixr 1 @== + -- TODO: All the code below will be deleted, in favour of Golden.hs {- Whether to run all or a particular golden test @@ -161,6 +167,7 @@ hasPrintTermGolden = \case _ -> True {- Run golden tests on the given Plutarch program -} +-- {-# DEPRECATED golden "Use `pgoldenSpec` instead." #-} golden :: PlutarchGolden -> ClosedTerm a -> Spec golden pg p = goldens pg [("0", popaque p)] @@ -170,6 +177,8 @@ golden pg p = Multiple programs use a single golden file. Each output separated from the keyword with a space. -} + +-- {-# DEPRECATED goldens "Use `pgoldenSpec` instead." #-} goldens :: PlutarchGolden -> [(String, ClosedTerm a)] -> Spec goldens pg ps = do name <- getGoldenFilePrefix diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 37770e3e6..8363f9d93 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -5,6 +5,9 @@ module Plutarch.Test.Golden ( (@>), (@\), (@->), + + -- * Internal + TermExpectation, ) where import qualified Data.Aeson.Text as Aeson @@ -69,6 +72,7 @@ instance HasGoldenValue (Term s a) where -} data TermExpectation s a = TermExpectation (Term s a) (Term s a -> Expectation) +{- Test an expectation on a golden Plutarch program -} (@->) :: Term s a -> (ClosedTerm a -> Expectation) -> TermExpectation s a (@->) p f = TermExpectation p (\p' -> f $ unsafeClosedTerm p') infixr 1 @-> From 7f18c6bab2691ab9f853fe559a8f3b40076eab57 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 11:11:23 -0500 Subject: [PATCH 017/584] plutarch-benchmark: add HasCallStack --- plutarch-benchmark/src/Plutarch/Benchmark.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plutarch-benchmark/src/Plutarch/Benchmark.hs b/plutarch-benchmark/src/Plutarch/Benchmark.hs index 2d9201a0f..3bca257df 100644 --- a/plutarch-benchmark/src/Plutarch/Benchmark.hs +++ b/plutarch-benchmark/src/Plutarch/Benchmark.hs @@ -62,10 +62,10 @@ import qualified Plutus.V1.Ledger.Api as Plutus -------------------------------------------------------------------------------- -- | Benchmark the given script -benchmarkScript :: String -> Script -> NamedBenchmark +benchmarkScript :: HasCallStack => String -> Script -> NamedBenchmark benchmarkScript name = NamedBenchmark . (name,) . benchmarkScript' -benchmarkScript' :: Script -> Benchmark +benchmarkScript' :: HasCallStack => Script -> Benchmark benchmarkScript' = uncurry mkBenchmark . (evalScriptCounting &&& (fromInteger . toInteger . SBS.length)) . serialiseScriptShort where From 502ec9cbbcf681bd6b67f182c6822a31121b1ada Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 11:36:57 -0500 Subject: [PATCH 018/584] plutarch-benchmark: do not fail on script evaluation failure Instead null the benchmark fields. --- plutarch-benchmark/src/Plutarch/Benchmark.hs | 38 ++++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/plutarch-benchmark/src/Plutarch/Benchmark.hs b/plutarch-benchmark/src/Plutarch/Benchmark.hs index 3bca257df..689c023c5 100644 --- a/plutarch-benchmark/src/Plutarch/Benchmark.hs +++ b/plutarch-benchmark/src/Plutarch/Benchmark.hs @@ -69,24 +69,27 @@ benchmarkScript' :: HasCallStack => Script -> Benchmark benchmarkScript' = uncurry mkBenchmark . (evalScriptCounting &&& (fromInteger . toInteger . SBS.length)) . serialiseScriptShort where - mkBenchmark :: ExBudget -> Int64 -> Benchmark - mkBenchmark (ExBudget cpu mem) = Benchmark cpu mem . ScriptSizeBytes + mkBenchmark :: Maybe ExBudget -> Int64 -> Benchmark + mkBenchmark Nothing = + Benchmark Nothing Nothing . ScriptSizeBytes + mkBenchmark (Just (ExBudget cpu mem)) = + Benchmark (Just cpu) (Just mem) . ScriptSizeBytes serialiseScriptShort :: Script -> SBS.ShortByteString serialiseScriptShort = SBS.toShort . LB.toStrict . serialise -- Using `flat` here breaks `evalScriptCounting` - evalScriptCounting :: HasCallStack => Plutus.SerializedScript -> Plutus.ExBudget + evalScriptCounting :: HasCallStack => Plutus.SerializedScript -> Maybe Plutus.ExBudget evalScriptCounting script = let costModel = fromJust Plutus.defaultCostModelParams (_logout, e) = Plutus.evaluateScriptCounting Plutus.Verbose costModel script [] in case e of - Left evalErr -> error ("Eval Error: " <> show evalErr) - Right exbudget -> exbudget + Left _evalErr -> Nothing + Right exbudget -> Just exbudget data Benchmark = Benchmark - { exBudgetCPU :: ExCPU - -- ^ CPU budget used by the script - , exBudgetMemory :: ExMemory - -- ^ Memory budget used by the script + { exBudgetCPU :: Maybe ExCPU + -- ^ CPU budget used by the script. Nothing if script errors. + , exBudgetMemory :: Maybe ExMemory + -- ^ Memory budget used by the script. Nothing if script errors. , scriptSizeBytes :: ScriptSizeBytes -- ^ Size of Plutus script in bytes } @@ -132,13 +135,14 @@ decodeBenchmarks :: LB.ByteString -> Either String [NamedBenchmark] decodeBenchmarks = let (#!) :: Num a => Vector Csv.Field -> Int -> Csv.Parser a (#!) v f = fmap fromInteger . Csv.parseField $ v ! f + mkBenchmark cpu mem sz = Benchmark (Just cpu) (Just mem) sz in fmap Vector.toList <$> Csv.decodeWithP ( \case v | length v == 4 -> fmap NamedBenchmark $ - (,) <$> v .! 0 <*> (Benchmark <$> v #! 1 <*> v #! 2 <*> v #! 3) + (,) <$> v .! 0 <*> (mkBenchmark <$> v #! 1 <*> v #! 2 <*> v #! 3) _ | otherwise -> mzero ) Csv.defaultDecodeOptions @@ -158,11 +162,11 @@ data BenchmarkDiff = BenchmarkDiff } deriving stock (Show, Generic) -diffBenchmark :: String -> Benchmark -> Benchmark -> Maybe BenchmarkDiff +diffBenchmark :: HasCallStack => String -> Benchmark -> Benchmark -> Maybe BenchmarkDiff diffBenchmark name - (Benchmark (ExCPU oldCpu) (ExMemory oldMem) (ScriptSizeBytes oldSize)) - new@(Benchmark (ExCPU cpu) (ExMemory mem) (ScriptSizeBytes size)) + (Benchmark (Just (ExCPU oldCpu)) (Just (ExMemory oldMem)) (ScriptSizeBytes oldSize)) + new@(Benchmark (Just (ExCPU cpu)) (Just (ExMemory mem)) (ScriptSizeBytes size)) | oldCpu /= cpu || oldMem /= mem || oldSize /= size = let pctChange old new = softRound (fromInteger (toInteger new - toInteger old) / fromInteger (toInteger $ max old new) * 100) @@ -174,6 +178,8 @@ diffBenchmark , name = name } | otherwise = Nothing +diffBenchmark _ _ _ = + error "Null cpu/mem benchmarks" diffBenchmarks :: [NamedBenchmark] -> [NamedBenchmark] -> BenchmarkDiffs diffBenchmarks (Map.fromList . coerce -> old) (Map.fromList . coerce -> new) = @@ -199,13 +205,15 @@ renderDiffTable (BenchmarkDiffs dropped changed added) = [B.text $ show old <> "(" <> tag <> ")", renderChange diff] renderBenchmarkDiff :: BenchmarkDiff -> [B.Box] - renderBenchmarkDiff (BenchmarkDiff (Benchmark (ExCPU x) (ExMemory y) (ScriptSizeBytes z)) (dx, dy, dz) name) = + renderBenchmarkDiff (BenchmarkDiff (Benchmark (Just (ExCPU x)) (Just (ExMemory y)) (ScriptSizeBytes z)) (dx, dy, dz) name) = mconcat [ [B.text name] , renderResult x dx "cpu" , renderResult y dy "mem" , renderResult z dz "bytes" ] + renderBenchmarkDiff _ = + error "Null cpu/mem benchmarks" in B.vsep 1 B.top @@ -229,7 +237,7 @@ renderBudgetTable bs = , B.text $ show mem <> "(mem)" , B.text $ show sz <> "(bytes)" ] - | NamedBenchmark (name, Benchmark (ExCPU cpu) (ExMemory mem) (ScriptSizeBytes sz)) <- bs + | NamedBenchmark (name, Benchmark (Just (ExCPU cpu)) (Just (ExMemory mem)) (ScriptSizeBytes sz)) <- bs ] benchMain :: [NamedBenchmark] -> IO () From 577797ea5cee79166e7228b6a78b8ed0d257a1f5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 11:40:25 -0500 Subject: [PATCH 019/584] Port ApiSpec, except for ctx printTerm --- plutarch-test/goldens/api.ctx.bench.golden | 4 ++ .../api.ctx.get.credentials.bench.golden | 1 - .../api.ctx.get.credentials.uplc.eval.golden | 1 - .../api.ctx.get.credentials.uplc.golden | 1 - .../goldens/api.ctx.get.mint.bench.golden | 1 - .../goldens/api.ctx.get.mint.uplc.eval.golden | 1 - .../goldens/api.ctx.get.mint.uplc.golden | 1 - .../goldens/api.ctx.get.sym.bench.golden | 1 - .../goldens/api.ctx.get.sym.uplc.eval.golden | 1 - .../goldens/api.ctx.get.sym.uplc.golden | 1 - .../goldens/api.ctx.get.txInfo.bench.golden | 1 - .../api.ctx.get.txInfo.uplc.eval.golden | 1 - .../goldens/api.ctx.get.txInfo.uplc.golden | 1 - .../api.ctx.printTerm.uplc.eval.golden | 1 + .../goldens/api.ctx.printTerm.uplc.golden | 1 + .../goldens/api.ctx.uplc.eval.golden | 5 +- plutarch-test/goldens/api.ctx.uplc.golden | 5 +- .../api.example.getFields.bench.golden | 2 +- .../api.example.getFields.uplc.eval.golden | 2 +- .../goldens/api.example.getFields.uplc.golden | 2 +- ...i.example.signatory.dev=false.bench.golden | 4 ++ ...mple.signatory.dev=false.cont.bench.golden | 1 - ....signatory.dev=false.cont.uplc.eval.golden | 1 - ...ample.signatory.dev=false.cont.uplc.golden | 1 - ....signatory.dev=false.termcont.bench.golden | 1 - ...natory.dev=false.termcont.uplc.eval.golden | 1 - ...e.signatory.dev=false.termcont.uplc.golden | 1 - ...ample.signatory.dev=false.uplc.eval.golden | 4 ++ ...pi.example.signatory.dev=false.uplc.golden | 4 ++ ...pi.example.signatory.dev=true.bench.golden | 4 ++ ...ample.signatory.dev=true.cont.bench.golden | 1 - ...e.signatory.dev=true.cont.uplc.eval.golden | 1 - ...xample.signatory.dev=true.cont.uplc.golden | 1 - ...e.signatory.dev=true.termcont.bench.golden | 1 - ...gnatory.dev=true.termcont.uplc.eval.golden | 1 - ...le.signatory.dev=true.termcont.uplc.golden | 1 - ...xample.signatory.dev=true.uplc.eval.golden | 4 ++ ...api.example.signatory.dev=true.uplc.golden | 4 ++ plutarch-test/src/Plutarch/ApiSpec.hs | 53 +++++++------------ 39 files changed, 61 insertions(+), 62 deletions(-) create mode 100644 plutarch-test/goldens/api.ctx.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.credentials.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.credentials.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.credentials.uplc.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.mint.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.mint.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.mint.uplc.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.sym.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.sym.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.sym.uplc.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.txInfo.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.txInfo.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.txInfo.uplc.golden create mode 100644 plutarch-test/goldens/api.ctx.printTerm.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.ctx.printTerm.uplc.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.cont.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.termcont.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.cont.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden diff --git a/plutarch-test/goldens/api.ctx.bench.golden b/plutarch-test/goldens/api.ctx.bench.golden new file mode 100644 index 000000000..8276a8ae2 --- /dev/null +++ b/plutarch-test/goldens/api.ctx.bench.golden @@ -0,0 +1,4 @@ +get.txInfo {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} +get.mint {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} +get.credentials {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} +get.sym {"exBudgetCPU":3825799,"exBudgetMemory":6816,"scriptSizeBytes":188} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.credentials.bench.golden b/plutarch-test/goldens/api.ctx.get.credentials.bench.golden deleted file mode 100644 index d158e9e3f..000000000 --- a/plutarch-test/goldens/api.ctx.get.credentials.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.credentials.uplc.eval.golden b/plutarch-test/goldens/api.ctx.get.credentials.uplc.eval.golden deleted file mode 100644 index 761dcf417..000000000 --- a/plutarch-test/goldens/api.ctx.get.credentials.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 [#41a1]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.credentials.uplc.golden b/plutarch-test/goldens/api.ctx.get.credentials.uplc.golden deleted file mode 100644 index bffa1ca61..000000000 --- a/plutarch-test/goldens/api.ctx.get.credentials.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (i5 i1)) (i2 (i4 i1))))))) (\i0 -> i3 (i5 (unConstrData ((\i0 -> i4 (i5 i1)) ((\i0 -> i4 (i5 i1)) (i3 (i2 (i4 i1)))))))) ((\i0 -> unListData (i3 (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.mint.bench.golden b/plutarch-test/goldens/api.ctx.get.mint.bench.golden deleted file mode 100644 index 45672ad50..000000000 --- a/plutarch-test/goldens/api.ctx.get.mint.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.mint.uplc.eval.golden b/plutarch-test/goldens/api.ctx.get.mint.uplc.eval.golden deleted file mode 100644 index 3a63e9a6d..000000000 --- a/plutarch-test/goldens/api.ctx.get.mint.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #a141c0a149736f6d65746f6b656e01) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.mint.uplc.golden b/plutarch-test/goldens/api.ctx.get.mint.uplc.golden deleted file mode 100644 index 9dc0fb79f..000000000 --- a/plutarch-test/goldens/api.ctx.get.mint.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.sym.bench.golden b/plutarch-test/goldens/api.ctx.get.sym.bench.golden deleted file mode 100644 index 4964f58c5..000000000 --- a/plutarch-test/goldens/api.ctx.get.sym.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":3825799,"exBudgetMemory":6816,"scriptSizeBytes":188} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.sym.uplc.eval.golden b/plutarch-test/goldens/api.ctx.get.sym.uplc.eval.golden deleted file mode 100644 index 92ecc58c0..000000000 --- a/plutarch-test/goldens/api.ctx.get.sym.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #c0) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.sym.uplc.golden b/plutarch-test/goldens/api.ctx.get.sym.uplc.golden deleted file mode 100644 index ad9dfedcc..000000000 --- a/plutarch-test/goldens/api.ctx.get.sym.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> force (force fstPair) (i3 i1)) (unMapData ((\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.txInfo.bench.golden b/plutarch-test/goldens/api.ctx.get.txInfo.bench.golden deleted file mode 100644 index bd11f8ac9..000000000 --- a/plutarch-test/goldens/api.ctx.get.txInfo.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.txInfo.uplc.eval.golden b/plutarch-test/goldens/api.ctx.get.txInfo.uplc.eval.golden deleted file mode 100644 index 5d2ba94aa..000000000 --- a/plutarch-test/goldens/api.ctx.get.txInfo.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #d8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffff) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.txInfo.uplc.golden b/plutarch-test/goldens/api.ctx.get.txInfo.uplc.golden deleted file mode 100644 index 91bc4fa02..000000000 --- a/plutarch-test/goldens/api.ctx.get.txInfo.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.printTerm.uplc.eval.golden b/plutarch-test/goldens/api.ctx.printTerm.uplc.eval.golden new file mode 100644 index 000000000..6d009b355 --- /dev/null +++ b/plutarch-test/goldens/api.ctx.printTerm.uplc.eval.golden @@ -0,0 +1 @@ +0 (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.printTerm.uplc.golden b/plutarch-test/goldens/api.ctx.printTerm.uplc.golden new file mode 100644 index 000000000..6d009b355 --- /dev/null +++ b/plutarch-test/goldens/api.ctx.printTerm.uplc.golden @@ -0,0 +1 @@ +0 (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.uplc.eval.golden b/plutarch-test/goldens/api.ctx.uplc.eval.golden index 6d009b355..343bb35ba 100644 --- a/plutarch-test/goldens/api.ctx.uplc.eval.golden +++ b/plutarch-test/goldens/api.ctx.uplc.eval.golden @@ -1 +1,4 @@ -0 (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) \ No newline at end of file +get.txInfo (program 1.0.0 #d8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffff) +get.mint (program 1.0.0 #a141c0a149736f6d65746f6b656e01) +get.credentials (program 1.0.0 [#41a1]) +get.sym (program 1.0.0 #c0) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.uplc.golden b/plutarch-test/goldens/api.ctx.uplc.golden index 6d009b355..9e0a6ebd1 100644 --- a/plutarch-test/goldens/api.ctx.uplc.golden +++ b/plutarch-test/goldens/api.ctx.uplc.golden @@ -1 +1,4 @@ -0 (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) \ No newline at end of file +get.txInfo (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) +get.mint (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +get.credentials (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (i5 i1)) (i2 (i4 i1))))))) (\i0 -> i3 (i5 (unConstrData ((\i0 -> i4 (i5 i1)) ((\i0 -> i4 (i5 i1)) (i3 (i2 (i4 i1)))))))) ((\i0 -> unListData (i3 (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +get.sym (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> force (force fstPair) (i3 i1)) (unMapData ((\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.getFields.bench.golden b/plutarch-test/goldens/api.example.getFields.bench.golden index b8e62d0c1..0180cc841 100644 --- a/plutarch-test/goldens/api.example.getFields.bench.golden +++ b/plutarch-test/goldens/api.example.getFields.bench.golden @@ -1 +1 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file +1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.getFields.uplc.eval.golden b/plutarch-test/goldens/api.example.getFields.uplc.eval.golden index 4ce239055..55ff402af 100644 --- a/plutarch-test/goldens/api.example.getFields.uplc.eval.golden +++ b/plutarch-test/goldens/api.example.getFields.uplc.eval.golden @@ -1 +1 @@ -0 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file +1 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.getFields.uplc.golden b/plutarch-test/goldens/api.example.getFields.uplc.golden index 4ce239055..55ff402af 100644 --- a/plutarch-test/goldens/api.example.getFields.uplc.golden +++ b/plutarch-test/goldens/api.example.getFields.uplc.golden @@ -1 +1 @@ -0 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file +1 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden new file mode 100644 index 000000000..bd78bd7bc --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden @@ -0,0 +1,4 @@ +cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} +cont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":286} +termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} +termcont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.cont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=false.cont.bench.golden deleted file mode 100644 index 8705ffc87..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.cont.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.golden deleted file mode 100644 index d8097f169..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=false.termcont.bench.golden deleted file mode 100644 index 8705ffc87..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.golden deleted file mode 100644 index ed510fea3..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden new file mode 100644 index 000000000..0070757cf --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ()) +cont.fails (program 1.0.0 error) +termcont.succeeds (program 1.0.0 ()) +termcont.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden new file mode 100644 index 000000000..7745ac73b --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden new file mode 100644 index 000000000..e18bb58d1 --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden @@ -0,0 +1,4 @@ +cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} +cont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":331} +termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":322} +termcont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":318} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.cont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.cont.bench.golden deleted file mode 100644 index 33f6ffc2d..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.cont.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.golden deleted file mode 100644 index 4946be45e..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden deleted file mode 100644 index 69a50fe95..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":322} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden deleted file mode 100644 index 670119686..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden new file mode 100644 index 000000000..0070757cf --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ()) +cont.fails (program 1.0.0 error) +termcont.succeeds (program 1.0.0 ()) +termcont.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden new file mode 100644 index 000000000..5291c1592 --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index db50c3131..0175701d6 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -26,44 +26,31 @@ spec :: Spec spec = do describe "api" $ do describe "ctx" $ do - golden PrintTerm ctx - describe "get" $ do - describe "txInfo" $ do - let p = pfromData $ getTxInfo # ctx - golden All p - it "works" $ plift p @?= info - describe "mint" $ do - let p = pforgetData $ getMint #$ getTxInfo # ctx - golden All p - it "works" $ plift p @?= toData mint - describe "credentials" $ do - let p = getCredentials ctx - golden All p - it "works" $ plift p @?= [toData validator] - describe "sym" $ do - let p = pfromData $ getSym #$ pfromData $ getMint #$ getTxInfo # ctx - golden All p - it "works" $ plift p @?= sym + describe "printTerm" $ golden PrintTerm ctx -- TODO + pgoldenSpec $ do + "get" @\ do + "txInfo" @> pfromData (getTxInfo # ctx) @-> \p -> + plift p @?= info + "mint" @> pforgetData (getMint #$ getTxInfo # ctx) @-> \p -> + plift p @?= toData mint + "credentials" @> getCredentials ctx @-> \p -> + plift p @?= [toData validator] + "sym" @> pfromData (getSym #$ pfromData $ getMint #$ getTxInfo # ctx) @-> \p -> + plift p @?= sym describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. -- See Plutarch.MonadicSpec for GHC9 only syntax. - describe "signatory" . plutarchDevFlagDescribe $ do + describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" - describe "cont" $ do - let p = checkSignatoryCont # pconstant aSig # ctx - pe = checkSignatoryCont # pconstant "41" # ctx - golden All p - it "succeeds" $ psucceeds p - it "fails" $ pfails pe - describe "termcont" $ do - let p = checkSignatoryTermCont # pconstant aSig # ctx - pe = checkSignatoryTermCont # pconstant "41" # ctx - golden All p - it "succeeds" $ psucceeds p - it "fails" $ pfails pe - describe "getFields" $ - golden All getFields + "cont" @\ do + "succeeds" @> checkSignatoryCont # pconstant aSig # ctx @-> psucceeds + "fails" @> checkSignatoryCont # pconstant "41" # ctx @-> pfails + "termcont" @\ do + "succeeds" @> checkSignatoryTermCont # pconstant aSig # ctx @-> psucceeds + "fails" @> checkSignatoryTermCont # pconstant "41" # ctx @-> pfails + describe "getFields" . pgoldenSpec $ do + "1" @> getFields -------------------------------------------------------------------------------- From 5203e813cd5879f1b7e7d28b1363ed7e69bf9e22 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 11:55:21 -0500 Subject: [PATCH 020/584] Port FieldSpec --- plutarch-test/goldens/api.ctx.bench.golden | 1 + .../api.ctx.printTerm.uplc.eval.golden | 1 - .../goldens/api.ctx.printTerm.uplc.golden | 1 - .../goldens/api.ctx.uplc.eval.golden | 1 + plutarch-test/goldens/api.ctx.uplc.golden | 1 + .../goldens/field.dropFields.bench.golden | 2 + .../field.dropFields.dropFields.bench.golden | 1 - ...eld.dropFields.dropFields.uplc.eval.golden | 1 - .../field.dropFields.dropFields.uplc.golden | 1 - .../goldens/field.dropFields.uplc.eval.golden | 2 + .../goldens/field.dropFields.uplc.golden | 11 +++ .../goldens/field.other.bench.golden | 2 + .../goldens/field.other.uplc.eval.golden | 2 + plutarch-test/goldens/field.other.uplc.golden | 2 + .../goldens/field.pletFields.bench.golden | 5 ++ ...ield.pletFields.letSomeFields.bench.golden | 1 - ....pletFields.letSomeFields.uplc.eval.golden | 1 - ...field.pletFields.letSomeFields.uplc.golden | 1 - .../field.pletFields.nFields.bench.golden | 1 - .../field.pletFields.nFields.uplc.eval.golden | 1 - .../field.pletFields.nFields.uplc.golden | 1 - .../goldens/field.pletFields.uplc.eval.golden | 5 ++ .../goldens/field.pletFields.uplc.golden | 23 +++++ .../goldens/field.rangeFields.bench.golden | 2 + ...field.rangeFields.rangeFields.bench.golden | 1 - ...d.rangeFields.rangeFields.uplc.eval.golden | 1 - .../field.rangeFields.rangeFields.uplc.golden | 1 - .../field.rangeFields.uplc.eval.golden | 2 + .../goldens/field.rangeFields.uplc.golden | 11 +++ .../goldens/field.trips.bench.golden | 7 ++ .../goldens/field.trips.getY.bench.golden | 1 - .../goldens/field.trips.getY.uplc.eval.golden | 1 - .../goldens/field.trips.getY.uplc.golden | 1 - .../goldens/field.trips.tripSum.bench.golden | 1 - .../field.trips.tripSum.uplc.eval.golden | 1 - .../goldens/field.trips.tripSum.uplc.golden | 1 - .../goldens/field.trips.tripYZ.bench.golden | 1 - .../field.trips.tripYZ.uplc.eval.golden | 1 - .../goldens/field.trips.tripYZ.uplc.golden | 1 - .../goldens/field.trips.uplc.eval.golden | 7 ++ plutarch-test/goldens/field.trips.uplc.golden | 7 ++ plutarch-test/src/Plutarch/ApiSpec.hs | 2 +- plutarch-test/src/Plutarch/FieldSpec.hs | 85 +++++++------------ 43 files changed, 124 insertions(+), 79 deletions(-) delete mode 100644 plutarch-test/goldens/api.ctx.printTerm.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.ctx.printTerm.uplc.golden create mode 100644 plutarch-test/goldens/field.dropFields.bench.golden delete mode 100644 plutarch-test/goldens/field.dropFields.dropFields.bench.golden delete mode 100644 plutarch-test/goldens/field.dropFields.dropFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.dropFields.dropFields.uplc.golden create mode 100644 plutarch-test/goldens/field.dropFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.dropFields.uplc.golden create mode 100644 plutarch-test/goldens/field.other.bench.golden create mode 100644 plutarch-test/goldens/field.other.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.other.uplc.golden create mode 100644 plutarch-test/goldens/field.pletFields.bench.golden delete mode 100644 plutarch-test/goldens/field.pletFields.letSomeFields.bench.golden delete mode 100644 plutarch-test/goldens/field.pletFields.letSomeFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.pletFields.letSomeFields.uplc.golden delete mode 100644 plutarch-test/goldens/field.pletFields.nFields.bench.golden delete mode 100644 plutarch-test/goldens/field.pletFields.nFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.pletFields.nFields.uplc.golden create mode 100644 plutarch-test/goldens/field.pletFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.pletFields.uplc.golden create mode 100644 plutarch-test/goldens/field.rangeFields.bench.golden delete mode 100644 plutarch-test/goldens/field.rangeFields.rangeFields.bench.golden delete mode 100644 plutarch-test/goldens/field.rangeFields.rangeFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.rangeFields.rangeFields.uplc.golden create mode 100644 plutarch-test/goldens/field.rangeFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.rangeFields.uplc.golden create mode 100644 plutarch-test/goldens/field.trips.bench.golden delete mode 100644 plutarch-test/goldens/field.trips.getY.bench.golden delete mode 100644 plutarch-test/goldens/field.trips.getY.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.trips.getY.uplc.golden delete mode 100644 plutarch-test/goldens/field.trips.tripSum.bench.golden delete mode 100644 plutarch-test/goldens/field.trips.tripSum.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.trips.tripSum.uplc.golden delete mode 100644 plutarch-test/goldens/field.trips.tripYZ.bench.golden delete mode 100644 plutarch-test/goldens/field.trips.tripYZ.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.trips.tripYZ.uplc.golden create mode 100644 plutarch-test/goldens/field.trips.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.trips.uplc.golden diff --git a/plutarch-test/goldens/api.ctx.bench.golden b/plutarch-test/goldens/api.ctx.bench.golden index 8276a8ae2..2b2d7de30 100644 --- a/plutarch-test/goldens/api.ctx.bench.golden +++ b/plutarch-test/goldens/api.ctx.bench.golden @@ -1,3 +1,4 @@ +term {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":140} get.txInfo {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} get.mint {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} get.credentials {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} diff --git a/plutarch-test/goldens/api.ctx.printTerm.uplc.eval.golden b/plutarch-test/goldens/api.ctx.printTerm.uplc.eval.golden deleted file mode 100644 index 6d009b355..000000000 --- a/plutarch-test/goldens/api.ctx.printTerm.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.printTerm.uplc.golden b/plutarch-test/goldens/api.ctx.printTerm.uplc.golden deleted file mode 100644 index 6d009b355..000000000 --- a/plutarch-test/goldens/api.ctx.printTerm.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.uplc.eval.golden b/plutarch-test/goldens/api.ctx.uplc.eval.golden index 343bb35ba..67a563998 100644 --- a/plutarch-test/goldens/api.ctx.uplc.eval.golden +++ b/plutarch-test/goldens/api.ctx.uplc.eval.golden @@ -1,3 +1,4 @@ +term (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) get.txInfo (program 1.0.0 #d8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffff) get.mint (program 1.0.0 #a141c0a149736f6d65746f6b656e01) get.credentials (program 1.0.0 [#41a1]) diff --git a/plutarch-test/goldens/api.ctx.uplc.golden b/plutarch-test/goldens/api.ctx.uplc.golden index 9e0a6ebd1..ed8772fa0 100644 --- a/plutarch-test/goldens/api.ctx.uplc.golden +++ b/plutarch-test/goldens/api.ctx.uplc.golden @@ -1,3 +1,4 @@ +term (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) get.txInfo (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) get.mint (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) get.credentials (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (i5 i1)) (i2 (i4 i1))))))) (\i0 -> i3 (i5 (unConstrData ((\i0 -> i4 (i5 i1)) ((\i0 -> i4 (i5 i1)) (i3 (i2 (i4 i1)))))))) ((\i0 -> unListData (i3 (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) diff --git a/plutarch-test/goldens/field.dropFields.bench.golden b/plutarch-test/goldens/field.dropFields.bench.golden new file mode 100644 index 000000000..48a962abf --- /dev/null +++ b/plutarch-test/goldens/field.dropFields.bench.golden @@ -0,0 +1,2 @@ +lam {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":45} +app {"exBudgetCPU":3487094,"exBudgetMemory":5018,"scriptSizeBytes":88} \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.dropFields.bench.golden b/plutarch-test/goldens/field.dropFields.dropFields.bench.golden deleted file mode 100644 index b73ce5d12..000000000 --- a/plutarch-test/goldens/field.dropFields.dropFields.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":45} \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.dropFields.uplc.eval.golden b/plutarch-test/goldens/field.dropFields.dropFields.uplc.eval.golden deleted file mode 100644 index 1e995ba0a..000000000 --- a/plutarch-test/goldens/field.dropFields.dropFields.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1)))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.dropFields.uplc.golden b/plutarch-test/goldens/field.dropFields.dropFields.uplc.golden deleted file mode 100644 index 27bbee0a2..000000000 --- a/plutarch-test/goldens/field.dropFields.dropFields.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.uplc.eval.golden b/plutarch-test/goldens/field.dropFields.uplc.eval.golden new file mode 100644 index 000000000..e4e3ead44 --- /dev/null +++ b/plutarch-test/goldens/field.dropFields.uplc.eval.golden @@ -0,0 +1,2 @@ +lam (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1)))))))))) +app (program 1.0.0 17) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.uplc.golden b/plutarch-test/goldens/field.dropFields.uplc.golden new file mode 100644 index 000000000..5541a25de --- /dev/null +++ b/plutarch-test/goldens/field.dropFields.uplc.golden @@ -0,0 +1,11 @@ +lam (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) (force headList)) (force tailList))) +app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.bench.golden b/plutarch-test/goldens/field.other.bench.golden new file mode 100644 index 000000000..5dc766302 --- /dev/null +++ b/plutarch-test/goldens/field.other.bench.golden @@ -0,0 +1,2 @@ +by {"exBudgetCPU":3110112,"exBudgetMemory":4884,"scriptSizeBytes":49} +dotPlus {"exBudgetCPU":17921705,"exBudgetMemory":26900,"scriptSizeBytes":239} \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.uplc.eval.golden b/plutarch-test/goldens/field.other.uplc.eval.golden new file mode 100644 index 000000000..b53a90f6a --- /dev/null +++ b/plutarch-test/goldens/field.other.uplc.eval.golden @@ -0,0 +1,2 @@ +by (program 1.0.0 10) +dotPlus (program 1.0.0 19010) \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.uplc.golden b/plutarch-test/goldens/field.other.uplc.golden new file mode 100644 index 000000000..c99ec4f08 --- /dev/null +++ b/plutarch-test/goldens/field.other.uplc.golden @@ -0,0 +1,2 @@ +by (program 1.0.0 ((\i0 -> (\i0 -> unIData (force headList (force tailList (force (force sndPair) (unConstrData i1))))) (constrData 0 (i1 (iData 50) (i1 (iData 10) (i1 (iData 40) [ ]))))) (force mkCons))) +dotPlus (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (addInteger (addInteger (addInteger (multiplyInteger (unIData (i9 i6)) (unIData (i9 i4))) (multiplyInteger (unIData (i9 i5)) (unIData (i9 i3)))) (multiplyInteger (unIData (i9 (i10 i5))) (unIData (i9 (i10 i3))))) (unIData (i9 i2))) (unIData (i9 i1))) (unIData (i9 (i10 i1)))) (i9 i1)) (i9 (i7 (i8 i5)))) (i7 i1)) (i7 (i5 i3))) (i5 i1)) (i5 (i3 i2))) (i3 i1)) (i3 (constrData 0 (i5 (constrData 0 (i5 (iData 150) (i5 (iData 750) (i5 (iData 100) i6)))) (i5 (constrData 0 (i5 (iData 50) (i5 (iData 10) (i5 (iData 40) i6)))) (i5 (constrData 0 (i5 (iData 1) (i5 (iData 8) (i5 (iData 1) i6)))) i6)))))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.bench.golden b/plutarch-test/goldens/field.pletFields.bench.golden new file mode 100644 index 000000000..b31518bc3 --- /dev/null +++ b/plutarch-test/goldens/field.pletFields.bench.golden @@ -0,0 +1,5 @@ +letSomeFields.lam {"exBudgetCPU":357376,"exBudgetMemory":1300,"scriptSizeBytes":55} +letSomeFields.order {"exBudgetCPU":357376,"exBudgetMemory":1300,"scriptSizeBytes":55} +letSomeFields.app {"exBudgetCPU":4160671,"exBudgetMemory":6620,"scriptSizeBytes":97} +nFields.lam {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":23} +nFields.app {"exBudgetCPU":1632088,"exBudgetMemory":2562,"scriptSizeBytes":68} \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.letSomeFields.bench.golden b/plutarch-test/goldens/field.pletFields.letSomeFields.bench.golden deleted file mode 100644 index 8d91d0b6d..000000000 --- a/plutarch-test/goldens/field.pletFields.letSomeFields.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":357376,"exBudgetMemory":1300,"scriptSizeBytes":55} \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.eval.golden b/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.eval.golden deleted file mode 100644 index f7ace1ee9..000000000 --- a/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.golden b/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.golden deleted file mode 100644 index cf5502e85..000000000 --- a/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.nFields.bench.golden b/plutarch-test/goldens/field.pletFields.nFields.bench.golden deleted file mode 100644 index ba69e6b7f..000000000 --- a/plutarch-test/goldens/field.pletFields.nFields.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":23} \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.nFields.uplc.eval.golden b/plutarch-test/goldens/field.pletFields.nFields.uplc.eval.golden deleted file mode 100644 index 8c9a58f82..000000000 --- a/plutarch-test/goldens/field.pletFields.nFields.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.nFields.uplc.golden b/plutarch-test/goldens/field.pletFields.nFields.uplc.golden deleted file mode 100644 index f973921a7..000000000 --- a/plutarch-test/goldens/field.pletFields.nFields.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> \i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) (force headList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.uplc.eval.golden b/plutarch-test/goldens/field.pletFields.uplc.eval.golden new file mode 100644 index 000000000..395124ffd --- /dev/null +++ b/plutarch-test/goldens/field.pletFields.uplc.eval.golden @@ -0,0 +1,5 @@ +letSomeFields.lam (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) +letSomeFields.order (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) +letSomeFields.app (program 1.0.0 14) +nFields.lam (program 1.0.0 (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1))))) +nFields.app (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.uplc.golden b/plutarch-test/goldens/field.pletFields.uplc.golden new file mode 100644 index 000000000..44ba7ab72 --- /dev/null +++ b/plutarch-test/goldens/field.pletFields.uplc.golden @@ -0,0 +1,23 @@ +letSomeFields.lam (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) +letSomeFields.order (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) +letSomeFields.app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) +nFields.lam (program 1.0.0 ((\i0 -> \i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) (force headList))) +nFields.app (program 1.0.0 ((\i0 -> (\i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.bench.golden b/plutarch-test/goldens/field.rangeFields.bench.golden new file mode 100644 index 000000000..de23c31f9 --- /dev/null +++ b/plutarch-test/goldens/field.rangeFields.bench.golden @@ -0,0 +1,2 @@ +lam {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":39} +app {"exBudgetCPU":2858456,"exBudgetMemory":4322,"scriptSizeBytes":82} \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.rangeFields.bench.golden b/plutarch-test/goldens/field.rangeFields.rangeFields.bench.golden deleted file mode 100644 index d3b27bdbd..000000000 --- a/plutarch-test/goldens/field.rangeFields.rangeFields.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":39} \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.eval.golden b/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.eval.golden deleted file mode 100644 index 879beed7e..000000000 --- a/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.golden b/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.golden deleted file mode 100644 index 0f9952f7a..000000000 --- a/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.uplc.eval.golden b/plutarch-test/goldens/field.rangeFields.uplc.eval.golden new file mode 100644 index 000000000..16b4687d3 --- /dev/null +++ b/plutarch-test/goldens/field.rangeFields.uplc.eval.golden @@ -0,0 +1,2 @@ +lam (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) +app (program 1.0.0 11) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.uplc.golden b/plutarch-test/goldens/field.rangeFields.uplc.golden new file mode 100644 index 000000000..1161c974b --- /dev/null +++ b/plutarch-test/goldens/field.rangeFields.uplc.golden @@ -0,0 +1,11 @@ +lam (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) (force headList)) (force tailList))) +app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.bench.golden b/plutarch-test/goldens/field.trips.bench.golden new file mode 100644 index 000000000..c3d97a005 --- /dev/null +++ b/plutarch-test/goldens/field.trips.bench.golden @@ -0,0 +1,7 @@ +lam.tripSum {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":46} +lam.getY {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} +lam.tripYZ {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":36} +tripSum.A {"exBudgetCPU":5147720,"exBudgetMemory":8048,"scriptSizeBytes":80} +tripSum.B {"exBudgetCPU":5147720,"exBudgetMemory":8048,"scriptSizeBytes":77} +tripSum.C {"exBudgetCPU":5147720,"exBudgetMemory":8048,"scriptSizeBytes":77} +tripYZ=tripZY {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":36} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.getY.bench.golden b/plutarch-test/goldens/field.trips.getY.bench.golden deleted file mode 100644 index 98f9bc333..000000000 --- a/plutarch-test/goldens/field.trips.getY.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.getY.uplc.eval.golden b/plutarch-test/goldens/field.trips.getY.uplc.eval.golden deleted file mode 100644 index 4afac955e..000000000 --- a/plutarch-test/goldens/field.trips.getY.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.getY.uplc.golden b/plutarch-test/goldens/field.trips.getY.uplc.golden deleted file mode 100644 index 4afac955e..000000000 --- a/plutarch-test/goldens/field.trips.getY.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripSum.bench.golden b/plutarch-test/goldens/field.trips.tripSum.bench.golden deleted file mode 100644 index 7902ff61e..000000000 --- a/plutarch-test/goldens/field.trips.tripSum.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":46} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripSum.uplc.eval.golden b/plutarch-test/goldens/field.trips.tripSum.uplc.eval.golden deleted file mode 100644 index 9322cb241..000000000 --- a/plutarch-test/goldens/field.trips.tripSum.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList (force tailList i1)))) (force tailList i1)) (force (force sndPair) (unConstrData i1)))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripSum.uplc.golden b/plutarch-test/goldens/field.trips.tripSum.uplc.golden deleted file mode 100644 index d670900a9..000000000 --- a/plutarch-test/goldens/field.trips.tripSum.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripYZ.bench.golden b/plutarch-test/goldens/field.trips.tripYZ.bench.golden deleted file mode 100644 index cb5716a05..000000000 --- a/plutarch-test/goldens/field.trips.tripYZ.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":36} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripYZ.uplc.eval.golden b/plutarch-test/goldens/field.trips.tripYZ.uplc.eval.golden deleted file mode 100644 index 33c95036e..000000000 --- a/plutarch-test/goldens/field.trips.tripYZ.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripYZ.uplc.golden b/plutarch-test/goldens/field.trips.tripYZ.uplc.golden deleted file mode 100644 index 0f34eb5df..000000000 --- a/plutarch-test/goldens/field.trips.tripYZ.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.uplc.eval.golden b/plutarch-test/goldens/field.trips.uplc.eval.golden new file mode 100644 index 000000000..f21ca2849 --- /dev/null +++ b/plutarch-test/goldens/field.trips.uplc.eval.golden @@ -0,0 +1,7 @@ +lam.tripSum (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList (force tailList i1)))) (force tailList i1)) (force (force sndPair) (unConstrData i1)))) +lam.getY (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) +lam.tripYZ (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) +tripSum.A (program 1.0.0 1000) +tripSum.B (program 1.0.0 100) +tripSum.C (program 1.0.0 10) +tripYZ=tripZY (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.uplc.golden b/plutarch-test/goldens/field.trips.uplc.golden new file mode 100644 index 000000000..04daca150 --- /dev/null +++ b/plutarch-test/goldens/field.trips.uplc.golden @@ -0,0 +1,7 @@ +lam.tripSum (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (force headList)) (force tailList))) +lam.getY (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) +lam.tripYZ (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) +tripSum.A (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 150) (i3 (iData 750) (i3 (iData 100) [ ]))))) (force headList)) (force tailList)) (force mkCons))) +tripSum.B (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 50) (i3 (iData 10) (i3 (iData 40) [ ]))))) (force headList)) (force tailList)) (force mkCons))) +tripSum.C (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 1) (i3 (iData 8) (i3 (iData 1) [ ]))))) (force headList)) (force tailList)) (force mkCons))) +tripYZ=tripZY (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index 0175701d6..f3c7c906b 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -26,8 +26,8 @@ spec :: Spec spec = do describe "api" $ do describe "ctx" $ do - describe "printTerm" $ golden PrintTerm ctx -- TODO pgoldenSpec $ do + "term" @> ctx "get" @\ do "txInfo" @> pfromData (getTxInfo # ctx) @-> \p -> plift p @?= info diff --git a/plutarch-test/src/Plutarch/FieldSpec.hs b/plutarch-test/src/Plutarch/FieldSpec.hs index df5cc42ca..3aa5faeae 100644 --- a/plutarch-test/src/Plutarch/FieldSpec.hs +++ b/plutarch-test/src/Plutarch/FieldSpec.hs @@ -25,68 +25,43 @@ spec :: Spec spec = do describe "field" $ do -- example: Trips - describe "trips" $ do + describe "trips" . pgoldenSpec $ do -- compilation - describe "tripSum" $ do - golden All tripSum - describe "getY" $ do - golden All getY - describe "tripYZ" $ do - golden All tripYZ - -- tests - describe "tripSum # tripA = 1000" $ do - let p = 1000 - it "works" $ plift (tripSum # tripA) @?= p - describe "tripSum # tripB = 100" $ do - let p = 100 - it "works" $ plift (tripSum # tripB) @?= p - describe "tripSum # tripC = 10" $ do - let p = 10 - it "works" $ plift (tripSum # tripC) @?= p - describe "tripYZ = tripZY" $ - it "works" $ tripZY #@?= tripYZ + "lam" @\ do + "tripSum" @> tripSum + "getY" @> getY + "tripYZ" @> tripYZ + "tripSum" @\ do + "A" @> tripSum # tripA @-> \p -> + plift p @?= 1000 + "B" @> tripSum # tripB @-> \p -> + plift p @?= 100 + "C" @> tripSum # tripC @-> \p -> + plift p @?= 10 + "tripYZ=tripZY" @> tripZY @== tripYZ -- rangeFields - describe "rangeFields" $ do + describe "rangeFields" . pgoldenSpec $ do -- compilation - describe "rangeFields" $ do - golden All rangeFields - -- tests - describe "rangeFields someFields = 11" $ do - let p = 11 - it "works" $ plift (rangeFields # someFields) @?= p + "lam" @> rangeFields + "app" @> rangeFields # someFields @-> \p -> plift p @?= 11 -- dropFields - describe "dropFields" $ do + describe "dropFields" . pgoldenSpec $ do -- compilation - describe "dropFields" $ do - golden All dropFields - -- tests - describe "dropFields someFields = 17" $ do - let p = 17 - it "works" $ plift (dropFields # someFields) @?= p + "lam" @> dropFields + "app" @> dropFields # someFields @-> \p -> plift p @?= 17 -- pletFields - describe "pletFields" $ do + describe "pletFields" . pgoldenSpec $ do -- compilation - describe "letSomeFields" $ do - golden All letSomeFields - describe "nFields" $ do - golden All nFields - -- tests - describe "letSomeFields = letSomeFields'" $ do - it "works" $ letSomeFields #@?= letSomeFields' - describe "letSomeFields someFields = 14" $ do - let p = 14 - it "works" $ plift (letSomeFields # someFields) @?= p - describe "nFields someFields = 1" $ do - let p = 1 - it "works" $ plift (nFields # someFields) @?= p - describe "other" $ do - -- tests - describe "by = 10" $ do - let p = 10 - it "works" $ plift by @?= p - describe "dotPlus = 19010" $ do - let p = 19010 - it "works" $ plift dotPlus @?= p + "letSomeFields" @\ do + "lam" @> letSomeFields + "order" @> letSomeFields' @== letSomeFields + "app" @> letSomeFields # someFields @-> \p -> plift p @?= 14 + "nFields" @\ do + "lam" @> nFields + "app" @> nFields # someFields @-> \p -> plift p @?= 1 + describe "other" . pgoldenSpec $ do + "by" @> by @-> \p -> plift p @?= 10 + "dotPlus" @> dotPlus @-> \p -> plift p @?= 19010 -------------------------------------------------------------------------------- From eaa16906ba12b68abf5db840c2268c3e1c1ba529 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 11:58:24 -0500 Subject: [PATCH 021/584] Port MonadicSpec --- ...c.api.example.signatory.dev=false.bench.golden | 2 ++ ...ample.signatory.dev=false.haskell.bench.golden | 1 - ...e.signatory.dev=false.haskell.uplc.eval.golden | 1 - ...xample.signatory.dev=false.haskell.uplc.golden | 1 - ...i.example.signatory.dev=false.uplc.eval.golden | 2 ++ ...ic.api.example.signatory.dev=false.uplc.golden | 2 ++ ...ic.api.example.signatory.dev=true.bench.golden | 2 ++ ...xample.signatory.dev=true.haskell.bench.golden | 1 - ...le.signatory.dev=true.haskell.uplc.eval.golden | 1 - ...example.signatory.dev=true.haskell.uplc.golden | 1 - ...pi.example.signatory.dev=true.uplc.eval.golden | 2 ++ ...dic.api.example.signatory.dev=true.uplc.golden | 2 ++ plutarch-test/src/Plutarch/MonadicSpec.hs | 15 ++++++--------- 13 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.eval.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.eval.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden new file mode 100644 index 000000000..fd107d1ef --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden @@ -0,0 +1,2 @@ +do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} +do.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.bench.golden deleted file mode 100644 index 8705ffc87..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.golden deleted file mode 100644 index ed510fea3..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden new file mode 100644 index 000000000..a9c117adc --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ()) +do.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden new file mode 100644 index 000000000..d5e484e74 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden new file mode 100644 index 000000000..60726e30c --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -0,0 +1,2 @@ +do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":322} +do.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":318} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden deleted file mode 100644 index 69a50fe95..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":322} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden deleted file mode 100644 index 670119686..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden new file mode 100644 index 000000000..a9c117adc --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ()) +do.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden new file mode 100644 index 000000000..c575ef839 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/MonadicSpec.hs b/plutarch-test/src/Plutarch/MonadicSpec.hs index bca6ed3b5..b9c58e742 100644 --- a/plutarch-test/src/Plutarch/MonadicSpec.hs +++ b/plutarch-test/src/Plutarch/MonadicSpec.hs @@ -27,16 +27,13 @@ spec = do describe "api.example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. - describe "signatory" . plutarchDevFlagDescribe $ do + describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" - describe "haskell" $ do - let p = checkSignatory # pconstant aSig # ApiSpec.ctx - pe = checkSignatory # pconstant "41" # ApiSpec.ctx - golden All p - it "succeeds" $ psucceeds p - it "fails" $ pfails pe - describe "getFields" $ - golden All getFields + "do" @\ do + "succeeds" @> checkSignatory # pconstant aSig # ApiSpec.ctx @-> psucceeds + "fails" @> checkSignatory # pconstant "41" # ApiSpec.ctx @-> pfails + describe "getFields" . pgoldenSpec $ do + "0" @> getFields checkSignatory :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) checkSignatory = plam $ \ph ctx' -> From e0ee7e3a606067d6a22726b144f06ed55ac29d34 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 12:14:27 -0500 Subject: [PATCH 022/584] Port PIsDataSpec --- .../goldens/pisdata.ppair.bench.golden | 5 +++ .../goldens/pisdata.ppair.uplc.eval.golden | 5 +++ .../goldens/pisdata.ppair.uplc.golden | 5 +++ plutarch-test/src/Plutarch/PIsDataSpec.hs | 45 +++++++++---------- 4 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 plutarch-test/goldens/pisdata.ppair.bench.golden create mode 100644 plutarch-test/goldens/pisdata.ppair.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.ppair.uplc.golden diff --git a/plutarch-test/goldens/pisdata.ppair.bench.golden b/plutarch-test/goldens/pisdata.ppair.bench.golden new file mode 100644 index 000000000..4e2199b85 --- /dev/null +++ b/plutarch-test/goldens/pisdata.ppair.bench.golden @@ -0,0 +1,5 @@ +simple {"exBudgetCPU":508511,"exBudgetMemory":864,"scriptSizeBytes":19} +scriptcredential {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":28} +isomorphism.pforgetData {"exBudgetCPU":1852836,"exBudgetMemory":3492,"scriptSizeBytes":52} +isomorphism.pbuiltinPairFromTuple {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":68} +isomorphism.ptupleFromBuiltin {"exBudgetCPU":1852836,"exBudgetMemory":3492,"scriptSizeBytes":52} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.ppair.uplc.eval.golden b/plutarch-test/goldens/pisdata.ppair.uplc.eval.golden new file mode 100644 index 000000000..86d4048d5 --- /dev/null +++ b/plutarch-test/goldens/pisdata.ppair.uplc.eval.golden @@ -0,0 +1,5 @@ +simple (program 1.0.0 (#01, #4141)) +scriptcredential (program 1.0.0 (#d8799f4141ff, #d87a9f4182ff)) +isomorphism.pforgetData (program 1.0.0 #d8799fd8799f4141ffd87a9f4182ffff) +isomorphism.pbuiltinPairFromTuple (program 1.0.0 (#d8799f4141ff, #d87a9f4182ff)) +isomorphism.ptupleFromBuiltin (program 1.0.0 #d8799fd8799f4141ffd87a9f4182ffff) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.ppair.uplc.golden b/plutarch-test/goldens/pisdata.ppair.uplc.golden new file mode 100644 index 000000000..87673939a --- /dev/null +++ b/plutarch-test/goldens/pisdata.ppair.uplc.golden @@ -0,0 +1,5 @@ +simple (program 1.0.0 (mkPairData #01 (bData #41))) +scriptcredential (program 1.0.0 (mkPairData #d8799f4141ff #d87a9f4182ff)) +isomorphism.pforgetData (program 1.0.0 ((\i0 -> (\i0 -> constrData 0 (i2 (force (force fstPair) i1) (i2 (force (force sndPair) i1) [ ]))) (mkPairData #d8799f4141ff #d87a9f4182ff)) (force mkCons))) +isomorphism.pbuiltinPairFromTuple (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (force (force sndPair) (unConstrData i1))) ((\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 [ ]))) #d8799f4141ff #d87a9f4182ff)) (force headList)) (force mkCons))) +isomorphism.ptupleFromBuiltin (program 1.0.0 ((\i0 -> (\i0 -> constrData 0 (i2 (force (force fstPair) i1) (i2 (force (force sndPair) i1) [ ]))) (mkPairData #d8799f4141ff #d87a9f4182ff)) (force mkCons))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/PIsDataSpec.hs b/plutarch-test/src/Plutarch/PIsDataSpec.hs index 9136ee3c9..ca051cea1 100644 --- a/plutarch-test/src/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/src/Plutarch/PIsDataSpec.hs @@ -23,30 +23,27 @@ spec = do propertySet @PBool "PBool" propertySet @PInteger "PInteger" propertySet @PUnit "PUnit" - describe "ppair" $ do - describe "pfromData (pdata (I 1, B 0x41)) ≡ (I 1, I 2)" $ do - let p :: Term s (PBuiltinPair (PAsData PInteger) (PAsData PByteString)) - p = - ppairDataBuiltin # pconstantData @PInteger 1 - -- ByteString doesn't have a ToData instance - can't use pconstantData.... - #$ pdata - $ pconstant $ encodeUtf8 "A" - it "works" $ pfromData (pdata p) #@?= p - describe "pfromData (pdata (PTxId 0x41, PScriptCredential 0x82)) ≡ (PTxId 0x41, PScriptCredential 0x82)" $ do - let p = - ppairDataBuiltin - # pconstantData @PTxId "41" #$ pconstantData - $ ScriptCredential "82" - it "works" $ pfromData (pdata p) #@?= p - describe "ptuple isomorphism" $ do - let p = - ppairDataBuiltin - # pconstantData @PTxId "41" #$ pconstantData - $ ScriptCredential "82" - tup = pdata $ ptuple # pconstantData @PTxId "41" #$ pconstantData $ ScriptCredential "82" - it "works" $ pforgetData (pdata p) #@?= pforgetData tup - it "works" $ pfromData (pbuiltinPairFromTuple tup) #@?= p - it "works" $ ptupleFromBuiltin (pdata p) #@?= tup + describe "ppair" . pgoldenSpec $ do + -- pfromData (pdata (I 1, B 0x41)) ≡ (I 1, I A) + "simple" + @> ( ppairDataBuiltin @_ @PInteger @PByteString + # pconstantData @PInteger 1 + #$ pdata (pconstant $ encodeUtf8 "A") + ) + @-> \p -> + pfromData (pdata p) `pshouldBe` p + -- pfromdata (pdata (ptxid 0x41, pscriptcredential 0x82)) ≡ (ptxid 0x41, pscriptcredential 0x82) + let scPair = + ppairDataBuiltin + # pconstantData @PTxId "41" + #$ pconstantData (ScriptCredential "82") + "scriptcredential" @> scPair @-> \p -> + pfromData (pdata p) `pshouldBe` p + let scTuple = pdata $ ptuple # pconstantData @PTxId "41" #$ pconstantData $ ScriptCredential "82" + "isomorphism" @\ do + "pforgetData" @> pforgetData (pdata scPair) @== pforgetData scTuple + "pbuiltinPairFromTuple" @> pfromData (pbuiltinPairFromTuple scTuple) @== scPair + "ptupleFromBuiltin" @> ptupleFromBuiltin (pdata scPair) @== scTuple propertySet :: forall p. From 196b9f9492763bb3f753ec66625d58642aa86dc2 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 13:15:08 -0500 Subject: [PATCH 023/584] Port PLamSpec --- plutarch-test/goldens/plam.bench.golden | 3 +++ plutarch-test/goldens/plam.uplc.eval.golden | 3 +++ plutarch-test/goldens/plam.uplc.golden | 3 +++ plutarch-test/src/Plutarch/PLamSpec.hs | 11 ++++------- 4 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 plutarch-test/goldens/plam.bench.golden create mode 100644 plutarch-test/goldens/plam.uplc.eval.golden create mode 100644 plutarch-test/goldens/plam.uplc.golden diff --git a/plutarch-test/goldens/plam.bench.golden b/plutarch-test/goldens/plam.bench.golden new file mode 100644 index 000000000..5bc8637ad --- /dev/null +++ b/plutarch-test/goldens/plam.bench.golden @@ -0,0 +1,3 @@ +id {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +flip.const {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +plet {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/plam.uplc.eval.golden b/plutarch-test/goldens/plam.uplc.eval.golden new file mode 100644 index 000000000..d1e247c5a --- /dev/null +++ b/plutarch-test/goldens/plam.uplc.eval.golden @@ -0,0 +1,3 @@ +id (program 1.0.0 (\i0 -> i1)) +flip.const (program 1.0.0 (\i0 -> \i0 -> i1)) +plet (program 1.0.0 (\i0 -> \i0 -> error)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.uplc.golden b/plutarch-test/goldens/plam.uplc.golden new file mode 100644 index 000000000..d1e247c5a --- /dev/null +++ b/plutarch-test/goldens/plam.uplc.golden @@ -0,0 +1,3 @@ +id (program 1.0.0 (\i0 -> i1)) +flip.const (program 1.0.0 (\i0 -> \i0 -> i1)) +plet (program 1.0.0 (\i0 -> \i0 -> error)) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/PLamSpec.hs b/plutarch-test/src/Plutarch/PLamSpec.hs index f630f79bc..b8b99c7e4 100644 --- a/plutarch-test/src/Plutarch/PLamSpec.hs +++ b/plutarch-test/src/Plutarch/PLamSpec.hs @@ -7,10 +7,7 @@ import Plutarch.Test spec :: Spec spec = do - describe "plam" $ do - describe "id" $ do - golden PrintTerm $ plam (\x -> x) - describe "flip.const" $ do - golden PrintTerm $ plam (\_ y -> y) - describe "plet" $ do - golden PrintTerm $ plam (\x _ -> plet x $ \_ -> perror) + describe "plam" . pgoldenSpec $ do + "id" @> plam (\x -> x) + "flip.const" @> plam (\_ y -> y) + "plet" @> plam (\x _ -> plet x $ \_ -> perror) From 238ac1c6c201c5386ef5ca2ba3ba3af5bd997a71 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 13:19:41 -0500 Subject: [PATCH 024/584] Port PlutusTypeSpec --- .../goldens/plutustype.example.bench.golden | 4 ++++ .../plutustype.example.uplc.eval.golden | 4 ++++ .../goldens/plutustype.example.uplc.golden | 4 ++++ plutarch-test/src/Plutarch/PlutusTypeSpec.hs | 19 ++++++------------- plutarch-test/src/Plutarch/Test.hs | 2 +- 5 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 plutarch-test/goldens/plutustype.example.bench.golden create mode 100644 plutarch-test/goldens/plutustype.example.uplc.eval.golden create mode 100644 plutarch-test/goldens/plutustype.example.uplc.golden diff --git a/plutarch-test/goldens/plutustype.example.bench.golden b/plutarch-test/goldens/plutustype.example.bench.golden new file mode 100644 index 000000000..6b4eb2311 --- /dev/null +++ b/plutarch-test/goldens/plutustype.example.bench.golden @@ -0,0 +1,4 @@ +A-as-0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +B-as-1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +swap.A {"exBudgetCPU":554791,"exBudgetMemory":1502,"scriptSizeBytes":21} +swap.B {"exBudgetCPU":554791,"exBudgetMemory":1502,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.uplc.eval.golden b/plutarch-test/goldens/plutustype.example.uplc.eval.golden new file mode 100644 index 000000000..14c7d3c9d --- /dev/null +++ b/plutarch-test/goldens/plutustype.example.uplc.eval.golden @@ -0,0 +1,4 @@ +A-as-0 (program 1.0.0 0) +B-as-1 (program 1.0.0 1) +swap.A (program 1.0.0 1) +swap.B (program 1.0.0 0) \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.uplc.golden b/plutarch-test/goldens/plutustype.example.uplc.golden new file mode 100644 index 000000000..861a2c517 --- /dev/null +++ b/plutarch-test/goldens/plutustype.example.uplc.golden @@ -0,0 +1,4 @@ +A-as-0 (program 1.0.0 0) +B-as-1 (program 1.0.0 1) +swap.A (program 1.0.0 (force (force ifThenElse (equalsInteger 0 0) (delay 1) (delay 0)))) +swap.B (program 1.0.0 (force (force ifThenElse (equalsInteger 1 0) (delay 1) (delay 0)))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs index afd408ef3..99d5a13c0 100644 --- a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs @@ -12,19 +12,12 @@ import Plutarch.Test spec :: Spec spec = do describe "plutustype" $ do - describe "example" $ do - describe "A encoded as 0" $ do - let p :: Term s PInteger - p = 0 - it "works" (pcon A #@?= p) - describe "B encoded as 1" $ do - let p :: Term s PInteger - p = 1 - it "works" $ pcon B #@?= p - describe "swap A == B" $ do - it "works" $ swap (pcon A) #@?= pcon B - describe "swap B == A" $ do - it "works" $ swap (pcon B) #@?= pcon A + describe "example" . pgoldenSpec $ do + "A-as-0" @> pcon A @== pconstant @PInteger 0 + "B-as-1" @> pcon B @== pconstant @PInteger 1 + "swap" @\ do + "A" @> swap (pcon A) @== pcon B + "B" @> swap (pcon B) @== pcon A describe "instances-sanity" $ do plutarchDevFlagDescribe $ do it "PBuiltinList" $ do diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index e9285f054..47e415309 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -134,7 +134,7 @@ pfails p = do Right _ -> expectationFailure $ "Term succeeded" {- Convenient alias for `@-> pshouldBe x` -} -(@==) :: Term s a -> ClosedTerm a -> TermExpectation s a +(@==) :: Term s a -> ClosedTerm b -> TermExpectation s a (@==) p x = p @-> pshouldBe x infixr 1 @== From 2bced32078d7d07752d5aabea0940115aacaa200 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 13:21:37 -0500 Subject: [PATCH 025/584] Port RecursionSpec --- .../goldens/recursion.example.bench.golden | 3 +++ .../recursion.example.uplc.eval.golden | 3 +++ .../goldens/recursion.example.uplc.golden | 3 +++ plutarch-test/src/Plutarch/RecursionSpec.hs | 24 ++++++++----------- 4 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 plutarch-test/goldens/recursion.example.bench.golden create mode 100644 plutarch-test/goldens/recursion.example.uplc.eval.golden create mode 100644 plutarch-test/goldens/recursion.example.uplc.golden diff --git a/plutarch-test/goldens/recursion.example.bench.golden b/plutarch-test/goldens/recursion.example.bench.golden new file mode 100644 index 000000000..8d6fc2845 --- /dev/null +++ b/plutarch-test/goldens/recursion.example.bench.golden @@ -0,0 +1,3 @@ +iterateN.lam {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} +iterateN.app.succ {"exBudgetCPU":18918235,"exBudgetMemory":45362,"scriptSizeBytes":65} +iterateN.app.double {"exBudgetCPU":17785665,"exBudgetMemory":45362,"scriptSizeBytes":65} \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.uplc.eval.golden b/plutarch-test/goldens/recursion.example.uplc.eval.golden new file mode 100644 index 000000000..ae3fa5d70 --- /dev/null +++ b/plutarch-test/goldens/recursion.example.uplc.eval.golden @@ -0,0 +1,3 @@ +iterateN.lam (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i3 1) i2 (i2 i1)))))) +iterateN.app.succ (program 1.0.0 10) +iterateN.app.double (program 1.0.0 1024) \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.uplc.golden b/plutarch-test/goldens/recursion.example.uplc.golden new file mode 100644 index 000000000..ccf9c0206 --- /dev/null +++ b/plutarch-test/goldens/recursion.example.uplc.golden @@ -0,0 +1,3 @@ +iterateN.lam (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))))) +iterateN.app.succ (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) 10 (\i0 -> addInteger i1 1) 0)) +iterateN.app.double (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) 10 (\i0 -> multiplyInteger i1 2) 1)) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/RecursionSpec.hs b/plutarch-test/src/Plutarch/RecursionSpec.hs index b50a16615..88d26c9ce 100644 --- a/plutarch-test/src/Plutarch/RecursionSpec.hs +++ b/plutarch-test/src/Plutarch/RecursionSpec.hs @@ -6,26 +6,22 @@ import Plutarch import Plutarch.Bool (pif, (#==)) import Plutarch.Integer (PInteger) -import Test.Syd (Spec, describe, it) +import Test.Syd (Spec, describe) +import Plutarch.Lift (pconstant) import Plutarch.Test spec :: Spec spec = do describe "recursion" $ do - describe "example" $ do - -- compilation - describe "iterateN" $ - golden All iterateN - -- tests - describe "iterateN (10) (+1) 0 == 10" $ do - let p :: Term s PInteger - p = 10 - it "works" $ (iterateN # 10 # succ # 0) #@?= p - describe "iterateN 10 (*2) 1 == 1024" $ do - let p :: Term s PInteger - p = 1024 - it "works" $ (iterateN # 10 # double # 1) #@?= p + describe "example" . pgoldenSpec $ do + "iterateN" @\ do + "lam" @> iterateN + "app" @\ do + "succ" @> iterateN # 10 # succ # 0 + @== pconstant @PInteger 10 + "double" @> iterateN # 10 # double # 1 + @== pconstant @PInteger 1024 succ :: Term s (PInteger :--> PInteger) succ = plam $ \x -> x + 1 From cb190f629de8de4cada03a4be7a1a85923da63a1 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 13:39:41 -0500 Subject: [PATCH 026/584] Port RationalSpec --- plutarch-test/goldens/rational.bench.golden | 21 +++++ .../goldens/rational.compare.bench.golden | 1 - .../goldens/rational.compare.uplc.eval.golden | 1 - .../goldens/rational.compare.uplc.golden | 1 - .../goldens/rational.literal.uplc.eval.golden | 1 - .../goldens/rational.literal.uplc.golden | 1 - .../goldens/rational.ops.bench.golden | 3 - .../goldens/rational.ops.uplc.eval.golden | 3 - .../goldens/rational.ops.uplc.golden | 3 - .../goldens/rational.uplc.eval.golden | 21 +++++ plutarch-test/goldens/rational.uplc.golden | 21 +++++ plutarch-test/src/Plutarch/RationalSpec.hs | 90 ++++++++----------- 12 files changed, 100 insertions(+), 67 deletions(-) create mode 100644 plutarch-test/goldens/rational.bench.golden delete mode 100644 plutarch-test/goldens/rational.compare.bench.golden delete mode 100644 plutarch-test/goldens/rational.compare.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rational.compare.uplc.golden delete mode 100644 plutarch-test/goldens/rational.literal.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rational.literal.uplc.golden delete mode 100644 plutarch-test/goldens/rational.ops.bench.golden delete mode 100644 plutarch-test/goldens/rational.ops.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rational.ops.uplc.golden create mode 100644 plutarch-test/goldens/rational.uplc.eval.golden create mode 100644 plutarch-test/goldens/rational.uplc.golden diff --git a/plutarch-test/goldens/rational.bench.golden b/plutarch-test/goldens/rational.bench.golden new file mode 100644 index 000000000..58cc9718e --- /dev/null +++ b/plutarch-test/goldens/rational.bench.golden @@ -0,0 +1,21 @@ +literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +ops.+ {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} +ops.- {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} +ops.* {"exBudgetCPU":53544398,"exBudgetMemory":123567,"scriptSizeBytes":353} +ops.harmonic-sum {"exBudgetCPU":79082665,"exBudgetMemory":181041,"scriptSizeBytes":351} +ops.multi-product {"exBudgetCPU":88311584,"exBudgetMemory":205073,"scriptSizeBytes":364} +compare {"exBudgetCPU":25140684,"exBudgetMemory":58473,"scriptSizeBytes":298} +round.5/3 {"exBudgetCPU":16770462,"exBudgetMemory":34647,"scriptSizeBytes":322} +round.4/3 {"exBudgetCPU":15284005,"exBudgetMemory":31544,"scriptSizeBytes":322} +round.-5/2 {"exBudgetCPU":16459980,"exBudgetMemory":33547,"scriptSizeBytes":336} +round.-1/4 {"exBudgetCPU":15510987,"exBudgetMemory":31646,"scriptSizeBytes":336} +truncate.5/4 {"exBudgetCPU":12715544,"exBudgetMemory":28437,"scriptSizeBytes":273} +truncate.7/4 {"exBudgetCPU":14202001,"exBudgetMemory":31540,"scriptSizeBytes":273} +truncate.1/4 {"exBudgetCPU":11229087,"exBudgetMemory":25334,"scriptSizeBytes":273} +truncate.-7/4 {"exBudgetCPU":16231741,"exBudgetMemory":35147,"scriptSizeBytes":287} +properFraction.-1/2 {"exBudgetCPU":38270534,"exBudgetMemory":87420,"scriptSizeBytes":423} +properFraction.-3/2 {"exBudgetCPU":40073292,"exBudgetMemory":90925,"scriptSizeBytes":428} +properFraction.-4/3 {"exBudgetCPU":40073292,"exBudgetMemory":90925,"scriptSizeBytes":428} +data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.11/3 {"exBudgetCPU":11211248,"exBudgetMemory":26831,"scriptSizeBytes":226} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.bench.golden b/plutarch-test/goldens/rational.compare.bench.golden deleted file mode 100644 index 6491ee7f6..000000000 --- a/plutarch-test/goldens/rational.compare.bench.golden +++ /dev/null @@ -1 +0,0 @@ -< {"exBudgetCPU":25140684,"exBudgetMemory":58473,"scriptSizeBytes":298} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.uplc.eval.golden b/plutarch-test/goldens/rational.compare.uplc.eval.golden deleted file mode 100644 index b33a7688c..000000000 --- a/plutarch-test/goldens/rational.compare.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -< (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.uplc.golden b/plutarch-test/goldens/rational.compare.uplc.golden deleted file mode 100644 index 5d367b7b5..000000000 --- a/plutarch-test/goldens/rational.compare.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -< (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.literal.uplc.eval.golden b/plutarch-test/goldens/rational.literal.uplc.eval.golden deleted file mode 100644 index 0dcc5a2f3..000000000 --- a/plutarch-test/goldens/rational.literal.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> i1 1 2)) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.literal.uplc.golden b/plutarch-test/goldens/rational.literal.uplc.golden deleted file mode 100644 index 0dcc5a2f3..000000000 --- a/plutarch-test/goldens/rational.literal.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> i1 1 2)) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.bench.golden b/plutarch-test/goldens/rational.ops.bench.golden deleted file mode 100644 index 262c8b0b7..000000000 --- a/plutarch-test/goldens/rational.ops.bench.golden +++ /dev/null @@ -1,3 +0,0 @@ -+ {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} -- {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} -* {"exBudgetCPU":53544398,"exBudgetMemory":123567,"scriptSizeBytes":353} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.uplc.eval.golden b/plutarch-test/goldens/rational.ops.uplc.eval.golden deleted file mode 100644 index 9a9de27ef..000000000 --- a/plutarch-test/goldens/rational.ops.uplc.eval.golden +++ /dev/null @@ -1,3 +0,0 @@ -+ (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 4 4)) (multiplyInteger 1 (divideInteger 4 4)))) -- (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) -* (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 4 1)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.uplc.golden b/plutarch-test/goldens/rational.ops.uplc.golden deleted file mode 100644 index efc174720..000000000 --- a/plutarch-test/goldens/rational.ops.uplc.golden +++ /dev/null @@ -1,3 +0,0 @@ -+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.uplc.eval.golden b/plutarch-test/goldens/rational.uplc.eval.golden new file mode 100644 index 000000000..48def975b --- /dev/null +++ b/plutarch-test/goldens/rational.uplc.eval.golden @@ -0,0 +1,21 @@ +literal (program 1.0.0 (\i0 -> i1 1 2)) +ops.+ (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 4 4)) (multiplyInteger 1 (divideInteger 4 4)))) +ops.- (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) +ops.* (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 4 1)))) +ops.harmonic-sum (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 77 1)) (multiplyInteger 1 (divideInteger 60 1)))) +ops.multi-product (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) +compare (program 1.0.0 True) +round.5/3 (program 1.0.0 2) +round.4/3 (program 1.0.0 1) +round.-5/2 (program 1.0.0 -2) +round.-1/4 (program 1.0.0 0) +truncate.5/4 (program 1.0.0 1) +truncate.7/4 (program 1.0.0 1) +truncate.1/4 (program 1.0.0 0) +truncate.-7/4 (program 1.0.0 -1) +properFraction.-1/2 (program 1.0.0 True) +properFraction.-3/2 (program 1.0.0 True) +properFraction.-4/3 (program 1.0.0 True) +data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) +data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) +data.id.11/3 (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 11 1)) (multiplyInteger 1 (divideInteger 3 1)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.uplc.golden b/plutarch-test/goldens/rational.uplc.golden new file mode 100644 index 000000000..100e5a64a --- /dev/null +++ b/plutarch-test/goldens/rational.uplc.golden @@ -0,0 +1,21 @@ +literal (program 1.0.0 (\i0 -> i1 1 2)) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i13 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i13 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i13 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i13 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i13 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i13 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i13 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i13 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i13 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) +data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/RationalSpec.hs b/plutarch-test/src/Plutarch/RationalSpec.hs index 2bc154e95..94480d6bf 100644 --- a/plutarch-test/src/Plutarch/RationalSpec.hs +++ b/plutarch-test/src/Plutarch/RationalSpec.hs @@ -2,63 +2,47 @@ module Plutarch.RationalSpec (spec) where import Test.Syd +import Plutarch.Internal (ClosedTerm) import Plutarch.Prelude import Plutarch.Rational (pproperFraction, ptruncate) import Plutarch.Test spec :: Spec spec = do - describe "rational" $ do - describe "literal" $ do - let p = 0.5 :: Term s PRational - golden PrintTerm p - describe "ops" $ do - let p1 = (1 / 2 + 1 / 2) :: Term s PRational - p2 = 1 / 2 - 1 / 3 :: Term s PRational - p3 = (1 - 3 / 2) * (2 - 5 / 2) :: Term s PRational - goldens - All - [ ("+", p1) - , ("-", p2) - , ("*", p3) - ] - it "+" $ passert $ p1 #== 1 - it "-" $ passert $ p2 #== 1 / 6 - it "*" $ passert $ p3 #== 1 / 4 - it "harmonic-sum" $ - passert $ 1 / 2 + 1 / 3 + 1 / 4 + 1 / 5 #== (77 / 60 :: Term s PRational) - it "multi-product" $ - passert $ 1 / 2 * 2 / 3 * 3 / 4 * 4 / 5 * 5 / 6 #== (1 / 6 :: Term s PRational) - describe "compare" $ do - let p1 = 2 / 9 #< (3 / 10 :: Term s PRational) - goldens All [("<", p1)] - it "<" $ passert p1 - describe "round" $ do + let rat :: Term s PRational -> Term s PRational + rat = id + assertRat :: ClosedTerm PRational -> ClosedTerm PRational -> Expectation + assertRat x p = passert $ p #== x + describe "rational" . pgoldenSpec $ do + "literal" @> rat 0.5 + "ops" @\ do + "+" @> rat (1 / 2 + 1 / 2) @-> assertRat 1 + "-" @> rat (1 / 2 - 1 / 3) @-> assertRat (1 / 6) + "*" @> rat ((1 - 3 / 2) * (2 - 5 / 2)) @-> assertRat (1 / 4) + "harmonic-sum" @> rat (1 / 2 + 1 / 3 + 1 / 4 + 1 / 5) + @-> assertRat (77 / 60) + "multi-product" @> rat (1 / 2 * 2 / 3 * 3 / 4 * 4 / 5 * 5 / 6) + @-> assertRat (1 / 6) + "compare" @> rat (2 / 9) #< rat (3 / 10) @-> passert + "round" @\ do -- NOTE: These will eventually be replaced by property tests. - it "5/3" $ passert $ pround # (5 / 3) #== 2 - it "4/3" $ passert $ pround # (4 / 3) #== 1 - it "-5/2" $ passert $ pround # (-5 / 2) #== -2 - it "-1/4" $ passert $ pround # (-1 / 4) #== 0 - describe "truncate" $ do - it "5/4" $ passert $ ptruncate # (5 / 4) #== 1 - it "7/4" $ passert $ ptruncate # (7 / 4) #== 1 - it "1/4" $ passert $ ptruncate # (1 / 4) #== 0 - it "-7/4" $ passert $ ptruncate # (-7 / 4) #== -1 - describe "properFraction" $ do - it "-1/2" $ - passert $ - pmatch (pproperFraction # (-1 / 2)) $ \(PPair x y) -> - x #== 0 #&& y #== (-1 / 2) - it "-3/2" $ - passert $ - pmatch (pproperFraction # (-3 / 2)) $ \(PPair x y) -> - x #== -1 #&& y #== (-1 / 2) - it "-4/3" $ - passert $ - pmatch (pproperFraction # (-4 / 3)) $ \(PPair x y) -> - x #== -1 #&& y #== (-1 / 3) - describe "data" $ do - describe "id" $ do - it "0.5" $ passert $ (0.5 :: Term s PRational) #== pfromData (pdata 0.5) - it "2" $ passert $ (2 :: Term s PRational) #== pfromData (pdata 2) - it "11/3" $ passert $ (11 / 3 :: Term s PRational) #== pfromData (pdata $ 11 / 3) + "5/3" @> pround # rat (5 / 3) @== pconstant @PInteger 2 + "4/3" @> pround # rat (4 / 3) @== pconstant @PInteger 1 + "-5/2" @> pround # rat (-5 / 2) @== pconstant @PInteger (-2) + "-1/4" @> pround # rat (-1 / 4) @== pconstant @PInteger 0 + "truncate" @\ do + "5/4" @> ptruncate # rat (5 / 4) @== pconstant @PInteger 1 + "7/4" @> ptruncate # rat (7 / 4) @== pconstant @PInteger 1 + "1/4" @> ptruncate # rat (1 / 4) @== pconstant @PInteger 0 + "-7/4" @> ptruncate # rat (-7 / 4) @== pconstant @PInteger (-1) + "properFraction" @\ do + let mkP r a b = pmatch (pproperFraction # r) $ \(PPair x y) -> + x #== a #&& y #== b + "-1/2" @> mkP (-1 / 2) 0 (-1 / 2) @-> passert + "-3/2" @> mkP (-3 / 2) (-1) (-1 / 2) @-> passert + "-4/3" @> mkP (-4 / 3) (-1) (-1 / 3) @-> passert + "data" @\ do + "id" @\ do + "0.5" @> rat 0.5 @-> assertRat (pfromData (pdata 0.5)) + "2" @> rat 2 @-> assertRat (pfromData (pdata 2)) + "11/3" @> rat 11 / 3 @-> assertRat (pfromData (pdata $ 11 / 3)) From 14e18c7387d726b9a924cf6f7e8f8d47a317a363 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 13:45:03 -0500 Subject: [PATCH 027/584] Port ScriptsSpec --- .../scripts.auth stake validator.uplc.golden | 1 - .../goldens/scripts.auth_policy.bench.golden | 1 + .../scripts.auth_stake_validator.bench.golden | 1 + .../goldens/scripts.auth_validator.bench.golden | 1 + plutarch-test/src/Plutarch/ScriptsSpec.hs | 13 ++++--------- 5 files changed, 7 insertions(+), 10 deletions(-) delete mode 100644 plutarch-test/goldens/scripts.auth stake validator.uplc.golden create mode 100644 plutarch-test/goldens/scripts.auth_policy.bench.golden create mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.bench.golden create mode 100644 plutarch-test/goldens/scripts.auth_validator.bench.golden diff --git a/plutarch-test/goldens/scripts.auth stake validator.uplc.golden b/plutarch-test/goldens/scripts.auth stake validator.uplc.golden deleted file mode 100644 index d6b3b2803..000000000 --- a/plutarch-test/goldens/scripts.auth stake validator.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.bench.golden b/plutarch-test/goldens/scripts.auth_policy.bench.golden new file mode 100644 index 000000000..85921866a --- /dev/null +++ b/plutarch-test/goldens/scripts.auth_policy.bench.golden @@ -0,0 +1 @@ +0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.bench.golden b/plutarch-test/goldens/scripts.auth_stake_validator.bench.golden new file mode 100644 index 000000000..85921866a --- /dev/null +++ b/plutarch-test/goldens/scripts.auth_stake_validator.bench.golden @@ -0,0 +1 @@ +0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.bench.golden b/plutarch-test/goldens/scripts.auth_validator.bench.golden new file mode 100644 index 000000000..99c3d1116 --- /dev/null +++ b/plutarch-test/goldens/scripts.auth_validator.bench.golden @@ -0,0 +1 @@ +0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":91} \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ScriptsSpec.hs b/plutarch-test/src/Plutarch/ScriptsSpec.hs index f149ee4ec..c1e996101 100644 --- a/plutarch-test/src/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/src/Plutarch/ScriptsSpec.hs @@ -39,34 +39,29 @@ import Plutarch.Api.V1 ( import Plutarch.Api.V1.Crypto (PPubKey, PPubKeyHash, PSignature (PSignature)) import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude -import Plutarch.Test ( - PlutarchGolden (PrintTerm), - getGoldenFilePrefix, - golden, - goldenFilePath, - ) +import Plutarch.Test import Test.Syd (Spec, describe, it, pureGoldenTextFile) spec :: Spec spec = do describe "scripts" $ do describe "auth_validator" $ do + pgoldenSpec $ "0" @> authValidatorTerm prefix <- getGoldenFilePrefix - golden PrintTerm authValidatorTerm it "hash" $ do pureGoldenTextFile (goldenFilePath "goldens" prefix "hash") validatorHashEncoded describe "auth_policy" $ do + pgoldenSpec $ "0" @> authPolicyTerm prefix <- getGoldenFilePrefix - golden PrintTerm authPolicyTerm it "hash" $ pureGoldenTextFile (goldenFilePath "goldens" prefix "hash") policySymEncoded describe "auth_stake_validator" $ do + pgoldenSpec $ "0" @> authStakeValidatorTerm prefix <- getGoldenFilePrefix - golden PrintTerm authStakeValidatorTerm it "hash" $ pureGoldenTextFile (goldenFilePath "goldens" prefix "hash") From cc0f0c52425764b77b3cd55d68c597f1e3d881fc Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 13:46:50 -0500 Subject: [PATCH 028/584] Port UnitSpec --- plutarch-test/goldens/unit.bench.golden | 5 ++++ .../goldens/unit.compare.bench.golden | 3 --- .../goldens/unit.compare.uplc.eval.golden | 3 --- .../goldens/unit.compare.uplc.golden | 3 --- plutarch-test/goldens/unit.pcon.bench.golden | 1 - .../goldens/unit.pcon.uplc.eval.golden | 1 - plutarch-test/goldens/unit.pcon.uplc.golden | 1 - .../goldens/unit.pmatch.bench.golden | 1 - .../goldens/unit.pmatch.uplc.eval.golden | 1 - plutarch-test/goldens/unit.pmatch.uplc.golden | 1 - plutarch-test/goldens/unit.uplc.eval.golden | 5 ++++ plutarch-test/goldens/unit.uplc.golden | 5 ++++ plutarch-test/src/Plutarch/UnitSpec.hs | 27 +++++-------------- 13 files changed, 22 insertions(+), 35 deletions(-) create mode 100644 plutarch-test/goldens/unit.bench.golden delete mode 100644 plutarch-test/goldens/unit.compare.bench.golden delete mode 100644 plutarch-test/goldens/unit.compare.uplc.eval.golden delete mode 100644 plutarch-test/goldens/unit.compare.uplc.golden delete mode 100644 plutarch-test/goldens/unit.pcon.bench.golden delete mode 100644 plutarch-test/goldens/unit.pcon.uplc.eval.golden delete mode 100644 plutarch-test/goldens/unit.pcon.uplc.golden delete mode 100644 plutarch-test/goldens/unit.pmatch.bench.golden delete mode 100644 plutarch-test/goldens/unit.pmatch.uplc.eval.golden delete mode 100644 plutarch-test/goldens/unit.pmatch.uplc.golden create mode 100644 plutarch-test/goldens/unit.uplc.eval.golden create mode 100644 plutarch-test/goldens/unit.uplc.golden diff --git a/plutarch-test/goldens/unit.bench.golden b/plutarch-test/goldens/unit.bench.golden new file mode 100644 index 000000000..ed147f57e --- /dev/null +++ b/plutarch-test/goldens/unit.bench.golden @@ -0,0 +1,5 @@ +pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +pmatch {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +compare.== {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +compare.< {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +compare.<= {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.compare.bench.golden b/plutarch-test/goldens/unit.compare.bench.golden deleted file mode 100644 index 9b5ece174..000000000 --- a/plutarch-test/goldens/unit.compare.bench.golden +++ /dev/null @@ -1,3 +0,0 @@ -== {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -< {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -<= {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.compare.uplc.eval.golden b/plutarch-test/goldens/unit.compare.uplc.eval.golden deleted file mode 100644 index 8e479b21c..000000000 --- a/plutarch-test/goldens/unit.compare.uplc.eval.golden +++ /dev/null @@ -1,3 +0,0 @@ -== (program 1.0.0 True) -< (program 1.0.0 False) -<= (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.compare.uplc.golden b/plutarch-test/goldens/unit.compare.uplc.golden deleted file mode 100644 index 8e479b21c..000000000 --- a/plutarch-test/goldens/unit.compare.uplc.golden +++ /dev/null @@ -1,3 +0,0 @@ -== (program 1.0.0 True) -< (program 1.0.0 False) -<= (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pcon.bench.golden b/plutarch-test/goldens/unit.pcon.bench.golden deleted file mode 100644 index c735abb6b..000000000 --- a/plutarch-test/goldens/unit.pcon.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pcon.uplc.eval.golden b/plutarch-test/goldens/unit.pcon.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/unit.pcon.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pcon.uplc.golden b/plutarch-test/goldens/unit.pcon.uplc.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/unit.pcon.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pmatch.bench.golden b/plutarch-test/goldens/unit.pmatch.bench.golden deleted file mode 100644 index c735abb6b..000000000 --- a/plutarch-test/goldens/unit.pmatch.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pmatch.uplc.eval.golden b/plutarch-test/goldens/unit.pmatch.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/unit.pmatch.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pmatch.uplc.golden b/plutarch-test/goldens/unit.pmatch.uplc.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/unit.pmatch.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.uplc.eval.golden b/plutarch-test/goldens/unit.uplc.eval.golden new file mode 100644 index 000000000..25660b104 --- /dev/null +++ b/plutarch-test/goldens/unit.uplc.eval.golden @@ -0,0 +1,5 @@ +pcon (program 1.0.0 ()) +pmatch (program 1.0.0 True) +compare.== (program 1.0.0 True) +compare.< (program 1.0.0 False) +compare.<= (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.uplc.golden b/plutarch-test/goldens/unit.uplc.golden new file mode 100644 index 000000000..25660b104 --- /dev/null +++ b/plutarch-test/goldens/unit.uplc.golden @@ -0,0 +1,5 @@ +pcon (program 1.0.0 ()) +pmatch (program 1.0.0 True) +compare.== (program 1.0.0 True) +compare.< (program 1.0.0 False) +compare.<= (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/UnitSpec.hs b/plutarch-test/src/Plutarch/UnitSpec.hs index 3b00709cc..0f6680812 100644 --- a/plutarch-test/src/Plutarch/UnitSpec.hs +++ b/plutarch-test/src/Plutarch/UnitSpec.hs @@ -8,23 +8,10 @@ import Plutarch.Test spec :: Spec spec = do - describe "unit" $ do - describe "pcon" $ do - golden All $ pcon PUnit - describe "pmatch" $ do - let p = pmatch (pcon PUnit) (\case PUnit -> pcon PTrue) - golden All p - it "works" $ passert p - describe "compare" $ do - let pEq = pcon PUnit #== pcon PUnit - pLt = pcon PUnit #< pcon PUnit - pLe = pcon PUnit #<= pcon PUnit - goldens - All - [ ("==", pEq) - , ("<", pLt) - , ("<=", pLe) - ] - it "==" $ passert pEq - it "<" $ passert $ pnot # pLt - it "<=" $ passert pLe + describe "unit" . pgoldenSpec $ do + "pcon" @> pcon PUnit + "pmatch" @> pmatch (pcon PUnit) (\case PUnit -> pcon PTrue) @-> passert + "compare" @\ do + "==" @> pcon PUnit #== pcon PUnit @-> passert + "<" @> pcon PUnit #< pcon PUnit @-> passertNot + "<=" @> pcon PUnit #<= pcon PUnit @-> passert From 6db35666b0378923a3a304291373c1f6bfdc43d8 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 13:52:54 -0500 Subject: [PATCH 029/584] Port TraceSpec --- .../goldens/trace.dev=false.bench.golden | 9 +++ .../trace.dev=false.ptrace.bench.golden | 2 - .../trace.dev=false.ptrace.uplc.eval.golden | 2 - .../trace.dev=false.ptrace.uplc.golden | 2 - ...trace.dev=false.ptraceIfFalse.bench.golden | 2 - ...e.dev=false.ptraceIfFalse.uplc.eval.golden | 2 - .../trace.dev=false.ptraceIfFalse.uplc.golden | 2 - .../trace.dev=false.ptraceIfTrue.bench.golden | 2 - ...ce.dev=false.ptraceIfTrue.uplc.eval.golden | 2 - .../trace.dev=false.ptraceIfTrue.uplc.golden | 2 - .../goldens/trace.dev=false.uplc.eval.golden | 9 +++ .../goldens/trace.dev=false.uplc.golden | 9 +++ .../goldens/trace.dev=true.bench.golden | 9 +++ .../trace.dev=true.ptrace.bench.golden | 2 - .../trace.dev=true.ptrace.uplc.eval.golden | 2 - .../goldens/trace.dev=true.ptrace.uplc.golden | 2 - .../trace.dev=true.ptraceIfFalse.bench.golden | 2 - ...ce.dev=true.ptraceIfFalse.uplc.eval.golden | 2 - .../trace.dev=true.ptraceIfFalse.uplc.golden | 2 - .../trace.dev=true.ptraceIfTrue.bench.golden | 2 - ...ace.dev=true.ptraceIfTrue.uplc.eval.golden | 2 - .../trace.dev=true.ptraceIfTrue.uplc.golden | 2 - .../goldens/trace.dev=true.uplc.eval.golden | 9 +++ .../goldens/trace.dev=true.uplc.golden | 9 +++ plutarch-test/src/Plutarch/TraceSpec.hs | 67 +++++++------------ 25 files changed, 80 insertions(+), 77 deletions(-) create mode 100644 plutarch-test/goldens/trace.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptrace.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptrace.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptrace.uplc.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfFalse.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfTrue.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.golden create mode 100644 plutarch-test/goldens/trace.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/trace.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/trace.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptrace.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptrace.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptrace.uplc.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfFalse.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfTrue.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.golden create mode 100644 plutarch-test/goldens/trace.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/trace.dev=true.uplc.golden diff --git a/plutarch-test/goldens/trace.dev=false.bench.golden b/plutarch-test/goldens/trace.dev=false.bench.golden new file mode 100644 index 000000000..133e26e3a --- /dev/null +++ b/plutarch-test/goldens/trace.dev=false.bench.golden @@ -0,0 +1,9 @@ +ptrace.one {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptrace.two {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfTrue.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfTrue.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfFalse.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfFalse.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +chained.false.true.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +chained.ptrace.true.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +chained.ptrace.true.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptrace.bench.golden b/plutarch-test/goldens/trace.dev=false.ptrace.bench.golden deleted file mode 100644 index a2816cf9f..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptrace.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -one {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -two {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptrace.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.ptrace.uplc.eval.golden deleted file mode 100644 index afed943f4..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptrace.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -one (program 1.0.0 ()) -two (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptrace.uplc.golden b/plutarch-test/goldens/trace.dev=false.ptrace.uplc.golden deleted file mode 100644 index afed943f4..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptrace.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -one (program 1.0.0 ()) -two (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.bench.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.bench.golden deleted file mode 100644 index a956630ef..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.eval.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.bench.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.bench.golden deleted file mode 100644 index a956630ef..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.eval.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.uplc.eval.golden new file mode 100644 index 000000000..f1804b70f --- /dev/null +++ b/plutarch-test/goldens/trace.dev=false.uplc.eval.golden @@ -0,0 +1,9 @@ +ptrace.one (program 1.0.0 ()) +ptrace.two (program 1.0.0 ()) +ptraceIfTrue.true (program 1.0.0 True) +ptraceIfTrue.false (program 1.0.0 False) +ptraceIfFalse.true (program 1.0.0 True) +ptraceIfFalse.false (program 1.0.0 False) +chained.false.true.false (program 1.0.0 False) +chained.ptrace.true.false (program 1.0.0 False) +chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.uplc.golden b/plutarch-test/goldens/trace.dev=false.uplc.golden new file mode 100644 index 000000000..f1804b70f --- /dev/null +++ b/plutarch-test/goldens/trace.dev=false.uplc.golden @@ -0,0 +1,9 @@ +ptrace.one (program 1.0.0 ()) +ptrace.two (program 1.0.0 ()) +ptraceIfTrue.true (program 1.0.0 True) +ptraceIfTrue.false (program 1.0.0 False) +ptraceIfFalse.true (program 1.0.0 True) +ptraceIfFalse.false (program 1.0.0 False) +chained.false.true.false (program 1.0.0 False) +chained.ptrace.true.false (program 1.0.0 False) +chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.bench.golden b/plutarch-test/goldens/trace.dev=true.bench.golden new file mode 100644 index 000000000..6af4df7e6 --- /dev/null +++ b/plutarch-test/goldens/trace.dev=true.bench.golden @@ -0,0 +1,9 @@ +ptrace.one {"exBudgetCPU":388284,"exBudgetMemory":932,"scriptSizeBytes":16} +ptrace.two {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":30} +ptraceIfTrue.true {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} +ptraceIfTrue.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} +ptraceIfFalse.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} +ptraceIfFalse.false {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} +chained.false.true.false {"exBudgetCPU":1192157,"exBudgetMemory":3634,"scriptSizeBytes":51} +chained.ptrace.true.false {"exBudgetCPU":834880,"exBudgetMemory":2433,"scriptSizeBytes":40} +chained.ptrace.true.true {"exBudgetCPU":1103972,"exBudgetMemory":2865,"scriptSizeBytes":40} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptrace.bench.golden b/plutarch-test/goldens/trace.dev=true.ptrace.bench.golden deleted file mode 100644 index 1170ab911..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptrace.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -one {"exBudgetCPU":388284,"exBudgetMemory":932,"scriptSizeBytes":16} -two {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":30} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptrace.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.ptrace.uplc.eval.golden deleted file mode 100644 index afed943f4..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptrace.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -one (program 1.0.0 ()) -two (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptrace.uplc.golden b/plutarch-test/goldens/trace.dev=true.ptrace.uplc.golden deleted file mode 100644 index 1fee9ffaf..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptrace.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -one (program 1.0.0 (force (force trace "foo" (delay ())))) -two (program 1.0.0 ((\i0 -> force (i1 "foo" (delay (force (i1 "bar" (delay ())))))) (force trace))) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.bench.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.bench.golden deleted file mode 100644 index 6591c746e..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} -false {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.eval.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.golden deleted file mode 100644 index f3c9dcec6..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) True)) -false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) False)) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.bench.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.bench.golden deleted file mode 100644 index 67ae0223c..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -true {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} -false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.eval.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.golden deleted file mode 100644 index f6214aa00..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) True)) -false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) False)) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.uplc.eval.golden new file mode 100644 index 000000000..f1804b70f --- /dev/null +++ b/plutarch-test/goldens/trace.dev=true.uplc.eval.golden @@ -0,0 +1,9 @@ +ptrace.one (program 1.0.0 ()) +ptrace.two (program 1.0.0 ()) +ptraceIfTrue.true (program 1.0.0 True) +ptraceIfTrue.false (program 1.0.0 False) +ptraceIfFalse.true (program 1.0.0 True) +ptraceIfFalse.false (program 1.0.0 False) +chained.false.true.false (program 1.0.0 False) +chained.ptrace.true.false (program 1.0.0 False) +chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.uplc.golden b/plutarch-test/goldens/trace.dev=true.uplc.golden new file mode 100644 index 000000000..603d96a97 --- /dev/null +++ b/plutarch-test/goldens/trace.dev=true.uplc.golden @@ -0,0 +1,9 @@ +ptrace.one (program 1.0.0 (force (force trace "foo" (delay ())))) +ptrace.two (program 1.0.0 ((\i0 -> force (i1 "foo" (delay (force (i1 "bar" (delay ())))))) (force trace))) +ptraceIfTrue.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) True)) +ptraceIfTrue.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) False)) +ptraceIfFalse.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) True)) +ptraceIfFalse.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) False)) +chained.false.true.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i2 i1 (delay i1) (delay (i3 "foo" i1)))) ((\i0 -> force (i2 i1 (delay (i3 "bar" i1)) (delay i1))) False)) (force ifThenElse)) (force trace))) +chained.ptrace.true.false (program 1.0.0 ((\i0 -> force (i1 "foo" (delay ((\i0 -> force (force ifThenElse i1 (delay (i2 "bar" i1)) (delay i1))) False)))) (force trace))) +chained.ptrace.true.true (program 1.0.0 ((\i0 -> force (i1 "foo" (delay ((\i0 -> force (force ifThenElse i1 (delay (i2 "bar" i1)) (delay i1))) True)))) (force trace))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/TraceSpec.hs b/plutarch-test/src/Plutarch/TraceSpec.hs index 2d587d98d..972fd72fb 100644 --- a/plutarch-test/src/Plutarch/TraceSpec.hs +++ b/plutarch-test/src/Plutarch/TraceSpec.hs @@ -7,44 +7,29 @@ import Plutarch.Test spec :: Spec spec = do - describe "trace" . plutarchDevFlagDescribe $ do - describe "ptrace" $ do - let p1 = ptrace "foo" (pcon PUnit) - p2 = ptrace "foo" (ptrace "bar" (pcon PUnit)) - goldens - All - [ ("one", p1) - , ("two", p2) - ] - it "traces one" $ p1 `ptraces` ["foo"] - it "traces two" $ p2 `ptraces` ["foo", "bar"] - describe "ptraceIfTrue" $ do - let p1 = ptraceIfTrue "foo" (pcon PTrue) - p2 = ptraceIfTrue "foo" (pcon PFalse) - goldens - All - [ ("true", p1) - , ("false", p2) - ] - it "true" $ p1 `ptraces` ["foo"] - it "false" $ p2 `ptraces` [] - describe "ptraceIfFalse" $ do - let p1 = ptraceIfFalse "foo" (pcon PTrue) - p2 = ptraceIfFalse "foo" (pcon PFalse) - goldens - All - [ ("true", p1) - , ("false", p2) - ] - it "true" $ p1 `ptraces` [] - it "false" $ p2 `ptraces` ["foo"] - describe "more traces" $ do - it "false.true.false" $ - ptraceIfFalse "foo" (ptraceIfTrue "bar" $ pcon PFalse) - `ptraces` ["foo"] - it "ptrace.true.false" $ - ptrace "foo" (ptraceIfTrue "bar" $ pcon PFalse) - `ptraces` ["foo"] - it "ptrace.true.true" $ - ptrace "foo" (ptraceIfTrue "bar" $ pcon PTrue) - `ptraces` ["foo", "bar"] + describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do + "ptrace" @\ do + "one" @> ptrace "foo" (pcon PUnit) @-> \p -> + ptraces p ["foo"] + "two" @> ptrace "foo" (ptrace "bar" (pcon PUnit)) @-> \p -> + ptraces p ["foo", "bar"] + "ptraceIfTrue" @\ do + "true" @> ptraceIfTrue "foo" (pcon PTrue) @-> \p -> + p `ptraces` ["foo"] + "false" @> ptraceIfTrue "foo" (pcon PFalse) @-> \p -> + p `ptraces` [] + "ptraceIfFalse" @\ do + "true" @> ptraceIfFalse "foo" (pcon PTrue) @-> \p -> + p `ptraces` [] + "false" @> ptraceIfFalse "foo" (pcon PFalse) @-> \p -> + p `ptraces` ["foo"] + "chained" @\ do + "false.true.false" + @> ptraceIfFalse "foo" (ptraceIfTrue "bar" $ pcon PFalse) + @-> \p -> p `ptraces` ["foo"] + "ptrace.true.false" + @> ptrace "foo" (ptraceIfTrue "bar" $ pcon PFalse) + @-> \p -> p `ptraces` ["foo"] + "ptrace.true.true" + @> ptrace "foo" (ptraceIfTrue "bar" $ pcon PTrue) + @-> \p -> p `ptraces` ["foo", "bar"] From 33ab4bdf6ddaf068bd52b940afb6064cf2086fd8 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 13:57:58 -0500 Subject: [PATCH 030/584] Mark old golden functions as deprecated. --- plutarch-test/src/Plutarch/Test.hs | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 47e415309..b804ddea2 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -11,18 +11,20 @@ module Plutarch.Test ( ptraces, pshouldBe, (#@?=), + + -- * For Development flag tests plutarchDevFlagDescribe, - -- | Golden testing - -- - -- Typically you want to use `golden`. For grouping multiple goldens, use - -- `goldens`. - golden, - goldens, + + -- * Golden testing (@>), (@\), (@->), (@==), pgoldenSpec, + + -- * Deprecated exports + golden, + goldens, PlutarchGolden (All, Bench, PrintTerm), getGoldenFilePrefix, goldenFilePath, @@ -156,18 +158,8 @@ data PlutarchGolden | PrintTerm deriving stock (Eq, Show) -hasBenchGolden :: PlutarchGolden -> Bool -hasBenchGolden = \case - PrintTerm -> False - _ -> True - -hasPrintTermGolden :: PlutarchGolden -> Bool -hasPrintTermGolden = \case - Bench -> False - _ -> True - {- Run golden tests on the given Plutarch program -} --- {-# DEPRECATED golden "Use `pgoldenSpec` instead." #-} +{-# DEPRECATED golden "Use `pgoldenSpec` instead." #-} golden :: PlutarchGolden -> ClosedTerm a -> Spec golden pg p = goldens pg [("0", popaque p)] @@ -177,8 +169,7 @@ golden pg p = Multiple programs use a single golden file. Each output separated from the keyword with a space. -} - --- {-# DEPRECATED goldens "Use `pgoldenSpec` instead." #-} +{-# DEPRECATED goldens "Use `pgoldenSpec` instead." #-} goldens :: PlutarchGolden -> [(String, ClosedTerm a)] -> Spec goldens pg ps = do name <- getGoldenFilePrefix @@ -199,6 +190,15 @@ goldens pg ps = do pureGoldenTextFile (goldenFilePath "goldens" name "bench") $ multiGolden ps $ \p -> TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ compileD p + where + hasBenchGolden :: PlutarchGolden -> Bool + hasBenchGolden = \case + PrintTerm -> False + _ -> True + hasPrintTermGolden :: PlutarchGolden -> Bool + hasPrintTermGolden = \case + Bench -> False + _ -> True -- | Get a golden filename prefix from the test description path getGoldenFilePrefix :: From 4a546827e17d6df478baa50581344334a2da038e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 13:59:08 -0500 Subject: [PATCH 031/584] Removed old goldens --- plutarch-test/goldens/bytestring.eq.bench.golden | 1 - plutarch-test/goldens/bytestring.eq.uplc.eval.golden | 1 - plutarch-test/goldens/bytestring.eq.uplc.golden | 1 - plutarch-test/goldens/bytestring.phexByteStr.bench.golden | 1 - plutarch-test/goldens/bytestring.pindexByteStr.bench.golden | 1 - .../goldens/bytestring.pindexByteStr.uplc.eval.golden | 1 - plutarch-test/goldens/bytestring.pindexByteStr.uplc.golden | 1 - plutarch-test/goldens/bytestring.plengthByteStr.bench.golden | 1 - .../goldens/bytestring.plengthByteStr.pconsBS.bench.golden | 1 - .../bytestring.plengthByteStr.pconsBS.uplc.eval.golden | 1 - .../goldens/bytestring.plengthByteStr.pconsBS.uplc.golden | 1 - .../goldens/bytestring.plengthByteStr.uplc.eval.golden | 1 - plutarch-test/goldens/bytestring.plengthByteStr.uplc.golden | 1 - plutarch-test/goldens/bytestring.psliceByteStr.bench.golden | 1 - .../goldens/bytestring.psliceByteStr.uplc.eval.golden | 1 - plutarch-test/goldens/bytestring.psliceByteStr.uplc.golden | 1 - plutarch-test/goldens/bytestring.semigroup.bench.golden | 1 - plutarch-test/goldens/bytestring.semigroup.uplc.eval.golden | 1 - plutarch-test/goldens/bytestring.semigroup.uplc.golden | 1 - plutarch-test/goldens/list.pconcat.identity.bench.golden | 1 - plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden | 1 - plutarch-test/goldens/list.pconcat.identity.uplc.golden | 1 - plutarch-test/goldens/list.pfilter.bench.golden | 2 -- plutarch-test/goldens/list.pfilter.uplc.eval.golden | 2 -- plutarch-test/goldens/list.pfilter.uplc.golden | 2 -- plutarch-test/goldens/list.pfoldl.bench.golden | 4 ---- plutarch-test/goldens/list.pfoldl.uplc.eval.golden | 4 ---- plutarch-test/goldens/list.pfoldl.uplc.golden | 4 ---- plutarch-test/goldens/list.phead.bench.golden | 1 - plutarch-test/goldens/list.phead.uplc.eval.golden | 1 - plutarch-test/goldens/list.phead.uplc.golden | 1 - plutarch-test/goldens/list.pmap.bench.golden | 1 - plutarch-test/goldens/list.pmap.uplc.eval.golden | 1 - plutarch-test/goldens/list.pmap.uplc.golden | 1 - plutarch-test/goldens/list.pmatch.uplc.eval.golden | 1 - plutarch-test/goldens/list.pmatch.uplc.golden | 1 - plutarch-test/goldens/list.pnull.bench.golden | 2 -- plutarch-test/goldens/list.pnull.uplc.eval.golden | 2 -- plutarch-test/goldens/list.pnull.uplc.golden | 2 -- plutarch-test/goldens/list.ptail.bench.golden | 1 - plutarch-test/goldens/list.ptail.uplc.eval.golden | 1 - plutarch-test/goldens/list.ptail.uplc.golden | 1 - plutarch-test/goldens/list.pzipWith.bench.golden | 1 - plutarch-test/goldens/list.pzipWith.uplc.eval.golden | 1 - plutarch-test/goldens/list.pzipWith.uplc.golden | 1 - plutarch-test/goldens/plam.flip.const.uplc.eval.golden | 1 - plutarch-test/goldens/plam.flip.const.uplc.golden | 1 - plutarch-test/goldens/plam.id.uplc.eval.golden | 1 - plutarch-test/goldens/plam.id.uplc.golden | 1 - plutarch-test/goldens/plam.plet.uplc.eval.golden | 1 - plutarch-test/goldens/plam.plet.uplc.golden | 1 - plutarch-test/goldens/recursion.example.iterateN.bench.golden | 1 - .../goldens/recursion.example.iterateN.uplc.eval.golden | 1 - plutarch-test/goldens/recursion.example.iterateN.uplc.golden | 1 - plutarch-test/goldens/str.eq.bench.golden | 1 - plutarch-test/goldens/str.eq.uplc.eval.golden | 1 - plutarch-test/goldens/str.eq.uplc.golden | 1 - plutarch-test/goldens/str.semigroup.bench.golden | 1 - plutarch-test/goldens/str.semigroup.uplc.eval.golden | 1 - plutarch-test/goldens/str.semigroup.uplc.golden | 1 - 60 files changed, 75 deletions(-) delete mode 100644 plutarch-test/goldens/bytestring.eq.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.eq.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.eq.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.phexByteStr.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.pindexByteStr.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.pindexByteStr.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.pindexByteStr.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.psliceByteStr.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.psliceByteStr.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.psliceByteStr.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.semigroup.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.semigroup.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.semigroup.uplc.golden delete mode 100644 plutarch-test/goldens/list.pconcat.identity.bench.golden delete mode 100644 plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pconcat.identity.uplc.golden delete mode 100644 plutarch-test/goldens/list.pfilter.bench.golden delete mode 100644 plutarch-test/goldens/list.pfilter.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pfilter.uplc.golden delete mode 100644 plutarch-test/goldens/list.pfoldl.bench.golden delete mode 100644 plutarch-test/goldens/list.pfoldl.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pfoldl.uplc.golden delete mode 100644 plutarch-test/goldens/list.phead.bench.golden delete mode 100644 plutarch-test/goldens/list.phead.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.phead.uplc.golden delete mode 100644 plutarch-test/goldens/list.pmap.bench.golden delete mode 100644 plutarch-test/goldens/list.pmap.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pmap.uplc.golden delete mode 100644 plutarch-test/goldens/list.pmatch.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pmatch.uplc.golden delete mode 100644 plutarch-test/goldens/list.pnull.bench.golden delete mode 100644 plutarch-test/goldens/list.pnull.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pnull.uplc.golden delete mode 100644 plutarch-test/goldens/list.ptail.bench.golden delete mode 100644 plutarch-test/goldens/list.ptail.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.ptail.uplc.golden delete mode 100644 plutarch-test/goldens/list.pzipWith.bench.golden delete mode 100644 plutarch-test/goldens/list.pzipWith.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pzipWith.uplc.golden delete mode 100644 plutarch-test/goldens/plam.flip.const.uplc.eval.golden delete mode 100644 plutarch-test/goldens/plam.flip.const.uplc.golden delete mode 100644 plutarch-test/goldens/plam.id.uplc.eval.golden delete mode 100644 plutarch-test/goldens/plam.id.uplc.golden delete mode 100644 plutarch-test/goldens/plam.plet.uplc.eval.golden delete mode 100644 plutarch-test/goldens/plam.plet.uplc.golden delete mode 100644 plutarch-test/goldens/recursion.example.iterateN.bench.golden delete mode 100644 plutarch-test/goldens/recursion.example.iterateN.uplc.eval.golden delete mode 100644 plutarch-test/goldens/recursion.example.iterateN.uplc.golden delete mode 100644 plutarch-test/goldens/str.eq.bench.golden delete mode 100644 plutarch-test/goldens/str.eq.uplc.eval.golden delete mode 100644 plutarch-test/goldens/str.eq.uplc.golden delete mode 100644 plutarch-test/goldens/str.semigroup.bench.golden delete mode 100644 plutarch-test/goldens/str.semigroup.uplc.eval.golden delete mode 100644 plutarch-test/goldens/str.semigroup.uplc.golden diff --git a/plutarch-test/goldens/bytestring.eq.bench.golden b/plutarch-test/goldens/bytestring.eq.bench.golden deleted file mode 100644 index 88df2c300..000000000 --- a/plutarch-test/goldens/bytestring.eq.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":16} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.eq.uplc.eval.golden b/plutarch-test/goldens/bytestring.eq.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.eq.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.eq.uplc.golden b/plutarch-test/goldens/bytestring.eq.uplc.golden deleted file mode 100644 index ffa36da0d..000000000 --- a/plutarch-test/goldens/bytestring.eq.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> equalsByteString i1 i1) #12)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.phexByteStr.bench.golden b/plutarch-test/goldens/bytestring.phexByteStr.bench.golden deleted file mode 100644 index 78caf852c..000000000 --- a/plutarch-test/goldens/bytestring.phexByteStr.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":19} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.pindexByteStr.bench.golden b/plutarch-test/goldens/bytestring.pindexByteStr.bench.golden deleted file mode 100644 index ba7e3d462..000000000 --- a/plutarch-test/goldens/bytestring.pindexByteStr.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":555925,"exBudgetMemory":1002,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.pindexByteStr.uplc.eval.golden b/plutarch-test/goldens/bytestring.pindexByteStr.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.pindexByteStr.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.pindexByteStr.uplc.golden b/plutarch-test/goldens/bytestring.pindexByteStr.uplc.golden deleted file mode 100644 index 601ba1807..000000000 --- a/plutarch-test/goldens/bytestring.pindexByteStr.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (equalsInteger (indexByteString #4102af 1) 2)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.bench.golden b/plutarch-test/goldens/bytestring.plengthByteStr.bench.golden deleted file mode 100644 index 04ee115ab..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":496379,"exBudgetMemory":805,"scriptSizeBytes":17} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.bench.golden b/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.bench.golden deleted file mode 100644 index d78a7e10c..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":1381637,"exBudgetMemory":2113,"scriptSizeBytes":33} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.eval.golden b/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.golden b/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.golden deleted file mode 100644 index e45e93136..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> equalsInteger (lengthOfByteString (consByteString 91 i1)) (addInteger 1 (lengthOfByteString i1))) #48fcd1)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.uplc.eval.golden b/plutarch-test/goldens/bytestring.plengthByteStr.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.uplc.golden b/plutarch-test/goldens/bytestring.plengthByteStr.uplc.golden deleted file mode 100644 index 45a52a44a..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (equalsInteger (lengthOfByteString #012f) 2)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.psliceByteStr.bench.golden b/plutarch-test/goldens/bytestring.psliceByteStr.bench.golden deleted file mode 100644 index 7c57b7d58..000000000 --- a/plutarch-test/goldens/bytestring.psliceByteStr.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":595386,"exBudgetMemory":1202,"scriptSizeBytes":33} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.psliceByteStr.uplc.eval.golden b/plutarch-test/goldens/bytestring.psliceByteStr.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.psliceByteStr.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.psliceByteStr.uplc.golden b/plutarch-test/goldens/bytestring.psliceByteStr.uplc.golden deleted file mode 100644 index ba2ca0703..000000000 --- a/plutarch-test/goldens/bytestring.psliceByteStr.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (equalsByteString (sliceByteString 2 3 #4102afde5b2a) #afde5b)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.semigroup.bench.golden b/plutarch-test/goldens/bytestring.semigroup.bench.golden deleted file mode 100644 index 3e62faa19..000000000 --- a/plutarch-test/goldens/bytestring.semigroup.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":546438,"exBudgetMemory":602,"scriptSizeBytes":17} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.semigroup.uplc.eval.golden b/plutarch-test/goldens/bytestring.semigroup.uplc.eval.golden deleted file mode 100644 index 1ed73a1ec..000000000 --- a/plutarch-test/goldens/bytestring.semigroup.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #1234) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.semigroup.uplc.golden b/plutarch-test/goldens/bytestring.semigroup.uplc.golden deleted file mode 100644 index 7de833223..000000000 --- a/plutarch-test/goldens/bytestring.semigroup.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (appendByteString #12 #34)) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.bench.golden b/plutarch-test/goldens/list.pconcat.identity.bench.golden deleted file mode 100644 index 520fbab6c..000000000 --- a/plutarch-test/goldens/list.pconcat.identity.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":2054437,"exBudgetMemory":7000,"scriptSizeBytes":64} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden b/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden deleted file mode 100644 index a6fe1ca52..000000000 --- a/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 0 (\i0 -> \i0 -> force i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.uplc.golden b/plutarch-test/goldens/list.pconcat.identity.uplc.golden deleted file mode 100644 index c2c095d0d..000000000 --- a/plutarch-test/goldens/list.pconcat.identity.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 i2 (i4 i1)) (delay i3)) i2) ((\i0 -> i2 i1 (\i0 -> \i0 -> force i1)) 0) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.bench.golden b/plutarch-test/goldens/list.pfilter.bench.golden deleted file mode 100644 index fa1a61ba1..000000000 --- a/plutarch-test/goldens/list.pfilter.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -p1 {"exBudgetCPU":35949366,"exBudgetMemory":87322,"scriptSizeBytes":115} -p2 {"exBudgetCPU":30925386,"exBudgetMemory":83312,"scriptSizeBytes":110} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.uplc.eval.golden b/plutarch-test/goldens/list.pfilter.uplc.eval.golden deleted file mode 100644 index 6ae3f0591..000000000 --- a/plutarch-test/goldens/list.pfilter.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -p1 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) -p2 (program 1.0.0 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.uplc.golden b/plutarch-test/goldens/list.pfilter.uplc.golden deleted file mode 100644 index 091b0f066..000000000 --- a/plutarch-test/goldens/list.pfilter.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -p1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -p2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.bench.golden b/plutarch-test/goldens/list.pfoldl.bench.golden deleted file mode 100644 index 5f2f40417..000000000 --- a/plutarch-test/goldens/list.pfoldl.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -p1 {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -p1' {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -p2 {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} -p2' {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.uplc.eval.golden b/plutarch-test/goldens/list.pfoldl.uplc.eval.golden deleted file mode 100644 index 934031787..000000000 --- a/plutarch-test/goldens/list.pfoldl.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -p1 (program 1.0.0 -55) -p1' (program 1.0.0 -55) -p2 (program 1.0.0 0) -p2' (program 1.0.0 0) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.uplc.golden b/plutarch-test/goldens/list.pfoldl.uplc.golden deleted file mode 100644 index 20449fe5f..000000000 --- a/plutarch-test/goldens/list.pfoldl.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -p1 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -p1' (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -p2 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -p2' (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.bench.golden b/plutarch-test/goldens/list.phead.bench.golden deleted file mode 100644 index df2056587..000000000 --- a/plutarch-test/goldens/list.phead.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.uplc.eval.golden b/plutarch-test/goldens/list.phead.uplc.eval.golden deleted file mode 100644 index bfe2c27c9..000000000 --- a/plutarch-test/goldens/list.phead.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.uplc.golden b/plutarch-test/goldens/list.phead.uplc.golden deleted file mode 100644 index 5e1f40f29..000000000 --- a/plutarch-test/goldens/list.phead.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.bench.golden b/plutarch-test/goldens/list.pmap.bench.golden deleted file mode 100644 index 978a33629..000000000 --- a/plutarch-test/goldens/list.pmap.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29309216,"exBudgetMemory":77312,"scriptSizeBytes":99} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.uplc.eval.golden b/plutarch-test/goldens/list.pmap.uplc.eval.golden deleted file mode 100644 index f5958794f..000000000 --- a/plutarch-test/goldens/list.pmap.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.uplc.golden b/plutarch-test/goldens/list.pmap.uplc.golden deleted file mode 100644 index ad1169d66..000000000 --- a/plutarch-test/goldens/list.pmap.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmatch.uplc.eval.golden b/plutarch-test/goldens/list.pmatch.uplc.eval.golden deleted file mode 100644 index 046ef4db8..000000000 --- a/plutarch-test/goldens/list.pmatch.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmatch.uplc.golden b/plutarch-test/goldens/list.pmatch.uplc.golden deleted file mode 100644 index 7c74576bf..000000000 --- a/plutarch-test/goldens/list.pmatch.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.bench.golden b/plutarch-test/goldens/list.pnull.bench.golden deleted file mode 100644 index b1909ab24..000000000 --- a/plutarch-test/goldens/list.pnull.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -p0 {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -p1 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.uplc.eval.golden b/plutarch-test/goldens/list.pnull.uplc.eval.golden deleted file mode 100644 index 13f0e5ad0..000000000 --- a/plutarch-test/goldens/list.pnull.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -p0 (program 1.0.0 True) -p1 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.uplc.golden b/plutarch-test/goldens/list.pnull.uplc.golden deleted file mode 100644 index a685f05af..000000000 --- a/plutarch-test/goldens/list.pnull.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -p0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) -p1 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.bench.golden b/plutarch-test/goldens/list.ptail.bench.golden deleted file mode 100644 index df2056587..000000000 --- a/plutarch-test/goldens/list.ptail.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.uplc.eval.golden b/plutarch-test/goldens/list.ptail.uplc.eval.golden deleted file mode 100644 index 1dbbd6e3c..000000000 --- a/plutarch-test/goldens/list.ptail.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.uplc.golden b/plutarch-test/goldens/list.ptail.uplc.golden deleted file mode 100644 index 0d8e97d35..000000000 --- a/plutarch-test/goldens/list.ptail.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.bench.golden b/plutarch-test/goldens/list.pzipWith.bench.golden deleted file mode 100644 index 7d51287d0..000000000 --- a/plutarch-test/goldens/list.pzipWith.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":46106600,"exBudgetMemory":119104,"scriptSizeBytes":120} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.uplc.eval.golden b/plutarch-test/goldens/list.pzipWith.uplc.eval.golden deleted file mode 100644 index f5958794f..000000000 --- a/plutarch-test/goldens/list.pzipWith.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.uplc.golden b/plutarch-test/goldens/list.pzipWith.uplc.golden deleted file mode 100644 index d44aef59c..000000000 --- a/plutarch-test/goldens/list.pzipWith.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i11 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.flip.const.uplc.eval.golden b/plutarch-test/goldens/plam.flip.const.uplc.eval.golden deleted file mode 100644 index d9080ab8b..000000000 --- a/plutarch-test/goldens/plam.flip.const.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.flip.const.uplc.golden b/plutarch-test/goldens/plam.flip.const.uplc.golden deleted file mode 100644 index d9080ab8b..000000000 --- a/plutarch-test/goldens/plam.flip.const.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.id.uplc.eval.golden b/plutarch-test/goldens/plam.id.uplc.eval.golden deleted file mode 100644 index 1e51ae76c..000000000 --- a/plutarch-test/goldens/plam.id.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.id.uplc.golden b/plutarch-test/goldens/plam.id.uplc.golden deleted file mode 100644 index 1e51ae76c..000000000 --- a/plutarch-test/goldens/plam.id.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.plet.uplc.eval.golden b/plutarch-test/goldens/plam.plet.uplc.eval.golden deleted file mode 100644 index 3cf174504..000000000 --- a/plutarch-test/goldens/plam.plet.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> error)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.plet.uplc.golden b/plutarch-test/goldens/plam.plet.uplc.golden deleted file mode 100644 index 3cf174504..000000000 --- a/plutarch-test/goldens/plam.plet.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> error)) \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.iterateN.bench.golden b/plutarch-test/goldens/recursion.example.iterateN.bench.golden deleted file mode 100644 index 87c0d711b..000000000 --- a/plutarch-test/goldens/recursion.example.iterateN.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.iterateN.uplc.eval.golden b/plutarch-test/goldens/recursion.example.iterateN.uplc.eval.golden deleted file mode 100644 index 9d49a3960..000000000 --- a/plutarch-test/goldens/recursion.example.iterateN.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i3 1) i2 (i2 i1)))))) \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.iterateN.uplc.golden b/plutarch-test/goldens/recursion.example.iterateN.uplc.golden deleted file mode 100644 index b474fd9f1..000000000 --- a/plutarch-test/goldens/recursion.example.iterateN.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/str.eq.bench.golden b/plutarch-test/goldens/str.eq.bench.golden deleted file mode 100644 index f101e03db..000000000 --- a/plutarch-test/goldens/str.eq.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":389284,"exBudgetMemory":901,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/str.eq.uplc.eval.golden b/plutarch-test/goldens/str.eq.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/str.eq.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/str.eq.uplc.golden b/plutarch-test/goldens/str.eq.uplc.golden deleted file mode 100644 index 63513b313..000000000 --- a/plutarch-test/goldens/str.eq.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> equalsString i1 i1) "foo")) \ No newline at end of file diff --git a/plutarch-test/goldens/str.semigroup.bench.golden b/plutarch-test/goldens/str.semigroup.bench.golden deleted file mode 100644 index c7b8dada0..000000000 --- a/plutarch-test/goldens/str.semigroup.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":300965,"exBudgetMemory":602,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/str.semigroup.uplc.eval.golden b/plutarch-test/goldens/str.semigroup.uplc.eval.golden deleted file mode 100644 index f164f6bbc..000000000 --- a/plutarch-test/goldens/str.semigroup.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 "foobar") \ No newline at end of file diff --git a/plutarch-test/goldens/str.semigroup.uplc.golden b/plutarch-test/goldens/str.semigroup.uplc.golden deleted file mode 100644 index 2f346f9ce..000000000 --- a/plutarch-test/goldens/str.semigroup.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (appendString "foo" "bar")) \ No newline at end of file From 16db764a6e043b974f9103a1a24d8042e58373b0 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 14:13:02 -0500 Subject: [PATCH 032/584] Combine BoolSpec's goldens for consistency --- plutarch-test/goldens/bool.bench.golden | 21 ++++++ plutarch-test/goldens/bool.pand.bench.golden | 4 - .../goldens/bool.pand.laziness.bench.golden | 2 - .../bool.pand.laziness.uplc.eval.golden | 2 - .../goldens/bool.pand.laziness.uplc.golden | 2 - .../goldens/bool.pand.uplc.eval.golden | 4 - plutarch-test/goldens/bool.pand.uplc.golden | 4 - plutarch-test/goldens/bool.pnot.bench.golden | 2 - .../goldens/bool.pnot.uplc.eval.golden | 2 - plutarch-test/goldens/bool.pnot.uplc.golden | 2 - plutarch-test/goldens/bool.por.bench.golden | 4 - .../goldens/bool.por.laziness.bench.golden | 2 - .../bool.por.laziness.uplc.eval.golden | 2 - .../goldens/bool.por.laziness.uplc.golden | 2 - .../goldens/bool.por.uplc.eval.golden | 4 - plutarch-test/goldens/bool.por.uplc.golden | 4 - plutarch-test/goldens/bool.uplc.eval.golden | 21 ++++++ plutarch-test/goldens/bool.uplc.golden | 21 ++++++ plutarch-test/src/Plutarch/BoolSpec.hs | 74 +++++++++---------- 19 files changed, 96 insertions(+), 83 deletions(-) create mode 100644 plutarch-test/goldens/bool.bench.golden delete mode 100644 plutarch-test/goldens/bool.pand.bench.golden delete mode 100644 plutarch-test/goldens/bool.pand.laziness.bench.golden delete mode 100644 plutarch-test/goldens/bool.pand.laziness.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.pand.laziness.uplc.golden delete mode 100644 plutarch-test/goldens/bool.pand.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.pand.uplc.golden delete mode 100644 plutarch-test/goldens/bool.pnot.bench.golden delete mode 100644 plutarch-test/goldens/bool.pnot.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.pnot.uplc.golden delete mode 100644 plutarch-test/goldens/bool.por.bench.golden delete mode 100644 plutarch-test/goldens/bool.por.laziness.bench.golden delete mode 100644 plutarch-test/goldens/bool.por.laziness.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.por.laziness.uplc.golden delete mode 100644 plutarch-test/goldens/bool.por.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.por.uplc.golden create mode 100644 plutarch-test/goldens/bool.uplc.eval.golden create mode 100644 plutarch-test/goldens/bool.uplc.golden diff --git a/plutarch-test/goldens/bool.bench.golden b/plutarch-test/goldens/bool.bench.golden new file mode 100644 index 000000000..63a05763c --- /dev/null +++ b/plutarch-test/goldens/bool.bench.golden @@ -0,0 +1,21 @@ +pnot.lam {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":14} +pnot.app {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +pand.tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.laziness.pand {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} +pand.laziness.op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} +pand.laziness.pand.perror.false {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":5} +pand.laziness.pand.perror.true {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":5} +pand.laziness.pand.perror.op {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":18} +por.tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +por.ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +por.tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +por.ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +por.laziness.por {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} +por.laziness.op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} +por.laziness.pand.perror.false {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":5} +por.laziness.pand.perror.true {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":5} +por.laziness.pand.perror.op.true {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} +por.laziness.pand.perror.op.false {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.bench.golden b/plutarch-test/goldens/bool.pand.bench.golden deleted file mode 100644 index e6b134eec..000000000 --- a/plutarch-test/goldens/bool.pand.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.laziness.bench.golden b/plutarch-test/goldens/bool.pand.laziness.bench.golden deleted file mode 100644 index dc2ec382c..000000000 --- a/plutarch-test/goldens/bool.pand.laziness.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -pand {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} -op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.laziness.uplc.eval.golden b/plutarch-test/goldens/bool.pand.laziness.uplc.eval.golden deleted file mode 100644 index ffb471430..000000000 --- a/plutarch-test/goldens/bool.pand.laziness.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -pand (program 1.0.0 (delay False)) -op (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.laziness.uplc.golden b/plutarch-test/goldens/bool.pand.laziness.uplc.golden deleted file mode 100644 index 9c7692e99..000000000 --- a/plutarch-test/goldens/bool.pand.laziness.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -pand (program 1.0.0 ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error))) -op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.uplc.eval.golden b/plutarch-test/goldens/bool.pand.uplc.eval.golden deleted file mode 100644 index 3b74b8afe..000000000 --- a/plutarch-test/goldens/bool.pand.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf (program 1.0.0 False) -ft (program 1.0.0 False) -tt (program 1.0.0 True) -ff (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.uplc.golden b/plutarch-test/goldens/bool.pand.uplc.golden deleted file mode 100644 index e59d781e5..000000000 --- a/plutarch-test/goldens/bool.pand.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay False)))) -ft (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay True)))) -tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay True)))) -ff (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay False)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pnot.bench.golden b/plutarch-test/goldens/bool.pnot.bench.golden deleted file mode 100644 index 7bd18a8b3..000000000 --- a/plutarch-test/goldens/bool.pnot.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":14} -app {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pnot.uplc.eval.golden b/plutarch-test/goldens/bool.pnot.uplc.eval.golden deleted file mode 100644 index f9a2f86f0..000000000 --- a/plutarch-test/goldens/bool.pnot.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam (program 1.0.0 (\i0 -> force (force ifThenElse i1 (delay False) (delay True)))) -app (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pnot.uplc.golden b/plutarch-test/goldens/bool.pnot.uplc.golden deleted file mode 100644 index 8426644c8..000000000 --- a/plutarch-test/goldens/bool.pnot.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam (program 1.0.0 (\i0 -> force (force ifThenElse i1 (delay False) (delay True)))) -app (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) True)) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.bench.golden b/plutarch-test/goldens/bool.por.bench.golden deleted file mode 100644 index e6b134eec..000000000 --- a/plutarch-test/goldens/bool.por.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.laziness.bench.golden b/plutarch-test/goldens/bool.por.laziness.bench.golden deleted file mode 100644 index c12676d85..000000000 --- a/plutarch-test/goldens/bool.por.laziness.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -por {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} -op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.laziness.uplc.eval.golden b/plutarch-test/goldens/bool.por.laziness.uplc.eval.golden deleted file mode 100644 index ae0c94093..000000000 --- a/plutarch-test/goldens/bool.por.laziness.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -por (program 1.0.0 (delay True)) -op (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.laziness.uplc.golden b/plutarch-test/goldens/bool.por.laziness.uplc.golden deleted file mode 100644 index f66bc7186..000000000 --- a/plutarch-test/goldens/bool.por.laziness.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -por (program 1.0.0 ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error))) -op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.uplc.eval.golden b/plutarch-test/goldens/bool.por.uplc.eval.golden deleted file mode 100644 index 376cf2bb7..000000000 --- a/plutarch-test/goldens/bool.por.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf (program 1.0.0 True) -ft (program 1.0.0 True) -tt (program 1.0.0 True) -ff (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.uplc.golden b/plutarch-test/goldens/bool.por.uplc.golden deleted file mode 100644 index bcdd4ba13..000000000 --- a/plutarch-test/goldens/bool.por.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay False)))) -ft (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay True)))) -tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay True)))) -ff (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay False)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.uplc.eval.golden b/plutarch-test/goldens/bool.uplc.eval.golden new file mode 100644 index 000000000..afaff81bb --- /dev/null +++ b/plutarch-test/goldens/bool.uplc.eval.golden @@ -0,0 +1,21 @@ +pnot.lam (program 1.0.0 (\i0 -> force (force ifThenElse i1 (delay False) (delay True)))) +pnot.app (program 1.0.0 False) +pand.tf (program 1.0.0 False) +pand.ft (program 1.0.0 False) +pand.tt (program 1.0.0 True) +pand.ff (program 1.0.0 False) +pand.laziness.pand (program 1.0.0 (delay False)) +pand.laziness.op (program 1.0.0 False) +pand.laziness.pand.perror.false (program 1.0.0 error) +pand.laziness.pand.perror.true (program 1.0.0 error) +pand.laziness.pand.perror.op (program 1.0.0 error) +por.tf (program 1.0.0 True) +por.ft (program 1.0.0 True) +por.tt (program 1.0.0 True) +por.ff (program 1.0.0 False) +por.laziness.por (program 1.0.0 (delay True)) +por.laziness.op (program 1.0.0 True) +por.laziness.pand.perror.false (program 1.0.0 error) +por.laziness.pand.perror.true (program 1.0.0 error) +por.laziness.pand.perror.op.true (program 1.0.0 True) +por.laziness.pand.perror.op.false (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.uplc.golden b/plutarch-test/goldens/bool.uplc.golden new file mode 100644 index 000000000..06af53167 --- /dev/null +++ b/plutarch-test/goldens/bool.uplc.golden @@ -0,0 +1,21 @@ +pnot.lam (program 1.0.0 (\i0 -> force (force ifThenElse i1 (delay False) (delay True)))) +pnot.app (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) True)) +pand.tf (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay False)))) +pand.ft (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay True)))) +pand.tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay True)))) +pand.ff (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay False)))) +pand.laziness.pand (program 1.0.0 ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error))) +pand.laziness.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error)))) +pand.laziness.pand.perror.false (program 1.0.0 error) +pand.laziness.pand.perror.true (program 1.0.0 error) +pand.laziness.pand.perror.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay error)))) +por.tf (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay False)))) +por.ft (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay True)))) +por.tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay True)))) +por.ff (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay False)))) +por.laziness.por (program 1.0.0 ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error))) +por.laziness.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error)))) +por.laziness.pand.perror.false (program 1.0.0 error) +por.laziness.pand.perror.true (program 1.0.0 error) +por.laziness.pand.perror.op.true (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error)))) +por.laziness.pand.perror.op.false (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay error)))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index bf6dca34a..3dd4efe07 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -8,44 +8,36 @@ import Plutarch.Test spec :: Spec spec = do - -- TODO: remove the `it`s - describe "bool" $ do - describe "pnot" $ do - pgoldenSpec $ do - "lam" @> pnot - "app" @> pnot #$ pcon PTrue - it "true" $ (pnot #$ pcon PTrue) #@?= pcon PFalse - it "false" $ (pnot #$ pcon PFalse) #@?= pcon PTrue - describe "pand" $ do - pgoldenSpec $ do - "tf" @> pcon PTrue #&& pcon PFalse @-> passertNot - "ft" @> pcon PFalse #&& pcon PTrue @-> passertNot - "tt" @> pcon PTrue #&& pcon PTrue @-> passert - "ff" @> pcon PFalse #&& pcon PFalse @-> passertNot - describe "laziness" $ do - pgoldenSpec $ do - "pand" @> pand # pcon PFalse # pdelay perror @-> \p -> - passert $ pnot # pforce p - "op" @> pcon PFalse #&& perror @-> \p -> - passert $ pnot # p - it "pand.perror" $ do - pfails $ pand # pcon PFalse # perror - pfails $ pand # pcon PTrue # perror - pfails $ pcon PTrue #&& perror - describe "por" $ do - pgoldenSpec $ do - "tf" @> pcon PTrue #|| pcon PFalse @-> passert - "ft" @> pcon PFalse #|| pcon PTrue @-> passert - "tt" @> pcon PTrue #|| pcon PTrue @-> passert - "ff" @> pcon PFalse #|| pcon PFalse @-> passertNot - describe "laziness" $ do - pgoldenSpec $ do - "por" @> por # pcon PTrue # pdelay perror @-> \p -> - passert (pforce p) - "op" @> pcon PTrue #|| perror @-> \p -> - passert p - it "pand.perror" $ do - pfails $ por # pcon PFalse # perror - pfails $ por # pcon PTrue # perror - passert $ pcon PTrue #|| perror - pfails $ pcon PFalse #|| perror + describe "bool" . pgoldenSpec $ do + "pnot" @\ do + "lam" @> pnot + "app" @> pnot # (pcon PTrue) @-> passertNot + "pand" @\ do + "tf" @> pcon PTrue #&& pcon PFalse @-> passertNot + "ft" @> pcon PFalse #&& pcon PTrue @-> passertNot + "tt" @> pcon PTrue #&& pcon PTrue @-> passert + "ff" @> pcon PFalse #&& pcon PFalse @-> passertNot + "laziness" @\ do + "pand" @> pand # pcon PFalse # pdelay perror @-> \p -> + passert $ pnot # pforce p + "op" @> pcon PFalse #&& perror @-> \p -> + passert $ pnot # p + "pand.perror" @\ do + "false" @> pand # pcon PFalse # perror @-> pfails + "true" @> pand # pcon PTrue # perror @-> pfails + "op" @> pcon PTrue #&& perror @-> pfails + "por" @\ do + "tf" @> pcon PTrue #|| pcon PFalse @-> passert + "ft" @> pcon PFalse #|| pcon PTrue @-> passert + "tt" @> pcon PTrue #|| pcon PTrue @-> passert + "ff" @> pcon PFalse #|| pcon PFalse @-> passertNot + "laziness" @\ do + "por" @> por # pcon PTrue # pdelay perror @-> \p -> + passert (pforce p) + "op" @> pcon PTrue #|| perror @-> \p -> + passert p + "pand.perror" @\ do + "false" @> por # pcon PFalse # perror @-> pfails + "true" @> por # pcon PTrue # perror @-> pfails + "op.true" @> pcon PTrue #|| perror @-> psucceeds + "op.false" @> pcon PFalse #|| perror @-> pfails From 9f56f874028cf9571cda2c88b7aabd96511a62f9 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 14:13:25 -0500 Subject: [PATCH 033/584] Improve assert fail message inside goldens Dispay the golden hierarchy --- plutarch-test/src/Plutarch/Test/Golden.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 8363f9d93..74331fc6e 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -8,6 +8,7 @@ module Plutarch.Test.Golden ( -- * Internal TermExpectation, + goldenKeyString, ) where import qualified Data.Aeson.Text as Aeson @@ -84,6 +85,9 @@ instance HasGoldenValue (TermExpectation s a) where newtype GoldenKey = GoldenKey Text deriving newtype (Eq, Show, Ord, IsString) +goldenKeyString :: GoldenKey -> String +goldenKeyString (GoldenKey s) = T.unpack s + instance Semigroup GoldenKey where GoldenKey s1 <> GoldenKey s2 = GoldenKey $ s1 <> "." <> s2 @@ -137,11 +141,11 @@ pgoldenSpec map = do it "bench" $ pureGoldenTextFile (goldenPathWith "bench") $ combineGoldens $ fmap goldenValueBench <$> bs - let asserts = flip mapMaybe bs $ \(_, b) -> do - goldenValueExpectation b + let asserts = flip mapMaybe bs $ \(k, b) -> do + (k,) <$> goldenValueExpectation b unless (null asserts) $ do - it "asserts" $ do - forM_ asserts id + forM_ asserts $ \(k, v) -> + it (goldenKeyString $ "" <> k <> "assert") v currentGoldenKey :: HasCallStack => forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey currentGoldenKey = do From 165df37419a6128557365cb7a3666df5e58cdc19 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 16 Feb 2022 20:53:15 +0000 Subject: [PATCH 034/584] Update plutus and haskell-language-server This was a bit of a PITA, and required a lot of changes, some backward incompatible. --- Plutarch/Api/V1.hs | 2 - Plutarch/Api/V1/Crypto.hs | 26 +-- Plutarch/Api/V1/Scripts.hs | 15 +- Plutarch/Api/V1/Value.hs | 6 +- Plutarch/Evaluate.hs | 81 ++++----- Plutarch/Internal.hs | 32 ++-- Plutarch/Lift.hs | 52 ++++-- Plutarch/Rec.hs | 10 +- flake.lock | 131 +++++++------ flake.nix | 364 +++++++++++++++++++------------------ 10 files changed, 355 insertions(+), 364 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index d6328108b..b519565cd 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -31,8 +31,6 @@ module Plutarch.Api.V1 ( -- ** Crypto Crypto.PPubKeyHash (PPubKeyHash), - Crypto.PPubKey (PPubKey), - Crypto.PSignature (PSignature), -- ** DCert DCert.PDCert ( diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index 920843f99..b80c7e370 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -3,16 +3,12 @@ module Plutarch.Api.V1.Crypto ( PPubKeyHash (PPubKeyHash), - PPubKey (PPubKey), - PSignature (PSignature), ) where import qualified Plutus.V1.Ledger.Api as Plutus -import qualified Plutus.V1.Ledger.Crypto as PlutusCrypto -import qualified PlutusTx.Builtins.Internal as PT import Plutarch.Lift ( - DerivePConstantViaNewtype (DerivePConstantViaNewtype), + DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), PLifted, PUnsafeLiftDecl, ) @@ -23,24 +19,6 @@ newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) instance PUnsafeLiftDecl PPubKeyHash where type PLifted PPubKeyHash = Plutus.PubKeyHash deriving via - (DerivePConstantViaNewtype Plutus.PubKeyHash PPubKeyHash PByteString) + (DerivePConstantViaBuiltin Plutus.PubKeyHash PPubKeyHash PByteString) instance (PConstant Plutus.PubKeyHash) - -newtype PPubKey (s :: S) = PPubKey (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PPubKey PByteString) - -instance PUnsafeLiftDecl PPubKey where type PLifted PPubKey = PlutusCrypto.PubKey -deriving via - (DerivePConstantViaNewtype PlutusCrypto.PubKey PPubKey PByteString) - instance - (PConstant PlutusCrypto.PubKey) - -newtype PSignature (s :: S) = PSignature (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PSignature PByteString) - -instance PUnsafeLiftDecl PSignature where type PLifted PSignature = PlutusCrypto.Signature -deriving via - (DerivePConstantViaNewtype PlutusCrypto.Signature PSignature PByteString) - instance - (PConstant PlutusCrypto.Signature) diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index 2e02827f6..cda6d5aa7 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -12,10 +12,9 @@ module Plutarch.Api.V1.Scripts ( ) where import qualified Plutus.V1.Ledger.Api as Plutus -import qualified PlutusTx.Builtins.Internal as PT import Plutarch.Lift ( - DerivePConstantViaNewtype (DerivePConstantViaNewtype), + DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), PLifted, PUnsafeLiftDecl, ) @@ -25,26 +24,26 @@ newtype PDatum (s :: S) = PDatum (Term s PData) deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PDatum PData) instance PUnsafeLiftDecl PDatum where type PLifted PDatum = Plutus.Datum -deriving via (DerivePConstantViaNewtype Plutus.Datum PDatum PData) instance (PConstant Plutus.Datum) +deriving via (DerivePConstantViaBuiltin Plutus.Datum PDatum PData) instance (PConstant Plutus.Datum) newtype PRedeemer (s :: S) = PRedeemer (Term s PData) deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PRedeemer PData) instance PUnsafeLiftDecl PRedeemer where type PLifted PRedeemer = Plutus.Redeemer -deriving via (DerivePConstantViaNewtype Plutus.Redeemer PRedeemer PData) instance (PConstant Plutus.Redeemer) +deriving via (DerivePConstantViaBuiltin Plutus.Redeemer PRedeemer PData) instance (PConstant Plutus.Redeemer) newtype PDatumHash (s :: S) = PDatumHash (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PDatumHash PByteString) instance PUnsafeLiftDecl PDatumHash where type PLifted PDatumHash = Plutus.DatumHash -deriving via (DerivePConstantViaNewtype Plutus.DatumHash PDatumHash PByteString) instance (PConstant Plutus.DatumHash) +deriving via (DerivePConstantViaBuiltin Plutus.DatumHash PDatumHash PByteString) instance (PConstant Plutus.DatumHash) newtype PStakeValidatorHash (s :: S) = PStakeValidatorHash (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PStakeValidatorHash PByteString) instance PUnsafeLiftDecl PStakeValidatorHash where type PLifted PStakeValidatorHash = Plutus.StakeValidatorHash deriving via - (DerivePConstantViaNewtype Plutus.StakeValidatorHash PStakeValidatorHash PByteString) + (DerivePConstantViaBuiltin Plutus.StakeValidatorHash PStakeValidatorHash PByteString) instance (PConstant Plutus.StakeValidatorHash) @@ -53,7 +52,7 @@ newtype PRedeemerHash (s :: S) = PRedeemerHash (Term s PByteString) instance PUnsafeLiftDecl PRedeemerHash where type PLifted PRedeemerHash = Plutus.RedeemerHash deriving via - (DerivePConstantViaNewtype Plutus.RedeemerHash PRedeemerHash PByteString) + (DerivePConstantViaBuiltin Plutus.RedeemerHash PRedeemerHash PByteString) instance (PConstant Plutus.RedeemerHash) @@ -62,6 +61,6 @@ newtype PValidatorHash (s :: S) = PValidatorHash (Term s PByteString) instance PUnsafeLiftDecl PValidatorHash where type PLifted PValidatorHash = Plutus.ValidatorHash deriving via - (DerivePConstantViaNewtype Plutus.ValidatorHash PValidatorHash PByteString) + (DerivePConstantViaBuiltin Plutus.ValidatorHash PValidatorHash PByteString) instance (PConstant Plutus.ValidatorHash) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 0b1655448..16063f2a5 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -8,10 +8,10 @@ module Plutarch.Api.V1.Value ( ) where import qualified Plutus.V1.Ledger.Api as Plutus -import qualified PlutusTx.Builtins.Internal as PT import Plutarch.Api.V1.AssocMap (PMap) import Plutarch.Lift ( + DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), PLifted, PUnsafeLiftDecl, @@ -23,7 +23,7 @@ newtype PTokenName (s :: S) = PTokenName (Term s PByteString) instance PUnsafeLiftDecl PTokenName where type PLifted PTokenName = Plutus.TokenName deriving via - (DerivePConstantViaNewtype Plutus.TokenName PTokenName PByteString) + (DerivePConstantViaBuiltin Plutus.TokenName PTokenName PByteString) instance (PConstant Plutus.TokenName) @@ -32,7 +32,7 @@ newtype PCurrencySymbol (s :: S) = PCurrencySymbol (Term s PByteString) instance PUnsafeLiftDecl PCurrencySymbol where type PLifted PCurrencySymbol = Plutus.CurrencySymbol deriving via - (DerivePConstantViaNewtype Plutus.CurrencySymbol PCurrencySymbol PByteString) + (DerivePConstantViaBuiltin Plutus.CurrencySymbol PCurrencySymbol PByteString) instance (PConstant Plutus.CurrencySymbol) diff --git a/Plutarch/Evaluate.hs b/Plutarch/Evaluate.hs index e9eab2530..16086f962 100644 --- a/Plutarch/Evaluate.hs +++ b/Plutarch/Evaluate.hs @@ -1,74 +1,59 @@ {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} -module Plutarch.Evaluate (evaluateBudgetedScript, evaluateScript) where +module Plutarch.Evaluate (evaluateBudgetedScript, evaluateScript, evalScript, evalScript', EvalError) where -import Control.Monad.Except (runExceptT) import Data.Text (Text) import Plutus.V1.Ledger.Scripts (Script (Script)) import qualified Plutus.V1.Ledger.Scripts as Scripts -import PlutusCore (FreeVariableError, defaultVersion) import qualified PlutusCore as PLC import PlutusCore.Evaluation.Machine.ExBudget ( ExBudget (ExBudget), ExRestrictingBudget (ExRestrictingBudget), minusExBudget, ) -import qualified PlutusCore.Evaluation.Machine.ExMemory as ExMemory +import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) import UntypedPlutusCore ( Program (Program), Term, - termMapNames, - unNameDeBruijn, ) -import UntypedPlutusCore.DeBruijn (deBruijnTerm) -import qualified UntypedPlutusCore.Evaluation.Machine.Cek as UPLC +import qualified UntypedPlutusCore as UPLC +import qualified UntypedPlutusCore.Evaluation.Machine.Cek as Cek --- Stolen from pluto, thanks Morgan - -{- | Evaluate a script, returning the trace log and term result. - - This is same as `Plutus.V1.Ledger.Scripts.evaluateScript`, but returns the - result as well. --} +{-# DEPRECATED evaluateScript "use evalScript" #-} evaluateScript :: Script -> Either Scripts.ScriptError (ExBudget, [Text], Script) -evaluateScript = evaluateBudgetedScript $ ExBudget (ExMemory.ExCPU maxInt) (ExMemory.ExMemory maxInt) +evaluateScript = evaluateBudgetedScript $ ExBudget (ExCPU maxInt) (ExMemory maxInt) where maxInt = fromIntegral (maxBound :: Int) +{-# DEPRECATED evaluateBudgetedScript "use evalScript'" #-} evaluateBudgetedScript :: ExBudget -> Script -> Either Scripts.ScriptError (ExBudget, [Text], Script) -evaluateBudgetedScript totalBudget s = do - p <- case Scripts.mkTermToEvaluate s of - Right p -> pure p - Left e -> Left . Scripts.MalformedScript $ show e - let (logOut, usedBudget, result) = evaluateCekBudgetedTrace totalBudget p - named <- case result of - Right term -> pure term - Left errWithCause@(UPLC.ErrorWithCause err cause) -> - Left $ case err of - UPLC.InternalEvaluationError internalEvalError -> - Scripts.EvaluationException (show errWithCause) (show internalEvalError) - UPLC.UserEvaluationError evalError -> - -- We use `show` here because plutus doesn't expose mkError - Scripts.EvaluationError logOut (show (evalError, cause)) - term' <- runExceptT @FreeVariableError (deBruijnTerm named) - let Right term = term' - let s' = Script $ Program () (defaultVersion ()) $ termMapNames unNameDeBruijn term - pure (usedBudget, logOut, s') +evaluateBudgetedScript budget script = case evalScript' budget script of + (Right res, remaining, logs) -> Right (remaining, logs, res) + (Left _, _, logs) -> Left $ Scripts.EvaluationError logs "evaluation failed" + +type EvalError = (Cek.CekEvaluationException PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun) + +-- | Evaluate a script with a big budget, returning the trace log and term result. +evalScript :: Script -> (Either EvalError Script, ExBudget, [Text]) +evalScript script = evalScript' budget script + where + -- from https://github.com/input-output-hk/cardano-node/blob/master/configuration/cardano/mainnet-alonzo-genesis.json#L17 + budget = ExBudget (ExCPU 10000000000) (ExMemory 10000000) + +-- | Evaluate a script with a specific budget, returning the trace log and term result. +evalScript' :: ExBudget -> Script -> (Either (Cek.CekEvaluationException PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun) Script, ExBudget, [Text]) +evalScript' budget (Script (Program _ _ t)) = case evalTerm budget (UPLC.termMapNames UPLC.fakeNameDeBruijn $ t) of + (res, remaining, logs) -> (Script . Program () (PLC.defaultVersion ()) . UPLC.termMapNames UPLC.unNameDeBruijn <$> res, remaining, logs) -{- | Evaluate a program in the CEK machine against the given budget, with the - usual text dynamic builtins and tracing, additionally returning the trace - output. --} -evaluateCekBudgetedTrace :: - -- | The resource budget which must not be exceeded during evaluation +evalTerm :: ExBudget -> - Program PLC.Name PLC.DefaultUni PLC.DefaultFun () -> - ( [Text] + Term PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun () -> + ( Either + EvalError + (Term PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun ()) , ExBudget - , Either - (UPLC.CekEvaluationException PLC.DefaultUni PLC.DefaultFun) - (Term PLC.Name PLC.DefaultUni PLC.DefaultFun ()) + , [Text] ) -evaluateCekBudgetedTrace budget (Program _ _ t) = - case UPLC.runCek PLC.defaultCekParameters (UPLC.restricting (ExRestrictingBudget budget)) UPLC.logEmitter t of - (errOrRes, UPLC.RestrictingSt (ExRestrictingBudget final), logs) -> (logs, budget `minusExBudget` final, errOrRes) +evalTerm budget t = + case Cek.runCekDeBruijn PLC.defaultCekParameters (Cek.restricting (ExRestrictingBudget budget)) Cek.logEmitter t of + (errOrRes, Cek.RestrictingSt (ExRestrictingBudget final), logs) -> (errOrRes, budget `minusExBudget` final, logs) diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 93273b0e9..6f9882530 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -39,8 +39,8 @@ import qualified Data.Map.Lazy as M import qualified Data.Set as S import qualified Flat.Run as F import GHC.Stack (HasCallStack) -import Numeric.Natural (Natural) -import Plutarch.Evaluate (evaluateScript) +import GHC.Word (Word64) +import Plutarch.Evaluate (evalScript) import Plutus.V1.Ledger.Scripts (Script (Script)) import PlutusCore (Some (Some), ValueOf (ValueOf)) import qualified PlutusCore as PLC @@ -68,8 +68,8 @@ data HoistedTerm = HoistedTerm Dig RawTerm deriving stock (Show) data RawTerm - = RVar Natural - | RLamAbs Natural RawTerm + = RVar Word64 + | RLamAbs Word64 RawTerm | RApply RawTerm [RawTerm] | RForce RawTerm | RDelay RawTerm @@ -132,7 +132,7 @@ type role Term phantom representational de-Bruijn index needed to reach its own level given the level it itself is instantiated with. -} -newtype Term (s :: S) (a :: PType) = Term {asRawTerm :: Natural -> TermResult} +newtype Term (s :: S) (a :: PType) = Term {asRawTerm :: Word64 -> TermResult} {- | *Closed* terms with no free variables. @@ -167,14 +167,14 @@ plam' f = Term $ \i -> t -> mapTerm (RLamAbs 0) t where -- 0 is 1 - getArity :: RawTerm -> Maybe Natural + getArity :: RawTerm -> Maybe Word64 -- We only do this if it's hoisted, since it's only safe if it doesn't -- refer to any of the variables in the wrapping lambda. getArity (RHoisted (HoistedTerm _ (RLamAbs n _))) = Just n getArity (RHoisted (HoistedTerm _ t)) = getArityBuiltin t getArity t = getArityBuiltin t - getArityBuiltin :: RawTerm -> Maybe Natural + getArityBuiltin :: RawTerm -> Maybe Word64 getArityBuiltin (RBuiltin PLC.AddInteger) = Just 1 getArityBuiltin (RBuiltin PLC.SubtractInteger) = Just 1 getArityBuiltin (RBuiltin PLC.MultiplyInteger) = Just 1 @@ -320,14 +320,14 @@ phoistAcyclic :: HasCallStack => ClosedTerm a -> Term s a phoistAcyclic t = case asRawTerm t 0 of -- Built-ins are smaller than variable references t'@(getTerm -> RBuiltin _) -> Term $ \_ -> t' - t' -> case evaluateScript . Script $ UPLC.Program () (PLC.defaultVersion ()) (compile' t') of - Right _ -> + t' -> case evalScript . Script . UPLC.Program () (PLC.defaultVersion ()) $ compile' t' of + (Right _, _, _) -> let hoisted = HoistedTerm (hashRawTerm . getTerm $ t') (getTerm t') in Term $ \_ -> TermResult (RHoisted hoisted) (hoisted : getDeps t') - Left e -> error $ "Hoisted term errs! " <> show e + (Left e, _, _) -> error $ "Hoisted term errs! " <> show e -- Couldn't find a definition for this in plutus-core -subst :: Natural -> (Natural -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () +subst :: Word64 -> (Word64 -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () subst idx x (UPLC.Apply () yx yy) = UPLC.Apply () (subst idx x yx) (subst idx x yy) subst idx x (UPLC.LamAbs () name y) = UPLC.LamAbs () name (subst (idx + 1) x y) subst idx x (UPLC.Delay () y) = UPLC.Delay () (subst idx x y) @@ -338,8 +338,8 @@ subst idx _ (UPLC.Var () (DeBruijn (Index idx'))) | idx < idx' = UPLC.Var () (De subst _ _ y = y rawTermToUPLC :: - (HoistedTerm -> Natural -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> - Natural -> + (HoistedTerm -> Word64 -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> + Word64 -> RawTerm -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () rawTermToUPLC _ _ (RVar i) = UPLC.Var () (DeBruijn . Index $ i + 1) -- Why the fuck does it start from 1 and not 0? @@ -373,14 +373,14 @@ compile' t = let t' = getTerm t deps = getDeps t - f :: Natural -> Maybe Natural -> (Bool, Maybe Natural) + f :: Word64 -> Maybe Word64 -> (Bool, Maybe Word64) f n Nothing = (True, Just n) f _ (Just n) = (False, Just n) g :: HoistedTerm -> - (M.Map Dig Natural, [(Natural, RawTerm)], Natural) -> - (M.Map Dig Natural, [(Natural, RawTerm)], Natural) + (M.Map Dig Word64, [(Word64, RawTerm)], Word64) -> + (M.Map Dig Word64, [(Word64, RawTerm)], Word64) g (HoistedTerm hash term) (map, defs, n) = case M.alterF (f n) hash map of (True, map) -> (map, (n, term) : defs, n + 1) (False, map) -> (map, defs, n) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index d9ad2380b..adecd02ef 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -15,6 +15,7 @@ module Plutarch.Lift ( PLift, DerivePConstantDirect (..), DerivePConstantViaNewtype (..), + DerivePConstantViaBuiltin (..), -- * Internal use PUnsafeLiftDecl (..), @@ -23,12 +24,14 @@ module Plutarch.Lift ( import Data.Coerce import Data.Kind (Type) import GHC.Stack (HasCallStack) -import Plutarch.Evaluate (evaluateScript) +import Plutarch.Evaluate (EvalError, evalScript) import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInternal) import qualified Plutus.V1.Ledger.Scripts as Scripts import qualified PlutusCore as PLC -import PlutusCore.Constant (readKnownConstant) +import PlutusCore.Builtin (ReadKnownError, readKnownConstant) import PlutusCore.Evaluation.Machine.Exception (ErrorWithCause, MachineError) +import PlutusTx (BuiltinData, Data, builtinDataToData, dataToBuiltinData) +import PlutusTx.Builtins.Class (FromBuiltin, ToBuiltin, fromBuiltin, toBuiltin) import qualified UntypedPlutusCore as UPLC class (PConstant (PLifted p), PConstanted (PLifted p) ~ p) => PUnsafeLiftDecl (p :: PType) where @@ -64,30 +67,31 @@ pconstant x = punsafeConstantInternal $ PLC.someValue @(PConstantRepr (PLifted p -- | Error during script evaluation. data LiftError - = LiftError_ScriptError Scripts.ScriptError - | LiftError_EvalException (ErrorWithCause (MachineError PLC.DefaultFun) ()) + = LiftError_EvalError EvalError + | LiftError_ReadKnownError (ErrorWithCause ReadKnownError (MachineError PLC.DefaultFun)) | LiftError_FromRepr - | LiftError_WrongRepr - deriving stock (Eq, Show) + deriving stock (Eq) {- | Convert a Plutarch term to the associated Haskell value. Fail otherwise. This will fully evaluate the arbitrary closed expression, and convert the resulting value. -} plift' :: forall p. PUnsafeLiftDecl p => ClosedTerm p -> Either LiftError (PLifted p) -plift' prog = case evaluateScript (compile prog) of - Right (_, _, Scripts.unScript -> UPLC.Program _ _ term) -> +plift' prog = case evalScript (compile prog) of + (Right (Scripts.unScript -> UPLC.Program _ _ term), _, _) -> case readKnownConstant @_ @(PConstantRepr (PLifted p)) @(MachineError PLC.DefaultFun) Nothing term of Right r -> case pconstantFromRepr r of Just h -> Right h Nothing -> Left LiftError_FromRepr - Left e -> Left $ LiftError_EvalException e - Left e -> Left $ LiftError_ScriptError e + Left e -> Left $ LiftError_ReadKnownError e + (Left e, _, _) -> Left $ LiftError_EvalError e -- | Like `plift'` but throws on failure. plift :: forall p. (HasCallStack, PLift p) => ClosedTerm p -> PLifted p plift prog = case plift' prog of Right x -> x - Left e -> error $ "plift failed: " <> show e + Left LiftError_FromRepr -> error "plift failed because of pconstantFromRepr" + Left (LiftError_ReadKnownError _) -> error "plift failed because of an internal error in plutus-core" + Left (LiftError_EvalError e) -> error $ "plift failed because of an erring term: " <> show e -- TODO: Add haddock newtype DerivePConstantDirect (h :: Type) (p :: PType) = DerivePConstantDirect h @@ -109,3 +113,29 @@ instance (PLift p, PLift p', Coercible h (PLifted p')) => PConstant (DerivePCons type PConstanted (DerivePConstantViaNewtype h p p') = p pconstantToRepr x = pconstantToRepr @(PLifted p') $ coerce x pconstantFromRepr x = coerce $ pconstantFromRepr @(PLifted p') x + +class ToBuiltin' a arep | a -> arep where + toBuiltin' :: a -> arep + +class FromBuiltin' arep a | arep -> a where + fromBuiltin' :: arep -> a + +instance {-# OVERLAPPABLE #-} ToBuiltin a arep => ToBuiltin' a arep where + toBuiltin' = toBuiltin + +instance {-# OVERLAPPABLE #-} FromBuiltin arep a => FromBuiltin' arep a where + fromBuiltin' = fromBuiltin + +instance ToBuiltin' Data BuiltinData where + toBuiltin' = dataToBuiltinData + +instance FromBuiltin' BuiltinData Data where + fromBuiltin' = builtinDataToData + +newtype DerivePConstantViaBuiltin (h :: Type) (p :: PType) (p' :: PType) = DerivePConstantViaBuiltin h + +instance (PLift p, PLift p', Coercible h h', ToBuiltin' (PLifted p') h', FromBuiltin' h' (PLifted p')) => PConstant (DerivePConstantViaBuiltin h p p') where + type PConstantRepr (DerivePConstantViaBuiltin h p p') = PConstantRepr (PLifted p') + type PConstanted (DerivePConstantViaBuiltin h p p') = p + pconstantToRepr x = pconstantToRepr @(PLifted p') $ fromBuiltin' (coerce x :: h') + pconstantFromRepr x = coerce (toBuiltin' <$> pconstantFromRepr @(PLifted p') x :: Maybe h') diff --git a/Plutarch/Rec.hs b/Plutarch/Rec.hs index f89d7a6a8..03eb77638 100644 --- a/Plutarch/Rec.hs +++ b/Plutarch/Rec.hs @@ -21,7 +21,7 @@ import Control.Monad.Trans.State.Lazy (State, evalState, get, put) import Data.Functor.Compose (Compose (Compose, getCompose)) import Data.Kind (Type) import Data.Monoid (Dual (Dual, getDual), Endo (Endo, appEndo), Sum (Sum, getSum)) -import Numeric.Natural (Natural) +import GHC.Word (Word64) import Plutarch ( PlutusType (PInner, pcon', pmatch'), pcon, @@ -78,7 +78,7 @@ rmatch p f = p # arg where arg :: Term s (ScottEncoded r t) arg = Term (\i -> TermResult (RLamAbs (fieldCount (initial @r) - 1) $ rawArg i) []) - rawArg :: Natural -> RawTerm + rawArg :: Word64 -> RawTerm rawArg depth = getTerm $ asRawTerm (f $ variables depth) $ depth + fieldCount (initial @r) -- | Wrapped recursive let construct, tying into knot the recursive equations specified in the record fields. @@ -121,14 +121,14 @@ accessors = abstract Rank2.<$> variables 0 {- | A record of terms that each accesses a different variable in scope, outside in following the field order. -} -variables :: forall r s. (Rank2.Distributive r, Rank2.Traversable r) => Natural -> r (Term s) +variables :: forall r s. (Rank2.Distributive r, Rank2.Traversable r) => Word64 -> r (Term s) variables baseDepth = Rank2.cotraverse var id where var :: (r (Term s) -> Term s a) -> Term s a var ref = ref ordered ordered :: r (Term s) ordered = evalState (Rank2.traverse next $ initial @r) 0 - next :: f a -> State Natural (Term s a) + next :: f a -> State Word64 (Term s a) next _ = do i <- get let i' = succ i @@ -230,7 +230,7 @@ verifySoleConstructor f d = initial :: Rank2.Distributive r => r (Compose Maybe (Term s)) initial = Rank2.distribute Nothing -fieldCount :: Rank2.Foldable r => r f -> Natural +fieldCount :: Rank2.Foldable r => r f -> Word64 fieldCount = getSum . Rank2.foldMap (const $ Sum 1) -- | The raw Y-combinator term diff --git a/flake.lock b/flake.lock index da8ad9044..5ba2ad14d 100644 --- a/flake.lock +++ b/flake.lock @@ -32,23 +32,6 @@ "type": "github" } }, - "Win32-network": { - "flake": false, - "locked": { - "lastModified": 1636063162, - "narHash": "sha256-uvYEWalN62ETpH45/O7lNHo4rAIaJtYpLWdIcAkq3dA=", - "owner": "input-output-hk", - "repo": "Win32-network", - "rev": "2d1a01c7cbb9f68a1aefe2934aad6c70644ebfea", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "Win32-network", - "rev": "2d1a01c7cbb9f68a1aefe2934aad6c70644ebfea", - "type": "github" - } - }, "autodocodec": { "flake": false, "locked": { @@ -70,10 +53,10 @@ "flake": false, "locked": { "lastModified": 1603716527, - "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", + "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", "owner": "haskell", "repo": "cabal", - "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", + "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", "type": "github" }, "original": { @@ -86,11 +69,11 @@ "cabal-34": { "flake": false, "locked": { - "lastModified": 1622475795, - "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", + "lastModified": 1640353650, + "narHash": "sha256-N1t6M3/wqj90AEdRkeC8i923gQYUpzSr8b40qVOZ1Rk=", "owner": "haskell", "repo": "cabal", - "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", + "rev": "942639c18c0cd8ec53e0a6f8d120091af35312cd", "type": "github" }, "original": { @@ -103,11 +86,11 @@ "cabal-36": { "flake": false, "locked": { - "lastModified": 1640163203, - "narHash": "sha256-TwDWP2CffT0j40W6zr0J1Qbu+oh3nsF1lUx9446qxZM=", + "lastModified": 1641652457, + "narHash": "sha256-BlFPKP4C4HRUJeAbdembX1Rms1LD380q9s0qVDeoAak=", "owner": "haskell", "repo": "cabal", - "rev": "ecf418050c1821f25e2e218f1be94c31e0465df1", + "rev": "f27667f8ec360c475027dcaee0138c937477b070", "type": "github" }, "original": { @@ -282,11 +265,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1623875721, - "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", "owner": "numtide", "repo": "flake-utils", - "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", "type": "github" }, "original": { @@ -365,11 +348,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1642554756, - "narHash": "sha256-1+SN+z80HgKYshlCf8dRxwRojQzuwwsQ5uq14N/JP1Y=", + "lastModified": 1644887696, + "narHash": "sha256-o4gltv4npUl7+1gEQIcrRqZniwqC9kK8QsPaftlrawc=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "f9d5e67ca90926b244c0ad68815371d37582a149", + "rev": "6ff64aa49b88e75dd6e0bbd2823c2a92c9174fa5", "type": "github" }, "original": { @@ -381,11 +364,11 @@ "hackage-nix": { "flake": false, "locked": { - "lastModified": 1637291070, - "narHash": "sha256-hTX2Xo36i9MR6PNwA/89C8daKjxmx5ZS5lwR2Cbp8Yo=", + "lastModified": 1644369434, + "narHash": "sha256-WqU6f1OhSM0UHXFW8Mhhvhz0tcij+NQVtmb6sW4RiFw=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "6ea4ad5f4a5e2303cd64974329ba90ccc410a012", + "rev": "644a0d702abf84cdec62f4e620ff1034000e6146", "type": "github" }, "original": { @@ -397,11 +380,11 @@ "haskell-language-server": { "flake": false, "locked": { - "lastModified": 1642772345, - "narHash": "sha256-fjdNOcd0S35OAvMZu81/im32B7hSIimjs08VKQA58Mw=", + "lastModified": 1645014262, + "narHash": "sha256-f49So1teiroV+S7sbGTK4AhzUOXpoiQ26/fTjdIKkqc=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "f0bbc390b995953885506b755f4e4b5c6af618fb", + "rev": "96ea854debd92f9a54e2270b9b9a080c0ce6f3d1", "type": "github" }, "original": { @@ -413,16 +396,16 @@ "haskell-language-server_2": { "flake": false, "locked": { - "lastModified": 1638136578, - "narHash": "sha256-Reo9BQ12O+OX7tuRfaDPZPBpJW4jnxZetm63BxYncoM=", + "lastModified": 1643835246, + "narHash": "sha256-5LQHcQmi3mUGRgJu+X/m3jeM3kdkYjLD+KwgnxBlbeU=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "745ef26f406dbdd5e4a538585f8519af9f1ccb09", + "rev": "024ddc8b3904f8b8e8fe67ba6b9ebd8a4bd7ce76", "type": "github" }, "original": { "owner": "haskell", - "ref": "1.5.1", + "ref": "1.6.1.1", "repo": "haskell-language-server", "type": "github" } @@ -441,7 +424,7 @@ "nix-tools": "nix-tools", "nixpkgs": [ "haskell-nix", - "nixpkgs-2111" + "nixpkgs-unstable" ], "nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2105": "nixpkgs-2105", @@ -451,11 +434,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1642811877, - "narHash": "sha256-7YbbFF4ISWMcs5hHDfH7GkCSccvwEwhvKZ5D74Cuajo=", + "lastModified": 1644944726, + "narHash": "sha256-jJWdP/3Ne1y1akC3m9rSO5ItRoBc4UTdVQZBCuPmmrM=", "owner": "L-as", "repo": "haskell.nix", - "rev": "ac825b91c202947ec59b1a477003564cc018fcec", + "rev": "45c583b5580c130487eb5a342679f0bdbc2b23fc", "type": "github" }, "original": { @@ -559,6 +542,22 @@ } }, "iohk-nix": { + "flake": false, + "locked": { + "lastModified": 1643251385, + "narHash": "sha256-Czbd69lg0ARSZfC18V6h+gtPMioWDAEVPbiHgL2x9LM=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "9d6ee3dcb3482f791e40ed991ad6fc649b343ad4", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "repo": "iohk-nix", + "type": "github" + } + }, + "iohk-nix_2": { "flake": false, "locked": { "lastModified": 1626953580, @@ -595,11 +594,11 @@ "nix-tools": { "flake": false, "locked": { - "lastModified": 1636018067, - "narHash": "sha256-ng306fkuwr6V/malWtt3979iAC4yMVDDH2ViwYB6sQE=", + "lastModified": 1644395812, + "narHash": "sha256-BVFk/BEsTLq5MMZvdy3ZYHKfaS3dHrsKh4+tb5t5b58=", "owner": "input-output-hk", "repo": "nix-tools", - "rev": "ed5bd7215292deba55d6ab7a4e8c21f8b1564dda", + "rev": "d847c63b99bbec78bf83be2a61dc9f09b8a9ccc1", "type": "github" }, "original": { @@ -672,11 +671,11 @@ }, "nixpkgs-2105": { "locked": { - "lastModified": 1640283157, - "narHash": "sha256-6Ddfop+rKE+Gl9Tjp9YIrkfoYPzb8F80ergdjcq3/MY=", + "lastModified": 1642244250, + "narHash": "sha256-vWpUEqQdVP4srj+/YLJRTN9vjpTs4je0cdWKXPbDItc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dde1557825c5644c869c5efc7448dc03722a8f09", + "rev": "0fd9ee1aa36ce865ad273f4f07fdc093adeb5c00", "type": "github" }, "original": { @@ -688,11 +687,11 @@ }, "nixpkgs-2111": { "locked": { - "lastModified": 1640283207, - "narHash": "sha256-SCwl7ZnCfMDsuSYvwIroiAlk7n33bW8HFfY8NvKhcPA=", + "lastModified": 1644510859, + "narHash": "sha256-xjpVvL5ecbyi0vxtVl/Fh9bwGlMbw3S06zE5nUzFB8A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64c7e3388bbd9206e437713351e814366e0c3284", + "rev": "0d1d5d7e3679fec9d07f2eb804d9f9fdb98378d3", "type": "github" }, "original": { @@ -720,11 +719,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1641285291, - "narHash": "sha256-KYaOBNGar3XWTxTsYPr9P6u74KAqNq0wobEC236U+0c=", + "lastModified": 1644486793, + "narHash": "sha256-EeijR4guVHgVv+JpOX3cQO+1XdrkJfGmiJ9XVsVU530=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0432195a4b8d68faaa7d3d4b355260a3120aeeae", + "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292", "type": "github" }, "original": { @@ -791,23 +790,23 @@ "hackage-nix": "hackage-nix", "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", - "iohk-nix": "iohk-nix", + "iohk-nix": "iohk-nix_2", "nixpkgs": "nixpkgs_3", "pre-commit-hooks-nix": "pre-commit-hooks-nix_2", "sphinxcontrib-haddock": "sphinxcontrib-haddock", "stackage-nix": "stackage-nix" }, "locked": { - "lastModified": 1642004499, - "narHash": "sha256-LMAMixBJRYZ5wgINjp4rb8hifEGkXptX8Z5e2Ip8HeM=", + "lastModified": 1645203653, + "narHash": "sha256-HAi60mSkyMXzu1Wg3h6KdYZg+ufNMvX6obfcLo0ArL0=", "owner": "L-as", "repo": "plutus", - "rev": "6cceda4793ee125dc700c63ff780593e387696b0", + "rev": "5ec17953aae3ac9546f6d923201eb1dbb4e058bb", "type": "github" }, "original": { "owner": "L-as", - "ref": "master", + "ref": "ghc9", "repo": "plutus", "type": "github" } @@ -864,7 +863,6 @@ "root": { "inputs": { "Shrinker": "Shrinker", - "Win32-network": "Win32-network", "autodocodec": "autodocodec", "cardano-base": "cardano-base", "cardano-crypto": "cardano-crypto", @@ -878,6 +876,7 @@ "haskell-nix": "haskell-nix", "hercules-ci-effects": "hercules-ci-effects", "hs-memory": "hs-memory", + "iohk-nix": "iohk-nix", "nixpkgs": [ "haskell-nix", "nixpkgs-unstable" @@ -944,11 +943,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1642468901, - "narHash": "sha256-+Hu4m9i8v8Moey/C8fy8juyxB729JdsXz02cK8nJXLk=", + "lastModified": 1644887829, + "narHash": "sha256-tjUXJpqB7MMnqM4FF5cdtZipfratUcTKRQVA6F77sEQ=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "7544f8fd16bb92b7cf90cb51cb4ddc43173526de", + "rev": "db8bdef6588cf4f38e6069075ba76f0024381f68", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index cc2936ad5..8190e11e2 100644 --- a/flake.nix +++ b/flake.nix @@ -10,8 +10,10 @@ flake = false; }; - # https://github.com/input-output-hk/plutus/pull/4328 - inputs.plutus.url = "github:L-as/plutus?ref=master"; + inputs.iohk-nix.url = "github:input-output-hk/iohk-nix"; + inputs.iohk-nix.flake = false; + # we use sphinxcontrib-haddock input + inputs.plutus.url = "github:L-as/plutus?ref=ghc9"; # https://github.com/input-output-hk/cardano-prelude/pull/162 inputs.cardano-prelude.url = "github:locallycompact/cardano-prelude?rev=93f95047bb36a055bdd56fb0cafd887c072cdce2"; inputs.cardano-prelude.flake = false; @@ -22,9 +24,6 @@ # https://github.com/Quid2/flat/pull/27 inputs.flat.url = "github:Quid2/flat?rev=41a040c413351e021982bb78bd00f750628f8060"; inputs.flat.flake = false; - # https://github.com/input-output-hk/Win32-network/pull/10 - inputs.Win32-network.url = "github:input-output-hk/Win32-network?rev=2d1a01c7cbb9f68a1aefe2934aad6c70644ebfea"; - inputs.Win32-network.flake = false; # https://github.com/haskell-foundation/foundation/pull/555 inputs.foundation.url = "github:haskell-foundation/foundation?rev=0bb195e1fea06d144dafc5af9a0ff79af0a5f4a0"; inputs.foundation.flake = false; @@ -58,7 +57,7 @@ inputs.autodocodec.url = "github:srid/autodocodec/ghc921"; inputs.autodocodec.flake = false; - outputs = inputs@{ self, nixpkgs, haskell-nix, plutus, flake-compat, flake-compat-ci, hercules-ci-effects, ... }: + outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, flake-compat, flake-compat-ci, hercules-ci-effects, ... }: let extraSources = [ { @@ -148,8 +147,12 @@ perSystem = nixpkgs.lib.genAttrs supportedSystems; - nixpkgsFor = system: import nixpkgs { inherit system; overlays = [ haskell-nix.overlay ]; inherit (haskell-nix) config; }; - nixpkgsFor' = system: import nixpkgs { inherit system; inherit (haskell-nix) config; }; + nixpkgsFor = system: import nixpkgs { + inherit system; + overlays = [ haskell-nix.overlay (import "${iohk-nix}/overlays/crypto") ]; + inherit (haskell-nix) config; + }; + nixpkgsFor' = system: import nixpkgs { inherit system; }; ghcVersion = "ghc921"; @@ -215,8 +218,7 @@ primitive-unlifted < 1.0.0.0 package haskell-language-server - flags: +use-ghc-stub +pedantic +ignore-plugins-ghc-bounds -alternateNumberFormat -brittany -callhierarchy -class -eval -floskell -fourmolu -haddockComments -hlint -importLens -ormolu -refineImports -retrie -splice -stylishhaskell -tactic -importLens - + flags: +use-ghc-stub +pedantic +ignore-plugins-ghc-bounds -alternateNumberFormat -brittany -class -eval -haddockComments -hlint -retrie -splice -stylishhaskell -tactic ''; src = "${inputs.haskell-language-server}"; }; @@ -229,12 +231,12 @@ cardano-binary.ghcOptions = [ "-Wwarn" ]; cardano-binary.src = "${inputs.cardano-base}/binary"; cardano-binary.components.library.postUnpack = "\n"; - cardano-crypto-class.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ]; + cardano-crypto-class.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (nixpkgsFor system).libsodium-vrf ] ]; cardano-crypto-class.doHaddock = false; cardano-crypto-class.ghcOptions = [ "-Wwarn" ]; cardano-crypto-class.src = "${inputs.cardano-base}/cardano-crypto-class"; cardano-crypto-class.components.library.postUnpack = "\n"; - cardano-crypto-praos.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ]; + cardano-crypto-praos.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (nixpkgsFor system).libsodium-vrf ] ]; cardano-crypto.src = "${inputs.cardano-crypto}"; cardano-crypto.components.library.postUnpack = "\n"; cardano-prelude.doHaddock = false; # somehow above options are not applied? @@ -249,8 +251,8 @@ foundation.components.library.postUnpack = "\n"; memory.src = "${inputs.hs-memory}"; memory.components.library.postUnpack = "\n"; - plutus-core.src = "${inputs.plutus}/plutus-core"; - plutus-core.components.library.postUnpack = "\n"; + #plutus-core.src = "${inputs.plutus}/plutus-core"; + #plutus-core.components.library.postUnpack = "\n"; plutus-tx.src = "${inputs.plutus}/plutus-tx"; plutus-tx.components.library.postUnpack = "\n"; plutus-ledger-api.src = "${inputs.plutus}/plutus-ledger-api"; @@ -287,173 +289,173 @@ , size-based:template-haskell constraints: - OneTuple ^>= 0.3.1 - , Only ^>= 0.1 - , QuickCheck ^>= 2.14.2 - , StateVar ^>= 1.2.2 - , Stream ^>= 0.4.7.2 - , adjunctions ^>= 4.4 - , aeson ^>= 2.0.3.0 - , algebraic-graphs ^>= 0.6 - , ansi-terminal ^>= 0.11.1 - , ansi-wl-pprint ^>= 0.6.9 - , assoc ^>= 1.0.2 - , async ^>= 2.2.4 - , attoparsec ^>= 0.14.4 - , barbies ^>= 2.0.3.1 - , base-compat ^>= 0.12.1 - , base-compat-batteries ^>= 0.12.1 - , base-orphans ^>= 0.8.6 - , base16-bytestring ^>= 1.0.2.0 - , basement ^>= 0.0.12 - , bifunctors ^>= 5.5.11 - , bimap ^>= 0.4.0 - , bin ^>= 0.1.2 - , boring ^>= 0.2 - , boxes ^>= 0.1.5 - , cabal-doctest ^>= 1.0.9 - , call-stack ^>= 0.4.0 - , canonical-json ^>= 0.6.0.0 - , cardano-binary ^>= 1.5.0 - , cardano-crypto ^>= 1.1.0 - , cardano-crypto-class ^>= 2.0.0 - , cardano-prelude ^>= 0.1.0.0 - , case-insensitive ^>= 1.2.1.0 - , cassava ^>= 0.5.2.0 - , cborg ^>= 0.2.6.0 - , clock ^>= 0.8.2 - , colour ^>= 2.3.6 - , comonad ^>= 5.0.8 - , composition-prelude ^>= 3.0.0.2 - , concurrent-output ^>= 1.10.14 - , constraints ^>= 0.13.2 - , constraints-extras ^>= 0.3.2.1 - , contravariant ^>= 1.5.5 - , cryptonite ^>= 0.29 - , data-default ^>= 0.7.1.1 - , data-default-class ^>= 0.1.2.0 - , data-default-instances-containers ^>= 0.0.1 - , data-default-instances-dlist ^>= 0.0.1 - , data-default-instances-old-locale ^>= 0.0.1 - , data-fix ^>= 0.3.2 - , dec ^>= 0.0.4 - , dependent-map ^>= 0.4.0.0 - , dependent-sum ^>= 0.7.1.0 - , dependent-sum-template ^>= 0.1.1.1 - , deriving-aeson ^>= 0.2.8 - , deriving-compat ^>= 0.6 - , dictionary-sharing ^>= 0.1.0.0 - , distributive ^>= 0.6.2.1 - , dlist ^>= 1.0 - , dom-lt ^>= 0.2.3 - , double-conversion ^>= 2.0.2.0 - , erf ^>= 2.0.0.0 - , exceptions ^>= 0.10.4 - , extra ^>= 1.7.10 - , fin ^>= 0.2.1 - , flat ^>= 0.4.5 - , foldl ^>= 1.4.12 - , formatting ^>= 7.1.3 - , foundation ^>= 0.0.26.1 - , free ^>= 5.1.7 - , half ^>= 0.3.1 - , hashable ^>= 1.4.0.2 - , haskell-lexer ^>= 1.1 - , hedgehog ^>= 1.0.5 - , indexed-traversable ^>= 0.1.2 - , indexed-traversable-instances ^>= 0.1.1 - , integer-logarithms ^>= 1.0.3.1 - , invariant ^>= 0.5.5 - , kan-extensions ^>= 5.2.3 - , lazy-search ^>= 0.1.2.1 - , lazysmallcheck ^>= 0.6 - , lens ^>= 5.1 - , lifted-async ^>= 0.10.2.2 - , lifted-base ^>= 0.2.3.12 - , list-t ^>= 1.0.5.1 - , logict ^>= 0.7.0.3 - , megaparsec ^>= 9.2.0 - , memory ^>= 0.16.0 - , microlens ^>= 0.4.12.0 - , mmorph ^>= 1.2.0 - , monad-control ^>= 1.0.3.1 - , mono-traversable ^>= 1.0.15.3 - , monoidal-containers ^>= 0.6.2.0 - , mtl-compat ^>= 0.2.2 - , newtype ^>= 0.2.2.0 - , newtype-generics ^>= 0.6.1 - , nothunks ^>= 0.1.3 - , old-locale ^>= 1.0.0.7 - , old-time ^>= 1.1.0.3 - , optparse-applicative ^>= 0.16.1.0 - , parallel ^>= 3.2.2.0 - , parser-combinators ^>= 1.3.0 - , plutus-core ^>= 0.1.0.0 - , plutus-ledger-api ^>= 0.1.0.0 - , plutus-tx ^>= 0.1.0.0 - , pretty-show ^>= 1.10 - , prettyprinter ^>= 1.7.1 - , prettyprinter-configurable ^>= 0.1.0.0 - , primitive ^>= 0.7.3.0 - , profunctors ^>= 5.6.2 - , protolude ^>= 0.3.0 - , quickcheck-instances ^>= 0.3.27 - , ral ^>= 0.2.1 - , random ^>= 1.2.1 - , rank2classes ^>= 1.4.4 - , recursion-schemes ^>= 5.2.2.2 - , reflection ^>= 2.1.6 - , resourcet ^>= 1.2.4.3 - , safe ^>= 0.3.19 - , safe-exceptions ^>= 0.1.7.2 - , scientific ^>= 0.3.7.0 - , semialign ^>= 1.2.0.1 - , semigroupoids ^>= 5.3.7 - , semigroups ^>= 0.20 - , serialise ^>= 0.2.4.0 - , size-based ^>= 0.1.2.0 - , some ^>= 1.0.3 - , split ^>= 0.2.3.4 - , splitmix ^>= 0.1.0.4 - , stm ^>= 2.5.0.0 - , strict ^>= 0.4.0.1 - , syb ^>= 0.7.2.1 - , tagged ^>= 0.8.6.1 - , tasty ^>= 1.4.2.1 - , tasty-golden ^>= 2.3.5 - , tasty-hedgehog ^>= 1.1.0.0 - , tasty-hunit ^>= 0.10.0.3 - , temporary ^>= 1.3 - , terminal-size ^>= 0.3.2.1 - , testing-type-modifiers ^>= 0.1.0.1 - , text-short ^>= 0.1.5 - , th-abstraction ^>= 0.4.3.0 - , th-compat ^>= 0.1.3 - , th-expand-syns ^>= 0.4.9.0 - , th-extras ^>= 0.0.0.6 - , th-lift ^>= 0.8.2 - , th-lift-instances ^>= 0.1.19 - , th-orphans ^>= 0.13.12 - , th-reify-many ^>= 0.1.10 - , th-utilities ^>= 0.2.4.3 - , these ^>= 1.1.1.1 - , time-compat ^>= 1.9.6.1 - , transformers-base ^>= 0.4.6 - , transformers-compat ^>= 0.7.1 - , type-equality ^>= 1 - , typed-process ^>= 0.2.8.0 - , unbounded-delays ^>= 0.1.1.1 - , universe-base ^>= 1.1.3 - , unliftio-core ^>= 0.2.0.1 - , unordered-containers ^>= 0.2.16.0 - , uuid-types ^>= 1.0.5 - , vector ^>= 0.12.3.1 - , vector-algorithms ^>= 0.8.0.4 - , void ^>= 0.7.3 - , wcwidth ^>= 0.0.2 - , witherable ^>= 0.4.2 - , wl-pprint-annotated ^>= 0.1.0.1 - , word-array ^>= 0.1.0.0 + OneTuple >= 0.3.1 + , Only >= 0.1 + , QuickCheck >= 2.14.2 + , StateVar >= 1.2.2 + , Stream >= 0.4.7.2 + , adjunctions >= 4.4 + , aeson >= 2.0.3.0 + , algebraic-graphs >= 0.6 + , ansi-terminal >= 0.11.1 + , ansi-wl-pprint >= 0.6.9 + , assoc >= 1.0.2 + , async >= 2.2.4 + , attoparsec >= 0.14.4 + , barbies >= 2.0.3.1 + , base-compat >= 0.12.1 + , base-compat-batteries >= 0.12.1 + , base-orphans >= 0.8.6 + , base16-bytestring >= 1.0.2.0 + , basement >= 0.0.12 + , bifunctors >= 5.5.11 + , bimap >= 0.4.0 + , bin >= 0.1.2 + , boring >= 0.2 + , boxes >= 0.1.5 + , cabal-doctest >= 1.0.9 + , call-stack >= 0.4.0 + , canonical-json >= 0.6.0.0 + , cardano-binary >= 1.5.0 + , cardano-crypto >= 1.1.0 + , cardano-crypto-class >= 2.0.0 + , cardano-prelude >= 0.1.0.0 + , case-insensitive >= 1.2.1.0 + , cassava >= 0.5.2.0 + , cborg >= 0.2.6.0 + , clock >= 0.8.2 + , colour >= 2.3.6 + , comonad >= 5.0.8 + , composition-prelude >= 3.0.0.2 + , concurrent-output >= 1.10.14 + , constraints >= 0.13.2 + , constraints-extras >= 0.3.2.1 + , contravariant >= 1.5.5 + , cryptonite >= 0.29 + , data-default >= 0.7.1.1 + , data-default-class >= 0.1.2.0 + , data-default-instances-containers >= 0.0.1 + , data-default-instances-dlist >= 0.0.1 + , data-default-instances-old-locale >= 0.0.1 + , data-fix >= 0.3.2 + , dec >= 0.0.4 + , dependent-map >= 0.4.0.0 + , dependent-sum >= 0.7.1.0 + , dependent-sum-template >= 0.1.1.1 + , deriving-aeson >= 0.2.8 + , deriving-compat >= 0.6 + , dictionary-sharing >= 0.1.0.0 + , distributive >= 0.6.2.1 + , dlist >= 1.0 + , dom-lt >= 0.2.3 + , double-conversion >= 2.0.2.0 + , erf >= 2.0.0.0 + , exceptions >= 0.10.4 + , extra >= 1.7.10 + , fin >= 0.2.1 + , flat >= 0.4.5 + , foldl >= 1.4.12 + , formatting >= 7.1.3 + , foundation >= 0.0.26.1 + , free >= 5.1.7 + , half >= 0.3.1 + , hashable >= 1.4.0.2 + , haskell-lexer >= 1.1 + , hedgehog >= 1.0.5 + , indexed-traversable >= 0.1.2 + , indexed-traversable-instances >= 0.1.1 + , integer-logarithms >= 1.0.3.1 + , invariant >= 0.5.5 + , kan-extensions >= 5.2.3 + , lazy-search >= 0.1.2.1 + , lazysmallcheck >= 0.6 + , lens >= 5.1 + , lifted-async >= 0.10.2.2 + , lifted-base >= 0.2.3.12 + , list-t >= 1.0.5.1 + , logict >= 0.7.0.3 + , megaparsec >= 9.2.0 + , memory >= 0.16.0 + , microlens >= 0.4.12.0 + , mmorph >= 1.2.0 + , monad-control >= 1.0.3.1 + , mono-traversable >= 1.0.15.3 + , monoidal-containers >= 0.6.2.0 + , mtl-compat >= 0.2.2 + , newtype >= 0.2.2.0 + , newtype-generics >= 0.6.1 + , nothunks >= 0.1.3 + , old-locale >= 1.0.0.7 + , old-time >= 1.1.0.3 + , optparse-applicative >= 0.16.1.0 + , parallel >= 3.2.2.0 + , parser-combinators >= 1.3.0 + , plutus-core >= 0.1.0.0 + , plutus-ledger-api >= 0.1.0.0 + , plutus-tx >= 0.1.0.0 + , pretty-show >= 1.10 + , prettyprinter >= 1.7.1 + , prettyprinter-configurable >= 0.1.0.0 + , primitive >= 0.7.3.0 + , profunctors >= 5.6.2 + , protolude >= 0.3.0 + , quickcheck-instances >= 0.3.27 + , ral >= 0.2.1 + , random >= 1.2.1 + , rank2classes >= 1.4.4 + , recursion-schemes >= 5.2.2.2 + , reflection >= 2.1.6 + , resourcet >= 1.2.4.3 + , safe >= 0.3.19 + , safe-exceptions >= 0.1.7.2 + , scientific >= 0.3.7.0 + , semialign >= 1.2.0.1 + , semigroupoids >= 5.3.7 + , semigroups >= 0.20 + , serialise >= 0.2.4.0 + , size-based >= 0.1.2.0 + , some >= 1.0.3 + , split >= 0.2.3.4 + , splitmix >= 0.1.0.4 + , stm >= 2.5.0.0 + , strict >= 0.4.0.1 + , syb >= 0.7.2.1 + , tagged >= 0.8.6.1 + , tasty >= 1.4.2.1 + , tasty-golden >= 2.3.5 + , tasty-hedgehog >= 1.1.0.0 + , tasty-hunit >= 0.10.0.3 + , temporary >= 1.3 + , terminal-size >= 0.3.2.1 + , testing-type-modifiers >= 0.1.0.1 + , text-short >= 0.1.5 + , th-abstraction >= 0.4.3.0 + , th-compat >= 0.1.3 + , th-expand-syns >= 0.4.9.0 + , th-extras >= 0.0.0.6 + , th-lift >= 0.8.2 + , th-lift-instances >= 0.1.19 + , th-orphans >= 0.13.12 + , th-reify-many >= 0.1.10 + , th-utilities >= 0.2.4.3 + , these >= 1.1.1.1 + , time-compat >= 1.9.6.1 + , transformers-base >= 0.4.6 + , transformers-compat >= 0.7.1 + , type-equality >= 1 + , typed-process >= 0.2.8.0 + , unbounded-delays >= 0.1.1.1 + , universe-base >= 1.1.3 + , unliftio-core >= 0.2.0.1 + , unordered-containers >= 0.2.16.0 + , uuid-types >= 1.0.5 + , vector >= 0.12.3.1 + , vector-algorithms >= 0.8.0.4 + , void >= 0.7.3 + , wcwidth >= 0.0.2 + , witherable >= 0.4.2 + , wl-pprint-annotated >= 0.1.0.1 + , word-array >= 0.1.0.0 ''; projectForGhc = ghcName: flagDevelopment: system: From c8661066cdd7a6828305206fce87f40dcadedfb0 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 15:42:07 -0500 Subject: [PATCH 035/584] Minimize diff. --- plutarch-test/goldens/api.example.getFields.bench.golden | 2 +- plutarch-test/goldens/api.example.getFields.uplc.eval.golden | 2 +- plutarch-test/goldens/api.example.getFields.uplc.golden | 2 +- plutarch-test/src/Plutarch/ApiSpec.hs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plutarch-test/goldens/api.example.getFields.bench.golden b/plutarch-test/goldens/api.example.getFields.bench.golden index 0180cc841..b8e62d0c1 100644 --- a/plutarch-test/goldens/api.example.getFields.bench.golden +++ b/plutarch-test/goldens/api.example.getFields.bench.golden @@ -1 +1 @@ -1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file +0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.getFields.uplc.eval.golden b/plutarch-test/goldens/api.example.getFields.uplc.eval.golden index 55ff402af..4ce239055 100644 --- a/plutarch-test/goldens/api.example.getFields.uplc.eval.golden +++ b/plutarch-test/goldens/api.example.getFields.uplc.eval.golden @@ -1 +1 @@ -1 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file +0 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.getFields.uplc.golden b/plutarch-test/goldens/api.example.getFields.uplc.golden index 55ff402af..4ce239055 100644 --- a/plutarch-test/goldens/api.example.getFields.uplc.golden +++ b/plutarch-test/goldens/api.example.getFields.uplc.golden @@ -1 +1 @@ -1 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file +0 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index f3c7c906b..4dcdc1baa 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -50,7 +50,7 @@ spec = do "succeeds" @> checkSignatoryTermCont # pconstant aSig # ctx @-> psucceeds "fails" @> checkSignatoryTermCont # pconstant "41" # ctx @-> pfails describe "getFields" . pgoldenSpec $ do - "1" @> getFields + "0" @> getFields -------------------------------------------------------------------------------- From 4c25b40377a7e5657af9e22ef57e85b81c283f60 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 15:49:27 -0500 Subject: [PATCH 036/584] Undo #297, but keep the refactor --- ...pi.example.signatory.dev=true.bench.golden | 4 +- ...api.example.signatory.dev=true.uplc.golden | 4 +- ...pi.example.signatory.dev=true.bench.golden | 4 +- ...api.example.signatory.dev=true.uplc.golden | 4 +- plutarch-test/plutarch-test.cabal | 1 - plutarch-test/src/Plutarch/ApiSpec.hs | 21 +++--- plutarch-test/src/Plutarch/Test.hs | 1 - .../src/Plutarch/Test/Deterministic.hs | 75 ------------------- plutarch-test/src/Plutarch/Test/Golden.hs | 22 +++++- 9 files changed, 41 insertions(+), 95 deletions(-) delete mode 100644 plutarch-test/src/Plutarch/Test/Deterministic.hs diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden index e18bb58d1..a51a09bc0 100644 --- a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden +++ b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden @@ -1,4 +1,4 @@ cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} cont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":331} -termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":322} -termcont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":318} \ No newline at end of file +termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} +termcont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":331} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden index 5291c1592..0be2377ab 100644 --- a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden @@ -1,4 +1,4 @@ cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden index 60726e30c..55f35c191 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -1,2 +1,2 @@ -do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":322} -do.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":318} \ No newline at end of file +do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":382} +do.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":378} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden index c575ef839..ef5f6088f 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -1,2 +1,2 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure..." (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:41:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:41:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 60ea612fb..b309ea025 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -125,7 +125,6 @@ executable plutarch-test Plutarch.ScriptsSpec Plutarch.StringSpec Plutarch.Test - Plutarch.Test.Deterministic Plutarch.Test.Golden Plutarch.Test.ListSyntax Plutarch.TraceSpec diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index 4dcdc1baa..9feffde06 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -175,15 +175,18 @@ checkSignatoryCont = plam $ \ph ctx' -> checkSignatoryTermCont :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) checkSignatoryTermCont = plam $ \ph ctx' -> unTermCont $ do ctx <- tcont $ pletFields @["txInfo", "purpose"] ctx' - PSpending _ <- tcont $ pmatch $ hrecField @"purpose" ctx - let signatories = pfield @"signatories" # hrecField @"txInfo" ctx - pure $ - pif - (pelem # pdata ph # pfromData signatories) - -- Success! - (pconstant ()) - -- Signature not present. - perror + tcont (pmatch $ hrecField @"purpose" ctx) >>= \case + PSpending _ -> do + let signatories = pfield @"signatories" # hrecField @"txInfo" ctx + pure $ + pif + (pelem # pdata ph # pfromData signatories) + -- Success! + (pconstant ()) + -- Signature not present. + perror + _ -> + pure $ ptraceError "checkSignatoryCont: not a spending tx" getFields :: Term s (PData :--> PBuiltinList PData) getFields = phoistAcyclic $ plam $ \addr -> psndBuiltin #$ pasConstr # addr diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index b804ddea2..6eed67c3f 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -53,7 +53,6 @@ import Plutarch import Plutarch.Benchmark (benchmarkScript') import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evaluateScript) -import Plutarch.Test.Deterministic (compileD, evaluateScriptAlways) import Plutarch.Test.Golden import qualified Plutus.V1.Ledger.Scripts as Scripts diff --git a/plutarch-test/src/Plutarch/Test/Deterministic.hs b/plutarch-test/src/Plutarch/Test/Deterministic.hs deleted file mode 100644 index c8d018cba..000000000 --- a/plutarch-test/src/Plutarch/Test/Deterministic.hs +++ /dev/null @@ -1,75 +0,0 @@ -{-# LANGUAGE ImpredicativeTypes #-} - -module Plutarch.Test.Deterministic (compileD, evaluateScriptAlways) where - -import qualified Data.Text as T -import Plutarch (ClosedTerm, compile, perror) -import Plutarch.Evaluate (evaluateScript) -import qualified Plutus.V1.Ledger.Scripts as Scripts -import PlutusCore.Default ( - DefaultFun (Trace), - DefaultUni (DefaultUniString), - Some (Some), - ValueOf (ValueOf), - someValueOf, - ) -import UntypedPlutusCore ( - Program (Program), - Term (Apply, Builtin, Constant, Delay, Force, LamAbs), - ) -import qualified UntypedPlutusCore as UPLC - -{- Like `evaluateScript` but doesn't fail. Also returns `Script`. - - All evaluation failures are treated as equivalent to a `perror`. Plutus does - not provide an accurate way to tell if the program evalutes to `Error` or not; - see https://github.com/input-output-hk/plutus/issues/4270 --} -evaluateScriptAlways :: Scripts.Script -> Scripts.Script -evaluateScriptAlways script = - case evaluateScript script of - Left _ -> compile perror - Right (_, _, x) -> x - -{- Like `compile`, but the result is deterministic -} -compileD :: ClosedTerm a -> Scripts.Script -compileD p = rewriteTraces $ compile p - -{- Rewrite the string used by `Trace` so that the script becomes deterministic. -} -rewriteTraces :: Scripts.Script -> Scripts.Script -rewriteTraces = - walkScript $ \term -> do - -- Replace the 's' in `trace s`. - Apply () b@(Force _ (Builtin _ Trace)) (Constant () (Some (ValueOf DefaultUniString s))) <- pure term - let s' = replaceGhcPatternMatch s - pure $ Apply () b (Constant () (someValueOf DefaultUniString $ s')) - where - replaceGhcPatternMatch = \case - (T.stripPrefix "Pattern match failure" -> Just _) -> - "Pattern match failure..." - x -> x - -{- Walk the Plutus script, transforming matching terms -} -walkScript :: - forall term. - (term ~ UPLC.Term UPLC.DeBruijn DefaultUni DefaultFun ()) => - (term -> Maybe term) -> - Scripts.Script -> - Scripts.Script -walkScript f (Scripts.Script (Program ann ver term)) = - Scripts.Script (Program ann ver (go term)) - where - go :: term -> term - go term = - case f term of - Just term' -> term' - Nothing -> case term of - LamAbs ann name t -> - LamAbs ann name (go t) - Apply ann t1 t2 -> - Apply ann (go t1) (go t2) - Force ann t -> - Force ann (go t) - Delay ann t -> - Delay ann (go t) - x -> x diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 74331fc6e..c33286a4e 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -9,6 +9,8 @@ module Plutarch.Test.Golden ( -- * Internal TermExpectation, goldenKeyString, + evaluateScriptAlways, + compileD, ) where import qualified Data.Aeson.Text as Aeson @@ -36,9 +38,10 @@ import Data.String (IsString) import GHC.Stack (HasCallStack) import Plutarch import Plutarch.Benchmark (benchmarkScript') +import Plutarch.Evaluate (evaluateScript) import Plutarch.Internal (Term (Term, asRawTerm)) -import Plutarch.Test.Deterministic (compileD, evaluateScriptAlways) import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) +import qualified Plutus.V1.Ledger.Scripts as Scripts data GoldenValue = GoldenValue { goldenValueUplcPreEval :: Text @@ -160,3 +163,20 @@ currentGoldenKey = do -- Because, we need a function with this signature. unsafeClosedTerm :: Term s a -> ClosedTerm a unsafeClosedTerm t = Term $ asRawTerm t + +{- Like `evaluateScript` but doesn't fail. Also returns `Script`. + + All evaluation failures are treated as equivalent to a `perror`. Plutus does + not provide an accurate way to tell if the program evalutes to `Error` or not; + see https://github.com/input-output-hk/plutus/issues/4270 +-} +evaluateScriptAlways :: Scripts.Script -> Scripts.Script +evaluateScriptAlways script = + case evaluateScript script of + Left _ -> compile perror + Right (_, _, x) -> x + +-- TODO: Make this deterministic +-- See +compileD :: ClosedTerm a -> Scripts.Script +compileD = compile From 7b82b135fc817cdaf697620d618b6ab43849ce54 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Feb 2022 20:54:33 +0000 Subject: [PATCH 037/584] Fix examples and tests --- examples/Main.hs | 8 ++---- examples/Utils.hs | 1 - plutarch-test/plutarch-test.cabal | 12 +++++++-- plutarch-test/src/Plutarch/ScriptsSpec.hs | 30 ++++++++++++++++------- plutarch.cabal | 3 ++- 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/examples/Main.hs b/examples/Main.hs index 8b3641b42..6289b4c89 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -6,15 +6,13 @@ module Main (main) where import Test.Tasty import Test.Tasty.HUnit -import qualified Data.Aeson as Aeson -import Data.Maybe (fromJust) import GHC.IO.Encoding (setLocaleEncoding, utf8) import Plutarch (POpaque, popaque, printTerm) import Plutarch.Api.V1 (PScriptPurpose (PMinting)) import Plutarch.Internal (punsafeConstantInternal) import Plutarch.Prelude import Plutarch.Unsafe (punsafeBuiltin) -import Plutus.V1.Ledger.Value (CurrencySymbol (CurrencySymbol)) +import Plutus.V1.Ledger.Value (CurrencySymbol, currencySymbol) import Plutus.V2.Ledger.Contexts (ScriptPurpose (Minting)) import qualified PlutusCore as PLC import qualified PlutusTx @@ -207,6 +205,4 @@ uplcTests = ] dummyCurrency :: CurrencySymbol -dummyCurrency = - CurrencySymbol . fromJust . Aeson.decode $ - "\"1111111111111111111111111111111111111111111111111111111111111111\"" +dummyCurrency = currencySymbol "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" diff --git a/examples/Utils.hs b/examples/Utils.hs index 761bdc7d9..568f02343 100644 --- a/examples/Utils.hs +++ b/examples/Utils.hs @@ -86,7 +86,6 @@ standardTester = case evaluateScript $ compile x of Left (Scripts.EvaluationError _ _) -> mempty Left (Scripts.EvaluationException _ _) -> mempty - Left e -> assertFailure $ "Script is malformed: " <> show e Right (_, _, s) -> assertFailure $ "Script didn't err: " <> printScript s expectImpl :: HasCallStack => ClosedTerm PBool -> Assertion diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index d39ccff81..4fea6c9f0 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -96,11 +96,18 @@ library hs-source-dirs: src exposed-modules: Plutarch.Test + -- FIXME remove -Wwarn=deprecations + ghc-options: -Wwarn=deprecations + executable plutarch-test import: c, deps - type: exitcode-stdio-1.0 main-is: Main.hs hs-source-dirs: src + build-depends: + , base16-bytestring + , cborg + , ghc-prim + , serialise if impl(ghc >=9.0) other-modules: @@ -128,4 +135,5 @@ executable plutarch-test if flag(development) cpp-options: -DDevelopment - ghc-options: -threaded -rtsopts -with-rtsopts=-N + -- FIXME remove -Wwarn=deprecations + ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wwarn=deprecations diff --git a/plutarch-test/src/Plutarch/ScriptsSpec.hs b/plutarch-test/src/Plutarch/ScriptsSpec.hs index f149ee4ec..b2cff0387 100644 --- a/plutarch-test/src/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/src/Plutarch/ScriptsSpec.hs @@ -20,9 +20,14 @@ module Plutarch.ScriptsSpec ( import Data.Text (Text) import qualified Plutus.V1.Ledger.Api as Plutus -import qualified Plutus.V1.Ledger.Crypto as Plutus -import Data.Aeson.Extras (encodeSerialise) +import GHC.Prim (coerce) + +import qualified Codec.CBOR.Write as Write +import Codec.Serialise (Serialise, encode) +import Data.ByteString (ByteString) +import qualified Data.ByteString.Base16 as Base16 +import qualified Data.Text.Encoding as TE import Plutarch (ClosedTerm, POpaque, popaque) import Plutarch.Api.V1 ( PScriptContext, @@ -36,7 +41,7 @@ import Plutarch.Api.V1 ( type PStakeValidator, type PValidator, ) -import Plutarch.Api.V1.Crypto (PPubKey, PPubKeyHash, PSignature (PSignature)) +import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude import Plutarch.Test ( @@ -72,6 +77,13 @@ spec = do (goldenFilePath "goldens" prefix "hash") stakeValidatorHashEncoded +encodeSerialise :: Serialise a => a -> Text +encodeSerialise = TE.decodeUtf8 . Base16.encode . Write.toStrictByteString . encode + +type PSignature = PByteString +type PPubKey = PByteString +type PubKey = ByteString + {- | A parameterized Validator which may be unlocked by signing the Datum Message with the parameter PubKey. @@ -84,7 +96,7 @@ authorizedValidator :: Term s POpaque authorizedValidator authKey datumMessage redeemerSig _ctx = pif - (pverifySignature # pto authKey # datumMessage # pto redeemerSig) + (pverifySignature # authKey # datumMessage # redeemerSig) (popaque $ pcon PUnit) perror @@ -124,7 +136,7 @@ authorizedStakeValidator authHash _redeemer ctx = (popaque $ pcon PUnit) perror -adminPubKey :: Plutus.PubKey +adminPubKey :: PubKey adminPubKey = "11661a8aca9b09bb93eefda295b5da2be3f944d1f4253ab29da17db580f50d02d26218e33fbba5e0cc1b0c0cadfb67a5f9a90157dcc19eecd7c9373b0415c888" adminPubKeyHash :: Plutus.PubKeyHash @@ -144,7 +156,7 @@ authValidatorTerm = authorizedValidator (pconstant adminPubKey) (pasByteStr # datum) - (pcon $ PSignature $ pasByteStr # redeemer) + (pasByteStr # redeemer) ctx -- | `validatorHash` gets the Plutus `ValidatorHash` @@ -208,12 +220,12 @@ stakeValidatorEncoded = encodeSerialise authStakeValidatorCompiled Also note that this is not the addr1/CIP-0019 Address encoding of the script. -} validatorHashEncoded :: Text -validatorHashEncoded = encodeSerialise authValidatorHash +validatorHashEncoded = encodeSerialise (coerce authValidatorHash :: Plutus.BuiltinByteString) -- | The same goes for `CurrencySymbol` policySymEncoded :: Text -policySymEncoded = encodeSerialise authPolicySymbol +policySymEncoded = encodeSerialise (coerce authPolicySymbol :: Plutus.BuiltinByteString) -- | ... And `StakeValidatorHash` stakeValidatorHashEncoded :: Text -stakeValidatorHashEncoded = encodeSerialise authStakeValidatorHash +stakeValidatorHashEncoded = encodeSerialise (coerce authStakeValidatorHash :: Plutus.BuiltinByteString) diff --git a/plutarch.cabal b/plutarch.cabal index 192d8d27e..49e669a1f 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -168,7 +168,6 @@ test-suite examples Utils build-depends: - , aeson , base , bytestring , generics-sop @@ -187,3 +186,5 @@ test-suite examples --, shrinker if flag(development) cpp-options: -DDevelopment + + ghc-options: -Wwarn=deprecations From 05c677fb25591a1fedc3f8ea25959fddd1453c8a Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 15:50:44 -0500 Subject: [PATCH 038/584] Rename @> to @| Looks more readable, in conjunction with @\ - due to the consistent use of bars. Also distinguishes the @-> better. --- plutarch-test/plutarch-test.cabal | 1 - plutarch-test/src/Plutarch/ApiSpec.hs | 20 +++++----- plutarch-test/src/Plutarch/BoolSpec.hs | 42 ++++++++++---------- plutarch-test/src/Plutarch/ByteStringSpec.hs | 20 +++++----- plutarch-test/src/Plutarch/FieldSpec.hs | 36 ++++++++--------- plutarch-test/src/Plutarch/IntegerSpec.hs | 14 +++---- plutarch-test/src/Plutarch/ListSpec.hs | 30 +++++++------- plutarch-test/src/Plutarch/MonadicSpec.hs | 6 +-- plutarch-test/src/Plutarch/PIsDataSpec.hs | 10 ++--- plutarch-test/src/Plutarch/PLamSpec.hs | 6 +-- plutarch-test/src/Plutarch/PlutusTypeSpec.hs | 8 ++-- plutarch-test/src/Plutarch/RationalSpec.hs | 42 ++++++++++---------- plutarch-test/src/Plutarch/RecursionSpec.hs | 6 +-- plutarch-test/src/Plutarch/ScriptsSpec.hs | 6 +-- plutarch-test/src/Plutarch/StringSpec.hs | 10 ++--- plutarch-test/src/Plutarch/Test.hs | 2 +- plutarch-test/src/Plutarch/Test/Golden.hs | 12 +++--- plutarch-test/src/Plutarch/TraceSpec.hs | 18 ++++----- plutarch-test/src/Plutarch/UnitSpec.hs | 10 ++--- 19 files changed, 149 insertions(+), 150 deletions(-) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index b309ea025..28534c131 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -97,7 +97,6 @@ library hs-source-dirs: src exposed-modules: Plutarch.Test other-modules: - Plutarch.Test.Deterministic Plutarch.Test.Golden Plutarch.Test.ListSyntax diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index 9feffde06..5de768906 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -27,15 +27,15 @@ spec = do describe "api" $ do describe "ctx" $ do pgoldenSpec $ do - "term" @> ctx + "term" @| ctx "get" @\ do - "txInfo" @> pfromData (getTxInfo # ctx) @-> \p -> + "txInfo" @| pfromData (getTxInfo # ctx) @-> \p -> plift p @?= info - "mint" @> pforgetData (getMint #$ getTxInfo # ctx) @-> \p -> + "mint" @| pforgetData (getMint #$ getTxInfo # ctx) @-> \p -> plift p @?= toData mint - "credentials" @> getCredentials ctx @-> \p -> + "credentials" @| getCredentials ctx @-> \p -> plift p @?= [toData validator] - "sym" @> pfromData (getSym #$ pfromData $ getMint #$ getTxInfo # ctx) @-> \p -> + "sym" @| pfromData (getSym #$ pfromData $ getMint #$ getTxInfo # ctx) @-> \p -> plift p @?= sym describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to @@ -44,13 +44,13 @@ spec = do describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" "cont" @\ do - "succeeds" @> checkSignatoryCont # pconstant aSig # ctx @-> psucceeds - "fails" @> checkSignatoryCont # pconstant "41" # ctx @-> pfails + "succeeds" @| checkSignatoryCont # pconstant aSig # ctx @-> psucceeds + "fails" @| checkSignatoryCont # pconstant "41" # ctx @-> pfails "termcont" @\ do - "succeeds" @> checkSignatoryTermCont # pconstant aSig # ctx @-> psucceeds - "fails" @> checkSignatoryTermCont # pconstant "41" # ctx @-> pfails + "succeeds" @| checkSignatoryTermCont # pconstant aSig # ctx @-> psucceeds + "fails" @| checkSignatoryTermCont # pconstant "41" # ctx @-> pfails describe "getFields" . pgoldenSpec $ do - "0" @> getFields + "0" @| getFields -------------------------------------------------------------------------------- diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index 3dd4efe07..a28ff77e6 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -10,34 +10,34 @@ spec :: Spec spec = do describe "bool" . pgoldenSpec $ do "pnot" @\ do - "lam" @> pnot - "app" @> pnot # (pcon PTrue) @-> passertNot + "lam" @| pnot + "app" @| pnot # (pcon PTrue) @-> passertNot "pand" @\ do - "tf" @> pcon PTrue #&& pcon PFalse @-> passertNot - "ft" @> pcon PFalse #&& pcon PTrue @-> passertNot - "tt" @> pcon PTrue #&& pcon PTrue @-> passert - "ff" @> pcon PFalse #&& pcon PFalse @-> passertNot + "tf" @| pcon PTrue #&& pcon PFalse @-> passertNot + "ft" @| pcon PFalse #&& pcon PTrue @-> passertNot + "tt" @| pcon PTrue #&& pcon PTrue @-> passert + "ff" @| pcon PFalse #&& pcon PFalse @-> passertNot "laziness" @\ do - "pand" @> pand # pcon PFalse # pdelay perror @-> \p -> + "pand" @| pand # pcon PFalse # pdelay perror @-> \p -> passert $ pnot # pforce p - "op" @> pcon PFalse #&& perror @-> \p -> + "op" @| pcon PFalse #&& perror @-> \p -> passert $ pnot # p "pand.perror" @\ do - "false" @> pand # pcon PFalse # perror @-> pfails - "true" @> pand # pcon PTrue # perror @-> pfails - "op" @> pcon PTrue #&& perror @-> pfails + "false" @| pand # pcon PFalse # perror @-> pfails + "true" @| pand # pcon PTrue # perror @-> pfails + "op" @| pcon PTrue #&& perror @-> pfails "por" @\ do - "tf" @> pcon PTrue #|| pcon PFalse @-> passert - "ft" @> pcon PFalse #|| pcon PTrue @-> passert - "tt" @> pcon PTrue #|| pcon PTrue @-> passert - "ff" @> pcon PFalse #|| pcon PFalse @-> passertNot + "tf" @| pcon PTrue #|| pcon PFalse @-> passert + "ft" @| pcon PFalse #|| pcon PTrue @-> passert + "tt" @| pcon PTrue #|| pcon PTrue @-> passert + "ff" @| pcon PFalse #|| pcon PFalse @-> passertNot "laziness" @\ do - "por" @> por # pcon PTrue # pdelay perror @-> \p -> + "por" @| por # pcon PTrue # pdelay perror @-> \p -> passert (pforce p) - "op" @> pcon PTrue #|| perror @-> \p -> + "op" @| pcon PTrue #|| perror @-> \p -> passert p "pand.perror" @\ do - "false" @> por # pcon PFalse # perror @-> pfails - "true" @> por # pcon PTrue # perror @-> pfails - "op.true" @> pcon PTrue #|| perror @-> psucceeds - "op.false" @> pcon PFalse #|| perror @-> pfails + "false" @| por # pcon PFalse # perror @-> pfails + "true" @| por # pcon PTrue # perror @-> pfails + "op.true" @| pcon PTrue #|| perror @-> psucceeds + "op.false" @| pcon PFalse #|| perror @-> pfails diff --git a/plutarch-test/src/Plutarch/ByteStringSpec.hs b/plutarch-test/src/Plutarch/ByteStringSpec.hs index 69c30b5ad..8b0f6e2bd 100644 --- a/plutarch-test/src/Plutarch/ByteStringSpec.hs +++ b/plutarch-test/src/Plutarch/ByteStringSpec.hs @@ -9,30 +9,30 @@ import Plutarch.Test spec :: Spec spec = do describe "bytestring" . pgoldenSpec $ do - "empty" @> mempty #== phexByteStr "" @-> passert + "empty" @| mempty #== phexByteStr "" @-> passert "phexByteStr" - @> ( let a :: [String] = ["42", "ab", "df", "c9"] + @| ( let a :: [String] = ["42", "ab", "df", "c9"] in pconstant @PByteString (BS.pack $ map readByte a) #== phexByteStr (concat a) ) @-> passert - "plengthByteStr" @> (plengthBS # phexByteStr "012f") #== 2 @-> passert + "plengthByteStr" @| (plengthBS # phexByteStr "012f") #== 2 @-> passert "pconsBS" - @> ( let xs = phexByteStr "48fCd1" + @| ( let xs = phexByteStr "48fCd1" in (plengthBS #$ pconsBS # 91 # xs) #== (1 + plengthBS # xs) ) @-> passert - "pindexByteStr" @> (pindexBS # phexByteStr "4102af" # 1) + "pindexByteStr" @| (pindexBS # phexByteStr "4102af" # 1) @== pconstant @PInteger 0x02 - "psliceByteStr" @> (psliceBS # 2 # 3 # phexByteStr "4102afde5b2a") + "psliceByteStr" @| (psliceBS # 2 # 3 # phexByteStr "4102afde5b2a") @== phexByteStr "afde5b" - "eq" @> phexByteStr "12" #== phexByteStr "12" @-> passert + "eq" @| phexByteStr "12" #== phexByteStr "12" @-> passert let s1 = phexByteStr "12" s2 = phexByteStr "34" "semigroup" @\ do - "concats" @> s1 <> s2 @== (phexByteStr "1234") + "concats" @| s1 <> s2 @== (phexByteStr "1234") "laws" @\ do - "id.1" @> (mempty <> s1) #== s1 @-> passert - "id.2" @> s1 #== (mempty <> s1) @-> passert + "id.1" @| (mempty <> s1) #== s1 @-> passert + "id.2" @| s1 #== (mempty <> s1) @-> passert {- | Interpret a byte. diff --git a/plutarch-test/src/Plutarch/FieldSpec.hs b/plutarch-test/src/Plutarch/FieldSpec.hs index 3aa5faeae..06811f644 100644 --- a/plutarch-test/src/Plutarch/FieldSpec.hs +++ b/plutarch-test/src/Plutarch/FieldSpec.hs @@ -28,40 +28,40 @@ spec = do describe "trips" . pgoldenSpec $ do -- compilation "lam" @\ do - "tripSum" @> tripSum - "getY" @> getY - "tripYZ" @> tripYZ + "tripSum" @| tripSum + "getY" @| getY + "tripYZ" @| tripYZ "tripSum" @\ do - "A" @> tripSum # tripA @-> \p -> + "A" @| tripSum # tripA @-> \p -> plift p @?= 1000 - "B" @> tripSum # tripB @-> \p -> + "B" @| tripSum # tripB @-> \p -> plift p @?= 100 - "C" @> tripSum # tripC @-> \p -> + "C" @| tripSum # tripC @-> \p -> plift p @?= 10 - "tripYZ=tripZY" @> tripZY @== tripYZ + "tripYZ=tripZY" @| tripZY @== tripYZ -- rangeFields describe "rangeFields" . pgoldenSpec $ do -- compilation - "lam" @> rangeFields - "app" @> rangeFields # someFields @-> \p -> plift p @?= 11 + "lam" @| rangeFields + "app" @| rangeFields # someFields @-> \p -> plift p @?= 11 -- dropFields describe "dropFields" . pgoldenSpec $ do -- compilation - "lam" @> dropFields - "app" @> dropFields # someFields @-> \p -> plift p @?= 17 + "lam" @| dropFields + "app" @| dropFields # someFields @-> \p -> plift p @?= 17 -- pletFields describe "pletFields" . pgoldenSpec $ do -- compilation "letSomeFields" @\ do - "lam" @> letSomeFields - "order" @> letSomeFields' @== letSomeFields - "app" @> letSomeFields # someFields @-> \p -> plift p @?= 14 + "lam" @| letSomeFields + "order" @| letSomeFields' @== letSomeFields + "app" @| letSomeFields # someFields @-> \p -> plift p @?= 14 "nFields" @\ do - "lam" @> nFields - "app" @> nFields # someFields @-> \p -> plift p @?= 1 + "lam" @| nFields + "app" @| nFields # someFields @-> \p -> plift p @?= 1 describe "other" . pgoldenSpec $ do - "by" @> by @-> \p -> plift p @?= 10 - "dotPlus" @> dotPlus @-> \p -> plift p @?= 19010 + "by" @| by @-> \p -> plift p @?= 10 + "dotPlus" @| dotPlus @-> \p -> plift p @?= 19010 -------------------------------------------------------------------------------- diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/src/Plutarch/IntegerSpec.hs index dbdff2671..d136fd6de 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/src/Plutarch/IntegerSpec.hs @@ -11,15 +11,15 @@ spec = do describe "int" $ do describe "examples" $ do pgoldenSpec $ do - "add1" @> add1 - "add1Hoisted" @> add1Hoisted - "example1" @> example1 - "example2" @> example2 + "add1" @| add1 + "add1Hoisted" @| add1Hoisted + "example1" @| example1 + "example2" @| example2 "fib" @\ do - "lam" @> fib + "lam" @| fib "app" @\ do - "9" @> fib # 9 - "uglyDouble" @> uglyDouble + "9" @| fib # 9 + "uglyDouble" @| uglyDouble add1 :: Term s (PInteger :--> PInteger :--> PInteger) add1 = plam $ \x y -> x + y + 1 diff --git a/plutarch-test/src/Plutarch/ListSpec.hs b/plutarch-test/src/Plutarch/ListSpec.hs index eff188001..bf45272d6 100644 --- a/plutarch-test/src/Plutarch/ListSpec.hs +++ b/plutarch-test/src/Plutarch/ListSpec.hs @@ -15,40 +15,40 @@ spec = do let xs10 :: Term _ (PList PInteger) xs10 = integerList [1 .. 10] describe "type" . pgoldenSpec $ do - "phead" @> phead # xs10 @== pconstant @PInteger 1 - "ptail" @> ptail # xs10 @== integerList [2 .. 10] + "phead" @| phead # xs10 @== pconstant @PInteger 1 + "ptail" @| ptail # xs10 @== integerList [2 .. 10] let matchP = pmatch (integerList [1, 3, 1]) $ \case PSNil -> perror PSCons x _ -> x - "pmatch" @> matchP @== pconstant @PInteger 1 + "pmatch" @| matchP @== pconstant @PInteger 1 describe "fun" . pgoldenSpec $ do "pnull" @\ do - "empty" @> pnull # (integerList []) @-> passert - "nonempty" @> pnot # (pnull # xs10) @-> passert + "empty" @| pnull # (integerList []) @-> passert + "nonempty" @| pnot # (pnull # xs10) @-> passert "pconcat" @\ do let xs :: Term s (PList PInteger) xs = psingleton # (fromInteger @(Term _ PInteger) 0) - "identity" @> pconcat # xs # pnil @== xs + "identity" @| pconcat # xs # pnil @== xs "pmap" @\ do - "eg" @> pmap # (plam $ \x -> x + x) # xs10 + "eg" @| pmap # (plam $ \x -> x + x) # xs10 @== (integerList $ fmap (* 2) [1 .. 10]) - "identity" @> pmap @PList # (plam $ \(x :: Term _ PInteger) -> x) # pnil + "identity" @| pmap @PList # (plam $ \(x :: Term _ PInteger) -> x) # pnil @== pnil @PList "pfilter" @\ do - "1" @> pfilter # (plam $ \x -> pmod # x # 2 #== 0) # xs10 + "1" @| pfilter # (plam $ \x -> pmod # x # 2 #== 0) # xs10 @== integerList [2, 4, 6, 8, 10] - "2" @> pfilter # (plam $ \x -> 5 #< x) # xs10 + "2" @| pfilter # (plam $ \x -> 5 #< x) # xs10 @== integerList [6 .. 10] - "pzipWith" @> pzipWith' (+) # xs10 # xs10 + "pzipWith" @| pzipWith' (+) # xs10 # xs10 @== (integerList (fmap (* 2) [1 .. 10])) "pfoldl" @\ do "primed" @\ do - "nonempty" @> pfoldl' (-) # 0 # xs10 + "nonempty" @| pfoldl' (-) # 0 # xs10 @== pconstant @PInteger (foldl (-) 0 [1 .. 10]) - "empty" @> pfoldl' (-) # 0 # integerList [] + "empty" @| pfoldl' (-) # 0 # integerList [] @== pconstant @PInteger 0 "primed" @\ do - "nonempty" @> pfoldl # plam (-) # 0 # xs10 + "nonempty" @| pfoldl # plam (-) # 0 # xs10 @== pconstant @PInteger (foldl (-) 0 [1 .. 10]) - "empty" @> pfoldl # plam (-) # 0 # integerList [] + "empty" @| pfoldl # plam (-) # 0 # integerList [] @== pconstant @PInteger 0 diff --git a/plutarch-test/src/Plutarch/MonadicSpec.hs b/plutarch-test/src/Plutarch/MonadicSpec.hs index b9c58e742..dfcc862a5 100644 --- a/plutarch-test/src/Plutarch/MonadicSpec.hs +++ b/plutarch-test/src/Plutarch/MonadicSpec.hs @@ -30,10 +30,10 @@ spec = do describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" "do" @\ do - "succeeds" @> checkSignatory # pconstant aSig # ApiSpec.ctx @-> psucceeds - "fails" @> checkSignatory # pconstant "41" # ApiSpec.ctx @-> pfails + "succeeds" @| checkSignatory # pconstant aSig # ApiSpec.ctx @-> psucceeds + "fails" @| checkSignatory # pconstant "41" # ApiSpec.ctx @-> pfails describe "getFields" . pgoldenSpec $ do - "0" @> getFields + "0" @| getFields checkSignatory :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) checkSignatory = plam $ \ph ctx' -> diff --git a/plutarch-test/src/Plutarch/PIsDataSpec.hs b/plutarch-test/src/Plutarch/PIsDataSpec.hs index ca051cea1..846ce1e01 100644 --- a/plutarch-test/src/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/src/Plutarch/PIsDataSpec.hs @@ -26,7 +26,7 @@ spec = do describe "ppair" . pgoldenSpec $ do -- pfromData (pdata (I 1, B 0x41)) ≡ (I 1, I A) "simple" - @> ( ppairDataBuiltin @_ @PInteger @PByteString + @| ( ppairDataBuiltin @_ @PInteger @PByteString # pconstantData @PInteger 1 #$ pdata (pconstant $ encodeUtf8 "A") ) @@ -37,13 +37,13 @@ spec = do ppairDataBuiltin # pconstantData @PTxId "41" #$ pconstantData (ScriptCredential "82") - "scriptcredential" @> scPair @-> \p -> + "scriptcredential" @| scPair @-> \p -> pfromData (pdata p) `pshouldBe` p let scTuple = pdata $ ptuple # pconstantData @PTxId "41" #$ pconstantData $ ScriptCredential "82" "isomorphism" @\ do - "pforgetData" @> pforgetData (pdata scPair) @== pforgetData scTuple - "pbuiltinPairFromTuple" @> pfromData (pbuiltinPairFromTuple scTuple) @== scPair - "ptupleFromBuiltin" @> ptupleFromBuiltin (pdata scPair) @== scTuple + "pforgetData" @| pforgetData (pdata scPair) @== pforgetData scTuple + "pbuiltinPairFromTuple" @| pfromData (pbuiltinPairFromTuple scTuple) @== scPair + "ptupleFromBuiltin" @| ptupleFromBuiltin (pdata scPair) @== scTuple propertySet :: forall p. diff --git a/plutarch-test/src/Plutarch/PLamSpec.hs b/plutarch-test/src/Plutarch/PLamSpec.hs index b8b99c7e4..91e84bbc1 100644 --- a/plutarch-test/src/Plutarch/PLamSpec.hs +++ b/plutarch-test/src/Plutarch/PLamSpec.hs @@ -8,6 +8,6 @@ import Plutarch.Test spec :: Spec spec = do describe "plam" . pgoldenSpec $ do - "id" @> plam (\x -> x) - "flip.const" @> plam (\_ y -> y) - "plet" @> plam (\x _ -> plet x $ \_ -> perror) + "id" @| plam (\x -> x) + "flip.const" @| plam (\_ y -> y) + "plet" @| plam (\x _ -> plet x $ \_ -> perror) diff --git a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs index 99d5a13c0..4c0762c12 100644 --- a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs @@ -13,11 +13,11 @@ spec :: Spec spec = do describe "plutustype" $ do describe "example" . pgoldenSpec $ do - "A-as-0" @> pcon A @== pconstant @PInteger 0 - "B-as-1" @> pcon B @== pconstant @PInteger 1 + "A-as-0" @| pcon A @== pconstant @PInteger 0 + "B-as-1" @| pcon B @== pconstant @PInteger 1 "swap" @\ do - "A" @> swap (pcon A) @== pcon B - "B" @> swap (pcon B) @== pcon A + "A" @| swap (pcon A) @== pcon B + "B" @| swap (pcon B) @== pcon A describe "instances-sanity" $ do plutarchDevFlagDescribe $ do it "PBuiltinList" $ do diff --git a/plutarch-test/src/Plutarch/RationalSpec.hs b/plutarch-test/src/Plutarch/RationalSpec.hs index 94480d6bf..94af1bb6e 100644 --- a/plutarch-test/src/Plutarch/RationalSpec.hs +++ b/plutarch-test/src/Plutarch/RationalSpec.hs @@ -14,35 +14,35 @@ spec = do assertRat :: ClosedTerm PRational -> ClosedTerm PRational -> Expectation assertRat x p = passert $ p #== x describe "rational" . pgoldenSpec $ do - "literal" @> rat 0.5 + "literal" @| rat 0.5 "ops" @\ do - "+" @> rat (1 / 2 + 1 / 2) @-> assertRat 1 - "-" @> rat (1 / 2 - 1 / 3) @-> assertRat (1 / 6) - "*" @> rat ((1 - 3 / 2) * (2 - 5 / 2)) @-> assertRat (1 / 4) - "harmonic-sum" @> rat (1 / 2 + 1 / 3 + 1 / 4 + 1 / 5) + "+" @| rat (1 / 2 + 1 / 2) @-> assertRat 1 + "-" @| rat (1 / 2 - 1 / 3) @-> assertRat (1 / 6) + "*" @| rat ((1 - 3 / 2) * (2 - 5 / 2)) @-> assertRat (1 / 4) + "harmonic-sum" @| rat (1 / 2 + 1 / 3 + 1 / 4 + 1 / 5) @-> assertRat (77 / 60) - "multi-product" @> rat (1 / 2 * 2 / 3 * 3 / 4 * 4 / 5 * 5 / 6) + "multi-product" @| rat (1 / 2 * 2 / 3 * 3 / 4 * 4 / 5 * 5 / 6) @-> assertRat (1 / 6) - "compare" @> rat (2 / 9) #< rat (3 / 10) @-> passert + "compare" @| rat (2 / 9) #< rat (3 / 10) @-> passert "round" @\ do -- NOTE: These will eventually be replaced by property tests. - "5/3" @> pround # rat (5 / 3) @== pconstant @PInteger 2 - "4/3" @> pround # rat (4 / 3) @== pconstant @PInteger 1 - "-5/2" @> pround # rat (-5 / 2) @== pconstant @PInteger (-2) - "-1/4" @> pround # rat (-1 / 4) @== pconstant @PInteger 0 + "5/3" @| pround # rat (5 / 3) @== pconstant @PInteger 2 + "4/3" @| pround # rat (4 / 3) @== pconstant @PInteger 1 + "-5/2" @| pround # rat (-5 / 2) @== pconstant @PInteger (-2) + "-1/4" @| pround # rat (-1 / 4) @== pconstant @PInteger 0 "truncate" @\ do - "5/4" @> ptruncate # rat (5 / 4) @== pconstant @PInteger 1 - "7/4" @> ptruncate # rat (7 / 4) @== pconstant @PInteger 1 - "1/4" @> ptruncate # rat (1 / 4) @== pconstant @PInteger 0 - "-7/4" @> ptruncate # rat (-7 / 4) @== pconstant @PInteger (-1) + "5/4" @| ptruncate # rat (5 / 4) @== pconstant @PInteger 1 + "7/4" @| ptruncate # rat (7 / 4) @== pconstant @PInteger 1 + "1/4" @| ptruncate # rat (1 / 4) @== pconstant @PInteger 0 + "-7/4" @| ptruncate # rat (-7 / 4) @== pconstant @PInteger (-1) "properFraction" @\ do let mkP r a b = pmatch (pproperFraction # r) $ \(PPair x y) -> x #== a #&& y #== b - "-1/2" @> mkP (-1 / 2) 0 (-1 / 2) @-> passert - "-3/2" @> mkP (-3 / 2) (-1) (-1 / 2) @-> passert - "-4/3" @> mkP (-4 / 3) (-1) (-1 / 3) @-> passert + "-1/2" @| mkP (-1 / 2) 0 (-1 / 2) @-> passert + "-3/2" @| mkP (-3 / 2) (-1) (-1 / 2) @-> passert + "-4/3" @| mkP (-4 / 3) (-1) (-1 / 3) @-> passert "data" @\ do "id" @\ do - "0.5" @> rat 0.5 @-> assertRat (pfromData (pdata 0.5)) - "2" @> rat 2 @-> assertRat (pfromData (pdata 2)) - "11/3" @> rat 11 / 3 @-> assertRat (pfromData (pdata $ 11 / 3)) + "0.5" @| rat 0.5 @-> assertRat (pfromData (pdata 0.5)) + "2" @| rat 2 @-> assertRat (pfromData (pdata 2)) + "11/3" @| rat 11 / 3 @-> assertRat (pfromData (pdata $ 11 / 3)) diff --git a/plutarch-test/src/Plutarch/RecursionSpec.hs b/plutarch-test/src/Plutarch/RecursionSpec.hs index 88d26c9ce..1fce9a299 100644 --- a/plutarch-test/src/Plutarch/RecursionSpec.hs +++ b/plutarch-test/src/Plutarch/RecursionSpec.hs @@ -16,11 +16,11 @@ spec = do describe "recursion" $ do describe "example" . pgoldenSpec $ do "iterateN" @\ do - "lam" @> iterateN + "lam" @| iterateN "app" @\ do - "succ" @> iterateN # 10 # succ # 0 + "succ" @| iterateN # 10 # succ # 0 @== pconstant @PInteger 10 - "double" @> iterateN # 10 # double # 1 + "double" @| iterateN # 10 # double # 1 @== pconstant @PInteger 1024 succ :: Term s (PInteger :--> PInteger) diff --git a/plutarch-test/src/Plutarch/ScriptsSpec.hs b/plutarch-test/src/Plutarch/ScriptsSpec.hs index c1e996101..ccf5778bd 100644 --- a/plutarch-test/src/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/src/Plutarch/ScriptsSpec.hs @@ -46,21 +46,21 @@ spec :: Spec spec = do describe "scripts" $ do describe "auth_validator" $ do - pgoldenSpec $ "0" @> authValidatorTerm + pgoldenSpec $ "0" @| authValidatorTerm prefix <- getGoldenFilePrefix it "hash" $ do pureGoldenTextFile (goldenFilePath "goldens" prefix "hash") validatorHashEncoded describe "auth_policy" $ do - pgoldenSpec $ "0" @> authPolicyTerm + pgoldenSpec $ "0" @| authPolicyTerm prefix <- getGoldenFilePrefix it "hash" $ pureGoldenTextFile (goldenFilePath "goldens" prefix "hash") policySymEncoded describe "auth_stake_validator" $ do - pgoldenSpec $ "0" @> authStakeValidatorTerm + pgoldenSpec $ "0" @| authStakeValidatorTerm prefix <- getGoldenFilePrefix it "hash" $ pureGoldenTextFile diff --git a/plutarch-test/src/Plutarch/StringSpec.hs b/plutarch-test/src/Plutarch/StringSpec.hs index d2129c10f..05794d82a 100644 --- a/plutarch-test/src/Plutarch/StringSpec.hs +++ b/plutarch-test/src/Plutarch/StringSpec.hs @@ -9,12 +9,12 @@ spec :: Spec spec = do describe "str" $ do pgoldenSpec $ do - "eq" @> "foo" #== pconstant @PString "foo" @-> passert + "eq" @| "foo" #== pconstant @PString "foo" @-> passert "semigroup" @\ do let s1 = pconstant @PString "foo" s2 = pconstant @PString "bar" "laws" @\ do - "id.1" @> (mempty <> s1) #== s1 @-> passert - "id.2" @> s1 #== (mempty <> s1) @-> passert - "concat" @> s1 <> s2 #== pconstant @PString "foobar" @-> passert - "mempty" @> mempty #== pconstant @PString "" @-> passert + "id.1" @| (mempty <> s1) #== s1 @-> passert + "id.2" @| s1 #== (mempty <> s1) @-> passert + "concat" @| s1 <> s2 #== pconstant @PString "foobar" @-> passert + "mempty" @| mempty #== pconstant @PString "" @-> passert diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 6eed67c3f..4e624e57f 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -16,7 +16,7 @@ module Plutarch.Test ( plutarchDevFlagDescribe, -- * Golden testing - (@>), + (@|), (@\), (@->), (@==), diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index c33286a4e..476e4d15b 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -2,7 +2,7 @@ module Plutarch.Test.Golden ( pgoldenSpec, - (@>), + (@|), (@\), (@->), @@ -104,9 +104,9 @@ combineGoldens xs = T.intercalate "\n" $ (\(GoldenKey k, v) -> k <> " " <> v) <$> xs -(@>) :: HasGoldenValue v => GoldenKey -> v -> ListSyntax (GoldenKey, GoldenValue) -(@>) k v = listSyntaxAdd (k, mkGoldenValue v) -infixr 0 @> +(@|) :: HasGoldenValue v => GoldenKey -> v -> ListSyntax (GoldenKey, GoldenValue) +(@|) k v = listSyntaxAdd (k, mkGoldenValue v) +infixr 0 @| (@\) :: GoldenKey -> ListSyntax (GoldenKey, GoldenValue) -> ListSyntax (GoldenKey, GoldenValue) (@\) = listSyntaxAddSubList @@ -119,9 +119,9 @@ infixr 0 @> For example, ``` pgoldenSpec $ do - "foo" @> pconstant 42 + "foo" @| pconstant 42 "bar" @\ do - "qux" @> pconstant "Hello" + "qux" @| pconstant "Hello" ``` Will create three golden files -- uplc.golden, uplc.eval.golden and diff --git a/plutarch-test/src/Plutarch/TraceSpec.hs b/plutarch-test/src/Plutarch/TraceSpec.hs index 972fd72fb..3809555a2 100644 --- a/plutarch-test/src/Plutarch/TraceSpec.hs +++ b/plutarch-test/src/Plutarch/TraceSpec.hs @@ -9,27 +9,27 @@ spec :: Spec spec = do describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do "ptrace" @\ do - "one" @> ptrace "foo" (pcon PUnit) @-> \p -> + "one" @| ptrace "foo" (pcon PUnit) @-> \p -> ptraces p ["foo"] - "two" @> ptrace "foo" (ptrace "bar" (pcon PUnit)) @-> \p -> + "two" @| ptrace "foo" (ptrace "bar" (pcon PUnit)) @-> \p -> ptraces p ["foo", "bar"] "ptraceIfTrue" @\ do - "true" @> ptraceIfTrue "foo" (pcon PTrue) @-> \p -> + "true" @| ptraceIfTrue "foo" (pcon PTrue) @-> \p -> p `ptraces` ["foo"] - "false" @> ptraceIfTrue "foo" (pcon PFalse) @-> \p -> + "false" @| ptraceIfTrue "foo" (pcon PFalse) @-> \p -> p `ptraces` [] "ptraceIfFalse" @\ do - "true" @> ptraceIfFalse "foo" (pcon PTrue) @-> \p -> + "true" @| ptraceIfFalse "foo" (pcon PTrue) @-> \p -> p `ptraces` [] - "false" @> ptraceIfFalse "foo" (pcon PFalse) @-> \p -> + "false" @| ptraceIfFalse "foo" (pcon PFalse) @-> \p -> p `ptraces` ["foo"] "chained" @\ do "false.true.false" - @> ptraceIfFalse "foo" (ptraceIfTrue "bar" $ pcon PFalse) + @| ptraceIfFalse "foo" (ptraceIfTrue "bar" $ pcon PFalse) @-> \p -> p `ptraces` ["foo"] "ptrace.true.false" - @> ptrace "foo" (ptraceIfTrue "bar" $ pcon PFalse) + @| ptrace "foo" (ptraceIfTrue "bar" $ pcon PFalse) @-> \p -> p `ptraces` ["foo"] "ptrace.true.true" - @> ptrace "foo" (ptraceIfTrue "bar" $ pcon PTrue) + @| ptrace "foo" (ptraceIfTrue "bar" $ pcon PTrue) @-> \p -> p `ptraces` ["foo", "bar"] diff --git a/plutarch-test/src/Plutarch/UnitSpec.hs b/plutarch-test/src/Plutarch/UnitSpec.hs index 0f6680812..99b6fc8f3 100644 --- a/plutarch-test/src/Plutarch/UnitSpec.hs +++ b/plutarch-test/src/Plutarch/UnitSpec.hs @@ -9,9 +9,9 @@ import Plutarch.Test spec :: Spec spec = do describe "unit" . pgoldenSpec $ do - "pcon" @> pcon PUnit - "pmatch" @> pmatch (pcon PUnit) (\case PUnit -> pcon PTrue) @-> passert + "pcon" @| pcon PUnit + "pmatch" @| pmatch (pcon PUnit) (\case PUnit -> pcon PTrue) @-> passert "compare" @\ do - "==" @> pcon PUnit #== pcon PUnit @-> passert - "<" @> pcon PUnit #< pcon PUnit @-> passertNot - "<=" @> pcon PUnit #<= pcon PUnit @-> passert + "==" @| pcon PUnit #== pcon PUnit @-> passert + "<" @| pcon PUnit #< pcon PUnit @-> passertNot + "<=" @| pcon PUnit #<= pcon PUnit @-> passert From 37eec7cf750524e1e1a71aaa4880ebb9c0933992 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 16:02:58 -0500 Subject: [PATCH 039/584] Explicit imports, comments, etc. --- plutarch-test/src/Plutarch/Test.hs | 14 +++++++++++--- plutarch-test/src/Plutarch/Test/Golden.hs | 22 ++++++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 4e624e57f..673e611f2 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -30,7 +30,7 @@ module Plutarch.Test ( goldenFilePath, ) where -import Control.Monad.Writer +import Control.Monad (when) import qualified Data.Aeson.Text as Aeson import Data.Kind (Type) import Data.Text (Text) @@ -53,7 +53,15 @@ import Plutarch import Plutarch.Benchmark (benchmarkScript') import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evaluateScript) -import Plutarch.Test.Golden +import Plutarch.Test.Golden ( + TermExpectation, + compileD, + evaluateScriptAlways, + pgoldenSpec, + (@->), + (@\), + (@|), + ) import qualified Plutus.V1.Ledger.Scripts as Scripts {- | @@ -139,7 +147,7 @@ pfails p = do (@==) p x = p @-> pshouldBe x infixr 1 @== --- TODO: All the code below will be deleted, in favour of Golden.hs +-- TODO: All the code below will be deleted, in favour of Golden.hs. {- Whether to run all or a particular golden test diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 476e4d15b..eccad2071 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -13,11 +13,19 @@ module Plutarch.Test.Golden ( compileD, ) where +import Control.Monad (forM_, unless) import qualified Data.Aeson.Text as Aeson +import Data.Kind (Type) +import Data.List.NonEmpty (nonEmpty) +import qualified Data.List.NonEmpty as NE +import Data.Maybe (mapMaybe) +import Data.Semigroup (sconcat) +import Data.String (IsString) import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Lazy as TL -import System.FilePath +import GHC.Stack (HasCallStack) +import System.FilePath (()) import Test.Syd ( Expectation, Spec, @@ -28,14 +36,6 @@ import Test.Syd ( pureGoldenTextFile, ) -import Control.Monad (forM_, unless) -import Data.Kind (Type) -import Data.List.NonEmpty (nonEmpty) -import qualified Data.List.NonEmpty as NE -import Data.Maybe (mapMaybe) -import Data.Semigroup (sconcat) -import Data.String (IsString) -import GHC.Stack (HasCallStack) import Plutarch import Plutarch.Benchmark (benchmarkScript') import Plutarch.Evaluate (evaluateScript) @@ -104,10 +104,12 @@ combineGoldens xs = T.intercalate "\n" $ (\(GoldenKey k, v) -> k <> " " <> v) <$> xs +{- Specify goldens for the given Plutarch program -} (@|) :: HasGoldenValue v => GoldenKey -> v -> ListSyntax (GoldenKey, GoldenValue) (@|) k v = listSyntaxAdd (k, mkGoldenValue v) infixr 0 @| +{- Add an expectation for the Plutarch program specified with (@|) -} (@\) :: GoldenKey -> ListSyntax (GoldenKey, GoldenValue) -> ListSyntax (GoldenKey, GoldenValue) (@\) = listSyntaxAddSubList @@ -177,6 +179,6 @@ evaluateScriptAlways script = Right (_, _, x) -> x -- TODO: Make this deterministic --- See +-- See https://github.com/Plutonomicon/plutarch/pull/297 compileD :: ClosedTerm a -> Scripts.Script compileD = compile From 07a49f171eacb554574b5e7d025699a3a6ce1fea Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Feb 2022 21:20:22 +0000 Subject: [PATCH 040/584] Update goldens --- plutarch-test/goldens/scripts.auth_validator.hash.golden | 2 +- plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden | 2 +- plutarch-test/goldens/scripts.auth_validator.uplc.golden | 2 +- plutarch-test/goldens/str.eq.bench.golden | 2 +- plutarch-test/goldens/str.semigroup.bench.golden | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plutarch-test/goldens/scripts.auth_validator.hash.golden b/plutarch-test/goldens/scripts.auth_validator.hash.golden index e2c047a34..cc553ffba 100644 --- a/plutarch-test/goldens/scripts.auth_validator.hash.golden +++ b/plutarch-test/goldens/scripts.auth_validator.hash.golden @@ -1 +1 @@ -581cb8c68ee0b38d3c830ae47aec8154b1c35eeabaceaf2c00bea1f33865 \ No newline at end of file +581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden index 8b9af4f50..22be3c42a 100644 --- a/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden +++ b/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden @@ -1 +1 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #11661a8aca9b09bb93eefda295b5da2be3f944d1f4253ab29da17db580f50d02d26218e33fbba5e0cc1b0c0cadfb67a5f9a90157dcc19eecd7c9373b0415c888 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file +0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.uplc.golden b/plutarch-test/goldens/scripts.auth_validator.uplc.golden index 8b9af4f50..22be3c42a 100644 --- a/plutarch-test/goldens/scripts.auth_validator.uplc.golden +++ b/plutarch-test/goldens/scripts.auth_validator.uplc.golden @@ -1 +1 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #11661a8aca9b09bb93eefda295b5da2be3f944d1f4253ab29da17db580f50d02d26218e33fbba5e0cc1b0c0cadfb67a5f9a90157dcc19eecd7c9373b0415c888 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file +0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/str.eq.bench.golden b/plutarch-test/goldens/str.eq.bench.golden index f101e03db..c130bed76 100644 --- a/plutarch-test/goldens/str.eq.bench.golden +++ b/plutarch-test/goldens/str.eq.bench.golden @@ -1 +1 @@ -0 {"exBudgetCPU":389284,"exBudgetMemory":901,"scriptSizeBytes":18} \ No newline at end of file +0 {"exBudgetCPU":391284,"exBudgetMemory":901,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/str.semigroup.bench.golden b/plutarch-test/goldens/str.semigroup.bench.golden index c7b8dada0..20bd6efa1 100644 --- a/plutarch-test/goldens/str.semigroup.bench.golden +++ b/plutarch-test/goldens/str.semigroup.bench.golden @@ -1 +1 @@ -0 {"exBudgetCPU":300965,"exBudgetMemory":602,"scriptSizeBytes":21} \ No newline at end of file +0 {"exBudgetCPU":304965,"exBudgetMemory":606,"scriptSizeBytes":21} \ No newline at end of file From 5422e6b7e025762e4e6b53e9c393b36a99841e52 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 16:46:27 -0500 Subject: [PATCH 041/584] Fix haddocks --- plutarch-test/src/Plutarch/Test.hs | 17 +++++++++-------- plutarch-test/src/Plutarch/Test/Golden.hs | 21 +++++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 673e611f2..7fa302199 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -78,19 +78,19 @@ pshouldBe x y = do Left e -> expectationFailure $ "Script evaluation failed: " <> show e Right (_, _, x') -> pure x' -{- Like `@?=` but for Plutarch terms -} +-- | Like `@?=` but for Plutarch terms (#@?=) :: ClosedTerm a -> ClosedTerm b -> Expectation (#@?=) = pshouldBe -{- Asserts the term to be true -} +-- | Asserts the term to be true passert :: ClosedTerm a -> Expectation passert p = p #@?= pcon PTrue -{- Asserts the term to be false -} +-- | Asserts the term to be false passertNot :: ClosedTerm a -> Expectation passertNot p = p #@?= pcon PFalse -{- Asserts the term evaluates successfully without failing -} +-- | Asserts the term evaluates successfully without failing psucceeds :: ClosedTerm a -> Expectation psucceeds p = case evaluateScript (compile p) of @@ -135,21 +135,22 @@ plutarchDevFlagDescribe m = #endif {- ORMOLU_ENABLE -} -{- Asserts the term evaluates without success -} +-- | Asserts the term evaluates without success pfails :: ClosedTerm a -> Expectation pfails p = do case evaluateScript (compile p) of Left _ -> pure () Right _ -> expectationFailure $ "Term succeeded" -{- Convenient alias for `@-> pshouldBe x` -} +-- | Convenient alias for `@-> pshouldBe x` (@==) :: Term s a -> ClosedTerm b -> TermExpectation s a (@==) p x = p @-> pshouldBe x + infixr 1 @== -- TODO: All the code below will be deleted, in favour of Golden.hs. -{- Whether to run all or a particular golden test +{- | Whether to run all or a particular golden test Typically you want to use `All` -- this produces printTerm and benchmark goldens. @@ -165,7 +166,7 @@ data PlutarchGolden | PrintTerm deriving stock (Eq, Show) -{- Run golden tests on the given Plutarch program -} +-- | Run golden tests on the given Plutarch program {-# DEPRECATED golden "Use `pgoldenSpec` instead." #-} golden :: PlutarchGolden -> ClosedTerm a -> Spec golden pg p = diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index eccad2071..ab026dfe5 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -50,7 +50,7 @@ data GoldenValue = GoldenValue , goldenValueExpectation :: Maybe Expectation } -{- Class of types that represent `GoldenValue` +{- | Class of types that represent `GoldenValue` This class exists for syntatic sugar provided by (@->) (via `TermExpectation`). -} @@ -68,23 +68,23 @@ mkGoldenValue' p mexp = instance HasGoldenValue (Term s a) where mkGoldenValue p = mkGoldenValue' (unsafeClosedTerm p) Nothing -{- A `Term` paired with its evaluation expectation +{- | A `Term` paired with its evaluation expectation Example: >>> TermExpectation (pcon PTrue) $ \p -> pshouldBe (pcon PTrue) - -} data TermExpectation s a = TermExpectation (Term s a) (Term s a -> Expectation) -{- Test an expectation on a golden Plutarch program -} +-- | Test an expectation on a golden Plutarch program (@->) :: Term s a -> (ClosedTerm a -> Expectation) -> TermExpectation s a (@->) p f = TermExpectation p (\p' -> f $ unsafeClosedTerm p') + infixr 1 @-> instance HasGoldenValue (TermExpectation s a) where mkGoldenValue (TermExpectation p f) = mkGoldenValue' (unsafeClosedTerm p) (Just $ f p) -{- The key used in the .golden files containing multiple golden values -} +-- | The key used in the .golden files containing multiple golden values newtype GoldenKey = GoldenKey Text deriving newtype (Eq, Show, Ord, IsString) @@ -98,22 +98,23 @@ goldenPath :: FilePath -> GoldenKey -> FilePath goldenPath baseDir (GoldenKey k) = baseDir T.unpack k <> ".golden" -{- Group multiple goldens values in the same file -} +-- | Group multiple goldens values in the same file combineGoldens :: [(GoldenKey, Text)] -> Text combineGoldens xs = T.intercalate "\n" $ (\(GoldenKey k, v) -> k <> " " <> v) <$> xs -{- Specify goldens for the given Plutarch program -} +-- | Specify goldens for the given Plutarch program (@|) :: HasGoldenValue v => GoldenKey -> v -> ListSyntax (GoldenKey, GoldenValue) (@|) k v = listSyntaxAdd (k, mkGoldenValue v) + infixr 0 @| -{- Add an expectation for the Plutarch program specified with (@|) -} +-- | Add an expectation for the Plutarch program specified with (@|) (@\) :: GoldenKey -> ListSyntax (GoldenKey, GoldenValue) -> ListSyntax (GoldenKey, GoldenValue) (@\) = listSyntaxAddSubList -{- Create golden specs for pre/post-eval UPLC and benchmarks. +{- | Create golden specs for pre/post-eval UPLC and benchmarks. A *single* golden file will be created (for each metric) for all the programs in the given tree. @@ -166,7 +167,7 @@ currentGoldenKey = do unsafeClosedTerm :: Term s a -> ClosedTerm a unsafeClosedTerm t = Term $ asRawTerm t -{- Like `evaluateScript` but doesn't fail. Also returns `Script`. +{- | Like `evaluateScript` but doesn't fail. Also returns `Script`. All evaluation failures are treated as equivalent to a `perror`. Plutus does not provide an accurate way to tell if the program evalutes to `Error` or not; From 5206f2ac649552f7247865e5ce503b70bc2dec38 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 16:46:33 -0500 Subject: [PATCH 042/584] Remove ImpredicativeTypes --- plutarch-test/src/Plutarch/Test/Golden.hs | 2 -- 1 file changed, 2 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index ab026dfe5..53420ec95 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE ImpredicativeTypes #-} - module Plutarch.Test.Golden ( pgoldenSpec, (@|), From 40c4c2bea2ca715ea2699906be3b455accf0c8e0 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 16:50:03 -0500 Subject: [PATCH 043/584] Test.Golden: use ClosedTerm throughout --- plutarch-test/src/Plutarch/Test.hs | 2 +- plutarch-test/src/Plutarch/Test/Golden.hs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 7fa302199..f79af72a6 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -143,7 +143,7 @@ pfails p = do Right _ -> expectationFailure $ "Term succeeded" -- | Convenient alias for `@-> pshouldBe x` -(@==) :: Term s a -> ClosedTerm b -> TermExpectation s a +(@==) :: ClosedTerm a -> ClosedTerm b -> TermExpectation a (@==) p x = p @-> pshouldBe x infixr 1 @== diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 53420ec95..b858ebaff 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -3,8 +3,6 @@ module Plutarch.Test.Golden ( (@|), (@\), (@->), - - -- * Internal TermExpectation, goldenKeyString, evaluateScriptAlways, @@ -71,15 +69,15 @@ instance HasGoldenValue (Term s a) where Example: >>> TermExpectation (pcon PTrue) $ \p -> pshouldBe (pcon PTrue) -} -data TermExpectation s a = TermExpectation (Term s a) (Term s a -> Expectation) +data TermExpectation a = TermExpectation (ClosedTerm a) (ClosedTerm a -> Expectation) -- | Test an expectation on a golden Plutarch program -(@->) :: Term s a -> (ClosedTerm a -> Expectation) -> TermExpectation s a +(@->) :: ClosedTerm a -> (ClosedTerm a -> Expectation) -> TermExpectation a (@->) p f = TermExpectation p (\p' -> f $ unsafeClosedTerm p') infixr 1 @-> -instance HasGoldenValue (TermExpectation s a) where +instance HasGoldenValue (TermExpectation a) where mkGoldenValue (TermExpectation p f) = mkGoldenValue' (unsafeClosedTerm p) (Just $ f p) -- | The key used in the .golden files containing multiple golden values From fce969cc31e0475946c226bb3c7750cef82f826c Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 21 Feb 2022 18:06:55 -0500 Subject: [PATCH 044/584] unsafeClosedTerm was redundant in 2/3 of places. --- plutarch-test/src/Plutarch/Test/Golden.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index b858ebaff..3f6a8a705 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -61,8 +61,15 @@ mkGoldenValue' p mexp = (TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ compileD p) mexp +-- We derive for `Term s a` only because GHC prevents us from deriving for +-- `ClosedTerm a`. In practice, this instance should be used only for closed +-- terms. instance HasGoldenValue (Term s a) where mkGoldenValue p = mkGoldenValue' (unsafeClosedTerm p) Nothing + where + -- Because, we need a function with this signature. + unsafeClosedTerm :: Term s a -> ClosedTerm a + unsafeClosedTerm t = Term $ asRawTerm t {- | A `Term` paired with its evaluation expectation @@ -73,12 +80,12 @@ data TermExpectation a = TermExpectation (ClosedTerm a) (ClosedTerm a -> Expecta -- | Test an expectation on a golden Plutarch program (@->) :: ClosedTerm a -> (ClosedTerm a -> Expectation) -> TermExpectation a -(@->) p f = TermExpectation p (\p' -> f $ unsafeClosedTerm p') +(@->) p f = TermExpectation p (\p' -> f p') infixr 1 @-> instance HasGoldenValue (TermExpectation a) where - mkGoldenValue (TermExpectation p f) = mkGoldenValue' (unsafeClosedTerm p) (Just $ f p) + mkGoldenValue (TermExpectation p f) = mkGoldenValue' p (Just $ f p) -- | The key used in the .golden files containing multiple golden values newtype GoldenKey = GoldenKey Text @@ -159,10 +166,6 @@ currentGoldenKey = do Just path -> pure $ sconcat $ fmap GoldenKey path --- Because, we need a function with this signature. -unsafeClosedTerm :: Term s a -> ClosedTerm a -unsafeClosedTerm t = Term $ asRawTerm t - {- | Like `evaluateScript` but doesn't fail. Also returns `Script`. All evaluation failures are treated as equivalent to a `perror`. Plutus does From a328e456d242771b6669ac4c4bf603ace063fbb9 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Feb 2022 10:50:13 +0000 Subject: [PATCH 045/584] Disallow `@|` etc. from taking open terms --- plutarch-test/src/Plutarch/Test/Golden.hs | 34 +++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 3f6a8a705..7d759ad3e 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -1,3 +1,7 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE FunctionalDependencies #-} +{-# LANGUAGE QuantifiedConstraints #-} + module Plutarch.Test.Golden ( pgoldenSpec, (@|), @@ -11,7 +15,6 @@ module Plutarch.Test.Golden ( import Control.Monad (forM_, unless) import qualified Data.Aeson.Text as Aeson -import Data.Kind (Type) import Data.List.NonEmpty (nonEmpty) import qualified Data.List.NonEmpty as NE import Data.Maybe (mapMaybe) @@ -32,10 +35,11 @@ import Test.Syd ( pureGoldenTextFile, ) -import Plutarch +import Plutarch (ClosedTerm, compile, printScript) import Plutarch.Benchmark (benchmarkScript') import Plutarch.Evaluate (evaluateScript) import Plutarch.Internal (Term (Term, asRawTerm)) +import Plutarch.Prelude import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) import qualified Plutus.V1.Ledger.Scripts as Scripts @@ -50,8 +54,8 @@ data GoldenValue = GoldenValue This class exists for syntatic sugar provided by (@->) (via `TermExpectation`). -} -class HasGoldenValue a where - mkGoldenValue :: a -> GoldenValue +class HasGoldenValue (t :: S -> PType -> Type) where + mkGoldenValue :: forall a. (forall s. t s a) -> GoldenValue mkGoldenValue' :: ClosedTerm a -> Maybe Expectation -> GoldenValue mkGoldenValue' p mexp = @@ -64,28 +68,30 @@ mkGoldenValue' p mexp = -- We derive for `Term s a` only because GHC prevents us from deriving for -- `ClosedTerm a`. In practice, this instance should be used only for closed -- terms. -instance HasGoldenValue (Term s a) where +instance HasGoldenValue Term where mkGoldenValue p = mkGoldenValue' (unsafeClosedTerm p) Nothing - where - -- Because, we need a function with this signature. - unsafeClosedTerm :: Term s a -> ClosedTerm a - unsafeClosedTerm t = Term $ asRawTerm t + +-- Because, we need a function with this signature. +unsafeClosedTerm :: Term s a -> ClosedTerm a +unsafeClosedTerm t = Term $ asRawTerm t {- | A `Term` paired with its evaluation expectation Example: >>> TermExpectation (pcon PTrue) $ \p -> pshouldBe (pcon PTrue) -} -data TermExpectation a = TermExpectation (ClosedTerm a) (ClosedTerm a -> Expectation) +data TermExpectation' s a = TermExpectation (Term s a) (Term s a -> Expectation) + +type TermExpectation a = forall s. TermExpectation' s a -- | Test an expectation on a golden Plutarch program (@->) :: ClosedTerm a -> (ClosedTerm a -> Expectation) -> TermExpectation a -(@->) p f = TermExpectation p (\p' -> f p') +(@->) p f = TermExpectation p (\p' -> f $ unsafeClosedTerm p') infixr 1 @-> -instance HasGoldenValue (TermExpectation a) where - mkGoldenValue (TermExpectation p f) = mkGoldenValue' p (Just $ f p) +instance HasGoldenValue TermExpectation' where + mkGoldenValue (TermExpectation p f) = mkGoldenValue' (unsafeClosedTerm p) (Just $ f p) -- | The key used in the .golden files containing multiple golden values newtype GoldenKey = GoldenKey Text @@ -108,7 +114,7 @@ combineGoldens xs = (\(GoldenKey k, v) -> k <> " " <> v) <$> xs -- | Specify goldens for the given Plutarch program -(@|) :: HasGoldenValue v => GoldenKey -> v -> ListSyntax (GoldenKey, GoldenValue) +(@|) :: forall t a. HasGoldenValue t => GoldenKey -> (forall s. t s a) -> ListSyntax (GoldenKey, GoldenValue) (@|) k v = listSyntaxAdd (k, mkGoldenValue v) infixr 0 @| From 398f0c314800f8652e843834e1d9194f59c49583 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Feb 2022 10:50:48 +0000 Subject: [PATCH 046/584] Make definition of `unsafeClosedTerm` more proper --- plutarch-test/src/Plutarch/Test/Golden.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 7d759ad3e..f6506b72a 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -38,7 +38,7 @@ import Test.Syd ( import Plutarch (ClosedTerm, compile, printScript) import Plutarch.Benchmark (benchmarkScript') import Plutarch.Evaluate (evaluateScript) -import Plutarch.Internal (Term (Term, asRawTerm)) +import Plutarch.Internal (Term (Term)) import Plutarch.Prelude import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) import qualified Plutus.V1.Ledger.Scripts as Scripts @@ -73,7 +73,7 @@ instance HasGoldenValue Term where -- Because, we need a function with this signature. unsafeClosedTerm :: Term s a -> ClosedTerm a -unsafeClosedTerm t = Term $ asRawTerm t +unsafeClosedTerm (Term t) = (Term t) {- | A `Term` paired with its evaluation expectation From a2dce4c5a9cea69554a0aaee3c0e95e562e80e38 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Feb 2022 10:59:25 +0000 Subject: [PATCH 047/584] Use `Data.Coerce` instead of `GHC.Prim` --- plutarch-test/plutarch-test.cabal | 1 - plutarch-test/src/Plutarch/ScriptsSpec.hs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 4fea6c9f0..94359b8f9 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -106,7 +106,6 @@ executable plutarch-test build-depends: , base16-bytestring , cborg - , ghc-prim , serialise if impl(ghc >=9.0) diff --git a/plutarch-test/src/Plutarch/ScriptsSpec.hs b/plutarch-test/src/Plutarch/ScriptsSpec.hs index b2cff0387..700bdf595 100644 --- a/plutarch-test/src/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/src/Plutarch/ScriptsSpec.hs @@ -21,7 +21,7 @@ import Data.Text (Text) import qualified Plutus.V1.Ledger.Api as Plutus -import GHC.Prim (coerce) +import Data.Coerce (coerce) import qualified Codec.CBOR.Write as Write import Codec.Serialise (Serialise, encode) From 51ef245d437f7ec34d3f60ce37c6965d4fbbe8e1 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Feb 2022 11:05:23 +0000 Subject: [PATCH 048/584] Remove unnecessary language extensions --- plutarch-test/src/Plutarch/Test/Golden.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index f6506b72a..428757113 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -1,7 +1,3 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE FunctionalDependencies #-} -{-# LANGUAGE QuantifiedConstraints #-} - module Plutarch.Test.Golden ( pgoldenSpec, (@|), From 51ed2bc92e67be3c4e2e8f32daf95d1e0f074f86 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Feb 2022 14:11:52 +0000 Subject: [PATCH 049/584] Fix goldens --- plutarch-test/goldens/bytestring.bench.golden | 6 +++--- plutarch-test/goldens/scripts.auth_validator.bench.golden | 2 +- plutarch-test/goldens/str.bench.golden | 8 ++++---- plutarch-test/goldens/str.eq.bench.golden | 1 - plutarch-test/goldens/str.semigroup.bench.golden | 1 - 5 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 plutarch-test/goldens/str.eq.bench.golden delete mode 100644 plutarch-test/goldens/str.semigroup.bench.golden diff --git a/plutarch-test/goldens/bytestring.bench.golden b/plutarch-test/goldens/bytestring.bench.golden index 2403928ab..547539432 100644 --- a/plutarch-test/goldens/bytestring.bench.golden +++ b/plutarch-test/goldens/bytestring.bench.golden @@ -1,4 +1,4 @@ -empty {"exBudgetCPU":350820,"exBudgetMemory":901,"scriptSizeBytes":14} +empty {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":14} phexByteStr {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":19} plengthByteStr {"exBudgetCPU":496379,"exBudgetMemory":805,"scriptSizeBytes":17} pconsBS {"exBudgetCPU":1381637,"exBudgetMemory":2113,"scriptSizeBytes":33} @@ -6,5 +6,5 @@ pindexByteStr {"exBudgetCPU":298965,"exBudgetMemory":601,"scriptSizeBytes":16} psliceByteStr {"exBudgetCPU":363511,"exBudgetMemory":801,"scriptSizeBytes":22} eq {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":16} semigroup.concats {"exBudgetCPU":546438,"exBudgetMemory":602,"scriptSizeBytes":17} -semigroup.laws.id.1 {"exBudgetCPU":867011,"exBudgetMemory":1302,"scriptSizeBytes":22} -semigroup.laws.id.2 {"exBudgetCPU":867011,"exBudgetMemory":1302,"scriptSizeBytes":21} \ No newline at end of file +semigroup.laws.id.1 {"exBudgetCPU":867632,"exBudgetMemory":1303,"scriptSizeBytes":22} +semigroup.laws.id.2 {"exBudgetCPU":867632,"exBudgetMemory":1303,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.bench.golden b/plutarch-test/goldens/scripts.auth_validator.bench.golden index 99c3d1116..fcc1ac79d 100644 --- a/plutarch-test/goldens/scripts.auth_validator.bench.golden +++ b/plutarch-test/goldens/scripts.auth_validator.bench.golden @@ -1 +1 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":91} \ No newline at end of file +0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":155} \ No newline at end of file diff --git a/plutarch-test/goldens/str.bench.golden b/plutarch-test/goldens/str.bench.golden index be9aabb74..87291e28b 100644 --- a/plutarch-test/goldens/str.bench.golden +++ b/plutarch-test/goldens/str.bench.golden @@ -1,5 +1,5 @@ -eq {"exBudgetCPU":389284,"exBudgetMemory":901,"scriptSizeBytes":18} -semigroup.laws.id.1 {"exBudgetCPU":659376,"exBudgetMemory":1302,"scriptSizeBytes":24} -semigroup.laws.id.2 {"exBudgetCPU":659376,"exBudgetMemory":1302,"scriptSizeBytes":23} -semigroup.concat {"exBudgetCPU":572057,"exBudgetMemory":1003,"scriptSizeBytes":35} +eq {"exBudgetCPU":391284,"exBudgetMemory":901,"scriptSizeBytes":18} +semigroup.laws.id.1 {"exBudgetCPU":663376,"exBudgetMemory":1304,"scriptSizeBytes":24} +semigroup.laws.id.2 {"exBudgetCPU":663376,"exBudgetMemory":1304,"scriptSizeBytes":23} +semigroup.concat {"exBudgetCPU":580057,"exBudgetMemory":1007,"scriptSizeBytes":35} semigroup.mempty {"exBudgetCPU":388284,"exBudgetMemory":901,"scriptSizeBytes":14} \ No newline at end of file diff --git a/plutarch-test/goldens/str.eq.bench.golden b/plutarch-test/goldens/str.eq.bench.golden deleted file mode 100644 index c130bed76..000000000 --- a/plutarch-test/goldens/str.eq.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":391284,"exBudgetMemory":901,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/str.semigroup.bench.golden b/plutarch-test/goldens/str.semigroup.bench.golden deleted file mode 100644 index 20bd6efa1..000000000 --- a/plutarch-test/goldens/str.semigroup.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":304965,"exBudgetMemory":606,"scriptSizeBytes":21} \ No newline at end of file From 4e18fc432b1aca1c0f464e087869fbae2382038b Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 22 Feb 2022 22:57:18 +0530 Subject: [PATCH 050/584] Capture more information on `plift` `ReadKnownError` --- Plutarch/Lift.hs | 15 +++++++++++---- plutarch.cabal | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index adecd02ef..04e4aa55c 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -21,6 +21,7 @@ module Plutarch.Lift ( PUnsafeLiftDecl (..), ) where +import Control.Lens ((^?)) import Data.Coerce import Data.Kind (Type) import GHC.Stack (HasCallStack) @@ -29,7 +30,7 @@ import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInter import qualified Plutus.V1.Ledger.Scripts as Scripts import qualified PlutusCore as PLC import PlutusCore.Builtin (ReadKnownError, readKnownConstant) -import PlutusCore.Evaluation.Machine.Exception (ErrorWithCause, MachineError) +import PlutusCore.Evaluation.Machine.Exception (ErrorWithCause (ErrorWithCause), MachineError, _UnliftingErrorE) import PlutusTx (BuiltinData, Data, builtinDataToData, dataToBuiltinData) import PlutusTx.Builtins.Class (FromBuiltin, ToBuiltin, fromBuiltin, toBuiltin) import qualified UntypedPlutusCore as UPLC @@ -89,9 +90,15 @@ plift' prog = case evalScript (compile prog) of plift :: forall p. (HasCallStack, PLift p) => ClosedTerm p -> PLifted p plift prog = case plift' prog of Right x -> x - Left LiftError_FromRepr -> error "plift failed because of pconstantFromRepr" - Left (LiftError_ReadKnownError _) -> error "plift failed because of an internal error in plutus-core" - Left (LiftError_EvalError e) -> error $ "plift failed because of an erring term: " <> show e + Left LiftError_FromRepr -> error "plift failed: pconstantFromRepr returned 'Nothing'" + Left (LiftError_ReadKnownError (ErrorWithCause e causeMaybe)) -> + let unliftErrMaybe = e ^? _UnliftingErrorE + in error $ + "plift failed: internal plutus-core error: " + <> maybe "ReadKnownEvaluationFailure" show unliftErrMaybe + <> "\n" + <> maybe "" (\x -> "cause: " <> show x) causeMaybe + Left (LiftError_EvalError e) -> error $ "plift failed: erring term: " <> show e -- TODO: Add haddock newtype DerivePConstantDirect (h :: Type) (p :: PType) = DerivePConstantDirect h diff --git a/plutarch.cabal b/plutarch.cabal index 49e669a1f..f2888a670 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -135,6 +135,7 @@ library , flat , generics-sop , hashable + , lens , memory , mtl , plutus-core From 45371c7a106f9a74b1ec37c54876d8cc504610b4 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 12:42:45 -0500 Subject: [PATCH 051/584] plutarch-test: use evalScript, and remove deprecation warnings --- plutarch-test/plutarch-test.cabal | 3 --- plutarch-test/src/Plutarch/Test.hs | 26 +++++++++++------------ plutarch-test/src/Plutarch/Test/Golden.hs | 8 +++---- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index c92eac2cb..2af945fb2 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -100,9 +100,6 @@ library Plutarch.Test.Golden Plutarch.Test.ListSyntax - -- FIXME remove -Wwarn=deprecations - ghc-options: -Wwarn=deprecations - executable plutarch-test import: c, deps main-is: Main.hs diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index f79af72a6..ef5e002cc 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -52,7 +52,7 @@ import Test.Syd ( import Plutarch import Plutarch.Benchmark (benchmarkScript') import Plutarch.Bool (PBool (PFalse, PTrue)) -import Plutarch.Evaluate (evaluateScript) +import Plutarch.Evaluate (evalScript) import Plutarch.Test.Golden ( TermExpectation, compileD, @@ -74,9 +74,9 @@ pshouldBe x y = do p1 `shouldBe` p2 where eval :: Scripts.Script -> IO Scripts.Script - eval s = case evaluateScript s of - Left e -> expectationFailure $ "Script evaluation failed: " <> show e - Right (_, _, x') -> pure x' + eval s = case evalScript s of + (Left e, _, _) -> expectationFailure $ "Script evaluation failed: " <> show e + (Right x', _, _) -> pure x' -- | Like `@?=` but for Plutarch terms (#@?=) :: ClosedTerm a -> ClosedTerm b -> Expectation @@ -93,9 +93,9 @@ passertNot p = p #@?= pcon PFalse -- | Asserts the term evaluates successfully without failing psucceeds :: ClosedTerm a -> Expectation psucceeds p = - case evaluateScript (compile p) of - Left _ -> expectationFailure $ "Term failed to evaluate" - Right _ -> pure () + case evalScript (compile p) of + (Left _, _, _) -> expectationFailure $ "Term failed to evaluate" + (Right _, _, _) -> pure () {- | Asserts that the term evaluates successfully with the given trace sequence @@ -103,9 +103,9 @@ psucceeds p = -} ptraces :: ClosedTerm a -> [Text] -> Expectation ptraces p develTraces = - case evaluateScript (compile p) of - Left _ -> expectationFailure $ "Term failed to evaluate" - Right (_, traceLog, _) -> do + case evalScript (compile p) of + (Left _, _, _) -> expectationFailure $ "Term failed to evaluate" + (Right _, _, traceLog) -> do #ifdef Development traceLog `shouldBe` develTraces #else @@ -138,9 +138,9 @@ plutarchDevFlagDescribe m = -- | Asserts the term evaluates without success pfails :: ClosedTerm a -> Expectation pfails p = do - case evaluateScript (compile p) of - Left _ -> pure () - Right _ -> expectationFailure $ "Term succeeded" + case evalScript (compile p) of + (Left _, _, _) -> pure () + (Right _, _, _) -> expectationFailure $ "Term succeeded" -- | Convenient alias for `@-> pshouldBe x` (@==) :: ClosedTerm a -> ClosedTerm b -> TermExpectation a diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 428757113..ddc170be8 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -33,7 +33,7 @@ import Test.Syd ( import Plutarch (ClosedTerm, compile, printScript) import Plutarch.Benchmark (benchmarkScript') -import Plutarch.Evaluate (evaluateScript) +import Plutarch.Evaluate (evalScript) import Plutarch.Internal (Term (Term)) import Plutarch.Prelude import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) @@ -176,9 +176,9 @@ currentGoldenKey = do -} evaluateScriptAlways :: Scripts.Script -> Scripts.Script evaluateScriptAlways script = - case evaluateScript script of - Left _ -> compile perror - Right (_, _, x) -> x + case evalScript script of + (Left _, _, _) -> compile perror + (Right x, _, _) -> x -- TODO: Make this deterministic -- See https://github.com/Plutonomicon/plutarch/pull/297 From 9ef185b9e56766d4f9f0e76b43190d2ef67f1331 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 13:44:38 -0500 Subject: [PATCH 052/584] plutarch-test: no need for benchmarkScript' As evalScript returns budget, we only need scriptSize from plutarch-benchmark. --- plutarch-benchmark/src/Plutarch/Benchmark.hs | 56 +++++++++---------- plutarch-test/goldens/api.ctx.bench.golden | 2 +- ...i.example.signatory.dev=false.bench.golden | 4 +- ...pi.example.signatory.dev=true.bench.golden | 4 +- plutarch-test/goldens/bool.bench.golden | 12 ++-- ...i.example.signatory.dev=false.bench.golden | 2 +- ...pi.example.signatory.dev=true.bench.golden | 2 +- plutarch-test/src/Plutarch/Test.hs | 7 +-- plutarch-test/src/Plutarch/Test/Golden.hs | 32 ++++++----- 9 files changed, 63 insertions(+), 58 deletions(-) diff --git a/plutarch-benchmark/src/Plutarch/Benchmark.hs b/plutarch-benchmark/src/Plutarch/Benchmark.hs index 689c023c5..9074cfab0 100644 --- a/plutarch-benchmark/src/Plutarch/Benchmark.hs +++ b/plutarch-benchmark/src/Plutarch/Benchmark.hs @@ -9,6 +9,8 @@ module Plutarch.Benchmark ( -- | * Benchmark an arbitraty Plutus script benchmarkScript, benchmarkScript', + mkBenchmark, + scriptSize, -- | * Benchmark entrypoints bench, bench', @@ -21,7 +23,6 @@ module Plutarch.Benchmark ( ) where import Codec.Serialise (serialise) -import Control.Arrow ((&&&)) import Control.Monad (mzero) import Data.Aeson (ToJSON) import qualified Data.ByteString.Lazy as BSL @@ -65,42 +66,46 @@ import qualified Plutus.V1.Ledger.Api as Plutus benchmarkScript :: HasCallStack => String -> Script -> NamedBenchmark benchmarkScript name = NamedBenchmark . (name,) . benchmarkScript' +{-# DEPRECATED benchmarkScript' "use `Plutarch.Evaluate.evalScript` and `mkBenchmark` with `scriptSize`" #-} benchmarkScript' :: HasCallStack => Script -> Benchmark -benchmarkScript' = - uncurry mkBenchmark . (evalScriptCounting &&& (fromInteger . toInteger . SBS.length)) . serialiseScriptShort +benchmarkScript' script = + mkBenchmark + (evalScriptCounting $ serialiseScriptShort script) + (scriptSize script) where - mkBenchmark :: Maybe ExBudget -> Int64 -> Benchmark - mkBenchmark Nothing = - Benchmark Nothing Nothing . ScriptSizeBytes - mkBenchmark (Just (ExBudget cpu mem)) = - Benchmark (Just cpu) (Just mem) . ScriptSizeBytes - - serialiseScriptShort :: Script -> SBS.ShortByteString - serialiseScriptShort = SBS.toShort . LB.toStrict . serialise -- Using `flat` here breaks `evalScriptCounting` - evalScriptCounting :: HasCallStack => Plutus.SerializedScript -> Maybe Plutus.ExBudget + evalScriptCounting :: HasCallStack => Plutus.SerializedScript -> Plutus.ExBudget evalScriptCounting script = let costModel = fromJust Plutus.defaultCostModelParams (_logout, e) = Plutus.evaluateScriptCounting Plutus.Verbose costModel script [] in case e of - Left _evalErr -> Nothing - Right exbudget -> Just exbudget + Left evalErr -> error $ show evalErr + Right exbudget -> exbudget data Benchmark = Benchmark - { exBudgetCPU :: Maybe ExCPU - -- ^ CPU budget used by the script. Nothing if script errors. - , exBudgetMemory :: Maybe ExMemory - -- ^ Memory budget used by the script. Nothing if script errors. + { exBudgetCPU :: ExCPU + -- ^ CPU budget used by the script. + , exBudgetMemory :: ExMemory + -- ^ Memory budget used by the script. , scriptSizeBytes :: ScriptSizeBytes -- ^ Size of Plutus script in bytes } deriving stock (Show, Generic) deriving anyclass (ToJSON) +mkBenchmark :: ExBudget -> ScriptSizeBytes -> Benchmark +mkBenchmark (ExBudget cpu mem) = Benchmark cpu mem + newtype ScriptSizeBytes = ScriptSizeBytes Int64 deriving stock (Eq, Ord, Show, Generic) deriving newtype (Num, ToField) deriving newtype (ToJSON) +scriptSize :: Script -> ScriptSizeBytes +scriptSize = ScriptSizeBytes . fromInteger . toInteger . SBS.length . serialiseScriptShort + +serialiseScriptShort :: Script -> SBS.ShortByteString +serialiseScriptShort = SBS.toShort . LB.toStrict . serialise -- Using `flat` here breaks `evalScriptCounting` + {- | A `Benchmark` with a name. Handy for writing CSV files with headers. @@ -135,14 +140,13 @@ decodeBenchmarks :: LB.ByteString -> Either String [NamedBenchmark] decodeBenchmarks = let (#!) :: Num a => Vector Csv.Field -> Int -> Csv.Parser a (#!) v f = fmap fromInteger . Csv.parseField $ v ! f - mkBenchmark cpu mem sz = Benchmark (Just cpu) (Just mem) sz in fmap Vector.toList <$> Csv.decodeWithP ( \case v | length v == 4 -> fmap NamedBenchmark $ - (,) <$> v .! 0 <*> (mkBenchmark <$> v #! 1 <*> v #! 2 <*> v #! 3) + (,) <$> v .! 0 <*> (Benchmark <$> v #! 1 <*> v #! 2 <*> v #! 3) _ | otherwise -> mzero ) Csv.defaultDecodeOptions @@ -165,8 +169,8 @@ data BenchmarkDiff = BenchmarkDiff diffBenchmark :: HasCallStack => String -> Benchmark -> Benchmark -> Maybe BenchmarkDiff diffBenchmark name - (Benchmark (Just (ExCPU oldCpu)) (Just (ExMemory oldMem)) (ScriptSizeBytes oldSize)) - new@(Benchmark (Just (ExCPU cpu)) (Just (ExMemory mem)) (ScriptSizeBytes size)) + (Benchmark (ExCPU oldCpu) (ExMemory oldMem) (ScriptSizeBytes oldSize)) + new@(Benchmark (ExCPU cpu) (ExMemory mem) (ScriptSizeBytes size)) | oldCpu /= cpu || oldMem /= mem || oldSize /= size = let pctChange old new = softRound (fromInteger (toInteger new - toInteger old) / fromInteger (toInteger $ max old new) * 100) @@ -178,8 +182,6 @@ diffBenchmark , name = name } | otherwise = Nothing -diffBenchmark _ _ _ = - error "Null cpu/mem benchmarks" diffBenchmarks :: [NamedBenchmark] -> [NamedBenchmark] -> BenchmarkDiffs diffBenchmarks (Map.fromList . coerce -> old) (Map.fromList . coerce -> new) = @@ -205,15 +207,13 @@ renderDiffTable (BenchmarkDiffs dropped changed added) = [B.text $ show old <> "(" <> tag <> ")", renderChange diff] renderBenchmarkDiff :: BenchmarkDiff -> [B.Box] - renderBenchmarkDiff (BenchmarkDiff (Benchmark (Just (ExCPU x)) (Just (ExMemory y)) (ScriptSizeBytes z)) (dx, dy, dz) name) = + renderBenchmarkDiff (BenchmarkDiff (Benchmark (ExCPU x) (ExMemory y) (ScriptSizeBytes z)) (dx, dy, dz) name) = mconcat [ [B.text name] , renderResult x dx "cpu" , renderResult y dy "mem" , renderResult z dz "bytes" ] - renderBenchmarkDiff _ = - error "Null cpu/mem benchmarks" in B.vsep 1 B.top @@ -237,7 +237,7 @@ renderBudgetTable bs = , B.text $ show mem <> "(mem)" , B.text $ show sz <> "(bytes)" ] - | NamedBenchmark (name, Benchmark (Just (ExCPU cpu)) (Just (ExMemory mem)) (ScriptSizeBytes sz)) <- bs + | NamedBenchmark (name, Benchmark (ExCPU cpu) (ExMemory mem) (ScriptSizeBytes sz)) <- bs ] benchMain :: [NamedBenchmark] -> IO () diff --git a/plutarch-test/goldens/api.ctx.bench.golden b/plutarch-test/goldens/api.ctx.bench.golden index 2b2d7de30..d0a170966 100644 --- a/plutarch-test/goldens/api.ctx.bench.golden +++ b/plutarch-test/goldens/api.ctx.bench.golden @@ -1,4 +1,4 @@ -term {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":140} +term {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":140} get.txInfo {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} get.mint {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} get.credentials {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden index bd78bd7bc..336511516 100644 --- a/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden +++ b/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden @@ -1,4 +1,4 @@ cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} -cont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":286} +cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":286} termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} -termcont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":286} \ No newline at end of file +termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden index a51a09bc0..6759b8694 100644 --- a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden +++ b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden @@ -1,4 +1,4 @@ cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} -cont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":331} +cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} -termcont.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":331} \ No newline at end of file +termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.bench.golden b/plutarch-test/goldens/bool.bench.golden index 63a05763c..e67edfc40 100644 --- a/plutarch-test/goldens/bool.bench.golden +++ b/plutarch-test/goldens/bool.bench.golden @@ -6,16 +6,16 @@ pand.tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} pand.ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} pand.laziness.pand {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} pand.laziness.op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} -pand.laziness.pand.perror.false {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":5} -pand.laziness.pand.perror.true {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":5} -pand.laziness.pand.perror.op {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":18} +pand.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +pand.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +pand.laziness.pand.perror.op {"exBudgetCPU":101,"exBudgetMemory":101,"scriptSizeBytes":18} por.tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} por.ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} por.tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} por.ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} por.laziness.por {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} por.laziness.op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} -por.laziness.pand.perror.false {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":5} -por.laziness.pand.perror.true {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":5} +por.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +por.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} por.laziness.pand.perror.op.true {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} -por.laziness.pand.perror.op.false {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":18} \ No newline at end of file +por.laziness.pand.perror.op.false {"exBudgetCPU":101,"exBudgetMemory":101,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden index fd107d1ef..bcae55e29 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden @@ -1,2 +1,2 @@ do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} -do.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":286} \ No newline at end of file +do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden index 55f35c191..3d0372498 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -1,2 +1,2 @@ do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":382} -do.fails {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":378} \ No newline at end of file +do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":378} \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index ef5e002cc..f4f84aee0 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -50,13 +50,12 @@ import Test.Syd ( ) import Plutarch -import Plutarch.Benchmark (benchmarkScript') import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evalScript) import Plutarch.Test.Golden ( TermExpectation, compileD, - evaluateScriptAlways, + evalScriptAlwaysWithBenchmark, pgoldenSpec, (@->), (@\), @@ -191,13 +190,13 @@ goldens pg ps = do it "uplc.eval" $ pureGoldenTextFile (goldenFilePath "goldens" name "uplc.eval") $ multiGolden ps $ \p -> - T.pack $ printScript $ evaluateScriptAlways $ compileD p + T.pack $ printScript $ fst $ evalScriptAlwaysWithBenchmark $ compileD p -- Golden test for Plutus benchmarks when (hasBenchGolden pg) $ it "bench" $ pureGoldenTextFile (goldenFilePath "goldens" name "bench") $ multiGolden ps $ \p -> - TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ compileD p + TL.toStrict $ Aeson.encodeToLazyText $ snd $ evalScriptAlwaysWithBenchmark $ compileD p where hasBenchGolden :: PlutarchGolden -> Bool hasBenchGolden = \case diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index ddc170be8..2e647aa19 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -5,7 +5,7 @@ module Plutarch.Test.Golden ( (@->), TermExpectation, goldenKeyString, - evaluateScriptAlways, + evalScriptAlwaysWithBenchmark, compileD, ) where @@ -32,7 +32,7 @@ import Test.Syd ( ) import Plutarch (ClosedTerm, compile, printScript) -import Plutarch.Benchmark (benchmarkScript') +import Plutarch.Benchmark (Benchmark, mkBenchmark, scriptSize) import Plutarch.Evaluate (evalScript) import Plutarch.Internal (Term (Term)) import Plutarch.Prelude @@ -55,11 +55,13 @@ class HasGoldenValue (t :: S -> PType -> Type) where mkGoldenValue' :: ClosedTerm a -> Maybe Expectation -> GoldenValue mkGoldenValue' p mexp = - GoldenValue - (T.pack $ printScript $ compileD p) - (T.pack $ printScript $ evaluateScriptAlways $ compileD p) - (TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ compileD p) - mexp + let compiledScript = compileD p + (evaluatedScript, bench) = evalScriptAlwaysWithBenchmark compiledScript + in GoldenValue + (T.pack $ printScript compiledScript) + (T.pack $ printScript evaluatedScript) + (TL.toStrict $ Aeson.encodeToLazyText bench) + mexp -- We derive for `Term s a` only because GHC prevents us from deriving for -- `ClosedTerm a`. In practice, this instance should be used only for closed @@ -168,17 +170,21 @@ currentGoldenKey = do Just path -> pure $ sconcat $ fmap GoldenKey path -{- | Like `evaluateScript` but doesn't fail. Also returns `Script`. +{- | Like `evalScript` but doesn't fail, and returns `Benchmark`. All evaluation failures are treated as equivalent to a `perror`. Plutus does not provide an accurate way to tell if the program evalutes to `Error` or not; see https://github.com/input-output-hk/plutus/issues/4270 -} -evaluateScriptAlways :: Scripts.Script -> Scripts.Script -evaluateScriptAlways script = - case evalScript script of - (Left _, _, _) -> compile perror - (Right x, _, _) -> x +evalScriptAlwaysWithBenchmark :: Scripts.Script -> (Scripts.Script, Benchmark) +evalScriptAlwaysWithBenchmark script = + let (res, exbudget, _traces) = evalScript script + bench = mkBenchmark exbudget (scriptSize script) + in ( case res of + Left _ -> compile perror + Right x -> x + , bench + ) -- TODO: Make this deterministic -- See https://github.com/Plutonomicon/plutarch/pull/297 From 446bf694a0eb64078282bd08578cba7dc63f3762 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 16:56:41 -0500 Subject: [PATCH 053/584] Remove 'flat' -- unused. Also use fromIntegral --- plutarch-benchmark/plutarch-benchmark.cabal | 1 - plutarch-benchmark/src/Plutarch/Benchmark.hs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/plutarch-benchmark/plutarch-benchmark.cabal b/plutarch-benchmark/plutarch-benchmark.cabal index eee1a346b..e5d660e67 100644 --- a/plutarch-benchmark/plutarch-benchmark.cabal +++ b/plutarch-benchmark/plutarch-benchmark.cabal @@ -80,7 +80,6 @@ library , cassava , containers , data-default - , flat , foldl , mtl , plutarch diff --git a/plutarch-benchmark/src/Plutarch/Benchmark.hs b/plutarch-benchmark/src/Plutarch/Benchmark.hs index 9074cfab0..2a14494fe 100644 --- a/plutarch-benchmark/src/Plutarch/Benchmark.hs +++ b/plutarch-benchmark/src/Plutarch/Benchmark.hs @@ -101,10 +101,10 @@ newtype ScriptSizeBytes = ScriptSizeBytes Int64 deriving newtype (ToJSON) scriptSize :: Script -> ScriptSizeBytes -scriptSize = ScriptSizeBytes . fromInteger . toInteger . SBS.length . serialiseScriptShort +scriptSize = ScriptSizeBytes . fromIntegral . SBS.length . serialiseScriptShort serialiseScriptShort :: Script -> SBS.ShortByteString -serialiseScriptShort = SBS.toShort . LB.toStrict . serialise -- Using `flat` here breaks `evalScriptCounting` +serialiseScriptShort = SBS.toShort . LB.toStrict . serialise {- | A `Benchmark` with a name. From f04a39d1c4e5c8b0b90e6c3acd35ec688473bbdd Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 17:01:53 -0500 Subject: [PATCH 054/584] Clarify comment by mentioning `EvalError`. --- plutarch-test/src/Plutarch/Test/Golden.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 2e647aa19..01470bd4b 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -170,11 +170,11 @@ currentGoldenKey = do Just path -> pure $ sconcat $ fmap GoldenKey path -{- | Like `evalScript` but doesn't fail, and returns `Benchmark`. +{- | Like `evalScript` but doesn't throw `EvalError`, and returns `Benchmark`. - All evaluation failures are treated as equivalent to a `perror`. Plutus does - not provide an accurate way to tell if the program evalutes to `Error` or not; - see https://github.com/input-output-hk/plutus/issues/4270 + On `EvalError`, this function returns `perror` as evaluated script. Plutus + does not provide an accurate way to tell if the program evalutes to `Error` or + not; see https://github.com/input-output-hk/plutus/issues/4270 -} evalScriptAlwaysWithBenchmark :: Scripts.Script -> (Scripts.Script, Benchmark) evalScriptAlwaysWithBenchmark script = From 4a88a3cfbc03d58153dfd2a0e2ef25ecaab0f97a Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 13:00:08 -0500 Subject: [PATCH 055/584] Remove int/bool benchmarks They already exist sufficiently in plutarch-test goldens. --- plutarch-benchmark/bench/Main.hs | 40 +------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/plutarch-benchmark/bench/Main.hs b/plutarch-benchmark/bench/Main.hs index 781ce8f12..f17797359 100644 --- a/plutarch-benchmark/bench/Main.hs +++ b/plutarch-benchmark/bench/Main.hs @@ -28,49 +28,11 @@ benchmarks :: [NamedBenchmark] benchmarks = benchGroup "types" - [ benchGroup "int" integerBench - , benchGroup "bool" boolBench - , benchGroup "builtin:intlist" intListBench + [ benchGroup "builtin:intlist" intListBench , benchGroup "data" dataBench , benchGroup "syn" syntaxBench ] -integerBench :: [[NamedBenchmark]] -integerBench = - [ -- Calling add twice - benchGroup - "add(2)" - $ let addInlined :: Term s PInteger -> Term s PInteger -> Term s PInteger - addInlined x y = x + y + 1 - addUnhoisted :: Term s (PInteger :--> PInteger :--> PInteger) - addUnhoisted = plam $ \x y -> x + y + 1 - addHoisted :: Term s (PInteger :--> PInteger :--> PInteger) - addHoisted = phoistAcyclic $ plam $ \x y -> x + y + 1 - in [ bench "inlined" $ addInlined 12 32 + addInlined 5 4 - , bench "unhoist" $ addUnhoisted # 12 # 32 + addUnhoisted # 5 # 4 - , bench "hoisted" $ addHoisted # 12 # 32 + addHoisted # 5 # 4 - ] - ] - -boolBench :: [[NamedBenchmark]] -boolBench = - let true = pconstant @PBool True - false = pconstant @PBool False - pandNoHoist = phoistAcyclic $ plam $ \x y -> pif' # x # y # (pdelay $ pcon PFalse) - in [ benchGroup - "and" - [ bench "strict" $ pand' # true # false - , bench "lazy" $ (#&&) true false - , -- Calling `pand` twice. - bench "pand(2)" $ - let x = pand # true # pdelay false - in pand # true # x - , bench "pand(2):unhoisted" $ - let x = pandNoHoist # true # pdelay false - in pandNoHoist # true # x - ] - ] - intListBench :: [[NamedBenchmark]] intListBench = let numList = pconstant @(PBuiltinList PInteger) [1 .. 5] From c080e48705cffee6d8e0ab1d3283df5cc605f925 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 13:08:14 -0500 Subject: [PATCH 056/584] Port list benchmarks --- plutarch-benchmark/bench/Main.hs | 56 +------------------ plutarch-test/goldens/list.bench.bench.golden | 5 ++ .../goldens/list.bench.uplc.eval.golden | 5 ++ plutarch-test/goldens/list.bench.uplc.golden | 5 ++ plutarch-test/goldens/list.fun.bench.golden | 6 ++ .../goldens/list.fun.uplc.eval.golden | 6 ++ plutarch-test/goldens/list.fun.uplc.golden | 6 ++ plutarch-test/src/Plutarch/ListSpec.hs | 49 ++++++++++++++++ 8 files changed, 83 insertions(+), 55 deletions(-) create mode 100644 plutarch-test/goldens/list.bench.bench.golden create mode 100644 plutarch-test/goldens/list.bench.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.bench.uplc.golden diff --git a/plutarch-benchmark/bench/Main.hs b/plutarch-benchmark/bench/Main.hs index f17797359..3087b3379 100644 --- a/plutarch-benchmark/bench/Main.hs +++ b/plutarch-benchmark/bench/Main.hs @@ -36,61 +36,7 @@ benchmarks = intListBench :: [[NamedBenchmark]] intListBench = let numList = pconstant @(PBuiltinList PInteger) [1 .. 5] - in [ bench "phead" $ List.phead # numList - , bench "ptail" $ List.ptail # numList - , -- Accessing the first two elements, and adds them. - benchGroup - "x1+x2" - [ -- Via HeadList and TailList only - bench "builtin" $ - (List.phead #$ List.ptail # numList) + (List.phead # numList) - , -- Via ChooseList (twice invoked) - bench "pmatch" $ - pmatch numList $ \case - PNil -> perror - PCons x xs -> - pmatch xs $ \case - PNil -> perror - PCons y _ -> - x + y - ] - , -- Various ways to uncons a list - benchGroup - "uncons" - [ -- ChooseList builtin, like uncons but fails on null lists - bench "ChooseList" $ - pmatch numList $ \case - PNil -> perror - PCons _x xs -> - xs - , -- Retrieving head and tail of a list - bench "head-and-tail" $ - plet (List.phead # numList) $ \_x -> - List.ptail # numList - , -- Retrieve head and tail using builtins, but fail on null lists. - bench "head-and-tail-and-null" $ - plet (List.pnull # numList) $ \isEmpty -> - pmatch isEmpty $ \case - PTrue -> perror - PFalse -> plet (List.phead # numList) $ \_x -> - List.ptail # numList - ] - , bench - "plength" - $ List.plength # pconstant @(PBuiltinList PInteger) [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] - , bench - "pelem" - $ List.pelem # 1 # pconstant @(PBuiltinList PInteger) [5, 2, 3, 4, 7, 5, 1, 6, 2] - , bench - "pall" - $ List.pall @PBuiltinList @PInteger # plam (const $ pconstant @PBool False) # pconstant [1, 2, 3, 4, 5, 6] - , benchGroup - "plistEquals" - [ bench "==(n=3)" $ List.plistEquals @PBuiltinList @PInteger # pconstant [1, 2, 3] # pconstant [1, 2, 3] - , bench "/=(n=4)" $ List.plistEquals @PBuiltinList @PInteger # pconstant [1, 2, 3, 4] # pconstant [1, 2, 3] - , bench "/=(empty;n=3)" $ List.plistEquals @PBuiltinList @PInteger # pconstant [] # pconstant [1, 2, 3] - ] - , benchGroup + in [ benchGroup "primitives" [ bench' $ plam $ \_ -> pconstant True , bench' $ plam $ \_ -> (0 :: Term _ PInteger) diff --git a/plutarch-test/goldens/list.bench.bench.golden b/plutarch-test/goldens/list.bench.bench.golden new file mode 100644 index 000000000..6115fae29 --- /dev/null +++ b/plutarch-test/goldens/list.bench.bench.golden @@ -0,0 +1,5 @@ +x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} +x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} +uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} +uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} +uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.bench.uplc.eval.golden b/plutarch-test/goldens/list.bench.uplc.eval.golden new file mode 100644 index 000000000..20730efd7 --- /dev/null +++ b/plutarch-test/goldens/list.bench.uplc.eval.golden @@ -0,0 +1,5 @@ +x1+x2.builtin (program 1.0.0 3) +x1+x2.pmatch (program 1.0.0 3) +uncons.ChooseList (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail-and-null (program 1.0.0 [2,3,4,5]) \ No newline at end of file diff --git a/plutarch-test/goldens/list.bench.uplc.golden b/plutarch-test/goldens/list.bench.uplc.golden new file mode 100644 index 000000000..8b2e1c0aa --- /dev/null +++ b/plutarch-test/goldens/list.bench.uplc.golden @@ -0,0 +1,5 @@ +x1+x2.builtin (program 1.0.0 ((\i0 -> (\i0 -> addInteger (i1 (force tailList i2)) (i1 i2)) (force headList)) [1,2,3,4,5])) +x1+x2.pmatch (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i1 i3 (delay error) (delay ((\i0 -> force (i2 i1 (delay error) (delay (addInteger (i3 i4) (i3 i1))))) (force tailList i3))))) (force (force chooseList))) (force headList)) [1,2,3,4,5])) +uncons.ChooseList (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay error) (delay (force tailList i1)))) [1,2,3,4,5])) +uncons.head-and-tail (program 1.0.0 ((\i0 -> (\i0 -> force tailList i2) (force headList i1)) [1,2,3,4,5])) +uncons.head-and-tail-and-null (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse i1 (delay error) (delay ((\i0 -> force tailList i3) (force headList i2))))) (force nullList i1)) [1,2,3,4,5])) \ No newline at end of file diff --git a/plutarch-test/goldens/list.fun.bench.golden b/plutarch-test/goldens/list.fun.bench.golden index 537bd0ec2..4449d5a2b 100644 --- a/plutarch-test/goldens/list.fun.bench.golden +++ b/plutarch-test/goldens/list.fun.bench.golden @@ -1,6 +1,12 @@ pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} pnull.nonempty {"exBudgetCPU":16261571,"exBudgetMemory":40093,"scriptSizeBytes":85} pconcat.identity {"exBudgetCPU":2054437,"exBudgetMemory":7000,"scriptSizeBytes":64} +plength {"exBudgetCPU":27522836,"exBudgetMemory":71312,"scriptSizeBytes":95} +pelem {"exBudgetCPU":21833687,"exBudgetMemory":56502,"scriptSizeBytes":97} +pall {"exBudgetCPU":16886804,"exBudgetMemory":42193,"scriptSizeBytes":100} +plistEquals.true {"exBudgetCPU":46644574,"exBudgetMemory":122904,"scriptSizeBytes":126} +plistEquals.false {"exBudgetCPU":25469562,"exBudgetMemory":64918,"scriptSizeBytes":128} +plistEquals.empty {"exBudgetCPU":16381797,"exBudgetMemory":40024,"scriptSizeBytes":125} pmap.eg {"exBudgetCPU":29309216,"exBudgetMemory":77312,"scriptSizeBytes":99} pmap.identity {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":54} pfilter.1 {"exBudgetCPU":35949366,"exBudgetMemory":87322,"scriptSizeBytes":115} diff --git a/plutarch-test/goldens/list.fun.uplc.eval.golden b/plutarch-test/goldens/list.fun.uplc.eval.golden index 9a177ad7f..9f48bf982 100644 --- a/plutarch-test/goldens/list.fun.uplc.eval.golden +++ b/plutarch-test/goldens/list.fun.uplc.eval.golden @@ -1,6 +1,12 @@ pnull.empty (program 1.0.0 True) pnull.nonempty (program 1.0.0 True) pconcat.identity (program 1.0.0 (\i0 -> \i0 -> i2 0 (\i0 -> \i0 -> force i1))) +plength (program 1.0.0 10) +pelem (program 1.0.0 True) +pall (program 1.0.0 False) +plistEquals.true (program 1.0.0 True) +plistEquals.false (program 1.0.0 False) +plistEquals.empty (program 1.0.0 False) pmap.eg (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) pmap.identity (program 1.0.0 (\i0 -> \i0 -> force i1)) pfilter.1 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) diff --git a/plutarch-test/goldens/list.fun.uplc.golden b/plutarch-test/goldens/list.fun.uplc.golden index 34565c7ef..3013d33f4 100644 --- a/plutarch-test/goldens/list.fun.uplc.golden +++ b/plutarch-test/goldens/list.fun.uplc.golden @@ -1,6 +1,12 @@ pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) pnull.nonempty (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 i2 (i4 i1)) (delay i3)) i2) ((\i0 -> i2 i1 (\i0 -> \i0 -> force i1)) 0) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +plength (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> addInteger (i5 i1 i3) 1) (delay i1)) i1 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pelem (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i2 i5) (delay True) (delay (i4 i1)))) (delay False))) 5 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pall (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i5 i2) (delay (i4 i1)))) (delay True))) (\i0 -> False) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +plistEquals.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) +plistEquals.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [1,2,3,4,5,6,7,8,9,10]) (i1 [1,2,3])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +plistEquals.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [1,2,3,4,5,6,7,8,9,10]) (i1 [])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) pmap.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1))) pfilter.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) diff --git a/plutarch-test/src/Plutarch/ListSpec.hs b/plutarch-test/src/Plutarch/ListSpec.hs index bf45272d6..f7a61d75c 100644 --- a/plutarch-test/src/Plutarch/ListSpec.hs +++ b/plutarch-test/src/Plutarch/ListSpec.hs @@ -29,6 +29,16 @@ spec = do let xs :: Term s (PList PInteger) xs = psingleton # (fromInteger @(Term _ PInteger) 0) "identity" @| pconcat # xs # pnil @== xs + "plength" + @| plength # xs10 @== pconstant @PInteger 10 + "pelem" + @| pelem # 5 # xs10 @-> passert + "pall" + @| pall # plam (const $ pconstant @PBool False) # xs10 @-> passertNot + "plistEquals" @\ do + "true" @| plistEquals # xs10 # integerList [1 .. 10] @-> passert + "false" @| plistEquals # xs10 # integerList [1 .. 3] @-> passertNot + "empty" @| plistEquals # xs10 # integerList [] @-> passertNot "pmap" @\ do "eg" @| pmap # (plam $ \x -> x + x) # xs10 @== (integerList $ fmap (* 2) [1 .. 10]) @@ -52,3 +62,42 @@ spec = do @== pconstant @PInteger (foldl (-) 0 [1 .. 10]) "empty" @| pfoldl # plam (-) # 0 # integerList [] @== pconstant @PInteger 0 + -- Benchmarking different ways of using lists + describe "bench" . pgoldenSpec $ do + let numList = pconstant @(PBuiltinList PInteger) [1 .. 5] + -- Two ways of matching on a list + "x1+x2" @\ do + -- Via HeadList and TailList only. + "builtin" @| (phead #$ ptail # numList) + (phead # numList) + -- Via ChooseList (twice invoked) + "pmatch" + @| pmatch numList + $ \case + PNil -> perror + PCons x xs -> + pmatch xs $ \case + PNil -> perror + PCons y _ -> + x + y + -- Various ways of uncons'ing a list + "uncons" @\ do + -- ChooseList builtin, like uncons but fails on null lists + "ChooseList" + @| pmatch numList + $ \case + PNil -> perror + PCons _x xs -> + xs + -- Retrieving head and tail of a list + "head-and-tail" + @| plet (phead # numList) + $ \_x -> + ptail # numList + -- Retrieve head and tail using builtins, but fail on null lists. + "head-and-tail-and-null" + @| plet (pnull # numList) + $ \isEmpty -> + pmatch isEmpty $ \case + PTrue -> perror + PFalse -> plet (phead # numList) $ \_x -> + ptail # numList From 6e7b37dec5d1f7c6fdb3f4d075f2021f71b21d09 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 14:03:01 -0500 Subject: [PATCH 057/584] Port primitive benchmarks --- plutarch-benchmark/bench/Main.hs | 27 ++------------------- plutarch-test/goldens/plam.bench.golden | 14 ++++++++++- plutarch-test/goldens/plam.uplc.eval.golden | 14 ++++++++++- plutarch-test/goldens/plam.uplc.golden | 14 ++++++++++- plutarch-test/src/Plutarch/PLamSpec.hs | 21 +++++++++++++++- 5 files changed, 61 insertions(+), 29 deletions(-) diff --git a/plutarch-benchmark/bench/Main.hs b/plutarch-benchmark/bench/Main.hs index 3087b3379..0b2acbf75 100644 --- a/plutarch-benchmark/bench/Main.hs +++ b/plutarch-benchmark/bench/Main.hs @@ -3,10 +3,9 @@ module Main (main) where import Control.Monad.Trans.Cont (cont, runCont) -import Data.ByteString (ByteString) import Plutarch (ClosedTerm) import Plutarch.Api.V1 -import Plutarch.Benchmark (NamedBenchmark, bench, bench', benchGroup, benchMain) +import Plutarch.Benchmark (NamedBenchmark, bench, benchGroup, benchMain) import Plutarch.Bool import Plutarch.Builtin import qualified Plutarch.List as List @@ -28,32 +27,10 @@ benchmarks :: [NamedBenchmark] benchmarks = benchGroup "types" - [ benchGroup "builtin:intlist" intListBench - , benchGroup "data" dataBench + [ benchGroup "data" dataBench , benchGroup "syn" syntaxBench ] -intListBench :: [[NamedBenchmark]] -intListBench = - let numList = pconstant @(PBuiltinList PInteger) [1 .. 5] - in [ benchGroup - "primitives" - [ bench' $ plam $ \_ -> pconstant True - , bench' $ plam $ \_ -> (0 :: Term _ PInteger) - , bench' $ plam $ \_ -> (1 :: Term _ PInteger) - , bench' $ plam $ \_ -> (512 :: Term _ PInteger) - , bench' $ plam $ \_ -> (1048576 :: Term _ PInteger) - , bench' $ plam $ \_ -> pconstant ("1" :: ByteString) - , bench' $ plam $ \_ -> pconstant ("1111111" :: ByteString) - , bench' $ plam $ \_ -> pconstant ([()] :: [()]) - , bench' $ plam $ \_ -> pconstant () - , bench' $ pconstant () - , bench' $ plam $ \x -> x - , bench' $ plam $ \_ -> (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) - , bench' $ (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) - ] - ] - dataBench :: [[NamedBenchmark]] dataBench = [ benchGroup "deconstruction" deconstrBench diff --git a/plutarch-test/goldens/plam.bench.golden b/plutarch-test/goldens/plam.bench.golden index 5bc8637ad..dfd694f39 100644 --- a/plutarch-test/goldens/plam.bench.golden +++ b/plutarch-test/goldens/plam.bench.golden @@ -1,3 +1,15 @@ id {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} flip.const {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -plet {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file +plet {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.bool.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.int.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +primitives.int.1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +primitives.int.512 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} +primitives.int.1048576 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +primitives.bytestring.1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +primitives.bytestring.1111111 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} +primitives.unit.list {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} +primitives.unit.() {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.id {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +primitives.fun.lam+ {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.fun.+ {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/plam.uplc.eval.golden b/plutarch-test/goldens/plam.uplc.eval.golden index d1e247c5a..3f624fffc 100644 --- a/plutarch-test/goldens/plam.uplc.eval.golden +++ b/plutarch-test/goldens/plam.uplc.eval.golden @@ -1,3 +1,15 @@ id (program 1.0.0 (\i0 -> i1)) flip.const (program 1.0.0 (\i0 -> \i0 -> i1)) -plet (program 1.0.0 (\i0 -> \i0 -> error)) \ No newline at end of file +plet (program 1.0.0 (\i0 -> \i0 -> error)) +primitives.bool.true (program 1.0.0 (\i0 -> True)) +primitives.int.0 (program 1.0.0 (\i0 -> 0)) +primitives.int.1 (program 1.0.0 (\i0 -> 1)) +primitives.int.512 (program 1.0.0 (\i0 -> 512)) +primitives.int.1048576 (program 1.0.0 (\i0 -> 1048576)) +primitives.bytestring.1 (program 1.0.0 (\i0 -> #31)) +primitives.bytestring.1111111 (program 1.0.0 (\i0 -> #31313131313131)) +primitives.unit.list (program 1.0.0 (\i0 -> [()])) +primitives.unit.() (program 1.0.0 (\i0 -> ())) +primitives.id (program 1.0.0 (\i0 -> i1)) +primitives.fun.lam+ (program 1.0.0 (\i0 -> addInteger)) +primitives.fun.+ (program 1.0.0 addInteger) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.uplc.golden b/plutarch-test/goldens/plam.uplc.golden index d1e247c5a..3f624fffc 100644 --- a/plutarch-test/goldens/plam.uplc.golden +++ b/plutarch-test/goldens/plam.uplc.golden @@ -1,3 +1,15 @@ id (program 1.0.0 (\i0 -> i1)) flip.const (program 1.0.0 (\i0 -> \i0 -> i1)) -plet (program 1.0.0 (\i0 -> \i0 -> error)) \ No newline at end of file +plet (program 1.0.0 (\i0 -> \i0 -> error)) +primitives.bool.true (program 1.0.0 (\i0 -> True)) +primitives.int.0 (program 1.0.0 (\i0 -> 0)) +primitives.int.1 (program 1.0.0 (\i0 -> 1)) +primitives.int.512 (program 1.0.0 (\i0 -> 512)) +primitives.int.1048576 (program 1.0.0 (\i0 -> 1048576)) +primitives.bytestring.1 (program 1.0.0 (\i0 -> #31)) +primitives.bytestring.1111111 (program 1.0.0 (\i0 -> #31313131313131)) +primitives.unit.list (program 1.0.0 (\i0 -> [()])) +primitives.unit.() (program 1.0.0 (\i0 -> ())) +primitives.id (program 1.0.0 (\i0 -> i1)) +primitives.fun.lam+ (program 1.0.0 (\i0 -> addInteger)) +primitives.fun.+ (program 1.0.0 addInteger) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/PLamSpec.hs b/plutarch-test/src/Plutarch/PLamSpec.hs index 91e84bbc1..f432c88c1 100644 --- a/plutarch-test/src/Plutarch/PLamSpec.hs +++ b/plutarch-test/src/Plutarch/PLamSpec.hs @@ -2,7 +2,8 @@ module Plutarch.PLamSpec (spec) where import Test.Syd -import Plutarch +import Data.ByteString (ByteString) +import Plutarch.Prelude import Plutarch.Test spec :: Spec @@ -11,3 +12,21 @@ spec = do "id" @| plam (\x -> x) "flip.const" @| plam (\_ y -> y) "plet" @| plam (\x _ -> plet x $ \_ -> perror) + "primitives" @\ do + "bool" @\ do + "true" @| plam $ \_ -> pconstant True + "int" @\ do + "0" @| plam $ \_ -> (0 :: Term _ PInteger) + "1" @| plam $ \_ -> (1 :: Term _ PInteger) + "512" @| plam $ \_ -> (512 :: Term _ PInteger) + "1048576" @| plam $ \_ -> (1048576 :: Term _ PInteger) + "bytestring" @\ do + "1" @| plam $ \_ -> pconstant ("1" :: ByteString) + "1111111" @| plam $ \_ -> pconstant ("1111111" :: ByteString) + "unit" @\ do + "list" @| plam $ \_ -> pconstant ([()] :: [()]) + "()" @| plam $ \_ -> pconstant () + "id" @| plam $ \x -> x + "fun" @\ do + "lam+" @| plam $ \_ -> (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) + "+" @| (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) From 639c85632c517967d5f5fe58fee814c7db1b864c Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 14:08:12 -0500 Subject: [PATCH 058/584] Port monadic syntax benchmarks --- plutarch-benchmark/bench/Main.hs | 43 ------------------- .../goldens/monadic.pmatch-twice.bench.golden | 4 ++ .../monadic.pmatch-twice.uplc.eval.golden | 4 ++ .../goldens/monadic.pmatch-twice.uplc.golden | 4 ++ plutarch-test/src/Plutarch/MonadicSpec.hs | 41 +++++++++++++++++- 5 files changed, 51 insertions(+), 45 deletions(-) create mode 100644 plutarch-test/goldens/monadic.pmatch-twice.bench.golden create mode 100644 plutarch-test/goldens/monadic.pmatch-twice.uplc.eval.golden create mode 100644 plutarch-test/goldens/monadic.pmatch-twice.uplc.golden diff --git a/plutarch-benchmark/bench/Main.hs b/plutarch-benchmark/bench/Main.hs index 0b2acbf75..22ca18f08 100644 --- a/plutarch-benchmark/bench/Main.hs +++ b/plutarch-benchmark/bench/Main.hs @@ -2,13 +2,11 @@ module Main (main) where -import Control.Monad.Trans.Cont (cont, runCont) import Plutarch (ClosedTerm) import Plutarch.Api.V1 import Plutarch.Benchmark (NamedBenchmark, bench, benchGroup, benchMain) import Plutarch.Bool import Plutarch.Builtin -import qualified Plutarch.List as List import qualified Plutarch.Monadic as P import Plutarch.Prelude import Plutus.V1.Ledger.Address (Address (Address)) @@ -28,7 +26,6 @@ benchmarks = benchGroup "types" [ benchGroup "data" dataBench - , benchGroup "syn" syntaxBench ] dataBench :: [[NamedBenchmark]] @@ -270,43 +267,3 @@ deconstrBench = , bench "rewarding" $ f #$ pconstant $ toData rewarding , bench "certifying" $ f #$ pconstant $ toData certifying ] - --- | Nested lambda, vs do-syntax vs cont monad. -syntaxBench :: [[NamedBenchmark]] -syntaxBench = - let integerList :: [Integer] -> Term s (PList PInteger) - integerList xs = List.pconvertLists #$ pconstant @(PBuiltinList PInteger) xs - xs = integerList [1 .. 10] - in [ benchGroup - "ttail-pmatch" - [ -- We expect all these benchmarks to produce equivalent numbers - bench "nested" $ do - pmatch xs $ \case - PSCons _x xs' -> do - pmatch xs' $ \case - PSCons _ xs'' -> - xs'' - PSNil -> perror - PSNil -> perror - , bench "do" $ - P.do - PSCons _ xs' <- pmatch xs - PSCons _ xs'' <- pmatch xs' - xs'' - , bench "cont" $ - flip runCont id $ do - ls <- cont $ pmatch xs - case ls of - PSCons _ xs' -> do - ls' <- cont $ pmatch xs' - case ls' of - PSCons _ xs'' -> pure xs'' - PSNil -> pure perror - PSNil -> pure perror - , bench "termcont" $ - unTermCont $ do - PSCons _ xs' <- TermCont $ pmatch xs - PSCons _ xs'' <- TermCont $ pmatch xs' - pure xs'' - ] - ] diff --git a/plutarch-test/goldens/monadic.pmatch-twice.bench.golden b/plutarch-test/goldens/monadic.pmatch-twice.bench.golden new file mode 100644 index 000000000..1e1b7e693 --- /dev/null +++ b/plutarch-test/goldens/monadic.pmatch-twice.bench.golden @@ -0,0 +1,4 @@ +normal {"exBudgetCPU":16172251,"exBudgetMemory":39792,"scriptSizeBytes":77} +do {"exBudgetCPU":16172251,"exBudgetMemory":39792,"scriptSizeBytes":77} +cont {"exBudgetCPU":16172251,"exBudgetMemory":39792,"scriptSizeBytes":77} +termcont {"exBudgetCPU":16172251,"exBudgetMemory":39792,"scriptSizeBytes":77} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.pmatch-twice.uplc.eval.golden b/plutarch-test/goldens/monadic.pmatch-twice.uplc.eval.golden new file mode 100644 index 000000000..610c12de2 --- /dev/null +++ b/plutarch-test/goldens/monadic.pmatch-twice.uplc.eval.golden @@ -0,0 +1,4 @@ +normal (program 1.0.0 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1)))))))))) +do (program 1.0.0 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1)))))))))) +cont (program 1.0.0 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1)))))))))) +termcont (program 1.0.0 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1)))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.pmatch-twice.uplc.golden b/plutarch-test/goldens/monadic.pmatch-twice.uplc.golden new file mode 100644 index 000000000..565763b92 --- /dev/null +++ b/plutarch-test/goldens/monadic.pmatch-twice.uplc.golden @@ -0,0 +1,4 @@ +normal (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10] (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (delay error))) +do (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10] (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (delay error))) +cont (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10] (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (delay error))) +termcont (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10] (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (delay error))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/MonadicSpec.hs b/plutarch-test/src/Plutarch/MonadicSpec.hs index dfcc862a5..d0d7079cc 100644 --- a/plutarch-test/src/Plutarch/MonadicSpec.hs +++ b/plutarch-test/src/Plutarch/MonadicSpec.hs @@ -3,10 +3,9 @@ module Plutarch.MonadicSpec (spec) where +import Control.Monad.Trans.Cont (cont, runCont) import Test.Syd -import Plutus.V1.Ledger.Api - import Plutarch.Api.V1 ( PAddress (PAddress), PCredential, @@ -17,13 +16,51 @@ import Plutarch.Api.V1 ( PStakingCredential, ) import qualified Plutarch.ApiSpec as ApiSpec +import qualified Plutarch.List as List import qualified Plutarch.Monadic as P import Plutarch.Prelude import Plutarch.Test +import Plutus.V1.Ledger.Api spec :: Spec spec = do describe "monadic" $ do + describe "pmatch-twice" . pgoldenSpec $ do + -- We expect all these benchmarks to produce equivalent numbers + let integerList :: [Integer] -> Term s (PList PInteger) + integerList xs = List.pconvertLists #$ pconstant @(PBuiltinList PInteger) xs + xs = integerList [1 .. 10] + "normal" + @| pmatch xs + $ \case + PSCons _x xs' -> do + pmatch xs' $ \case + PSCons _ xs'' -> + xs'' + PSNil -> perror + PSNil -> perror + "do" + @| P.do + PSCons _ xs' <- pmatch xs + PSCons _ xs'' <- pmatch xs' + xs'' + "cont" + @| flip runCont id + $ do + ls <- cont $ pmatch xs + case ls of + PSCons _ xs' -> do + ls' <- cont $ pmatch xs' + case ls' of + PSCons _ xs'' -> pure xs'' + PSNil -> pure perror + PSNil -> pure perror + "termcont" + @| unTermCont + $ do + PSCons _ xs' <- TermCont $ pmatch xs + PSCons _ xs'' <- TermCont $ pmatch xs' + pure xs'' describe "api.example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. From e1f950899c6a235332995c7058f59112abcfb562 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 14:16:49 -0500 Subject: [PATCH 059/584] Disable these tests until flakiness is fixed cf. plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden --- .../monadic.api.example.signatory.dev=true.uplc.golden | 4 ++-- plutarch-test/goldens/monadic.pmatch-twice.bench.golden | 4 ---- .../goldens/monadic.pmatch-twice.uplc.eval.golden | 4 ---- plutarch-test/goldens/monadic.pmatch-twice.uplc.golden | 4 ---- plutarch-test/src/Plutarch/MonadicSpec.hs | 8 +++++--- 5 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 plutarch-test/goldens/monadic.pmatch-twice.bench.golden delete mode 100644 plutarch-test/goldens/monadic.pmatch-twice.uplc.eval.golden delete mode 100644 plutarch-test/goldens/monadic.pmatch-twice.uplc.golden diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden index ef5f6088f..38d9d9c54 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -1,2 +1,2 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:41:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:41:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.pmatch-twice.bench.golden b/plutarch-test/goldens/monadic.pmatch-twice.bench.golden deleted file mode 100644 index 1e1b7e693..000000000 --- a/plutarch-test/goldens/monadic.pmatch-twice.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -normal {"exBudgetCPU":16172251,"exBudgetMemory":39792,"scriptSizeBytes":77} -do {"exBudgetCPU":16172251,"exBudgetMemory":39792,"scriptSizeBytes":77} -cont {"exBudgetCPU":16172251,"exBudgetMemory":39792,"scriptSizeBytes":77} -termcont {"exBudgetCPU":16172251,"exBudgetMemory":39792,"scriptSizeBytes":77} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.pmatch-twice.uplc.eval.golden b/plutarch-test/goldens/monadic.pmatch-twice.uplc.eval.golden deleted file mode 100644 index 610c12de2..000000000 --- a/plutarch-test/goldens/monadic.pmatch-twice.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -normal (program 1.0.0 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1)))))))))) -do (program 1.0.0 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1)))))))))) -cont (program 1.0.0 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1)))))))))) -termcont (program 1.0.0 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1)))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.pmatch-twice.uplc.golden b/plutarch-test/goldens/monadic.pmatch-twice.uplc.golden deleted file mode 100644 index 565763b92..000000000 --- a/plutarch-test/goldens/monadic.pmatch-twice.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -normal (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10] (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (delay error))) -do (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10] (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (delay error))) -cont (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10] (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (delay error))) -termcont (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10] (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (delay error))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/MonadicSpec.hs b/plutarch-test/src/Plutarch/MonadicSpec.hs index d0d7079cc..6aa57af0b 100644 --- a/plutarch-test/src/Plutarch/MonadicSpec.hs +++ b/plutarch-test/src/Plutarch/MonadicSpec.hs @@ -3,7 +3,6 @@ module Plutarch.MonadicSpec (spec) where -import Control.Monad.Trans.Cont (cont, runCont) import Test.Syd import Plutarch.Api.V1 ( @@ -16,7 +15,6 @@ import Plutarch.Api.V1 ( PStakingCredential, ) import qualified Plutarch.ApiSpec as ApiSpec -import qualified Plutarch.List as List import qualified Plutarch.Monadic as P import Plutarch.Prelude import Plutarch.Test @@ -25,7 +23,10 @@ import Plutus.V1.Ledger.Api spec :: Spec spec = do describe "monadic" $ do - describe "pmatch-twice" . pgoldenSpec $ do + {- TODO: Uncomment this after flakiness is fixed + See https://github.com/Plutonomicon/plutarch/issues/290 + -} + {- describe "pmatch-twice" . pgoldenSpec $ do -- We expect all these benchmarks to produce equivalent numbers let integerList :: [Integer] -> Term s (PList PInteger) integerList xs = List.pconvertLists #$ pconstant @(PBuiltinList PInteger) xs @@ -61,6 +62,7 @@ spec = do PSCons _ xs' <- TermCont $ pmatch xs PSCons _ xs'' <- TermCont $ pmatch xs' pure xs'' + -} describe "api.example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. From a03f016dcc024cd02fd3e1ff82873de2949be054 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 14:23:02 -0500 Subject: [PATCH 060/584] nix: do not run the benchmark effect --- README.md | 2 +- flake.nix | 39 --------------------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/README.md b/README.md index 53c6deabb..ced0313dd 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ package plutarch # Benchmarks -See the [`plutarch-benchmark`](./plutarch-benchmark) library for how to benchmark plutarch, and benchmarking your own scripts. +See the [`plutarch-test`](./plutarch-test) for testing and golden files containing benchmarks and UPLCs. # Usage Read the [Plutarch guide](./docs/GUIDE.md) to get started! diff --git a/flake.nix b/flake.nix index 8190e11e2..ace2f55f1 100644 --- a/flake.nix +++ b/flake.nix @@ -643,7 +643,6 @@ self.flake.${system}.checks // { formatCheck = formatCheckFor system; - benchmark = (nixpkgsFor system).runCommand "benchmark" { } "${self.apps.${system}.benchmark.program} | tee $out"; test-ghc9-nodev = flakeApp2Derivation system "test-ghc9-nodev"; test-ghc9-dev = flakeApp2Derivation system "test-ghc9-dev"; test-ghc810-nodev = flakeApp2Derivation system "test-ghc810-nodev"; @@ -672,15 +671,6 @@ test-ghc9-dev = plutarchTestApp system "ghc9-dev" self.projectMatrix.ghc9.dev; test-ghc810-nodev = plutarchTestApp system "ghc810-nodev" self.projectMatrix.ghc810.nodev; test-ghc810-dev = plutarchTestApp system "ghc810-dev" self.projectMatrix.ghc810.dev; - # TODO: The bellow apps will be removed eventually. - benchmark = { - type = "app"; - program = "${self.flake.${system}.packages."plutarch-benchmark:bench:benchmark"}/bin/benchmark"; - }; - benchmark-diff = { - type = "app"; - program = "${self.flake.${system}.packages."plutarch-benchmark:exe:benchmark-diff"}/bin/benchmark-diff"; - }; } ); devShell = perSystem (system: self.flake.${system}.devShell); @@ -691,35 +681,6 @@ hci-effects = hercules-ci-effects.lib.withPkgs pkgs; in { - # Hercules 0.9 will allow us to calculate the merge-base so we can test all PRs. - # Right now we just hardcode this effect to test every commit against - # origin/staging. We set != "refs/head/master" so that merges into master don't - # cause a lot of unnecessary bogus benchmarks to appear in CI for the time - # being. - benchmark-diff = hci-effects.runIf (src.ref != "refs/heads/master") ( - hci-effects.mkEffect { - src = self; - buildInputs = with pkgs; [ git nixFlakes ]; - effectScript = '' - git clone https://github.com/Plutonomicon/plutarch.git plutarch - cd plutarch - - git checkout $(git merge-base origin/staging ${src.rev}) - nix --extra-experimental-features 'nix-command flakes' run .#benchmark -- --csv > before.csv - - git checkout ${src.rev} - nix --extra-experimental-features 'nix-command flakes' run .#benchmark -- --csv > after.csv - - echo - echo - echo "Benchmark diff between $(git merge-base origin/staging ${src.rev}) and ${src.rev}:" - echo - echo - - nix --extra-experimental-features 'nix-command flakes' run .#benchmark-diff -- before.csv after.csv - ''; - } - ); gh-pages = hci-effects.runIf (src.ref == "refs/heads/master") ( hci-effects.mkEffect { src = self; From dc2893c81c643e6c92433b99692140cf8bbaaf1d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 16:22:10 -0500 Subject: [PATCH 061/584] Port deconstrBench --- plutarch-benchmark/bench/Main.hs | 202 +----------------- .../goldens/plutustype.deconstr.bench.golden | 26 +++ .../plutustype.deconstr.uplc.eval.golden | 27 +++ .../goldens/plutustype.deconstr.uplc.golden | 26 +++ plutarch-test/src/Plutarch/PlutusTypeSpec.hs | 184 +++++++++++++++- plutarch-test/src/Plutarch/Test.hs | 2 + plutarch-test/src/Plutarch/Test/Golden.hs | 7 +- 7 files changed, 270 insertions(+), 204 deletions(-) create mode 100644 plutarch-test/goldens/plutustype.deconstr.bench.golden create mode 100644 plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden create mode 100644 plutarch-test/goldens/plutustype.deconstr.uplc.golden diff --git a/plutarch-benchmark/bench/Main.hs b/plutarch-benchmark/bench/Main.hs index 22ca18f08..457824ad3 100644 --- a/plutarch-benchmark/bench/Main.hs +++ b/plutarch-benchmark/bench/Main.hs @@ -30,8 +30,7 @@ benchmarks = dataBench :: [[NamedBenchmark]] dataBench = - [ benchGroup "deconstruction" deconstrBench - , benchGroup + [ benchGroup "pmatch-pfield" -- These two should ideally have the exact same efficiency. [ benchGroup @@ -68,202 +67,3 @@ dataBench = ] ] ] - -{- | For comparing typed and untyped data deconstruction approaches. - -We ideally want the typed and raw versions to have as little deviation as possible. --} -deconstrBench :: [[NamedBenchmark]] -deconstrBench = - [ benchGroup - "matching" - $ [ benchGroup - "typed" - [ bench "newtype" $ - plam - ( \x -> P.do - PAddress addrFields <- pmatch x - addrFields - ) - # pconstant addrPC - , bench "sumtype(ignore-fields)" $ - plam - ( \x -> P.do - PMinting _ <- pmatch x - pconstant () - ) - # pconstant minting - , bench "sumtype(partial-match)" $ - plam - ( \x -> P.do - PMinting hs <- pmatch x - hs - ) - # pconstant minting - , benchGroup "sumtype(exhaustive)" $ - benchPurpose $ - plam - ( \x -> P.do - purp <- pmatch x - case purp of - PMinting f -> plet f $ const $ phexByteStr "01" - PSpending f -> plet f $ const $ phexByteStr "02" - PRewarding f -> plet f $ const $ phexByteStr "03" - PCertifying f -> plet f $ const $ phexByteStr "04" - ) - , benchGroup "sumtype(exhaustive)(ignore-fields)" $ - benchPurpose $ - plam - ( \x -> P.do - purp <- pmatch x - case purp of - PMinting _ -> phexByteStr "01" - PSpending _ -> phexByteStr "02" - PRewarding _ -> phexByteStr "03" - PCertifying _ -> phexByteStr "04" - ) - ] - , benchGroup - "raw" - [ bench "newtype" $ - plam - ( \x -> - psndBuiltin #$ pasConstr # x - ) - #$ pconstant - $ toData addrPC - , bench "sumtype(ignore-fields)" $ - plam - ( \x -> - pif - ((pfstBuiltin #$ pasConstr # x) #== 0) - (pconstant ()) - perror - ) - #$ pconstant - $ toData minting - , bench "sumtype(partial-match)" $ - plam - ( \x -> - plet (pasConstr # x) $ \d -> - pif - (pfstBuiltin # d #== 0) - (psndBuiltin # d) - perror - ) - #$ pconstant - $ toData minting - , benchGroup "sumtype(exhaustive)" $ - benchPurpose' $ - plam - ( \x -> P.do - d <- plet $ pasConstr # x - constr <- plet $ pfstBuiltin # d - _ <- plet $ psndBuiltin # d - pif - (constr #== 1) - (phexByteStr "02") - $ pif - (constr #== 2) - (phexByteStr "03") - $ pif - (constr #== 3) - (phexByteStr "04") - $ phexByteStr "01" - ) - , benchGroup "sumtype(exhaustive)(ignore-fields)" $ - benchPurpose' $ - plam - ( \x -> P.do - constr <- plet $ pfstBuiltin #$ pasConstr # x - pif - (constr #== 1) - (phexByteStr "02") - $ pif - (constr #== 2) - (phexByteStr "03") - $ pif - (constr #== 3) - (phexByteStr "04") - $ phexByteStr "01" - ) - ] - ] - , benchGroup - "fields" - $ [ benchGroup - "typed" - [ bench "extract-single" $ - plam - ( \x -> - pfield @"credential" # x - ) - # pconstant addrSC - ] - , benchGroup - "raw" - [ bench "extract-single" $ - plam - ( \x -> - phead #$ psndBuiltin #$ pasConstr # x - ) - #$ pconstant - $ toData addrSC - ] - ] - , benchGroup - "combined" - [ benchGroup - "typed" - [ bench "toValidatorHash" $ - plam - ( \x -> P.do - cred <- pmatch . pfromData $ pfield @"credential" # x - case cred of - PPubKeyCredential _ -> pcon PNothing - PScriptCredential credFields -> pcon . PJust $ pto $ pfromData $ pfield @"_0" # credFields - ) - # pconstant addrSC - ] - , benchGroup - "raw" - [ bench "toValidatorHash" $ - plam - ( \x -> - P.do - let cred = phead #$ psndBuiltin #$ pasConstr # x - deconstrCred <- plet $ pasConstr # cred - pif - (pfstBuiltin # deconstrCred #== 0) - (pcon PNothing) - $ pcon . PJust $ pasByteStr #$ phead #$ psndBuiltin # deconstrCred - ) - #$ pconstant - $ toData addrSC - ] - ] - ] - where - addrSC = Address (ScriptCredential "ab") Nothing - addrPC = Address (PubKeyCredential "ab") Nothing - minting = Minting "" - spending = Spending (TxOutRef "ab" 0) - rewarding = Rewarding (StakingPtr 42 0 7) - certifying = Certifying DCertGenesis - -- Bench given function feeding in all 4 types of script purpose (typed). - benchPurpose :: ClosedTerm (PScriptPurpose :--> PByteString) -> [[NamedBenchmark]] - benchPurpose f = - [ bench "minting" $ f # pconstant minting - , bench "spending" $ f # pconstant spending - , bench "rewarding" $ f # pconstant rewarding - , bench "certifying" $ f # pconstant certifying - ] - - -- Bench given function feeding in all 4 types of script purpose (untyped). - benchPurpose' :: ClosedTerm (PData :--> PByteString) -> [[NamedBenchmark]] - benchPurpose' f = - [ bench "minting" $ f #$ pconstant $ toData minting - , bench "spending" $ f #$ pconstant $ toData spending - , bench "rewarding" $ f #$ pconstant $ toData rewarding - , bench "certifying" $ f #$ pconstant $ toData certifying - ] diff --git a/plutarch-test/goldens/plutustype.deconstr.bench.golden b/plutarch-test/goldens/plutustype.deconstr.bench.golden new file mode 100644 index 000000000..aecc38657 --- /dev/null +++ b/plutarch-test/goldens/plutustype.deconstr.bench.golden @@ -0,0 +1,26 @@ +matching.typed.newtype {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} +matching.typed.sumtype(ignore-fields) {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(partial-match) {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(exhaustive).minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive).spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive).rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive).certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.typed.sumtype(exhaustive)(ignore-fields).minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive)(ignore-fields).spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive)(ignore-fields).rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive)(ignore-fields).certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.raw.newtype {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} +matching.raw.sumtype(ignore-fields) {"exBudgetCPU":1122748,"exBudgetMemory":2466,"scriptSizeBytes":33} +matching.raw.sumtype(partial-match) {"exBudgetCPU":1481159,"exBudgetMemory":3198,"scriptSizeBytes":39} +matching.raw.sumtype(exhaustive).minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.raw.sumtype(exhaustive).spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.raw.sumtype(exhaustive).rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.raw.sumtype(exhaustive).certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.raw.sumtype(exhaustive)(ignore-fields).minting {"exBudgetCPU":2291676,"exBudgetMemory":5470,"scriptSizeBytes":75} +matching.raw.sumtype(exhaustive)(ignore-fields).spending {"exBudgetCPU":1301386,"exBudgetMemory":3066,"scriptSizeBytes":85} +matching.raw.sumtype(exhaustive)(ignore-fields).rewarding {"exBudgetCPU":1796531,"exBudgetMemory":4268,"scriptSizeBytes":82} +matching.raw.sumtype(exhaustive)(ignore-fields).certifying {"exBudgetCPU":2291676,"exBudgetMemory":5470,"scriptSizeBytes":77} +fields.typed.extract-single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} +fields.raw.extract-single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} +combined.typed.toValidatorHash {"exBudgetCPU":2496846,"exBudgetMemory":5194,"scriptSizeBytes":72} +combined.raw.toValidatorHash {"exBudgetCPU":2108662,"exBudgetMemory":4362,"scriptSizeBytes":67} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden b/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden new file mode 100644 index 000000000..f3245ed4f --- /dev/null +++ b/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden @@ -0,0 +1,27 @@ +matching.typed.newtype (program 1.0.0 [#d8799f41abff, #d87a80]) +matching.typed.sumtype(ignore-fields) (program 1.0.0 ()) +matching.typed.sumtype(partial-match) (program 1.0.0 [#40]) +matching.typed.sumtype(exhaustive).minting (program 1.0.0 #01) +matching.typed.sumtype(exhaustive).spending (program 1.0.0 #02) +matching.typed.sumtype(exhaustive).rewarding (program 1.0.0 #03) +matching.typed.sumtype(exhaustive).certifying (program 1.0.0 #04) +matching.typed.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 #01) +matching.typed.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 #02) +matching.typed.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 #03) +matching.typed.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 #04) +matching.raw.newtype (program 1.0.0 [#d8799f41abff, #d87a80]) +matching.raw.sumtype(ignore-fields) (program 1.0.0 ()) +matching.raw.sumtype(partial-match) (program 1.0.0 [#40]) +matching.raw.sumtype(exhaustive).minting (program 1.0.0 #01) +matching.raw.sumtype(exhaustive).spending (program 1.0.0 #02) +matching.raw.sumtype(exhaustive).rewarding (program 1.0.0 #03) +matching.raw.sumtype(exhaustive).certifying (program 1.0.0 #04) +matching.raw.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 #01) +matching.raw.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 #02) +matching.raw.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 #03) +matching.raw.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 #04) +fields.typed.extract-single (program 1.0.0 #d87a9f41abff) +fields.raw.extract-single (program 1.0.0 #d87a9f41abff) +combined.typed.toValidatorHash (program 1.0.0 (\i0 -> \i0 -> i2 (unBData (force headList [#41ab])))) +combined.raw.toValidatorHash (program 1.0.0 (\i0 -> \i0 -> i2 (unBData (force headList (force (force sndPair) ( 1 +, [#41ab] )))))) \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.uplc.golden b/plutarch-test/goldens/plutustype.deconstr.uplc.golden new file mode 100644 index 000000000..e9c9de8d6 --- /dev/null +++ b/plutarch-test/goldens/plutustype.deconstr.uplc.golden @@ -0,0 +1,26 @@ +matching.typed.newtype (program 1.0.0 ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) +matching.typed.sumtype(ignore-fields) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay ()) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) +matching.typed.sumtype(partial-match) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) +matching.typed.sumtype(exhaustive).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.raw.newtype (program 1.0.0 ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) +matching.raw.sumtype(ignore-fields) (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) (unConstrData i1)) 0) (delay ()) (delay error))) #d8799f40ff)) +matching.raw.sumtype(partial-match) (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force (force sndPair) i1)) (delay error))) (unConstrData i1)) #d8799f40ff)) +matching.raw.sumtype(exhaustive).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger i2 1) (delay #02) (delay (force (i5 (equalsInteger i2 2) (delay #03) (delay (force (i5 (equalsInteger i2 3) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.raw.sumtype(exhaustive).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger i2 1) (delay #02) (delay (force (i5 (equalsInteger i2 2) (delay #03) (delay (force (i5 (equalsInteger i2 3) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.raw.sumtype(exhaustive).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger i2 1) (delay #02) (delay (force (i5 (equalsInteger i2 2) (delay #03) (delay (force (i5 (equalsInteger i2 3) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.raw.sumtype(exhaustive).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger i2 1) (delay #02) (delay (force (i5 (equalsInteger i2 2) (delay #03) (delay (force (i5 (equalsInteger i2 3) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.raw.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i3 (equalsInteger i1 1) (delay #02) (delay (force (i3 (equalsInteger i1 2) (delay #03) (delay (force (i3 (equalsInteger i1 3) (delay #04) (delay #01))))))))) (force (force fstPair) (unConstrData i1))) #d8799f40ff) (force ifThenElse))) +matching.raw.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i3 (equalsInteger i1 1) (delay #02) (delay (force (i3 (equalsInteger i1 2) (delay #03) (delay (force (i3 (equalsInteger i1 3) (delay #04) (delay #01))))))))) (force (force fstPair) (unConstrData i1))) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.raw.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i3 (equalsInteger i1 1) (delay #02) (delay (force (i3 (equalsInteger i1 2) (delay #03) (delay (force (i3 (equalsInteger i1 3) (delay #04) (delay #01))))))))) (force (force fstPair) (unConstrData i1))) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.raw.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i3 (equalsInteger i1 1) (delay #02) (delay (force (i3 (equalsInteger i1 2) (delay #03) (delay (force (i3 (equalsInteger i1 3) (delay #04) (delay #01))))))))) (force (force fstPair) (unConstrData i1))) #d87c9fd87e80ff) (force ifThenElse))) +fields.typed.extract-single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd87a9f41abffd87a80ff)) +fields.raw.extract-single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd87a9f41abffd87a80ff)) +combined.typed.toValidatorHash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 1 i2) (delay (\i0 -> \i0 -> i2 (unBData (i7 i3)))) (delay (\i0 -> \i0 -> force i1)))) (i5 i2)) (force (force fstPair) i1)) (unConstrData (i2 (i3 (unConstrData i1))))) #d8799fd87a9f41abffd87a80ff) (force headList)) (force (force sndPair)))) +combined.raw.toValidatorHash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 (unBData (i5 (i6 i3))))))) (unConstrData (i2 (i3 (unConstrData i1))))) #d8799fd87a9f41abffd87a80ff) (force headList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs index 4c0762c12..eaa093558 100644 --- a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs @@ -1,13 +1,23 @@ {-# LANGUAGE CPP #-} +{-# OPTIONS_GHC -Wno-unused-imports #-} +{-# OPTIONS_GHC -Wno-unused-local-binds #-} module Plutarch.PlutusTypeSpec (spec) where import Test.Syd import Plutarch +import Plutarch.Api.V1 +import Plutarch.Builtin import Plutarch.Prelude - import Plutarch.Test +import Plutus.V1.Ledger.Address (Address (Address)) +import Plutus.V1.Ledger.Api (DCert (DCertGenesis), toData) +import Plutus.V1.Ledger.Contexts (ScriptPurpose (Certifying, Minting, Rewarding, Spending), TxOutRef (TxOutRef)) +import Plutus.V1.Ledger.Credential ( + Credential (PubKeyCredential, ScriptCredential), + StakingCredential (StakingPtr), + ) spec :: Spec spec = do @@ -22,6 +32,178 @@ spec = do plutarchDevFlagDescribe $ do it "PBuiltinList" $ do pmatchTargetEval $ pconstant [1 :: Integer, 2, 3, 4] + deconstrSpec + +{- | For comparing typed and untyped data deconstruction approaches. + +We ideally want the typed and raw versions to have as little deviation as possible. +-} +deconstrSpec :: Spec +deconstrSpec = do + describe "deconstr" . pgoldenSpec $ do + "matching" @\ do + "typed" @\ do + "newtype" + @| plam + ( \x -> pmatch x $ \(PAddress addrFields) -> + addrFields + ) + # pconstant addrPC + "sumtype(ignore-fields)" + @| plam + ( \x -> pmatch x $ \case + PMinting _ -> pconstant () + _ -> perror + ) + # pconstant minting + "sumtype(partial-match)" + @| plam + ( \x -> pmatch x $ \case + PMinting hs -> hs + _ -> perror + ) + # pconstant minting + "sumtype(exhaustive)" @\ do + benchPurpose $ + plam + ( \x -> pmatch x $ \case + PMinting f -> plet f $ const $ phexByteStr "01" + PSpending f -> plet f $ const $ phexByteStr "02" + PRewarding f -> plet f $ const $ phexByteStr "03" + PCertifying f -> plet f $ const $ phexByteStr "04" + ) + "sumtype(exhaustive)(ignore-fields)" @\ do + benchPurpose $ + plam + ( \x -> pmatch x $ \case + PMinting _ -> phexByteStr "01" + PSpending _ -> phexByteStr "02" + PRewarding _ -> phexByteStr "03" + PCertifying _ -> phexByteStr "04" + ) + "raw" @\ do + "newtype" + @| plam + ( \x -> + psndBuiltin #$ pasConstr # x + ) + #$ pconstant + (toData addrPC) + "sumtype(ignore-fields)" + @| plam + ( \x -> + pif + ((pfstBuiltin #$ pasConstr # x) #== 0) + (pconstant ()) + perror + ) + #$ pconstant (toData minting) + "sumtype(partial-match)" + @| plam + ( \x -> + plet (pasConstr # x) $ \d -> + pif + (pfstBuiltin # d #== 0) + (psndBuiltin # d) + perror + ) + #$ pconstant (toData minting) + "sumtype(exhaustive)" @\ do + benchPurpose' $ + plam + ( \x -> + plet (pasConstr # x) $ \d -> + plet (pfstBuiltin # d) $ \constr -> + plet (psndBuiltin # d) $ \_ -> + pif + (constr #== 1) + (phexByteStr "02") + $ pif + (constr #== 2) + (phexByteStr "03") + $ pif + (constr #== 3) + (phexByteStr "04") + $ phexByteStr "01" + ) + "sumtype(exhaustive)(ignore-fields)" @\ do + benchPurpose' $ + plam + ( \x -> do + plet (pfstBuiltin #$ pasConstr # x) $ \constr -> + pif + (constr #== 1) + (phexByteStr "02") + $ pif + (constr #== 2) + (phexByteStr "03") + $ pif + (constr #== 3) + (phexByteStr "04") + $ phexByteStr "01" + ) + "fields" @\ do + "typed" @\ do + "extract-single" + @| plam + ( \x -> + pfield @"credential" # x + ) + # pconstant addrSC + "raw" @\ do + "extract-single" + @| plam + ( \x -> + phead #$ psndBuiltin #$ pasConstr # x + ) + #$ pconstant + $ toData addrSC + "combined" @\ do + "typed" @\ do + "toValidatorHash" + @| plam + ( \x -> + pmatch (pfromData $ pfield @"credential" # x) $ \case + PPubKeyCredential _ -> + pcon PNothing + PScriptCredential credFields -> + pcon . PJust $ pto $ pfromData $ pfield @"_0" # credFields + ) + # pconstant addrSC + "raw" @\ do + "toValidatorHash" + @| plam + ( \x -> + let cred = phead #$ psndBuiltin #$ pasConstr # x + in plet (pasConstr # cred) $ \deconstrCred -> + pif + (pfstBuiltin # deconstrCred #== 0) + (pcon PNothing) + $ pcon . PJust $ pasByteStr #$ phead #$ psndBuiltin # deconstrCred + ) + # pconstant (toData addrSC) + where + addrSC = Address (ScriptCredential "ab") Nothing + addrPC = Address (PubKeyCredential "ab") Nothing + minting :: ScriptPurpose + minting = Minting "" + spending = Spending (TxOutRef "ab" 0) + rewarding = Rewarding (StakingPtr 42 0 7) + certifying = Certifying DCertGenesis + -- Bench given function feeding in all 4 types of script purpose (typed). + benchPurpose :: ClosedTerm (PScriptPurpose :--> PByteString) -> PlutarchGoldens + benchPurpose f = do + "minting" @| f # pconstant minting + "spending" @| f # pconstant spending + "rewarding" @| f # pconstant rewarding + "certifying" @| f # pconstant certifying + -- Bench given function feeding in all 4 types of script purpose (untyped). + benchPurpose' :: ClosedTerm (PData :--> PByteString) -> PlutarchGoldens + benchPurpose' f = do + "minting" @| f #$ pconstant $ toData minting + "spending" @| f #$ pconstant $ toData spending + "rewarding" @| f #$ pconstant $ toData rewarding + "certifying" @| f #$ pconstant $ toData certifying -- | Make sure the target of 'pmatch' is only evaluated once. pmatchTargetEval :: PlutusType p => ClosedTerm p -> Expectation diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index f4f84aee0..c07d3477b 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -21,6 +21,7 @@ module Plutarch.Test ( (@->), (@==), pgoldenSpec, + PlutarchGoldens, -- * Deprecated exports golden, @@ -53,6 +54,7 @@ import Plutarch import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evalScript) import Plutarch.Test.Golden ( + PlutarchGoldens, TermExpectation, compileD, evalScriptAlwaysWithBenchmark, diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 01470bd4b..1928064e1 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -4,6 +4,7 @@ module Plutarch.Test.Golden ( (@\), (@->), TermExpectation, + PlutarchGoldens, goldenKeyString, evalScriptAlwaysWithBenchmark, compileD, @@ -111,14 +112,16 @@ combineGoldens xs = T.intercalate "\n" $ (\(GoldenKey k, v) -> k <> " " <> v) <$> xs +type PlutarchGoldens = ListSyntax (GoldenKey, GoldenValue) + -- | Specify goldens for the given Plutarch program -(@|) :: forall t a. HasGoldenValue t => GoldenKey -> (forall s. t s a) -> ListSyntax (GoldenKey, GoldenValue) +(@|) :: forall t a. HasGoldenValue t => GoldenKey -> (forall s. t s a) -> PlutarchGoldens (@|) k v = listSyntaxAdd (k, mkGoldenValue v) infixr 0 @| -- | Add an expectation for the Plutarch program specified with (@|) -(@\) :: GoldenKey -> ListSyntax (GoldenKey, GoldenValue) -> ListSyntax (GoldenKey, GoldenValue) +(@\) :: GoldenKey -> PlutarchGoldens -> PlutarchGoldens (@\) = listSyntaxAddSubList {- | Create golden specs for pre/post-eval UPLC and benchmarks. From 981074584b9ae16270c06ca649e48e83cbbdfbbf Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 16:28:23 -0500 Subject: [PATCH 062/584] Port the rest of benchmarks --- plutarch-benchmark/bench/Main.hs | 63 +------------------ plutarch-test/goldens/field.data.bench.golden | 4 ++ .../goldens/field.data.uplc.eval.golden | 4 ++ plutarch-test/goldens/field.data.uplc.golden | 4 ++ plutarch-test/src/Plutarch/FieldSpec.hs | 35 ++++++++++- 5 files changed, 46 insertions(+), 64 deletions(-) create mode 100644 plutarch-test/goldens/field.data.bench.golden create mode 100644 plutarch-test/goldens/field.data.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.data.uplc.golden diff --git a/plutarch-benchmark/bench/Main.hs b/plutarch-benchmark/bench/Main.hs index 457824ad3..258d95bfa 100644 --- a/plutarch-benchmark/bench/Main.hs +++ b/plutarch-benchmark/bench/Main.hs @@ -1,69 +1,10 @@ -{-# LANGUAGE QualifiedDo #-} - module Main (main) where -import Plutarch (ClosedTerm) -import Plutarch.Api.V1 -import Plutarch.Benchmark (NamedBenchmark, bench, benchGroup, benchMain) -import Plutarch.Bool -import Plutarch.Builtin -import qualified Plutarch.Monadic as P -import Plutarch.Prelude -import Plutus.V1.Ledger.Address (Address (Address)) -import Plutus.V1.Ledger.Api (DCert (DCertGenesis), toData) -import Plutus.V1.Ledger.Contexts (ScriptPurpose (Certifying, Minting, Rewarding, Spending), TxOutRef (TxOutRef)) -import Plutus.V1.Ledger.Credential ( - Credential (PubKeyCredential, ScriptCredential), - StakingCredential (StakingPtr), - ) +import Plutarch.Benchmark (NamedBenchmark, benchMain) main :: IO () main = do benchMain benchmarks benchmarks :: [NamedBenchmark] -benchmarks = - benchGroup - "types" - [ benchGroup "data" dataBench - ] - -dataBench :: [[NamedBenchmark]] -dataBench = - [ benchGroup - "pmatch-pfield" - -- These two should ideally have the exact same efficiency. - [ benchGroup - "pmatch" - [ bench "newtype" $ P.do - let addr = pconstant $ Address (PubKeyCredential "ab") Nothing - PAddress addrFields <- pmatch addr - y <- pletFields @'["credential", "stakingCredential"] addrFields - ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y - ] - , benchGroup - "pfield" - [ bench "newtype" $ P.do - let addr = pconstant $ Address (PubKeyCredential "ab") Nothing - y <- pletFields @'["credential", "stakingCredential"] addr - ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y - ] - ] - , benchGroup - "pfield-pletFields" - -- These two should ideally have the exact same efficiency. - [ benchGroup - "pfield" - [ bench "single" $ P.do - let addr = pconstant $ Address (PubKeyCredential "ab") Nothing - pfromData $ pfield @"credential" # addr - ] - , benchGroup - "pletFields" - [ bench "single" $ P.do - let addr = pconstant $ Address (PubKeyCredential "ab") Nothing - y <- pletFields @'["credential"] addr - pfromData $ hrecField @"credential" y - ] - ] - ] +benchmarks = [] \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.bench.golden b/plutarch-test/goldens/field.data.bench.golden new file mode 100644 index 000000000..fb3535e2d --- /dev/null +++ b/plutarch-test/goldens/field.data.bench.golden @@ -0,0 +1,4 @@ +pmatch-pfield.pmatch.newtype {"exBudgetCPU":1733744,"exBudgetMemory":3092,"scriptSizeBytes":45} +pmatch-pfield.pfield.newtype {"exBudgetCPU":1733744,"exBudgetMemory":3092,"scriptSizeBytes":45} +pfield-pletFields.pfield.single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} +pfield-pletFields.pletFields.single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.uplc.eval.golden b/plutarch-test/goldens/field.data.uplc.eval.golden new file mode 100644 index 000000000..183cfd7b7 --- /dev/null +++ b/plutarch-test/goldens/field.data.uplc.eval.golden @@ -0,0 +1,4 @@ +pmatch-pfield.pmatch.newtype (program 1.0.0 (#d8799f41abff, #d87a80)) +pmatch-pfield.pfield.newtype (program 1.0.0 (#d8799f41abff, #d87a80)) +pfield-pletFields.pfield.single (program 1.0.0 #d8799f41abff) +pfield-pletFields.pletFields.single (program 1.0.0 #d8799f41abff) \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.uplc.golden b/plutarch-test/goldens/field.data.uplc.golden new file mode 100644 index 000000000..b8d5b8853 --- /dev/null +++ b/plutarch-test/goldens/field.data.uplc.golden @@ -0,0 +1,4 @@ +pmatch-pfield.pmatch.newtype (program 1.0.0 ((\i0 -> (\i0 -> mkPairData (i2 i1) (i2 (force tailList i1))) ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) (force headList))) +pmatch-pfield.pfield.newtype (program 1.0.0 ((\i0 -> (\i0 -> mkPairData (i2 i1) (i2 (force tailList i1))) ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) (force headList))) +pfield-pletFields.pfield.single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f41abffd87a80ff)) +pfield-pletFields.pletFields.single (program 1.0.0 (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/FieldSpec.hs b/plutarch-test/src/Plutarch/FieldSpec.hs index 06811f644..6578e60fa 100644 --- a/plutarch-test/src/Plutarch/FieldSpec.hs +++ b/plutarch-test/src/Plutarch/FieldSpec.hs @@ -9,18 +9,23 @@ import Test.Tasty.HUnit import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) import Plutarch +import Plutarch.Api.V1 +import Plutarch.Builtin import Plutarch.DataRepr ( PDataFields, PIsDataReprInstances (PIsDataReprInstances), ) +import Plutarch.Prelude +import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) +import Plutus.V1.Ledger.Address (Address (Address)) +import Plutus.V1.Ledger.Credential ( + Credential (PubKeyCredential), + ) import qualified PlutusCore as PLC import qualified PlutusTx -import Plutarch.Prelude -import Plutarch.Test - spec :: Spec spec = do describe "field" $ do @@ -62,6 +67,30 @@ spec = do describe "other" . pgoldenSpec $ do "by" @| by @-> \p -> plift p @?= 10 "dotPlus" @| dotPlus @-> \p -> plift p @?= 19010 + describe "data" . pgoldenSpec $ do + "pmatch-pfield" @\ do + -- These two should ideally have the exact same efficiency. + "pmatch" @\ do + "newtype" + @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing + in pmatch addr $ \(PAddress addrFields) -> + pletFields @'["credential", "stakingCredential"] addrFields $ \y -> + ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y + "pfield" @\ do + "newtype" + @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing + in pletFields @'["credential", "stakingCredential"] addr $ \y -> + ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y + "pfield-pletFields" @\ do + "pfield" @\ do + "single" + @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing + in pfromData $ pfield @"credential" # addr + "pletFields" @\ do + "single" + @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing + in pletFields @'["credential"] addr $ \y -> + pfromData $ hrecField @"credential" y -------------------------------------------------------------------------------- From 54c5b9a8e0ce9dd830c18369cf92320c8b957e7e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 16:37:14 -0500 Subject: [PATCH 063/584] Remove benchmark exe/bench/diff --- plutarch-benchmark/README.md | 39 -------------------- plutarch-benchmark/bench/Main.hs | 10 ----- plutarch-benchmark/benchmark-diff/Main.hs | 23 ------------ plutarch-benchmark/plutarch-benchmark.cabal | 25 ------------- plutarch-test/src/Plutarch/FieldSpec.hs | 16 +++----- plutarch-test/src/Plutarch/PlutusTypeSpec.hs | 12 +++--- 6 files changed, 13 insertions(+), 112 deletions(-) delete mode 100644 plutarch-benchmark/README.md delete mode 100644 plutarch-benchmark/bench/Main.hs delete mode 100644 plutarch-benchmark/benchmark-diff/Main.hs diff --git a/plutarch-benchmark/README.md b/plutarch-benchmark/README.md deleted file mode 100644 index cbbf2d9d8..000000000 --- a/plutarch-benchmark/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# `plutarch-benchmark` - -**NOTE**: These benchmarks will soon be removed, to be replaced by the golden tests in `./plutarch-test`. - -```sh -# If running from repo root: -cabal bench plutarch-benchmark -# Or, if running from this sub directory: -cabal bench -``` - -This will write the benchmark report to `bench.csv` as well as output a table view of the same. - -## Benchmarking a commit -To run benchmarks on a particular commit, - -``` -nix run github:Plutonomicon/plutarch/#benchmark -``` - -You can also emit a `.csv` file into stdout by passing the `--csv` flag: - -``` -nix run github:Plutonomicon/plutarch/#benchmark -- --csv -``` - -## Benchmarking in CI - -Note that you can also view these benchmarks on a per-commit basis by looking at Hercules CI logs. Go to the Hercules CI job run for a given commit, and navigate to the `checks.x86_64-linux.benchmark` page in the Attributes table, and then click on the "Log" header to view its output. - -Additionally, a Hercules Effect to diff benchmarks between commits is created for PRs into staging. This is findable from the effects link on the PR. - -## Diffing two `.csv` files - -You can diff two previous result files using the `benchmark-diff` binary: - -``` -nix run .#benchmark-diff -- -``` diff --git a/plutarch-benchmark/bench/Main.hs b/plutarch-benchmark/bench/Main.hs deleted file mode 100644 index 258d95bfa..000000000 --- a/plutarch-benchmark/bench/Main.hs +++ /dev/null @@ -1,10 +0,0 @@ -module Main (main) where - -import Plutarch.Benchmark (NamedBenchmark, benchMain) - -main :: IO () -main = do - benchMain benchmarks - -benchmarks :: [NamedBenchmark] -benchmarks = [] \ No newline at end of file diff --git a/plutarch-benchmark/benchmark-diff/Main.hs b/plutarch-benchmark/benchmark-diff/Main.hs deleted file mode 100644 index b8eace681..000000000 --- a/plutarch-benchmark/benchmark-diff/Main.hs +++ /dev/null @@ -1,23 +0,0 @@ -module Main (main) where - -import Plutarch.Benchmark (decodeBenchmarks, diffBenchmarks, renderDiffTable) - -import qualified Data.ByteString.Lazy as BSL -import System.Environment (getArgs) -import qualified Text.PrettyPrint.Boxes as B - --------------------------------------------------------------------------------- - -main :: IO () -main = - getArgs >>= \case - [oldPath, newPath] -> do - Right old <- decodeBenchmarks <$> BSL.readFile oldPath - Right new <- decodeBenchmarks <$> BSL.readFile newPath - - putStrLn . B.render . renderDiffTable $ diffBenchmarks old new - _ -> usage - -usage :: IO () -usage = - putStrLn "usage: benchmark-diff [old] [new]" diff --git a/plutarch-benchmark/plutarch-benchmark.cabal b/plutarch-benchmark/plutarch-benchmark.cabal index e5d660e67..a8cdcb767 100644 --- a/plutarch-benchmark/plutarch-benchmark.cabal +++ b/plutarch-benchmark/plutarch-benchmark.cabal @@ -91,28 +91,3 @@ library , vector hs-source-dirs: src - -benchmark benchmark - import: c - type: exitcode-stdio-1.0 - hs-source-dirs: bench - main-is: Main.hs - build-depends: - , base - , bytestring - , plutarch - , plutarch-benchmark - , plutus-ledger-api - , transformers - -executable benchmark-diff - import: c - hs-source-dirs: benchmark-diff - main-is: Main.hs - build-depends: - , base - , boxes - , bytestring - , cassava - , plutarch - , plutarch-benchmark diff --git a/plutarch-test/src/Plutarch/FieldSpec.hs b/plutarch-test/src/Plutarch/FieldSpec.hs index 6578e60fa..8e773f25f 100644 --- a/plutarch-test/src/Plutarch/FieldSpec.hs +++ b/plutarch-test/src/Plutarch/FieldSpec.hs @@ -3,14 +3,17 @@ module Plutarch.FieldSpec (spec) where +import Plutus.V1.Ledger.Address (Address (Address)) +import Plutus.V1.Ledger.Credential (Credential (PubKeyCredential)) +import qualified PlutusCore as PLC +import qualified PlutusTx import Test.Syd import Test.Tasty.HUnit import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -import Plutarch -import Plutarch.Api.V1 -import Plutarch.Builtin +import Plutarch.Api.V1 (PAddress (PAddress)) +import Plutarch.Builtin (ppairDataBuiltin) import Plutarch.DataRepr ( PDataFields, PIsDataReprInstances (PIsDataReprInstances), @@ -19,13 +22,6 @@ import Plutarch.Prelude import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) -import Plutus.V1.Ledger.Address (Address (Address)) -import Plutus.V1.Ledger.Credential ( - Credential (PubKeyCredential), - ) -import qualified PlutusCore as PLC -import qualified PlutusTx - spec :: Spec spec = do describe "field" $ do diff --git a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs index eaa093558..354d509cf 100644 --- a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs @@ -1,14 +1,16 @@ {-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -Wno-unused-imports #-} -{-# OPTIONS_GHC -Wno-unused-local-binds #-} module Plutarch.PlutusTypeSpec (spec) where import Test.Syd -import Plutarch -import Plutarch.Api.V1 -import Plutarch.Builtin +import Plutarch (ClosedTerm, pcon', pmatch') +import Plutarch.Api.V1 ( + PAddress (PAddress), + PCredential (PPubKeyCredential, PScriptCredential), + PScriptPurpose (PCertifying, PMinting, PRewarding, PSpending), + ) +import Plutarch.Builtin (pasByteStr, pasConstr) import Plutarch.Prelude import Plutarch.Test import Plutus.V1.Ledger.Address (Address (Address)) From b9f3dc408b71c2f876b80016438346ade03e9c86 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 16:51:07 -0500 Subject: [PATCH 064/584] gitignore: no longer necessary --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6bd616d62..36f5659ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /result* /dist-newstyle .direnv -bench.csv \ No newline at end of file From d1de3ab532ba9d5d287cdf69ba78f74bd8e64735 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 17:08:28 -0500 Subject: [PATCH 065/584] rm plutarch-benchmark; create Plutarch.Test.Benchmark --- flake.nix | 1 - plutarch-benchmark/plutarch-benchmark.cabal | 93 ------- plutarch-benchmark/src/Plutarch/Benchmark.hs | 251 ------------------- plutarch-test/plutarch-test.cabal | 9 +- plutarch-test/src/Plutarch/Test/Benchmark.hs | 38 +++ plutarch-test/src/Plutarch/Test/Golden.hs | 2 +- 6 files changed, 45 insertions(+), 349 deletions(-) delete mode 100644 plutarch-benchmark/plutarch-benchmark.cabal delete mode 100644 plutarch-benchmark/src/Plutarch/Benchmark.hs create mode 100644 plutarch-test/src/Plutarch/Test/Benchmark.hs diff --git a/flake.nix b/flake.nix index ace2f55f1..9bbb3f472 100644 --- a/flake.nix +++ b/flake.nix @@ -649,7 +649,6 @@ test-ghc810-dev = flakeApp2Derivation system "test-ghc810-dev"; "ghc810-plutarch:lib:plutarch" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch:lib:plutarch"; "ghc810-plutarch:lib:plutarch-test" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch-test:lib:plutarch-test"; - "ghc810-plutarch:lib:plutarch-benchmark" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch-benchmark:lib:plutarch-benchmark"; }); # Because `nix flake check` does not work with haskell.nix (due to IFD), # we provide this attribute for running the checks locally, using: diff --git a/plutarch-benchmark/plutarch-benchmark.cabal b/plutarch-benchmark/plutarch-benchmark.cabal deleted file mode 100644 index a8cdcb767..000000000 --- a/plutarch-benchmark/plutarch-benchmark.cabal +++ /dev/null @@ -1,93 +0,0 @@ -cabal-version: 2.4 -name: plutarch-benchmark -version: 1.1.0 -author: Las Safin -license: MIT -extra-source-files: README.md - -common c - default-language: Haskell2010 - default-extensions: - NoStarIsType - BangPatterns - BinaryLiterals - ConstrainedClassMethods - ConstraintKinds - DataKinds - DeriveAnyClass - DeriveDataTypeable - DeriveFoldable - DeriveFunctor - DeriveGeneric - DeriveLift - DeriveTraversable - DerivingStrategies - DerivingVia - DoAndIfThenElse - EmptyCase - EmptyDataDecls - EmptyDataDeriving - ExistentialQuantification - ExplicitForAll - FlexibleContexts - FlexibleInstances - ForeignFunctionInterface - GADTSyntax - GeneralisedNewtypeDeriving - HexFloatLiterals - ImplicitPrelude - InstanceSigs - KindSignatures - LambdaCase - MonomorphismRestriction - MultiParamTypeClasses - NamedFieldPuns - NamedWildCards - NumericUnderscores - OverloadedStrings - PartialTypeSignatures - PatternGuards - PolyKinds - PostfixOperators - RankNTypes - RelaxedPolyRec - ScopedTypeVariables - StandaloneDeriving - StandaloneKindSignatures - TraditionalRecordSyntax - TupleSections - TypeApplications - TypeFamilies - TypeOperators - TypeSynonymInstances - ViewPatterns - - ghc-options: - -Wall -Wcompat -Wincomplete-uni-patterns -Wno-unused-do-bind - -Wno-partial-type-signatures -Wmissing-export-lists -Werror - -Wincomplete-record-updates -Wmissing-deriving-strategies - -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls - -fprint-explicit-kinds - -library - import: c - exposed-modules: Plutarch.Benchmark - build-depends: - , aeson - , base - , boxes - , bytestring - , cassava - , containers - , data-default - , foldl - , mtl - , plutarch - , plutus-core - , plutus-ledger-api - , serialise - , text - , these - , vector - - hs-source-dirs: src diff --git a/plutarch-benchmark/src/Plutarch/Benchmark.hs b/plutarch-benchmark/src/Plutarch/Benchmark.hs deleted file mode 100644 index 2a14494fe..000000000 --- a/plutarch-benchmark/src/Plutarch/Benchmark.hs +++ /dev/null @@ -1,251 +0,0 @@ -{-# LANGUAGE RecordWildCards #-} - --- | Benchmark (exbudget and script size) for Plutus scripts -module Plutarch.Benchmark ( - -- | * Types - Benchmark, - NamedBenchmark, - ScriptSizeBytes, - -- | * Benchmark an arbitraty Plutus script - benchmarkScript, - benchmarkScript', - mkBenchmark, - scriptSize, - -- | * Benchmark entrypoints - bench, - bench', - benchGroup, - benchMain, - -- | * Working with benchmark results - decodeBenchmarks, - diffBenchmarks, - renderDiffTable, -) where - -import Codec.Serialise (serialise) -import Control.Monad (mzero) -import Data.Aeson (ToJSON) -import qualified Data.ByteString.Lazy as BSL -import Data.Coerce (coerce) -import qualified Data.Map.Strict as Map -import Data.Vector (Vector, (!)) -import qualified Data.Vector as Vector -import System.Environment (getArgs) -import Text.PrettyPrint.Boxes ((//)) -import qualified Text.PrettyPrint.Boxes as B - -import qualified Data.ByteString.Lazy as LB -import qualified Data.ByteString.Short as SBS -import Data.Csv ( - DefaultOrdered, - ToField, - ToNamedRecord, - header, - namedRecord, - (.!), - (.=), - ) -import qualified Data.Csv as Csv -import Data.Int (Int64) -import qualified Data.List as List -import Data.Maybe (fromJust) -import GHC.Generics (Generic) -import GHC.Stack (HasCallStack) -import Plutarch (ClosedTerm, compile, printTerm) -import Plutus.V1.Ledger.Api ( - ExBudget (ExBudget), - ExCPU (ExCPU), - ExMemory (ExMemory), - Script, - ) -import qualified Plutus.V1.Ledger.Api as Plutus - --------------------------------------------------------------------------------- - --- | Benchmark the given script -benchmarkScript :: HasCallStack => String -> Script -> NamedBenchmark -benchmarkScript name = NamedBenchmark . (name,) . benchmarkScript' - -{-# DEPRECATED benchmarkScript' "use `Plutarch.Evaluate.evalScript` and `mkBenchmark` with `scriptSize`" #-} -benchmarkScript' :: HasCallStack => Script -> Benchmark -benchmarkScript' script = - mkBenchmark - (evalScriptCounting $ serialiseScriptShort script) - (scriptSize script) - where - evalScriptCounting :: HasCallStack => Plutus.SerializedScript -> Plutus.ExBudget - evalScriptCounting script = - let costModel = fromJust Plutus.defaultCostModelParams - (_logout, e) = Plutus.evaluateScriptCounting Plutus.Verbose costModel script [] - in case e of - Left evalErr -> error $ show evalErr - Right exbudget -> exbudget - -data Benchmark = Benchmark - { exBudgetCPU :: ExCPU - -- ^ CPU budget used by the script. - , exBudgetMemory :: ExMemory - -- ^ Memory budget used by the script. - , scriptSizeBytes :: ScriptSizeBytes - -- ^ Size of Plutus script in bytes - } - deriving stock (Show, Generic) - deriving anyclass (ToJSON) - -mkBenchmark :: ExBudget -> ScriptSizeBytes -> Benchmark -mkBenchmark (ExBudget cpu mem) = Benchmark cpu mem - -newtype ScriptSizeBytes = ScriptSizeBytes Int64 - deriving stock (Eq, Ord, Show, Generic) - deriving newtype (Num, ToField) - deriving newtype (ToJSON) - -scriptSize :: Script -> ScriptSizeBytes -scriptSize = ScriptSizeBytes . fromIntegral . SBS.length . serialiseScriptShort - -serialiseScriptShort :: Script -> SBS.ShortByteString -serialiseScriptShort = SBS.toShort . LB.toStrict . serialise - -{- | A `Benchmark` with a name. - - Handy for writing CSV files with headers. --} -newtype NamedBenchmark = NamedBenchmark (String, Benchmark) - deriving stock (Show, Generic) - deriving newtype (ToJSON) - -instance ToNamedRecord NamedBenchmark where - toNamedRecord (NamedBenchmark (name, Benchmark {..})) = - namedRecord ["name" .= name, "cpu" .= exBudgetCPU, "mem" .= exBudgetMemory, "size" .= scriptSizeBytes] - -instance DefaultOrdered NamedBenchmark where - headerOrder _ = header ["name", "cpu", "mem", "size"] - --- | Create a benchmark group with a shared prefix -benchGroup :: String -> [[NamedBenchmark]] -> [NamedBenchmark] -benchGroup groupName bs = - [NamedBenchmark (groupName ++ ":" ++ name, benchmark) | NamedBenchmark (name, benchmark) <- concat bs] - --- | Create a benchmark with a name -bench :: String -> ClosedTerm a -> [NamedBenchmark] -bench name prog = - [coerce . benchmarkScript name $ compile prog] - --- | Create a benchmark with itself as name -bench' :: ClosedTerm a -> [NamedBenchmark] -bench' prog = bench (init . drop (length ("(program 1.0.0 " :: String)) $ printTerm prog) prog - --- | Decode benchmark results from a CSV file -decodeBenchmarks :: LB.ByteString -> Either String [NamedBenchmark] -decodeBenchmarks = - let (#!) :: Num a => Vector Csv.Field -> Int -> Csv.Parser a - (#!) v f = fmap fromInteger . Csv.parseField $ v ! f - in fmap Vector.toList - <$> Csv.decodeWithP - ( \case - v - | length v == 4 -> - fmap NamedBenchmark $ - (,) <$> v .! 0 <*> (Benchmark <$> v #! 1 <*> v #! 2 <*> v #! 3) - _ | otherwise -> mzero - ) - Csv.defaultDecodeOptions - Csv.HasHeader - -data BenchmarkDiffs = BenchmarkDiffs - { dropped :: [NamedBenchmark] - , changed :: [BenchmarkDiff] - , added :: [NamedBenchmark] - } - deriving stock (Show, Generic) - -data BenchmarkDiff = BenchmarkDiff - { benchmark :: Benchmark - , change :: (Double, Double, Double) - , name :: String - } - deriving stock (Show, Generic) - -diffBenchmark :: HasCallStack => String -> Benchmark -> Benchmark -> Maybe BenchmarkDiff -diffBenchmark - name - (Benchmark (ExCPU oldCpu) (ExMemory oldMem) (ScriptSizeBytes oldSize)) - new@(Benchmark (ExCPU cpu) (ExMemory mem) (ScriptSizeBytes size)) - | oldCpu /= cpu || oldMem /= mem || oldSize /= size = - let pctChange old new = softRound (fromInteger (toInteger new - toInteger old) / fromInteger (toInteger $ max old new) * 100) - - softRound n = fromInteger @Double (round @Double @Integer n * 10) / 10 - in Just $ - BenchmarkDiff - { benchmark = new - , change = (pctChange oldCpu cpu, pctChange oldMem mem, pctChange oldSize size) - , name = name - } - | otherwise = Nothing - -diffBenchmarks :: [NamedBenchmark] -> [NamedBenchmark] -> BenchmarkDiffs -diffBenchmarks (Map.fromList . coerce -> old) (Map.fromList . coerce -> new) = - BenchmarkDiffs - { changed = - Map.elems $ - Map.mapMaybeWithKey - ( \k new -> - old Map.!? k >>= \old -> diffBenchmark k old new - ) - new - , dropped = coerce . Map.toList $ old `Map.difference` new - , added = coerce . Map.toList $ new `Map.difference` old - } - -renderDiffTable :: BenchmarkDiffs -> B.Box -renderDiffTable (BenchmarkDiffs dropped changed added) = - let renderChange change - | abs change <= 0.01 = B.text "" - | otherwise = B.text $ if change > 0 then "+" <> show change <> "%" else show change <> "%" - - renderResult old diff tag = - [B.text $ show old <> "(" <> tag <> ")", renderChange diff] - - renderBenchmarkDiff :: BenchmarkDiff -> [B.Box] - renderBenchmarkDiff (BenchmarkDiff (Benchmark (ExCPU x) (ExMemory y) (ScriptSizeBytes z)) (dx, dy, dz) name) = - mconcat - [ [B.text name] - , renderResult x dx "cpu" - , renderResult y dy "mem" - , renderResult z dz "bytes" - ] - in B.vsep - 1 - B.top - [ if null dropped then B.nullBox else B.text "Dropped benchmarks:" // renderBudgetTable dropped - , if null changed then B.nullBox else B.text "Changed benchmarks:" // renderTable [renderBenchmarkDiff change | change <- changed] - , if null added then B.nullBox else B.text "Added benchmarks:" // renderBudgetTable added - ] - -renderTable :: [[B.Box]] -> B.Box -renderTable rows = - let alignments = - -- Align all but the first column to the right, because they represent numeric values. - B.left : repeat B.right - in B.hsep 2 B.left . fmap (uncurry B.vcat) $ zip alignments (List.transpose rows) - -renderBudgetTable :: [NamedBenchmark] -> B.Box -renderBudgetTable bs = - renderTable $ - [ [ B.text name - , B.text $ show cpu <> "(cpu)" - , B.text $ show mem <> "(mem)" - , B.text $ show sz <> "(bytes)" - ] - | NamedBenchmark (name, Benchmark (ExCPU cpu) (ExMemory mem) (ScriptSizeBytes sz)) <- bs - ] - -benchMain :: [NamedBenchmark] -> IO () -benchMain benchmarks = - getArgs >>= \case - ["--csv"] -> BSL.putStr $ Csv.encodeDefaultOrderedByName benchmarks - _ -> do - let csv = Csv.encodeDefaultOrderedByName benchmarks - BSL.writeFile "bench.csv" csv - putStrLn "Wrote to bench.csv:" - putStrLn . B.render $ renderBudgetTable benchmarks diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 2af945fb2..46915b583 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -73,14 +73,13 @@ common c common deps build-depends: - , aeson >=2.0 + , aeson >=2.0 , base , bytestring , filepath , generics-sop , mtl , plutarch - , plutarch-benchmark , plutus-core , plutus-ledger-api , plutus-tx @@ -95,7 +94,10 @@ common deps library import: c, deps hs-source-dirs: src - exposed-modules: Plutarch.Test + exposed-modules: + Plutarch.Test + Plutarch.Test.Benchmark + other-modules: Plutarch.Test.Golden Plutarch.Test.ListSyntax @@ -128,6 +130,7 @@ executable plutarch-test Plutarch.ScriptsSpec Plutarch.StringSpec Plutarch.Test + Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax Plutarch.TraceSpec diff --git a/plutarch-test/src/Plutarch/Test/Benchmark.hs b/plutarch-test/src/Plutarch/Test/Benchmark.hs new file mode 100644 index 000000000..617d9b61b --- /dev/null +++ b/plutarch-test/src/Plutarch/Test/Benchmark.hs @@ -0,0 +1,38 @@ +module Plutarch.Test.Benchmark ( + Benchmark, + ScriptSizeBytes, + mkBenchmark, + scriptSize, +) where + +import Codec.Serialise (serialise) +import Data.Aeson (ToJSON) +import qualified Data.ByteString.Lazy as LB +import qualified Data.ByteString.Short as SBS +import Data.Int (Int64) +import GHC.Generics (Generic) +import Plutus.V1.Ledger.Api (ExBudget (ExBudget), ExCPU, ExMemory, Script) + +data Benchmark = Benchmark + { exBudgetCPU :: ExCPU + -- ^ CPU budget used by the script. + , exBudgetMemory :: ExMemory + -- ^ Memory budget used by the script. + , scriptSizeBytes :: ScriptSizeBytes + -- ^ Size of Plutus script in bytes + } + deriving stock (Show, Generic) + deriving anyclass (ToJSON) + +mkBenchmark :: ExBudget -> ScriptSizeBytes -> Benchmark +mkBenchmark (ExBudget cpu mem) = Benchmark cpu mem + +newtype ScriptSizeBytes = ScriptSizeBytes Int64 + deriving stock (Eq, Ord, Show, Generic) + deriving newtype (Num, ToJSON) + +scriptSize :: Script -> ScriptSizeBytes +scriptSize = ScriptSizeBytes . fromIntegral . SBS.length . serialiseScriptShort + +serialiseScriptShort :: Script -> SBS.ShortByteString +serialiseScriptShort = SBS.toShort . LB.toStrict . serialise diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 1928064e1..3a78ef28c 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -33,10 +33,10 @@ import Test.Syd ( ) import Plutarch (ClosedTerm, compile, printScript) -import Plutarch.Benchmark (Benchmark, mkBenchmark, scriptSize) import Plutarch.Evaluate (evalScript) import Plutarch.Internal (Term (Term)) import Plutarch.Prelude +import Plutarch.Test.Benchmark (Benchmark, mkBenchmark, scriptSize) import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) import qualified Plutus.V1.Ledger.Scripts as Scripts From 05674716e64b321c835a3d676b69566de25e1cc5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 17:14:48 -0500 Subject: [PATCH 066/584] Unexpose Plutarch.Test.Benchmark No reason to expose. --- plutarch-test/plutarch-test.cabal | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 46915b583..7412655d0 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -94,11 +94,9 @@ common deps library import: c, deps hs-source-dirs: src - exposed-modules: - Plutarch.Test - Plutarch.Test.Benchmark - + exposed-modules: Plutarch.Test other-modules: + Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax From 32d9122cf9688f4b3cb63137bc8358a5e991ea0d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Feb 2022 17:15:18 -0500 Subject: [PATCH 067/584] Add serialise dependency --- plutarch-test/plutarch-test.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 7412655d0..6c653f7a8 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -83,6 +83,7 @@ common deps , plutus-core , plutus-ledger-api , plutus-tx + , serialise , sydtest , sydtest-discover , tasty From c2e03420bc2f3f61a32ec14924049fa86e7023a7 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Tue, 22 Feb 2022 23:29:39 +0100 Subject: [PATCH 068/584] issue 303: - scaffolding - notes --- Plutarch/Api/V1/Scripts.hs | 4 ++++ Plutarch/DataRepr/Internal/HList.hs | 8 ++++++++ Plutarch/Verify.hs | 27 +++++++++++++++++++++++++++ plutarch.cabal | 1 + 4 files changed, 40 insertions(+) create mode 100644 Plutarch/Verify.hs diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index cda6d5aa7..a6d813f53 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -20,6 +20,10 @@ import Plutarch.Lift ( ) import Plutarch.Prelude +{- TODO: + - this seems to be the type zthis is going to be working on, i.e. whose representation + I will have to check +-} newtype PDatum (s :: S) = PDatum (Term s PData) deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PDatum PData) diff --git a/Plutarch/DataRepr/Internal/HList.hs b/Plutarch/DataRepr/Internal/HList.hs index c7d3c9f19..301911b4d 100644 --- a/Plutarch/DataRepr/Internal/HList.hs +++ b/Plutarch/DataRepr/Internal/HList.hs @@ -124,6 +124,14 @@ hrecField :: Term s c hrecField xs = pmaybeFromAsData $ hrecField' @name xs +{- TODO: + - add instance for PVerified b + - add function that + - either uses id, in case it is already verified + - or verifies the structure + - also add that Class constraint to the HasField instance +-} + ---------- HasField instances instance forall name a as b c s. diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs new file mode 100644 index 000000000..d80ab96ab --- /dev/null +++ b/Plutarch/Verify.hs @@ -0,0 +1,27 @@ +module Verify ( PTryFrom (ptryFrom) ) where + +import Plutarch.ByteString (PByteString) +import Plutarch.Integer (PInteger) +import Plutarch.Internal.Other + ( POpaque + , type (:-->) + , Term + , plam + ) + +class PTryFrom a where + ptryFrom :: Term s (POpaque :--> a) + +instance PTryFrom PInteger where + ptryFrom = plam $ _ + +instance PTryFrom PByteString where + ptryFrom = plam $ _ + +{- TODO: + -> implement for + - PBuiltinList + - PBuiltinPair + -> derive for + - PBuiltinMap +-} diff --git a/plutarch.cabal b/plutarch.cabal index 49e669a1f..81e284c14 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -125,6 +125,7 @@ library Plutarch.Trace Plutarch.Unit Plutarch.Unsafe + Plutarch.Verify build-depends: , base From 5af867598f574c91c59e62a6e1e6b6d0f08101a6 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 23 Feb 2022 17:05:56 +0530 Subject: [PATCH 069/584] Update error messages --- Plutarch/Lift.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 04e4aa55c..7dcec1f48 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -94,8 +94,8 @@ plift prog = case plift' prog of Left (LiftError_ReadKnownError (ErrorWithCause e causeMaybe)) -> let unliftErrMaybe = e ^? _UnliftingErrorE in error $ - "plift failed: internal plutus-core error: " - <> maybe "ReadKnownEvaluationFailure" show unliftErrMaybe + "plift failed: incorrect type: " + <> maybe "absurd evaluation failure" show unliftErrMaybe <> "\n" <> maybe "" (\x -> "cause: " <> show x) causeMaybe Left (LiftError_EvalError e) -> error $ "plift failed: erring term: " <> show e From 583b5019e66537e25bf69b950173f8b6f101ca9d Mon Sep 17 00:00:00 2001 From: mangoiv Date: Wed, 23 Feb 2022 16:29:16 +0100 Subject: [PATCH 070/584] wip: - work in progress #303 - added two classes, one for partially verifying a Data one for recursively verifying Pdata --- Plutarch/Api/V1/Scripts.hs | 4 +- Plutarch/DataRepr/Internal/HList.hs | 4 +- Plutarch/Verify.hs | 118 ++++++++++++++++++++++------ 3 files changed, 99 insertions(+), 27 deletions(-) diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index a6d813f53..8450559f6 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -20,8 +20,8 @@ import Plutarch.Lift ( ) import Plutarch.Prelude -{- TODO: - - this seems to be the type zthis is going to be working on, i.e. whose representation +{- TODO: + - this seems to be the type zthis is going to be working on, i.e. whose representation I will have to check -} newtype PDatum (s :: S) = PDatum (Term s PData) diff --git a/Plutarch/DataRepr/Internal/HList.hs b/Plutarch/DataRepr/Internal/HList.hs index 301911b4d..f5eeca8f3 100644 --- a/Plutarch/DataRepr/Internal/HList.hs +++ b/Plutarch/DataRepr/Internal/HList.hs @@ -124,9 +124,9 @@ hrecField :: Term s c hrecField xs = pmaybeFromAsData $ hrecField' @name xs -{- TODO: +{- TODO: - add instance for PVerified b - - add function that + - add function that - either uses id, in case it is already verified - or verifies the structure - also add that Class constraint to the HasField instance diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index d80ab96ab..54c946503 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -1,27 +1,99 @@ -module Verify ( PTryFrom (ptryFrom) ) where +{-# OPTIONS_GHC -Wredundant-constraints #-} +module Plutarch.Verify ( + PTryFrom (ptryFrom), + PTryFromRecur (ptryFromRecur), +) where + +import Plutarch.Builtin ( + PAsData, + PBuiltinList, + PBuiltinMap, + PBuiltinPair, + PData, + PIsData (pfromData), + pdata, + pfstBuiltin, + ppairDataBuiltin, + psndBuiltin, + ) import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) -import Plutarch.Internal.Other - ( POpaque - , type (:-->) - , Term - , plam - ) - -class PTryFrom a where - ptryFrom :: Term s (POpaque :--> a) - -instance PTryFrom PInteger where - ptryFrom = plam $ _ - -instance PTryFrom PByteString where - ptryFrom = plam $ _ - -{- TODO: - -> implement for - - PBuiltinList - - PBuiltinPair - -> derive for - - PBuiltinMap +import Plutarch.Internal.Other ( + POpaque, + PType, + Term, + phoistAcyclic, + plam, + (#), + (#$), + type (:-->), + ) +import Plutarch.List (pmap) + +import Plutarch.Lift (PLift) +import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) +import qualified PlutusCore as PLC + +{- | + Each POpaque can be of any representation as it represents + the universe of Types. With PTryFrom we establish trust + in the Data by verifying the requested type matches its + representation. +-} +class PTryFrom (a :: PType) where + ptryFrom :: Term s (PData :--> a) + +instance PTryFrom PInteger where + ptryFrom = punsafeBuiltin PLC.UnIData + +instance PTryFrom PByteString where + ptryFrom = punsafeBuiltin PLC.UnBData + +{- | + Note: PAsData POpaque ~ PData -} +instance PTryFrom (PBuiltinList PData) where + ptryFrom = punsafeBuiltin PLC.UnListData + +instance PTryFrom (PBuiltinMap POpaque POpaque) where + ptryFrom = punsafeBuiltin PLC.UnMapData + +instance PTryFrom (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) where + ptryFrom = phoistAcyclic $ + plam $ \opq -> + let tup :: Term _ (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) + tup = punsafeCoerce opq + chk :: Term _ (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) + chk = + ppairDataBuiltin + # (pfstBuiltin # tup) + # (psndBuiltin # tup) + in chk + +class PTryFromRecur (a :: PType) where + ptryFromRecur :: Term s (PData :--> a) + +instance PTryFromRecur PInteger where + ptryFromRecur = punsafeBuiltin PLC.UnIData + +instance PTryFromRecur PByteString where + ptryFromRecur = punsafeBuiltin PLC.UnBData + +instance (PTryFromRecur a, PLift a, PIsData a) => PTryFromRecur (PBuiltinList (PAsData a)) where + ptryFromRecur = phoistAcyclic $ + plam $ \opq -> + let lst :: Term _ (PBuiltinList (PAsData PData)) + lst = punsafeBuiltin PLC.UnListData #$ opq + in pmap # (plam $ \e -> pdata $ ptryFromRecur @a #$ pfromData e) # lst + +instance (PTryFromRecur a, PIsData a, PTryFromRecur b, PIsData b) => PTryFromRecur (PBuiltinPair (PAsData a) (PAsData b)) where + ptryFromRecur = phoistAcyclic $ + plam $ \opq -> + let tup :: Term _ (PBuiltinPair (PAsData PData) (PAsData PData)) + tup = punsafeCoerce opq + fst :: Term _ (PAsData a) + fst = pdata $ ptryFromRecur @a #$ pfromData $ pfstBuiltin # tup + snd :: Term _ (PAsData b) + snd = pdata $ ptryFromRecur @b #$ pfromData $ psndBuiltin # tup + in ppairDataBuiltin # fst # snd From ee14a95793aff0dc8e1660b2481fc5187fd79224 Mon Sep 17 00:00:00 2001 From: Renegatto <46404781+Renegatto@users.noreply.github.com> Date: Wed, 23 Feb 2022 19:12:08 +0300 Subject: [PATCH 071/584] Fix typos in README --- plutarch-test/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plutarch-test/README.md b/plutarch-test/README.md index 4255fe999..6d4ceca42 100644 --- a/plutarch-test/README.md +++ b/plutarch-test/README.md @@ -23,11 +23,11 @@ $ vim cabal.project # And then uncomment the "flags: +developmenet" line. $ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test' -T Main.main ``` -## The `developmenmt` flag +## The `development` flag Plutarch has a `development` flag. Right now, the flag is used to control tracing functions, wherein turning on the flag will inject `Trace` instructions in the generated UPLC. -Since this will impact the printTerm goldens in tests, we provide `plutarchDevFlagDescribe` that should be used everywhere in the test hierarchy where the immediate sub-tree of tests are known to use tracing functions (or any other development-flag-specific featuresto use tracing functions (or any other development-flag-specific features). +Since this will impact the printTerm goldens in tests, we provide `plutarchDevFlagDescribe` that should be used everywhere in the test hierarchy where the immediate sub-tree of tests are known to use tracing functions (or any other development-flag-specific features to use tracing functions (or any other development-flag-specific features). ## Goldens From c33863fa1f44b788184b04d211f3b75ce781c1cf Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 15 Feb 2022 14:40:52 -0500 Subject: [PATCH 072/584] Port over Examples.Lift --- examples/Examples/Lift.hs | 37 ------------------- examples/Main.hs | 2 - .../goldens/lift.pconstantData.bench.golden | 5 +++ .../lift.pconstantData.uplc.eval.golden | 5 +++ .../goldens/lift.pconstantData.uplc.golden | 5 +++ plutarch-test/plutarch-test.cabal | 1 + plutarch-test/src/Plutarch/LiftSpec.hs | 34 +++++++++++++++++ plutarch.cabal | 1 - 8 files changed, 50 insertions(+), 40 deletions(-) delete mode 100644 examples/Examples/Lift.hs create mode 100644 plutarch-test/goldens/lift.pconstantData.bench.golden create mode 100644 plutarch-test/goldens/lift.pconstantData.uplc.eval.golden create mode 100644 plutarch-test/goldens/lift.pconstantData.uplc.golden create mode 100644 plutarch-test/src/Plutarch/LiftSpec.hs diff --git a/examples/Examples/Lift.hs b/examples/Examples/Lift.hs deleted file mode 100644 index 847923125..000000000 --- a/examples/Examples/Lift.hs +++ /dev/null @@ -1,37 +0,0 @@ -module Examples.Lift (tests) where - -import Test.Tasty (TestTree, testGroup) -import Test.Tasty.HUnit (Assertion, testCase, (@?=)) - -import Utils - -import Plutarch (printTerm) -import Plutarch.Api.V1 () -import Plutarch.Lift (PLifted) -import Plutarch.Prelude -import Plutus.V1.Ledger.Api -import qualified PlutusTx - -testPConstantDataSan :: forall p. (HasTester, PIsData p, PLift p, PlutusTx.ToData (PLifted p)) => PLifted p -> Assertion -testPConstantDataSan x = pconstantData @p x `equal` pdata (pconstant @p x) - -tests :: HasTester => TestTree -tests = testGroup "pconstant/plift tests" [pconstantDataTests] - -pconstantDataTests :: HasTester => TestTree -pconstantDataTests = - testGroup - "pconstantData" - [ testCase "pconstantData ≡ pdata . pconstant" $ do - testPConstantDataSan False - testPConstantDataSan @PInteger 42 - testPConstantDataSan $ PubKeyHash "04" - testPConstantDataSan $ Minting "" - testPConstantDataSan $ TxOutRef "41" 12 - , testCase "pconstantData compiled output" $ do - printTerm (pconstantData @PInteger 42) @?= "(program 1.0.0 #182a)" - printTerm (pconstantData True) @?= "(program 1.0.0 #d87a80)" - printTerm (pconstantData $ PubKeyHash "04") @?= "(program 1.0.0 #423034)" - printTerm (pconstantData $ Minting "") @?= "(program 1.0.0 #d8799f40ff)" - printTerm (pconstantData $ TxOutRef "41" 12) @?= "(program 1.0.0 #d8799fd8799f4141ff0cff)" - ] diff --git a/examples/Main.hs b/examples/Main.hs index 6289b4c89..1af7d523a 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -19,7 +19,6 @@ import qualified PlutusTx import qualified Examples.ConstrData as ConstrData import qualified Examples.LetRec as LetRec -import qualified Examples.Lift as Lift import Utils import Data.Text (Text) @@ -49,7 +48,6 @@ tests = , uplcTests , LetRec.tests , ConstrData.tests - , Lift.tests ] plutarchTests :: HasTester => TestTree diff --git a/plutarch-test/goldens/lift.pconstantData.bench.golden b/plutarch-test/goldens/lift.pconstantData.bench.golden new file mode 100644 index 000000000..a1c4f2059 --- /dev/null +++ b/plutarch-test/goldens/lift.pconstantData.bench.golden @@ -0,0 +1,5 @@ +bool {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +int {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +pkh {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +minting {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":14} +txoutref {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":20} \ No newline at end of file diff --git a/plutarch-test/goldens/lift.pconstantData.uplc.eval.golden b/plutarch-test/goldens/lift.pconstantData.uplc.eval.golden new file mode 100644 index 000000000..aa6b1e15c --- /dev/null +++ b/plutarch-test/goldens/lift.pconstantData.uplc.eval.golden @@ -0,0 +1,5 @@ +bool (program 1.0.0 #d87980) +int (program 1.0.0 #182a) +pkh (program 1.0.0 #423034) +minting (program 1.0.0 #d8799f40ff) +txoutref (program 1.0.0 #d8799fd8799f4141ff0cff) \ No newline at end of file diff --git a/plutarch-test/goldens/lift.pconstantData.uplc.golden b/plutarch-test/goldens/lift.pconstantData.uplc.golden new file mode 100644 index 000000000..aa6b1e15c --- /dev/null +++ b/plutarch-test/goldens/lift.pconstantData.uplc.golden @@ -0,0 +1,5 @@ +bool (program 1.0.0 #d87980) +int (program 1.0.0 #182a) +pkh (program 1.0.0 #423034) +minting (program 1.0.0 #d8799f40ff) +txoutref (program 1.0.0 #d8799fd8799f4141ff0cff) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 6c653f7a8..6dbf89b41 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -117,6 +117,7 @@ executable plutarch-test other-modules: Plutarch.ApiSpec + Plutarch.LiftSpec Plutarch.BoolSpec Plutarch.ByteStringSpec Plutarch.IntegerSpec diff --git a/plutarch-test/src/Plutarch/LiftSpec.hs b/plutarch-test/src/Plutarch/LiftSpec.hs new file mode 100644 index 000000000..fac44038e --- /dev/null +++ b/plutarch-test/src/Plutarch/LiftSpec.hs @@ -0,0 +1,34 @@ +module Plutarch.LiftSpec (spec) where + +import Test.Syd + +import Plutarch.Builtin +import Plutarch.Internal.Other (popaque) +import Plutarch.Lift (PLift, PLifted, pconstant) +import Plutarch.Test + +import Plutus.V1.Ledger.Api +import qualified PlutusTx + +spec :: Spec +spec = do + describe "lift" $ do + describe "pconstantData" $ do + let p1 = False + p2 = 42 :: Integer + p3 = PubKeyHash "04" + p4 = Minting "" + p5 = TxOutRef "41" 12 + goldens + All + [ ("bool", popaque $ pconstantData p1) + , ("int", popaque $ pconstantData p2) + , ("pkh", popaque $ pconstantData p3) + , ("minting", popaque $ pconstantData p4) + , ("txoutref", popaque $ pconstantData p5) + ] + it "works" $ testPConstantDataSan False + +testPConstantDataSan :: forall p. (PIsData p, PLift p, PlutusTx.ToData (PLifted p)) => PLifted p -> Expectation +testPConstantDataSan x = + pconstantData @p x `pshouldBe` pdata (pconstant @p x) diff --git a/plutarch.cabal b/plutarch.cabal index f2888a670..07f65583b 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -165,7 +165,6 @@ test-suite examples other-modules: Examples.ConstrData Examples.LetRec - Examples.Lift Utils build-depends: From dccf852c51a1a521bd74ac97bdcaf13dd04a4e3b Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 15 Feb 2022 16:39:52 -0500 Subject: [PATCH 073/584] Port over the rest of lift tests --- examples/Main.hs | 25 --------------------- plutarch-test/src/Plutarch/LiftSpec.hs | 30 ++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/examples/Main.hs b/examples/Main.hs index 1af7d523a..42ef2eea8 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -21,8 +21,6 @@ import qualified Examples.ConstrData as ConstrData import qualified Examples.LetRec as LetRec import Utils -import Data.Text (Text) - main :: IO () main = do setLocaleEncoding utf8 @@ -142,29 +140,6 @@ plutarchTests = , testCase "λy. (λx. x + x) y" $ printTerm (plam $ \y -> (plam $ \(x :: Term _ PInteger) -> x + x) # y) @?= "(program 1.0.0 (\\i0 -> addInteger i1 i1))" ] - , testGroup - "Lifting of constants" - [ testCase "plift on primitive types" $ do - plift (pcon PTrue) @?= True - plift (pcon PFalse) @?= False - , testCase "pconstant on primitive types" $ do - plift (pconstant @PBool False) @?= False - plift (pconstant @PBool True) @?= True - , testCase "plift on list and pair" $ do - plift (pconstant ([1, 2, 3] :: [Integer])) @?= [1, 2, 3] - plift (pconstant ("IOHK" :: Text, 42 :: Integer)) @?= ("IOHK", 42) - , testCase "plift on data" $ do - let d :: PlutusTx.Data - d = PlutusTx.toData @(Either Bool Bool) $ Right False - plift (pconstant d) @?= d - , testCase "plift on nested containers" $ do - -- List of pairs - let v1 = [("IOHK", 42), ("Plutus", 31)] :: [(Text, Integer)] - plift (pconstant v1) @?= v1 - -- List of pair of lists - let v2 = [("IOHK", [1, 2, 3]), ("Plutus", [9, 8, 7])] :: [(Text, [Integer])] - plift (pconstant v2) @?= v2 - ] ] -- | Tests for the behaviour of UPLC itself. diff --git a/plutarch-test/src/Plutarch/LiftSpec.hs b/plutarch-test/src/Plutarch/LiftSpec.hs index fac44038e..80d9df823 100644 --- a/plutarch-test/src/Plutarch/LiftSpec.hs +++ b/plutarch-test/src/Plutarch/LiftSpec.hs @@ -1,18 +1,40 @@ module Plutarch.LiftSpec (spec) where +import Data.Text (Text) +import Plutus.V1.Ledger.Api +import qualified PlutusTx import Test.Syd import Plutarch.Builtin import Plutarch.Internal.Other (popaque) -import Plutarch.Lift (PLift, PLifted, pconstant) +import Plutarch.Lift (PLifted) +import Plutarch.Prelude import Plutarch.Test -import Plutus.V1.Ledger.Api -import qualified PlutusTx - spec :: Spec spec = do describe "lift" $ do + describe "plift" $ do + it "bool" $ do + plift (pcon PTrue) `shouldBe` True + plift (pcon PFalse) `shouldBe` False + plift (pconstant False) `shouldBe` False + plift (pconstant True) `shouldBe` True + it "list" $ do + plift (pconstant ([1, 2, 3] :: [Integer])) `shouldBe` [1, 2, 3] + plift (pconstant ("IOHK" :: Text, 42 :: Integer)) `shouldBe` ("IOHK", 42) + it "nested" $ do + -- List of pairs + let v1 = [("IOHK", 42), ("Plutus", 31)] :: [(Text, Integer)] + plift (pconstant v1) `shouldBe` v1 + -- List of pair of lists + let v2 = [("IOHK", [1, 2, 3]), ("Plutus", [9, 8, 7])] :: [(Text, [Integer])] + plift (pconstant v2) `shouldBe` v2 + it "data" $ do + let d :: PlutusTx.Data + d = PlutusTx.toData @(Either Bool Bool) $ Right False + plift (pconstant d) `shouldBe` d + describe "pconstantData" $ do let p1 = False p2 = 42 :: Integer From 358acbb4a7ac3fac9bedbebd53cc2e8118947895 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 15 Feb 2022 17:18:15 -0500 Subject: [PATCH 074/584] Port the only pconstant test --- examples/Main.hs | 3 --- plutarch-test/src/Plutarch/LiftSpec.hs | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/Main.hs b/examples/Main.hs index 42ef2eea8..635de7969 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -70,9 +70,6 @@ plutarchTests = let x = pmatch (pcon (PPair a b) :: Term s (PPair PInteger PString)) $ \(PPair _ y) -> y printTerm x @?= "(program 1.0.0 ((\\i0 -> i1 42 \"Universe\") (\\i0 -> \\i0 -> i1)))" ] - , testCase "pconstant \"abc\" == \"abc\"" $ do - pconstant @PString "abc" `equal` pconstant @PString "abc" - expect $ pconstant @PString "foo" #== "foo" , testCase "ScriptPurpose literal" $ let d :: ScriptPurpose d = Minting dummyCurrency diff --git a/plutarch-test/src/Plutarch/LiftSpec.hs b/plutarch-test/src/Plutarch/LiftSpec.hs index 80d9df823..b8347994d 100644 --- a/plutarch-test/src/Plutarch/LiftSpec.hs +++ b/plutarch-test/src/Plutarch/LiftSpec.hs @@ -34,7 +34,10 @@ spec = do let d :: PlutusTx.Data d = PlutusTx.toData @(Either Bool Bool) $ Right False plift (pconstant d) `shouldBe` d - + describe "pconstant" $ do + it "string" $ do + pconstant @PString "abc" `pshouldBe` pconstant @PString "abc" + pconstant @PString "foo" `pshouldBe` ("foo" :: Term _ PString) describe "pconstantData" $ do let p1 = False p2 = 42 :: Integer From babba1020b61fba538a550fa21d82f74c1113de8 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 11:41:26 -0500 Subject: [PATCH 075/584] Use pgoldenSpec --- plutarch-test/plutarch-test.cabal | 2 +- plutarch-test/src/Plutarch/LiftSpec.hs | 20 ++++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 6dbf89b41..a44939f3d 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -117,10 +117,10 @@ executable plutarch-test other-modules: Plutarch.ApiSpec - Plutarch.LiftSpec Plutarch.BoolSpec Plutarch.ByteStringSpec Plutarch.IntegerSpec + Plutarch.LiftSpec Plutarch.ListSpec Plutarch.PIsDataSpec Plutarch.PLamSpec diff --git a/plutarch-test/src/Plutarch/LiftSpec.hs b/plutarch-test/src/Plutarch/LiftSpec.hs index b8347994d..8fa350ce9 100644 --- a/plutarch-test/src/Plutarch/LiftSpec.hs +++ b/plutarch-test/src/Plutarch/LiftSpec.hs @@ -6,7 +6,6 @@ import qualified PlutusTx import Test.Syd import Plutarch.Builtin -import Plutarch.Internal.Other (popaque) import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.Test @@ -39,19 +38,12 @@ spec = do pconstant @PString "abc" `pshouldBe` pconstant @PString "abc" pconstant @PString "foo" `pshouldBe` ("foo" :: Term _ PString) describe "pconstantData" $ do - let p1 = False - p2 = 42 :: Integer - p3 = PubKeyHash "04" - p4 = Minting "" - p5 = TxOutRef "41" 12 - goldens - All - [ ("bool", popaque $ pconstantData p1) - , ("int", popaque $ pconstantData p2) - , ("pkh", popaque $ pconstantData p3) - , ("minting", popaque $ pconstantData p4) - , ("txoutref", popaque $ pconstantData p5) - ] + pgoldenSpec $ do + "bool" @| pconstantData False + "int" @| pconstantData (42 :: Integer) + "pkh" @| pconstantData (PubKeyHash "04") + "minting" @| pconstantData (Minting "") + "txoutref" @| pconstantData (TxOutRef "41" 12) it "works" $ testPConstantDataSan False testPConstantDataSan :: forall p. (PIsData p, PLift p, PlutusTx.ToData (PLifted p)) => PLifted p -> Expectation From dcaa4e2171493854fadd542a6ddbae1d7583a933 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 11:47:18 -0500 Subject: [PATCH 076/584] Import orphan instances, working around flaky GHC bug --- plutarch-test/src/Plutarch/LiftSpec.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plutarch-test/src/Plutarch/LiftSpec.hs b/plutarch-test/src/Plutarch/LiftSpec.hs index 8fa350ce9..8d7721daa 100644 --- a/plutarch-test/src/Plutarch/LiftSpec.hs +++ b/plutarch-test/src/Plutarch/LiftSpec.hs @@ -1,11 +1,11 @@ module Plutarch.LiftSpec (spec) where import Data.Text (Text) -import Plutus.V1.Ledger.Api +import Plutarch.Api.V1 () +import Plutus.V1.Ledger.Api (PubKeyHash (PubKeyHash), ScriptPurpose (Minting), TxOutRef (TxOutRef)) import qualified PlutusTx import Test.Syd -import Plutarch.Builtin import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.Test From 83ca08101f7fd9f34fe4f5fb119ccb938b434ee7 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Wed, 23 Feb 2022 21:14:36 +0100 Subject: [PATCH 077/584] wip #303: - add documentation for PTryFromRecur - fix bug in the PBuiltinPair implementation --- Plutarch/Verify.hs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index 54c946503..8c2de9832 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -16,6 +16,7 @@ import Plutarch.Builtin ( pfstBuiltin, ppairDataBuiltin, psndBuiltin, + pforgetData, ) import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) @@ -63,7 +64,7 @@ instance PTryFrom (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) where ptryFrom = phoistAcyclic $ plam $ \opq -> let tup :: Term _ (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) - tup = punsafeCoerce opq + tup = pfromData $ punsafeCoerce opq chk :: Term _ (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) chk = ppairDataBuiltin @@ -71,6 +72,13 @@ instance PTryFrom (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) where # (psndBuiltin # tup) in chk +{- | + This deeply checks the Datastructure for validity. + Be aware this might get really expensive, so only + use it if you cannot establish trust otherwise + (e.g. via only checking a part of your Data with + PTryFrom) +-} class PTryFromRecur (a :: PType) where ptryFromRecur :: Term s (PData :--> a) @@ -90,10 +98,10 @@ instance (PTryFromRecur a, PLift a, PIsData a) => PTryFromRecur (PBuiltinList (P instance (PTryFromRecur a, PIsData a, PTryFromRecur b, PIsData b) => PTryFromRecur (PBuiltinPair (PAsData a) (PAsData b)) where ptryFromRecur = phoistAcyclic $ plam $ \opq -> - let tup :: Term _ (PBuiltinPair (PAsData PData) (PAsData PData)) - tup = punsafeCoerce opq + let tup :: Term _ (PBuiltinPair (PAsData _) (PAsData _)) + tup = pfromData $ punsafeCoerce opq fst :: Term _ (PAsData a) - fst = pdata $ ptryFromRecur @a #$ pfromData $ pfstBuiltin # tup + fst = pdata $ ptryFromRecur @a #$ pforgetData $ pfstBuiltin # tup snd :: Term _ (PAsData b) - snd = pdata $ ptryFromRecur @b #$ pfromData $ psndBuiltin # tup + snd = pdata $ ptryFromRecur @b #$ pforgetData $ psndBuiltin # tup in ppairDataBuiltin # fst # snd From 920cda3c6b913ca2e7182f1953f80afc547bf574 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Wed, 23 Feb 2022 21:15:55 +0100 Subject: [PATCH 078/584] wip #303: - add tests and golden tests for all everything that is added until now --- .../verification_untrusted_data.bench.golden | 7 ++ ...rification_untrusted_data.uplc.eval.golden | 7 ++ .../verification_untrusted_data.uplc.golden | 7 ++ plutarch-test/plutarch-test.cabal | 3 +- plutarch-test/src/Plutarch/VerifySpec.hs | 71 +++++++++++++++++++ 5 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 plutarch-test/goldens/verification_untrusted_data.bench.golden create mode 100644 plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden create mode 100644 plutarch-test/goldens/verification_untrusted_data.uplc.golden create mode 100644 plutarch-test/src/Plutarch/VerifySpec.hs diff --git a/plutarch-test/goldens/verification_untrusted_data.bench.golden b/plutarch-test/goldens/verification_untrusted_data.bench.golden new file mode 100644 index 000000000..3769c2ec5 --- /dev/null +++ b/plutarch-test/goldens/verification_untrusted_data.bench.golden @@ -0,0 +1,7 @@ +erroneous.int /= bytestring {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":16} +erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":102} +erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":85} +working.int == int {"exBudgetCPU":448965,"exBudgetMemory":664,"scriptSizeBytes":11} +working.(String, String) == (String, String) {"exBudgetCPU":7384676,"exBudgetMemory":12164,"scriptSizeBytes":102} +working.(POpaque, POpaque) == (POpaque, POpaque) {"exBudgetCPU":6216719,"exBudgetMemory":11072,"scriptSizeBytes":88} +working.[String] == [String] {"exBudgetCPU":6809909,"exBudgetMemory":14008,"scriptSizeBytes":94} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden new file mode 100644 index 000000000..246c35ffe --- /dev/null +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden @@ -0,0 +1,7 @@ +erroneous.int /= bytestring (program 1.0.0 error) +erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) +erroneous.[String] /= [Integer] (program 1.0.0 error) +working.int == int (program 1.0.0 42) +working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) +working.(POpaque, POpaque) == (POpaque, POpaque) (program 1.0.0 (#d87980, #d87980)) +working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.golden new file mode 100644 index 000000000..f1fae4c89 --- /dev/null +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.golden @@ -0,0 +1,7 @@ +erroneous.int /= bytestring (program 1.0.0 (unIData (bData #666f6f))) +erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (iData (unIData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) +erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> bData (unBData i1)) (unListData i1)) (listData (i1 (iData 3) ((\i0 -> i2 i1 i3) (iData 4))))) (force mkCons)) [ ])) +working.int == int (program 1.0.0 (unIData (iData 42))) +working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (bData (unBData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) +working.(POpaque, POpaque) == (POpaque, POpaque) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (i5 (i2 i1)) (i7 (i2 i1))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData i7 i7))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair))) #d87980)) +working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> bData (unBData i1)) (unListData i1)) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172))))) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index c92eac2cb..b07ba45dc 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -66,7 +66,7 @@ common c ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wno-unused-do-bind - -Wno-partial-type-signatures -Wmissing-export-lists -Werror + -Wno-partial-type-signatures -Wmissing-export-lists -Wincomplete-record-updates -Wmissing-deriving-strategies -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls -fprint-explicit-kinds @@ -135,6 +135,7 @@ executable plutarch-test Plutarch.Test.ListSyntax Plutarch.TraceSpec Plutarch.UnitSpec + Plutarch.VerifySpec Spec if flag(development) diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/VerifySpec.hs new file mode 100644 index 000000000..d43f70544 --- /dev/null +++ b/plutarch-test/src/Plutarch/VerifySpec.hs @@ -0,0 +1,71 @@ +module Plutarch.VerifySpec (spec) where + +import Test.Syd + +import Plutarch +import Plutarch.Prelude +import Plutarch.Test +import Plutarch.Verify ( PTryFrom (ptryFrom) + , PTryFromRecur (ptryFromRecur)) +import Plutarch.Builtin (pforgetData, ppairDataBuiltin) +import Plutarch.Unsafe (punsafeBuiltin) +import qualified PlutusCore as PLC + +spec :: Spec +spec = do + describe "verification_untrusted_data" . pgoldenSpec $ do + "erroneous" @\ do + "int /= bytestring" + @| checkShallow + @PInteger + @PByteString + (pconstant "foo") + @-> pfails + "(String, Integer) /= (String, String)" + @| checkDeep + @(PBuiltinPair (PAsData PInteger) (PAsData PByteString)) + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) + @-> pfails + "[String] /= [Integer]" + @| checkDeep + @(PBuiltinList (PAsData PByteString)) + @(PBuiltinList (PAsData PInteger)) + ((pcons # (pdata $ pconstant 3)) #$ (psingleton # (pdata $ pconstant 4))) + @-> pfails + "working" @\ do + "int == int" + @| checkShallow @PInteger @PInteger (pconstant 42) + @-> psucceeds + "(String, String) == (String, String)" + @| checkDeep + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) + @-> psucceeds + "(POpaque, POpaque) == (POpaque, POpaque)" + @| checkShallow + @(PBuiltinPair (PAsData POpaque) (PAsData POpaque)) + @(PBuiltinPair (PAsData POpaque) (PAsData POpaque)) + (punsafeBuiltin PLC.MkPairData # + (pdata $ pcon PUnit) # + (pdata $ pcon PUnit)) + @-> psucceeds + "[String] == [String]" + @| checkDeep + @(PBuiltinList (PAsData PByteString)) + @(PBuiltinList (PAsData PByteString)) + ((pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) + @-> psucceeds + +checkShallow :: forall (target :: PType) (actual :: PType). + (PTryFrom target, PIsData actual) => ClosedTerm actual -> ClosedTerm target +checkShallow = reprTargetActual ptryFrom + +checkDeep :: forall (target :: PType) (actual :: PType). + (PTryFromRecur target, PIsData actual) => ClosedTerm actual -> ClosedTerm target +checkDeep = reprTargetActual ptryFromRecur + +reprTargetActual :: forall (target :: PType) (actual :: PType). + (PIsData actual ) => ClosedTerm (PData :--> target) -> ClosedTerm actual -> ClosedTerm target +reprTargetActual f x = f #$ pforgetData $ pdata x From 0c2cce04a2ed0ffbddffeb5b13a443ccdd1a5c49 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Wed, 23 Feb 2022 21:16:49 +0100 Subject: [PATCH 079/584] fix: - formatting --- Plutarch/Verify.hs | 12 ++-- plutarch-test/plutarch-test.cabal | 2 +- plutarch-test/src/Plutarch/VerifySpec.hs | 79 ++++++++++++++---------- 3 files changed, 53 insertions(+), 40 deletions(-) diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index 8c2de9832..d028301d8 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -13,10 +13,10 @@ import Plutarch.Builtin ( PData, PIsData (pfromData), pdata, + pforgetData, pfstBuiltin, ppairDataBuiltin, psndBuiltin, - pforgetData, ) import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) @@ -72,11 +72,11 @@ instance PTryFrom (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) where # (psndBuiltin # tup) in chk -{- | - This deeply checks the Datastructure for validity. - Be aware this might get really expensive, so only - use it if you cannot establish trust otherwise - (e.g. via only checking a part of your Data with +{- | + This deeply checks the Datastructure for validity. + Be aware this might get really expensive, so only + use it if you cannot establish trust otherwise + (e.g. via only checking a part of your Data with PTryFrom) -} class PTryFromRecur (a :: PType) where diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index b07ba45dc..9727a2c19 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -66,7 +66,7 @@ common c ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wno-unused-do-bind - -Wno-partial-type-signatures -Wmissing-export-lists + -Wno-partial-type-signatures -Wmissing-export-lists -Wincomplete-record-updates -Wmissing-deriving-strategies -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls -fprint-explicit-kinds diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/VerifySpec.hs index d43f70544..40b580709 100644 --- a/plutarch-test/src/Plutarch/VerifySpec.hs +++ b/plutarch-test/src/Plutarch/VerifySpec.hs @@ -2,70 +2,83 @@ module Plutarch.VerifySpec (spec) where import Test.Syd -import Plutarch -import Plutarch.Prelude -import Plutarch.Test -import Plutarch.Verify ( PTryFrom (ptryFrom) - , PTryFromRecur (ptryFromRecur)) +import Plutarch import Plutarch.Builtin (pforgetData, ppairDataBuiltin) +import Plutarch.Prelude +import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin) +import Plutarch.Verify ( + PTryFrom (ptryFrom), + PTryFromRecur (ptryFromRecur), + ) import qualified PlutusCore as PLC -spec :: Spec -spec = do - describe "verification_untrusted_data" . pgoldenSpec $ do - "erroneous" @\ do - "int /= bytestring" - @| checkShallow - @PInteger - @PByteString - (pconstant "foo") +spec :: Spec +spec = do + describe "verification_untrusted_data" . pgoldenSpec $ do + "erroneous" @\ do + "int /= bytestring" + @| checkShallow + @PInteger + @PByteString + (pconstant "foo") @-> pfails - "(String, Integer) /= (String, String)" - @| checkDeep + "(String, Integer) /= (String, String)" + @| checkDeep @(PBuiltinPair (PAsData PInteger) (PAsData PByteString)) @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) @-> pfails "[String] /= [Integer]" - @| checkDeep + @| checkDeep @(PBuiltinList (PAsData PByteString)) @(PBuiltinList (PAsData PInteger)) ((pcons # (pdata $ pconstant 3)) #$ (psingleton # (pdata $ pconstant 4))) @-> pfails - "working" @\ do - "int == int" + "working" @\ do + "int == int" @| checkShallow @PInteger @PInteger (pconstant 42) @-> psucceeds - "(String, String) == (String, String)" - @| checkDeep + "(String, String) == (String, String)" + @| checkDeep @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) @-> psucceeds - "(POpaque, POpaque) == (POpaque, POpaque)" - @| checkShallow + "(POpaque, POpaque) == (POpaque, POpaque)" + @| checkShallow @(PBuiltinPair (PAsData POpaque) (PAsData POpaque)) @(PBuiltinPair (PAsData POpaque) (PAsData POpaque)) - (punsafeBuiltin PLC.MkPairData # - (pdata $ pcon PUnit) # - (pdata $ pcon PUnit)) + ( punsafeBuiltin PLC.MkPairData + # (pdata $ pcon PUnit) + # (pdata $ pcon PUnit) + ) @-> psucceeds "[String] == [String]" - @| checkDeep + @| checkDeep @(PBuiltinList (PAsData PByteString)) @(PBuiltinList (PAsData PByteString)) ((pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) @-> psucceeds -checkShallow :: forall (target :: PType) (actual :: PType). - (PTryFrom target, PIsData actual) => ClosedTerm actual -> ClosedTerm target +checkShallow :: + forall (target :: PType) (actual :: PType). + (PTryFrom target, PIsData actual) => + ClosedTerm actual -> + ClosedTerm target checkShallow = reprTargetActual ptryFrom -checkDeep :: forall (target :: PType) (actual :: PType). - (PTryFromRecur target, PIsData actual) => ClosedTerm actual -> ClosedTerm target +checkDeep :: + forall (target :: PType) (actual :: PType). + (PTryFromRecur target, PIsData actual) => + ClosedTerm actual -> + ClosedTerm target checkDeep = reprTargetActual ptryFromRecur -reprTargetActual :: forall (target :: PType) (actual :: PType). - (PIsData actual ) => ClosedTerm (PData :--> target) -> ClosedTerm actual -> ClosedTerm target +reprTargetActual :: + forall (target :: PType) (actual :: PType). + (PIsData actual) => + ClosedTerm (PData :--> target) -> + ClosedTerm actual -> + ClosedTerm target reprTargetActual f x = f #$ pforgetData $ pdata x From 463f8f5fd47c97632643ae8b8001010169707456 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 15:55:56 -0500 Subject: [PATCH 080/584] Port ConstrData tests --- examples/Examples/ConstrData.hs | 134 ----------------- examples/Main.hs | 2 - .../goldens/pisdata.constr.bench.golden | 8 + .../goldens/pisdata.constr.uplc.eval.golden | 8 + .../goldens/pisdata.constr.uplc.golden | 8 + plutarch-test/src/Plutarch/PIsDataSpec.hs | 138 +++++++++++++++++- plutarch.cabal | 1 - 7 files changed, 156 insertions(+), 143 deletions(-) delete mode 100644 examples/Examples/ConstrData.hs create mode 100644 plutarch-test/goldens/pisdata.constr.bench.golden create mode 100644 plutarch-test/goldens/pisdata.constr.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.constr.uplc.golden diff --git a/examples/Examples/ConstrData.hs b/examples/Examples/ConstrData.hs deleted file mode 100644 index 5913600ba..000000000 --- a/examples/Examples/ConstrData.hs +++ /dev/null @@ -1,134 +0,0 @@ -{-# LANGUAGE UndecidableInstances #-} - -module Examples.ConstrData (tests) where - -import Data.String (fromString) -import qualified GHC.Generics as GHC -import Generics.SOP - -import Test.Tasty (TestTree, testGroup) -import Test.Tasty.HUnit (testCase) - -import Utils - -import Plutarch.Api.V1 -import Plutarch.DataRepr (PDataFields, PIsDataReprInstances (PIsDataReprInstances)) -import Plutarch.Prelude -import Plutarch.Unsafe (punsafeCoerce) - -import Plutus.V1.Ledger.Api -import qualified PlutusTx - -{- | - We can defined a data-type using PDataRecord, with labeled fields. - - With an appropriate instance of 'PIsDataRepr', we can automatically - derive 'PDataFields'. --} -newtype Triplet (a :: PType) (s :: S) - = Triplet - ( Term - s - ( PDataRecord - '[ "x" ':= a - , "y" ':= a - , "z" ':= a - ] - ) - ) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields) - via (PIsDataReprInstances (Triplet a)) - -data PVehicle (s :: S) - = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) - | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) - | PImmovableBox (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData) - via PIsDataReprInstances PVehicle - -data PEnumType (s :: S) - = PA (Term s (PDataRecord '[])) - | PB (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData) - via PIsDataReprInstances PEnumType - -tests :: HasTester => TestTree -tests = - testGroup - "Data construction tests" - [ testCase "Sum of products construction" $ do - pcon - ( PFourWheeler $ - pdcons - # pconstantData 2 #$ pdcons - # pconstantData 5 #$ pdcons - # pconstantData 42 #$ pdcons - # pconstantData 0 - # pdnil - ) - `equal` punsafeCoerce - (pconstant $ PlutusTx.Constr 0 [PlutusTx.I 2, PlutusTx.I 5, PlutusTx.I 42, PlutusTx.I 0]) - pcon (PTwoWheeler $ pdcons # pconstantData 5 #$ pdcons # pconstantData 0 # pdnil) - `equal` punsafeCoerce - (pconstant $ PlutusTx.Constr 1 [PlutusTx.I 5, PlutusTx.I 0]) - pcon (PImmovableBox pdnil) - `equal` punsafeCoerce - (pconstant $ PlutusTx.Constr 2 []) - , testCase "Product construction" $ do - pcon - ( Triplet $ - pdcons - # pconstantData @PCurrencySymbol "ab" #$ pdcons - # pconstantData "41" #$ pdcons - # pconstantData "0e" - # pdnil - ) - `equal` punsafeCoerce - ( pconstant $ - PlutusTx.Constr - 0 - [ PlutusTx.toData @CurrencySymbol "ab" - , PlutusTx.toData @CurrencySymbol "41" - , PlutusTx.toData @CurrencySymbol "0e" - ] - ) - let minting = Minting "" - spending = Spending $ TxOutRef "ab" 0 - rewarding = Rewarding . StakingHash $ PubKeyCredential "da" - pcon - ( Triplet $ - pdcons - # pconstantData minting #$ pdcons - # pconstantData spending #$ pdcons - # pconstantData rewarding - # pdnil - ) - `equal` punsafeCoerce - ( pconstant $ - PlutusTx.Constr - 0 - [PlutusTx.toData minting, PlutusTx.toData spending, PlutusTx.toData rewarding] - ) - , testCase "Enumerable sum type construction" $ do - pcon (PA pdnil) `equal` punsafeCoerce (pconstant $ PlutusTx.Constr 0 []) - pcon (PB pdnil) `equal` punsafeCoerce (pconstant $ PlutusTx.Constr 1 []) - , testCase "Relation between pconstant and pcon" $ do - let valHash = "01" - addr = Address (ScriptCredential $ fromString valHash) Nothing - pscriptCredential :: Term s PCredential - pscriptCredential = - pcon $ - PScriptCredential $ - pdcons # pdata (pcon $ PValidatorHash $ phexByteStr valHash) # pdnil - pconstant addr - `equal` pcon (PAddress $ pdcons # pdata pscriptCredential #$ pdcons # pdata (pcon $ PDNothing pdnil) # pdnil) - ] diff --git a/examples/Main.hs b/examples/Main.hs index 635de7969..b2836057b 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -17,7 +17,6 @@ import Plutus.V2.Ledger.Contexts (ScriptPurpose (Minting)) import qualified PlutusCore as PLC import qualified PlutusTx -import qualified Examples.ConstrData as ConstrData import qualified Examples.LetRec as LetRec import Utils @@ -45,7 +44,6 @@ tests = [ plutarchTests , uplcTests , LetRec.tests - , ConstrData.tests ] plutarchTests :: HasTester => TestTree diff --git a/plutarch-test/goldens/pisdata.constr.bench.golden b/plutarch-test/goldens/pisdata.constr.bench.golden new file mode 100644 index 000000000..2a54c6d30 --- /dev/null +++ b/plutarch-test/goldens/pisdata.constr.bench.golden @@ -0,0 +1,8 @@ +sop.4wheeler {"exBudgetCPU":1494425,"exBudgetMemory":2760,"scriptSizeBytes":45} +sop.2wheeler {"exBudgetCPU":956241,"exBudgetMemory":1896,"scriptSizeBytes":30} +sop.immovable {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} +prod.1 {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":40} +prod.2 {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":68} +enum.PA {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} +enum.PB {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} +pconstant-pcon-rel {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":22} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.constr.uplc.eval.golden b/plutarch-test/goldens/pisdata.constr.uplc.eval.golden new file mode 100644 index 000000000..6f3b5cbf0 --- /dev/null +++ b/plutarch-test/goldens/pisdata.constr.uplc.eval.golden @@ -0,0 +1,8 @@ +sop.4wheeler (program 1.0.0 #d8799f0205182a00ff) +sop.2wheeler (program 1.0.0 #d87a9f0500ff) +sop.immovable (program 1.0.0 #d87b80) +prod.1 (program 1.0.0 #d8799f41ab4141410eff) +prod.2 (program 1.0.0 #d8799fd8799f40ffd87a9fd8799fd8799f41abff00ffffd87b9fd8799fd8799f41daffffffff) +enum.PA (program 1.0.0 #d87980) +enum.PB (program 1.0.0 #d87a80) +pconstant-pcon-rel (program 1.0.0 #d8799fd87a9f4101ffd87a80ff) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.constr.uplc.golden b/plutarch-test/goldens/pisdata.constr.uplc.golden new file mode 100644 index 000000000..38bb851e4 --- /dev/null +++ b/plutarch-test/goldens/pisdata.constr.uplc.golden @@ -0,0 +1,8 @@ +sop.4wheeler (program 1.0.0 ((\i0 -> constrData 0 (i1 #02 (i1 #05 (i1 #182a (i1 #00 [ ]))))) (force mkCons))) +sop.2wheeler (program 1.0.0 ((\i0 -> constrData 1 (i1 #05 (i1 #00 []))) (force mkCons))) +sop.immovable (program 1.0.0 (constrData 2 [])) +prod.1 (program 1.0.0 ((\i0 -> constrData 0 (i1 #41ab (i1 #4141 (i1 #410e [ ])))) (force mkCons))) +prod.2 (program 1.0.0 ((\i0 -> constrData 0 (i1 #d8799f40ff (i1 #d87a9fd8799fd8799f41abff00ffff (i1 #d87b9fd8799fd8799f41daffffff [ ])))) (force mkCons))) +enum.PA (program 1.0.0 (constrData 0 [])) +enum.PB (program 1.0.0 (constrData 1 [])) +pconstant-pcon-rel (program 1.0.0 #d8799fd87a9f4101ffd87a80ff) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/PIsDataSpec.hs b/plutarch-test/src/Plutarch/PIsDataSpec.hs index 846ce1e01..f438c99c1 100644 --- a/plutarch-test/src/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/src/Plutarch/PIsDataSpec.hs @@ -1,21 +1,32 @@ {-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE UndecidableInstances #-} module Plutarch.PIsDataSpec (spec) where import Data.Text.Encoding (encodeUtf8) +import Data.String (fromString) +import qualified GHC.Generics as GHC +import Generics.SOP +import Plutus.V1.Ledger.Api ( + Address (Address), + Credential (PubKeyCredential, ScriptCredential), + CurrencySymbol, + ScriptPurpose (Minting, Rewarding, Spending), + StakingCredential (StakingHash), + TxOutRef (TxOutRef), + ) +import qualified PlutusTx +import Test.Syd +import Test.Tasty.QuickCheck (Arbitrary, property) + import Plutarch.Api.V1 import Plutarch.Api.V1.Tuple (pbuiltinPairFromTuple, ptupleFromBuiltin) import Plutarch.Builtin (pforgetData, ppairDataBuiltin) +import Plutarch.DataRepr (PDataFields, PIsDataReprInstances (PIsDataReprInstances)) import Plutarch.Lift (PLifted) import Plutarch.Prelude - -import Plutus.V1.Ledger.Credential (Credential (ScriptCredential)) -import qualified PlutusTx - import Plutarch.Test -import Test.Syd -import Test.Tasty.QuickCheck (Arbitrary, property) spec :: Spec spec = do @@ -44,6 +55,79 @@ spec = do "pforgetData" @| pforgetData (pdata scPair) @== pforgetData scTuple "pbuiltinPairFromTuple" @| pfromData (pbuiltinPairFromTuple scTuple) @== scPair "ptupleFromBuiltin" @| ptupleFromBuiltin (pdata scPair) @== scTuple + -- Data construction tests + describe "constr" . pgoldenSpec $ do + -- Sum of products construction + "sop" @\ do + "4wheeler" + @| pcon + ( PFourWheeler $ + pdcons + # pconstantData 2 #$ pdcons + # pconstantData 5 #$ pdcons + # pconstantData 42 #$ pdcons + # pconstantData 0 + # pdnil + ) + @== pconstant (PlutusTx.Constr 0 [PlutusTx.I 2, PlutusTx.I 5, PlutusTx.I 42, PlutusTx.I 0]) + "2wheeler" + @| pcon (PTwoWheeler $ pdcons # pconstantData 5 #$ pdcons # pconstantData 0 # pdnil) + @== pconstant (PlutusTx.Constr 1 [PlutusTx.I 5, PlutusTx.I 0]) + "immovable" + @| pcon (PImmovableBox pdnil) + @== pconstant (PlutusTx.Constr 2 []) + -- Product construction + "prod" @\ do + "1" + @| pcon + ( Triplet $ + pdcons + # pconstantData @PCurrencySymbol "ab" #$ pdcons + # pconstantData "41" #$ pdcons + # pconstantData "0e" + # pdnil + ) + @== pconstant + ( PlutusTx.Constr + 0 + [ PlutusTx.toData @CurrencySymbol "ab" + , PlutusTx.toData @CurrencySymbol "41" + , PlutusTx.toData @CurrencySymbol "0e" + ] + ) + let minting = Minting "" + spending = Spending $ TxOutRef "ab" 0 + rewarding = Rewarding . StakingHash $ PubKeyCredential "da" + "2" + @| pcon + ( Triplet $ + pdcons + # pconstantData minting #$ pdcons + # pconstantData spending #$ pdcons + # pconstantData rewarding + # pdnil + ) + @== pconstant + ( PlutusTx.Constr + 0 + [PlutusTx.toData minting, PlutusTx.toData spending, PlutusTx.toData rewarding] + ) + -- Enumerable sum type construction + "enum" @\ do + "PA" @| pcon (PA pdnil) @== pconstant (PlutusTx.Constr 0 []) + "PB" @| pcon (PB pdnil) @== pconstant (PlutusTx.Constr 1 []) + -- Relation between pconstant and pcon + "pconstant-pcon-rel" + @| ( let valHash = "01" + addr = Address (ScriptCredential $ fromString valHash) Nothing + pscriptCredential :: Term s PCredential + pscriptCredential = + pcon $ + PScriptCredential $ + pdcons # pdata (pcon $ PValidatorHash $ phexByteStr valHash) # pdnil + in pconstant addr + @== pcon (PAddress $ pdcons # pdata pscriptCredential #$ pdcons # pdata (pcon $ PDNothing pdnil) # pdnil) + ) propertySet :: forall p. @@ -98,3 +182,45 @@ pdataCompat :: PLifted p -> IO () pdataCompat x = PlutusTx.fromData @(PLifted p) (plift $ pforgetData $ pdata $ pconstant @p x) `shouldBe` Just x + +{- | + We can defined a data-type using PDataRecord, with labeled fields. + + With an appropriate instance of 'PIsDataRepr', we can automatically + derive 'PDataFields'. +-} +newtype Triplet (a :: PType) (s :: S) + = Triplet + ( Term + s + ( PDataRecord + '[ "x" ':= a + , "y" ':= a + , "z" ':= a + ] + ) + ) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData, PDataFields) + via (PIsDataReprInstances (Triplet a)) + +data PVehicle (s :: S) + = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) + | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) + | PImmovableBox (Term s (PDataRecord '[])) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData) + via PIsDataReprInstances PVehicle + +data PEnumType (s :: S) + = PA (Term s (PDataRecord '[])) + | PB (Term s (PDataRecord '[])) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData) + via PIsDataReprInstances PEnumType diff --git a/plutarch.cabal b/plutarch.cabal index 07f65583b..24a952ae5 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -163,7 +163,6 @@ test-suite examples QualifiedDo other-modules: - Examples.ConstrData Examples.LetRec Utils From c84a1ee57550b4553f566ec79dbda8af753fc9be Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 16:21:01 -0500 Subject: [PATCH 081/584] Port LetRec --- examples/Examples/LetRec.hs | 410 --------------------- examples/Main.hs | 2 - plutarch-test/goldens/rec.bench.golden | 45 +++ plutarch-test/goldens/rec.uplc.eval.golden | 59 +++ plutarch-test/goldens/rec.uplc.golden | 45 +++ plutarch-test/plutarch-test.cabal | 2 + plutarch-test/src/Plutarch/RecSpec.hs | 303 +++++++++++++++ plutarch.cabal | 1 - 8 files changed, 454 insertions(+), 413 deletions(-) delete mode 100644 examples/Examples/LetRec.hs create mode 100644 plutarch-test/goldens/rec.bench.golden create mode 100644 plutarch-test/goldens/rec.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.uplc.golden create mode 100644 plutarch-test/src/Plutarch/RecSpec.hs diff --git a/examples/Examples/LetRec.hs b/examples/Examples/LetRec.hs deleted file mode 100644 index 3a839f2cc..000000000 --- a/examples/Examples/LetRec.hs +++ /dev/null @@ -1,410 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE TemplateHaskell #-} - -module Examples.LetRec (tests) where - -import Plutarch (pcon', pmatch', printTerm) -import Plutarch.Builtin (pasConstr, pforgetData) -import Plutarch.Prelude -import Plutarch.Rec ( - DataReader (DataReader, readData), - DataWriter (DataWriter, writeData), - PRecord (PRecord), - RecordFromData, - ScottEncoded, - ScottEncoding, - field, - fieldFromData, - letrec, - rcon, - recordDataFromFieldWriters, - recordFromFieldReaders, - rmatch, - ) -import Plutarch.Rec.TH (deriveAll) -import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) -import qualified Rank2.TH -import Test.Tasty (TestTree, testGroup) -import Test.Tasty.HUnit (testCase, (@?=)) -import Utils -import Prelude hiding (even, odd) - -data FlatOuterRecord f = FlatOuterRecord - { flatOuterBool :: f PBool - , flatInner1 :: SampleRecord f - , flatOuterInt :: f PInteger - , flatInner2 :: SampleRecord f - , flatOuterString :: f PString - } - -data ShallowOuterRecord f = ShallowOuterRecord - { shallowOuterBool :: f PBool - , shallowInner1 :: f (PRecord SampleRecord) - , shallowOuterInt :: f PInteger - , shallowInner2 :: f (PRecord SampleRecord) - , shallowOuterString :: f PString - } - -data SampleRecord f = SampleRecord - { sampleBool :: f PBool - , sampleInt :: f PInteger - , sampleString :: f PString - } - -data EvenOdd f = EvenOdd - { even :: f (PInteger :--> PBool) - , odd :: f (PInteger :--> PBool) - } - -type instance ScottEncoded EvenOdd a = (PInteger :--> PBool) :--> (PInteger :--> PBool) :--> a - -$(Rank2.TH.deriveAll ''EvenOdd) -$(deriveAll ''SampleRecord) -- also autoderives the @type instance ScottEncoded@ -$(deriveAll ''FlatOuterRecord) -$(deriveAll ''ShallowOuterRecord) -instance RecordFromData SampleRecord -instance RecordFromData FlatOuterRecord -instance RecordFromData ShallowOuterRecord - -instance PIsData (PRecord SampleRecord) where - pfromData = readData (recordFromFieldReaders sampleReader) - pdata = writeData (recordDataFromFieldWriters sampleWriter) - -instance PIsData (PRecord FlatOuterRecord) where - pfromData = readData (recordFromFieldReaders flatOuterReader) - pdata = writeData (recordDataFromFieldWriters flatOuterWriter) - -instance PIsData (PRecord ShallowOuterRecord) where - pfromData = readData (recordFromFieldReaders shallowOuterReader) - pdata = writeData (recordDataFromFieldWriters shallowOuterWriter) - -sampleReader :: SampleRecord (DataReader s) -sampleReader = - SampleRecord - { sampleBool = DataReader pfromData - , sampleInt = DataReader pfromData - , sampleString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d - } - -sampleWriter :: SampleRecord (DataWriter s) -sampleWriter = - SampleRecord - { sampleBool = DataWriter pdata - , sampleInt = DataWriter pdata - , sampleString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s - } - -flatOuterReader :: FlatOuterRecord (DataReader s) -flatOuterReader = - FlatOuterRecord - { flatOuterBool = DataReader pfromData - , flatInner1 = sampleReader - , flatOuterInt = DataReader pfromData - , flatInner2 = sampleReader - , flatOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d - } - -flatOuterWriter :: FlatOuterRecord (DataWriter s) -flatOuterWriter = - FlatOuterRecord - { flatOuterBool = DataWriter pdata - , flatInner1 = sampleWriter - , flatOuterInt = DataWriter pdata - , flatInner2 = sampleWriter - , flatOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s - } - -shallowOuterReader :: ShallowOuterRecord (DataReader s) -shallowOuterReader = - ShallowOuterRecord - { shallowOuterBool = DataReader pfromData - , shallowInner1 = DataReader pfromData - , shallowOuterInt = DataReader pfromData - , shallowInner2 = DataReader pfromData - , shallowOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d - } - -shallowOuterWriter :: ShallowOuterRecord (DataWriter s) -shallowOuterWriter = - ShallowOuterRecord - { shallowOuterBool = DataWriter pdata - , shallowInner1 = DataWriter pdata - , shallowOuterInt = DataWriter pdata - , shallowInner2 = DataWriter pdata - , shallowOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s - } - -sampleFlatOuter :: Term (s :: S) (ScottEncoding FlatOuterRecord (t :: PType)) -sampleFlatOuter = rcon rawFlatOuter - -rawFlatOuter :: FlatOuterRecord (Term s) -rawFlatOuter = - FlatOuterRecord - { flatOuterBool = pcon PFalse - , flatInner1 = rawRecord - , flatOuterInt = 4 - , flatInner2 = rawRecord {sampleInt = 9} - , flatOuterString = "Hola, Mundo!" - } - -sampleShallowOuter :: Term (s :: S) (ScottEncoding ShallowOuterRecord (t :: PType)) -sampleShallowOuter = rcon rawShallowOuter - -rawShallowOuter :: ShallowOuterRecord (Term s) -rawShallowOuter = - ShallowOuterRecord - { shallowOuterBool = pcon PFalse - , shallowInner1 = pcon $ PRecord rawRecord - , shallowOuterInt = 4 - , shallowInner2 = pcon $ PRecord rawRecord {sampleInt = 9} - , shallowOuterString = "Hola, Mundo!" - } - -sampleRecord :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) -sampleRecord = rcon rawRecord - -sampleRecord' :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) -sampleRecord' = pcon' $ PRecord rawRecord - -sampleRecord'' :: Term (s :: S) (PRecord SampleRecord :: PType) -sampleRecord'' = pcon $ PRecord rawRecord - -rawRecord :: SampleRecord (Term s) -rawRecord = - SampleRecord - { sampleBool = pcon PFalse - , sampleInt = 6 - , sampleString = "Salut, Monde!" - } - -sampleRecur :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) -sampleRecur = - letrec $ - const - SampleRecord - { sampleBool = pcon PTrue - , sampleInt = 12 - , sampleString = "Hello, World!" - } - -evenOdd :: Term (s :: S) (ScottEncoding EvenOdd (t :: PType)) -evenOdd = letrec evenOddRecursion - where - evenOddRecursion :: EvenOdd (Term s) -> EvenOdd (Term s) - evenOddRecursion EvenOdd {even, odd} = - EvenOdd - { even = plam $ \n -> pif (n #== 0) (pcon PTrue) (odd #$ n - 1) - , odd = plam $ \n -> pif (n #== 0) (pcon PFalse) (even #$ n - 1) - } - -sampleData :: Term s (PAsData (PRecord SampleRecord)) -sampleData = pdata (punsafeFrom sampleRecord) - -flatOuterData :: Term s (PAsData (PRecord FlatOuterRecord)) -flatOuterData = pdata (punsafeFrom sampleFlatOuter) - -shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) -shallowOuterData = pdata (punsafeFrom sampleShallowOuter) - -tests :: HasTester => TestTree -tests = - testGroup - "Records" - [ testGroup - "Simple" - [ testCase "record construction with pcon" $ - printTerm sampleRecord'' - @?= "(program 1.0.0 (\\i0 -> i1 False 6 \"Salut, Monde!\"))" - , testCase "record construction with pcon'" $ - printTerm sampleRecord' - @?= "(program 1.0.0 (\\i0 -> i1 False 6 \"Salut, Monde!\"))" - , testCase "record construction with rcon" $ - printTerm sampleRecord - @?= "(program 1.0.0 (\\i0 -> i1 False 6 \"Salut, Monde!\"))" - , testCase "field access term" $ - printTerm (sampleRecord' # field sampleInt) - @?= "(program 1.0.0 ((\\i0 -> i1 False 6 \"Salut, Monde!\") (\\i0 -> \\i0 -> \\i0 -> i2)))" - , testGroup "field value" $ - [ testCase "direct access" $ - equal' (sampleRecord # field sampleInt) "(program 1.0.0 6)" - , testCase "pmatch" $ - equal' (pmatch sampleRecord'' $ \(PRecord r) -> sampleString r) "(program 1.0.0 \"Salut, Monde!\")" - , testCase "pmatch'" $ - equal' (pmatch' sampleRecord $ \(PRecord r) -> sampleString r) "(program 1.0.0 \"Salut, Monde!\")" - , testCase "rmatch" $ - equal' (rmatch sampleRecord $ \SampleRecord {sampleString = s} -> s) "(program 1.0.0 \"Salut, Monde!\")" - ] - , testCase "record reconstruction with pcon" $ - printTerm (pmatch' sampleRecord' (pcon @(PRecord SampleRecord))) - @?= "(program 1.0.0 ((\\i0 -> i1 False 6 \"Salut, Monde!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> i1 i4 i3 i2)))" - , testCase "reconstructed field access" $ - equal' (pto (pmatch' sampleRecord' (pcon @(PRecord SampleRecord))) # field sampleInt) "(program 1.0.0 6)" - ] - , testGroup - "Letrec" - [ testCase "record" $ (printTerm $ sampleRecur # field sampleInt) @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i2 (\\i0 -> i2 i2 i1)) (\\i0 -> i2 (\\i0 -> i2 i2 i1))) (\\i0 -> \\i0 -> i1 True 12 \"Hello, World!\") (\\i0 -> \\i0 -> \\i0 -> i2)))" - , testCase "record field" $ equal' (sampleRecur # field sampleInt) "(program 1.0.0 12)" - , testCase "even" $ (printTerm $ evenOdd # field even) @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> i2 (\\i0 -> i2 i2 i1)) (\\i0 -> i2 (\\i0 -> i2 i2 i1))) (\\i0 -> \\i0 -> i1 (\\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\\i0 -> \\i0 -> i1) (subtractInteger i1 1))))) (\\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\\i0 -> \\i0 -> i2)))" - , testCase "even 4" $ equal' (evenOdd # field even # (4 :: Term s PInteger)) "(program 1.0.0 True)" - , testCase "even 5" $ equal' (evenOdd # field even # (5 :: Term s PInteger)) "(program 1.0.0 False)" - ] - , testGroup - "flat nested" - [ testCase "record construction with rcon" $ - printTerm (sampleFlatOuter) - @?= "(program 1.0.0 ((\\i0 -> \\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") \"Salut, Monde!\"))" - , testCase "nested field access" $ - printTerm (sampleFlatOuter # field (sampleInt . flatInner2)) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i3)) \"Salut, Monde!\"))" - , testGroup "nested field value" $ - [ testCase "direct access" $ - equal' (sampleFlatOuter # field (sampleInt . flatInner2)) "(program 1.0.0 9)" - , testCase "pmatch" $ - equal' (pmatch (pcon $ PRecord rawFlatOuter) $ \(PRecord r) -> sampleInt $ flatInner2 r) "(program 1.0.0 9)" - , testCase "pmatch'" $ - equal' (pmatch' sampleFlatOuter $ \(PRecord r) -> sampleString $ flatInner2 r) "(program 1.0.0 \"Salut, Monde!\")" - , testCase "rmatch" $ - equal' (rmatch sampleFlatOuter $ \FlatOuterRecord {flatInner2 = SampleRecord {sampleString = s}} -> s) "(program 1.0.0 \"Salut, Monde!\")" - ] - , testCase "reconstruct with pcon" $ - printTerm (pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord))) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) \"Salut, Monde!\"))" - , testCase "reconstruction nested field value" $ - equal' (pto (pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord))) # field (sampleInt . flatInner2)) "(program 1.0.0 9)" - , testCase "nested record access term" $ - printTerm - ( pmatch' (rcon rawFlatOuter) $ - \(PRecord FlatOuterRecord {flatInner1}) -> pcon $ PRecord flatInner1 - ) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i1 i9 i8 i7)) \"Salut, Monde!\"))" - , testCase "nested match term" $ - printTerm - ( rmatch (rcon rawFlatOuter) $ \(FlatOuterRecord {flatInner2}) -> - rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> - sampleString - ) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> (\\i0 -> i1 i5 i4 i3) (\\i0 -> \\i0 -> \\i0 -> i1))) \"Salut, Monde!\"))" - , testCase "nested match value" $ - equal' - ( rmatch (rcon rawFlatOuter) $ \(FlatOuterRecord {flatInner2}) -> - rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> - sampleString - ) - "(program 1.0.0 \"Salut, Monde!\")" - ] - , testGroup - "shallow nested" - [ testCase "record construction with rcon" $ - printTerm (sampleShallowOuter) - @?= "(program 1.0.0 ((\\i0 -> \\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") \"Salut, Monde!\"))" - , testCase "nested field access" $ - printTerm (pto (sampleShallowOuter # field shallowInner2) # field sampleInt) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i2) (\\i0 -> \\i0 -> \\i0 -> i2)) \"Salut, Monde!\"))" - , testGroup "nested field value" $ - [ testCase "direct access" $ - equal' (pto (sampleShallowOuter # field shallowInner2) # field sampleInt) "(program 1.0.0 9)" - , testCase "pmatch" $ - equal' (pmatch (pcon $ PRecord rawShallowOuter) $ \(PRecord r) -> pto (shallowInner2 r) # field sampleInt) "(program 1.0.0 9)" - , testCase "pmatch'" $ - equal' (pmatch' sampleShallowOuter $ \(PRecord r) -> pto (shallowInner2 r) # field sampleString) "(program 1.0.0 \"Salut, Monde!\")" - , testCase "rmatch" $ - equal' (rmatch sampleShallowOuter $ \ShallowOuterRecord {shallowInner2 = inner} -> pto inner # field sampleString) "(program 1.0.0 \"Salut, Monde!\")" - ] - , testCase "reconstruct with pcon" $ - printTerm (pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord))) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i1 i6 i5 i4 i3 i2)) \"Salut, Monde!\"))" - , testCase "reconstruction nested field value" $ - equal' (pto (pto (pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord))) # field shallowInner2) # field sampleInt) "(program 1.0.0 9)" - , testCase "nested record access term" $ - printTerm (pmatch' sampleShallowOuter $ \(PRecord ShallowOuterRecord {shallowInner1}) -> shallowInner1) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i4)) \"Salut, Monde!\"))" - , testCase "nested match term" $ - printTerm - ( pmatch' sampleShallowOuter $ \(PRecord ShallowOuterRecord {shallowInner2}) -> - pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> - sampleString - ) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i2 (\\i0 -> \\i0 -> \\i0 -> i1))) \"Salut, Monde!\"))" - , testCase "nested match value" $ - equal' - ( pmatch' sampleShallowOuter $ \(PRecord ShallowOuterRecord {shallowInner2}) -> - pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> - sampleString - ) - "(program 1.0.0 \"Salut, Monde!\")" - ] - , testGroup - "Data" - [ testGroup - "pdata" - [ testCase "simple" $ printTerm sampleData @?= "(program 1.0.0 ((\\i0 -> i1 False 6 \"Salut, Monde!\") (\\i0 -> \\i0 -> \\i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))" - , testCase "simple value deconstructed" $ equal' (pasConstr # pforgetData sampleData) "(program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521]))" - , testCase "flat data deconstructed" $ - equal' - (pasConstr # pforgetData flatOuterData) - "(program 1.0.0 ( 0\n, [ #d87980\n , #d87980\n , #06\n , #4d53616c75742c204d6f6e646521\n , #04\n , #d87980\n , #09\n , #4d53616c75742c204d6f6e646521\n , #4c486f6c612c204d756e646f21 ] ))" - , testCase "shallow data deconstructed" $ - equal' - (pasConstr # pforgetData shallowOuterData) - "(program 1.0.0 ( 0\n, [ #d87980\n , #d8799fd87980064d53616c75742c204d6f6e646521ff\n , #04\n , #d8799fd87980094d53616c75742c204d6f6e646521ff\n , #4c486f6c612c204d756e646f21 ] ))" - ] - , testGroup - "fieldFromData term" - [ testCase "simple record" $ - (printTerm $ plam $ \dat -> plam pfromData #$ fieldFromData sampleInt # dat) - @?= result_fieldFromDataTerm'simpleRecord - , testCase "flat nested" $ - (printTerm $ plam $ \dat -> plam pfromData #$ fieldFromData (sampleInt . flatInner2) # dat) - @?= result_fieldFromDataTerm'flatNested - , testCase "shallow nested" $ - ( printTerm $ - plam $ \dat -> pto (plam pfromData #$ fieldFromData shallowInner2 # dat) # field sampleInt - ) - @?= result_fieldFromDataTerm'shallowNested - ] - , testGroup - "fieldFromData value" - [ testCase "simple" $ equal' (fieldFromData sampleInt # sampleData) "(program 1.0.0 #06)" - , testCase "flat nested" $ equal' (fieldFromData (sampleInt . flatInner2) # flatOuterData) "(program 1.0.0 #09)" - , testCase "shallow nested" $ equal' (fieldFromData sampleInt #$ fieldFromData shallowInner2 #$ shallowOuterData) "(program 1.0.0 #09)" - ] - , testCase "pfromData term" $ - (printTerm $ plam $ \d -> punsafeCoerce (pfromData d :: Term _ (PRecord SampleRecord)) # field sampleInt) - @?= result_fieldFromDataValue'shallowNested - ] - ] - --- CPP support isn't great in fourmolu. -{- ORMOLU_DISABLE -} - -result_fieldFromDataTerm'simpleRecord :: String -result_fieldFromDataTerm'simpleRecord = -#ifdef Development - "(program 1.0.0 (\\i0 -> unIData ((\\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace \"verifySoleConstructor failed\" (delay error)))))) (unConstrData i1))))" -#else - "(program 1.0.0 (\\i0 -> unIData ((\\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1))))" -#endif - -result_fieldFromDataTerm'flatNested :: String -result_fieldFromDataTerm'flatNested = -#ifdef Development - "(program 1.0.0 ((\\i0 -> \\i0 -> unIData ((\\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay (force (force trace \"verifySoleConstructor failed\" (delay error)))))) (unConstrData i1))) (force tailList)))" -#else - "(program 1.0.0 ((\\i0 -> \\i0 -> unIData ((\\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1))) (force tailList)))" -#endif - -result_fieldFromDataTerm'shallowNested :: String -result_fieldFromDataTerm'shallowNested = -#ifdef Development - "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> \\i0 -> (\\i0 -> (\\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\\i0 -> i1 ((\\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay (force (i9 i10 (delay error)))))) (unConstrData i1)) ((\\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay (force (i8 i9 (delay error)))))) (unConstrData i1)) (\\i0 -> \\i0 -> \\i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (force trace)) \"verifySoleConstructor failed\"))" -#else - "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> \\i0 -> (\\i0 -> (\\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\\i0 -> i1 ((\\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay error))) (unConstrData i1)) ((\\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay error))) (unConstrData i1)) (\\i0 -> \\i0 -> \\i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))))" -#endif - -result_fieldFromDataValue'shallowNested :: String -result_fieldFromDataValue'shallowNested = -#ifdef Development - "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> \\i0 -> (\\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\\i0 -> i1 ((\\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay (force (force trace \"verifySoleConstructor failed\" (delay error)))))) (unConstrData i1) (\\i0 -> \\i0 -> \\i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))))" -#else - "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> \\i0 -> (\\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\\i0 -> i1 ((\\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay error))) (unConstrData i1) (\\i0 -> \\i0 -> \\i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))))" -#endif diff --git a/examples/Main.hs b/examples/Main.hs index b2836057b..0fce8d51d 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -17,7 +17,6 @@ import Plutus.V2.Ledger.Contexts (ScriptPurpose (Minting)) import qualified PlutusCore as PLC import qualified PlutusTx -import qualified Examples.LetRec as LetRec import Utils main :: IO () @@ -43,7 +42,6 @@ tests = "unit tests" [ plutarchTests , uplcTests - , LetRec.tests ] plutarchTests :: HasTester => TestTree diff --git a/plutarch-test/goldens/rec.bench.golden b/plutarch-test/goldens/rec.bench.golden new file mode 100644 index 000000000..2d9ec6b78 --- /dev/null +++ b/plutarch-test/goldens/rec.bench.golden @@ -0,0 +1,45 @@ +simple.constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} +simple.reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} +LetRec.record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} +LetRec.even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} +LetRec.even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} +nested.flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} +nested.flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} +nested.flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} +nested.flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} +nested.shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} +nested.shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} +nested.shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} +nested.shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +Data.pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} +Data.pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} +Data.pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} +Data.pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} +Data.fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":36} +Data.fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":48} +Data.fieldFromData.nested.shallow {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":115} +Data.pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":83} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.uplc.eval.golden b/plutarch-test/goldens/rec.uplc.eval.golden new file mode 100644 index 000000000..756e9884a --- /dev/null +++ b/plutarch-test/goldens/rec.uplc.eval.golden @@ -0,0 +1,59 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 6) +simple.field.value.direct-access (program 1.0.0 6) +simple.field.value.pmatch (program 1.0.0 "Salut, Monde!") +simple.field.value.pmatch' (program 1.0.0 "Salut, Monde!") +simple.field.value.rmatch (program 1.0.0 "Salut, Monde!") +simple.reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.reconstr.field-access (program 1.0.0 6) +LetRec.record (program 1.0.0 12) +LetRec.record-field (program 1.0.0 12) +LetRec.even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) +LetRec.even.4 (program 1.0.0 True) +LetRec.even.5 (program 1.0.0 False) +nested.flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.nested-field-access (program 1.0.0 9) +nested.flat.nested-field-value.direct-access (program 1.0.0 9) +nested.flat.nested-field-value.pmatch (program 1.0.0 9) +nested.flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 9) +nested.flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.flat.nested-match-value (program 1.0.0 "Salut, Monde!") +nested.shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.nested-field-access (program 1.0.0 9) +nested.shallow.nested-field-value.direct-access (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 9) +nested.shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-match-value (program 1.0.0 "Salut, Monde!") +Data.pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) +Data.pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) +Data.pdata.flat-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d87980 + , #06 + , #4d53616c75742c204d6f6e646521 + , #04 + , #d87980 + , #09 + , #4d53616c75742c204d6f6e646521 + , #4c486f6c612c204d756e646f21 ] )) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d8799fd87980064d53616c75742c204d6f6e646521ff + , #04 + , #d8799fd87980094d53616c75742c204d6f6e646521ff + , #4c486f6c612c204d756e646f21 ] )) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1)))) +Data.fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) +Data.pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.uplc.golden b/plutarch-test/goldens/rec.uplc.golden new file mode 100644 index 000000000..6c7a400f5 --- /dev/null +++ b/plutarch-test/goldens/rec.uplc.golden @@ -0,0 +1,45 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) +simple.reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) +nested.flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) +nested.flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) +nested.shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +Data.pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) +Data.pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) +Data.pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1))) (force tailList))) +Data.fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) +Data.pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index a44939f3d..0cccc3f0e 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -108,6 +108,7 @@ executable plutarch-test build-depends: , base16-bytestring , cborg + , rank2classes , serialise if impl(ghc >=9.0) @@ -126,6 +127,7 @@ executable plutarch-test Plutarch.PLamSpec Plutarch.PlutusTypeSpec Plutarch.RationalSpec + Plutarch.RecSpec Plutarch.RecursionSpec Plutarch.ScriptsSpec Plutarch.StringSpec diff --git a/plutarch-test/src/Plutarch/RecSpec.hs b/plutarch-test/src/Plutarch/RecSpec.hs new file mode 100644 index 000000000..c74098636 --- /dev/null +++ b/plutarch-test/src/Plutarch/RecSpec.hs @@ -0,0 +1,303 @@ +{-# LANGUAGE TemplateHaskell #-} + +module Plutarch.RecSpec (spec) where + +import qualified Rank2.TH +import Test.Syd +import Prelude hiding (even, odd) + +import Plutarch (pcon', pmatch') +import Plutarch.Builtin (pasConstr, pforgetData) +import Plutarch.Prelude +import Plutarch.Rec ( + DataReader (DataReader, readData), + DataWriter (DataWriter, writeData), + PRecord (PRecord), + RecordFromData, + ScottEncoded, + ScottEncoding, + field, + fieldFromData, + letrec, + rcon, + recordDataFromFieldWriters, + recordFromFieldReaders, + rmatch, + ) +import Plutarch.Rec.TH (deriveAll) +import Plutarch.Test +import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) + +data FlatOuterRecord f = FlatOuterRecord + { flatOuterBool :: f PBool + , flatInner1 :: SampleRecord f + , flatOuterInt :: f PInteger + , flatInner2 :: SampleRecord f + , flatOuterString :: f PString + } + +data ShallowOuterRecord f = ShallowOuterRecord + { shallowOuterBool :: f PBool + , shallowInner1 :: f (PRecord SampleRecord) + , shallowOuterInt :: f PInteger + , shallowInner2 :: f (PRecord SampleRecord) + , shallowOuterString :: f PString + } + +data SampleRecord f = SampleRecord + { sampleBool :: f PBool + , sampleInt :: f PInteger + , sampleString :: f PString + } + +data EvenOdd f = EvenOdd + { even :: f (PInteger :--> PBool) + , odd :: f (PInteger :--> PBool) + } + +type instance ScottEncoded EvenOdd a = (PInteger :--> PBool) :--> (PInteger :--> PBool) :--> a + +$(Rank2.TH.deriveAll ''EvenOdd) +$(deriveAll ''SampleRecord) -- also autoderives the @type instance ScottEncoded@ +$(deriveAll ''FlatOuterRecord) +$(deriveAll ''ShallowOuterRecord) +instance RecordFromData SampleRecord +instance RecordFromData FlatOuterRecord +instance RecordFromData ShallowOuterRecord + +instance PIsData (PRecord SampleRecord) where + pfromData = readData (recordFromFieldReaders sampleReader) + pdata = writeData (recordDataFromFieldWriters sampleWriter) + +instance PIsData (PRecord FlatOuterRecord) where + pfromData = readData (recordFromFieldReaders flatOuterReader) + pdata = writeData (recordDataFromFieldWriters flatOuterWriter) + +instance PIsData (PRecord ShallowOuterRecord) where + pfromData = readData (recordFromFieldReaders shallowOuterReader) + pdata = writeData (recordDataFromFieldWriters shallowOuterWriter) + +sampleReader :: SampleRecord (DataReader s) +sampleReader = + SampleRecord + { sampleBool = DataReader pfromData + , sampleInt = DataReader pfromData + , sampleString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d + } + +sampleWriter :: SampleRecord (DataWriter s) +sampleWriter = + SampleRecord + { sampleBool = DataWriter pdata + , sampleInt = DataWriter pdata + , sampleString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s + } + +flatOuterReader :: FlatOuterRecord (DataReader s) +flatOuterReader = + FlatOuterRecord + { flatOuterBool = DataReader pfromData + , flatInner1 = sampleReader + , flatOuterInt = DataReader pfromData + , flatInner2 = sampleReader + , flatOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d + } + +flatOuterWriter :: FlatOuterRecord (DataWriter s) +flatOuterWriter = + FlatOuterRecord + { flatOuterBool = DataWriter pdata + , flatInner1 = sampleWriter + , flatOuterInt = DataWriter pdata + , flatInner2 = sampleWriter + , flatOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s + } + +shallowOuterReader :: ShallowOuterRecord (DataReader s) +shallowOuterReader = + ShallowOuterRecord + { shallowOuterBool = DataReader pfromData + , shallowInner1 = DataReader pfromData + , shallowOuterInt = DataReader pfromData + , shallowInner2 = DataReader pfromData + , shallowOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d + } + +shallowOuterWriter :: ShallowOuterRecord (DataWriter s) +shallowOuterWriter = + ShallowOuterRecord + { shallowOuterBool = DataWriter pdata + , shallowInner1 = DataWriter pdata + , shallowOuterInt = DataWriter pdata + , shallowInner2 = DataWriter pdata + , shallowOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s + } + +sampleFlatOuter :: Term (s :: S) (ScottEncoding FlatOuterRecord (t :: PType)) +sampleFlatOuter = rcon rawFlatOuter + +rawFlatOuter :: FlatOuterRecord (Term s) +rawFlatOuter = + FlatOuterRecord + { flatOuterBool = pcon PFalse + , flatInner1 = rawRecord + , flatOuterInt = 4 + , flatInner2 = rawRecord {sampleInt = 9} + , flatOuterString = "Hola, Mundo!" + } + +sampleShallowOuter :: Term (s :: S) (ScottEncoding ShallowOuterRecord (t :: PType)) +sampleShallowOuter = rcon rawShallowOuter + +rawShallowOuter :: ShallowOuterRecord (Term s) +rawShallowOuter = + ShallowOuterRecord + { shallowOuterBool = pcon PFalse + , shallowInner1 = pcon $ PRecord rawRecord + , shallowOuterInt = 4 + , shallowInner2 = pcon $ PRecord rawRecord {sampleInt = 9} + , shallowOuterString = "Hola, Mundo!" + } + +sampleRecord :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) +sampleRecord = rcon rawRecord + +sampleRecord' :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) +sampleRecord' = pcon' $ PRecord rawRecord + +sampleRecord'' :: Term (s :: S) (PRecord SampleRecord :: PType) +sampleRecord'' = pcon $ PRecord rawRecord + +rawRecord :: SampleRecord (Term s) +rawRecord = + SampleRecord + { sampleBool = pcon PFalse + , sampleInt = 6 + , sampleString = "Salut, Monde!" + } + +sampleRecur :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) +sampleRecur = + letrec $ + const + SampleRecord + { sampleBool = pcon PTrue + , sampleInt = 12 + , sampleString = "Hello, World!" + } + +evenOdd :: Term (s :: S) (ScottEncoding EvenOdd (t :: PType)) +evenOdd = letrec evenOddRecursion + where + evenOddRecursion :: EvenOdd (Term s) -> EvenOdd (Term s) + evenOddRecursion EvenOdd {even, odd} = + EvenOdd + { even = plam $ \n -> pif (n #== 0) (pcon PTrue) (odd #$ n - 1) + , odd = plam $ \n -> pif (n #== 0) (pcon PFalse) (even #$ n - 1) + } + +sampleData :: Term s (PAsData (PRecord SampleRecord)) +sampleData = pdata (punsafeFrom sampleRecord) + +flatOuterData :: Term s (PAsData (PRecord FlatOuterRecord)) +flatOuterData = pdata (punsafeFrom sampleFlatOuter) + +shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) +shallowOuterData = pdata (punsafeFrom sampleShallowOuter) + +spec :: Spec +spec = do + describe "rec" . pgoldenSpec $ do + "simple" @\ do + -- Record construction + "constr" @\ do + "pcon" @| sampleRecord'' + "pcon'" @| sampleRecord' + "rcon" @| sampleRecord + "field" @\ do + "access-term" @| sampleRecord' # field sampleInt + "value" @\ do + "direct-access" @| sampleRecord # field sampleInt + "pmatch" @| pmatch sampleRecord'' $ \(PRecord r) -> sampleString r + "pmatch'" @| pmatch' sampleRecord $ \(PRecord r) -> sampleString r + "rmatch" @| rmatch sampleRecord $ \SampleRecord {sampleString = s} -> s + -- Record reconstruction + "reconstr" @\ do + "pcon" @| pmatch' sampleRecord' (pcon @(PRecord SampleRecord)) + -- reconstructed field access + "field-access" @| pto (pmatch' sampleRecord' (pcon @(PRecord SampleRecord))) # field sampleInt + "LetRec" @\ do + "record" @| sampleRecur # field sampleInt + "record-field" @| sampleRecur # field sampleInt + "even" @| evenOdd # field even + "even.4" @| evenOdd # field even # (4 :: Term s PInteger) + "even.5" @| evenOdd # field even # (5 :: Term s PInteger) + "nested" @\ do + "flat" @\ do + "reconstr-with-rcon" @| sampleFlatOuter + "nested-field-access" @| sampleFlatOuter # field (sampleInt . flatInner2) + "nested-field-value" @\ do + "direct-access" @| sampleFlatOuter # field (sampleInt . flatInner2) + "pmatch" @| pmatch (pcon $ PRecord rawFlatOuter) $ \(PRecord r) -> sampleInt $ flatInner2 r + "pmatch'" @| pmatch' sampleFlatOuter $ \(PRecord r) -> sampleString $ flatInner2 r + "rmatch" @| rmatch sampleFlatOuter $ \FlatOuterRecord {flatInner2 = SampleRecord {sampleString = s}} -> s + "reconstr-with-pcon" @| pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord)) + "reconstr-nested-field-value" + @| pto (pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord))) # field (sampleInt . flatInner2) + "nested-record-access-term" + @| pmatch' (rcon rawFlatOuter) + $ \(PRecord FlatOuterRecord {flatInner1}) -> pcon $ PRecord flatInner1 + "nested-match-term" + @| rmatch (rcon rawFlatOuter) + $ \(FlatOuterRecord {flatInner2}) -> + rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> + sampleString + "nested-match-value" + @| rmatch (rcon rawFlatOuter) + $ \(FlatOuterRecord {flatInner2}) -> + rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> + sampleString + "shallow" @\ do + "constr-with-rcon" @| sampleShallowOuter + "nested-field-access" + @| pto (sampleShallowOuter # field shallowInner2) # field sampleInt + "nested-field-value" @\ do + "direct-access" + @| pto (sampleShallowOuter # field shallowInner2) # field sampleInt + "pmatch" + @| pmatch (pcon $ PRecord rawShallowOuter) + $ \(PRecord r) -> pto (shallowInner2 r) # field sampleInt + "pmatch'" + @| pmatch' sampleShallowOuter + $ \(PRecord r) -> pto (shallowInner2 r) # field sampleString + "rmatch" + @| rmatch sampleShallowOuter + $ \ShallowOuterRecord {shallowInner2 = inner} -> pto inner # field sampleString + "reconstr-with-pcon" + @| pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord)) + "reconstr-nested-field-value" + @| pto (pto (pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord))) # field shallowInner2) # field sampleInt + "nested-record-access-term" + @| pmatch' sampleShallowOuter + $ \(PRecord ShallowOuterRecord {shallowInner1}) -> shallowInner1 + "nested-match-term" + @| pmatch' sampleShallowOuter + $ \(PRecord ShallowOuterRecord {shallowInner2}) -> + pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> + sampleString + "nested-match-value" + @| pmatch' sampleShallowOuter + $ \(PRecord ShallowOuterRecord {shallowInner2}) -> + pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> + sampleString + "Data" @\ do + "pdata" @\ do + "simple" @| sampleData + "simple-value-deconstructed" @| pasConstr # pforgetData sampleData + "flat-data-deconstructed" @| pasConstr # pforgetData flatOuterData + "shallow-data-deconstructed" @| pasConstr # pforgetData shallowOuterData + "fieldFromData" @\ do + "simple" @| plam $ \dat -> plam pfromData #$ fieldFromData sampleInt # dat + "nested.flat" @| plam $ \dat -> plam pfromData #$ fieldFromData (sampleInt . flatInner2) # dat + "nested.shallow" @| plam $ \dat -> pto (plam pfromData #$ fieldFromData shallowInner2 # dat) # field sampleInt + "pfromData" @| plam $ \d -> punsafeCoerce (pfromData d :: Term _ (PRecord SampleRecord)) # field sampleInt diff --git a/plutarch.cabal b/plutarch.cabal index 24a952ae5..24005ded6 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -163,7 +163,6 @@ test-suite examples QualifiedDo other-modules: - Examples.LetRec Utils build-depends: From 0471cff07adba9395331ec57076b637832593778 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 16:29:09 -0500 Subject: [PATCH 082/584] Port UPLC tests --- examples/Main.hs | 46 ------------------- .../goldens/uplc-behaviour.bench.golden | 4 ++ .../goldens/uplc-behaviour.uplc.eval.golden | 4 ++ .../goldens/uplc-behaviour.uplc.golden | 4 ++ plutarch-test/plutarch-test.cabal | 1 + plutarch-test/src/Plutarch/UPLCSpec.hs | 38 +++++++++++++++ plutarch.cabal | 4 +- 7 files changed, 52 insertions(+), 49 deletions(-) create mode 100644 plutarch-test/goldens/uplc-behaviour.bench.golden create mode 100644 plutarch-test/goldens/uplc-behaviour.uplc.eval.golden create mode 100644 plutarch-test/goldens/uplc-behaviour.uplc.golden create mode 100644 plutarch-test/src/Plutarch/UPLCSpec.hs diff --git a/examples/Main.hs b/examples/Main.hs index 0fce8d51d..db1c1673a 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -9,7 +9,6 @@ import Test.Tasty.HUnit import GHC.IO.Encoding (setLocaleEncoding, utf8) import Plutarch (POpaque, popaque, printTerm) import Plutarch.Api.V1 (PScriptPurpose (PMinting)) -import Plutarch.Internal (punsafeConstantInternal) import Plutarch.Prelude import Plutarch.Unsafe (punsafeBuiltin) import Plutus.V1.Ledger.Value (CurrencySymbol, currencySymbol) @@ -24,15 +23,6 @@ main = do setLocaleEncoding utf8 defaultMain $ testGroup "all tests" [standardTests] -- , shrinkTests ] --- FIXME: Make the below impossible using run-time checks. --- loop :: Term (PInteger :--> PInteger) --- loop = plam $ \x -> loop # x --- loopHoisted :: Term (PInteger :--> PInteger) --- loopHoisted = phoistAcyclic $ plam $ \x -> loop # x - --- _shrinkTests :: TestTree --- _shrinkTests = testGroup "shrink tests" [let ?tester = shrinkTester in tests] - standardTests :: TestTree standardTests = testGroup "standard tests" [let ?tester = standardTester in tests] @@ -41,7 +31,6 @@ tests = testGroup "unit tests" [ plutarchTests - , uplcTests ] plutarchTests :: HasTester => TestTree @@ -135,40 +124,5 @@ plutarchTests = ] ] --- | Tests for the behaviour of UPLC itself. -uplcTests :: HasTester => TestTree -uplcTests = - testGroup - "uplc tests" - [ testCase "2:[1]" $ - let l :: Term _ (PBuiltinList PInteger) = - punsafeConstantInternal . PLC.Some $ - PLC.ValueOf (PLC.DefaultUniApply PLC.DefaultUniProtoList PLC.DefaultUniInteger) [1] - l' :: Term _ (PBuiltinList PInteger) = - pforce (punsafeBuiltin PLC.MkCons) # (2 :: Term _ PInteger) # l - in equal' l' "(program 1.0.0 [2,1])" - , testCase "fails: True:[1]" $ - let l :: Term _ (PBuiltinList POpaque) = - punsafeConstantInternal . PLC.Some $ - PLC.ValueOf (PLC.DefaultUniApply PLC.DefaultUniProtoList PLC.DefaultUniInteger) [1] - l' :: Term _ (PBuiltinList POpaque) = - pforce (punsafeBuiltin PLC.MkCons) # pcon PTrue # l - in fails l' - , testCase "(2,1)" $ - let p :: Term _ (PBuiltinPair PInteger PInteger) = - punsafeConstantInternal . PLC.Some $ - PLC.ValueOf - ( PLC.DefaultUniApply - (PLC.DefaultUniApply PLC.DefaultUniProtoPair PLC.DefaultUniInteger) - PLC.DefaultUniInteger - ) - (1, 2) - in equal' p "(program 1.0.0 (1, 2))" - , testCase "fails: MkPair 1 2" $ - let p :: Term _ (PBuiltinPair PInteger PInteger) = - punsafeBuiltin PLC.MkPairData # (1 :: Term _ PInteger) # (2 :: Term _ PInteger) - in fails p - ] - dummyCurrency :: CurrencySymbol dummyCurrency = currencySymbol "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" diff --git a/plutarch-test/goldens/uplc-behaviour.bench.golden b/plutarch-test/goldens/uplc-behaviour.bench.golden new file mode 100644 index 000000000..87aaea128 --- /dev/null +++ b/plutarch-test/goldens/uplc-behaviour.bench.golden @@ -0,0 +1,4 @@ +2:[1] {"exBudgetCPU":328738,"exBudgetMemory":732,"scriptSizeBytes":13} +fails:True:[1] {"exBudgetCPU":150100,"exBudgetMemory":132,"scriptSizeBytes":13} +(2,1) {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +fails:MkPair-1-2 {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":11} \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-behaviour.uplc.eval.golden b/plutarch-test/goldens/uplc-behaviour.uplc.eval.golden new file mode 100644 index 000000000..246399d89 --- /dev/null +++ b/plutarch-test/goldens/uplc-behaviour.uplc.eval.golden @@ -0,0 +1,4 @@ +2:[1] (program 1.0.0 [2,1]) +fails:True:[1] (program 1.0.0 error) +(2,1) (program 1.0.0 (1, 2)) +fails:MkPair-1-2 (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-behaviour.uplc.golden b/plutarch-test/goldens/uplc-behaviour.uplc.golden new file mode 100644 index 000000000..b10d2a70b --- /dev/null +++ b/plutarch-test/goldens/uplc-behaviour.uplc.golden @@ -0,0 +1,4 @@ +2:[1] (program 1.0.0 (force mkCons 2 [1])) +fails:True:[1] (program 1.0.0 (force mkCons True [1])) +(2,1) (program 1.0.0 (1, 2)) +fails:MkPair-1-2 (program 1.0.0 (mkPairData 1 2)) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 0cccc3f0e..ae23fad96 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -137,6 +137,7 @@ executable plutarch-test Plutarch.Test.ListSyntax Plutarch.TraceSpec Plutarch.UnitSpec + Plutarch.UPLCSpec Spec if flag(development) diff --git a/plutarch-test/src/Plutarch/UPLCSpec.hs b/plutarch-test/src/Plutarch/UPLCSpec.hs new file mode 100644 index 000000000..c1c310a5b --- /dev/null +++ b/plutarch-test/src/Plutarch/UPLCSpec.hs @@ -0,0 +1,38 @@ +module Plutarch.UPLCSpec (spec) where + +import qualified PlutusCore as PLC +import Test.Syd + +import Plutarch (POpaque) +import Plutarch.Internal (punsafeConstantInternal) +import Plutarch.Prelude +import Plutarch.Test +import Plutarch.Unsafe (punsafeBuiltin) + +spec :: Spec +spec = do + -- Tests for the behaviour of UPLC itself. + describe "uplc-behaviour" . pgoldenSpec $ do + "2:[1]" + @| ( let l :: Term _ (PBuiltinList PInteger) = + punsafeConstantInternal . PLC.Some $ + PLC.ValueOf (PLC.DefaultUniApply PLC.DefaultUniProtoList PLC.DefaultUniInteger) [1] + in pforce (punsafeBuiltin PLC.MkCons) # (2 :: Term _ PInteger) # l + ) + "fails:True:[1]" + @| ( let l :: Term _ (PBuiltinList POpaque) = + punsafeConstantInternal . PLC.Some $ + PLC.ValueOf (PLC.DefaultUniApply PLC.DefaultUniProtoList PLC.DefaultUniInteger) [1] + in pforce (punsafeBuiltin PLC.MkCons) # pcon PTrue # l @-> pfails + ) + "(2,1)" + @| punsafeConstantInternal . PLC.Some + $ PLC.ValueOf + ( PLC.DefaultUniApply + (PLC.DefaultUniApply PLC.DefaultUniProtoPair PLC.DefaultUniInteger) + PLC.DefaultUniInteger + ) + (1, 2) + "fails:MkPair-1-2" + @| punsafeBuiltin PLC.MkPairData # (1 :: Term _ PInteger) # (2 :: Term _ PInteger) + @-> pfails diff --git a/plutarch.cabal b/plutarch.cabal index 24005ded6..2d2d19ac0 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -162,9 +162,7 @@ test-suite examples OverloadedRecordDot QualifiedDo - other-modules: - Utils - + other-modules: Utils build-depends: , base , bytestring From 7609794990ad4239b52e415fde51a1d5f06bbe39 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 16:33:05 -0500 Subject: [PATCH 083/584] Port Scott encoding test --- examples/Main.hs | 16 ---------------- .../goldens/plutustype.example.bench.golden | 4 +++- .../goldens/plutustype.example.uplc.eval.golden | 4 +++- .../goldens/plutustype.example.uplc.golden | 4 +++- plutarch-test/src/Plutarch/PlutusTypeSpec.hs | 14 ++++++++++++++ 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/examples/Main.hs b/examples/Main.hs index db1c1673a..cc335ea01 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -39,22 +39,6 @@ plutarchTests = "plutarch tests" [ testCase "1 + 2 == 3" $ equal (pconstant @PInteger $ 1 + 2) (pconstant @PInteger 3) , testCase "fails: perror" $ fails perror - , testGroup - "PlutusType scott encoding " - [ testCase "PMaybe" $ do - let a = 42 :: Term s PInteger - let x = pmatch (pcon $ PJust a) $ \case - PJust x -> x - -- We expect this perror not to be evaluated eagerly when mx - -- is a PJust. - PNothing -> perror - printTerm x @?= "(program 1.0.0 ((\\i0 -> \\i0 -> i2 42) (\\i0 -> i1) (delay error)))" - , testCase "PPair" $ do - let a = 42 :: Term s PInteger - b = "Universe" :: Term s PString - let x = pmatch (pcon (PPair a b) :: Term s (PPair PInteger PString)) $ \(PPair _ y) -> y - printTerm x @?= "(program 1.0.0 ((\\i0 -> i1 42 \"Universe\") (\\i0 -> \\i0 -> i1)))" - ] , testCase "ScriptPurpose literal" $ let d :: ScriptPurpose d = Minting dummyCurrency diff --git a/plutarch-test/goldens/plutustype.example.bench.golden b/plutarch-test/goldens/plutustype.example.bench.golden index 6b4eb2311..6c43feb59 100644 --- a/plutarch-test/goldens/plutustype.example.bench.golden +++ b/plutarch-test/goldens/plutustype.example.bench.golden @@ -1,4 +1,6 @@ A-as-0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} B-as-1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} swap.A {"exBudgetCPU":554791,"exBudgetMemory":1502,"scriptSizeBytes":21} -swap.B {"exBudgetCPU":554791,"exBudgetMemory":1502,"scriptSizeBytes":21} \ No newline at end of file +swap.B {"exBudgetCPU":554791,"exBudgetMemory":1502,"scriptSizeBytes":21} +scottenc.PMaybe {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":14} +scottenc.PPair {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":26} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.uplc.eval.golden b/plutarch-test/goldens/plutustype.example.uplc.eval.golden index 14c7d3c9d..2c3a2a96e 100644 --- a/plutarch-test/goldens/plutustype.example.uplc.eval.golden +++ b/plutarch-test/goldens/plutustype.example.uplc.eval.golden @@ -1,4 +1,6 @@ A-as-0 (program 1.0.0 0) B-as-1 (program 1.0.0 1) swap.A (program 1.0.0 1) -swap.B (program 1.0.0 0) \ No newline at end of file +swap.B (program 1.0.0 0) +scottenc.PMaybe (program 1.0.0 42) +scottenc.PPair (program 1.0.0 "Universe") \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.uplc.golden b/plutarch-test/goldens/plutustype.example.uplc.golden index 861a2c517..01b5ecaee 100644 --- a/plutarch-test/goldens/plutustype.example.uplc.golden +++ b/plutarch-test/goldens/plutustype.example.uplc.golden @@ -1,4 +1,6 @@ A-as-0 (program 1.0.0 0) B-as-1 (program 1.0.0 1) swap.A (program 1.0.0 (force (force ifThenElse (equalsInteger 0 0) (delay 1) (delay 0)))) -swap.B (program 1.0.0 (force (force ifThenElse (equalsInteger 1 0) (delay 1) (delay 0)))) \ No newline at end of file +swap.B (program 1.0.0 (force (force ifThenElse (equalsInteger 1 0) (delay 1) (delay 0)))) +scottenc.PMaybe (program 1.0.0 ((\i0 -> \i0 -> i2 42) (\i0 -> i1) (delay error))) +scottenc.PPair (program 1.0.0 ((\i0 -> i1 42 "Universe") (\i0 -> \i0 -> i1))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs index 354d509cf..d000de95e 100644 --- a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs @@ -30,6 +30,20 @@ spec = do "swap" @\ do "A" @| swap (pcon A) @== pcon B "B" @| swap (pcon B) @== pcon A + "scottenc" @\ do + "PMaybe" + @| ( let a = 42 :: Term s PInteger + in pmatch (pcon $ PJust a) $ \case + PJust x -> x + -- We expect this perror not to be evaluated eagerly when mx + -- is a PJust. + PNothing -> perror + ) + "PPair" + @| ( let a = 42 :: Term s PInteger + b = "Universe" :: Term s PString + in pmatch (pcon (PPair a b) :: Term s (PPair PInteger PString)) $ \(PPair _ y) -> y + ) describe "instances-sanity" $ do plutarchDevFlagDescribe $ do it "PBuiltinList" $ do From 9d904bdd6d2018fafd467e394c86ed0d22c4db28 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 16:37:11 -0500 Subject: [PATCH 084/584] Mark RecSpec as GHC only due to #290 --- flake.nix | 1 + plutarch-test/plutarch-test.cabal | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 9bbb3f472..0a21e2800 100644 --- a/flake.nix +++ b/flake.nix @@ -475,6 +475,7 @@ chmod -R u+w $out/plutarch-test rm -f $out/plutarch-test/src/Plutarch/MonadicSpec.hs rm -f $out/plutarch-test/src/Plutarch/FieldSpec.hs + rm -f $out/plutarch-test/src/Plutarch/RecSpec.hs ''; compiler-nix-name = ghcName; inherit extraSources; diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index ae23fad96..87dbe146f 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -115,6 +115,7 @@ executable plutarch-test other-modules: Plutarch.FieldSpec Plutarch.MonadicSpec + Plutarch.RecSpec other-modules: Plutarch.ApiSpec @@ -127,7 +128,6 @@ executable plutarch-test Plutarch.PLamSpec Plutarch.PlutusTypeSpec Plutarch.RationalSpec - Plutarch.RecSpec Plutarch.RecursionSpec Plutarch.ScriptsSpec Plutarch.StringSpec From 652387f409cce8e3123ff050645b5e5a982b751b Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 16:39:47 -0500 Subject: [PATCH 085/584] RecSpec: create dev=true goldens --- ...ench.golden => rec.dev=false.bench.golden} | 0 ....golden => rec.dev=false.uplc.eval.golden} | 0 ....uplc.golden => rec.dev=false.uplc.golden} | 0 .../goldens/rec.dev=true.bench.golden | 45 ++++++++++++++ .../goldens/rec.dev=true.uplc.eval.golden | 59 +++++++++++++++++++ .../goldens/rec.dev=true.uplc.golden | 45 ++++++++++++++ plutarch-test/src/Plutarch/RecSpec.hs | 4 +- 7 files changed, 152 insertions(+), 1 deletion(-) rename plutarch-test/goldens/{rec.bench.golden => rec.dev=false.bench.golden} (100%) rename plutarch-test/goldens/{rec.uplc.eval.golden => rec.dev=false.uplc.eval.golden} (100%) rename plutarch-test/goldens/{rec.uplc.golden => rec.dev=false.uplc.golden} (100%) create mode 100644 plutarch-test/goldens/rec.dev=true.bench.golden create mode 100644 plutarch-test/goldens/rec.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.dev=true.uplc.golden diff --git a/plutarch-test/goldens/rec.bench.golden b/plutarch-test/goldens/rec.dev=false.bench.golden similarity index 100% rename from plutarch-test/goldens/rec.bench.golden rename to plutarch-test/goldens/rec.dev=false.bench.golden diff --git a/plutarch-test/goldens/rec.uplc.eval.golden b/plutarch-test/goldens/rec.dev=false.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/rec.uplc.eval.golden rename to plutarch-test/goldens/rec.dev=false.uplc.eval.golden diff --git a/plutarch-test/goldens/rec.uplc.golden b/plutarch-test/goldens/rec.dev=false.uplc.golden similarity index 100% rename from plutarch-test/goldens/rec.uplc.golden rename to plutarch-test/goldens/rec.dev=false.uplc.golden diff --git a/plutarch-test/goldens/rec.dev=true.bench.golden b/plutarch-test/goldens/rec.dev=true.bench.golden new file mode 100644 index 000000000..c1d0f244d --- /dev/null +++ b/plutarch-test/goldens/rec.dev=true.bench.golden @@ -0,0 +1,45 @@ +simple.constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} +simple.reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} +LetRec.record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} +LetRec.even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} +LetRec.even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} +nested.flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} +nested.flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} +nested.flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} +nested.flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} +nested.shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} +nested.shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} +nested.shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} +nested.shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +Data.pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} +Data.pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} +Data.pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} +Data.pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} +Data.fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":72} +Data.fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":84} +Data.fieldFromData.nested.shallow {"exBudgetCPU":893290,"exBudgetMemory":3100,"scriptSizeBytes":161} +Data.pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":118} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.dev=true.uplc.eval.golden new file mode 100644 index 000000000..16ab3b629 --- /dev/null +++ b/plutarch-test/goldens/rec.dev=true.uplc.eval.golden @@ -0,0 +1,59 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 6) +simple.field.value.direct-access (program 1.0.0 6) +simple.field.value.pmatch (program 1.0.0 "Salut, Monde!") +simple.field.value.pmatch' (program 1.0.0 "Salut, Monde!") +simple.field.value.rmatch (program 1.0.0 "Salut, Monde!") +simple.reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.reconstr.field-access (program 1.0.0 6) +LetRec.record (program 1.0.0 12) +LetRec.record-field (program 1.0.0 12) +LetRec.even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) +LetRec.even.4 (program 1.0.0 True) +LetRec.even.5 (program 1.0.0 False) +nested.flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.nested-field-access (program 1.0.0 9) +nested.flat.nested-field-value.direct-access (program 1.0.0 9) +nested.flat.nested-field-value.pmatch (program 1.0.0 9) +nested.flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 9) +nested.flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.flat.nested-match-value (program 1.0.0 "Salut, Monde!") +nested.shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.nested-field-access (program 1.0.0 9) +nested.shallow.nested-field-value.direct-access (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 9) +nested.shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-match-value (program 1.0.0 "Salut, Monde!") +Data.pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) +Data.pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) +Data.pdata.flat-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d87980 + , #06 + , #4d53616c75742c204d6f6e646521 + , #04 + , #d87980 + , #09 + , #4d53616c75742c204d6f6e646521 + , #4c486f6c612c204d756e646f21 ] )) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d8799fd87980064d53616c75742c204d6f6e646521ff + , #04 + , #d8799fd87980094d53616c75742c204d6f6e646521ff + , #4c486f6c612c204d756e646f21 ] )) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +Data.fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) +Data.pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.golden b/plutarch-test/goldens/rec.dev=true.uplc.golden new file mode 100644 index 000000000..772f9ecfb --- /dev/null +++ b/plutarch-test/goldens/rec.dev=true.uplc.golden @@ -0,0 +1,45 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) +simple.reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) +nested.flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) +nested.flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) +nested.shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +Data.pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) +Data.pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) +Data.pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1))) (force tailList))) +Data.fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay (force (i9 i10 (delay error)))))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay (force (i8 i9 (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (force trace)) "verifySoleConstructor failed")) +Data.pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/RecSpec.hs b/plutarch-test/src/Plutarch/RecSpec.hs index c74098636..df5d317b6 100644 --- a/plutarch-test/src/Plutarch/RecSpec.hs +++ b/plutarch-test/src/Plutarch/RecSpec.hs @@ -207,7 +207,9 @@ shallowOuterData = pdata (punsafeFrom sampleShallowOuter) spec :: Spec spec = do - describe "rec" . pgoldenSpec $ do + -- Plutarch.Rec.verifySoleConstructor uses tracing, so we must create two sets + -- of golden. + describe "rec" . plutarchDevFlagDescribe . pgoldenSpec $ do "simple" @\ do -- Record construction "constr" @\ do From 82d1e732c7ba22a29ef2807710b5d5ab21474b34 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 16:45:22 -0500 Subject: [PATCH 086/584] =?UTF-8?q?Port=20=CE=B7-reduction-optimisations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/Main.hs | 29 --------------- plutarch-test/goldens/plam.bench.golden | 15 +++++++- plutarch-test/goldens/plam.uplc.eval.golden | 15 +++++++- plutarch-test/goldens/plam.uplc.golden | 15 +++++++- plutarch-test/src/Plutarch/PLamSpec.hs | 41 ++++++++++++++++++++- 5 files changed, 82 insertions(+), 33 deletions(-) diff --git a/examples/Main.hs b/examples/Main.hs index cc335ea01..83357c83a 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -77,35 +77,6 @@ plutarchTests = , testCase "PAsData equality" $ do expect $ let dat = pdata @PInteger 42 in dat #== dat expect $ pnot #$ pdata (phexByteStr "12") #== pdata (phexByteStr "ab") - , testGroup - "η-reduction optimisations" - [ testCase "λx y. addInteger x y => addInteger" $ - printTerm (plam $ \x y -> (x :: Term _ PInteger) + y) @?= "(program 1.0.0 addInteger)" - , testCase "λx y. hoist (force mkCons) x y => force mkCons" $ - printTerm (plam $ \x y -> (pforce $ punsafeBuiltin PLC.MkCons) # x # y) @?= "(program 1.0.0 (force mkCons))" - , testCase "λx y. hoist mkCons x y => mkCons x y" $ - printTerm (plam $ \x y -> (punsafeBuiltin PLC.MkCons) # x # y) @?= "(program 1.0.0 (\\i0 -> \\i0 -> mkCons i2 i1))" - , testCase "λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x" $ - printTerm (plam $ \x y -> (phoistAcyclic $ plam $ \(x :: Term _ PInteger) y -> x + y - y - x) # x # y) @?= "(program 1.0.0 (\\i0 -> \\i0 -> subtractInteger (subtractInteger (addInteger i2 i1) i1) i2))" - , testCase "λx y. x + x" $ - printTerm (plam $ \(x :: Term _ PInteger) (_ :: Term _ PInteger) -> x + x) @?= "(program 1.0.0 (\\i0 -> \\i0 -> addInteger i2 i2))" - , testCase "let x = addInteger in x 1 1" $ - printTerm (plet (punsafeBuiltin PLC.AddInteger) $ \x -> x # (1 :: Term _ PInteger) # (1 :: Term _ PInteger)) @?= "(program 1.0.0 (addInteger 1 1))" - , testCase "let x = 0 in x => 0" $ - printTerm (plet 0 $ \(x :: Term _ PInteger) -> x) @?= "(program 1.0.0 0)" - , testCase "let x = hoist (λx. x + x) in 0 => 0" $ - printTerm (plet (phoistAcyclic $ plam $ \(x :: Term _ PInteger) -> x + x) $ \_ -> (0 :: Term _ PInteger)) @?= "(program 1.0.0 0)" - , testCase "let x = hoist (λx. x + x) in x" $ - printTerm (plet (phoistAcyclic $ plam $ \(x :: Term _ PInteger) -> x + x) $ \x -> x) @?= "(program 1.0.0 (\\i0 -> addInteger i1 i1))" - , testCase "λx y. sha2_256 x y =>!" $ - printTerm ((plam $ \x y -> punsafeBuiltin PLC.Sha2_256 # x # y)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> sha2_256 i2 i1))" - , testCase "let f = hoist (λx. x) in λx y. f x y => λx y. x y" $ - printTerm ((plam $ \x y -> (phoistAcyclic $ plam $ \x -> x) # x # y)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> i2 i1))" - , testCase "let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y" $ - printTerm ((plam $ \x y -> ((phoistAcyclic $ plam $ \x -> x # pcon PTrue)) # x # y)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> i2 True i1))" - , testCase "λy. (λx. x + x) y" $ - printTerm (plam $ \y -> (plam $ \(x :: Term _ PInteger) -> x + x) # y) @?= "(program 1.0.0 (\\i0 -> addInteger i1 i1))" - ] ] dummyCurrency :: CurrencySymbol diff --git a/plutarch-test/goldens/plam.bench.golden b/plutarch-test/goldens/plam.bench.golden index dfd694f39..1756137ec 100644 --- a/plutarch-test/goldens/plam.bench.golden +++ b/plutarch-test/goldens/plam.bench.golden @@ -12,4 +12,17 @@ primitives.unit.list {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes" primitives.unit.() {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} primitives.id {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} primitives.fun.lam+ {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -primitives.fun.+ {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file +primitives.fun.+ {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +η-reduction-optimisations.λx y. addInteger x y => addInteger {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +η-reduction-optimisations.λx y. hoist (force mkCons) x y => force mkCons {"exBudgetCPU":59646,"exBudgetMemory":300,"scriptSizeBytes":6} +η-reduction-optimisations.λx y. hoist mkCons x y => mkCons x y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":19} +η-reduction-optimisations.λx y. x + x {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.let x = addInteger in x 1 1 {"exBudgetCPU":346174,"exBudgetMemory":602,"scriptSizeBytes":11} +η-reduction-optimisations.let x = 0 in x => 0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +η-reduction-optimisations.let x = hoist (λx. x + x) in 0 => 0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +η-reduction-optimisations.let x = hoist (λx. x + x) in x {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +η-reduction-optimisations.λx y. sha2_256 x y =>! {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.let f = hoist (λx. x) in λx y. f x y => λx y. x y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":9} +η-reduction-optimisations.let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.λy. (λx. x + x) y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file diff --git a/plutarch-test/goldens/plam.uplc.eval.golden b/plutarch-test/goldens/plam.uplc.eval.golden index 3f624fffc..eeaf90097 100644 --- a/plutarch-test/goldens/plam.uplc.eval.golden +++ b/plutarch-test/goldens/plam.uplc.eval.golden @@ -12,4 +12,17 @@ primitives.unit.list (program 1.0.0 (\i0 -> [()])) primitives.unit.() (program 1.0.0 (\i0 -> ())) primitives.id (program 1.0.0 (\i0 -> i1)) primitives.fun.lam+ (program 1.0.0 (\i0 -> addInteger)) -primitives.fun.+ (program 1.0.0 addInteger) \ No newline at end of file +primitives.fun.+ (program 1.0.0 addInteger) +η-reduction-optimisations.λx y. addInteger x y => addInteger (program 1.0.0 addInteger) +η-reduction-optimisations.λx y. hoist (force mkCons) x y => force mkCons (program 1.0.0 (force mkCons)) +η-reduction-optimisations.λx y. hoist mkCons x y => mkCons x y (program 1.0.0 (\i0 -> \i0 -> mkCons i2 i1)) +η-reduction-optimisations.λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x (program 1.0.0 (\i0 -> \i0 -> subtractInteger (subtractInteger (addInteger i2 i1) i1) i2)) +η-reduction-optimisations.λx y. x + x (program 1.0.0 (\i0 -> \i0 -> addInteger i2 i2)) +η-reduction-optimisations.let x = addInteger in x 1 1 (program 1.0.0 2) +η-reduction-optimisations.let x = 0 in x => 0 (program 1.0.0 0) +η-reduction-optimisations.let x = hoist (λx. x + x) in 0 => 0 (program 1.0.0 0) +η-reduction-optimisations.let x = hoist (λx. x + x) in x (program 1.0.0 (\i0 -> addInteger i1 i1)) +η-reduction-optimisations.λx y. sha2_256 x y =>! (program 1.0.0 (\i0 -> \i0 -> sha2_256 i2 i1)) +η-reduction-optimisations.let f = hoist (λx. x) in λx y. f x y => λx y. x y (program 1.0.0 (\i0 -> \i0 -> i2 i1)) +η-reduction-optimisations.let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y (program 1.0.0 (\i0 -> \i0 -> i2 True i1)) +η-reduction-optimisations.λy. (λx. x + x) y (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.uplc.golden b/plutarch-test/goldens/plam.uplc.golden index 3f624fffc..2137369c2 100644 --- a/plutarch-test/goldens/plam.uplc.golden +++ b/plutarch-test/goldens/plam.uplc.golden @@ -12,4 +12,17 @@ primitives.unit.list (program 1.0.0 (\i0 -> [()])) primitives.unit.() (program 1.0.0 (\i0 -> ())) primitives.id (program 1.0.0 (\i0 -> i1)) primitives.fun.lam+ (program 1.0.0 (\i0 -> addInteger)) -primitives.fun.+ (program 1.0.0 addInteger) \ No newline at end of file +primitives.fun.+ (program 1.0.0 addInteger) +η-reduction-optimisations.λx y. addInteger x y => addInteger (program 1.0.0 addInteger) +η-reduction-optimisations.λx y. hoist (force mkCons) x y => force mkCons (program 1.0.0 (force mkCons)) +η-reduction-optimisations.λx y. hoist mkCons x y => mkCons x y (program 1.0.0 (\i0 -> \i0 -> mkCons i2 i1)) +η-reduction-optimisations.λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x (program 1.0.0 (\i0 -> \i0 -> subtractInteger (subtractInteger (addInteger i2 i1) i1) i2)) +η-reduction-optimisations.λx y. x + x (program 1.0.0 (\i0 -> \i0 -> addInteger i2 i2)) +η-reduction-optimisations.let x = addInteger in x 1 1 (program 1.0.0 (addInteger 1 1)) +η-reduction-optimisations.let x = 0 in x => 0 (program 1.0.0 0) +η-reduction-optimisations.let x = hoist (λx. x + x) in 0 => 0 (program 1.0.0 0) +η-reduction-optimisations.let x = hoist (λx. x + x) in x (program 1.0.0 (\i0 -> addInteger i1 i1)) +η-reduction-optimisations.λx y. sha2_256 x y =>! (program 1.0.0 (\i0 -> \i0 -> sha2_256 i2 i1)) +η-reduction-optimisations.let f = hoist (λx. x) in λx y. f x y => λx y. x y (program 1.0.0 (\i0 -> \i0 -> i2 i1)) +η-reduction-optimisations.let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y (program 1.0.0 (\i0 -> \i0 -> i2 True i1)) +η-reduction-optimisations.λy. (λx. x + x) y (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/PLamSpec.hs b/plutarch-test/src/Plutarch/PLamSpec.hs index f432c88c1..aab58cb43 100644 --- a/plutarch-test/src/Plutarch/PLamSpec.hs +++ b/plutarch-test/src/Plutarch/PLamSpec.hs @@ -1,10 +1,12 @@ module Plutarch.PLamSpec (spec) where +import Data.ByteString (ByteString) +import qualified PlutusCore as PLC import Test.Syd -import Data.ByteString (ByteString) import Plutarch.Prelude import Plutarch.Test +import Plutarch.Unsafe (punsafeBuiltin) spec :: Spec spec = do @@ -30,3 +32,40 @@ spec = do "fun" @\ do "lam+" @| plam $ \_ -> (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) "+" @| (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) + "η-reduction-optimisations" @\ do + "λx y. addInteger x y => addInteger" + @| plam + $ \x y -> (x :: Term _ PInteger) + y + "λx y. hoist (force mkCons) x y => force mkCons" + @| plam + $ \x y -> (pforce $ punsafeBuiltin PLC.MkCons) # x # y + "λx y. hoist mkCons x y => mkCons x y" + @| plam + $ \x y -> (punsafeBuiltin PLC.MkCons) # x # y + "λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x" + @| plam + $ \x y -> (phoistAcyclic $ plam $ \(x :: Term _ PInteger) y -> x + y - y - x) # x # y + "λx y. x + x" + @| plam + $ \(x :: Term _ PInteger) (_ :: Term _ PInteger) -> x + x + "let x = addInteger in x 1 1" + @| plet (punsafeBuiltin PLC.AddInteger) + $ \x -> x # (1 :: Term _ PInteger) # (1 :: Term _ PInteger) + "let x = 0 in x => 0" + @| plet 0 + $ \(x :: Term _ PInteger) -> x + "let x = hoist (λx. x + x) in 0 => 0" + @| plet (phoistAcyclic $ plam $ \(x :: Term _ PInteger) -> x + x) + $ \_ -> (0 :: Term _ PInteger) + "let x = hoist (λx. x + x) in x" + @| plet (phoistAcyclic $ plam $ \(x :: Term _ PInteger) -> x + x) + $ \x -> x + "λx y. sha2_256 x y =>!" + @| (plam $ \x y -> punsafeBuiltin PLC.Sha2_256 # x # y) + "let f = hoist (λx. x) in λx y. f x y => λx y. x y" + @| (plam $ \x y -> (phoistAcyclic $ plam $ \x -> x) # x # y) + "let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y" + @| (plam $ \x y -> ((phoistAcyclic $ plam $ \x -> x # pcon PTrue)) # x # y) + "λy. (λx. x + x) y" + @| plam + $ \y -> (plam $ \(x :: Term _ PInteger) -> x + x) # y From e08b8dd774f27f05ac6735fb4979dc91c72bccea Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 16:54:15 -0500 Subject: [PATCH 087/584] Port misc uplc tests --- examples/Main.hs | 20 +------------------ .../goldens/int.examples.bench.golden | 1 + .../goldens/int.examples.uplc.eval.golden | 1 + .../goldens/int.examples.uplc.golden | 1 + plutarch-test/goldens/uplc-misc.bench.golden | 6 ++++++ .../goldens/uplc-misc.uplc.eval.golden | 6 ++++++ plutarch-test/goldens/uplc-misc.uplc.golden | 6 ++++++ plutarch-test/src/Plutarch/IntegerSpec.hs | 1 + plutarch-test/src/Plutarch/UPLCSpec.hs | 11 ++++++++++ 9 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 plutarch-test/goldens/uplc-misc.bench.golden create mode 100644 plutarch-test/goldens/uplc-misc.uplc.eval.golden create mode 100644 plutarch-test/goldens/uplc-misc.uplc.golden diff --git a/examples/Main.hs b/examples/Main.hs index 83357c83a..46dc61ba3 100644 --- a/examples/Main.hs +++ b/examples/Main.hs @@ -37,9 +37,7 @@ plutarchTests :: HasTester => TestTree plutarchTests = testGroup "plutarch tests" - [ testCase "1 + 2 == 3" $ equal (pconstant @PInteger $ 1 + 2) (pconstant @PInteger 3) - , testCase "fails: perror" $ fails perror - , testCase "ScriptPurpose literal" $ + [ testCase "ScriptPurpose literal" $ let d :: ScriptPurpose d = Minting dummyCurrency f :: Term s PScriptPurpose @@ -55,22 +53,6 @@ plutarchTests = PMinting c -> popaque c _ -> perror in printTerm f @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff)))" - , testCase "error # 1 => error" $ - printTerm (perror # (1 :: Term s PInteger)) @?= "(program 1.0.0 error)" - , -- TODO: Port this to pluatrch-test - -- , testCase "fib error => error" $ - -- printTerm (fib # perror) @?= "(program 1.0.0 error)" - testCase "force (delay 0) => 0" $ - printTerm (pforce . pdelay $ (0 :: Term s PInteger)) @?= "(program 1.0.0 0)" - , testCase "delay (force (delay 0)) => delay 0" $ - printTerm (pdelay . pforce . pdelay $ (0 :: Term s PInteger)) @?= "(program 1.0.0 (delay 0))" - , testCase "id # 0 => 0" $ - printTerm ((plam $ \x -> x) # (0 :: Term s PInteger)) @?= "(program 1.0.0 0)" - , testCase "hoist id 0 => 0" $ - printTerm ((phoistAcyclic $ plam $ \x -> x) # (0 :: Term s PInteger)) @?= "(program 1.0.0 0)" - , testCase "hoist fstPair => fstPair" $ - printTerm (phoistAcyclic (punsafeBuiltin PLC.FstPair)) @?= "(program 1.0.0 fstPair)" - , testCase "throws: hoist error" $ throws $ phoistAcyclic perror , testCase "PData equality" $ do expect $ let dat = pconstant @PData (PlutusTx.List [PlutusTx.Constr 1 [PlutusTx.I 0]]) in dat #== dat expect $ pnot #$ pconstant @PData (PlutusTx.Constr 0 []) #== pconstant @PData (PlutusTx.I 42) diff --git a/plutarch-test/goldens/int.examples.bench.golden b/plutarch-test/goldens/int.examples.bench.golden index e4f61a84e..e6789832b 100644 --- a/plutarch-test/goldens/int.examples.bench.golden +++ b/plutarch-test/goldens/int.examples.bench.golden @@ -4,4 +4,5 @@ example1 {"exBudgetCPU":2057973,"exBudgetMemory":3710,"scriptSizeBytes":34} example2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":21} fib.lam {"exBudgetCPU":416922,"exBudgetMemory":1500,"scriptSizeBytes":72} fib.app.9 {"exBudgetCPU":187876376,"exBudgetMemory":433318,"scriptSizeBytes":75} +fib.error {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} uglyDouble {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.uplc.eval.golden b/plutarch-test/goldens/int.examples.uplc.eval.golden index 94d064400..923ba5104 100644 --- a/plutarch-test/goldens/int.examples.uplc.eval.golden +++ b/plutarch-test/goldens/int.examples.uplc.eval.golden @@ -4,4 +4,5 @@ example1 (program 1.0.0 55) example2 (program 1.0.0 (\i0 -> i1 (\i0 -> addInteger i1 1) (\i0 -> subtractInteger i1 1))) fib.lam (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 1)) ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 2)))))))))) fib.app.9 (program 1.0.0 34) +fib.error (program 1.0.0 error) uglyDouble (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.uplc.golden b/plutarch-test/goldens/int.examples.uplc.golden index 41ef79cf6..1eb85a63f 100644 --- a/plutarch-test/goldens/int.examples.uplc.golden +++ b/plutarch-test/goldens/int.examples.uplc.golden @@ -4,4 +4,5 @@ example1 (program 1.0.0 ((\i0 -> addInteger (i1 12 32) (i1 5 4)) (\i0 -> \i0 -> example2 (program 1.0.0 (\i0 -> i1 (\i0 -> addInteger i1 1) (\i0 -> subtractInteger i1 1))) fib.lam (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2)))))))))) (force ifThenElse))) fib.app.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) 9) (force ifThenElse))) +fib.error (program 1.0.0 error) uglyDouble (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-misc.bench.golden b/plutarch-test/goldens/uplc-misc.bench.golden new file mode 100644 index 000000000..e6bd51f17 --- /dev/null +++ b/plutarch-test/goldens/uplc-misc.bench.golden @@ -0,0 +1,6 @@ +perror {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +perror.arg {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +laziness.f.d {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +laziness.d.f.d {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +hoist.id.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":9} +hoist.fstPair {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-misc.uplc.eval.golden b/plutarch-test/goldens/uplc-misc.uplc.eval.golden new file mode 100644 index 000000000..016f4bba5 --- /dev/null +++ b/plutarch-test/goldens/uplc-misc.uplc.eval.golden @@ -0,0 +1,6 @@ +perror (program 1.0.0 error) +perror.arg (program 1.0.0 error) +laziness.f.d (program 1.0.0 0) +laziness.d.f.d (program 1.0.0 (delay 0)) +hoist.id.0 (program 1.0.0 (\i0 -> i1 0)) +hoist.fstPair (program 1.0.0 fstPair) \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-misc.uplc.golden b/plutarch-test/goldens/uplc-misc.uplc.golden new file mode 100644 index 000000000..016f4bba5 --- /dev/null +++ b/plutarch-test/goldens/uplc-misc.uplc.golden @@ -0,0 +1,6 @@ +perror (program 1.0.0 error) +perror.arg (program 1.0.0 error) +laziness.f.d (program 1.0.0 0) +laziness.d.f.d (program 1.0.0 (delay 0)) +hoist.id.0 (program 1.0.0 (\i0 -> i1 0)) +hoist.fstPair (program 1.0.0 fstPair) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/src/Plutarch/IntegerSpec.hs index d136fd6de..875dff874 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/src/Plutarch/IntegerSpec.hs @@ -19,6 +19,7 @@ spec = do "lam" @| fib "app" @\ do "9" @| fib # 9 + "error" @| fib # perror @-> pfails "uglyDouble" @| uglyDouble add1 :: Term s (PInteger :--> PInteger :--> PInteger) diff --git a/plutarch-test/src/Plutarch/UPLCSpec.hs b/plutarch-test/src/Plutarch/UPLCSpec.hs index c1c310a5b..d783f9e24 100644 --- a/plutarch-test/src/Plutarch/UPLCSpec.hs +++ b/plutarch-test/src/Plutarch/UPLCSpec.hs @@ -36,3 +36,14 @@ spec = do "fails:MkPair-1-2" @| punsafeBuiltin PLC.MkPairData # (1 :: Term _ PInteger) # (2 :: Term _ PInteger) @-> pfails + describe "uplc-misc" . pgoldenSpec $ do + "perror" @| perror @-> pfails + "perror.arg" @| perror # (1 :: Term s PInteger) @-> pfails + "laziness" @\ do + "f.d" @| (pforce . pdelay $ (0 :: Term s PInteger)) + "d.f.d" @| (pdelay . pforce . pdelay $ (0 :: Term s PInteger)) + "hoist" @\ do + -- hoist id 0 => 0 + "id.0" @| phoistAcyclic $ plam $ \x -> x # (0 :: Term s PInteger) + -- hoist fstPair => fstPair + "fstPair" @| phoistAcyclic (punsafeBuiltin PLC.FstPair) From f829415e3bf992c6d8313e236245aa1cd8a7a212 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 17:01:09 -0500 Subject: [PATCH 088/584] Port the remaining, and remove examples --- examples/Main.hs | 65 ------ examples/Utils.hs | 194 ------------------ plutarch-test/goldens/api.ctx.bench.golden | 4 +- .../goldens/api.ctx.uplc.eval.golden | 4 +- plutarch-test/goldens/api.ctx.uplc.golden | 4 +- .../goldens/pisdata.equality.bench.golden | 4 + .../goldens/pisdata.equality.uplc.eval.golden | 4 + .../goldens/pisdata.equality.uplc.golden | 4 + plutarch-test/src/Plutarch/ApiSpec.hs | 13 +- plutarch-test/src/Plutarch/PIsDataSpec.hs | 16 ++ plutarch.cabal | 34 --- 11 files changed, 49 insertions(+), 297 deletions(-) delete mode 100644 examples/Main.hs delete mode 100644 examples/Utils.hs create mode 100644 plutarch-test/goldens/pisdata.equality.bench.golden create mode 100644 plutarch-test/goldens/pisdata.equality.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.equality.uplc.golden diff --git a/examples/Main.hs b/examples/Main.hs deleted file mode 100644 index 46dc61ba3..000000000 --- a/examples/Main.hs +++ /dev/null @@ -1,65 +0,0 @@ -{-# LANGUAGE ImplicitParams #-} -{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} - -module Main (main) where - -import Test.Tasty -import Test.Tasty.HUnit - -import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Plutarch (POpaque, popaque, printTerm) -import Plutarch.Api.V1 (PScriptPurpose (PMinting)) -import Plutarch.Prelude -import Plutarch.Unsafe (punsafeBuiltin) -import Plutus.V1.Ledger.Value (CurrencySymbol, currencySymbol) -import Plutus.V2.Ledger.Contexts (ScriptPurpose (Minting)) -import qualified PlutusCore as PLC -import qualified PlutusTx - -import Utils - -main :: IO () -main = do - setLocaleEncoding utf8 - defaultMain $ testGroup "all tests" [standardTests] -- , shrinkTests ] - -standardTests :: TestTree -standardTests = testGroup "standard tests" [let ?tester = standardTester in tests] - -tests :: HasTester => TestTree -tests = - testGroup - "unit tests" - [ plutarchTests - ] - -plutarchTests :: HasTester => TestTree -plutarchTests = - testGroup - "plutarch tests" - [ testCase "ScriptPurpose literal" $ - let d :: ScriptPurpose - d = Minting dummyCurrency - f :: Term s PScriptPurpose - f = pconstant @PScriptPurpose d - in printTerm f @?= "(program 1.0.0 #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff)" - , testCase "decode ScriptPurpose" $ - let d :: ScriptPurpose - d = Minting dummyCurrency - d' :: Term s PScriptPurpose - d' = pconstant @PScriptPurpose d - f :: Term s POpaque - f = pmatch d' $ \case - PMinting c -> popaque c - _ -> perror - in printTerm f @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff)))" - , testCase "PData equality" $ do - expect $ let dat = pconstant @PData (PlutusTx.List [PlutusTx.Constr 1 [PlutusTx.I 0]]) in dat #== dat - expect $ pnot #$ pconstant @PData (PlutusTx.Constr 0 []) #== pconstant @PData (PlutusTx.I 42) - , testCase "PAsData equality" $ do - expect $ let dat = pdata @PInteger 42 in dat #== dat - expect $ pnot #$ pdata (phexByteStr "12") #== pdata (phexByteStr "ab") - ] - -dummyCurrency :: CurrencySymbol -dummyCurrency = currencySymbol "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" diff --git a/examples/Utils.hs b/examples/Utils.hs deleted file mode 100644 index 568f02343..000000000 --- a/examples/Utils.hs +++ /dev/null @@ -1,194 +0,0 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE ImplicitParams #-} - -module Utils ( - HasTester, - standardTester, - eval, - equal, - equalBudgeted, - equal', - fails, - expect, - throws, - traces, - succeeds, -) where - -import Control.Exception (SomeException, try) -import Data.Text (Text) -import Plutarch (ClosedTerm, compile, printScript) -import Plutarch.Evaluate (evaluateBudgetedScript, evaluateScript) -import Plutarch.Prelude -import qualified Plutus.V1.Ledger.Scripts as Scripts -import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) -import qualified PlutusCore.Evaluation.Machine.ExMemory as ExMemory - --- import Shrink (shrinkScript) -import Test.Tasty.HUnit - -newtype EvalImpl = EvalImpl {runEvalImpl :: forall (a :: PType). HasCallStack => ClosedTerm a -> IO Scripts.Script} -newtype EqualImpl = EqualImpl {runEqualImpl :: forall (a :: PType) (b :: PType). HasCallStack => ClosedTerm a -> ClosedTerm b -> Assertion} -newtype Equal'Impl = Equal'Impl {runEqual'Impl :: forall (a :: PType). HasCallStack => ClosedTerm a -> String -> Assertion} -newtype FailsImpl = FailsImpl {runFailsImpl :: forall (a :: PType). HasCallStack => ClosedTerm a -> Assertion} -newtype ExpectImpl = ExpectImpl {runExpectImpl :: HasCallStack => ClosedTerm PBool -> Assertion} -newtype ThrowsImpl = ThrowsImpl {runThrowsImpl :: forall (a :: PType). ClosedTerm a -> Assertion} -newtype TracesImpl = TracesImpl {runTracesImpl :: forall (a :: PType). ClosedTerm a -> [Text] -> Assertion} -newtype SucceedsImpl = SucceedsImpl {runSucceedsImpl :: ClosedTerm PUnit -> Assertion} - -data Tester = Tester - { evalImpl :: EvalImpl - , equalImpl :: EqualImpl - , equal'Impl :: Equal'Impl - , failsImpl :: FailsImpl - , expectImpl :: ExpectImpl - , throwsImpl :: ThrowsImpl - , tracesImpl :: TracesImpl - , succeedsImpl :: SucceedsImpl - } - -type HasTester = (?tester :: Tester) - -eval' :: HasCallStack => Scripts.Script -> IO Scripts.Script -eval' s = case evaluateScript s of - Left e -> assertFailure $ "Script evaluation failed: " <> show e - Right (_, _, x') -> pure x' - -standardTester :: Tester -standardTester = - Tester - { evalImpl = EvalImpl evalImpl - , equalImpl = EqualImpl equalImpl - , equal'Impl = Equal'Impl equal'Impl - , failsImpl = FailsImpl failsImpl - , expectImpl = ExpectImpl expectImpl - , throwsImpl = ThrowsImpl throwsImpl - , tracesImpl = TracesImpl tracesImpl - , succeedsImpl = SucceedsImpl succeedsImpl - } - where - evalImpl :: HasCallStack => ClosedTerm a -> IO Scripts.Script - evalImpl x = eval' $ compile x - - equalImpl :: HasCallStack => ClosedTerm a -> ClosedTerm b -> Assertion - equalImpl x y = do - x' <- evalImpl x - y' <- evalImpl y - printScript x' @?= printScript y' - - equal'Impl :: HasCallStack => ClosedTerm a -> String -> Assertion - equal'Impl x y = do - x' <- evalImpl x - printScript x' @?= y - - failsImpl :: HasCallStack => ClosedTerm a -> Assertion - failsImpl x = - case evaluateScript $ compile x of - Left (Scripts.EvaluationError _ _) -> mempty - Left (Scripts.EvaluationException _ _) -> mempty - Right (_, _, s) -> assertFailure $ "Script didn't err: " <> printScript s - - expectImpl :: HasCallStack => ClosedTerm PBool -> Assertion - expectImpl = equalImpl (pcon PTrue :: Term s PBool) - - throwsImpl :: HasCallStack => ClosedTerm a -> Assertion - throwsImpl x = - try @SomeException (putStrLn $ printScript $ compile x) >>= \case - Right _ -> assertFailure "Supposed to throw" - Left _ -> pure () - - tracesImpl :: HasCallStack => ClosedTerm a -> [Text] -> Assertion - tracesImpl x sl = - case evaluateScript $ compile x of - Left e -> assertFailure $ "Script evalImpluation failed: " <> show e - Right (_, traceLog, _) -> traceLog @?= sl - - succeedsImpl :: HasCallStack => ClosedTerm PUnit -> Assertion - succeedsImpl x = case evaluateScript $ compile x of - Left e -> assertFailure $ "Script evaluation failed: " <> show e - Right _ -> pure () - -{- -shrinkTester :: Tester -shrinkTester = - Tester - { evalImpl = EvalImpl evalImpl - , equalImpl = EqualImpl equalImpl - , equal'Impl = Equal'Impl equal'Impl - , failsImpl = FailsImpl failsImpl - , expectImpl = ExpectImpl expectImpl - , throwsImpl = ThrowsImpl throwsImpl - , tracesImpl = TracesImpl tracesImpl - } - where - evalImpl :: HasCallStack => ClosedTerm a -> IO Scripts.Script - evalImpl x = eval' . shrinkScript $ compile x - - equalImpl :: HasCallStack => ClosedTerm a -> ClosedTerm b -> Assertion - equalImpl x y = do - x' <- evalImpl x - y' <- evalImpl y - printScript x' @?= printScript y' - - equal'Impl :: HasCallStack => ClosedTerm a -> String -> Assertion - equal'Impl x y = do - x' <- let ?tester = standardTester in eval x - printScript x' @?= y - - failsImpl :: HasCallStack => ClosedTerm a -> Assertion - failsImpl x = - case evaluateScript . shrinkScript $ compile x of - Left (Scripts.EvaluationError _ _) -> mempty - Left (Scripts.EvaluationException _ _) -> mempty - Left e -> assertFailure $ "Script is malformed: " <> show e - Right (_, _, s) -> assertFailure $ "Script didn't err: " <> printScript s - - expectImpl :: HasCallStack => ClosedTerm PBool -> Assertion - expectImpl = equalImpl (pcon PTrue :: Term s PBool) - - throwsImpl :: HasCallStack => ClosedTerm a -> Assertion - throwsImpl x = - try @SomeException (putStrLn . printScript . shrinkScript $ compile x) >>= \case - Right _ -> assertFailure "Supposed to throw" - Left _ -> pure () - - tracesImpl :: HasCallStack => ClosedTerm a -> [Text] -> Assertion - tracesImpl x sl = - case evaluateScript . shrinkScript $ compile x of - Left e -> assertFailure $ "Script evalImpluation failed: " <> show e - Right (_, traceLog, _) -> traceLog @?= sl --} - -eval :: (HasCallStack, HasTester) => ClosedTerm a -> IO Scripts.Script -eval = runEvalImpl (evalImpl ?tester) -equal :: forall (a :: PType) (b :: PType). (HasCallStack, HasTester) => ClosedTerm a -> ClosedTerm b -> Assertion -equal x y = runEqualImpl (equalImpl ?tester) x y -equal' :: (HasCallStack, HasTester) => ClosedTerm a -> String -> Assertion -equal' = runEqual'Impl (equal'Impl ?tester) -fails :: (HasCallStack, HasTester) => ClosedTerm a -> Assertion -fails = runFailsImpl (failsImpl ?tester) -expect :: (HasCallStack, HasTester) => ClosedTerm PBool -> Assertion -expect = runExpectImpl (expectImpl ?tester) -throws :: (HasCallStack, HasTester) => ClosedTerm a -> Assertion -throws = runThrowsImpl (throwsImpl ?tester) -traces :: (HasCallStack, HasTester) => ClosedTerm a -> [Text] -> Assertion -traces = runTracesImpl (tracesImpl ?tester) -succeeds :: (HasCallStack, HasTester) => ClosedTerm PUnit -> Assertion -succeeds = runSucceedsImpl (succeedsImpl ?tester) - -evalBudgeted :: HasCallStack => ClosedTerm a -> IO Scripts.Script -evalBudgeted x = case evaluateBudgetedScript (ExBudget maxCPU maxMemory) $ compile x of - Left e -> assertFailure $ "Script evaluation failed: " <> show e - Right (_, _, x') -> pure x' - -maxCPU :: ExMemory.ExCPU -maxCPU = ExMemory.ExCPU 4000 - -maxMemory :: ExMemory.ExMemory -maxMemory = ExMemory.ExMemory 4000 - -equalBudgeted :: HasCallStack => ClosedTerm a -> ClosedTerm b -> Assertion -equalBudgeted x y = do - x' <- evalBudgeted x - y' <- evalBudgeted y - printScript x' @?= printScript y' diff --git a/plutarch-test/goldens/api.ctx.bench.golden b/plutarch-test/goldens/api.ctx.bench.golden index d0a170966..46308ed55 100644 --- a/plutarch-test/goldens/api.ctx.bench.golden +++ b/plutarch-test/goldens/api.ctx.bench.golden @@ -2,4 +2,6 @@ term {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":140} get.txInfo {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} get.mint {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} get.credentials {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} -get.sym {"exBudgetCPU":3825799,"exBudgetMemory":6816,"scriptSizeBytes":188} \ No newline at end of file +get.sym {"exBudgetCPU":3825799,"exBudgetMemory":6816,"scriptSizeBytes":188} +ScriptPurpose.literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":48} +ScriptPurpose.decode {"exBudgetCPU":1570478,"exBudgetMemory":3498,"scriptSizeBytes":74} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.uplc.eval.golden b/plutarch-test/goldens/api.ctx.uplc.eval.golden index 67a563998..982f866ad 100644 --- a/plutarch-test/goldens/api.ctx.uplc.eval.golden +++ b/plutarch-test/goldens/api.ctx.uplc.eval.golden @@ -2,4 +2,6 @@ term (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9 get.txInfo (program 1.0.0 #d8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffff) get.mint (program 1.0.0 #a141c0a149736f6d65746f6b656e01) get.credentials (program 1.0.0 [#41a1]) -get.sym (program 1.0.0 #c0) \ No newline at end of file +get.sym (program 1.0.0 #c0) +ScriptPurpose.literal (program 1.0.0 #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff) +ScriptPurpose.decode (program 1.0.0 [ #58201111111111111111111111111111111111111111111111111111111111111111 ]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.uplc.golden b/plutarch-test/goldens/api.ctx.uplc.golden index ed8772fa0..490acea63 100644 --- a/plutarch-test/goldens/api.ctx.uplc.golden +++ b/plutarch-test/goldens/api.ctx.uplc.golden @@ -2,4 +2,6 @@ term (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9 get.txInfo (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) get.mint (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) get.credentials (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (i5 i1)) (i2 (i4 i1))))))) (\i0 -> i3 (i5 (unConstrData ((\i0 -> i4 (i5 i1)) ((\i0 -> i4 (i5 i1)) (i3 (i2 (i4 i1)))))))) ((\i0 -> unListData (i3 (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -get.sym (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> force (force fstPair) (i3 i1)) (unMapData ((\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +get.sym (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> force (force fstPair) (i3 i1)) (unMapData ((\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +ScriptPurpose.literal (program 1.0.0 #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff) +ScriptPurpose.decode (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff))) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.equality.bench.golden b/plutarch-test/goldens/pisdata.equality.bench.golden new file mode 100644 index 000000000..1e7a0c8e3 --- /dev/null +++ b/plutarch-test/goldens/pisdata.equality.bench.golden @@ -0,0 +1,4 @@ +PData.1 {"exBudgetCPU":518284,"exBudgetMemory":901,"scriptSizeBytes":22} +PData.2 {"exBudgetCPU":696242,"exBudgetMemory":1802,"scriptSizeBytes":31} +PAsData.1 {"exBudgetCPU":768057,"exBudgetMemory":1065,"scriptSizeBytes":15} +PAsData.1 {"exBudgetCPU":1125334,"exBudgetMemory":2266,"scriptSizeBytes":32} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.equality.uplc.eval.golden b/plutarch-test/goldens/pisdata.equality.uplc.eval.golden new file mode 100644 index 000000000..c177045ae --- /dev/null +++ b/plutarch-test/goldens/pisdata.equality.uplc.eval.golden @@ -0,0 +1,4 @@ +PData.1 (program 1.0.0 True) +PData.2 (program 1.0.0 True) +PAsData.1 (program 1.0.0 True) +PAsData.1 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.equality.uplc.golden b/plutarch-test/goldens/pisdata.equality.uplc.golden new file mode 100644 index 000000000..d0755c998 --- /dev/null +++ b/plutarch-test/goldens/pisdata.equality.uplc.golden @@ -0,0 +1,4 @@ +PData.1 (program 1.0.0 ((\i0 -> equalsData i1 i1) #9fd87a9f00ffff)) +PData.2 (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) (equalsData #d87980 #182a))) +PAsData.1 (program 1.0.0 (equalsData (iData 42) (iData 42))) +PAsData.1 (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) (equalsData (bData #12) (bData #ab)))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index 5de768906..f46fe65e3 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -8,12 +8,13 @@ import Plutus.V1.Ledger.Api import qualified Plutus.V1.Ledger.Interval as Interval import qualified Plutus.V1.Ledger.Value as Value +import Plutarch (popaque) import Plutarch.Api.V1 ( PCredential, PCurrencySymbol, PPubKeyHash, PScriptContext, - PScriptPurpose (PSpending), + PScriptPurpose (PMinting, PSpending), PTxInInfo, PTxInfo, PValue, @@ -37,6 +38,13 @@ spec = do plift p @?= [toData validator] "sym" @| pfromData (getSym #$ pfromData $ getMint #$ getTxInfo # ctx) @-> \p -> plift p @?= sym + "ScriptPurpose" @\ do + "literal" @| pconstant @PScriptPurpose (Minting dummyCurrency) + "decode" + @| pmatch (pconstant @PScriptPurpose (Minting dummyCurrency)) + $ \case + PMinting c -> popaque c + _ -> perror describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. @@ -190,3 +198,6 @@ checkSignatoryTermCont = plam $ \ph ctx' -> unTermCont $ do getFields :: Term s (PData :--> PBuiltinList PData) getFields = phoistAcyclic $ plam $ \addr -> psndBuiltin #$ pasConstr # addr + +dummyCurrency :: CurrencySymbol +dummyCurrency = Value.currencySymbol "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" diff --git a/plutarch-test/src/Plutarch/PIsDataSpec.hs b/plutarch-test/src/Plutarch/PIsDataSpec.hs index f438c99c1..befe64418 100644 --- a/plutarch-test/src/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/src/Plutarch/PIsDataSpec.hs @@ -34,6 +34,22 @@ spec = do propertySet @PBool "PBool" propertySet @PInteger "PInteger" propertySet @PUnit "PUnit" + describe "equality" . pgoldenSpec $ do + "PData" @\ do + "1" + @| (let dat = pconstant @PData (PlutusTx.List [PlutusTx.Constr 1 [PlutusTx.I 0]]) in dat #== dat) + @-> passert + "2" + @| (pnot #$ pconstant @PData (PlutusTx.Constr 0 []) #== pconstant @PData (PlutusTx.I 42)) + @-> passert + "PAsData" @\ do + "1" + @| let dat = pdata @PInteger 42 + in dat #== dat + @-> passert + "1" + @| (pnot #$ pdata (phexByteStr "12") #== pdata (phexByteStr "ab")) + @-> passert describe "ppair" . pgoldenSpec $ do -- pfromData (pdata (I 1, B 0x41)) ≡ (I 1, I A) "simple" diff --git a/plutarch.cabal b/plutarch.cabal index 2d2d19ac0..b122c2c44 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -150,37 +150,3 @@ library if flag(development) cpp-options: -DDevelopment - --- Everything below this line is deleted for GHC 8.10 - -test-suite examples - import: c - type: exitcode-stdio-1.0 - main-is: Main.hs - hs-source-dirs: examples - default-extensions: - OverloadedRecordDot - QualifiedDo - - other-modules: Utils - build-depends: - , base - , bytestring - , generics-sop - , plutarch - , plutus-core - , plutus-ledger-api - , plutus-tx - , rank2classes >=1.4.4 - , serialise - , tasty - , tasty-golden - , tasty-hunit - , text - , transformers - - --, shrinker - if flag(development) - cpp-options: -DDevelopment - - ghc-options: -Wwarn=deprecations From 8bca4e38e0f4e3c77b3de69adb700c47a651110d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 17:07:32 -0500 Subject: [PATCH 089/584] Mention Plutarch.Test in changelog --- CHANGELOG.md | 2 ++ plutarch-test/src/Plutarch/PIsDataSpec.hs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f1e1e9d0..c5af2fe9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,8 @@ Added by: [#235](https://github.com/Plutonomicon/plutarch/pull/270) +- Add `Plutarch.Test` for testing Plutarch code with goldens for UPLC printing and Plutus benchmarks. + # 1.1.0 - General repository changes. diff --git a/plutarch-test/src/Plutarch/PIsDataSpec.hs b/plutarch-test/src/Plutarch/PIsDataSpec.hs index befe64418..9e48ddc1d 100644 --- a/plutarch-test/src/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/src/Plutarch/PIsDataSpec.hs @@ -7,7 +7,7 @@ import Data.Text.Encoding (encodeUtf8) import Data.String (fromString) import qualified GHC.Generics as GHC -import Generics.SOP +import Generics.SOP (Generic, I (I)) import Plutus.V1.Ledger.Api ( Address (Address), Credential (PubKeyCredential, ScriptCredential), From ab1621a73325ef5784bae877b6c8520497a897d1 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 23 Feb 2022 17:11:23 -0500 Subject: [PATCH 090/584] Remove redundant nix code --- flake.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 0a21e2800..fc5099c63 100644 --- a/flake.nix +++ b/flake.nix @@ -462,16 +462,12 @@ let pkgs = nixpkgsFor system; in let pkgs' = nixpkgsFor' system; in let pkgSet = (nixpkgsFor system).haskell-nix.cabalProject' ({ - # This is truly a horrible hack but is necessary. We can't disable tests otherwise in haskell.nix. + # This is truly a horrible hack but is necessary for sydtest-discover to work. src = if ghcName == ghcVersion then ./. else pkgs.runCommand "fake-src" { } '' - cp -rT ${./.} $out - chmod u+w $out $out/plutarch.cabal - # Remove stanzas from .cabal that won't work in GHC 8.10 - sed -i '/-- Everything below this line is deleted for GHC 8.10/,$d' $out/plutarch.cabal - # Prevent `sydtest-discover` from using GHC9 only modules when building with GHC810 # https://github.com/NorfairKing/sydtest/blob/master/sydtest-discover/src/Test/Syd/Discover.hs + cp -rT ${./.} $out chmod -R u+w $out/plutarch-test rm -f $out/plutarch-test/src/Plutarch/MonadicSpec.hs rm -f $out/plutarch-test/src/Plutarch/FieldSpec.hs From f44303264912ad52f27a5975a4e0eb469250ddf7 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Thu, 24 Feb 2022 21:09:38 +0100 Subject: [PATCH 091/584] wip #303: - add a full test - corrected a litte something in Verify.hs --- Plutarch/Verify.hs | 27 +-- .../verification_untrusted_data.bench.golden | 15 +- ...rification_untrusted_data.uplc.eval.golden | 3 +- .../verification_untrusted_data.uplc.golden | 15 +- plutarch-test/src/Plutarch/ApiSpec.hs | 2 +- plutarch-test/src/Plutarch/VerifySpec.hs | 192 +++++++++++++++++- 6 files changed, 215 insertions(+), 39 deletions(-) diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index d028301d8..10ffdb0b9 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -12,6 +12,8 @@ import Plutarch.Builtin ( PBuiltinPair, PData, PIsData (pfromData), + pasByteStr, + pasInt, pdata, pforgetData, pfstBuiltin, @@ -32,7 +34,6 @@ import Plutarch.Internal.Other ( ) import Plutarch.List (pmap) -import Plutarch.Lift (PLift) import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) import qualified PlutusCore as PLC @@ -43,13 +44,13 @@ import qualified PlutusCore as PLC representation. -} class PTryFrom (a :: PType) where - ptryFrom :: Term s (PData :--> a) + ptryFrom :: Term s (PData :--> PAsData a) instance PTryFrom PInteger where - ptryFrom = punsafeBuiltin PLC.UnIData + ptryFrom = plam $ pdata . (pasInt #) instance PTryFrom PByteString where - ptryFrom = punsafeBuiltin PLC.UnBData + ptryFrom = plam $ pdata . (pasByteStr #) {- | Note: PAsData POpaque ~ PData @@ -70,7 +71,7 @@ instance PTryFrom (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) where ppairDataBuiltin # (pfstBuiltin # tup) # (psndBuiltin # tup) - in chk + in pdata $ chk {- | This deeply checks the Datastructure for validity. @@ -80,20 +81,20 @@ instance PTryFrom (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) where PTryFrom) -} class PTryFromRecur (a :: PType) where - ptryFromRecur :: Term s (PData :--> a) + ptryFromRecur :: Term s (PData :--> PAsData a) instance PTryFromRecur PInteger where - ptryFromRecur = punsafeBuiltin PLC.UnIData + ptryFromRecur = plam $ pdata . (pasInt #) instance PTryFromRecur PByteString where - ptryFromRecur = punsafeBuiltin PLC.UnBData + ptryFromRecur = plam $ pdata . (pasByteStr #) -instance (PTryFromRecur a, PLift a, PIsData a) => PTryFromRecur (PBuiltinList (PAsData a)) where +instance (PTryFromRecur a, PIsData a) => PTryFromRecur (PBuiltinList (PAsData a)) where ptryFromRecur = phoistAcyclic $ plam $ \opq -> let lst :: Term _ (PBuiltinList (PAsData PData)) lst = punsafeBuiltin PLC.UnListData #$ opq - in pmap # (plam $ \e -> pdata $ ptryFromRecur @a #$ pfromData e) # lst + in pdata $ pmap # (plam $ \e -> ptryFromRecur @a #$ pfromData e) # lst instance (PTryFromRecur a, PIsData a, PTryFromRecur b, PIsData b) => PTryFromRecur (PBuiltinPair (PAsData a) (PAsData b)) where ptryFromRecur = phoistAcyclic $ @@ -101,7 +102,7 @@ instance (PTryFromRecur a, PIsData a, PTryFromRecur b, PIsData b) => PTryFromRec let tup :: Term _ (PBuiltinPair (PAsData _) (PAsData _)) tup = pfromData $ punsafeCoerce opq fst :: Term _ (PAsData a) - fst = pdata $ ptryFromRecur @a #$ pforgetData $ pfstBuiltin # tup + fst = ptryFromRecur @a #$ pforgetData $ pfstBuiltin # tup snd :: Term _ (PAsData b) - snd = pdata $ ptryFromRecur @b #$ pforgetData $ psndBuiltin # tup - in ppairDataBuiltin # fst # snd + snd = ptryFromRecur @b #$ pforgetData $ psndBuiltin # tup + in pdata $ ppairDataBuiltin # fst # snd diff --git a/plutarch-test/goldens/verification_untrusted_data.bench.golden b/plutarch-test/goldens/verification_untrusted_data.bench.golden index 3769c2ec5..772069ba2 100644 --- a/plutarch-test/goldens/verification_untrusted_data.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.bench.golden @@ -1,7 +1,8 @@ -erroneous.int /= bytestring {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":16} -erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":102} -erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":85} -working.int == int {"exBudgetCPU":448965,"exBudgetMemory":664,"scriptSizeBytes":11} -working.(String, String) == (String, String) {"exBudgetCPU":7384676,"exBudgetMemory":12164,"scriptSizeBytes":102} -working.(POpaque, POpaque) == (POpaque, POpaque) {"exBudgetCPU":6216719,"exBudgetMemory":11072,"scriptSizeBytes":88} -working.[String] == [String] {"exBudgetCPU":6809909,"exBudgetMemory":14008,"scriptSizeBytes":94} \ No newline at end of file +erroneous.int /= bytestring {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":22} +erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":116} +erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":89} +working.int == int {"exBudgetCPU":957376,"exBudgetMemory":1428,"scriptSizeBytes":17} +working.(String, String) == (String, String) {"exBudgetCPU":10553099,"exBudgetMemory":17616,"scriptSizeBytes":116} +working.(POpaque, POpaque) == (POpaque, POpaque) {"exBudgetCPU":9206504,"exBudgetMemory":15924,"scriptSizeBytes":97} +working.[String] == [String] {"exBudgetCPU":7229001,"exBudgetMemory":14472,"scriptSizeBytes":98} +example.concatenate two lists {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":241} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden index 246c35ffe..0e459dd10 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden @@ -4,4 +4,5 @@ erroneous.[String] /= [Integer] (program 1.0.0 error) working.int == int (program 1.0.0 42) working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) working.(POpaque, POpaque) == (POpaque, POpaque) (program 1.0.0 (#d87980, #d87980)) -working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) \ No newline at end of file +working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) +example.concatenate two lists (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.golden index f1fae4c89..d0a6a91fe 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.golden @@ -1,7 +1,8 @@ -erroneous.int /= bytestring (program 1.0.0 (unIData (bData #666f6f))) -erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (iData (unIData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) -erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> bData (unBData i1)) (unListData i1)) (listData (i1 (iData 3) ((\i0 -> i2 i1 i3) (iData 4))))) (force mkCons)) [ ])) -working.int == int (program 1.0.0 (unIData (iData 42))) -working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (bData (unBData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) -working.(POpaque, POpaque) == (POpaque, POpaque) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (i5 (i2 i1)) (i7 (i2 i1))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData i7 i7))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair))) #d87980)) -working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> bData (unBData i1)) (unListData i1)) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172))))) (force mkCons)) [ ])) \ No newline at end of file +erroneous.int /= bytestring (program 1.0.0 (unIData ((\i0 -> iData (unIData i1)) (bData #666f6f)))) +erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> i5 (mkPairData ((\i0 -> iData (unIData i1)) (i6 (i2 i1))) ((\i0 -> bData (unBData i1)) (i8 (i2 i1))))) (i4 (mkPairData (bData #666f6f) (bData #626172))))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) +erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> unListData ((\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> bData (unBData i1)) (unListData i1))) (listData (i1 (iData 3) ((\i0 -> i2 i1 i3) (iData 4)))))) (force mkCons)) [ ])) +working.int == int (program 1.0.0 (unIData ((\i0 -> iData (unIData i1)) (iData 42)))) +working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> i5 (mkPairData ((\i0 -> bData (unBData i1)) (i6 (i2 i1))) ((\i0 -> bData (unBData i1)) (i8 (i2 i1))))) (i4 (mkPairData (bData #666f6f) (bData #626172))))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) +working.(POpaque, POpaque) == (POpaque, POpaque) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> i5 (mkPairData (i6 (i2 i1)) (i8 (i2 i1)))) (i4 (mkPairData i9 i9)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #d87980)) +working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> unListData ((\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> bData (unBData i1)) (unListData i1))) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))))) (force mkCons)) [ ])) +example.concatenate two lists (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> error) (listData (i1 (iData 1) (i1 (iData 2) (i1 (iData 3) (i1 (iData 4) (i1 (iData 5) i2)))))) (listData (i1 (iData 6) (i1 (iData 7) (i1 (iData 8) (i1 (iData 9) (i1 (iData 10) i2)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index 5de768906..2189fdb31 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -1,4 +1,4 @@ -module Plutarch.ApiSpec (spec, ctx) where +module Plutarch.ApiSpec (spec, ctx, info, purpose) where import Test.Syd import Test.Tasty.HUnit diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/VerifySpec.hs index 40b580709..57076b215 100644 --- a/plutarch-test/src/Plutarch/VerifySpec.hs +++ b/plutarch-test/src/Plutarch/VerifySpec.hs @@ -1,11 +1,36 @@ +{-# LANGUAGE UndecidableInstances #-} + module Plutarch.VerifySpec (spec) where import Test.Syd +import Plutus.V1.Ledger.Api ( + Datum (Datum), + DatumHash, + ScriptContext (ScriptContext), + ToData (toBuiltinData), + TxInfo (txInfoData), + ) + import Plutarch -import Plutarch.Builtin (pforgetData, ppairDataBuiltin) +import Plutarch.Api.V1 ( + PDatum, + PDatumHash, + PMaybeData (PDJust), + PScriptContext, + PScriptPurpose (PSpending), + PTuple, + PTxInInfo, + PTxOutRef, + PValidator, + ) +import Plutarch.Bool (pif') +import Plutarch.Builtin ( + pasInt, + pforgetData, + ppairDataBuiltin, + ) import Plutarch.Prelude -import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin) import Plutarch.Verify ( PTryFrom (ptryFrom), @@ -13,6 +38,9 @@ import Plutarch.Verify ( ) import qualified PlutusCore as PLC +import Plutarch.ApiSpec (info, purpose) +import Plutarch.Test + spec :: Spec spec = do describe "verification_untrusted_data" . pgoldenSpec $ do @@ -60,25 +88,169 @@ spec = do @(PBuiltinList (PAsData PByteString)) ((pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) @-> psucceeds + "example" @\ do + let validContext = ctx validList1 + l1 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) + l1 = toDatadList [1 .. 5] + l2 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) + l2 = toDatadList [6 .. 10] + "concatenate two lists" + @| validator # pforgetData l1 # pforgetData l2 # validContext @-> psucceeds checkShallow :: forall (target :: PType) (actual :: PType). - (PTryFrom target, PIsData actual) => + ( PTryFrom target + , PIsData actual + , PIsData target + ) => ClosedTerm actual -> ClosedTerm target checkShallow = reprTargetActual ptryFrom checkDeep :: forall (target :: PType) (actual :: PType). - (PTryFromRecur target, PIsData actual) => + ( PTryFromRecur target + , PIsData actual + , PIsData target + ) => ClosedTerm actual -> ClosedTerm target -checkDeep = reprTargetActual ptryFromRecur +checkDeep = reprTargetActual (ptryFromRecur) reprTargetActual :: forall (target :: PType) (actual :: PType). - (PIsData actual) => - ClosedTerm (PData :--> target) -> - ClosedTerm actual -> - ClosedTerm target -reprTargetActual f x = f #$ pforgetData $ pdata x + ( PIsData actual + , PIsData target + ) => + ClosedTerm (PData :--> PAsData target) -> + ClosedTerm (actual) -> + ClosedTerm (target) +reprTargetActual f x = pfromData $ f #$ pforgetData $ pdata x + +-- example: untrusted redeemer + +newtype PNatural (s :: S) = PMkNatural (Term s PInteger) + deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PNatural PInteger) + +-- | partial +pmkNatural :: Term s (PInteger :--> PNatural) +pmkNatural = plam $ \i -> pif' # (i #< 0) # perror # (pcon $ PMkNatural i) + +{- | total + pmaybeMkNatural :: Term s (PInteger :--> PMaybe PNatural) + pmaybeMkNatural = plam $ \i -> pif' # (i #< 0) # pcon PNothing # (pcon $ PJust $ pcon $ PMkNatural i) +-} +instance PTryFromRecur PNatural where + ptryFromRecur = plam $ \opq -> unTermCont $ do + let i :: Term _ PInteger + i = pasInt # opq + pure $ pdata $ pmkNatural # i + +validator :: Term s PValidator +validator = phoistAcyclic $ + plam $ \dat red ctx -> unTermCont $ do + -- untrusted ---^---^ ^--- trusted + let trustedRedeemer :: Term _ (PBuiltinList (PAsData PNatural)) + trustedRedeemer = pfromData $ ptryFromRecur # red + trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) + trustedDatum = pfromData $ ptryFromRecur # dat + -- make the Datm and Redeemer trusted + + ownHash :: Term _ PDatumHash + ownHash = unTermCont $ do + PJust ownInput <- tcont $ pmatch $ pfindOwnInput # ctx + let maybeHash :: Term _ (PMaybeData PDatumHash) + maybeHash = pfield @"datumHash" #$ pfield @"resolved" #$ (pfromData ownInput) + PDJust datumHash <- tcont $ pmatch maybeHash + pure $ pfield @"_0" # datumHash + -- find own script adress matching DatumHash + + outputs :: Term _ (PBuiltinList (PAsData (PTuple PDatumHash PDatum))) + outputs = pfield @"data" #$ pfield @"txInfo" # ctx + -- find the list of the outputs + + matchingHashDatum :: Term _ (PBuiltinList PDatum) + matchingHashDatum = + precList + ( \self x xs -> unTermCont $ do + tup <- tcont $ pletFields @["_0", "_1"] x + pure $ + pif + (hrecField @"_0" tup #== ownHash) + (pcons # (hrecField @"_1" tup) # (self # xs)) + (self # xs) + ) + (const pnil) + #$ outputs + -- filter and map at the same time, as there is no efficient way + -- to do that with tools available, I wrote it by hand + + singleOutput :: Term _ PDatum + singleOutput = + pif' # (pnull #$ ptail # matchingHashDatum) + # (phead # matchingHashDatum) + # perror + -- make sure that after filtering the outputs, only one output + -- remains + + resultList :: Term _ (PAsData (PBuiltinList (PAsData PNatural))) + resultList = pdata $ pconcat # trustedDatum # trustedRedeemer + -- the resulting list with trusted datum and trusted redeemer + + isValid :: Term _ PBool + isValid = (pto singleOutput) #== pforgetData resultList + -- the final check for validity + pure $ + pif' # isValid # (popaque $ pcon PUnit) # perror + +pfindOwnInput :: Term s (PScriptContext :--> PMaybe (PAsData PTxInInfo)) +pfindOwnInput = phoistAcyclic $ + plam $ \ctx' -> unTermCont $ do + ctx <- tcont $ pletFields @["txInfo", "purpose"] ctx' + PSpending txoutRef <- tcont $ pmatch $ hrecField @"purpose" ctx + let txInInfos :: Term _ (PBuiltinList (PAsData PTxInInfo)) + txInInfos = pfield @"inputs" #$ hrecField @"txInfo" ctx + target :: Term _ PTxOutRef + target = pfield @"_0" # txoutRef + pred :: Term _ (PAsData PTxInInfo :--> PBool) + pred = plam $ \actual -> + (pfield @"id" # target) #== (pfield @"id" #$ pfield @"outRef" # pfromData actual) + pure $ pfind # pred # txInInfos + +{- | + can be safely removed after + https://github.com/Plutonomicon/plutarch/pull/274 + has been merged +-} +pfind :: (PIsListLike l a) => Term s ((a :--> PBool) :--> l a :--> PMaybe a) +pfind = phoistAcyclic $ + pfix #$ plam $ \self f xs -> + pelimList + ( \y ys -> + pif + (f # y) + (pcon $ PJust y) + (self # f # ys) + ) + (pcon PNothing) + xs + +-- Mocking a transaction + +ctx :: [(DatumHash, Datum)] -> Term s PScriptContext +ctx l = pconstant (ScriptContext (info' l) purpose) + +info' :: [(DatumHash, Datum)] -> TxInfo +info' dat = info {txInfoData = dat} + +validList1 :: [(DatumHash, Datum)] +validList1 = + let dat :: Datum + dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] + in [("d0", dat)] + +toDatadList :: [Integer] -> Term s (PAsData (PBuiltinList (PAsData PInteger))) +toDatadList = pdata . (foldr go pnil) + where + go :: Integer -> Term _ (PBuiltinList (PAsData PInteger)) -> Term _ (PBuiltinList (PAsData PInteger)) + go i acc = pcons # (pdata $ pconstant i) # acc From 8a807ce4397dd7ec485c70d5534e1d28f7c8200b Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 25 Feb 2022 02:51:22 +0300 Subject: [PATCH 092/584] Make puncons, punsafeUncons functions --- Plutarch/List.hs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Plutarch/List.hs b/Plutarch/List.hs index ba09ad1d9..c5a621200 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -17,6 +17,10 @@ module Plutarch.List ( -- * Construction psingleton, + -- * Deconstruction + puncons, + punsafeUncons, + -- * Combine pconcat, pzipWith, @@ -67,6 +71,7 @@ import Plutarch.Bool (PBool (PFalse, PTrue), PEq, pif, (#&&), (#==), (#||)) import Plutarch.Integer (PInteger) import Plutarch.Lift (pconstant) import Plutarch.Pair (PPair (PPair)) +import Plutarch.Maybe (PMaybe (PJust,PNothing)) import Data.Kind @@ -133,6 +138,20 @@ pconvertLists = phoistAcyclic $ (\x xs -> pcons # x #$ self # xs) pnil +-- | Extract head and tail of the list, throws error if list is empty. +punsafeUncons :: + PIsListLike list a => + Term s (list a) -> + Term s (PPair a (list a)) +punsafeUncons = pelimList (\x -> pcon . PPair x) perror + +-- | Extract head and tail of the list, if list is not empty. +puncons :: + PIsListLike list a => + Term s (list a) -> + Term s (PMaybe (PPair a (list a))) +puncons = pelimList (\x -> pcon . PJust . pcon . PPair x) (pcon PNothing) + -- | Like 'pelimList', but with a fixpoint recursion hatch. precList :: PIsListLike list a => From 190a87198fa8d8a5c0056a77016a76f1387764b8 Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 25 Feb 2022 02:53:11 +0300 Subject: [PATCH 093/584] Make CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f1e1e9d0..bbddefb58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Revision history for plutarch # Unreleased +- Add `puncons` and `punsafeUncons` functions for deconstructing list. - `TermCont`: Parametrize by result type; add `MonadFail` instance; etc. From dd3a786aebcc6e6092dad1614bca698bef5dfe27 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 25 Feb 2022 20:14:22 +0100 Subject: [PATCH 094/584] wip #303: - restructured the Verify classes and documented it a bit better - adjusted the tests and correcte what was not working --- Plutarch/Verify.hs | 184 +++++++++++++----- .../verification_untrusted_data.bench.golden | 15 +- ...rification_untrusted_data.uplc.eval.golden | 5 +- .../verification_untrusted_data.uplc.golden | 15 +- plutarch-test/src/Plutarch/VerifySpec.hs | 113 ++++++----- 5 files changed, 203 insertions(+), 129 deletions(-) diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index 10ffdb0b9..63c8fde1a 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -1,8 +1,17 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE FunctionalDependencies #-} +{-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-} {-# OPTIONS_GHC -Wredundant-constraints #-} module Plutarch.Verify ( PTryFrom (ptryFrom), - PTryFromRecur (ptryFromRecur), + PDepth (PDeep, PShallow), + pcheckType, + pcheckByteStr, + pcheckInt, + pcheckList, + pcheckMap, ) where import Plutarch.Builtin ( @@ -12,8 +21,6 @@ import Plutarch.Builtin ( PBuiltinPair, PData, PIsData (pfromData), - pasByteStr, - pasInt, pdata, pforgetData, pfstBuiltin, @@ -26,83 +33,154 @@ import Plutarch.Internal.Other ( POpaque, PType, Term, + perror, + pforce, phoistAcyclic, plam, (#), (#$), type (:-->), ) + +import Plutarch.Bool (pif, (#==)) + import Plutarch.List (pmap) import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) import qualified PlutusCore as PLC -{- | - Each POpaque can be of any representation as it represents - the universe of Types. With PTryFrom we establish trust - in the Data by verifying the requested type matches its - representation. --} -class PTryFrom (a :: PType) where - ptryFrom :: Term s (PData :--> PAsData a) - -instance PTryFrom PInteger where - ptryFrom = plam $ pdata . (pasInt #) - -instance PTryFrom PByteString where - ptryFrom = plam $ pdata . (pasByteStr #) - {- | Note: PAsData POpaque ~ PData -} -instance PTryFrom (PBuiltinList PData) where - ptryFrom = punsafeBuiltin PLC.UnListData -instance PTryFrom (PBuiltinMap POpaque POpaque) where - ptryFrom = punsafeBuiltin PLC.UnMapData - -instance PTryFrom (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) where - ptryFrom = phoistAcyclic $ - plam $ \opq -> - let tup :: Term _ (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) - tup = pfromData $ punsafeCoerce opq - chk :: Term _ (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) - chk = - ppairDataBuiltin - # (pfstBuiltin # tup) - # (psndBuiltin # tup) - in pdata $ chk +----------------------- The class PTryFrom ---------------------------------------------- {- | - This deeply checks the Datastructure for validity. + This checks the datastructure for validity. + Be aware that if called with `PDeep`, it will in + most cases will at least be slightly more expensive Be aware this might get really expensive, so only use it if you cannot establish trust otherwise (e.g. via only checking a part of your Data with PTryFrom) -} -class PTryFromRecur (a :: PType) where - ptryFromRecur :: Term s (PData :--> PAsData a) +class PTryFrom (d :: PDepth) (a :: PType) (b :: PType) where + -- this is the "safest" type --^ ^-- this is the target type + ptryFrom :: Term s (a :--> b) + +----------------------- Polymorphic instances ------------------------------------------- + +instance PTryFrom a PData (PAsData PInteger) where + ptryFrom = pcheckInt -instance PTryFromRecur PInteger where - ptryFromRecur = plam $ pdata . (pasInt #) +instance PTryFrom a PData (PAsData PByteString) where + ptryFrom = pcheckByteStr -instance PTryFromRecur PByteString where - ptryFromRecur = plam $ pdata . (pasByteStr #) +----------------------- PDeep PData instances ------------------------------------------- -instance (PTryFromRecur a, PIsData a) => PTryFromRecur (PBuiltinList (PAsData a)) where - ptryFromRecur = phoistAcyclic $ +data PDepth + = PDeep + | PShallow + +{- +instance {-# OVERLAPPING #-} PTryFrom PDeep PData PData where + ptryFrom = plam id +-} + +instance {-# OVERLAPPING #-} PTryFrom PDeep PData (PAsData (PBuiltinList PData)) where + ptryFrom = pcheckList + +instance {-# OVERLAPPING #-} PTryFrom PDeep PData (PAsData (PBuiltinMap PData PData)) where + ptryFrom = pcheckMap + +instance + {-# OVERLAPPABLE #-} + ( PTryFrom PDeep PData a + , a ~ PAsData b + , PIsData b + ) => + PTryFrom PDeep PData (PAsData (PBuiltinList a)) + where + ptryFrom = phoistAcyclic $ plam $ \opq -> - let lst :: Term _ (PBuiltinList (PAsData PData)) - lst = punsafeBuiltin PLC.UnListData #$ opq - in pdata $ pmap # (plam $ \e -> ptryFromRecur @a #$ pfromData e) # lst + let lst :: Term _ (PBuiltinList a) + lst = punsafeBuiltin PLC.UnListData # opq + in pdata $ pmap # (plam $ \e -> ptryFrom @PDeep @PData @a #$ pforgetData e) # lst -instance (PTryFromRecur a, PIsData a, PTryFromRecur b, PIsData b) => PTryFromRecur (PBuiltinPair (PAsData a) (PAsData b)) where - ptryFromRecur = phoistAcyclic $ +instance + {-# OVERLAPPABLE #-} + ( PTryFrom PDeep PData a + , a ~ PAsData a' + , PIsData a' + , PTryFrom PDeep PData b + , b ~ PAsData b' + , PIsData b' + ) => + PTryFrom PDeep PData (PAsData (PBuiltinPair a b)) + where + ptryFrom = phoistAcyclic $ plam $ \opq -> - let tup :: Term _ (PBuiltinPair (PAsData _) (PAsData _)) + let tup :: Term _ (PBuiltinPair a b) tup = pfromData $ punsafeCoerce opq - fst :: Term _ (PAsData a) - fst = ptryFromRecur @a #$ pforgetData $ pfstBuiltin # tup - snd :: Term _ (PAsData b) - snd = ptryFromRecur @b #$ pforgetData $ psndBuiltin # tup + fst :: Term _ a + fst = ptryFrom @PDeep @PData @a #$ pforgetData $ pfstBuiltin # tup + snd :: Term _ b + snd = ptryFrom @PDeep @PData @b #$ pforgetData $ psndBuiltin # tup in pdata $ ppairDataBuiltin # fst # snd + +----------------------- PDeep POpaque instances ----------------------------------------- + +{- | + for none of the opaque instances it can be verified + that the actual structure is what it says to be + because that data is lost when the PAsData wrapper + is removed, this can only be safely used if you obtained + your POpaque safely +-} +instance + ( PTryFrom PDeep PData (PAsData a) + , PIsData a + ) => + PTryFrom PDeep POpaque a + where + ptryFrom = phoistAcyclic $ + plam $ \opq -> + let prop :: Term _ a + prop = punsafeCoerce opq + in pfromData $ ptryFrom @PDeep @PData @(PAsData a) #$ pforgetData $ pdata prop + +----------------------- PShallow PData instances ---------------------------------------- + +instance PTryFrom PShallow PData (PAsData (PBuiltinList PData)) where + ptryFrom = pcheckList + +instance PTryFrom PShallow PData (PAsData (PBuiltinMap PData PData)) where + ptryFrom = pcheckMap + +instance PTryFrom PShallow PData PData where + ptryFrom = plam id + +-- PShallow POpaque instances wouldn't make sense as that wouldn't do any verifying at all + +----------------------- Helper functions ------------------------------------------------ + +pchooseData :: Term s (PData :--> a :--> a :--> a :--> a :--> a :--> a) +pchooseData = phoistAcyclic $ pforce $ punsafeBuiltin PLC.ChooseData + +pcheckType :: (Term s PInteger) -> Term _ (PData :--> PAsData b) +pcheckType i = plam $ \d -> + let con :: Term _ PInteger + con = pchooseData # d # 0 # 1 # 2 # 3 # 4 + in pif (con #== i) (punsafeCoerce d) perror + +pcheckMap :: Term s (PData :--> PAsData (PBuiltinMap PData PData)) +pcheckMap = pcheckType 1 + +pcheckList :: Term s (PData :--> PAsData (PBuiltinList PData)) +pcheckList = pcheckType 2 + +pcheckInt :: Term s (PData :--> PAsData PInteger) +pcheckInt = pcheckType 3 + +pcheckByteStr :: Term s (PData :--> PAsData PByteString) +pcheckByteStr = pcheckType 4 diff --git a/plutarch-test/goldens/verification_untrusted_data.bench.golden b/plutarch-test/goldens/verification_untrusted_data.bench.golden index 772069ba2..0a87f92bc 100644 --- a/plutarch-test/goldens/verification_untrusted_data.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.bench.golden @@ -1,8 +1,7 @@ -erroneous.int /= bytestring {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":22} -erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":116} -erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":89} -working.int == int {"exBudgetCPU":957376,"exBudgetMemory":1428,"scriptSizeBytes":17} -working.(String, String) == (String, String) {"exBudgetCPU":10553099,"exBudgetMemory":17616,"scriptSizeBytes":116} -working.(POpaque, POpaque) == (POpaque, POpaque) {"exBudgetCPU":9206504,"exBudgetMemory":15924,"scriptSizeBytes":97} -working.[String] == [String] {"exBudgetCPU":7229001,"exBudgetMemory":14472,"scriptSizeBytes":98} -example.concatenate two lists {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":241} \ No newline at end of file +erroneous.int /= bytestring {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":45} +erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":171} +erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":115} +working.int == int {"exBudgetCPU":1390705,"exBudgetMemory":3366,"scriptSizeBytes":40} +working.(String, String) == (String, String) {"exBudgetCPU":12047260,"exBudgetMemory":22656,"scriptSizeBytes":171} +working.[String] == [String] {"exBudgetCPU":8604070,"exBudgetMemory":19112,"scriptSizeBytes":124} +example.concatenate two lists {"exBudgetCPU":66205381,"exBudgetMemory":127091,"scriptSizeBytes":644} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden index 0e459dd10..d691c6a76 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden @@ -1,8 +1,7 @@ erroneous.int /= bytestring (program 1.0.0 error) erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) erroneous.[String] /= [Integer] (program 1.0.0 error) -working.int == int (program 1.0.0 42) +working.int == int (program 1.0.0 #182a) working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) -working.(POpaque, POpaque) == (POpaque, POpaque) (program 1.0.0 (#d87980, #d87980)) working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) -example.concatenate two lists (program 1.0.0 error) \ No newline at end of file +example.concatenate two lists (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.golden index d0a6a91fe..8c8577601 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.golden @@ -1,8 +1,7 @@ -erroneous.int /= bytestring (program 1.0.0 (unIData ((\i0 -> iData (unIData i1)) (bData #666f6f)))) -erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> i5 (mkPairData ((\i0 -> iData (unIData i1)) (i6 (i2 i1))) ((\i0 -> bData (unBData i1)) (i8 (i2 i1))))) (i4 (mkPairData (bData #666f6f) (bData #626172))))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) -erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> unListData ((\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> bData (unBData i1)) (unListData i1))) (listData (i1 (iData 3) ((\i0 -> i2 i1 i3) (iData 4)))))) (force mkCons)) [ ])) -working.int == int (program 1.0.0 (unIData ((\i0 -> iData (unIData i1)) (iData 42)))) -working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> i5 (mkPairData ((\i0 -> bData (unBData i1)) (i6 (i2 i1))) ((\i0 -> bData (unBData i1)) (i8 (i2 i1))))) (i4 (mkPairData (bData #666f6f) (bData #626172))))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) -working.(POpaque, POpaque) == (POpaque, POpaque) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> i5 (mkPairData (i6 (i2 i1)) (i8 (i2 i1)))) (i4 (mkPairData i9 i9)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #d87980)) -working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> unListData ((\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> bData (unBData i1)) (unListData i1))) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))))) (force mkCons)) [ ])) -example.concatenate two lists (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> error) (listData (i1 (iData 1) (i1 (iData 2) (i1 (iData 3) (i1 (iData 4) (i1 (iData 5) i2)))))) (listData (i1 (iData 6) (i1 (iData 7) (i1 (iData 8) (i1 (iData 9) (i1 (iData 10) i2)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force mkCons)) [ ])) \ No newline at end of file +erroneous.int /= bytestring (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (bData #666f6f))) +erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 ((\i0 -> i8 (mkPairData ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 3) (delay i1) (delay error))) (i9 (i5 i1))) ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i11 (i5 i1))))) (i7 i1))) (mkPairData (bData #666f6f) (bData #626172))) (force ifThenElse)) (force chooseData)) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) +erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> unListData ((\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 4) (delay i1) (delay error))) (unListData i1))) (listData i1))) (i1 (iData 3) ((\i0 -> i2 i1 i3) (iData 4)))) (force mkCons)) [ ])) +working.int == int (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (iData 42))) +working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 ((\i0 -> i8 (mkPairData ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i9 (i5 i1))) ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i11 (i5 i1))))) (i7 i1))) (mkPairData (bData #666f6f) (bData #626172))) (force ifThenElse)) (force chooseData)) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) +working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> unListData ((\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 4) (delay i1) (delay error))) (unListData i1))) (listData i1))) (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))) (force mkCons)) [ ])) +example.concatenate two lists (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 7) (i12 (iData 8) (i12 (iData 9) (i12 (iData 10) i13)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/VerifySpec.hs index 57076b215..e52ab836b 100644 --- a/plutarch-test/src/Plutarch/VerifySpec.hs +++ b/plutarch-test/src/Plutarch/VerifySpec.hs @@ -24,19 +24,16 @@ import Plutarch.Api.V1 ( PTxOutRef, PValidator, ) -import Plutarch.Bool (pif') import Plutarch.Builtin ( pasInt, pforgetData, ppairDataBuiltin, ) import Plutarch.Prelude -import Plutarch.Unsafe (punsafeBuiltin) import Plutarch.Verify ( PTryFrom (ptryFrom), - PTryFromRecur (ptryFromRecur), + PDepth (PShallow, PDeep), ) -import qualified PlutusCore as PLC import Plutarch.ApiSpec (info, purpose) import Plutarch.Test @@ -49,7 +46,7 @@ spec = do @| checkShallow @PInteger @PByteString - (pconstant "foo") + (pdata $ pconstant "foo") @-> pfails "(String, Integer) /= (String, String)" @| checkDeep @@ -65,7 +62,7 @@ spec = do @-> pfails "working" @\ do "int == int" - @| checkShallow @PInteger @PInteger (pconstant 42) + @| checkShallow @PInteger @PInteger (pdata $ pconstant 42) @-> psucceeds "(String, String) == (String, String)" @| checkDeep @@ -73,15 +70,6 @@ spec = do @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) @-> psucceeds - "(POpaque, POpaque) == (POpaque, POpaque)" - @| checkShallow - @(PBuiltinPair (PAsData POpaque) (PAsData POpaque)) - @(PBuiltinPair (PAsData POpaque) (PAsData POpaque)) - ( punsafeBuiltin PLC.MkPairData - # (pdata $ pcon PUnit) - # (pdata $ pcon PUnit) - ) - @-> psucceeds "[String] == [String]" @| checkDeep @(PBuiltinList (PAsData PByteString)) @@ -98,50 +86,56 @@ spec = do @| validator # pforgetData l1 # pforgetData l2 # validContext @-> psucceeds checkShallow :: - forall (target :: PType) (actual :: PType). - ( PTryFrom target - , PIsData actual - , PIsData target + forall (target :: PType) (actual :: PType) . + ( PTryFrom 'PShallow PData (PAsData target) ) => - ClosedTerm actual -> - ClosedTerm target -checkShallow = reprTargetActual ptryFrom + ClosedTerm (PAsData actual) -> + ClosedTerm (PAsData target) +checkShallow t = ptryFrom @'PShallow #$ pforgetData t checkDeep :: forall (target :: PType) (actual :: PType). - ( PTryFromRecur target + ( PTryFrom 'PDeep POpaque target , PIsData actual , PIsData target ) => ClosedTerm actual -> ClosedTerm target -checkDeep = reprTargetActual (ptryFromRecur) +checkDeep t = ptryFrom @'PDeep #$ popaque t -reprTargetActual :: - forall (target :: PType) (actual :: PType). - ( PIsData actual - , PIsData target - ) => - ClosedTerm (PData :--> PAsData target) -> - ClosedTerm (actual) -> - ClosedTerm (target) -reprTargetActual f x = pfromData $ f #$ pforgetData $ pdata x --- example: untrusted redeemer +{- +this (the `partialCheck` function) would be really useful and it should be possible, however, it wants a +`PIsData` instance for `PBuiltinList PData` which of course there isn't. +From my understanding tho, when it comes to the `PAsData (PBuiltinList PData)` case it should stop +complaining because the instance for `PAsData (PBuiltinList PData)` is strictly more specific than the +instance for `PAsData (PbuiltinList (PAsData a))`, i.e. it should not require the `PIsData` constraint + +sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) +sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1..100] + +partialCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList PData)))) +partialCheck = let dat :: Term _ PData + dat = pforgetData sampleStructure + in ptryFrom @'PDeep #$ dat + +fullCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) +fullCheck = ptryFrom @'PDeep #$ pforgetData sampleStructure +-} + + +------------------- Example: untrusted Redeemer ------------------------------------ + newtype PNatural (s :: S) = PMkNatural (Term s PInteger) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PNatural PInteger) -- | partial pmkNatural :: Term s (PInteger :--> PNatural) -pmkNatural = plam $ \i -> pif' # (i #< 0) # perror # (pcon $ PMkNatural i) +pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) -{- | total - pmaybeMkNatural :: Term s (PInteger :--> PMaybe PNatural) - pmaybeMkNatural = plam $ \i -> pif' # (i #< 0) # pcon PNothing # (pcon $ PJust $ pcon $ PMkNatural i) --} -instance PTryFromRecur PNatural where - ptryFromRecur = plam $ \opq -> unTermCont $ do +instance PTryFrom a PData (PAsData PNatural) where + ptryFrom = plam $ \opq -> unTermCont $ do let i :: Term _ PInteger i = pasInt # opq pure $ pdata $ pmkNatural # i @@ -151,10 +145,10 @@ validator = phoistAcyclic $ plam $ \dat red ctx -> unTermCont $ do -- untrusted ---^---^ ^--- trusted let trustedRedeemer :: Term _ (PBuiltinList (PAsData PNatural)) - trustedRedeemer = pfromData $ ptryFromRecur # red + trustedRedeemer = pfromData $ ptryFrom @'PDeep # red trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) - trustedDatum = pfromData $ ptryFromRecur # dat - -- make the Datm and Redeemer trusted + trustedDatum = pfromData $ ptryFrom @'PDeep # dat + -- make the Datum and Redeemer trusted ownHash :: Term _ PDatumHash ownHash = unTermCont $ do @@ -163,7 +157,7 @@ validator = phoistAcyclic $ maybeHash = pfield @"datumHash" #$ pfield @"resolved" #$ (pfromData ownInput) PDJust datumHash <- tcont $ pmatch maybeHash pure $ pfield @"_0" # datumHash - -- find own script adress matching DatumHash + -- find own script address matching DatumHash outputs :: Term _ (PBuiltinList (PAsData (PTuple PDatumHash PDatum))) outputs = pfield @"data" #$ pfield @"txInfo" # ctx @@ -172,13 +166,13 @@ validator = phoistAcyclic $ matchingHashDatum :: Term _ (PBuiltinList PDatum) matchingHashDatum = precList - ( \self x xs -> unTermCont $ do - tup <- tcont $ pletFields @["_0", "_1"] x - pure $ + ( \self x xs -> pletFields @["_0", "_1"] x $ + \tup -> + ptrace "iteration" $ pif (hrecField @"_0" tup #== ownHash) - (pcons # (hrecField @"_1" tup) # (self # xs)) - (self # xs) + (ptrace "appended something" pcons # (hrecField @"_1" tup) # (self # xs)) + (ptrace "called without appending" self # xs) ) (const pnil) #$ outputs @@ -186,10 +180,10 @@ validator = phoistAcyclic $ -- to do that with tools available, I wrote it by hand singleOutput :: Term _ PDatum - singleOutput = - pif' # (pnull #$ ptail # matchingHashDatum) - # (phead # matchingHashDatum) - # perror + singleOutput = plet matchingHashDatum $ \dat -> + pif (pnull #$ ptail # dat) + (phead # dat) + (ptraceError "not a single output") -- make sure that after filtering the outputs, only one output -- remains @@ -201,7 +195,7 @@ validator = phoistAcyclic $ isValid = (pto singleOutput) #== pforgetData resultList -- the final check for validity pure $ - pif' # isValid # (popaque $ pcon PUnit) # perror + pif isValid (popaque $ pcon PUnit) (ptraceError "not valid") pfindOwnInput :: Term s (PScriptContext :--> PMaybe (PAsData PTxInInfo)) pfindOwnInput = phoistAcyclic $ @@ -235,7 +229,8 @@ pfind = phoistAcyclic $ (pcon PNothing) xs --- Mocking a transaction +------------------- Mocking a transaction ------------------------------------------ + ctx :: [(DatumHash, Datum)] -> Term s PScriptContext ctx l = pconstant (ScriptContext (info' l) purpose) @@ -247,7 +242,11 @@ validList1 :: [(DatumHash, Datum)] validList1 = let dat :: Datum dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] - in [("d0", dat)] + in [("d0", dat)] + + +------------------- Helpers -------------------------------------------------------- + toDatadList :: [Integer] -> Term s (PAsData (PBuiltinList (PAsData PInteger))) toDatadList = pdata . (foldr go pnil) From cf02d2374b4acdaad50130fa86e60830cf83cf36 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 25 Feb 2022 16:42:03 -0500 Subject: [PATCH 095/584] PEq generic deriving, WIP --- Plutarch/Bool.hs | 68 +++++++++++++++++++++++++++++++++++++++++++++++ Plutarch/Maybe.hs | 3 ++- Plutarch/Pair.hs | 9 ++++--- 3 files changed, 76 insertions(+), 4 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index e5a493ca9..11dd04a96 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -17,6 +19,9 @@ module Plutarch.Bool ( por', ) where +import Data.Foldable (foldl') +import Data.SOP.Constraint +import Generics.SOP import Plutarch.Internal.Other ( DerivePNewtype, PDelayed, @@ -33,6 +38,7 @@ import Plutarch.Internal.Other ( (#), type (:-->), ) +import Plutarch.Internal.TypeFamily (ToPType2) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstant, @@ -57,6 +63,29 @@ instance PlutusType PBool where class PEq t where (#==) :: Term s t -> Term s t -> Term s PBool + default (#==) :: + forall s code pcode. + ( code ~ Code (t s) + , pcode ~ ToPType2 code + , Generic (t s) + , PlutusType t + , All2 PEq pcode + , SameShapeAs code pcode + , SameShapeAs pcode code + , AllZipF (AllZip (LiftedCoercible I (Term s))) code pcode + ) => + Term s t -> + Term s t -> + Term s PBool + a #== b = go # a # b + where + -- FIXME: hoisting breaks compilation + go = + {- phoistAcyclic $ -} + plam $ \x y -> + pmatch x $ \x' -> + pmatch y $ \y' -> + gpeq @t (pfrom x') (pfrom y') infix 4 #== @@ -117,3 +146,42 @@ por = phoistAcyclic $ plam $ \x y -> pif' # x # (phoistAcyclic $ pdelay $ pcon P -- | Hoisted, Plutarch level, strictly evaluated boolean or function. por' :: Term s (PBool :--> PBool :--> PBool) por' = phoistAcyclic $ plam $ \x y -> pif' # x # (pcon PTrue) # y + +gpeq :: + forall a s code pcode. + ( code ~ Code (a s) + , pcode ~ ToPType2 code + , All2 PEq pcode + ) => + SOP (Term s) pcode -> + SOP (Term s) pcode -> + Term s PBool +gpeq (SOP c1) (SOP c2) = + ccompare_NS (Proxy @(All PEq)) (pcon PFalse) eqProd (pcon PFalse) c1 c2 + where + eqProd :: All PEq xs => NP (Term s) xs -> NP (Term s) xs -> Term s PBool + eqProd p1 p2 = + foldl' (#&&) (pcon PTrue) $ + hcollapse $ hcliftA2 (Proxy :: Proxy PEq) eqTerm p1 p2 + where + eqTerm :: forall a. PEq a => Term s a -> Term s a -> K (Term s PBool) a + eqTerm a b = + K $ a #== b + +{- | Like `from` but for Plutarch terms + + Instead of `I`, this uses `Term s` as the container type. +-} +pfrom :: + forall a s code pcode. + ( Generic (a s) + , code ~ Code (a s) + , pcode ~ ToPType2 code + , SameShapeAs code pcode + , SameShapeAs pcode code + , AllZipF (AllZip (LiftedCoercible I (Term s))) code pcode + , All Top pcode + ) => + a s -> + SOP (Term s) (ToPType2 (Code (a s))) +pfrom = hfromI . from diff --git a/Plutarch/Maybe.hs b/Plutarch/Maybe.hs index 9c63c5467..4a45a4b46 100644 --- a/Plutarch/Maybe.hs +++ b/Plutarch/Maybe.hs @@ -8,10 +8,11 @@ import Plutarch ( S, Term, ) +import Plutarch.Bool (PEq) -- | Plutus Maybe type, with Scott-encoded repr data PMaybe (a :: PType) (s :: S) = PJust (Term s a) | PNothing deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving anyclass (Generic, PlutusType, PEq) diff --git a/Plutarch/Pair.hs b/Plutarch/Pair.hs index efaf3d113..4a0a38ff3 100644 --- a/Plutarch/Pair.hs +++ b/Plutarch/Pair.hs @@ -1,15 +1,18 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} + module Plutarch.Pair (PPair (..)) where import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -import Plutarch (PType, PlutusType, S, Term) +import Plutarch.Bool (PEq) +import Plutarch.Internal.Other (PType, PlutusType, S, Term) {- | Plutus encoding of Pairs. - Note: This is represented differently than 'BuiltinPair' + Note: This is represented differently than 'BuiltinPair'. It is scott-encoded. -} data PPair (a :: PType) (b :: PType) (s :: S) = PPair (Term s a) (Term s b) deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving anyclass (Generic, PlutusType, PEq) From 87e6e738a12a02ee2b8283fbab380f608d4134cc Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 26 Feb 2022 00:16:51 +0100 Subject: [PATCH 096/584] fix: - update goldens to new tests and remove unecessary comment --- Plutarch/Api/V1/Scripts.hs | 4 -- Plutarch/Verify.hs | 63 +++++++++++++++++++ .../verification_untrusted_data.bench.golden | 4 ++ ...rification_untrusted_data.uplc.eval.golden | 4 ++ .../verification_untrusted_data.uplc.golden | 4 ++ plutarch-test/src/Plutarch/VerifySpec.hs | 38 +++++++++++ 6 files changed, 113 insertions(+), 4 deletions(-) diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index 8450559f6..cda6d5aa7 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -20,10 +20,6 @@ import Plutarch.Lift ( ) import Plutarch.Prelude -{- TODO: - - this seems to be the type zthis is going to be working on, i.e. whose representation - I will have to check --} newtype PDatum (s :: S) = PDatum (Term s PData) deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PDatum PData) diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index 63c8fde1a..7888f3f56 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -6,6 +6,7 @@ module Plutarch.Verify ( PTryFrom (ptryFrom), + PTryUnwrapFrom (ptryUnwrapFrom), PDepth (PDeep, PShallow), pcheckType, pcheckByteStr, @@ -21,6 +22,10 @@ import Plutarch.Builtin ( PBuiltinPair, PData, PIsData (pfromData), + pasByteStr, + pasInt, + pasList, + pasMap, pdata, pforgetData, pfstBuiltin, @@ -42,6 +47,8 @@ import Plutarch.Internal.Other ( type (:-->), ) +import Plutarch.Lift (PLift) + import Plutarch.Bool (pif, (#==)) import Plutarch.List (pmap) @@ -162,6 +169,62 @@ instance PTryFrom PShallow PData PData where -- PShallow POpaque instances wouldn't make sense as that wouldn't do any verifying at all +----------------------- Class that removes the PAsData wrapper -------------------------- + +{- | + the basic idea behind the class is, that if i removed the data wrapper, I have + confidence that the type really has the structure I tested it to have +-} +class PTryUnwrapFrom (d :: PDepth) (b :: PType) where + ptryUnwrapFrom :: Term s (PData :--> b) + +instance PTryUnwrapFrom PDeep PInteger where + ptryUnwrapFrom = pasInt + +instance PTryUnwrapFrom PDeep PByteString where + ptryUnwrapFrom = pasByteStr + +instance {-# OVERLAPPING #-} PTryUnwrapFrom PDeep (PBuiltinList PData) where + ptryUnwrapFrom = pasList + +instance {-# OVERLAPPING #-} PTryUnwrapFrom PDeep (PBuiltinList (PBuiltinPair PData PData)) where + ptryUnwrapFrom = pasMap + +instance + {-# OVERLAPPABLE #-} + ( PTryUnwrapFrom PDeep b + , PIsData b + , PLift b + ) => + PTryUnwrapFrom PDeep (PBuiltinList b) + where + ptryUnwrapFrom = phoistAcyclic $ + plam $ \opq -> + let lst :: Term _ (PBuiltinList (PAsData b)) + lst = punsafeBuiltin PLC.UnListData # opq + in pmap # (plam $ \e -> ptryUnwrapFrom @PDeep @b #$ pforgetData e) # lst + +-- this instance is not ok, I can not create an instance that doesn't work on +-- wrapped types. +instance + {-# OVERLAPPABLE #-} + ( PTryUnwrapFrom PDeep a + , PTryUnwrapFrom PDeep b + , PIsData a + , PIsData b + ) => + PTryUnwrapFrom PDeep (PBuiltinPair (PAsData a) (PAsData b)) + where + ptryUnwrapFrom = phoistAcyclic $ + plam $ \opq -> + let tup :: Term _ (PBuiltinPair (PAsData a) (PAsData b)) + tup = pfromData $ punsafeCoerce opq + fst :: Term _ a + fst = ptryUnwrapFrom @PDeep @a #$ pforgetData $ pfstBuiltin # tup + snd :: Term _ b + snd = ptryUnwrapFrom @PDeep @b #$ pforgetData $ psndBuiltin # tup + in ppairDataBuiltin # pdata fst # pdata snd + ----------------------- Helper functions ------------------------------------------------ pchooseData :: Term s (PData :--> a :--> a :--> a :--> a :--> a :--> a) diff --git a/plutarch-test/goldens/verification_untrusted_data.bench.golden b/plutarch-test/goldens/verification_untrusted_data.bench.golden index 0a87f92bc..1595afb5d 100644 --- a/plutarch-test/goldens/verification_untrusted_data.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.bench.golden @@ -4,4 +4,8 @@ erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scrip working.int == int {"exBudgetCPU":1390705,"exBudgetMemory":3366,"scriptSizeBytes":40} working.(String, String) == (String, String) {"exBudgetCPU":12047260,"exBudgetMemory":22656,"scriptSizeBytes":171} working.[String] == [String] {"exBudgetCPU":8604070,"exBudgetMemory":19112,"scriptSizeBytes":124} +removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":102} +removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":77} +removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":7384676,"exBudgetMemory":12164,"scriptSizeBytes":102} +removing the data wrapper.working.[String] == [String] {"exBudgetCPU":6033541,"exBudgetMemory":12344,"scriptSizeBytes":85} example.concatenate two lists {"exBudgetCPU":66205381,"exBudgetMemory":127091,"scriptSizeBytes":644} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden index d691c6a76..c9d62ef1a 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden @@ -4,4 +4,8 @@ erroneous.[String] /= [Integer] (program 1.0.0 error) working.int == int (program 1.0.0 #182a) working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) +removing the data wrapper.working.[String] == [String] (program 1.0.0 [#666f6f, #626172]) example.concatenate two lists (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.golden index 8c8577601..c6f9986e3 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.golden @@ -4,4 +4,8 @@ erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> unListDa working.int == int (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (iData 42))) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 ((\i0 -> i8 (mkPairData ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i9 (i5 i1))) ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i11 (i5 i1))))) (i7 i1))) (mkPairData (bData #666f6f) (bData #626172))) (force ifThenElse)) (force chooseData)) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> unListData ((\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 4) (delay i1) (delay error))) (unListData i1))) (listData i1))) (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))) (force mkCons)) [ ])) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (iData (unIData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (i4 (unBData (force headList i1)) (i2 (force tailList i1)))))) (unListData i1)) (listData (i1 (iData 3) ((\i0 -> i2 i1 [ ]) (iData 4))))) (force mkCons))) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (bData (unBData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) +removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (i4 (unBData (force headList i1)) (i2 (force tailList i1)))))) (unListData i1)) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 [ ]) (bData #626172))))) (force mkCons))) example.concatenate two lists (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 7) (i12 (iData 8) (i12 (iData 9) (i12 (iData 10) i13)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/VerifySpec.hs index e52ab836b..43c48ddcb 100644 --- a/plutarch-test/src/Plutarch/VerifySpec.hs +++ b/plutarch-test/src/Plutarch/VerifySpec.hs @@ -32,6 +32,7 @@ import Plutarch.Builtin ( import Plutarch.Prelude import Plutarch.Verify ( PTryFrom (ptryFrom), + PTryUnwrapFrom (ptryUnwrapFrom), PDepth (PShallow, PDeep), ) @@ -76,6 +77,33 @@ spec = do @(PBuiltinList (PAsData PByteString)) ((pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) @-> psucceeds + "removing the data wrapper" @\ do + "erroneous" @\ do + "(String, Integer) /= (String, String)" + @| checkDeepUnwrap + @(PAsData (PBuiltinPair (PAsData PByteString) (PAsData PByteString))) + @(PBuiltinPair (PAsData PInteger) (PAsData PByteString)) + (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) + @-> pfails + "[String] /= [Integer]" + @| (checkDeepUnwrap + @(PAsData (PBuiltinList (PAsData PInteger))) + @(PBuiltinList PByteString) + (pdata $ (pcons # (pdata $ pconstant 3)) #$ (psingleton # (pdata $ pconstant 4)))) + @-> pfails + "working" @\ do + "(String, String) == (String, String)" + @| (checkDeepUnwrap + @(PAsData (PBuiltinPair (PAsData PByteString) (PAsData PByteString))) + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar"))) + @-> psucceeds + "[String] == [String]" + @| checkDeepUnwrap + @(PAsData (PBuiltinList (PAsData PByteString))) + @(PBuiltinList PByteString) + (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) + @-> psucceeds "example" @\ do let validContext = ctx validList1 l1 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) @@ -85,6 +113,16 @@ spec = do "concatenate two lists" @| validator # pforgetData l1 # pforgetData l2 # validContext @-> psucceeds +checkDeepUnwrap :: + forall (actual :: PType) (target :: PType) b. + ( PTryUnwrapFrom 'PDeep target + , PAsData b ~ actual + ) => + ClosedTerm actual -> + ClosedTerm target +checkDeepUnwrap t = ptryUnwrapFrom @'PDeep #$ pforgetData t + + checkShallow :: forall (target :: PType) (actual :: PType) . ( PTryFrom 'PShallow PData (PAsData target) From 1e95908252d06802c7a9ddf79416e65c687bc084 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 26 Feb 2022 13:39:53 +0100 Subject: [PATCH 097/584] wip #303: - added instances to make PData of recusing into substructures - added corresponding test --- Plutarch/Builtin.hs | 8 ++++++++ Plutarch/Verify.hs | 1 + .../goldens/verification_untrusted_data.bench.golden | 4 +++- .../verification_untrusted_data.uplc.eval.golden | 2 ++ .../goldens/verification_untrusted_data.uplc.golden | 4 +++- plutarch-test/src/Plutarch/VerifySpec.hs | 11 +++++++++-- 6 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 59d07cfe8..f8b46388c 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -224,6 +224,10 @@ instance PIsData a => PIsData (PBuiltinList (PAsData a)) where pfromData x = punsafeCoerce $ pasList # pforgetData x pdata x = punsafeBuiltin PLC.ListData # x +instance PIsData (PBuiltinList PData) where + pfromData x = punsafeCoerce $ pasList # pforgetData x + pdata x = punsafeBuiltin PLC.ListData # x + instance PIsData (PBuiltinMap k v) where pfromData x = punsafeCoerce $ pasMap # pforgetData x pdata x = punsafeBuiltin PLC.MapData # x @@ -274,6 +278,10 @@ instance PIsData (PBuiltinPair (PAsData a) (PAsData b)) where f = phoistAcyclic $ plam $ \pair -> pconstrBuiltin # 0 #$ pcons # (pfstBuiltin # pair) #$ pcons # (psndBuiltin # pair) # pnil +instance PIsData (PBuiltinPair PData PData) where + pfromData x = punsafeCoerce $ pfromData @(PBuiltinPair (PAsData _) (PAsData _)) $ punsafeCoerce x + pdata x = punsafeCoerce $ pdata @(PBuiltinPair (PAsData _) (PAsData _)) $ punsafeCoerce x + instance PIsData PUnit where pfromData _ = pconstant () pdata _ = punsafeCoerce $ pconstant (Constr 0 []) diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index 7888f3f56..a9daf8bfe 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -1,6 +1,7 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-orphans #-} {-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-} {-# OPTIONS_GHC -Wredundant-constraints #-} diff --git a/plutarch-test/goldens/verification_untrusted_data.bench.golden b/plutarch-test/goldens/verification_untrusted_data.bench.golden index 1595afb5d..c478cd036 100644 --- a/plutarch-test/goldens/verification_untrusted_data.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.bench.golden @@ -8,4 +8,6 @@ removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBu removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":77} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":7384676,"exBudgetMemory":12164,"scriptSizeBytes":102} removing the data wrapper.working.[String] == [String] {"exBudgetCPU":6033541,"exBudgetMemory":12344,"scriptSizeBytes":85} -example.concatenate two lists {"exBudgetCPU":66205381,"exBudgetMemory":127091,"scriptSizeBytes":644} \ No newline at end of file +removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":315492408,"exBudgetMemory":673004,"scriptSizeBytes":839} +removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":53643621,"exBudgetMemory":79318,"scriptSizeBytes":810} +example.concatenate two lists {"exBudgetCPU":67071068,"exBudgetMemory":129055,"scriptSizeBytes":1040} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden index c9d62ef1a..f64ea2320 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden @@ -8,4 +8,6 @@ removing the data wrapper.erroneous.(String, Integer) /= (String, String) (progr removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) removing the data wrapper.working.[String] == [String] (program 1.0.0 [#666f6f, #626172]) +removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) example.concatenate two lists (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.golden index c6f9986e3..f6d457720 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.golden @@ -8,4 +8,6 @@ removing the data wrapper.erroneous.(String, Integer) /= (String, String) (progr removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (i4 (unBData (force headList i1)) (i2 (force tailList i1)))))) (unListData i1)) (listData (i1 (iData 3) ((\i0 -> i2 i1 [ ]) (iData 4))))) (force mkCons))) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (bData (unBData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (i4 (unBData (force headList i1)) (i2 (force tailList i1)))))) (unListData i1)) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 [ ]) (bData #626172))))) (force mkCons))) -example.concatenate two lists (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 7) (i12 (iData 8) (i12 (iData 9) (i12 (iData 10) i13)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file +removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (\i0 -> listData (i3 (\i0 -> listData (i4 (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (unListData i1))) (unListData i1))) (unListData i1))) (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 2) (delay i1) (delay error))) (unListData i1))) (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +example.concatenate two lists (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/VerifySpec.hs:249:5-22" (delay error)))))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/VerifySpec.hs:203:11-26" (delay error)))))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/VerifySpec.hs:200:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i20)) (i15 (i16 i1)) (i3 (i16 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i16 i2)))))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i21 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (listData (i14 (iData 1) (i14 (iData 2) (i14 (iData 3) (i14 (iData 4) (i14 (iData 5) i15)))))) (listData (i14 (iData 6) (i14 (iData 7) (i14 (iData 8) (i14 (iData 9) (i14 (iData 10) i15)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay (force (i11 i10 (delay error)))) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) "could not make natural") (force trace)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/VerifySpec.hs index 43c48ddcb..d9a4b5c42 100644 --- a/plutarch-test/src/Plutarch/VerifySpec.hs +++ b/plutarch-test/src/Plutarch/VerifySpec.hs @@ -103,7 +103,14 @@ spec = do @(PAsData (PBuiltinList (PAsData PByteString))) @(PBuiltinList PByteString) (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) - @-> psucceeds + @-> psucceeds + "partial checks" @\ do + -- this is way more expensive ... + "check whole structure" + @| fullCheck @-> psucceeds + -- ... than this + "check structure partly" + @| partialCheck @-> psucceeds "example" @\ do let validContext = ctx validList1 l1 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) @@ -148,6 +155,7 @@ this (the `partialCheck` function) would be really useful and it should be possi From my understanding tho, when it comes to the `PAsData (PBuiltinList PData)` case it should stop complaining because the instance for `PAsData (PBuiltinList PData)` is strictly more specific than the instance for `PAsData (PbuiltinList (PAsData a))`, i.e. it should not require the `PIsData` constraint +-} sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1..100] @@ -159,7 +167,6 @@ partialCheck = let dat :: Term _ PData fullCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) fullCheck = ptryFrom @'PDeep #$ pforgetData sampleStructure --} ------------------- Example: untrusted Redeemer ------------------------------------ From e454a27e7483ca792ba80ab1d050d83593cbb636 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sun, 27 Feb 2022 20:54:35 +0100 Subject: [PATCH 098/584] wip #303: - added new instances for PIsData for PDataRecord - added new instances for PTryFrom PDeep PData for PDataRecord - added test --- Plutarch/DataRepr/Internal.hs | 18 +++++- Plutarch/Verify.hs | 64 ++++++++++++++++--- .../verification_untrusted_data.bench.golden | 14 ++-- ...rification_untrusted_data.uplc.eval.golden | 10 ++- .../verification_untrusted_data.uplc.golden | 14 ++-- plutarch-test/src/Plutarch/VerifySpec.hs | 52 ++++++++++----- 6 files changed, 133 insertions(+), 39 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 2fa9806db..5f8a10340 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -92,13 +92,14 @@ import Plutarch.Builtin ( import Plutarch.DataRepr.Internal.Generic (MkSum (mkSum)) import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) import Plutarch.Integer (PInteger) -import Plutarch.Internal (S (SI)) +import Plutarch.Internal (S (SI), punsafeBuiltin) import Plutarch.Internal.TypeFamily (ToPType2) import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) import Plutarch.Unsafe (punsafeCoerce) import qualified Plutus.V1.Ledger.Api as Ledger +import qualified PlutusCore as PLC {- | A "record" of `exists a. PAsData a`. The underlying representation is `PBuiltinList PData`. @@ -174,6 +175,21 @@ type family PLabelIndex (name :: Symbol) (as :: [PLabeledType]) :: Nat where type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (name ':= a) = a +type PUnLabelAll :: [PLabeledType] -> [PType] +type family PUnLabelAll l where + PUnLabelAll '[] = '[] + PUnLabelAll (x ': xs) = PUnLabel x ': PUnLabelAll xs + +instance + {-# OVERLAPPABLE #-} + ( All PIsData bs + , bs ~ PUnLabelAll xs + ) => + PIsData (PDataRecord xs) + where + pfromData x = punsafeBuiltin PLC.UnListData # pforgetData x + pdata x = punsafeBuiltin PLC.ListData # x + {- | A sum of 'PDataRecord's. The underlying representation is the `PDataConstr` constructor, where the integer is the index of the variant and the list is the record. diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index a9daf8bfe..51dba2511 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -43,16 +43,28 @@ import Plutarch.Internal.Other ( pforce, phoistAcyclic, plam, + plet, (#), (#$), type (:-->), ) +import Plutarch.DataRepr.Internal ( + PDataRecord, + PLabeledType ((:=)), + pdcons, + pdnil, + ) + import Plutarch.Lift (PLift) import Plutarch.Bool (pif, (#==)) -import Plutarch.List (pmap) +import Plutarch.List ( + phead, + pmap, + ptail, + ) import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) import qualified PlutusCore as PLC @@ -128,13 +140,49 @@ instance where ptryFrom = phoistAcyclic $ plam $ \opq -> - let tup :: Term _ (PBuiltinPair a b) - tup = pfromData $ punsafeCoerce opq - fst :: Term _ a - fst = ptryFrom @PDeep @PData @a #$ pforgetData $ pfstBuiltin # tup - snd :: Term _ b - snd = ptryFrom @PDeep @PData @b #$ pforgetData $ psndBuiltin # tup - in pdata $ ppairDataBuiltin # fst # snd + plet (pfromData $ punsafeCoerce opq) $ + \tup -> + let fst :: Term _ a + fst = ptryFrom @PDeep @PData @a #$ pforgetData $ pfstBuiltin # tup + snd :: Term _ b + snd = ptryFrom @PDeep @PData @b #$ pforgetData $ psndBuiltin # tup + in pdata $ ppairDataBuiltin # fst # snd + +instance + {-# OVERLAPPABLE #-} + ( PTryFrom PDeep PData (PAsData b) + , PTryFrom PDeep PData (PAsData (PDataRecord xs)) + , x ~ (s ':= b) + , PIsData (PDataRecord xs) + ) => + PTryFrom PDeep PData (PAsData (PDataRecord (x ': xs))) + where + ptryFrom = phoistAcyclic $ + plam $ \opq -> plet (pfromData @(PBuiltinList _) $ punsafeCoerce opq) $ \lst -> + let lsthead :: Term _ PData + lsthead = phead # lst + lsttail :: Term _ (PAsData (PBuiltinList PData)) + lsttail = pdata $ ptail # lst + in punsafeCoerce $ + pdcons @s + # (ptryFrom @PDeep @PData @(PAsData b) # lsthead) + # (pfromData (ptryFrom @PDeep @PData @(PAsData (PDataRecord xs)) # pforgetData lsttail)) + +instance + {-# OVERLAPPING #-} + ( PTryFrom PDeep PData (PAsData b) + , x ~ (s ':= b) + ) => + PTryFrom PDeep PData (PAsData (PDataRecord '[x])) + where + ptryFrom = phoistAcyclic $ + plam $ \opq -> + let lsthead :: Term _ PData + lsthead = phead # (pfromData @(PBuiltinList _) $ punsafeCoerce opq) + in punsafeCoerce $ + pdcons @s + # (ptryFrom @PDeep @PData @(PAsData b) # lsthead) + # pdnil ----------------------- PDeep POpaque instances ----------------------------------------- diff --git a/plutarch-test/goldens/verification_untrusted_data.bench.golden b/plutarch-test/goldens/verification_untrusted_data.bench.golden index c478cd036..5c009e072 100644 --- a/plutarch-test/goldens/verification_untrusted_data.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.bench.golden @@ -1,13 +1,17 @@ erroneous.int /= bytestring {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":45} -erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":171} -erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":115} +erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":159} +erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":111} working.int == int {"exBudgetCPU":1390705,"exBudgetMemory":3366,"scriptSizeBytes":40} -working.(String, String) == (String, String) {"exBudgetCPU":12047260,"exBudgetMemory":22656,"scriptSizeBytes":171} -working.[String] == [String] {"exBudgetCPU":8604070,"exBudgetMemory":19112,"scriptSizeBytes":124} +working.(String, String) == (String, String) {"exBudgetCPU":8788383,"exBudgetMemory":17372,"scriptSizeBytes":159} +working.[String] == [String] {"exBudgetCPU":8305205,"exBudgetMemory":18580,"scriptSizeBytes":120} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":125} removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":102} removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":77} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":7384676,"exBudgetMemory":12164,"scriptSizeBytes":102} removing the data wrapper.working.[String] == [String] {"exBudgetCPU":6033541,"exBudgetMemory":12344,"scriptSizeBytes":85} removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":315492408,"exBudgetMemory":673004,"scriptSizeBytes":839} removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":53643621,"exBudgetMemory":79318,"scriptSizeBytes":810} -example.concatenate two lists {"exBudgetCPU":67071068,"exBudgetMemory":129055,"scriptSizeBytes":1040} \ No newline at end of file +example.concatenate two lists, legal {"exBudgetCPU":66205381,"exBudgetMemory":127091,"scriptSizeBytes":644} +example.concatenate tow lists, illegal (list too short) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":637} +example.concatenate tow lists, illegal (wrong elements in list) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":644} +example.concatenate tow lists, illegal (more than one output) {"exBudgetCPU":null,"exBudgetMemory":null,"scriptSizeBytes":651} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden index f64ea2320..7522d04ec 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden @@ -2,12 +2,16 @@ erroneous.int /= bytestring (program 1.0.0 error) erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) erroneous.[String] /= [Integer] (program 1.0.0 error) working.int == int (program 1.0.0 #182a) -working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) -working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) +working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) +working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 error) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) removing the data wrapper.working.[String] == [String] (program 1.0.0 [#666f6f, #626172]) removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) -example.concatenate two lists (program 1.0.0 ()) \ No newline at end of file +example.concatenate two lists, legal (program 1.0.0 ()) +example.concatenate tow lists, illegal (list too short) (program 1.0.0 error) +example.concatenate tow lists, illegal (wrong elements in list) (program 1.0.0 error) +example.concatenate tow lists, illegal (more than one output) (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.golden index f6d457720..5f423c0c1 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.golden @@ -1,13 +1,17 @@ erroneous.int /= bytestring (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (bData #666f6f))) -erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 ((\i0 -> i8 (mkPairData ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 3) (delay i1) (delay error))) (i9 (i5 i1))) ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i11 (i5 i1))))) (i7 i1))) (mkPairData (bData #666f6f) (bData #626172))) (force ifThenElse)) (force chooseData)) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) -erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> unListData ((\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 4) (delay i1) (delay error))) (unListData i1))) (listData i1))) (i1 (iData 3) ((\i0 -> i2 i1 i3) (iData 4)))) (force mkCons)) [ ])) +erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 3) (delay i1) (delay error))) (i7 i1)) ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i9 i1)))) ((\i0 -> mkPairData (i5 i1) (i5 (force tailList i1))) (i8 (unConstrData i1)))) (i4 (mkPairData (bData #666f6f) (bData #626172)))) (force ifThenElse)) (force chooseData)) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) +erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 4) (delay i1) (delay error))) (unListData i1))) (listData (i1 (iData 3) ((\i0 -> i2 i1 i3) (iData 4))))) (force mkCons)) [ ])) working.int == int (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (iData 42))) -working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 ((\i0 -> i8 (mkPairData ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i9 (i5 i1))) ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i11 (i5 i1))))) (i7 i1))) (mkPairData (bData #666f6f) (bData #626172))) (force ifThenElse)) (force chooseData)) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i7 (unConstrData i1)))) (force headList)) (force tailList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) -working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> unListData ((\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 4) (delay i1) (delay error))) (unListData i1))) (listData i1))) (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))) (force mkCons)) [ ])) +working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i7 i1)) ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i9 i1)))) ((\i0 -> mkPairData (i5 i1) (i5 (force tailList i1))) (i8 (unConstrData i1)))) (i4 (mkPairData (bData #666f6f) (bData #626172)))) (force ifThenElse)) (force chooseData)) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) +working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 4) (delay i1) (delay error))) (unListData i1))) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172))))) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 3) (delay i1) (delay error))) (i5 i1)) (unListData ((\i0 -> i7 ((\i0 -> force (i5 (equalsInteger (i6 i1 0 1 2 3 4) 3) (delay i1) (delay error))) (i6 (unListData i1))) i8) (listData (force tailList i1))))) (unListData i1)) (listData (i4 (iData 7) (i4 (iData 42) i5)))) (force ifThenElse)) (force chooseData)) (force headList)) (force mkCons)) [ ])) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (iData (unIData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (i4 (unBData (force headList i1)) (i2 (force tailList i1)))))) (unListData i1)) (listData (i1 (iData 3) ((\i0 -> i2 i1 [ ]) (iData 4))))) (force mkCons))) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (bData (unBData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (i4 (unBData (force headList i1)) (i2 (force tailList i1)))))) (unListData i1)) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 [ ]) (bData #626172))))) (force mkCons))) removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (\i0 -> listData (i3 (\i0 -> listData (i4 (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (unListData i1))) (unListData i1))) (unListData i1))) (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 2) (delay i1) (delay error))) (unListData i1))) (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -example.concatenate two lists (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/VerifySpec.hs:249:5-22" (delay error)))))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/VerifySpec.hs:203:11-26" (delay error)))))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/VerifySpec.hs:200:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i20)) (i15 (i16 i1)) (i3 (i16 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i16 i2)))))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i21 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (listData (i14 (iData 1) (i14 (iData 2) (i14 (iData 3) (i14 (iData 4) (i14 (iData 5) i15)))))) (listData (i14 (iData 6) (i14 (iData 7) (i14 (iData 8) (i14 (iData 9) (i14 (iData 10) i15)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay (force (i11 i10 (delay error)))) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) "could not make natural") (force trace)) (force mkCons)) [ ])) \ No newline at end of file +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 7) (i12 (iData 8) (i12 (iData 9) (i12 (iData 10) i13)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate tow lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 7) (i12 (iData 8) (i12 (iData 9) i13))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate tow lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 8) (i12 (iData 8) (i12 (iData 9) (i12 (iData 10) i13)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate tow lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 7) (i12 (iData 8) (i12 (iData 9) (i12 (iData 10) i13)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffd8799f41d003ffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/VerifySpec.hs index d9a4b5c42..d1ccbb564 100644 --- a/plutarch-test/src/Plutarch/VerifySpec.hs +++ b/plutarch-test/src/Plutarch/VerifySpec.hs @@ -53,13 +53,13 @@ spec = do @| checkDeep @(PBuiltinPair (PAsData PInteger) (PAsData PByteString)) @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) - (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) + (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) @-> pfails "[String] /= [Integer]" @| checkDeep @(PBuiltinList (PAsData PByteString)) @(PBuiltinList (PAsData PInteger)) - ((pcons # (pdata $ pconstant 3)) #$ (psingleton # (pdata $ pconstant 4))) + (pdata $ (pcons # (pdata $ pconstant 3)) #$ (psingleton # (pdata $ pconstant 4))) @-> pfails "working" @\ do "int == int" @@ -69,14 +69,19 @@ spec = do @| checkDeep @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) - (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) + (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) @-> psucceeds "[String] == [String]" @| checkDeep @(PBuiltinList (PAsData PByteString)) @(PBuiltinList (PAsData PByteString)) - ((pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) + (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) @-> psucceeds + "A { test := String, test2 := Integer } == { test := String, test2 := Integer }" + @| checkDeep + @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) + @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) + (pdata (pdcons @"foo" # (pdata $ pconstant 7) #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) "removing the data wrapper" @\ do "erroneous" @\ do "(String, Integer) /= (String, String)" @@ -113,12 +118,26 @@ spec = do @| partialCheck @-> psucceeds "example" @\ do let validContext = ctx validList1 + invalidContext = ctx invalidList1 l1 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) l1 = toDatadList [1 .. 5] l2 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) l2 = toDatadList [6 .. 10] - "concatenate two lists" + l3 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) + l3 = toDatadList [6..9] + l4 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) + l4 = toDatadList [6,8,8,9,10] + "concatenate two lists, legal" @| validator # pforgetData l1 # pforgetData l2 # validContext @-> psucceeds + "concatenate tow lists, illegal (list too short)" + @| validator # pforgetData l1 # pforgetData l3 # validContext @-> pfails + "concatenate tow lists, illegal (wrong elements in list)" + @| validator # pforgetData l1 # pforgetData l4 # validContext @-> pfails + "concatenate tow lists, illegal (more than one output)" + @| validator # pforgetData l1 # pforgetData l2 # invalidContext @-> pfails + +-- rec :: Term _ (PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) +-- rec = checkDeepUnwrap :: forall (actual :: PType) (target :: PType) b. @@ -140,26 +159,19 @@ checkShallow t = ptryFrom @'PShallow #$ pforgetData t checkDeep :: forall (target :: PType) (actual :: PType). - ( PTryFrom 'PDeep POpaque target + ( PTryFrom 'PDeep PData (PAsData target) , PIsData actual , PIsData target ) => - ClosedTerm actual -> - ClosedTerm target -checkDeep t = ptryFrom @'PDeep #$ popaque t - + ClosedTerm (PAsData actual) -> + ClosedTerm (PAsData target) +checkDeep t = ptryFrom @'PDeep #$ pforgetData t -{- -this (the `partialCheck` function) would be really useful and it should be possible, however, it wants a -`PIsData` instance for `PBuiltinList PData` which of course there isn't. -From my understanding tho, when it comes to the `PAsData (PBuiltinList PData)` case it should stop -complaining because the instance for `PAsData (PBuiltinList PData)` is strictly more specific than the -instance for `PAsData (PbuiltinList (PAsData a))`, i.e. it should not require the `PIsData` constraint --} sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1..100] +-- | PData serves as the base case for recursing into the structure partialCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList PData)))) partialCheck = let dat :: Term _ PData dat = pforgetData sampleStructure @@ -289,6 +301,12 @@ validList1 = dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] in [("d0", dat)] +invalidList1 :: [(DatumHash, Datum)] +invalidList1 = + let dat :: Datum + dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] + in [("d0", dat), ("d0", Datum $ toBuiltinData @Integer 3)] + ------------------- Helpers -------------------------------------------------------- From f4cd406bb2282f8d45b564cf3ddadafb88e17cc4 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Mon, 28 Feb 2022 13:39:42 +0100 Subject: [PATCH 099/584] fix: - changed ptryFrom from plutarch level to haskell level function as suggested by Chase, it indeed improves performance as it enables no-ops --- Plutarch/Verify.hs | 54 +++++++++++------------- plutarch-test/src/Plutarch/VerifySpec.hs | 40 ++++++++++++------ 2 files changed, 53 insertions(+), 41 deletions(-) diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index 51dba2511..293f1e5de 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -15,6 +15,8 @@ module Plutarch.Verify ( pcheckList, pcheckMap, ) where + +-- import GHC.TypeLits (KnownNat) import Plutarch.Builtin ( PAsData, @@ -86,15 +88,15 @@ import qualified PlutusCore as PLC -} class PTryFrom (d :: PDepth) (a :: PType) (b :: PType) where -- this is the "safest" type --^ ^-- this is the target type - ptryFrom :: Term s (a :--> b) + ptryFrom :: Term s a -> Term s b ----------------------- Polymorphic instances ------------------------------------------- instance PTryFrom a PData (PAsData PInteger) where - ptryFrom = pcheckInt + ptryFrom = (pcheckInt #) instance PTryFrom a PData (PAsData PByteString) where - ptryFrom = pcheckByteStr + ptryFrom = (pcheckByteStr #) ----------------------- PDeep PData instances ------------------------------------------- @@ -102,16 +104,14 @@ data PDepth = PDeep | PShallow -{- -instance {-# OVERLAPPING #-} PTryFrom PDeep PData PData where - ptryFrom = plam id --} +instance PTryFrom PDeep PData PData where + ptryFrom = id instance {-# OVERLAPPING #-} PTryFrom PDeep PData (PAsData (PBuiltinList PData)) where - ptryFrom = pcheckList + ptryFrom = (pcheckList #) instance {-# OVERLAPPING #-} PTryFrom PDeep PData (PAsData (PBuiltinMap PData PData)) where - ptryFrom = pcheckMap + ptryFrom = (pcheckMap #) instance {-# OVERLAPPABLE #-} @@ -121,11 +121,10 @@ instance ) => PTryFrom PDeep PData (PAsData (PBuiltinList a)) where - ptryFrom = phoistAcyclic $ - plam $ \opq -> + ptryFrom opq = let lst :: Term _ (PBuiltinList a) lst = punsafeBuiltin PLC.UnListData # opq - in pdata $ pmap # (plam $ \e -> ptryFrom @PDeep @PData @a #$ pforgetData e) # lst + in pdata $ pmap # (plam $ \e -> ptryFrom @PDeep @PData @a $ pforgetData e) # lst instance {-# OVERLAPPABLE #-} @@ -138,14 +137,13 @@ instance ) => PTryFrom PDeep PData (PAsData (PBuiltinPair a b)) where - ptryFrom = phoistAcyclic $ - plam $ \opq -> + ptryFrom opq = plet (pfromData $ punsafeCoerce opq) $ \tup -> let fst :: Term _ a - fst = ptryFrom @PDeep @PData @a #$ pforgetData $ pfstBuiltin # tup + fst = ptryFrom @PDeep @PData @a $ pforgetData $ pfstBuiltin # tup snd :: Term _ b - snd = ptryFrom @PDeep @PData @b #$ pforgetData $ psndBuiltin # tup + snd = ptryFrom @PDeep @PData @b $ pforgetData $ psndBuiltin # tup in pdata $ ppairDataBuiltin # fst # snd instance @@ -157,16 +155,16 @@ instance ) => PTryFrom PDeep PData (PAsData (PDataRecord (x ': xs))) where - ptryFrom = phoistAcyclic $ - plam $ \opq -> plet (pfromData @(PBuiltinList _) $ punsafeCoerce opq) $ \lst -> + ptryFrom opq = + plet (pfromData @(PBuiltinList _) $ punsafeCoerce opq) $ \lst -> let lsthead :: Term _ PData lsthead = phead # lst lsttail :: Term _ (PAsData (PBuiltinList PData)) lsttail = pdata $ ptail # lst in punsafeCoerce $ pdcons @s - # (ptryFrom @PDeep @PData @(PAsData b) # lsthead) - # (pfromData (ptryFrom @PDeep @PData @(PAsData (PDataRecord xs)) # pforgetData lsttail)) + # (ptryFrom @PDeep @PData @(PAsData b) lsthead) + # (pfromData (ptryFrom @PDeep @PData @(PAsData (PDataRecord xs)) (pforgetData lsttail))) instance {-# OVERLAPPING #-} @@ -175,13 +173,12 @@ instance ) => PTryFrom PDeep PData (PAsData (PDataRecord '[x])) where - ptryFrom = phoistAcyclic $ - plam $ \opq -> + ptryFrom opq = let lsthead :: Term _ PData lsthead = phead # (pfromData @(PBuiltinList _) $ punsafeCoerce opq) in punsafeCoerce $ pdcons @s - # (ptryFrom @PDeep @PData @(PAsData b) # lsthead) + # (ptryFrom @PDeep @PData @(PAsData b) lsthead) # pdnil ----------------------- PDeep POpaque instances ----------------------------------------- @@ -199,22 +196,21 @@ instance ) => PTryFrom PDeep POpaque a where - ptryFrom = phoistAcyclic $ - plam $ \opq -> + ptryFrom opq = let prop :: Term _ a prop = punsafeCoerce opq - in pfromData $ ptryFrom @PDeep @PData @(PAsData a) #$ pforgetData $ pdata prop + in pfromData $ ptryFrom @PDeep @PData @(PAsData a) $ pforgetData $ pdata prop ----------------------- PShallow PData instances ---------------------------------------- instance PTryFrom PShallow PData (PAsData (PBuiltinList PData)) where - ptryFrom = pcheckList + ptryFrom = (pcheckList #) instance PTryFrom PShallow PData (PAsData (PBuiltinMap PData PData)) where - ptryFrom = pcheckMap + ptryFrom = (pcheckMap #) instance PTryFrom PShallow PData PData where - ptryFrom = plam id + ptryFrom = id -- PShallow POpaque instances wouldn't make sense as that wouldn't do any verifying at all diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/VerifySpec.hs index d1ccbb564..0a689de9a 100644 --- a/plutarch-test/src/Plutarch/VerifySpec.hs +++ b/plutarch-test/src/Plutarch/VerifySpec.hs @@ -61,6 +61,12 @@ spec = do @(PBuiltinList (PAsData PInteger)) (pdata $ (pcons # (pdata $ pconstant 3)) #$ (psingleton # (pdata $ pconstant 4))) @-> pfails + "A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer }" + @| checkDeep + @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) + @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) + (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) + @-> pfails "working" @\ do "int == int" @| checkShallow @PInteger @PInteger (pdata $ pconstant 42) @@ -77,11 +83,21 @@ spec = do @(PBuiltinList (PAsData PByteString)) (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) @-> psucceeds - "A { test := String, test2 := Integer } == { test := String, test2 := Integer }" + "A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer }" @| checkDeep @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) (pdata (pdcons @"foo" # (pdata $ pconstant 7) #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) + "A { test := Integer, test2 := Integer } == [Integer]" + @| checkDeep + @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) + @(PBuiltinList (PAsData PInteger)) + (pdata (pcons # (pdata $ pconstant 7) #$ pcons # (pdata $ pconstant 42) # pnil)) + "A { test := String, test2 := Integer } == { test := String, test2 := Integer }" + @| checkDeep + @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) + @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) + (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) "removing the data wrapper" @\ do "erroneous" @\ do "(String, Integer) /= (String, String)" @@ -129,11 +145,11 @@ spec = do l4 = toDatadList [6,8,8,9,10] "concatenate two lists, legal" @| validator # pforgetData l1 # pforgetData l2 # validContext @-> psucceeds - "concatenate tow lists, illegal (list too short)" + "concatenate two lists, illegal (list too short)" @| validator # pforgetData l1 # pforgetData l3 # validContext @-> pfails - "concatenate tow lists, illegal (wrong elements in list)" + "concatenate two lists, illegal (wrong elements in list)" @| validator # pforgetData l1 # pforgetData l4 # validContext @-> pfails - "concatenate tow lists, illegal (more than one output)" + "concatenate two lists, illegal (more than one output)" @| validator # pforgetData l1 # pforgetData l2 # invalidContext @-> pfails -- rec :: Term _ (PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) @@ -155,7 +171,7 @@ checkShallow :: ) => ClosedTerm (PAsData actual) -> ClosedTerm (PAsData target) -checkShallow t = ptryFrom @'PShallow #$ pforgetData t +checkShallow t = ptryFrom @'PShallow $ pforgetData t checkDeep :: forall (target :: PType) (actual :: PType). @@ -165,7 +181,7 @@ checkDeep :: ) => ClosedTerm (PAsData actual) -> ClosedTerm (PAsData target) -checkDeep t = ptryFrom @'PDeep #$ pforgetData t +checkDeep t = ptryFrom @'PDeep $ pforgetData t sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) @@ -175,10 +191,10 @@ sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1..10 partialCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList PData)))) partialCheck = let dat :: Term _ PData dat = pforgetData sampleStructure - in ptryFrom @'PDeep #$ dat + in ptryFrom @'PDeep $ dat fullCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) -fullCheck = ptryFrom @'PDeep #$ pforgetData sampleStructure +fullCheck = ptryFrom @'PDeep $ pforgetData sampleStructure ------------------- Example: untrusted Redeemer ------------------------------------ @@ -192,19 +208,19 @@ pmkNatural :: Term s (PInteger :--> PNatural) pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) instance PTryFrom a PData (PAsData PNatural) where - ptryFrom = plam $ \opq -> unTermCont $ do + ptryFrom opq = let i :: Term _ PInteger i = pasInt # opq - pure $ pdata $ pmkNatural # i + in pdata $ pmkNatural # i validator :: Term s PValidator validator = phoistAcyclic $ plam $ \dat red ctx -> unTermCont $ do -- untrusted ---^---^ ^--- trusted let trustedRedeemer :: Term _ (PBuiltinList (PAsData PNatural)) - trustedRedeemer = pfromData $ ptryFrom @'PDeep # red + trustedRedeemer = pfromData $ ptryFrom @'PDeep red trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) - trustedDatum = pfromData $ ptryFrom @'PDeep # dat + trustedDatum = pfromData $ ptryFrom @'PDeep dat -- make the Datum and Redeemer trusted ownHash :: Term _ PDatumHash From 3297fa0d957d6f8bbcc3199a39d379440e3db913 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 09:52:01 -0500 Subject: [PATCH 100/584] Derive PEq for PEither --- Plutarch/Either.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plutarch/Either.hs b/Plutarch/Either.hs index b8001c71b..74c280a57 100644 --- a/Plutarch/Either.hs +++ b/Plutarch/Either.hs @@ -3,9 +3,10 @@ module Plutarch.Either (PEither (..)) where import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) import Plutarch (PType, PlutusType, S, Term) +import Plutarch.Bool (PEq) data PEither (a :: PType) (b :: PType) (s :: S) = PLeft (Term s a) | PRight (Term s b) deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving anyclass (Generic, PlutusType, PEq) From ece6771fe644f8074e13ae2f893b44f0e4667046 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 10:11:26 -0500 Subject: [PATCH 101/584] Add PEq tests --- plutarch-test/goldens/either.bench.golden | 5 ++++ plutarch-test/goldens/either.uplc.eval.golden | 5 ++++ plutarch-test/goldens/either.uplc.golden | 5 ++++ plutarch-test/goldens/maybe.bench.golden | 4 +++ plutarch-test/goldens/maybe.uplc.eval.golden | 4 +++ plutarch-test/goldens/maybe.uplc.golden | 4 +++ plutarch-test/goldens/pair.bench.golden | 4 +++ plutarch-test/goldens/pair.uplc.eval.golden | 4 +++ plutarch-test/goldens/pair.uplc.golden | 4 +++ plutarch-test/plutarch-test.cabal | 3 ++ plutarch-test/src/Plutarch/EitherSpec.hs | 18 ++++++++++++ plutarch-test/src/Plutarch/MaybeSpec.hs | 20 +++++++++++++ plutarch-test/src/Plutarch/PairSpec.hs | 28 +++++++++++++++++++ 13 files changed, 108 insertions(+) create mode 100644 plutarch-test/goldens/either.bench.golden create mode 100644 plutarch-test/goldens/either.uplc.eval.golden create mode 100644 plutarch-test/goldens/either.uplc.golden create mode 100644 plutarch-test/goldens/maybe.bench.golden create mode 100644 plutarch-test/goldens/maybe.uplc.eval.golden create mode 100644 plutarch-test/goldens/maybe.uplc.golden create mode 100644 plutarch-test/goldens/pair.bench.golden create mode 100644 plutarch-test/goldens/pair.uplc.eval.golden create mode 100644 plutarch-test/goldens/pair.uplc.golden create mode 100644 plutarch-test/src/Plutarch/EitherSpec.hs create mode 100644 plutarch-test/src/Plutarch/MaybeSpec.hs create mode 100644 plutarch-test/src/Plutarch/PairSpec.hs diff --git a/plutarch-test/goldens/either.bench.golden b/plutarch-test/goldens/either.bench.golden new file mode 100644 index 000000000..abcf70dd9 --- /dev/null +++ b/plutarch-test/goldens/either.bench.golden @@ -0,0 +1,5 @@ +eq.true.left {"exBudgetCPU":1715938,"exBudgetMemory":5402,"scriptSizeBytes":67} +eq.true.right {"exBudgetCPU":1715938,"exBudgetMemory":5402,"scriptSizeBytes":67} +eq.false.left-right {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":67} +eq.false.left-left {"exBudgetCPU":1715938,"exBudgetMemory":5402,"scriptSizeBytes":67} +eq.false.right-right {"exBudgetCPU":1715938,"exBudgetMemory":5402,"scriptSizeBytes":67} \ No newline at end of file diff --git a/plutarch-test/goldens/either.uplc.eval.golden b/plutarch-test/goldens/either.uplc.eval.golden new file mode 100644 index 000000000..7d8b63ad6 --- /dev/null +++ b/plutarch-test/goldens/either.uplc.eval.golden @@ -0,0 +1,5 @@ +eq.true.left (program 1.0.0 True) +eq.true.right (program 1.0.0 True) +eq.false.left-right (program 1.0.0 False) +eq.false.left-left (program 1.0.0 False) +eq.false.right-right (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/either.uplc.golden b/plutarch-test/goldens/either.uplc.golden new file mode 100644 index 000000000..b5a97c524 --- /dev/null +++ b/plutarch-test/goldens/either.uplc.golden @@ -0,0 +1,5 @@ +eq.true.left (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) +eq.true.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i1 42) (\i0 -> \i0 -> i1 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) +eq.false.left-right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i1 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) +eq.false.left-left (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) +eq.false.right-right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i1 24) (\i0 -> \i0 -> i1 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.bench.golden b/plutarch-test/goldens/maybe.bench.golden new file mode 100644 index 000000000..061701efb --- /dev/null +++ b/plutarch-test/goldens/maybe.bench.golden @@ -0,0 +1,4 @@ +eq.true.nothing {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":46} +eq.true.just {"exBudgetCPU":1447981,"exBudgetMemory":4502,"scriptSizeBytes":51} +eq.false.nothing-just {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":48} +eq.false.just-just {"exBudgetCPU":1447981,"exBudgetMemory":4502,"scriptSizeBytes":51} \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.eval.golden b/plutarch-test/goldens/maybe.uplc.eval.golden new file mode 100644 index 000000000..4a70ad9fd --- /dev/null +++ b/plutarch-test/goldens/maybe.uplc.eval.golden @@ -0,0 +1,4 @@ +eq.true.nothing (program 1.0.0 True) +eq.true.just (program 1.0.0 True) +eq.false.nothing-just (program 1.0.0 False) +eq.false.just-just (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.golden b/plutarch-test/goldens/maybe.uplc.golden new file mode 100644 index 000000000..225ed9921 --- /dev/null +++ b/plutarch-test/goldens/maybe.uplc.golden @@ -0,0 +1,4 @@ +eq.true.nothing (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay (equalsInteger i2 i1)))) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> force i1))) +eq.true.just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay (equalsInteger i2 i1)))) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42))) +eq.false.nothing-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay (equalsInteger i2 i1)))) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> i2 42))) +eq.false.just-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay (equalsInteger i2 i1)))) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) \ No newline at end of file diff --git a/plutarch-test/goldens/pair.bench.golden b/plutarch-test/goldens/pair.bench.golden new file mode 100644 index 000000000..e527cf562 --- /dev/null +++ b/plutarch-test/goldens/pair.bench.golden @@ -0,0 +1,4 @@ +eq.true {"exBudgetCPU":2496172,"exBudgetMemory":7504,"scriptSizeBytes":72} +eq.false.fst {"exBudgetCPU":2222080,"exBudgetMemory":7103,"scriptSizeBytes":72} +eq.false.snd {"exBudgetCPU":2406853,"exBudgetMemory":7204,"scriptSizeBytes":76} +eq.false.both {"exBudgetCPU":2132761,"exBudgetMemory":6803,"scriptSizeBytes":76} \ No newline at end of file diff --git a/plutarch-test/goldens/pair.uplc.eval.golden b/plutarch-test/goldens/pair.uplc.eval.golden new file mode 100644 index 000000000..f93364c5e --- /dev/null +++ b/plutarch-test/goldens/pair.uplc.eval.golden @@ -0,0 +1,4 @@ +eq.true (program 1.0.0 True) +eq.false.fst (program 1.0.0 False) +eq.false.snd (program 1.0.0 False) +eq.false.both (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/pair.uplc.golden b/plutarch-test/goldens/pair.uplc.golden new file mode 100644 index 000000000..9ab076b98 --- /dev/null +++ b/plutarch-test/goldens/pair.uplc.golden @@ -0,0 +1,4 @@ +eq.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 (force (i7 True (delay (equalsInteger i4 i2)))) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i5) (\i0 -> i1 42 i5)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) "Hello")) +eq.false.fst (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 (force (i7 True (delay (equalsInteger i4 i2)))) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i5) (\i0 -> i1 24 i5)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) "Hello")) +eq.false.snd (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 (force (i7 True (delay (equalsInteger i4 i2)))) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 42 "World")) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) +eq.false.both (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 (force (i7 True (delay (equalsInteger i4 i2)))) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 24 "World")) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 87dbe146f..3a57c37ea 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -121,9 +121,12 @@ executable plutarch-test Plutarch.ApiSpec Plutarch.BoolSpec Plutarch.ByteStringSpec + Plutarch.EitherSpec Plutarch.IntegerSpec Plutarch.LiftSpec Plutarch.ListSpec + Plutarch.MaybeSpec + Plutarch.PairSpec Plutarch.PIsDataSpec Plutarch.PLamSpec Plutarch.PlutusTypeSpec diff --git a/plutarch-test/src/Plutarch/EitherSpec.hs b/plutarch-test/src/Plutarch/EitherSpec.hs new file mode 100644 index 000000000..3c895e279 --- /dev/null +++ b/plutarch-test/src/Plutarch/EitherSpec.hs @@ -0,0 +1,18 @@ +module Plutarch.EitherSpec (spec) where + +import Test.Syd + +import Plutarch.Prelude +import Plutarch.Test + +spec :: Spec +spec = do + describe "either" . pgoldenSpec $ do + "eq" @\ do + "true" @\ do + "left" @| pcon @(PEither PInteger PInteger) (PLeft 42) #== pcon (PLeft 42) @-> passert + "right" @| pcon @(PEither PInteger PInteger) (PRight 42) #== pcon (PRight 42) @-> passert + "false" @\ do + "left-right" @| pcon @(PEither PInteger PInteger) (PLeft 42) #== pcon (PRight 42) @-> passertNot + "left-left" @| pcon @(PEither PInteger PInteger) (PLeft 24) #== pcon (PLeft 42) @-> passertNot + "right-right" @| pcon @(PEither PInteger PInteger) (PRight 24) #== pcon (PRight 42) @-> passertNot diff --git a/plutarch-test/src/Plutarch/MaybeSpec.hs b/plutarch-test/src/Plutarch/MaybeSpec.hs new file mode 100644 index 000000000..5f51a1b0d --- /dev/null +++ b/plutarch-test/src/Plutarch/MaybeSpec.hs @@ -0,0 +1,20 @@ +module Plutarch.MaybeSpec (spec) where + +import Test.Syd + +import Plutarch +import Plutarch.Bool (PEq ((#==))) +import Plutarch.Integer (PInteger) +import Plutarch.Maybe (PMaybe (PJust, PNothing)) +import Plutarch.Test + +spec :: Spec +spec = do + describe "maybe" . pgoldenSpec $ do + "eq" @\ do + "true" @\ do + "nothing" @| pcon @(PMaybe PInteger) PNothing #== pcon PNothing @-> passert + "just" @| pcon @(PMaybe PInteger) (PJust 42) #== pcon (PJust 42) @-> passert + "false" @\ do + "nothing-just" @| pcon @(PMaybe PInteger) PNothing #== pcon (PJust 42) @-> passertNot + "just-just" @| pcon @(PMaybe PInteger) (PJust 24) #== pcon (PJust 42) @-> passertNot diff --git a/plutarch-test/src/Plutarch/PairSpec.hs b/plutarch-test/src/Plutarch/PairSpec.hs new file mode 100644 index 000000000..65f5613f2 --- /dev/null +++ b/plutarch-test/src/Plutarch/PairSpec.hs @@ -0,0 +1,28 @@ +module Plutarch.PairSpec (spec) where + +import Test.Syd + +import Plutarch.Prelude +import Plutarch.Test + +spec :: Spec +spec = do + describe "pair" . pgoldenSpec $ do + "eq" @\ do + "true" + @| pcon @(PPair PInteger PString) (PPair 42 "Hello") + #== pcon (PPair 42 "Hello") + @-> passert + "false" @\ do + "fst" + @| pcon @(PPair PInteger PString) (PPair 42 "Hello") + #== pcon (PPair 24 "Hello") + @-> passertNot + "snd" + @| pcon @(PPair PInteger PString) (PPair 42 "Hello") + #== pcon (PPair 42 "World") + @-> passertNot + "both" + @| pcon @(PPair PInteger PString) (PPair 42 "Hello") + #== pcon (PPair 24 "World") + @-> passertNot From ee91e82153de7752e2294ef5e8062a4ff0929c06 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 10:11:35 -0500 Subject: [PATCH 102/584] plutarch-test: add command for resetting dirty goldens Useful during development. --- plutarch-test/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plutarch-test/README.md b/plutarch-test/README.md index 6d4ceca42..468e54c8a 100644 --- a/plutarch-test/README.md +++ b/plutarch-test/README.md @@ -23,6 +23,8 @@ $ vim cabal.project # And then uncomment the "flags: +developmenet" line. $ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test' -T Main.main ``` +Note: `cabal run` should be run inside `./plutarch-test` directory. + ## The `development` flag Plutarch has a `development` flag. Right now, the flag is used to control tracing functions, wherein turning on the flag will inject `Trace` instructions in the generated UPLC. @@ -31,10 +33,20 @@ Since this will impact the printTerm goldens in tests, we provide `plutarchDevFl ## Goldens +### Navigation + To quickly nagivate and preview the golden files in the terminal, run: -``` +```sh-session nix run nixpkgs#ranger -- ./plutarch-test/goldens/ ``` Then hit `zv` to toggle on preview. Use `hjkl` to naviate. + +### Reset + +When writing tests you may want to clean up working copy goldens, and start from base. To do this, run: + +```sh-session +rm plutarch-test/goldens/*.golden; git restore --source=HEAD --staged --worktree -- plutarch-test/goldens/ +``` \ No newline at end of file From f94a93e4361fb22ecbc980b3805c0b8518bd90d6 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 10:20:49 -0500 Subject: [PATCH 103/584] Add failing test for PEq on recursive data type --- plutarch-test/src/Plutarch/BoolSpec.hs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index a28ff77e6..28e49bc4d 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -1,9 +1,11 @@ module Plutarch.BoolSpec (spec) where +import qualified GHC.Generics as GHC +import Generics.SOP (Generic, I (I)) import Test.Syd -import Plutarch -import Plutarch.Bool (PBool (PFalse, PTrue), pand, pnot, por, (#&&), (#||)) +import Plutarch.Bool (pand, por) +import Plutarch.Prelude import Plutarch.Test spec :: Spec @@ -41,3 +43,23 @@ spec = do "true" @| por # pcon PTrue # perror @-> pfails "op.true" @| pcon PTrue #|| perror @-> psucceeds "op.false" @| pcon PFalse #|| perror @-> pfails + "peq" @\ do + "rec" @\ do + "true" @\ do + "leaf" @| leaf1 #== leaf1 @-> passert + +{- A recursive data type to test PEq behaviour + + This is just a simple binary tree; nothing sophisticated. +-} +data PTree a s + = PLeaf (Term s a) + | PBranch (Term s (PPair (PTree a) (PTree a))) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PlutusType, PEq) + +leaf1 :: Term s (PTree PInteger) +leaf1 = pcon $ PLeaf 42 + +_leaf2 :: Term s (PTree PInteger) +_leaf2 = pcon $ PLeaf 24 From e3a352edad1b7b2a60c09481c2ee674e9977ee9e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 13:20:42 -0500 Subject: [PATCH 104/584] Hoist (#==) using punsafehoistAcyclic --- Plutarch/Bool.hs | 29 +++++++++++++++++++++-------- Plutarch/Internal.hs | 7 +++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 11dd04a96..961b67bf0 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -22,6 +22,7 @@ module Plutarch.Bool ( import Data.Foldable (foldl') import Data.SOP.Constraint import Generics.SOP +import Plutarch.Internal (punsafehoistAcyclic) import Plutarch.Internal.Other ( DerivePNewtype, PDelayed, @@ -77,15 +78,27 @@ class PEq t where Term s t -> Term s t -> Term s PBool - a #== b = go # a # b + a #== b = peq' # a # b where - -- FIXME: hoisting breaks compilation - go = - {- phoistAcyclic $ -} - plam $ \x y -> - pmatch x $ \x' -> - pmatch y $ \y' -> - gpeq @t (pfrom x') (pfrom y') + +peq' :: + forall t s code pcode. + ( code ~ Code (t s) + , pcode ~ ToPType2 code + , Generic (t s) + , PlutusType t + , All2 PEq pcode + , SameShapeAs code pcode + , SameShapeAs pcode code + , AllZipF (AllZip (LiftedCoercible I (Term s))) code pcode + ) => + Term s (t :--> t :--> PBool) +peq' = + punsafehoistAcyclic $ + plam $ \x y -> + pmatch x $ \x' -> + pmatch y $ \y' -> + gpeq @t (pfrom x') (pfrom y') infix 4 #== diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 6f9882530..fee50bf53 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -13,6 +13,7 @@ module Plutarch.Internal ( pdelay, pforce, phoistAcyclic, + punsafehoistAcyclic, perror, punsafeCoerce, punsafeBuiltin, @@ -326,6 +327,12 @@ phoistAcyclic t = case asRawTerm t 0 of in Term $ \_ -> TermResult (RHoisted hoisted) (hoisted : getDeps t') (Left e, _, _) -> error $ "Hoisted term errs! " <> show e +punsafehoistAcyclic :: HasCallStack => Term s a -> Term s a +punsafehoistAcyclic t = phoistAcyclic $ unsafeClosedTerm t + +unsafeClosedTerm :: Term s a -> ClosedTerm a +unsafeClosedTerm (Term t) = (Term t) + -- Couldn't find a definition for this in plutus-core subst :: Word64 -> (Word64 -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () subst idx x (UPLC.Apply () yx yy) = UPLC.Apply () (subst idx x yx) (subst idx x yy) From f030d14d7eadff376cb0fb8442cd9e87560c2462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 3 Feb 2022 16:33:52 -0500 Subject: [PATCH 105/584] Added the new RawTerm constructor --- Plutarch/Internal.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 6f9882530..722dff879 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -75,6 +75,7 @@ data RawTerm | RDelay RawTerm | RConstant (Some (ValueOf PLC.DefaultUni)) | RBuiltin PLC.DefaultFun + | RCompiled (UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) | RError | RHoisted HoistedTerm deriving stock (Show) @@ -91,6 +92,7 @@ hashRawTerm' (RConstant x) = flip hashUpdate ("5" :: BS.ByteString) . flip hashU hashRawTerm' (RBuiltin x) = flip hashUpdate ("6" :: BS.ByteString) . flip hashUpdate (F.flat x) hashRawTerm' RError = flip hashUpdate ("7" :: BS.ByteString) hashRawTerm' (RHoisted (HoistedTerm hash _)) = flip hashUpdate ("8" :: BS.ByteString) . flip hashUpdate hash +hashRawTerm' (RCompiled code) = flip hashUpdate ("9" :: BS.ByteString) . flip hashUpdate (F.flat code) hashRawTerm :: RawTerm -> Dig hashRawTerm t = hashFinalize . hashRawTerm' t $ hashInit @@ -363,6 +365,7 @@ rawTermToUPLC m l (RDelay t) = UPLC.Delay () (rawTermToUPLC m l t) rawTermToUPLC m l (RForce t) = UPLC.Force () (rawTermToUPLC m l t) rawTermToUPLC _ _ (RBuiltin f) = UPLC.Builtin () f rawTermToUPLC _ _ (RConstant c) = UPLC.Constant () c +rawTermToUPLC _ _ (RCompiled code) = code rawTermToUPLC _ _ RError = UPLC.Error () -- rawTermToUPLC m l (RHoisted hoisted) = UPLC.Var () . DeBruijn . Index $ l - m hoisted rawTermToUPLC m l (RHoisted hoisted) = m hoisted l -- UPLC.Var () . DeBruijn . Index $ l - m hoisted From cd73f48262abf0efb98170aa57a985ee806258fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 4 Feb 2022 11:24:21 -0500 Subject: [PATCH 106/584] Added the Plutarch.FFI module --- Plutarch/FFI.hs | 37 +++++++++++++++++++++++++++++++++++++ Plutarch/Internal.hs | 2 ++ plutarch.cabal | 1 + 3 files changed, 40 insertions(+) create mode 100644 Plutarch/FFI.hs diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs new file mode 100644 index 000000000..fcf4e9862 --- /dev/null +++ b/Plutarch/FFI.hs @@ -0,0 +1,37 @@ +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.FFI ( + foreignExport, + foreignImport, +) where + +import Data.Kind (Type) +import Plutarch.Internal (ClosedTerm, PType, RawTerm (RCompiled), Term (Term), TermResult (TermResult), asClosedRawTerm, compile', (:-->)) +import Plutarch.Lift (PLifted) +import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) +import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) +import UntypedPlutusCore (fakeNameDeBruijn) +import qualified UntypedPlutusCore as UPLC + +data ForallPhantom + +foreignExport :: PlutarchInner p ForallPhantom ~ PlutusTxInner t ForallPhantom => ClosedTerm p -> CompiledCode t +foreignExport t = DeserializedCode program Nothing mempty + where + program = + UPLC.Program () (UPLC.Version () 1 0 0) $ + UPLC.termMapNames fakeNameDeBruijn $ + compile' $ + asClosedRawTerm t + +foreignImport :: PlutarchInner p ForallPhantom ~ PlutusTxInner t ForallPhantom => CompiledCode t -> ClosedTerm p +foreignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unScript $ fromCompiledCode c) [] + +type family PlutarchInner (p :: PType) (any :: Type) :: Type where + PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x + PlutarchInner p _ = PLifted p + +type family PlutusTxInner (t :: Type) (any :: Type) :: Type where + PlutusTxInner Bool _ = Bool + PlutusTxInner Integer _ = Integer + PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 722dff879..86ebdd727 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -6,6 +6,7 @@ module Plutarch.Internal ( PDelayed, -- | $term Term (Term, asRawTerm), + asClosedRawTerm, mapTerm, plam', plet, @@ -19,6 +20,7 @@ module Plutarch.Internal ( punsafeConstant, punsafeConstantInternal, compile, + compile', ClosedTerm, Dig, hashTerm, diff --git a/plutarch.cabal b/plutarch.cabal index b122c2c44..5d3103ab4 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -105,6 +105,7 @@ library Plutarch.DataRepr.Internal.HList.Utils Plutarch.Either Plutarch.Evaluate + Plutarch.FFI Plutarch.Integer Plutarch.Internal Plutarch.Internal.Other From 2e99f0f44c57a26c40d1c3833cae6f16f12bf8f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 4 Feb 2022 12:37:59 -0500 Subject: [PATCH 107/584] Added Scott-encoded types to FFI --- Plutarch/FFI.hs | 58 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index fcf4e9862..874683f12 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -6,16 +6,29 @@ module Plutarch.FFI ( ) where import Data.Kind (Type) -import Plutarch.Internal (ClosedTerm, PType, RawTerm (RCompiled), Term (Term), TermResult (TermResult), asClosedRawTerm, compile', (:-->)) -import Plutarch.Lift (PLifted) +import GHC.TypeLits (ErrorMessage (Text), TypeError) +import qualified Generics.SOP as SOP +import Plutarch.Integer (PInteger) +import Plutarch.Internal ( + ClosedTerm, + PType, + RawTerm (RCompiled), + Term (Term), + TermResult (TermResult), + asClosedRawTerm, + compile', + (:-->), + ) +import Plutarch.Internal.PlutusType (PlutusType (PInner)) import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) import UntypedPlutusCore (fakeNameDeBruijn) import qualified UntypedPlutusCore as UPLC -data ForallPhantom +data ForallPhantom :: Type +data PhorallPhantom :: PType -foreignExport :: PlutarchInner p ForallPhantom ~ PlutusTxInner t ForallPhantom => ClosedTerm p -> CompiledCode t +foreignExport :: PlutarchInner p PhorallPhantom ~ PlutusTxInner t ForallPhantom => ClosedTerm p -> CompiledCode t foreignExport t = DeserializedCode program Nothing mempty where program = @@ -24,14 +37,45 @@ foreignExport t = DeserializedCode program Nothing mempty compile' $ asClosedRawTerm t -foreignImport :: PlutarchInner p ForallPhantom ~ PlutusTxInner t ForallPhantom => CompiledCode t -> ClosedTerm p +foreignImport :: PlutarchInner p PhorallPhantom ~ PlutusTxInner t ForallPhantom => CompiledCode t -> ClosedTerm p foreignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unScript $ fromCompiledCode c) [] -type family PlutarchInner (p :: PType) (any :: Type) :: Type where +type family PlutarchInner (p :: PType) (any :: PType) :: Type where + PlutarchInner PInteger _ = Integer PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x - PlutarchInner p _ = PLifted p + PlutarchInner p x = PlutarchInner (PInner p x) x type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner Bool _ = Bool PlutusTxInner Integer _ = Integer PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x + PlutusTxInner a x = PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x + +{- | + List of scott-encoded constructors of a Haskell type (represented by 'SOP.Code') + + ScottList (Code (Either a b)) c = '[a -> c, b -> c] +-} +type ScottList :: [[Type]] -> Type -> [Type] +type family ScottList code c where +-- We disallow certain shapes because Scott encoding is not appropriate for them. + ScottList '[] c = TypeError ( 'Text "PlutusType(scott encoding): Data type without constructors not accepted") + ScottList '[ '[]] c = TypeError ( 'Text "PlutusType(scott encoding): Data type with single nullary constructor not accepted") + ScottList '[ '[_]] c = TypeError ( 'Text "PlutusType(scott encoding): Data type with single unary constructor not accepted; use newtype!") + ScottList (xs ': xss) c = ScottFn xs c ': ScottList' xss c + +type ScottList' :: [[Type]] -> Type -> [Type] +type family ScottList' code c where + ScottList' '[] c = '[] + ScottList' (xs ': xss) c = ScottFn xs c ': ScottList' xss c + +{- | + An individual constructor function of a Scott encoding. + + ScottFn '[a, b] c = (a -> b -> c) + ScottFn '[] c = c +-} +type ScottFn :: [Type] -> Type -> Type +type family ScottFn xs b where + ScottFn '[] b = b + ScottFn (x ': xs) b = x -> ScottFn xs b From 6a2af4cc5c1af7dc5a9ba91eebf46f3df8b03a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 4 Feb 2022 14:20:21 -0500 Subject: [PATCH 108/584] Added PBool and PString --- Plutarch/FFI.hs | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 874683f12..eab6d3bf5 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -6,8 +6,11 @@ module Plutarch.FFI ( ) where import Data.Kind (Type) -import GHC.TypeLits (ErrorMessage (Text), TypeError) +import Data.Text (Text) +import GHC.TypeLits (TypeError) +import qualified GHC.TypeLits as TypeLits import qualified Generics.SOP as SOP +import Plutarch.Bool (PBool) import Plutarch.Integer (PInteger) import Plutarch.Internal ( ClosedTerm, @@ -20,8 +23,10 @@ import Plutarch.Internal ( (:-->), ) import Plutarch.Internal.PlutusType (PlutusType (PInner)) +import Plutarch.String (PString) import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) +import PlutusTx.Prelude (BuiltinString) import UntypedPlutusCore (fakeNameDeBruijn) import qualified UntypedPlutusCore as UPLC @@ -41,13 +46,16 @@ foreignImport :: PlutarchInner p PhorallPhantom ~ PlutusTxInner t ForallPhantom foreignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unScript $ fromCompiledCode c) [] type family PlutarchInner (p :: PType) (any :: PType) :: Type where + PlutarchInner PBool _ = Bool PlutarchInner PInteger _ = Integer + PlutarchInner PString _ = Text PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x PlutarchInner p x = PlutarchInner (PInner p x) x type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner Bool _ = Bool PlutusTxInner Integer _ = Integer + PlutusTxInner BuiltinString _ = Text PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x PlutusTxInner a x = PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x @@ -59,9 +67,17 @@ type family PlutusTxInner (t :: Type) (any :: Type) :: Type where type ScottList :: [[Type]] -> Type -> [Type] type family ScottList code c where -- We disallow certain shapes because Scott encoding is not appropriate for them. - ScottList '[] c = TypeError ( 'Text "PlutusType(scott encoding): Data type without constructors not accepted") - ScottList '[ '[]] c = TypeError ( 'Text "PlutusType(scott encoding): Data type with single nullary constructor not accepted") - ScottList '[ '[_]] c = TypeError ( 'Text "PlutusType(scott encoding): Data type with single unary constructor not accepted; use newtype!") + ScottList '[] c = TypeError ( 'TypeLits.Text "PlutusType(scott encoding): Data type without constructors not accepted") + ScottList '[ '[]] c = + TypeError + ( 'TypeLits.Text + "PlutusType(scott encoding): Data type with single nullary constructor not accepted" + ) + ScottList '[ '[_]] c = + TypeError + ( 'TypeLits.Text + "PlutusType(scott encoding): Data type with single unary constructor not accepted; use newtype!" + ) ScottList (xs ': xss) c = ScottFn xs c ': ScottList' xss c type ScottList' :: [[Type]] -> Type -> [Type] From 5cfb790a080807ae4a3ac024ab360b8a8f0b3e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Sun, 6 Feb 2022 19:59:08 -0500 Subject: [PATCH 109/584] Attempt at support for polymorphic functions --- Plutarch/FFI.hs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index eab6d3bf5..beb141cb7 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -5,7 +5,7 @@ module Plutarch.FFI ( foreignImport, ) where -import Data.Kind (Type) +import Data.Kind (Constraint, Type) import Data.Text (Text) import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits @@ -14,6 +14,7 @@ import Plutarch.Bool (PBool) import Plutarch.Integer (PInteger) import Plutarch.Internal ( ClosedTerm, + PDelayed, PType, RawTerm (RCompiled), Term (Term), @@ -33,7 +34,7 @@ import qualified UntypedPlutusCore as UPLC data ForallPhantom :: Type data PhorallPhantom :: PType -foreignExport :: PlutarchInner p PhorallPhantom ~ PlutusTxInner t ForallPhantom => ClosedTerm p -> CompiledCode t +foreignExport :: PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom => ClosedTerm p -> CompiledCode t foreignExport t = DeserializedCode program Nothing mempty where program = @@ -42,21 +43,29 @@ foreignExport t = DeserializedCode program Nothing mempty compile' $ asClosedRawTerm t -foreignImport :: PlutarchInner p PhorallPhantom ~ PlutusTxInner t ForallPhantom => CompiledCode t -> ClosedTerm p +foreignImport :: PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom => CompiledCode t -> ClosedTerm p foreignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unScript $ fromCompiledCode c) [] +type family a ~~ b :: Constraint where + ForallPhantom ~~ _ = () + _ ~~ ForallPhantom = () + a ~~ b = a ~ b + type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner PBool _ = Bool PlutarchInner PInteger _ = Integer PlutarchInner PString _ = Text - PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x + PlutarchInner PhorallPhantom _ = ForallPhantom + PlutarchInner (a :--> b) x = PlutarchInner a b -> PlutarchInner b x -- hack to support Scott encodings + PlutarchInner (PDelayed a) x = PlutarchInner a x PlutarchInner p x = PlutarchInner (PInner p x) x type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner Bool _ = Bool PlutusTxInner Integer _ = Integer PlutusTxInner BuiltinString _ = Text - PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x + PlutusTxInner ForallPhantom _ = ForallPhantom + PlutusTxInner (a -> b) x = PlutusTxInner a b -> PlutusTxInner b x -- hack to support Scott encodings PlutusTxInner a x = PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x {- | From 7efb565b4191d8cca8eb35169c2b98fe1645ecd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 9 Feb 2022 09:57:42 -0500 Subject: [PATCH 110/584] Added unsafeForeignExport/Import --- Plutarch/FFI.hs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index beb141cb7..9d5a6d68d 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -3,6 +3,8 @@ module Plutarch.FFI ( foreignExport, foreignImport, + unsafeForeignExport, + unsafeForeignImport, ) where import Data.Kind (Constraint, Type) @@ -35,7 +37,13 @@ data ForallPhantom :: Type data PhorallPhantom :: PType foreignExport :: PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom => ClosedTerm p -> CompiledCode t -foreignExport t = DeserializedCode program Nothing mempty +foreignExport = unsafeForeignExport + +foreignImport :: PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom => CompiledCode t -> ClosedTerm p +foreignImport = unsafeForeignImport + +unsafeForeignExport :: ClosedTerm p -> CompiledCode t +unsafeForeignExport t = DeserializedCode program Nothing mempty where program = UPLC.Program () (UPLC.Version () 1 0 0) $ @@ -43,8 +51,8 @@ foreignExport t = DeserializedCode program Nothing mempty compile' $ asClosedRawTerm t -foreignImport :: PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom => CompiledCode t -> ClosedTerm p -foreignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unScript $ fromCompiledCode c) [] +unsafeForeignImport :: CompiledCode t -> ClosedTerm p +unsafeForeignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unScript $ fromCompiledCode c) [] type family a ~~ b :: Constraint where ForallPhantom ~~ _ = () From e766a884d12b392d0bc8b3731d6f519de0765572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 9 Feb 2022 15:06:09 -0500 Subject: [PATCH 111/584] Replaced Bool with BuiltinBool --- Plutarch/FFI.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 9d5a6d68d..573bb9da7 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -28,6 +28,7 @@ import Plutarch.Internal ( import Plutarch.Internal.PlutusType (PlutusType (PInner)) import Plutarch.String (PString) import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) +import PlutusTx.Builtins.Internal (BuiltinBool) import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) import PlutusTx.Prelude (BuiltinString) import UntypedPlutusCore (fakeNameDeBruijn) @@ -60,7 +61,7 @@ type family a ~~ b :: Constraint where a ~~ b = a ~ b type family PlutarchInner (p :: PType) (any :: PType) :: Type where - PlutarchInner PBool _ = Bool + PlutarchInner PBool _ = BuiltinBool PlutarchInner PInteger _ = Integer PlutarchInner PString _ = Text PlutarchInner PhorallPhantom _ = ForallPhantom @@ -69,7 +70,7 @@ type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner p x = PlutarchInner (PInner p x) x type family PlutusTxInner (t :: Type) (any :: Type) :: Type where - PlutusTxInner Bool _ = Bool + PlutusTxInner BuiltinBool _ = BuiltinBool PlutusTxInner Integer _ = Integer PlutusTxInner BuiltinString _ = Text PlutusTxInner ForallPhantom _ = ForallPhantom From 3b9823905cef78a75c99c5c48648db455204623c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 9 Feb 2022 15:49:18 -0500 Subject: [PATCH 112/584] Fixing the handling of Delayed --- Plutarch/FFI.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 573bb9da7..d19c9d25c 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -1,6 +1,7 @@ {-# LANGUAGE UndecidableInstances #-} module Plutarch.FFI ( + Delayed, foreignExport, foreignImport, unsafeForeignExport, @@ -37,6 +38,8 @@ import qualified UntypedPlutusCore as UPLC data ForallPhantom :: Type data PhorallPhantom :: PType +data Delayed :: Type -> Type + foreignExport :: PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom => ClosedTerm p -> CompiledCode t foreignExport = unsafeForeignExport @@ -58,6 +61,7 @@ unsafeForeignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unS type family a ~~ b :: Constraint where ForallPhantom ~~ _ = () _ ~~ ForallPhantom = () + Delayed a ~~ Delayed b = a ~~ b a ~~ b = a ~ b type family PlutarchInner (p :: PType) (any :: PType) :: Type where @@ -66,7 +70,7 @@ type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner PString _ = Text PlutarchInner PhorallPhantom _ = ForallPhantom PlutarchInner (a :--> b) x = PlutarchInner a b -> PlutarchInner b x -- hack to support Scott encodings - PlutarchInner (PDelayed a) x = PlutarchInner a x + PlutarchInner (PDelayed a) x = Delayed (PlutarchInner a x) PlutarchInner p x = PlutarchInner (PInner p x) x type family PlutusTxInner (t :: Type) (any :: Type) :: Type where @@ -75,7 +79,8 @@ type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner BuiltinString _ = Text PlutusTxInner ForallPhantom _ = ForallPhantom PlutusTxInner (a -> b) x = PlutusTxInner a b -> PlutusTxInner b x -- hack to support Scott encodings - PlutusTxInner a x = PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x + PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) + PlutusTxInner a x = Delayed (PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x) {- | List of scott-encoded constructors of a Haskell type (represented by 'SOP.Code') From 662f48da2a5b1d21fd727c6534bc71ef5114f826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 10 Feb 2022 09:25:22 -0500 Subject: [PATCH 113/584] Eliminated the hack, found a workaround --- Plutarch/FFI.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index d19c9d25c..2efeeea19 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -69,7 +69,7 @@ type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner PInteger _ = Integer PlutarchInner PString _ = Text PlutarchInner PhorallPhantom _ = ForallPhantom - PlutarchInner (a :--> b) x = PlutarchInner a b -> PlutarchInner b x -- hack to support Scott encodings + PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x PlutarchInner (PDelayed a) x = Delayed (PlutarchInner a x) PlutarchInner p x = PlutarchInner (PInner p x) x @@ -78,7 +78,7 @@ type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner Integer _ = Integer PlutusTxInner BuiltinString _ = Text PlutusTxInner ForallPhantom _ = ForallPhantom - PlutusTxInner (a -> b) x = PlutusTxInner a b -> PlutusTxInner b x -- hack to support Scott encodings + PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) PlutusTxInner a x = Delayed (PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x) From 6c238628157528eb9bc6a7203019b8f6a7b4e949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 14 Feb 2022 09:31:36 -0500 Subject: [PATCH 114/584] Added the PData <-> BuiltinData equivalence --- Plutarch/FFI.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 2efeeea19..98d6ba75a 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -14,6 +14,7 @@ import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits import qualified Generics.SOP as SOP import Plutarch.Bool (PBool) +import Plutarch.Builtin (PData) import Plutarch.Integer (PInteger) import Plutarch.Internal ( ClosedTerm, @@ -29,7 +30,7 @@ import Plutarch.Internal ( import Plutarch.Internal.PlutusType (PlutusType (PInner)) import Plutarch.String (PString) import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) -import PlutusTx.Builtins.Internal (BuiltinBool) +import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinData) import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) import PlutusTx.Prelude (BuiltinString) import UntypedPlutusCore (fakeNameDeBruijn) @@ -68,6 +69,7 @@ type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner PBool _ = BuiltinBool PlutarchInner PInteger _ = Integer PlutarchInner PString _ = Text + PlutarchInner PData _ = BuiltinData PlutarchInner PhorallPhantom _ = ForallPhantom PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x PlutarchInner (PDelayed a) x = Delayed (PlutarchInner a x) @@ -77,6 +79,7 @@ type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner BuiltinBool _ = BuiltinBool PlutusTxInner Integer _ = Integer PlutusTxInner BuiltinString _ = Text + PlutusTxInner BuiltinData _ = BuiltinData PlutusTxInner ForallPhantom _ = ForallPhantom PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) From a872e7f13f35d0969dd5f69830c257ee30054519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 14 Feb 2022 13:43:00 -0500 Subject: [PATCH 115/584] Added safe-ish coercions of PAsData functions --- Plutarch/FFI.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 98d6ba75a..d31b9938a 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -14,7 +14,7 @@ import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits import qualified Generics.SOP as SOP import Plutarch.Bool (PBool) -import Plutarch.Builtin (PData) +import Plutarch.Builtin (PAsData, PData) import Plutarch.Integer (PInteger) import Plutarch.Internal ( ClosedTerm, @@ -71,6 +71,8 @@ type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner PString _ = Text PlutarchInner PData _ = BuiltinData PlutarchInner PhorallPhantom _ = ForallPhantom + PlutarchInner (PAsData a :--> PAsData b) x = PlutarchInner (PData :--> PData) x + PlutarchInner (PAsData a :--> b) x = PlutarchInner (PData :--> b) x PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x PlutarchInner (PDelayed a) x = Delayed (PlutarchInner a x) PlutarchInner p x = PlutarchInner (PInner p x) x From a77fac89e833e7b5ce7ab1917a9f930ee554a7fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 15 Feb 2022 09:11:21 -0500 Subject: [PATCH 116/584] Handling ByteString and newtypes --- Plutarch/FFI.hs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index d31b9938a..9f96c9f6f 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-unused-imports #-} module Plutarch.FFI ( Delayed, @@ -8,13 +9,16 @@ module Plutarch.FFI ( unsafeForeignImport, ) where +import Data.ByteString (ByteString) import Data.Kind (Constraint, Type) import Data.Text (Text) +import GHC.Generics (C, D, K1, M1, Meta (MetaData), Rep, S) import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits import qualified Generics.SOP as SOP import Plutarch.Bool (PBool) import Plutarch.Builtin (PAsData, PData) +import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) import Plutarch.Internal ( ClosedTerm, @@ -29,8 +33,11 @@ import Plutarch.Internal ( ) import Plutarch.Internal.PlutusType (PlutusType (PInner)) import Plutarch.String (PString) +import Plutus.V1.Ledger.Api ( + PubKeyHash (..), + ) import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) -import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinData) +import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinByteString, BuiltinData) import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) import PlutusTx.Prelude (BuiltinString) import UntypedPlutusCore (fakeNameDeBruijn) @@ -69,6 +76,7 @@ type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner PBool _ = BuiltinBool PlutarchInner PInteger _ = Integer PlutarchInner PString _ = Text + PlutarchInner PByteString _ = ByteString PlutarchInner PData _ = BuiltinData PlutarchInner PhorallPhantom _ = ForallPhantom PlutarchInner (PAsData a :--> PAsData b) x = PlutarchInner (PData :--> PData) x @@ -81,11 +89,17 @@ type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner BuiltinBool _ = BuiltinBool PlutusTxInner Integer _ = Integer PlutusTxInner BuiltinString _ = Text + PlutusTxInner BuiltinByteString _ = ByteString PlutusTxInner BuiltinData _ = BuiltinData PlutusTxInner ForallPhantom _ = ForallPhantom PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) - PlutusTxInner a x = Delayed (PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x) + PlutusTxInner a x = TypeEncoding a (Rep a) x + +type TypeEncoding :: Type -> (Type -> Type) -> Type -> Type +type family TypeEncoding a rep x where + TypeEncoding a (M1 D ( 'MetaData _ _ _ 'True) (M1 C _ (M1 S _ (K1 _ b)))) x = PlutusTxInner b x -- newtype + TypeEncoding a _ x = Delayed (PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x) {- | List of scott-encoded constructors of a Haskell type (represented by 'SOP.Code') From bd2da6a054574c0edfedfd44fc7077f186f404e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 15 Feb 2022 10:25:30 -0500 Subject: [PATCH 117/584] Exported type (>~<) and added Haddock comments --- Plutarch/FFI.hs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 9f96c9f6f..890dc4b86 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -1,8 +1,7 @@ {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -Wno-unused-imports #-} module Plutarch.FFI ( - Delayed, + type (>~<), foreignExport, foreignImport, unsafeForeignExport, @@ -33,9 +32,6 @@ import Plutarch.Internal ( ) import Plutarch.Internal.PlutusType (PlutusType (PInner)) import Plutarch.String (PString) -import Plutus.V1.Ledger.Api ( - PubKeyHash (..), - ) import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinByteString, BuiltinData) import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) @@ -48,12 +44,15 @@ data PhorallPhantom :: PType data Delayed :: Type -> Type -foreignExport :: PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom => ClosedTerm p -> CompiledCode t +-- | Compile and export a Plutarch term so it can be used by `PlutusTx.applyCode`. +foreignExport :: p >~< t => ClosedTerm p -> CompiledCode t foreignExport = unsafeForeignExport -foreignImport :: PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom => CompiledCode t -> ClosedTerm p +-- | Import compiled UPLC code (such as a spliced `PlutusTx.compile` result) as a Plutarch term. +foreignImport :: p >~< t => CompiledCode t -> ClosedTerm p foreignImport = unsafeForeignImport +-- | Seriously unsafe, may fail at run time or result in unexpected behaviour in your on-chain validator. unsafeForeignExport :: ClosedTerm p -> CompiledCode t unsafeForeignExport t = DeserializedCode program Nothing mempty where @@ -63,9 +62,13 @@ unsafeForeignExport t = DeserializedCode program Nothing mempty compile' $ asClosedRawTerm t +-- | Seriously unsafe, may fail at run time or result in unexpected behaviour in your on-chain validator. unsafeForeignImport :: CompiledCode t -> ClosedTerm p unsafeForeignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unScript $ fromCompiledCode c) [] +-- | Equality of inner types - Plutarch on the left and Haskell on the right. +type p >~< t = PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom + type family a ~~ b :: Constraint where ForallPhantom ~~ _ = () _ ~~ ForallPhantom = () From 85ea0a1abaa0dbf4ef968b3703ace5c0971c0b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 15 Feb 2022 12:34:03 -0500 Subject: [PATCH 118/584] Added BuiltinUnit >~< PUnit --- Plutarch/FFI.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 890dc4b86..df3ef6da5 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -32,8 +32,9 @@ import Plutarch.Internal ( ) import Plutarch.Internal.PlutusType (PlutusType (PInner)) import Plutarch.String (PString) +import Plutarch.Unit (PUnit) import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) -import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinByteString, BuiltinData) +import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinByteString, BuiltinData, BuiltinUnit) import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) import PlutusTx.Prelude (BuiltinString) import UntypedPlutusCore (fakeNameDeBruijn) @@ -81,6 +82,7 @@ type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner PString _ = Text PlutarchInner PByteString _ = ByteString PlutarchInner PData _ = BuiltinData + PlutarchInner PUnit _ = () PlutarchInner PhorallPhantom _ = ForallPhantom PlutarchInner (PAsData a :--> PAsData b) x = PlutarchInner (PData :--> PData) x PlutarchInner (PAsData a :--> b) x = PlutarchInner (PData :--> b) x @@ -94,6 +96,7 @@ type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner BuiltinString _ = Text PlutusTxInner BuiltinByteString _ = ByteString PlutusTxInner BuiltinData _ = BuiltinData + PlutusTxInner BuiltinUnit _ = () PlutusTxInner ForallPhantom _ = ForallPhantom PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) From 8a464211cb932cdc9cd4ea9a3a8c63758186668d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 16 Feb 2022 15:00:39 -0500 Subject: [PATCH 119/584] Added PDelayedList --- Plutarch/FFI.hs | 66 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index df3ef6da5..9dbb3faac 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -2,8 +2,11 @@ module Plutarch.FFI ( type (>~<), + PDelayedList (PDCons, PDNil), foreignExport, foreignImport, + pdelayList, + pforceList, unsafeForeignExport, unsafeForeignImport, ) where @@ -11,26 +14,38 @@ module Plutarch.FFI ( import Data.ByteString (ByteString) import Data.Kind (Constraint, Type) import Data.Text (Text) -import GHC.Generics (C, D, K1, M1, Meta (MetaData), Rep, S) +import GHC.Generics (C, D, Generic, K1, M1, Meta (MetaData), Rep) +import qualified GHC.Generics as Generics import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits import qualified Generics.SOP as SOP -import Plutarch.Bool (PBool) +import Plutarch ( + ClosedTerm, + PDelayed, + PType, + S, + pcon, + pdelay, + pforce, + phoistAcyclic, + plam, + pto, + (#), + (:-->), + ) +import Plutarch.Bool (PBool, PEq, (#==)) import Plutarch.Builtin (PAsData, PData) import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) import Plutarch.Internal ( - ClosedTerm, - PDelayed, - PType, RawTerm (RCompiled), Term (Term), TermResult (TermResult), asClosedRawTerm, compile', - (:-->), ) -import Plutarch.Internal.PlutusType (PlutusType (PInner)) +import Plutarch.Internal.PlutusType (PlutusType (PInner, pcon', pmatch')) +import Plutarch.List (PList, PListLike (PElemConstraint, pcons, pelimList, pnil), pconvertLists, plistEquals) import Plutarch.String (PString) import Plutarch.Unit (PUnit) import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) @@ -44,6 +59,19 @@ data ForallPhantom :: Type data PhorallPhantom :: PType data Delayed :: Type -> Type +data DelayedList :: Type -> Type + +-- | Plutarch type of delayed lists, compatible with the PlutusTx encoding of +-- Haskell lists and convertible with the regular 'PList' using 'pdelayList' +-- and 'pforceList'. +data PDelayedList (a :: PType) (s :: S) + = PDCons (Term s a) (Term s (PDelayedList a)) + | PDNil + deriving stock (Generic) + deriving anyclass (SOP.Generic) + +instance PEq a => PEq (PDelayedList a) where + (#==) xs ys = plistEquals # xs # ys -- | Compile and export a Plutarch term so it can be used by `PlutusTx.applyCode`. foreignExport :: p >~< t => ClosedTerm p -> CompiledCode t @@ -67,6 +95,26 @@ unsafeForeignExport t = DeserializedCode program Nothing mempty unsafeForeignImport :: CompiledCode t -> ClosedTerm p unsafeForeignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unScript $ fromCompiledCode c) [] +-- | Convert a strict 'PList' to a 'PDelayList', perhaps before exporting it with 'foreignExport'. +pdelayList :: Term s (PList a :--> PDelayedList a) +pdelayList = pconvertLists + +-- | Convert a 'PDelayList' to a strict 'PList', probably after importing it with 'foreignImport'. +pforceList :: Term s (PDelayedList a :--> PList a) +pforceList = pconvertLists + +instance PlutusType (PDelayedList a) where + type PInner (PDelayedList a) r = PDelayed (r :--> (a :--> PDelayedList a :--> r) :--> r) + pcon' (PDCons x xs) = pdelay $ plam $ \_nil cons -> cons # x # xs + pcon' PDNil = phoistAcyclic $ pdelay $ plam $ \nil _cons -> nil + pmatch' elim f = pforce elim # f PDNil # (plam $ \x xs -> f $ PDCons x xs) + +instance PListLike PDelayedList where + type PElemConstraint PDelayedList _ = () + pelimList cons nil list = pforce (pto list) # nil # plam cons + pcons = phoistAcyclic $ plam $ \x xs -> pcon (PDCons x xs) + pnil = pcon PDNil + -- | Equality of inner types - Plutarch on the left and Haskell on the right. type p >~< t = PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom @@ -88,6 +136,7 @@ type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner (PAsData a :--> b) x = PlutarchInner (PData :--> b) x PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x PlutarchInner (PDelayed a) x = Delayed (PlutarchInner a x) + PlutarchInner (PDelayedList a) x = DelayedList (PlutarchInner a x) PlutarchInner p x = PlutarchInner (PInner p x) x type family PlutusTxInner (t :: Type) (any :: Type) :: Type where @@ -100,11 +149,12 @@ type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner ForallPhantom _ = ForallPhantom PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) + PlutusTxInner [a] x = DelayedList (PlutusTxInner a x) PlutusTxInner a x = TypeEncoding a (Rep a) x type TypeEncoding :: Type -> (Type -> Type) -> Type -> Type type family TypeEncoding a rep x where - TypeEncoding a (M1 D ( 'MetaData _ _ _ 'True) (M1 C _ (M1 S _ (K1 _ b)))) x = PlutusTxInner b x -- newtype + TypeEncoding a (M1 D ( 'MetaData _ _ _ 'True) (M1 C _ (M1 Generics.S _ (K1 _ b)))) x = PlutusTxInner b x -- newtype TypeEncoding a _ x = Delayed (PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x) {- | From 452be08d21b2b5f646b1e64ea1f7e25fedb18bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 17 Feb 2022 09:27:15 -0500 Subject: [PATCH 120/584] Using Generics.SOP instead of Generics for newtype detection --- Plutarch/FFI.hs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 9dbb3faac..6c79ecb4f 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -14,11 +14,11 @@ module Plutarch.FFI ( import Data.ByteString (ByteString) import Data.Kind (Constraint, Type) import Data.Text (Text) -import GHC.Generics (C, D, Generic, K1, M1, Meta (MetaData), Rep) -import qualified GHC.Generics as Generics +import GHC.Generics (Generic) import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits import qualified Generics.SOP as SOP +import Generics.SOP.Type.Metadata (DatatypeInfo (Newtype)) import Plutarch ( ClosedTerm, PDelayed, @@ -61,9 +61,10 @@ data PhorallPhantom :: PType data Delayed :: Type -> Type data DelayedList :: Type -> Type --- | Plutarch type of delayed lists, compatible with the PlutusTx encoding of --- Haskell lists and convertible with the regular 'PList' using 'pdelayList' --- and 'pforceList'. +{- | Plutarch type of delayed lists, compatible with the PlutusTx encoding of + Haskell lists and convertible with the regular 'PList' using 'pdelayList' + and 'pforceList'. +-} data PDelayedList (a :: PType) (s :: S) = PDCons (Term s a) (Term s (PDelayedList a)) | PDNil @@ -150,12 +151,12 @@ type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) PlutusTxInner [a] x = DelayedList (PlutusTxInner a x) - PlutusTxInner a x = TypeEncoding a (Rep a) x + PlutusTxInner a x = TypeEncoding (SOP.Code a) (SOP.DatatypeInfoOf a) x -type TypeEncoding :: Type -> (Type -> Type) -> Type -> Type +type TypeEncoding :: [[Type]] -> DatatypeInfo -> Type -> Type type family TypeEncoding a rep x where - TypeEncoding a (M1 D ( 'MetaData _ _ _ 'True) (M1 C _ (M1 Generics.S _ (K1 _ b)))) x = PlutusTxInner b x -- newtype - TypeEncoding a _ x = Delayed (PlutusTxInner (ScottFn (ScottList (SOP.Code a) x) x) x) + TypeEncoding '[ '[b]] ( 'Newtype _ _ _) x = PlutusTxInner b x + TypeEncoding sop _ x = Delayed (PlutusTxInner (ScottFn (ScottList sop x) x) x) {- | List of scott-encoded constructors of a Haskell type (represented by 'SOP.Code') From ec1f5e92d486ee657b319329073202408c23d842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 17 Feb 2022 14:18:35 -0500 Subject: [PATCH 121/584] Matching the sum type encodings of PlutusTx --- Plutarch/FFI.hs | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 6c79ecb4f..c2c56cb69 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -18,7 +18,12 @@ import GHC.Generics (Generic) import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits import qualified Generics.SOP as SOP -import Generics.SOP.Type.Metadata (DatatypeInfo (Newtype)) +import Generics.SOP.GGP (GCode, GDatatypeInfoOf) +import Generics.SOP.Type.Metadata ( + ConstructorInfo (Constructor, Infix, Record), + ConstructorName, + DatatypeInfo (ADT, Newtype), + ) import Plutarch ( ClosedTerm, PDelayed, @@ -151,12 +156,44 @@ type family PlutusTxInner (t :: Type) (any :: Type) :: Type where PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) PlutusTxInner [a] x = DelayedList (PlutusTxInner a x) - PlutusTxInner a x = TypeEncoding (SOP.Code a) (SOP.DatatypeInfoOf a) x + PlutusTxInner a x = TypeEncoding (GCode a) (GDatatypeInfoOf a) x type TypeEncoding :: [[Type]] -> DatatypeInfo -> Type -> Type type family TypeEncoding a rep x where TypeEncoding '[ '[b]] ( 'Newtype _ _ _) x = PlutusTxInner b x - TypeEncoding sop _ x = Delayed (PlutusTxInner (ScottFn (ScottList sop x) x) x) +-- Matching the behaviour of PlutusTx.Lift.Class.sortedCons + TypeEncoding sop ( 'ADT _ "Bool" _ _) x = Delayed (PlutusTxInner (ScottFn (ScottList sop x) x) x) + TypeEncoding sop ( 'ADT _ _ cons _) x = Delayed (PlutusTxInner (ScottFn (ScottList (Fst (SortedBy '(sop, NamesOf cons))) x) x) x) + +type Fst :: (a, b) -> a +type family Fst x where + Fst '(a, _) = a + +type SortedBy :: ([[Type]], [ConstructorName]) -> ([[Type]], [ConstructorName]) +type family SortedBy xs where + SortedBy '((ts ': tss), (name ': names)) = Insert ts name (SortedBy '(tss, names)) + SortedBy '( '[], '[]) = '( '[], '[]) + +type Insert :: [Type] -> ConstructorName -> ([[Type]], [ConstructorName]) -> ([[Type]], [ConstructorName]) +type family Insert ts name xs where + Insert ts1 name1 '(ts2 ': tss, name2 : names) = Insert' (TypeLits.CmpSymbol name1 name2) ts1 name1 '(ts2 ': tss, name2 : names) + Insert ts name '( '[], '[]) = '( '[ts], '[name]) + +type Insert' :: Ordering -> [Type] -> ConstructorName -> ([[Type]], [ConstructorName]) -> ([[Type]], [ConstructorName]) +type family Insert' o ts name xs where + Insert' 'GT ts1 name1 '(ts2 ': tss, name2 ': names) = Cons ts2 name2 (Insert ts1 name1 '(tss, names)) + Insert' _ ts name '(tss, names) = '(ts ': tss, name ': names) + +type Cons :: a -> b -> ([a], [b]) -> ([a], [b]) +type family Cons ts name xs where + Cons ts name '(tss, names) = '(ts ': tss, name ': names) + +type NamesOf :: [ConstructorInfo] -> [ConstructorName] +type family NamesOf cs where + NamesOf ( 'Constructor name ': cs) = name ': NamesOf cs + NamesOf ( 'Infix name _ _ ': cs) = name ': NamesOf cs + NamesOf ( 'Record name _ ': cs) = name ': NamesOf cs + NamesOf '[] = '[] {- | List of scott-encoded constructors of a Haskell type (represented by 'SOP.Code') From 132d246eda15bde667d70390cede8aedeb42213b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 23 Feb 2022 15:36:30 -0500 Subject: [PATCH 122/584] Updated a UPLC import --- Plutarch/FFI.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index c2c56cb69..b3b5b7d8c 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -99,7 +99,7 @@ unsafeForeignExport t = DeserializedCode program Nothing mempty -- | Seriously unsafe, may fail at run time or result in unexpected behaviour in your on-chain validator. unsafeForeignImport :: CompiledCode t -> ClosedTerm p -unsafeForeignImport c = Term $ const $ TermResult (RCompiled $ UPLC.toTerm $ unScript $ fromCompiledCode c) [] +unsafeForeignImport c = Term $ const $ TermResult (RCompiled $ UPLC._progTerm $ unScript $ fromCompiledCode c) [] -- | Convert a strict 'PList' to a 'PDelayList', perhaps before exporting it with 'foreignExport'. pdelayList :: Term s (PList a :--> PDelayedList a) From 1829bae92a3f557881f13d8854850d2ce9061778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 28 Feb 2022 13:49:49 -0500 Subject: [PATCH 123/584] Added opaqueExport/Import --- Plutarch/FFI.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index b3b5b7d8c..5fde43fca 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -5,6 +5,8 @@ module Plutarch.FFI ( PDelayedList (PDCons, PDNil), foreignExport, foreignImport, + opaqueExport, + opaqueImport, pdelayList, pforceList, unsafeForeignExport, @@ -14,6 +16,7 @@ module Plutarch.FFI ( import Data.ByteString (ByteString) import Data.Kind (Constraint, Type) import Data.Text (Text) +import Data.Void (Void) import GHC.Generics (Generic) import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits @@ -27,6 +30,7 @@ import Generics.SOP.Type.Metadata ( import Plutarch ( ClosedTerm, PDelayed, + POpaque, PType, S, pcon, @@ -87,6 +91,14 @@ foreignExport = unsafeForeignExport foreignImport :: p >~< t => CompiledCode t -> ClosedTerm p foreignImport = unsafeForeignImport +-- | Export Plutarch term of any type as @CompiledCode Void@. +opaqueExport :: ClosedTerm p -> CompiledCode Void +opaqueExport = unsafeForeignExport + +-- | Import compiled UPLC code of any type as a Plutarch opaque term. +opaqueImport :: CompiledCode t -> ClosedTerm POpaque +opaqueImport = unsafeForeignImport + -- | Seriously unsafe, may fail at run time or result in unexpected behaviour in your on-chain validator. unsafeForeignExport :: ClosedTerm p -> CompiledCode t unsafeForeignExport t = DeserializedCode program Nothing mempty From ef68571110b46b3ec02274b29b1c56601fc7fffa Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 13:42:32 -0500 Subject: [PATCH 124/584] Add PGeneric And move to helper module. --- Plutarch/Bool.hs | 67 ++++++++------------------- Plutarch/DataRepr/Internal/Generic.hs | 39 ++++++++++++++-- 2 files changed, 56 insertions(+), 50 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 961b67bf0..4dec5fac9 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -20,8 +20,18 @@ module Plutarch.Bool ( ) where import Data.Foldable (foldl') -import Data.SOP.Constraint -import Generics.SOP +import Generics.SOP ( + All, + All2, + HCollapse (hcollapse), + K (..), + NP, + Proxy (..), + SOP (..), + ccompare_NS, + hcliftA2, + ) +import Plutarch.DataRepr.Internal.Generic (PCode, PGeneric, pfrom) import Plutarch.Internal (punsafehoistAcyclic) import Plutarch.Internal.Other ( DerivePNewtype, @@ -39,7 +49,6 @@ import Plutarch.Internal.Other ( (#), type (:-->), ) -import Plutarch.Internal.TypeFamily (ToPType2) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstant, @@ -65,32 +74,17 @@ instance PlutusType PBool where class PEq t where (#==) :: Term s t -> Term s t -> Term s PBool default (#==) :: - forall s code pcode. - ( code ~ Code (t s) - , pcode ~ ToPType2 code - , Generic (t s) - , PlutusType t - , All2 PEq pcode - , SameShapeAs code pcode - , SameShapeAs pcode code - , AllZipF (AllZip (LiftedCoercible I (Term s))) code pcode - ) => + (PGeneric s t, PlutusType t, All2 PEq (PCode s t)) => Term s t -> Term s t -> Term s PBool a #== b = peq' # a # b - where peq' :: - forall t s code pcode. - ( code ~ Code (t s) - , pcode ~ ToPType2 code - , Generic (t s) + forall t s. + ( PGeneric s t , PlutusType t - , All2 PEq pcode - , SameShapeAs code pcode - , SameShapeAs pcode code - , AllZipF (AllZip (LiftedCoercible I (Term s))) code pcode + , All2 PEq (PCode s t) ) => Term s (t :--> t :--> PBool) peq' = @@ -161,13 +155,10 @@ por' :: Term s (PBool :--> PBool :--> PBool) por' = phoistAcyclic $ plam $ \x y -> pif' # x # (pcon PTrue) # y gpeq :: - forall a s code pcode. - ( code ~ Code (a s) - , pcode ~ ToPType2 code - , All2 PEq pcode - ) => - SOP (Term s) pcode -> - SOP (Term s) pcode -> + forall a s. + All2 PEq (PCode s a) => + SOP (Term s) (PCode s a) -> + SOP (Term s) (PCode s a) -> Term s PBool gpeq (SOP c1) (SOP c2) = ccompare_NS (Proxy @(All PEq)) (pcon PFalse) eqProd (pcon PFalse) c1 c2 @@ -180,21 +171,3 @@ gpeq (SOP c1) (SOP c2) = eqTerm :: forall a. PEq a => Term s a -> Term s a -> K (Term s PBool) a eqTerm a b = K $ a #== b - -{- | Like `from` but for Plutarch terms - - Instead of `I`, this uses `Term s` as the container type. --} -pfrom :: - forall a s code pcode. - ( Generic (a s) - , code ~ Code (a s) - , pcode ~ ToPType2 code - , SameShapeAs code pcode - , SameShapeAs pcode code - , AllZipF (AllZip (LiftedCoercible I (Term s))) code pcode - , All Top pcode - ) => - a s -> - SOP (Term s) (ToPType2 (Code (a s))) -pfrom = hfromI . from diff --git a/Plutarch/DataRepr/Internal/Generic.hs b/Plutarch/DataRepr/Internal/Generic.hs index 2810c8829..7936ef08d 100644 --- a/Plutarch/DataRepr/Internal/Generic.hs +++ b/Plutarch/DataRepr/Internal/Generic.hs @@ -1,15 +1,48 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-} --- | Common generics-sop utilities for use in Plutarch. +{- Common generics-sop utilities for use in Plutarch. + + TODO: Move to Plutarch.Internal.Generic? +-} module Plutarch.DataRepr.Internal.Generic ( + -- * Plutarch adapters for generics-sop API + PGeneric, + PCode, + pfrom, + + -- * Helpers for when existing generics-sop combinators are insufficient. MkSum (..), ) where -import Data.Kind (Type) +import Data.Kind (Constraint, Type) import GHC.TypeLits (Nat, type (-)) -import Generics.SOP (I, NP, NS (S, Z)) +import Generics.SOP (All, AllZip, Code, Generic (from), I, LiftedCoercible, NP, NS (S, Z), SOP, SameShapeAs, Top, hfromI) +import Generics.SOP.Constraint (AllZipF) import Plutarch.DataRepr.Internal.HList.Utils (IndexList) +import Plutarch.Internal (PType, S, Term) +import Plutarch.Internal.TypeFamily (ToPType2) + +{- `Generic` constraint extended to work with Plutarch types. +-} +type PGeneric :: S -> PType -> Constraint +type PGeneric s a = + ( Generic (a s) + , SameShapeAs (Code (a s)) (ToPType2 (Code (a s))) + , SameShapeAs (ToPType2 (Code (a s))) (Code (a s)) + , AllZipF (AllZip (LiftedCoercible I (Term s))) (Code (a s)) (ToPType2 (Code (a s))) + , All Top (ToPType2 (Code (a s))) + ) + +{- Like `Code` but for Plutarch types -} +type PCode s a = ToPType2 (Code (a s)) + +{- | Like `from` but for Plutarch terms + + Instead of `I`, this uses `Term s` as the container type. +-} +pfrom :: PGeneric s a => a s -> SOP (Term s) (PCode s a) +pfrom = hfromI . from {- | Infrastructure to create a single sum constructor given its type index and value. From 74fd7d1a4db47db5d4c946dbf3e056b252fe8e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 28 Feb 2022 16:02:33 -0500 Subject: [PATCH 125/584] Replaced Data.Void with GHC.Any --- Plutarch/FFI.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 5fde43fca..c51dac579 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -16,7 +16,6 @@ module Plutarch.FFI ( import Data.ByteString (ByteString) import Data.Kind (Constraint, Type) import Data.Text (Text) -import Data.Void (Void) import GHC.Generics (Generic) import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits @@ -27,6 +26,7 @@ import Generics.SOP.Type.Metadata ( ConstructorName, DatatypeInfo (ADT, Newtype), ) +import GHC.Exts (Any) import Plutarch ( ClosedTerm, PDelayed, @@ -91,8 +91,8 @@ foreignExport = unsafeForeignExport foreignImport :: p >~< t => CompiledCode t -> ClosedTerm p foreignImport = unsafeForeignImport --- | Export Plutarch term of any type as @CompiledCode Void@. -opaqueExport :: ClosedTerm p -> CompiledCode Void +-- | Export Plutarch term of any type as @CompiledCode Any@. +opaqueExport :: ClosedTerm p -> CompiledCode Any opaqueExport = unsafeForeignExport -- | Import compiled UPLC code of any type as a Plutarch opaque term. From 805448d9f7793a38edaa058a3f7c6bac10b5e02f Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 16:15:31 -0500 Subject: [PATCH 126/584] Cleanup and changelog --- CHANGELOG.md | 4 ++++ Plutarch/Bool.hs | 33 +++++++++++++------------- plutarch-test/src/Plutarch/BoolSpec.hs | 22 ----------------- 3 files changed, 21 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5af2fe9e..afb391d0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # Unreleased +- Add generic deriving for `PEq` + + Started by [#335](https://github.com/Plutonomicon/plutarch/pull/335) + - `TermCont`: Parametrize by result type; add `MonadFail` instance; etc. Also, export from `Plutarch.TermCont`, and then from `Plutarch.Prelude` (TermCont is no longer exported by `Plutarch.Internal`). diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 4dec5fac9..b0968260e 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -78,21 +78,7 @@ class PEq t where Term s t -> Term s t -> Term s PBool - a #== b = peq' # a # b - -peq' :: - forall t s. - ( PGeneric s t - , PlutusType t - , All2 PEq (PCode s t) - ) => - Term s (t :--> t :--> PBool) -peq' = - punsafehoistAcyclic $ - plam $ \x y -> - pmatch x $ \x' -> - pmatch y $ \y' -> - gpeq @t (pfrom x') (pfrom y') + a #== b = gpeq # a # b infix 4 #== @@ -154,13 +140,28 @@ por = phoistAcyclic $ plam $ \x y -> pif' # x # (phoistAcyclic $ pdelay $ pcon P por' :: Term s (PBool :--> PBool :--> PBool) por' = phoistAcyclic $ plam $ \x y -> pif' # x # (pcon PTrue) # y +-- | Generic version of (#==) gpeq :: + forall t s. + ( PGeneric s t + , PlutusType t + , All2 PEq (PCode s t) + ) => + Term s (t :--> t :--> PBool) +gpeq = + punsafehoistAcyclic $ + plam $ \x y -> + pmatch x $ \x' -> + pmatch y $ \y' -> + gpeq' @t (pfrom x') (pfrom y') + +gpeq' :: forall a s. All2 PEq (PCode s a) => SOP (Term s) (PCode s a) -> SOP (Term s) (PCode s a) -> Term s PBool -gpeq (SOP c1) (SOP c2) = +gpeq' (SOP c1) (SOP c2) = ccompare_NS (Proxy @(All PEq)) (pcon PFalse) eqProd (pcon PFalse) c1 c2 where eqProd :: All PEq xs => NP (Term s) xs -> NP (Term s) xs -> Term s PBool diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs index 28e49bc4d..4f9606741 100644 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ b/plutarch-test/src/Plutarch/BoolSpec.hs @@ -1,7 +1,5 @@ module Plutarch.BoolSpec (spec) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) import Test.Syd import Plutarch.Bool (pand, por) @@ -43,23 +41,3 @@ spec = do "true" @| por # pcon PTrue # perror @-> pfails "op.true" @| pcon PTrue #|| perror @-> psucceeds "op.false" @| pcon PFalse #|| perror @-> pfails - "peq" @\ do - "rec" @\ do - "true" @\ do - "leaf" @| leaf1 #== leaf1 @-> passert - -{- A recursive data type to test PEq behaviour - - This is just a simple binary tree; nothing sophisticated. --} -data PTree a s - = PLeaf (Term s a) - | PBranch (Term s (PPair (PTree a) (PTree a))) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType, PEq) - -leaf1 :: Term s (PTree PInteger) -leaf1 = pcon $ PLeaf 42 - -_leaf2 :: Term s (PTree PInteger) -_leaf2 = pcon $ PLeaf 24 From 7a73e74a152f4a3a83f3b6ef726ffeb2bfdf6408 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 16:20:55 -0500 Subject: [PATCH 127/584] Add punsafeAsClosedTerm --- Plutarch/Bool.hs | 13 +++++++------ Plutarch/Internal.hs | 9 +++------ plutarch-test/src/Plutarch/Test/Golden.hs | 12 ++++-------- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index b0968260e..db2612bb6 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -32,7 +32,7 @@ import Generics.SOP ( hcliftA2, ) import Plutarch.DataRepr.Internal.Generic (PCode, PGeneric, pfrom) -import Plutarch.Internal (punsafehoistAcyclic) +import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Internal.Other ( DerivePNewtype, PDelayed, @@ -149,11 +149,12 @@ gpeq :: ) => Term s (t :--> t :--> PBool) gpeq = - punsafehoistAcyclic $ - plam $ \x y -> - pmatch x $ \x' -> - pmatch y $ \y' -> - gpeq' @t (pfrom x') (pfrom y') + phoistAcyclic $ + punsafeAsClosedTerm @s $ + plam $ \x y -> + pmatch x $ \x' -> + pmatch y $ \y' -> + gpeq' @t (pfrom x') (pfrom y') gpeq' :: forall a s. diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index fee50bf53..444851b27 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -13,7 +13,7 @@ module Plutarch.Internal ( pdelay, pforce, phoistAcyclic, - punsafehoistAcyclic, + punsafeAsClosedTerm, perror, punsafeCoerce, punsafeBuiltin, @@ -327,11 +327,8 @@ phoistAcyclic t = case asRawTerm t 0 of in Term $ \_ -> TermResult (RHoisted hoisted) (hoisted : getDeps t') (Left e, _, _) -> error $ "Hoisted term errs! " <> show e -punsafehoistAcyclic :: HasCallStack => Term s a -> Term s a -punsafehoistAcyclic t = phoistAcyclic $ unsafeClosedTerm t - -unsafeClosedTerm :: Term s a -> ClosedTerm a -unsafeClosedTerm (Term t) = (Term t) +punsafeAsClosedTerm :: forall s a. Term s a -> ClosedTerm a +punsafeAsClosedTerm (Term t) = (Term t) -- Couldn't find a definition for this in plutus-core subst :: Word64 -> (Word64 -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index 3a78ef28c..b8e6c16c7 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -34,7 +34,7 @@ import Test.Syd ( import Plutarch (ClosedTerm, compile, printScript) import Plutarch.Evaluate (evalScript) -import Plutarch.Internal (Term (Term)) +import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Prelude import Plutarch.Test.Benchmark (Benchmark, mkBenchmark, scriptSize) import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) @@ -68,11 +68,7 @@ mkGoldenValue' p mexp = -- `ClosedTerm a`. In practice, this instance should be used only for closed -- terms. instance HasGoldenValue Term where - mkGoldenValue p = mkGoldenValue' (unsafeClosedTerm p) Nothing - --- Because, we need a function with this signature. -unsafeClosedTerm :: Term s a -> ClosedTerm a -unsafeClosedTerm (Term t) = (Term t) + mkGoldenValue p = mkGoldenValue' (punsafeAsClosedTerm p) Nothing {- | A `Term` paired with its evaluation expectation @@ -85,12 +81,12 @@ type TermExpectation a = forall s. TermExpectation' s a -- | Test an expectation on a golden Plutarch program (@->) :: ClosedTerm a -> (ClosedTerm a -> Expectation) -> TermExpectation a -(@->) p f = TermExpectation p (\p' -> f $ unsafeClosedTerm p') +(@->) p f = TermExpectation p (\p' -> f $ punsafeAsClosedTerm p') infixr 1 @-> instance HasGoldenValue TermExpectation' where - mkGoldenValue (TermExpectation p f) = mkGoldenValue' (unsafeClosedTerm p) (Just $ f p) + mkGoldenValue (TermExpectation p f) = mkGoldenValue' (punsafeAsClosedTerm p) (Just $ f p) -- | The key used in the .golden files containing multiple golden values newtype GoldenKey = GoldenKey Text From 0a6c6f40b7303407ffa305a5f2d9dacffe89ef59 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 16:25:42 -0500 Subject: [PATCH 128/584] Move module to Plutarch.Internal.Generic ... inasmuch as it is independent of DataRepr stuff. --- Plutarch/Bool.hs | 2 +- Plutarch/DataRepr/Internal.hs | 2 +- Plutarch/{DataRepr => }/Internal/Generic.hs | 9 +++------ Plutarch/Internal/PlutusType.hs | 2 +- Plutarch/Pair.hs | 2 -- plutarch.cabal | 2 +- 6 files changed, 7 insertions(+), 12 deletions(-) rename Plutarch/{DataRepr => }/Internal/Generic.hs (90%) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index db2612bb6..74fc01f24 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -31,8 +31,8 @@ import Generics.SOP ( ccompare_NS, hcliftA2, ) -import Plutarch.DataRepr.Internal.Generic (PCode, PGeneric, pfrom) import Plutarch.Internal (punsafeAsClosedTerm) +import Plutarch.Internal.Generic (PCode, PGeneric, pfrom) import Plutarch.Internal.Other ( DerivePNewtype, PDelayed, diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 2fa9806db..15dd6f53a 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -89,10 +89,10 @@ import Plutarch.Builtin ( pfstBuiltin, psndBuiltin, ) -import Plutarch.DataRepr.Internal.Generic (MkSum (mkSum)) import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) import Plutarch.Integer (PInteger) import Plutarch.Internal (S (SI)) +import Plutarch.Internal.Generic (MkSum (mkSum)) import Plutarch.Internal.TypeFamily (ToPType2) import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) diff --git a/Plutarch/DataRepr/Internal/Generic.hs b/Plutarch/Internal/Generic.hs similarity index 90% rename from Plutarch/DataRepr/Internal/Generic.hs rename to Plutarch/Internal/Generic.hs index 7936ef08d..5bf8add03 100644 --- a/Plutarch/DataRepr/Internal/Generic.hs +++ b/Plutarch/Internal/Generic.hs @@ -2,10 +2,8 @@ {-# LANGUAGE UndecidableInstances #-} {- Common generics-sop utilities for use in Plutarch. - - TODO: Move to Plutarch.Internal.Generic? -} -module Plutarch.DataRepr.Internal.Generic ( +module Plutarch.Internal.Generic ( -- * Plutarch adapters for generics-sop API PGeneric, PCode, @@ -23,8 +21,7 @@ import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Internal (PType, S, Term) import Plutarch.Internal.TypeFamily (ToPType2) -{- `Generic` constraint extended to work with Plutarch types. --} +-- | `Generic` constraint extended to work with Plutarch types. type PGeneric :: S -> PType -> Constraint type PGeneric s a = ( Generic (a s) @@ -34,7 +31,7 @@ type PGeneric s a = , All Top (ToPType2 (Code (a s))) ) -{- Like `Code` but for Plutarch types -} +-- | Like `Code` but for Plutarch types type PCode s a = ToPType2 (Code (a s)) {- | Like `from` but for Plutarch terms diff --git a/Plutarch/Internal/PlutusType.hs b/Plutarch/Internal/PlutusType.hs index edfd5936a..e2a0db443 100644 --- a/Plutarch/Internal/PlutusType.hs +++ b/Plutarch/Internal/PlutusType.hs @@ -27,10 +27,10 @@ import Generics.SOP ( hcoerce, unSOP, ) -import Plutarch.DataRepr.Internal.Generic (MkSum (mkSum)) import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Internal (PType, S, Term, pforce, plam', punsafeCoerce, (:-->)) import qualified Plutarch.Internal as PI +import Plutarch.Internal.Generic (MkSum (mkSum)) import Plutarch.Internal.PLam ((#)) import Plutarch.Internal.TypeFamily (ToPType, ToPType2) diff --git a/Plutarch/Pair.hs b/Plutarch/Pair.hs index 4a0a38ff3..e9fbd7d97 100644 --- a/Plutarch/Pair.hs +++ b/Plutarch/Pair.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} - module Plutarch.Pair (PPair (..)) where import qualified GHC.Generics as GHC diff --git a/plutarch.cabal b/plutarch.cabal index b122c2c44..d394c4158 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -100,13 +100,13 @@ library Plutarch.DataRepr.Internal Plutarch.DataRepr.Internal.Field Plutarch.DataRepr.Internal.FromData - Plutarch.DataRepr.Internal.Generic Plutarch.DataRepr.Internal.HList Plutarch.DataRepr.Internal.HList.Utils Plutarch.Either Plutarch.Evaluate Plutarch.Integer Plutarch.Internal + Plutarch.Internal.Generic Plutarch.Internal.Other Plutarch.Internal.PLam Plutarch.Internal.PlutusType From 7195555a2600dc11b3ba1af1b42f2d14c7086f52 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 28 Feb 2022 16:28:33 -0500 Subject: [PATCH 129/584] Remove implicit imports --- Plutarch/Bool.hs | 6 +++--- Plutarch/Internal/Generic.hs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 74fc01f24..62819836d 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -24,10 +24,10 @@ import Generics.SOP ( All, All2, HCollapse (hcollapse), - K (..), + K (K), NP, - Proxy (..), - SOP (..), + Proxy (Proxy), + SOP (SOP), ccompare_NS, hcliftA2, ) diff --git a/Plutarch/Internal/Generic.hs b/Plutarch/Internal/Generic.hs index 5bf8add03..0d466bc88 100644 --- a/Plutarch/Internal/Generic.hs +++ b/Plutarch/Internal/Generic.hs @@ -10,7 +10,7 @@ module Plutarch.Internal.Generic ( pfrom, -- * Helpers for when existing generics-sop combinators are insufficient. - MkSum (..), + MkSum (mkSum), ) where import Data.Kind (Constraint, Type) From 64f8a336558a73295f8c5a408c8c16c1ce551d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 1 Mar 2022 07:55:21 -0500 Subject: [PATCH 130/584] Formatting --- Plutarch/FFI.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index c51dac579..d9c3dae38 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -16,6 +16,7 @@ module Plutarch.FFI ( import Data.ByteString (ByteString) import Data.Kind (Constraint, Type) import Data.Text (Text) +import GHC.Exts (Any) import GHC.Generics (Generic) import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits @@ -26,7 +27,6 @@ import Generics.SOP.Type.Metadata ( ConstructorName, DatatypeInfo (ADT, Newtype), ) -import GHC.Exts (Any) import Plutarch ( ClosedTerm, PDelayed, From b03ad156366d3cd84d2952249232fb2bf0b4a2b8 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Tue, 1 Mar 2022 22:08:19 +0100 Subject: [PATCH 131/584] wip #303: - removed the PDepth tag as requrested by las - corrected erroneous instances - adjusted the tests to cover more instances - restructure the class to not make any work unneeded - adjust the tests to accomodate for those changes --- Plutarch/Verify.hs | 289 +++++++++--------- .../verification_untrusted_data.bench.golden | 37 +-- ...rification_untrusted_data.uplc.eval.golden | 17 +- .../verification_untrusted_data.uplc.golden | 37 +-- plutarch-test/plutarch-test.cabal | 2 +- plutarch-test/src/Plutarch/VerifySpec.hs | 190 ++++++------ 6 files changed, 284 insertions(+), 288 deletions(-) diff --git a/Plutarch/Verify.hs b/Plutarch/Verify.hs index 293f1e5de..ded08af07 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/Verify.hs @@ -1,22 +1,16 @@ {-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -Wno-orphans #-} {-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-} {-# OPTIONS_GHC -Wredundant-constraints #-} module Plutarch.Verify ( - PTryFrom (ptryFrom), - PTryUnwrapFrom (ptryUnwrapFrom), - PDepth (PDeep, PShallow), + PTryFrom (PExcess, ptryFrom), pcheckType, pcheckByteStr, pcheckInt, pcheckList, pcheckMap, ) where - --- import GHC.TypeLits (KnownNat) import Plutarch.Builtin ( PAsData, @@ -35,21 +29,23 @@ import Plutarch.Builtin ( ppairDataBuiltin, psndBuiltin, ) + import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) import Plutarch.Internal.Other ( POpaque, PType, Term, + pcon, perror, pforce, phoistAcyclic, plam, plet, (#), - (#$), type (:-->), ) +import Plutarch.Unit (PUnit (PUnit)) import Plutarch.DataRepr.Internal ( PDataRecord, @@ -58,8 +54,6 @@ import Plutarch.DataRepr.Internal ( pdnil, ) -import Plutarch.Lift (PLift) - import Plutarch.Bool (pif, (#==)) import Plutarch.List ( @@ -71,6 +65,8 @@ import Plutarch.List ( import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) import qualified PlutusCore as PLC +import Plutarch.TermCont (TermCont, tcont, unTermCont) + {- | Note: PAsData POpaque ~ PData -} @@ -79,109 +75,162 @@ import qualified PlutusCore as PLC {- | This checks the datastructure for validity. - Be aware that if called with `PDeep`, it will in - most cases will at least be slightly more expensive + If you don't care about parts of the datastructure + don't verify those parts, just let it return a PData + instead Be aware this might get really expensive, so only use it if you cannot establish trust otherwise (e.g. via only checking a part of your Data with PTryFrom) -} -class PTryFrom (d :: PDepth) (a :: PType) (b :: PType) where - -- this is the "safest" type --^ ^-- this is the target type - ptryFrom :: Term s a -> Term s b - ------------------------ Polymorphic instances ------------------------------------------- - -instance PTryFrom a PData (PAsData PInteger) where - ptryFrom = (pcheckInt #) - -instance PTryFrom a PData (PAsData PByteString) where - ptryFrom = (pcheckByteStr #) +class PTryFrom (a :: PType) (b :: PType) where + -- "safest" type --^ ^-- target type + type PExcess a b :: PType + ptryFrom :: Term s a -> TermCont s (Term s b, Term s (PExcess a b)) + +----------------------- PData instances ------------------------------------------------- + +instance PTryFrom PData (PAsData PInteger) where + type PExcess PData (PAsData PInteger) = PInteger + ptryFrom opq = do + ver <- tcont $ plet (pasInt # opq) + pure $ (punsafeCoerce opq, ver) + +instance PTryFrom PData (PAsData PByteString) where + type PExcess PData (PAsData PByteString) = PByteString + ptryFrom opq = do + ver <- tcont $ plet (pasByteStr # opq) + pure $ (punsafeCoerce opq, ver) + +instance PTryFrom PData PData where + type PExcess PData PData = PUnit + ptryFrom opq = pure $ (opq, pcon PUnit) + +instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) where + type PExcess PData (PAsData (PBuiltinList PData)) = PBuiltinList PData + ptryFrom opq = do + ver <- tcont $ plet (pasList # opq) + pure $ (punsafeCoerce opq, ver) ------------------------ PDeep PData instances ------------------------------------------- - -data PDepth - = PDeep - | PShallow - -instance PTryFrom PDeep PData PData where - ptryFrom = id - -instance {-# OVERLAPPING #-} PTryFrom PDeep PData (PAsData (PBuiltinList PData)) where - ptryFrom = (pcheckList #) - -instance {-# OVERLAPPING #-} PTryFrom PDeep PData (PAsData (PBuiltinMap PData PData)) where - ptryFrom = (pcheckMap #) +instance + {-# OVERLAPS #-} + ( PTryFrom PData (PAsData a) + , PTryFrom PData (PAsData b) + ) => + PTryFrom PData (PAsData (PBuiltinMap a b)) + where + type PExcess PData (PAsData (PBuiltinMap a b)) = PBuiltinList (PBuiltinPair (PAsData a) (PAsData b)) + ptryFrom opq = do + verMap <- tcont $ plet (pasMap # opq) + -- I've not obtained a `PBuiltinList (PBuiltinPair a b)` + let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) + verifyPair = plam $ \tup -> unTermCont $ do + (verfst, _) <- ptryFrom @PData @(PAsData a) $ pfstBuiltin # tup + (versnd, _) <- ptryFrom @PData @(PAsData b) $ psndBuiltin # tup + pure $ ppairDataBuiltin # verfst # versnd + ver <- tcont $ plet $ pmap # verifyPair # verMap + pure (punsafeCoerce opq, ver) + +instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinMap POpaque POpaque)) where + type PExcess PData (PAsData (PBuiltinMap POpaque POpaque)) = PBuiltinList (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) + ptryFrom opq = do + ver <- tcont $ plet (pasMap # opq) + pure $ (punsafeCoerce opq, punsafeCoerce ver) -- PAsData POpaque ~ PData instance {-# OVERLAPPABLE #-} - ( PTryFrom PDeep PData a + ( PTryFrom PData a , a ~ PAsData b , PIsData b ) => - PTryFrom PDeep PData (PAsData (PBuiltinList a)) + PTryFrom PData (PAsData (PBuiltinList a)) where - ptryFrom opq = - let lst :: Term _ (PBuiltinList a) - lst = punsafeBuiltin PLC.UnListData # opq - in pdata $ pmap # (plam $ \e -> ptryFrom @PDeep @PData @a $ pforgetData e) # lst + type PExcess PData (PAsData (PBuiltinList a)) = PBuiltinList a + ptryFrom opq = + let lst :: Term _ (PBuiltinList a) + lst = punsafeBuiltin PLC.UnListData # opq + verify :: a ~ PAsData b => Term _ (PAsData b :--> a) + verify = plam $ \e -> + unTermCont $ do + (wrapped, _) <- ptryFrom @PData @a $ pforgetData e + pure wrapped + in do + ver <- tcont $ plet $ pmap # verify # lst + pure $ (punsafeCoerce opq, ver) instance {-# OVERLAPPABLE #-} - ( PTryFrom PDeep PData a + ( PTryFrom PData a , a ~ PAsData a' , PIsData a' - , PTryFrom PDeep PData b + , PTryFrom PData b , b ~ PAsData b' , PIsData b' ) => - PTryFrom PDeep PData (PAsData (PBuiltinPair a b)) + PTryFrom PData (PAsData (PBuiltinPair a b)) where - ptryFrom opq = - plet (pfromData $ punsafeCoerce opq) $ - \tup -> - let fst :: Term _ a - fst = ptryFrom @PDeep @PData @a $ pforgetData $ pfstBuiltin # tup - snd :: Term _ b - snd = ptryFrom @PDeep @PData @b $ pforgetData $ psndBuiltin # tup - in pdata $ ppairDataBuiltin # fst # snd + type PExcess PData (PAsData (PBuiltinPair a b)) = PBuiltinPair a b + ptryFrom opq = do + tup <- tcont $ plet (pfromData $ punsafeCoerce opq) + let fst' :: Term _ a + fst' = unTermCont $ fst <$> (ptryFrom @PData @a $ pforgetData $ pfstBuiltin # tup) + snd' :: Term _ b + snd' = unTermCont $ fst <$> (ptryFrom @PData @b $ pforgetData $ psndBuiltin # tup) + ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' + pure $ (punsafeCoerce opq, ver) instance {-# OVERLAPPABLE #-} - ( PTryFrom PDeep PData (PAsData b) - , PTryFrom PDeep PData (PAsData (PDataRecord xs)) + ( PTryFrom PData (PAsData b) + , PTryFrom PData (PAsData (PDataRecord xs)) , x ~ (s ':= b) , PIsData (PDataRecord xs) + , PExcess PData (PAsData (PDataRecord xs)) ~ PDataRecord xs ) => - PTryFrom PDeep PData (PAsData (PDataRecord (x ': xs))) + PTryFrom PData (PAsData (PDataRecord (x ': xs))) where - ptryFrom opq = - plet (pfromData @(PBuiltinList _) $ punsafeCoerce opq) $ \lst -> - let lsthead :: Term _ PData - lsthead = phead # lst - lsttail :: Term _ (PAsData (PBuiltinList PData)) - lsttail = pdata $ ptail # lst - in punsafeCoerce $ - pdcons @s - # (ptryFrom @PDeep @PData @(PAsData b) lsthead) - # (pfromData (ptryFrom @PDeep @PData @(PAsData (PDataRecord xs)) (pforgetData lsttail))) + type PExcess PData (PAsData (PDataRecord (x ': xs))) = PDataRecord (x ': xs) + ptryFrom opq = do + lst <- tcont $ plet (pfromData @(PBuiltinList _) $ punsafeCoerce opq) + let lsthead :: Term _ PData + lsthead = phead # lst + lsttail :: Term _ (PAsData (PBuiltinList PData)) + lsttail = pdata $ ptail # lst + verhead :: Term _ (PAsData b) + verhead = unTermCont $ fst <$> (ptryFrom @PData @(PAsData b) lsthead) + vertail :: Term _ (PDataRecord xs) + vertail = unTermCont $ snd <$> (ptryFrom @PData @(PAsData (PDataRecord xs)) (pforgetData lsttail)) + ver <- + tcont $ + plet $ + pdcons @s + # verhead + # vertail + pure (punsafeCoerce opq, ver) instance {-# OVERLAPPING #-} - ( PTryFrom PDeep PData (PAsData b) + ( PTryFrom PData (PAsData b) + , PIsData b , x ~ (s ':= b) ) => - PTryFrom PDeep PData (PAsData (PDataRecord '[x])) + PTryFrom PData (PAsData (PDataRecord '[x])) where - ptryFrom opq = - let lsthead :: Term _ PData - lsthead = phead # (pfromData @(PBuiltinList _) $ punsafeCoerce opq) - in punsafeCoerce $ - pdcons @s - # (ptryFrom @PDeep @PData @(PAsData b) lsthead) - # pdnil - ------------------------ PDeep POpaque instances ----------------------------------------- + type PExcess PData (PAsData (PDataRecord '[x])) = PDataRecord '[x] + ptryFrom opq = do + let lsthead :: Term _ PData + lsthead = phead # (pfromData @(PBuiltinList _) $ punsafeCoerce opq) + verhead :: Term _ (PAsData b) + verhead = unTermCont $ fst <$> (ptryFrom @PData @(PAsData b) lsthead) + ver <- + tcont $ + plet $ + pdcons @s + # verhead + # pdnil + pure $ (punsafeCoerce opq, ver) + +----------------------- POpaque Instances ----------------------------------------------- {- | for none of the opaque instances it can be verified @@ -191,84 +240,18 @@ instance your POpaque safely -} instance - ( PTryFrom PDeep PData (PAsData a) + ( PTryFrom PData (PAsData a) , PIsData a ) => - PTryFrom PDeep POpaque a - where - ptryFrom opq = - let prop :: Term _ a - prop = punsafeCoerce opq - in pfromData $ ptryFrom @PDeep @PData @(PAsData a) $ pforgetData $ pdata prop - ------------------------ PShallow PData instances ---------------------------------------- - -instance PTryFrom PShallow PData (PAsData (PBuiltinList PData)) where - ptryFrom = (pcheckList #) - -instance PTryFrom PShallow PData (PAsData (PBuiltinMap PData PData)) where - ptryFrom = (pcheckMap #) - -instance PTryFrom PShallow PData PData where - ptryFrom = id - --- PShallow POpaque instances wouldn't make sense as that wouldn't do any verifying at all - ------------------------ Class that removes the PAsData wrapper -------------------------- - -{- | - the basic idea behind the class is, that if i removed the data wrapper, I have - confidence that the type really has the structure I tested it to have --} -class PTryUnwrapFrom (d :: PDepth) (b :: PType) where - ptryUnwrapFrom :: Term s (PData :--> b) - -instance PTryUnwrapFrom PDeep PInteger where - ptryUnwrapFrom = pasInt - -instance PTryUnwrapFrom PDeep PByteString where - ptryUnwrapFrom = pasByteStr - -instance {-# OVERLAPPING #-} PTryUnwrapFrom PDeep (PBuiltinList PData) where - ptryUnwrapFrom = pasList - -instance {-# OVERLAPPING #-} PTryUnwrapFrom PDeep (PBuiltinList (PBuiltinPair PData PData)) where - ptryUnwrapFrom = pasMap - -instance - {-# OVERLAPPABLE #-} - ( PTryUnwrapFrom PDeep b - , PIsData b - , PLift b - ) => - PTryUnwrapFrom PDeep (PBuiltinList b) - where - ptryUnwrapFrom = phoistAcyclic $ - plam $ \opq -> - let lst :: Term _ (PBuiltinList (PAsData b)) - lst = punsafeBuiltin PLC.UnListData # opq - in pmap # (plam $ \e -> ptryUnwrapFrom @PDeep @b #$ pforgetData e) # lst - --- this instance is not ok, I can not create an instance that doesn't work on --- wrapped types. -instance - {-# OVERLAPPABLE #-} - ( PTryUnwrapFrom PDeep a - , PTryUnwrapFrom PDeep b - , PIsData a - , PIsData b - ) => - PTryUnwrapFrom PDeep (PBuiltinPair (PAsData a) (PAsData b)) + PTryFrom POpaque a where - ptryUnwrapFrom = phoistAcyclic $ - plam $ \opq -> - let tup :: Term _ (PBuiltinPair (PAsData a) (PAsData b)) - tup = pfromData $ punsafeCoerce opq - fst :: Term _ a - fst = ptryUnwrapFrom @PDeep @a #$ pforgetData $ pfstBuiltin # tup - snd :: Term _ b - snd = ptryUnwrapFrom @PDeep @b #$ pforgetData $ psndBuiltin # tup - in ppairDataBuiltin # pdata fst # pdata snd + type PExcess POpaque a = PAsData a + ptryFrom opq = do + let prop :: Term _ a + prop = punsafeCoerce opq + ver' <- fst <$> (ptryFrom @PData @(PAsData a) $ pforgetData $ pdata prop) + ver <- tcont $ plet ver' + pure $ (punsafeCoerce opq, ver) ----------------------- Helper functions ------------------------------------------------ diff --git a/plutarch-test/goldens/verification_untrusted_data.bench.golden b/plutarch-test/goldens/verification_untrusted_data.bench.golden index 5a1908e93..17b2ac113 100644 --- a/plutarch-test/goldens/verification_untrusted_data.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.bench.golden @@ -1,17 +1,20 @@ -erroneous.int /= bytestring {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":45} -erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2537969,"exBudgetMemory":614,"scriptSizeBytes":159} -erroneous.[String] /= [Integer] {"exBudgetCPU":1487969,"exBudgetMemory":390,"scriptSizeBytes":111} -working.int == int {"exBudgetCPU":1390705,"exBudgetMemory":3366,"scriptSizeBytes":40} -working.(String, String) == (String, String) {"exBudgetCPU":8788383,"exBudgetMemory":17372,"scriptSizeBytes":159} -working.[String] == [String] {"exBudgetCPU":8305205,"exBudgetMemory":18580,"scriptSizeBytes":120} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":2375838,"exBudgetMemory":552,"scriptSizeBytes":125} -removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":102} -removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":77} -removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":7384676,"exBudgetMemory":12164,"scriptSizeBytes":102} -removing the data wrapper.working.[String] == [String] {"exBudgetCPU":6033541,"exBudgetMemory":12344,"scriptSizeBytes":85} -removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":315492408,"exBudgetMemory":673004,"scriptSizeBytes":839} -removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":53643621,"exBudgetMemory":79318,"scriptSizeBytes":810} -example.concatenate two lists, legal {"exBudgetCPU":66205381,"exBudgetMemory":127091,"scriptSizeBytes":644} -example.concatenate tow lists, illegal (list too short) {"exBudgetCPU":58463317,"exBudgetMemory":105633,"scriptSizeBytes":637} -example.concatenate tow lists, illegal (wrong elements in list) {"exBudgetCPU":65848105,"exBudgetMemory":125891,"scriptSizeBytes":644} -example.concatenate tow lists, illegal (more than one output) {"exBudgetCPU":39820947,"exBudgetMemory":64533,"scriptSizeBytes":651} \ No newline at end of file +erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} +erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":99} +erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} +working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} +working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} +working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} +removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":96} +removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":92} +removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":5889216,"exBudgetMemory":9972,"scriptSizeBytes":101} +removing the data wrapper.working.[String] == [String] {"exBudgetCPU":6480136,"exBudgetMemory":13844,"scriptSizeBytes":92} +removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} +removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} +example.concatenate two lists, legal {"exBudgetCPU":63896970,"exBudgetMemory":125943,"scriptSizeBytes":656} +example.concatenate two lists, illegal (list too short) {"exBudgetCPU":56513317,"exBudgetMemory":105217,"scriptSizeBytes":649} +example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":63748105,"exBudgetMemory":125443,"scriptSizeBytes":656} +example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":67586627,"exBudgetMemory":126281,"scriptSizeBytes":663} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden index 7522d04ec..d6cef46a6 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden @@ -1,17 +1,20 @@ -erroneous.int /= bytestring (program 1.0.0 error) erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) erroneous.[String] /= [Integer] (program 1.0.0 error) -working.int == int (program 1.0.0 #182a) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 error) +erroneous.Map Int String /= Map Int Int (program 1.0.0 error) working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 error) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) +working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) -removing the data wrapper.working.[String] == [String] (program 1.0.0 [#666f6f, #626172]) +removing the data wrapper.working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) example.concatenate two lists, legal (program 1.0.0 ()) -example.concatenate tow lists, illegal (list too short) (program 1.0.0 error) -example.concatenate tow lists, illegal (wrong elements in list) (program 1.0.0 error) -example.concatenate tow lists, illegal (more than one output) (program 1.0.0 error) \ No newline at end of file +example.concatenate two lists, illegal (list too short) (program 1.0.0 error) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.golden index 5f423c0c1..9e85659ed 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.golden @@ -1,17 +1,20 @@ -erroneous.int /= bytestring (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (bData #666f6f))) -erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 3) (delay i1) (delay error))) (i7 i1)) ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i9 i1)))) ((\i0 -> mkPairData (i5 i1) (i5 (force tailList i1))) (i8 (unConstrData i1)))) (i4 (mkPairData (bData #666f6f) (bData #626172)))) (force ifThenElse)) (force chooseData)) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) -erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 4) (delay i1) (delay error))) (unListData i1))) (listData (i1 (iData 3) ((\i0 -> i2 i1 i3) (iData 4))))) (force mkCons)) [ ])) -working.int == int (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (iData 42))) -working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i7 i1)) ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 4) (delay i1) (delay error))) (i9 i1)))) ((\i0 -> mkPairData (i5 i1) (i5 (force tailList i1))) (i8 (unConstrData i1)))) (i4 (mkPairData (bData #666f6f) (bData #626172)))) (force ifThenElse)) (force chooseData)) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ])) -working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 4) (delay i1) (delay error))) (unListData i1))) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172))))) (force mkCons)) [ ])) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 ((\i0 -> force (i4 (equalsInteger (i5 i1 0 1 2 3 4) 3) (delay i1) (delay error))) (i5 i1)) (unListData ((\i0 -> i7 ((\i0 -> force (i5 (equalsInteger (i6 i1 0 1 2 3 4) 3) (delay i1) (delay error))) (i6 (unListData i1))) i8) (listData (force tailList i1))))) (unListData i1)) (listData (i4 (iData 7) (i4 (iData 42) i5)))) (force ifThenElse)) (force chooseData)) (force headList)) (force mkCons)) [ ])) -removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (iData (unIData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) -removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (i4 (unBData (force headList i1)) (i2 (force tailList i1)))))) (unListData i1)) (listData (i1 (iData 3) ((\i0 -> i2 i1 [ ]) (iData 4))))) (force mkCons))) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (bData (unBData (i5 (i2 i1)))) (bData (unBData (i7 (i2 i1))))) ((\i0 -> constrData 0 (i6 (i5 i1) (i6 (i7 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172)))) (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (i4 i1))) (i6 (unConstrData i1)))) (force headList)) (force tailList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) -removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (i4 (unBData (force headList i1)) (i2 (force tailList i1)))))) (unListData i1)) (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 [ ]) (bData #626172))))) (force mkCons))) -removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (\i0 -> listData (i3 (\i0 -> listData (i4 (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 3) (delay i1) (delay error))) (unListData i1))) (unListData i1))) (unListData i1))) (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> force (force ifThenElse (equalsInteger (force chooseData i1 0 1 2 3 4) 2) (delay i1) (delay error))) (unListData i1))) (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 7) (i12 (iData 8) (i12 (iData 9) (i12 (iData 10) i13)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate tow lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 7) (i12 (iData 8) (i12 (iData 9) i13))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate tow lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 8) (i12 (iData 8) (i12 (iData 9) (i12 (iData 10) i13)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate tow lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i14 (equalsData ((\i0 -> force (i15 (force nullList (i14 i1)) (delay (i13 i1)) (delay error))) (i10 (\i0 -> \i0 -> force (i13 i1 (delay i18) (delay ((\i0 -> force (i17 (equalsByteString (unBData (i15 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 1 i2) (delay (i17 (\i0 -> \i0 -> \i0 -> force (i21 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i24 (i2 (i22 i1)) (delay (\i0 -> \i0 -> i2 (i24 i3))) (delay (i3 i2 (i23 i1)))))))) (\i0 -> equalsData ((\i0 -> i21 (i15 i1)) (i20 i2)) ((\i0 -> i21 (i15 i1)) (i20 (i14 i1)))) ((\i0 -> unListData (i20 (i14 i1))) (i19 i4)))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData (i16 (i17 i1)))) (i9 i4) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i13 i2)) (i9 i1)) (unConstrData ((\i0 -> i17 (i10 (i11 i1))) (i16 (i17 (i10 i1)))))) (delay error))) (delay (i18 (i15 (i16 i1)) (i3 (i16 i2)))) (delay (i3 (i16 i2))))) (i8 (i14 i1)))))) ((\i0 -> unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i7 i1))))))) (i7 i1)))) (i12 (i6 i1))))) (listData ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i19 (i16 i1) (i2 (i17 i1)))))) i2) (unListData (i8 i3)) (unListData (i8 i2))))) (delay ()) (delay error))) (listData (i12 (iData 1) (i12 (iData 2) (i12 (iData 3) (i12 (iData 4) (i12 (iData 5) i13)))))) (listData (i12 (iData 6) (i12 (iData 7) (i12 (iData 8) (i12 (iData 9) (i12 (iData 10) i13)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffd8799f41d003ffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i9 (i9 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> listData (i2 (\i0 -> iData ((\i0 -> force (i9 (lessThanInteger i1 0) (delay error) (delay i1))) (unIData i1))) (unListData i1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file +erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unIData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) +erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unBData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) +working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (iData 42) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #62617a)))))) (force mkCons)) [ ])) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) +removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))))) (force mkCons)) [ ])) +removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) i12))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 8) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffd8799f41d003ffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 1848de742..661b19dcc 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -66,7 +66,7 @@ common c ghc-options: -Wall -Wcompat -Wincomplete-uni-patterns -Wno-unused-do-bind - -Wno-partial-type-signatures -Wmissing-export-lists + -Wno-partial-type-signatures -Wmissing-export-lists -Werror -Wincomplete-record-updates -Wmissing-deriving-strategies -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls -fprint-explicit-kinds diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/VerifySpec.hs index 0a689de9a..1031bf11c 100644 --- a/plutarch-test/src/Plutarch/VerifySpec.hs +++ b/plutarch-test/src/Plutarch/VerifySpec.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.VerifySpec (spec) where @@ -12,6 +13,10 @@ import Plutus.V1.Ledger.Api ( TxInfo (txInfoData), ) +import Plutarch.Unsafe ( + punsafeCoerce, + ) + import Plutarch import Plutarch.Api.V1 ( PDatum, @@ -25,15 +30,13 @@ import Plutarch.Api.V1 ( PValidator, ) import Plutarch.Builtin ( - pasInt, + PBuiltinMap, pforgetData, ppairDataBuiltin, ) import Plutarch.Prelude import Plutarch.Verify ( - PTryFrom (ptryFrom), - PTryUnwrapFrom (ptryUnwrapFrom), - PDepth (PShallow, PDeep), + PTryFrom (PExcess, ptryFrom), ) import Plutarch.ApiSpec (info, purpose) @@ -43,12 +46,6 @@ spec :: Spec spec = do describe "verification_untrusted_data" . pgoldenSpec $ do "erroneous" @\ do - "int /= bytestring" - @| checkShallow - @PInteger - @PByteString - (pdata $ pconstant "foo") - @-> pfails "(String, Integer) /= (String, String)" @| checkDeep @(PBuiltinPair (PAsData PInteger) (PAsData PByteString)) @@ -62,15 +59,14 @@ spec = do (pdata $ (pcons # (pdata $ pconstant 3)) #$ (psingleton # (pdata $ pconstant 4))) @-> pfails "A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer }" - @| checkDeep + @| checkDeep @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) - (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) + (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) @-> pfails + "Map Int String /= Map Int Int" + @| mapTestFails @-> pfails "working" @\ do - "int == int" - @| checkShallow @PInteger @PInteger (pdata $ pconstant 42) - @-> psucceeds "(String, String) == (String, String)" @| checkDeep @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) @@ -84,50 +80,57 @@ spec = do (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) @-> psucceeds "A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer }" - @| checkDeep + @| checkDeep @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) - (pdata (pdcons @"foo" # (pdata $ pconstant 7) #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) + (pdata (pdcons @"foo" # (pdata $ pconstant 7) #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) + @-> psucceeds "A { test := Integer, test2 := Integer } == [Integer]" - @| checkDeep + @| checkDeep @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) @(PBuiltinList (PAsData PInteger)) - (pdata (pcons # (pdata $ pconstant 7) #$ pcons # (pdata $ pconstant 42) # pnil)) + (pdata (pcons # (pdata $ pconstant 7) #$ pcons # (pdata $ pconstant 42) # pnil)) + @-> psucceeds "A { test := String, test2 := Integer } == { test := String, test2 := Integer }" @| checkDeep @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) - (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) - "removing the data wrapper" @\ do + (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) + @-> psucceeds + "Map Int String == Map Int String" + @| mapTestSucceeds @-> psucceeds + "removing the data wrapper" @\ do "erroneous" @\ do "(String, Integer) /= (String, String)" @| checkDeepUnwrap - @(PAsData (PBuiltinPair (PAsData PByteString) (PAsData PByteString))) + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) @(PBuiltinPair (PAsData PInteger) (PAsData PByteString)) - (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) - @-> pfails + (pdata $ ppairDataBuiltin # (pdata $ pconstant 42) # (pdata $ pconstant "bar")) + @-> pfails "[String] /= [Integer]" - @| (checkDeepUnwrap - @(PAsData (PBuiltinList (PAsData PInteger))) - @(PBuiltinList PByteString) - (pdata $ (pcons # (pdata $ pconstant 3)) #$ (psingleton # (pdata $ pconstant 4)))) + @| ( checkDeepUnwrap + @(PBuiltinList (PAsData PInteger)) + @(PBuiltinList (PAsData PByteString)) + (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "baz"))) + ) @-> pfails "working" @\ do "(String, String) == (String, String)" - @| (checkDeepUnwrap - @(PAsData (PBuiltinPair (PAsData PByteString) (PAsData PByteString))) - @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) - (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar"))) + @| ( checkDeepUnwrap + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) + ) @-> psucceeds "[String] == [String]" @| checkDeepUnwrap - @(PAsData (PBuiltinList (PAsData PByteString))) - @(PBuiltinList PByteString) - (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) - @-> psucceeds - "partial checks" @\ do + @(PBuiltinList (PAsData PByteString)) + @(PBuiltinList (PAsData PByteString)) + (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) + @-> psucceeds + "partial checks" @\ do -- this is way more expensive ... - "check whole structure" + "check whole structure" @| fullCheck @-> psucceeds -- ... than this "check structure partly" @@ -140,9 +143,9 @@ spec = do l2 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) l2 = toDatadList [6 .. 10] l3 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) - l3 = toDatadList [6..9] + l3 = toDatadList [6 .. 9] l4 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) - l4 = toDatadList [6,8,8,9,10] + l4 = toDatadList [6, 8, 8, 9, 10] "concatenate two lists, legal" @| validator # pforgetData l1 # pforgetData l2 # validContext @-> psucceeds "concatenate two lists, illegal (list too short)" @@ -152,78 +155,81 @@ spec = do "concatenate two lists, illegal (more than one output)" @| validator # pforgetData l1 # pforgetData l2 # invalidContext @-> pfails --- rec :: Term _ (PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) --- rec = +mapTestSucceeds :: ClosedTerm (PAsData (PBuiltinMap PByteString PInteger)) +mapTestSucceeds = unTermCont $ do + (val, _) <- ptryFrom @PData $ pforgetData sampleMap + pure val -checkDeepUnwrap :: - forall (actual :: PType) (target :: PType) b. - ( PTryUnwrapFrom 'PDeep target - , PAsData b ~ actual - ) => - ClosedTerm actual -> - ClosedTerm target -checkDeepUnwrap t = ptryUnwrapFrom @'PDeep #$ pforgetData t +mapTestFails :: ClosedTerm (PAsData (PBuiltinMap PInteger PInteger)) +mapTestFails = unTermCont $ do + (val, _) <- ptryFrom @PData $ pforgetData sampleMap + pure val +sampleMap :: Term _ (PAsData (PBuiltinMap PByteString PInteger)) +sampleMap = + pdata $ + pcons + # (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant 42)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant "bar") # (pdata $ pconstant 41)) + # pnil -checkShallow :: - forall (target :: PType) (actual :: PType) . - ( PTryFrom 'PShallow PData (PAsData target) +checkDeep :: + forall (target :: PType) (actual :: PType). + ( PTryFrom PData (PAsData target) + , PIsData actual + , PIsData target ) => ClosedTerm (PAsData actual) -> ClosedTerm (PAsData target) -checkShallow t = ptryFrom @'PShallow $ pforgetData t +checkDeep t = unTermCont $ fst <$> (ptryFrom $ pforgetData t) -checkDeep :: +checkDeepUnwrap :: forall (target :: PType) (actual :: PType). - ( PTryFrom 'PDeep PData (PAsData target) + ( PTryFrom PData (PAsData target) , PIsData actual , PIsData target ) => ClosedTerm (PAsData actual) -> - ClosedTerm (PAsData target) -checkDeep t = ptryFrom @'PDeep $ pforgetData t - + ClosedTerm (PExcess PData (PAsData target)) +checkDeepUnwrap t = unTermCont $ snd <$> (ptryFrom @PData @(PAsData target) $ pforgetData t) sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) -sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1..100] +sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1 .. 100] -- | PData serves as the base case for recursing into the structure partialCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList PData)))) -partialCheck = let dat :: Term _ PData - dat = pforgetData sampleStructure - in ptryFrom @'PDeep $ dat +partialCheck = + let dat :: Term _ PData + dat = pforgetData sampleStructure + in unTermCont $ fst <$> (ptryFrom dat) fullCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) -fullCheck = ptryFrom @'PDeep $ pforgetData sampleStructure - +fullCheck = unTermCont $ fst <$> (ptryFrom $ pforgetData sampleStructure) ------------------- Example: untrusted Redeemer ------------------------------------ - newtype PNatural (s :: S) = PMkNatural (Term s PInteger) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PNatural PInteger) -- | partial pmkNatural :: Term s (PInteger :--> PNatural) -pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) +pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) -instance PTryFrom a PData (PAsData PNatural) where - ptryFrom opq = - let i :: Term _ PInteger - i = pasInt # opq - in pdata $ pmkNatural # i +instance PTryFrom PData (PAsData PNatural) where + type PExcess PData (PAsData PNatural) = PNatural + ptryFrom opq = do + (wrapped, unwrapped) <- ptryFrom @PData @(PAsData PInteger) opq + ver <- tcont $ plet $ pmkNatural # unwrapped + pure $ (punsafeCoerce wrapped, ver) validator :: Term s PValidator validator = phoistAcyclic $ plam $ \dat red ctx -> unTermCont $ do - -- untrusted ---^---^ ^--- trusted - let trustedRedeemer :: Term _ (PBuiltinList (PAsData PNatural)) - trustedRedeemer = pfromData $ ptryFrom @'PDeep red - trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) - trustedDatum = pfromData $ ptryFrom @'PDeep dat - -- make the Datum and Redeemer trusted - - ownHash :: Term _ PDatumHash + (_, trustedRedeemer) <- ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red + (_, trustedDatum) <- (ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) dat) + -- make the Datum and Redeemer trusted + + let ownHash :: Term _ PDatumHash ownHash = unTermCont $ do PJust ownInput <- tcont $ pmatch $ pfindOwnInput # ctx let maybeHash :: Term _ (PMaybeData PDatumHash) @@ -239,13 +245,13 @@ validator = phoistAcyclic $ matchingHashDatum :: Term _ (PBuiltinList PDatum) matchingHashDatum = precList - ( \self x xs -> pletFields @["_0", "_1"] x $ - \tup -> - ptrace "iteration" $ - pif - (hrecField @"_0" tup #== ownHash) - (ptrace "appended something" pcons # (hrecField @"_1" tup) # (self # xs)) - (ptrace "called without appending" self # xs) + ( \self x xs -> pletFields @["_0", "_1"] x $ + \tup -> + ptrace "iteration" $ + pif + (hrecField @"_0" tup #== ownHash) + (ptrace "appended something" pcons # (hrecField @"_1" tup) # (self # xs)) + (ptrace "called without appending" self # xs) ) (const pnil) #$ outputs @@ -254,7 +260,8 @@ validator = phoistAcyclic $ singleOutput :: Term _ PDatum singleOutput = plet matchingHashDatum $ \dat -> - pif (pnull #$ ptail # dat) + pif + (pnull #$ ptail # dat) (phead # dat) (ptraceError "not a single output") -- make sure that after filtering the outputs, only one output @@ -304,7 +311,6 @@ pfind = phoistAcyclic $ ------------------- Mocking a transaction ------------------------------------------ - ctx :: [(DatumHash, Datum)] -> Term s PScriptContext ctx l = pconstant (ScriptContext (info' l) purpose) @@ -315,18 +321,16 @@ validList1 :: [(DatumHash, Datum)] validList1 = let dat :: Datum dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] - in [("d0", dat)] + in [("d0", dat)] invalidList1 :: [(DatumHash, Datum)] invalidList1 = let dat :: Datum dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] - in [("d0", dat), ("d0", Datum $ toBuiltinData @Integer 3)] - + in [("d0", dat), ("d0", Datum $ toBuiltinData @Integer 3)] ------------------- Helpers -------------------------------------------------------- - toDatadList :: [Integer] -> Term s (PAsData (PBuiltinList (PAsData PInteger))) toDatadList = pdata . (foldr go pnil) where From 81768c125a9f63ab3ca566907d3238e40bcd12ee Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 2 Mar 2022 01:24:21 +0300 Subject: [PATCH 132/584] Rename to ptryUncons --- Plutarch/List.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Plutarch/List.hs b/Plutarch/List.hs index c5a621200..0fd2fd793 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -19,7 +19,7 @@ module Plutarch.List ( -- * Deconstruction puncons, - punsafeUncons, + ptryUncons, -- * Combine pconcat, @@ -139,11 +139,9 @@ pconvertLists = phoistAcyclic $ pnil -- | Extract head and tail of the list, throws error if list is empty. -punsafeUncons :: +ptryUncons :: PIsListLike list a => - Term s (list a) -> - Term s (PPair a (list a)) -punsafeUncons = pelimList (\x -> pcon . PPair x) perror +ptryUncons = -- | Extract head and tail of the list, if list is not empty. puncons :: From 4d82b781f8e59adcbd2fe77bb6a29b8f42a537a4 Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 2 Mar 2022 01:24:43 +0300 Subject: [PATCH 133/584] Make puncons/ptryUncons plutarch-level functions --- Plutarch/List.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Plutarch/List.hs b/Plutarch/List.hs index 0fd2fd793..d7fd0eb40 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -70,8 +70,8 @@ import Plutarch ( import Plutarch.Bool (PBool (PFalse, PTrue), PEq, pif, (#&&), (#==), (#||)) import Plutarch.Integer (PInteger) import Plutarch.Lift (pconstant) +import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Pair (PPair (PPair)) -import Plutarch.Maybe (PMaybe (PJust,PNothing)) import Data.Kind @@ -141,14 +141,16 @@ pconvertLists = phoistAcyclic $ -- | Extract head and tail of the list, throws error if list is empty. ptryUncons :: PIsListLike list a => + Term s (list a :--> PPair a (list a)) ptryUncons = + plam $ pelimList (\x -> pcon . PPair x) perror -- | Extract head and tail of the list, if list is not empty. -puncons :: +puncons :: PIsListLike list a => - Term s (list a) -> - Term s (PMaybe (PPair a (list a))) -puncons = pelimList (\x -> pcon . PJust . pcon . PPair x) (pcon PNothing) + Term s (list a :--> PMaybe (PPair a (list a))) +puncons = + plam $ pelimList (\x -> pcon . PJust . pcon . PPair x) (pcon PNothing) -- | Like 'pelimList', but with a fixpoint recursion hatch. precList :: From 1c161fab8531c5b518cda1079e65a344e08f364d Mon Sep 17 00:00:00 2001 From: gnumonik Date: Wed, 2 Mar 2022 04:39:42 +0000 Subject: [PATCH 134/584] Reworked PDataSum to have constructors (necessary for giving it a PlutusType instance), wrote the PlutusType instance for PDataSum + some auxilliary data types, type families, type classes, functions. Everything typechecks and I think the approach here works, but it need some revisions. --- Plutarch/DataRepr/Internal.hs | 122 ++++++++++++++++++++++++++++++++-- 1 file changed, 118 insertions(+), 4 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 2fa9806db..cee26e89b 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -33,7 +33,8 @@ import GHC.TypeLits ( Symbol, TypeError, natVal, - type (+), + type (+), + Natural ) import Generics.SOP ( All, @@ -92,13 +93,18 @@ import Plutarch.Builtin ( import Plutarch.DataRepr.Internal.Generic (MkSum (mkSum)) import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) import Plutarch.Integer (PInteger) -import Plutarch.Internal (S (SI)) +import Plutarch.Internal (S (SI), punsafeBuiltin) import Plutarch.Internal.TypeFamily (ToPType2) import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) import Plutarch.Unsafe (punsafeCoerce) import qualified Plutus.V1.Ledger.Api as Ledger +import qualified PlutusCore as PLC +import Data.Constraint +import Data.Constraint.Nat (plusNat) +import Data.Type.Equality +import qualified Unsafe.Coerce as UNSAFE {- | A "record" of `exists a. PAsData a`. The underlying representation is `PBuiltinList PData`. @@ -180,7 +186,114 @@ type family PUnLabel (a :: PLabeledType) :: PType where This is how most data structures are stored on-chain. -} type PDataSum :: [[PLabeledType]] -> PType -data PDataSum (defs :: [[PLabeledType]]) (s :: S) +data PDataSum (defs :: [[PLabeledType]]) (s :: S) where + MkPDataSum :: PDataSum' n 'True defs s -> PDataSum defs s + +data PDataSum' :: Natural -> Bool -> [[PLabeledType]] -> PType where + SumZE :: forall {x:: [PLabeledType]} {s :: S} + . PDataSum' 0 'False '[x] s + + SumZF :: forall {x:: [PLabeledType]} {s :: S} + . (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) + -> PDataSum' 0 'True '[x] s + + InjE :: forall {n :: Natural} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} + . (KnownNat (n+1)) + => (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) + -> PDataSum' n 'False xss s + -> PDataSum' (n + 1) 'True (x ': xss) s + + InjF :: forall {n :: Natural} {b :: Bool} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} + . KnownNat (n+1) + => PDataSum' n b xss s + -> PDataSum' (n + 1) b (x ': xss) s + +-- Used to reconstruct the PDataSum in the pmatch' instance for PlutusType +data IndexedSum :: Nat -> [k] -> Type where + IxZ :: forall k (a :: k). IndexedSum 0 '[a] + + IxS :: forall k (a :: k) (as :: [k]) + . IndexedSum (Length as) as -> IndexedSum (Length as + 1) (a ': as) + +-- Well, length minus one at least +type family Length (xss :: [k]) :: Nat where + Length '[x] = 0 + Length (x ': xs) = (Length xs) + 1 + +-- Could convert an SList into this, but this is simpler (I don't think SList is suitable here) +class IndexableSum (defs :: [k]) where + indexSum :: IndexedSum (Length defs) defs + +-- this is kind of a cheap hack and there's probably a better way to do this +knownLength :: forall n ks. IndexedSum n ks -> Dict (KnownNat n) +knownLength = \case + IxZ -> Dict + ixed@(IxS rest) -> case knownLength rest of + d@Dict -> go ixed d + where + go :: forall (n' :: Nat) a as . IndexedSum (n' + 1) (a:as) + -> Dict (KnownNat n') + -> Dict (KnownNat (n' + 1)) + go (IxS _) Dict = mapDict plusNat (Dict :: Dict (KnownNat n', KnownNat 1)) + +-- maybe don't need the constraints? +addLength :: forall k ks. (IndexableSum (k:ks), IndexableSum ks) => Length (k:ks) :~: Length ks + 1 +addLength = UNSAFE.unsafeCoerce Refl + +-- maybe overlap-related pragmas? +instance IndexableSum '[k] where + indexSum = IxZ + +instance IndexableSum ks => IndexableSum (k ': ks) where + indexSum = case addLength @k @ks of + Refl -> IxS (indexSum :: IndexedSum (Length ks) ks) + +-- the constraint will be satisfied by every nonempty list +instance IndexableSum defs => PlutusType (PDataSum defs) where + type PInner (PDataSum defs) _ = PData + + pcon' :: forall (s :: S) (b :: PType). PDataSum defs s -> Term s (PInner (PDataSum defs) b) + pcon' (MkPDataSum s) = go s + where + go :: forall {n :: Natural} {defs :: [[PLabeledType]]} {s :: S}. PDataSum' n 'True defs s -> Term s (PInner (PDataSum defs) b) + go = \case + SumZF f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger (natVal $ Proxy @n)) # (f id) -- rewrite this with pconstrBuiltin + InjE f _ -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger (natVal $ Proxy @n)) # (f id) + InjF pds -> go pds + + + pmatch' :: forall (s :: S) (b :: PType) + . Term s (PInner (PDataSum defs) b) + -> (PDataSum defs s -> Term s b) + -> Term s b + pmatch' d f = + plet (pasConstr #$ pforgetData $ pdata d) $ \d' -> + plet (pfstBuiltin # d') $ \constr -> + plet (psndBuiltin # d') $ \args -> + go + constr args (indexSum :: IndexedSum (Length defs) defs) (f . MkPDataSum) + where + iLen :: forall n as s. IndexedSum n as -> Term s PInteger + iLen ixed = pconstant $ natVal (Proxy @n) \\ knownLength ixed -- pconstant bad? + + mkEmpty :: forall n as s. IndexedSum n as -> PDataSum' n 'False as s + mkEmpty = \case + IxZ -> SumZE + i@(IxS rest) -> InjF (mkEmpty rest) \\ knownLength i + + go :: forall n as + . Term s PInteger + -> Term s (PBuiltinList PData) + -> IndexedSum (n) as + -> (PDataSum' n 'True as s -> Term s b) + -> Term s b + go constr args ias@(IxS rest) g = + pif (constr #== iLen ias) + (g $ InjE (\k -> k $ punsafeCoerce args) $ mkEmpty rest) + (go constr args rest (g . InjF)) + \\ knownLength ias + + go _ args IxZ g = g $ SumZF $ \k -> k $ punsafeCoerce args instance PIsData (PDataSum defs) where pdata = punsafeCoerce @@ -228,7 +341,7 @@ pmatchDataSum d handlers = plet (pfstBuiltin # d') $ \constr -> plet (psndBuiltin # d') $ \args -> let handlers' = applyHandlers args handlers - in runTermCont (findCommon handlers') $ \common -> + in runTermCont (findCommon handlers') $ \common -> go common 0 @@ -381,3 +494,4 @@ class IsBuiltinList a where instance IsBuiltinList (PDataRecord l) where dataListFrom = punsafeCoerce + From b1441e2cb727ba5e1b6ae136e92539b43e29d580 Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 2 Mar 2022 13:34:29 +0300 Subject: [PATCH 135/584] Hoist uncons functions --- Plutarch/List.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Plutarch/List.hs b/Plutarch/List.hs index d7fd0eb40..92f762af5 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -143,14 +143,18 @@ ptryUncons :: PIsListLike list a => Term s (list a :--> PPair a (list a)) ptryUncons = - plam $ pelimList (\x -> pcon . PPair x) perror + phoistAcyclic $ + plam $ + pelimList (\x -> pcon . PPair x) perror -- | Extract head and tail of the list, if list is not empty. puncons :: PIsListLike list a => Term s (list a :--> PMaybe (PPair a (list a))) puncons = - plam $ pelimList (\x -> pcon . PJust . pcon . PPair x) (pcon PNothing) + phoistAcyclic $ + plam $ + pelimList (\x -> pcon . PJust . pcon . PPair x) (pcon PNothing) -- | Like 'pelimList', but with a fixpoint recursion hatch. precList :: From dc2ebbc96efb99aa66d2917c7439beedce662066 Mon Sep 17 00:00:00 2001 From: gnumonik Date: Wed, 2 Mar 2022 18:05:10 +0000 Subject: [PATCH 136/584] Added an explanation of how this is supposed to work, changed some constructor names for clarity --- Plutarch/DataRepr/Internal.hs | 95 ++++++++++++++++++++++++++--------- 1 file changed, 71 insertions(+), 24 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index cee26e89b..784341ec1 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -189,21 +189,66 @@ type PDataSum :: [[PLabeledType]] -> PType data PDataSum (defs :: [[PLabeledType]]) (s :: S) where MkPDataSum :: PDataSum' n 'True defs s -> PDataSum defs s +{- Overview of how this works: + +1) We need constructors for PDataSum in order to define a PlutusType instance. + +2) Ideally, we want the PDataSum data type to be structured so as to enforce the invariant that each sum contains + *exactly one* of its choices + +3) We can't do that with PDataSum alone. To enforce those invariants at the type level, we need an index type which encodes + the fact that the sum contains exactly one choice. + +4) PDataSum' is the helper type which allows us to express those invariants. The structure of the type has to be inductive, but + we need four constructors (two Zero / two Suc) to cover each of the possible cases. The Boolean type argument indicates whether or not the + sum contains an element, while the Natural type argument represents the position of the element in the list of choices. + + a) 'SumZE' represents a one element sum that *does not* contain its element. + + b) 'SumZF' represents a one element sum that *does* contain its element. + + c) 'InjE' injects an element into a sum which does not contain any elements such that the sum will contain the injected element. + + d) 'InjF' injects an element into a sum which may or may not contain any elements, and preserves the containment status of + the sum it was injected into. + + Suggestions for better constructor names are welcome. + +5) PDataSum is a wrapper around a PDataSum' that contains exactly one of its elements. The structure of PDataSum' ensures that any 'PDataSum n 'True' + will contain exactly one of its elements. An empty sum cannot be represented, and there is no way to inject a second element into a sum which already + contains one element such that the resulting sum contains more than one of its elements. + +6) We use a universally quantified continuation to indicate containment. I *think* we have to do it this way. + +7) We need some helper utilities to reconstruct the Sum (which we have to do) in pmatch'. Those utilities are: + + a) 'IndexedSum'. This is basically a singleton list a la SList from sop-core, except it can only represent nonempty lists, has an + "explicit" inductive structure, and indicates the position of elements explicitly. + + b) A 'Length' type family. This doesn't work like 'length' from Prelude: 'Length '[a]' == 0, not 1. + + c) A type class 'IndexableSum' which is like SListI from sop-core, except for our 'IndexedSum' type. As far as I can tell it is impossible + to reconstruct the sum without an inductive GADT that represents the structure of the sum. We need to conjure that structure out of thin air, + so we need a type class. + + d) Some dictionary stuff and an axiom to placate GHC and make this all typecheck. +-} + data PDataSum' :: Natural -> Bool -> [[PLabeledType]] -> PType where - SumZE :: forall {x:: [PLabeledType]} {s :: S} + SumZ_ :: forall {x:: [PLabeledType]} {s :: S} . PDataSum' 0 'False '[x] s - SumZF :: forall {x:: [PLabeledType]} {s :: S} + SumZ :: forall {x:: [PLabeledType]} {s :: S} . (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) -> PDataSum' 0 'True '[x] s - InjE :: forall {n :: Natural} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} + Inj :: forall {n :: Natural} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} . (KnownNat (n+1)) => (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) -> PDataSum' n 'False xss s -> PDataSum' (n + 1) 'True (x ': xss) s - InjF :: forall {n :: Natural} {b :: Bool} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} + Inj_ :: forall {n :: Natural} {b :: Bool} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} . KnownNat (n+1) => PDataSum' n b xss s -> PDataSum' (n + 1) b (x ': xss) s @@ -224,7 +269,7 @@ type family Length (xss :: [k]) :: Nat where class IndexableSum (defs :: [k]) where indexSum :: IndexedSum (Length defs) defs --- this is kind of a cheap hack and there's probably a better way to do this +-- this is kind of a cheap hack and there's probably a better way knownLength :: forall n ks. IndexedSum n ks -> Dict (KnownNat n) knownLength = \case IxZ -> Dict @@ -243,7 +288,7 @@ addLength = UNSAFE.unsafeCoerce Refl -- maybe overlap-related pragmas? instance IndexableSum '[k] where indexSum = IxZ - + instance IndexableSum ks => IndexableSum (k ': ks) where indexSum = case addLength @k @ks of Refl -> IxS (indexSum :: IndexedSum (Length ks) ks) @@ -252,16 +297,17 @@ instance IndexableSum ks => IndexableSum (k ': ks) where instance IndexableSum defs => PlutusType (PDataSum defs) where type PInner (PDataSum defs) _ = PData + -- this is reasonably straightforward. we don't need to worry about the SumZE case because it's impossible here pcon' :: forall (s :: S) (b :: PType). PDataSum defs s -> Term s (PInner (PDataSum defs) b) pcon' (MkPDataSum s) = go s where go :: forall {n :: Natural} {defs :: [[PLabeledType]]} {s :: S}. PDataSum' n 'True defs s -> Term s (PInner (PDataSum defs) b) go = \case - SumZF f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger (natVal $ Proxy @n)) # (f id) -- rewrite this with pconstrBuiltin - InjE f _ -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger (natVal $ Proxy @n)) # (f id) - InjF pds -> go pds - + SumZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger (natVal $ Proxy @n)) # (f id) -- rewrite this with pconstrBuiltin? + Inj f _ -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger (natVal $ Proxy @n)) # (f id) + Inj_ pds -> go pds + -- this is more complicated pmatch' :: forall (s :: S) (b :: PType) . Term s (PInner (PDataSum defs) b) -> (PDataSum defs s -> Term s b) @@ -270,30 +316,31 @@ instance IndexableSum defs => PlutusType (PDataSum defs) where plet (pasConstr #$ pforgetData $ pdata d) $ \d' -> plet (pfstBuiltin # d') $ \constr -> plet (psndBuiltin # d') $ \args -> - go - constr args (indexSum :: IndexedSum (Length defs) defs) (f . MkPDataSum) + go constr args (indexSum :: IndexedSum (Length defs) defs) (f . MkPDataSum) where + -- get the PInteger length of an IndexedSum. iLen :: forall n as s. IndexedSum n as -> Term s PInteger iLen ixed = pconstant $ natVal (Proxy @n) \\ knownLength ixed -- pconstant bad? + -- Used to "fill in" the remaining elements of the "right hand side" of a sum once we've determined which element the sum ought to contain. mkEmpty :: forall n as s. IndexedSum n as -> PDataSum' n 'False as s mkEmpty = \case - IxZ -> SumZE - i@(IxS rest) -> InjF (mkEmpty rest) \\ knownLength i + IxZ -> SumZ_ + i@(IxS rest) -> Inj_ (mkEmpty rest) \\ knownLength i go :: forall n as - . Term s PInteger - -> Term s (PBuiltinList PData) - -> IndexedSum (n) as - -> (PDataSum' n 'True as s -> Term s b) - -> Term s b + . Term s PInteger -- the index of the constructor in the sum + -> Term s (PBuiltinList PData) -- the inner representation of the record at the index of the first argument + -> IndexedSum n as -- the GADT which represents the structure of the sum (can't construct it w/o this) + -> (PDataSum' n 'True as s -> Term s b) -- an accumulator function. represents an empty "left-hand side" of the sum + -> Term s b go constr args ias@(IxS rest) g = - pif (constr #== iLen ias) - (g $ InjE (\k -> k $ punsafeCoerce args) $ mkEmpty rest) - (go constr args rest (g . InjF)) - \\ knownLength ias + pif (constr #== iLen ias) -- if the index of the constructor matches the size of the sum + (g $ Inj (\k -> k $ punsafeCoerce args) $ mkEmpty rest) -- then cons an injection (which contains an element) onto an empty tail, and append the empty left hand side at the front + (go constr args rest (g . Inj_)) -- else recurse, "moving the accumulator forward by one" + \\ knownLength ias -- ghc is bad at math - go _ args IxZ g = g $ SumZF $ \k -> k $ punsafeCoerce args + go _ args IxZ g = g $ SumZ $ \k -> k $ punsafeCoerce args -- if we've reached the end of the IndexedSum we have to do this, no point in checking that the indices match instance PIsData (PDataSum defs) where pdata = punsafeCoerce From 2a1a593fa123352cd9ed33fc7bd198e4aecbc75b Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 2 Mar 2022 22:10:25 +0300 Subject: [PATCH 137/584] Fix changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4d15ae83..41316f6bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Revision history for plutarch # Unreleased -- Add `puncons` and `punsafeUncons` functions for deconstructing list. +- Add `puncons` and `ptryUncons` functions for deconstructing list. - `TermCont`: Parametrize by result type; add `MonadFail` instance; etc. From b333fae024188ab03d167ef01bdb6062e8ad1374 Mon Sep 17 00:00:00 2001 From: gnumonik Date: Wed, 2 Mar 2022 21:16:29 +0000 Subject: [PATCH 138/584] Replaced my type classes / helper GADTs with SListI and SList from sop-core, removed Data.Constraint stuff, removed unsafeCoerce. --- Plutarch/DataRepr/Internal.hs | 212 ++++++++++++---------------------- 1 file changed, 74 insertions(+), 138 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 784341ec1..62601a508 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -33,8 +33,7 @@ import GHC.TypeLits ( Symbol, TypeError, natVal, - type (+), - Natural + type (+) ) import Generics.SOP ( All, @@ -55,6 +54,9 @@ import Generics.SOP ( hfromI, hindex, to, + I(..), + sList, + SList(..), lengthSList ) import Plutarch ( Dig, @@ -101,10 +103,6 @@ import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) import Plutarch.Unsafe (punsafeCoerce) import qualified Plutus.V1.Ledger.Api as Ledger import qualified PlutusCore as PLC -import Data.Constraint -import Data.Constraint.Nat (plusNat) -import Data.Type.Equality -import qualified Unsafe.Coerce as UNSAFE {- | A "record" of `exists a. PAsData a`. The underlying representation is `PBuiltinList PData`. @@ -187,160 +185,98 @@ type family PUnLabel (a :: PLabeledType) :: PType where -} type PDataSum :: [[PLabeledType]] -> PType data PDataSum (defs :: [[PLabeledType]]) (s :: S) where - MkPDataSum :: PDataSum' n 'True defs s -> PDataSum defs s + MkPDataSum :: PDataSum' 'True defs s -> PDataSum defs s -{- Overview of how this works: -1) We need constructors for PDataSum in order to define a PlutusType instance. +data PDataSum' :: Bool -> [[PLabeledType]] -> PType where + SumZ_ :: forall + {x:: [PLabeledType]} + {s :: S} + . PDataSum' 'False '[x] s -2) Ideally, we want the PDataSum data type to be structured so as to enforce the invariant that each sum contains - *exactly one* of its choices + SumZ :: forall + {x:: [PLabeledType]} + {s :: S} + . (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) + -> PDataSum' 'True '[x] s -3) We can't do that with PDataSum alone. To enforce those invariants at the type level, we need an index type which encodes - the fact that the sum contains exactly one choice. + Inj :: forall + {x :: [PLabeledType]} + {xss :: [[PLabeledType]]} + {s :: S} + . (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) + -> PDataSum' 'False xss s + -> PDataSum' 'True (x ': xss) s -4) PDataSum' is the helper type which allows us to express those invariants. The structure of the type has to be inductive, but - we need four constructors (two Zero / two Suc) to cover each of the possible cases. The Boolean type argument indicates whether or not the - sum contains an element, while the Natural type argument represents the position of the element in the list of choices. + Inj_ :: forall {b :: Bool} {w :: [PLabeledType]} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} + . PDataSum' b (x:xss) s + -> PDataSum' b (w:x:xss) s - a) 'SumZE' represents a one element sum that *does not* contain its element. - - b) 'SumZF' represents a one element sum that *does* contain its element. - - c) 'InjE' injects an element into a sum which does not contain any elements such that the sum will contain the injected element. - - d) 'InjF' injects an element into a sum which may or may not contain any elements, and preserves the containment status of - the sum it was injected into. - - Suggestions for better constructor names are welcome. - -5) PDataSum is a wrapper around a PDataSum' that contains exactly one of its elements. The structure of PDataSum' ensures that any 'PDataSum n 'True' - will contain exactly one of its elements. An empty sum cannot be represented, and there is no way to inject a second element into a sum which already - contains one element such that the resulting sum contains more than one of its elements. - -6) We use a universally quantified continuation to indicate containment. I *think* we have to do it this way. - -7) We need some helper utilities to reconstruct the Sum (which we have to do) in pmatch'. Those utilities are: - - a) 'IndexedSum'. This is basically a singleton list a la SList from sop-core, except it can only represent nonempty lists, has an - "explicit" inductive structure, and indicates the position of elements explicitly. - - b) A 'Length' type family. This doesn't work like 'length' from Prelude: 'Length '[a]' == 0, not 1. - - c) A type class 'IndexableSum' which is like SListI from sop-core, except for our 'IndexedSum' type. As far as I can tell it is impossible - to reconstruct the sum without an inductive GADT that represents the structure of the sum. We need to conjure that structure out of thin air, - so we need a type class. - - d) Some dictionary stuff and an axiom to placate GHC and make this all typecheck. --} - -data PDataSum' :: Natural -> Bool -> [[PLabeledType]] -> PType where - SumZ_ :: forall {x:: [PLabeledType]} {s :: S} - . PDataSum' 0 'False '[x] s - - SumZ :: forall {x:: [PLabeledType]} {s :: S} - . (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) - -> PDataSum' 0 'True '[x] s - - Inj :: forall {n :: Natural} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} - . (KnownNat (n+1)) - => (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) - -> PDataSum' n 'False xss s - -> PDataSum' (n + 1) 'True (x ': xss) s - - Inj_ :: forall {n :: Natural} {b :: Bool} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} - . KnownNat (n+1) - => PDataSum' n b xss s - -> PDataSum' (n + 1) b (x ': xss) s - --- Used to reconstruct the PDataSum in the pmatch' instance for PlutusType -data IndexedSum :: Nat -> [k] -> Type where - IxZ :: forall k (a :: k). IndexedSum 0 '[a] - - IxS :: forall k (a :: k) (as :: [k]) - . IndexedSum (Length as) as -> IndexedSum (Length as + 1) (a ': as) - --- Well, length minus one at least -type family Length (xss :: [k]) :: Nat where - Length '[x] = 0 - Length (x ': xs) = (Length xs) + 1 - --- Could convert an SList into this, but this is simpler (I don't think SList is suitable here) -class IndexableSum (defs :: [k]) where - indexSum :: IndexedSum (Length defs) defs - --- this is kind of a cheap hack and there's probably a better way -knownLength :: forall n ks. IndexedSum n ks -> Dict (KnownNat n) -knownLength = \case - IxZ -> Dict - ixed@(IxS rest) -> case knownLength rest of - d@Dict -> go ixed d - where - go :: forall (n' :: Nat) a as . IndexedSum (n' + 1) (a:as) - -> Dict (KnownNat n') - -> Dict (KnownNat (n' + 1)) - go (IxS _) Dict = mapDict plusNat (Dict :: Dict (KnownNat n', KnownNat 1)) - --- maybe don't need the constraints? -addLength :: forall k ks. (IndexableSum (k:ks), IndexableSum ks) => Length (k:ks) :~: Length ks + 1 -addLength = UNSAFE.unsafeCoerce Refl - --- maybe overlap-related pragmas? -instance IndexableSum '[k] where - indexSum = IxZ - -instance IndexableSum ks => IndexableSum (k ': ks) where - indexSum = case addLength @k @ks of - Refl -> IxS (indexSum :: IndexedSum (Length ks) ks) +-- the length functions in sop-core gives the actual length, we want length-1 +adjustedLength :: forall x xs proxy. SListI (x:xs) => proxy (x:xs) -> Integer +adjustedLength proxy = fromIntegral (lengthSList proxy) - 1 -- the constraint will be satisfied by every nonempty list -instance IndexableSum defs => PlutusType (PDataSum defs) where - type PInner (PDataSum defs) _ = PData - - -- this is reasonably straightforward. we don't need to worry about the SumZE case because it's impossible here - pcon' :: forall (s :: S) (b :: PType). PDataSum defs s -> Term s (PInner (PDataSum defs) b) +instance SListI (def:defs) => PlutusType (PDataSum (def:defs)) where + type PInner (PDataSum (def:defs)) _ = PData + + -- this is reasonably straightforward. we don't need to worry about the SumZ_ case because it's impossible here + pcon' :: forall + {s :: S} + {b :: PType} + . PDataSum (def:defs) s + -> Term s (PInner (PDataSum (def:defs)) b) pcon' (MkPDataSum s) = go s where - go :: forall {n :: Natural} {defs :: [[PLabeledType]]} {s :: S}. PDataSum' n 'True defs s -> Term s (PInner (PDataSum defs) b) - go = \case - SumZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger (natVal $ Proxy @n)) # (f id) -- rewrite this with pconstrBuiltin? - Inj f _ -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger (natVal $ Proxy @n)) # (f id) - Inj_ pds -> go pds + go :: forall + {d :: [PLabeledType]} + {ds :: [[PLabeledType]]} + {s :: S} + . PDataSum' 'True (d:ds) s + -> Term s (PInner (PDataSum (d:ds)) b) + go = \case + SumZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(def:defs)) # (f id) -- rewrite this with pconstrBuiltin? + Inj f _ -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(def:defs)) # (f id) + Inj_ pds -> go pds -- this is more complicated - pmatch' :: forall (s :: S) (b :: PType) - . Term s (PInner (PDataSum defs) b) - -> (PDataSum defs s -> Term s b) + pmatch' :: forall + {s :: S} + {b :: PType} + . Term s (PInner (PDataSum (def:defs)) b) + -> (PDataSum (def:defs) s -> Term s b) -> Term s b pmatch' d f = plet (pasConstr #$ pforgetData $ pdata d) $ \d' -> plet (pfstBuiltin # d') $ \constr -> plet (psndBuiltin # d') $ \args -> - go constr args (indexSum :: IndexedSum (Length defs) defs) (f . MkPDataSum) + go constr args sList (f . MkPDataSum) where - -- get the PInteger length of an IndexedSum. - iLen :: forall n as s. IndexedSum n as -> Term s PInteger - iLen ixed = pconstant $ natVal (Proxy @n) \\ knownLength ixed -- pconstant bad? - -- Used to "fill in" the remaining elements of the "right hand side" of a sum once we've determined which element the sum ought to contain. - mkEmpty :: forall n as s. IndexedSum n as -> PDataSum' n 'False as s - mkEmpty = \case - IxZ -> SumZ_ - i@(IxS rest) -> Inj_ (mkEmpty rest) \\ knownLength i - - go :: forall n as + mkEmpty :: forall + {d :: [PLabeledType]} + {ds :: [[PLabeledType]]} + {s :: S} + . SListI (d:ds) + => SList (d:ds) + -> PDataSum' 'False (d:ds) s + mkEmpty SCons = case sList @ds of + SNil -> SumZ_ + rest@SCons -> Inj_ (mkEmpty rest) + + go :: forall {d :: [PLabeledType]} {ds :: [[PLabeledType]]} . Term s PInteger -- the index of the constructor in the sum -> Term s (PBuiltinList PData) -- the inner representation of the record at the index of the first argument - -> IndexedSum n as -- the GADT which represents the structure of the sum (can't construct it w/o this) - -> (PDataSum' n 'True as s -> Term s b) -- an accumulator function. represents an empty "left-hand side" of the sum + -> SList (d:ds) -- a GADT which represents the structure of the sum (can't construct it w/o this) + -> (PDataSum' 'True (d:ds) s -> Term s b) -- an accumulator function. represents an empty "left-hand side" of the sum -> Term s b - go constr args ias@(IxS rest) g = - pif (constr #== iLen ias) -- if the index of the constructor matches the size of the sum - (g $ Inj (\k -> k $ punsafeCoerce args) $ mkEmpty rest) -- then cons an injection (which contains an element) onto an empty tail, and append the empty left hand side at the front - (go constr args rest (g . Inj_)) -- else recurse, "moving the accumulator forward by one" - \\ knownLength ias -- ghc is bad at math - - go _ args IxZ g = g $ SumZ $ \k -> k $ punsafeCoerce args -- if we've reached the end of the IndexedSum we have to do this, no point in checking that the indices match + go constr args SCons g = + case sList @ds of + SNil -> g $ SumZ $ \k -> k $ punsafeCoerce args + rest@SCons -> + pif (constr #== pconstant (adjustedLength $ Proxy @(d:ds))) -- if the index of the constructor matches the size of the sum + (g $ Inj (\k -> k $ punsafeCoerce args) $ mkEmpty sList) -- then cons an injection (which contains an element) onto an empty tail, and append the empty left hand side at the front + (go constr args rest (g . Inj_)) -- else recurse, "moving the accumulator forward by one" instance PIsData (PDataSum defs) where pdata = punsafeCoerce From 37f242459f8116155b44bbfb89f3bb77e350a6f2 Mon Sep 17 00:00:00 2001 From: gnumonik Date: Wed, 2 Mar 2022 21:21:45 +0000 Subject: [PATCH 139/584] Implemented the changes @srid suggested for PDataSum. --- Plutarch/DataRepr/Internal.hs | 72 +++++++---------------------------- 1 file changed, 14 insertions(+), 58 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 62601a508..a27101040 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -185,61 +185,29 @@ type family PUnLabel (a :: PLabeledType) :: PType where -} type PDataSum :: [[PLabeledType]] -> PType data PDataSum (defs :: [[PLabeledType]]) (s :: S) where - MkPDataSum :: PDataSum' 'True defs s -> PDataSum defs s + DSZ :: (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) + -> PDataSum (x ': xs) s - -data PDataSum' :: Bool -> [[PLabeledType]] -> PType where - SumZ_ :: forall - {x:: [PLabeledType]} - {s :: S} - . PDataSum' 'False '[x] s - - SumZ :: forall - {x:: [PLabeledType]} - {s :: S} - . (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) - -> PDataSum' 'True '[x] s - - Inj :: forall - {x :: [PLabeledType]} - {xss :: [[PLabeledType]]} - {s :: S} - . (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) - -> PDataSum' 'False xss s - -> PDataSum' 'True (x ': xss) s - - Inj_ :: forall {b :: Bool} {w :: [PLabeledType]} {x :: [PLabeledType]} {xss :: [[PLabeledType]]} {s :: S} - . PDataSum' b (x:xss) s - -> PDataSum' b (w:x:xss) s + DSS :: PDataSum xs s -> PDataSum (x ': xs) s -- the length functions in sop-core gives the actual length, we want length-1 adjustedLength :: forall x xs proxy. SListI (x:xs) => proxy (x:xs) -> Integer adjustedLength proxy = fromIntegral (lengthSList proxy) - 1 --- the constraint will be satisfied by every nonempty list instance SListI (def:defs) => PlutusType (PDataSum (def:defs)) where type PInner (PDataSum (def:defs)) _ = PData - -- this is reasonably straightforward. we don't need to worry about the SumZ_ case because it's impossible here pcon' :: forall {s :: S} {b :: PType} . PDataSum (def:defs) s -> Term s (PInner (PDataSum (def:defs)) b) - pcon' (MkPDataSum s) = go s - where - go :: forall - {d :: [PLabeledType]} - {ds :: [[PLabeledType]]} - {s :: S} - . PDataSum' 'True (d:ds) s - -> Term s (PInner (PDataSum (d:ds)) b) - go = \case - SumZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(def:defs)) # (f id) -- rewrite this with pconstrBuiltin? - Inj f _ -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(def:defs)) # (f id) - Inj_ pds -> go pds - - -- this is more complicated + pcon' = \case + DSZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(def:defs)) # (f id) -- rewrite this with pconstrBuiltin? + DSS rest -> case rest of + DSZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(def:defs)) # (f id) + dss@(DSS _) -> pcon' dss + pmatch' :: forall {s :: S} {b :: PType} @@ -250,33 +218,21 @@ instance SListI (def:defs) => PlutusType (PDataSum (def:defs)) where plet (pasConstr #$ pforgetData $ pdata d) $ \d' -> plet (pfstBuiltin # d') $ \constr -> plet (psndBuiltin # d') $ \args -> - go constr args sList (f . MkPDataSum) + go constr args sList f where - -- Used to "fill in" the remaining elements of the "right hand side" of a sum once we've determined which element the sum ought to contain. - mkEmpty :: forall - {d :: [PLabeledType]} - {ds :: [[PLabeledType]]} - {s :: S} - . SListI (d:ds) - => SList (d:ds) - -> PDataSum' 'False (d:ds) s - mkEmpty SCons = case sList @ds of - SNil -> SumZ_ - rest@SCons -> Inj_ (mkEmpty rest) - go :: forall {d :: [PLabeledType]} {ds :: [[PLabeledType]]} . Term s PInteger -- the index of the constructor in the sum -> Term s (PBuiltinList PData) -- the inner representation of the record at the index of the first argument -> SList (d:ds) -- a GADT which represents the structure of the sum (can't construct it w/o this) - -> (PDataSum' 'True (d:ds) s -> Term s b) -- an accumulator function. represents an empty "left-hand side" of the sum + -> (PDataSum (d:ds) s -> Term s b) -- an accumulator function. represents an empty "left-hand side" of the sum -> Term s b go constr args SCons g = case sList @ds of - SNil -> g $ SumZ $ \k -> k $ punsafeCoerce args + SNil -> g $ DSZ $ \k -> k $ punsafeCoerce args rest@SCons -> pif (constr #== pconstant (adjustedLength $ Proxy @(d:ds))) -- if the index of the constructor matches the size of the sum - (g $ Inj (\k -> k $ punsafeCoerce args) $ mkEmpty sList) -- then cons an injection (which contains an element) onto an empty tail, and append the empty left hand side at the front - (go constr args rest (g . Inj_)) -- else recurse, "moving the accumulator forward by one" + (g $ DSZ (\k -> k $ punsafeCoerce args)) -- then cons an injection (which contains an element) onto an empty tail, and append the empty left hand side at the front + (go constr args rest (g . DSS)) -- else recurse, "moving the accumulator forward by one" instance PIsData (PDataSum defs) where pdata = punsafeCoerce From 17d5cb71538a4fa31cc52623643805c3cb780923 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Wed, 2 Mar 2022 23:37:06 +0100 Subject: [PATCH 140/584] wip #303: - applied requested fixes - written implementation for PDataSum which costed me quite some nerves to do right --- Plutarch/DataRepr/Internal.hs | 8 -- Plutarch/{Verify.hs => TryFrom.hs} | 88 +++++++++++++++---- .../verification_untrusted_data.bench.golden | 4 + ...rification_untrusted_data.uplc.eval.golden | 4 + .../verification_untrusted_data.uplc.golden | 4 + plutarch-test/plutarch-test.cabal | 2 +- .../{VerifySpec.hs => TryFromSpec.hs} | 75 +++++++++++----- plutarch.cabal | 2 +- 8 files changed, 136 insertions(+), 51 deletions(-) rename Plutarch/{Verify.hs => TryFrom.hs} (72%) rename plutarch-test/src/Plutarch/{VerifySpec.hs => TryFromSpec.hs} (87%) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 5f8a10340..a7c099f5b 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -175,16 +175,8 @@ type family PLabelIndex (name :: Symbol) (as :: [PLabeledType]) :: Nat where type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (name ':= a) = a -type PUnLabelAll :: [PLabeledType] -> [PType] -type family PUnLabelAll l where - PUnLabelAll '[] = '[] - PUnLabelAll (x ': xs) = PUnLabel x ': PUnLabelAll xs - instance {-# OVERLAPPABLE #-} - ( All PIsData bs - , bs ~ PUnLabelAll xs - ) => PIsData (PDataRecord xs) where pfromData x = punsafeBuiltin PLC.UnListData # pforgetData x diff --git a/Plutarch/Verify.hs b/Plutarch/TryFrom.hs similarity index 72% rename from Plutarch/Verify.hs rename to Plutarch/TryFrom.hs index ded08af07..8ce704b92 100644 --- a/Plutarch/Verify.hs +++ b/Plutarch/TryFrom.hs @@ -1,10 +1,10 @@ {-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-} {-# OPTIONS_GHC -Wredundant-constraints #-} -module Plutarch.Verify ( - PTryFrom (PExcess, ptryFrom), +module Plutarch.TryFrom ( + PTryFrom (PTryFromExcess, ptryFrom), pcheckType, pcheckByteStr, pcheckInt, @@ -12,6 +12,11 @@ module Plutarch.Verify ( pcheckMap, ) where +import GHC.TypeLits (Nat, KnownNat, natVal, type (+)) +import Data.Proxy (Proxy (Proxy)) + +--import Data.Kind (Constraint) + import Plutarch.Builtin ( PAsData, PBuiltinList, @@ -28,6 +33,7 @@ import Plutarch.Builtin ( pfstBuiltin, ppairDataBuiltin, psndBuiltin, + pasConstr, ) import Plutarch.ByteString (PByteString) @@ -43,12 +49,14 @@ import Plutarch.Internal.Other ( plam, plet, (#), + (#$), type (:-->), ) import Plutarch.Unit (PUnit (PUnit)) import Plutarch.DataRepr.Internal ( PDataRecord, + PDataSum, PLabeledType ((:=)), pdcons, pdnil, @@ -85,41 +93,41 @@ import Plutarch.TermCont (TermCont, tcont, unTermCont) -} class PTryFrom (a :: PType) (b :: PType) where -- "safest" type --^ ^-- target type - type PExcess a b :: PType - ptryFrom :: Term s a -> TermCont s (Term s b, Term s (PExcess a b)) + type PTryFromExcess a b :: PType + ptryFrom :: Term s a -> TermCont s (Term s b, Term s (PTryFromExcess a b)) ----------------------- PData instances ------------------------------------------------- instance PTryFrom PData (PAsData PInteger) where - type PExcess PData (PAsData PInteger) = PInteger + type PTryFromExcess PData (PAsData PInteger) = PInteger ptryFrom opq = do ver <- tcont $ plet (pasInt # opq) pure $ (punsafeCoerce opq, ver) instance PTryFrom PData (PAsData PByteString) where - type PExcess PData (PAsData PByteString) = PByteString + type PTryFromExcess PData (PAsData PByteString) = PByteString ptryFrom opq = do ver <- tcont $ plet (pasByteStr # opq) pure $ (punsafeCoerce opq, ver) instance PTryFrom PData PData where - type PExcess PData PData = PUnit + type PTryFromExcess PData PData = PUnit ptryFrom opq = pure $ (opq, pcon PUnit) instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) where - type PExcess PData (PAsData (PBuiltinList PData)) = PBuiltinList PData + type PTryFromExcess PData (PAsData (PBuiltinList PData)) = PBuiltinList PData ptryFrom opq = do ver <- tcont $ plet (pasList # opq) pure $ (punsafeCoerce opq, ver) instance - {-# OVERLAPS #-} + {-# OVERLAPPABLE #-} ( PTryFrom PData (PAsData a) , PTryFrom PData (PAsData b) ) => PTryFrom PData (PAsData (PBuiltinMap a b)) where - type PExcess PData (PAsData (PBuiltinMap a b)) = PBuiltinList (PBuiltinPair (PAsData a) (PAsData b)) + type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = PBuiltinList (PBuiltinPair (PAsData a) (PAsData b)) ptryFrom opq = do verMap <- tcont $ plet (pasMap # opq) -- I've not obtained a `PBuiltinList (PBuiltinPair a b)` @@ -132,7 +140,7 @@ instance pure (punsafeCoerce opq, ver) instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinMap POpaque POpaque)) where - type PExcess PData (PAsData (PBuiltinMap POpaque POpaque)) = PBuiltinList (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) + type PTryFromExcess PData (PAsData (PBuiltinMap POpaque POpaque)) = PBuiltinList (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) ptryFrom opq = do ver <- tcont $ plet (pasMap # opq) pure $ (punsafeCoerce opq, punsafeCoerce ver) -- PAsData POpaque ~ PData @@ -145,7 +153,7 @@ instance ) => PTryFrom PData (PAsData (PBuiltinList a)) where - type PExcess PData (PAsData (PBuiltinList a)) = PBuiltinList a + type PTryFromExcess PData (PAsData (PBuiltinList a)) = PBuiltinList a ptryFrom opq = let lst :: Term _ (PBuiltinList a) lst = punsafeBuiltin PLC.UnListData # opq @@ -169,7 +177,7 @@ instance ) => PTryFrom PData (PAsData (PBuiltinPair a b)) where - type PExcess PData (PAsData (PBuiltinPair a b)) = PBuiltinPair a b + type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = PBuiltinPair a b ptryFrom opq = do tup <- tcont $ plet (pfromData $ punsafeCoerce opq) let fst' :: Term _ a @@ -185,11 +193,11 @@ instance , PTryFrom PData (PAsData (PDataRecord xs)) , x ~ (s ':= b) , PIsData (PDataRecord xs) - , PExcess PData (PAsData (PDataRecord xs)) ~ PDataRecord xs + , PTryFromExcess PData (PAsData (PDataRecord xs)) ~ PDataRecord xs ) => PTryFrom PData (PAsData (PDataRecord (x ': xs))) where - type PExcess PData (PAsData (PDataRecord (x ': xs))) = PDataRecord (x ': xs) + type PTryFromExcess PData (PAsData (PDataRecord (x ': xs))) = PDataRecord (x ': xs) ptryFrom opq = do lst <- tcont $ plet (pfromData @(PBuiltinList _) $ punsafeCoerce opq) let lsthead :: Term _ PData @@ -216,7 +224,7 @@ instance ) => PTryFrom PData (PAsData (PDataRecord '[x])) where - type PExcess PData (PAsData (PDataRecord '[x])) = PDataRecord '[x] + type PTryFromExcess PData (PAsData (PDataRecord '[x])) = PDataRecord '[x] ptryFrom opq = do let lsthead :: Term _ PData lsthead = phead # (pfromData @(PBuiltinList _) $ punsafeCoerce opq) @@ -230,6 +238,50 @@ instance # pdnil pure $ (punsafeCoerce opq, ver) +class SumValidation (n::Nat) (sum :: [[PLabeledType]] ) where + validateSum :: Term s PData -> Term s (PBuiltinList PData) + +instance + {-# OVERLAPPABLE #-} + forall n x xs. + ( PTryFrom PData (PAsData (PDataRecord x)) + , SumValidation (n+1) xs + , KnownNat n + ) => + SumValidation n (x ': xs) where + validateSum s = unTermCont $ + do let n :: Integer + n = natVal (Proxy @n) + elem <- tcont $ plet $ pasConstr #$ s + let snd' :: Term _ (PBuiltinList PData) + snd' = pif (fromInteger n #== (pfstBuiltin # elem)) + (unTermCont $ do + let rec = pdata $ psndBuiltin # elem + y <- snd <$> (ptryFrom @PData @(PAsData (PDataRecord x)) $ pforgetData rec) + pure $ punsafeCoerce (y :: Term _ (PTryFromExcess PData (PAsData (PDataRecord x)))) + ) + (validateSum @(n+1) @xs $ punsafeCoerce s) + tcont $ plet snd' + + +instance + {-# OVERLAPPING #-} + SumValidation n '[] where + validateSum _ = perror + +instance + {-# OVERLAPPING #-} + forall ys. + ( SumValidation 0 ys + --, AllRecordsPTryFrom ys + )=> + PTryFrom PData (PAsData (PDataSum ys)) where + type PTryFromExcess PData (PAsData (PDataSum ys)) = PUnit + ptryFrom opq = do + _ <- tcont $ plet $ validateSum @0 @ys opq + pure (punsafeCoerce opq, pcon PUnit) + + ----------------------- POpaque Instances ----------------------------------------------- {- | @@ -245,7 +297,7 @@ instance ) => PTryFrom POpaque a where - type PExcess POpaque a = PAsData a + type PTryFromExcess POpaque a = PAsData a ptryFrom opq = do let prop :: Term _ a prop = punsafeCoerce opq diff --git a/plutarch-test/goldens/verification_untrusted_data.bench.golden b/plutarch-test/goldens/verification_untrusted_data.bench.golden index 17b2ac113..36934e45b 100644 --- a/plutarch-test/goldens/verification_untrusted_data.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.bench.golden @@ -2,12 +2,16 @@ erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudget erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":99} erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} +erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":98} +erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":171} working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} +working.PDataSum constr 0 {"exBudgetCPU":6024815,"exBudgetMemory":10910,"scriptSizeBytes":171} +working.PDataSum constr 1 {"exBudgetCPU":7028371,"exBudgetMemory":12876,"scriptSizeBytes":171} removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":96} removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":92} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":5889216,"exBudgetMemory":9972,"scriptSizeBytes":101} diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden index d6cef46a6..a399b62ae 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden @@ -2,12 +2,16 @@ erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) erroneous.[String] /= [Integer] (program 1.0.0 error) erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 error) erroneous.Map Int String /= Map Int Int (program 1.0.0 error) +erroneous.PDataSum constr 2 (program 1.0.0 error) +erroneous.PDataSum wrong record type (program 1.0.0 error) working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) +working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) +working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.uplc.golden index 9e85659ed..c23e90631 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.uplc.golden @@ -2,12 +2,16 @@ erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unIData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> i3 ((\i0 -> i5 i2) (unIData (i4 i1))) (i3 ((\i0 -> i5 (unListData (listData (i6 i2)))) (unBData (i4 (unListData (listData (i5 i1)))))) [ ])) (unListData (listData (force (force sndPair) i1))))) (delay error))) (unConstrData i4))) (force mkCons)) (force headList)) (force tailList)) #d87a9f0543666f6fff)) +erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unBData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87b9f0543666f6fff)) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unBData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d8799f0543666f6fff)) +working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87a9f0543666f6fff)) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (iData 42) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #62617a)))))) (force mkCons)) [ ])) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 661b19dcc..25df67578 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -136,9 +136,9 @@ executable plutarch-test Plutarch.Test.Golden Plutarch.Test.ListSyntax Plutarch.TraceSpec + Plutarch.TryFromSpec Plutarch.UnitSpec Plutarch.UPLCSpec - Plutarch.VerifySpec Spec if flag(development) diff --git a/plutarch-test/src/Plutarch/VerifySpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs similarity index 87% rename from plutarch-test/src/Plutarch/VerifySpec.hs rename to plutarch-test/src/Plutarch/TryFromSpec.hs index 1031bf11c..f225246e4 100644 --- a/plutarch-test/src/Plutarch/VerifySpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -1,7 +1,8 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE TemplateHaskell #-} -module Plutarch.VerifySpec (spec) where +module Plutarch.TryFromSpec (spec) where import Test.Syd @@ -13,6 +14,10 @@ import Plutus.V1.Ledger.Api ( TxInfo (txInfoData), ) +import PlutusTx ( + Data (Constr, I, B), + ) + import Plutarch.Unsafe ( punsafeCoerce, ) @@ -35,8 +40,8 @@ import Plutarch.Builtin ( ppairDataBuiltin, ) import Plutarch.Prelude -import Plutarch.Verify ( - PTryFrom (PExcess, ptryFrom), +import Plutarch.TryFrom ( + PTryFrom (PTryFromExcess, ptryFrom), ) import Plutarch.ApiSpec (info, purpose) @@ -66,6 +71,16 @@ spec = do @-> pfails "Map Int String /= Map Int Int" @| mapTestFails @-> pfails + "PDataSum constr 2" + @| checkDeep + @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ]]) + @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) + (punsafeCoerce $ pconstant $ Constr 1 [I 5, B "foo"]) @-> pfails + "PDataSum wrong record type" + @| checkDeep + @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PByteString, "b4" ':= PByteString ] ]) + @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) + (punsafeCoerce $ pconstant $ Constr 2 [I 5, B "foo"]) @-> pfails "working" @\ do "(String, String) == (String, String)" @| checkDeep @@ -99,6 +114,16 @@ spec = do @-> psucceeds "Map Int String == Map Int String" @| mapTestSucceeds @-> psucceeds + "PDataSum constr 0" + @| checkDeep + @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) + @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) + (punsafeCoerce $ pconstant $ Constr 0 [I 5, B "foo"]) @-> psucceeds + "PDataSum constr 1" + @| checkDeep + @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) + @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) + (punsafeCoerce $ pconstant $ Constr 1 [I 5, B "foo"]) @-> psucceeds "removing the data wrapper" @\ do "erroneous" @\ do "(String, Integer) /= (String, String)" @@ -155,23 +180,7 @@ spec = do "concatenate two lists, illegal (more than one output)" @| validator # pforgetData l1 # pforgetData l2 # invalidContext @-> pfails -mapTestSucceeds :: ClosedTerm (PAsData (PBuiltinMap PByteString PInteger)) -mapTestSucceeds = unTermCont $ do - (val, _) <- ptryFrom @PData $ pforgetData sampleMap - pure val - -mapTestFails :: ClosedTerm (PAsData (PBuiltinMap PInteger PInteger)) -mapTestFails = unTermCont $ do - (val, _) <- ptryFrom @PData $ pforgetData sampleMap - pure val - -sampleMap :: Term _ (PAsData (PBuiltinMap PByteString PInteger)) -sampleMap = - pdata $ - pcons - # (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant 42)) #$ pcons - # (ppairDataBuiltin # (pdata $ pconstant "bar") # (pdata $ pconstant 41)) - # pnil +------------------- Checking deeply, shallowly and unwrapping ---------------------- checkDeep :: forall (target :: PType) (actual :: PType). @@ -190,7 +199,7 @@ checkDeepUnwrap :: , PIsData target ) => ClosedTerm (PAsData actual) -> - ClosedTerm (PExcess PData (PAsData target)) + ClosedTerm (PTryFromExcess PData (PAsData target)) checkDeepUnwrap t = unTermCont $ snd <$> (ptryFrom @PData @(PAsData target) $ pforgetData t) sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) @@ -216,7 +225,7 @@ pmkNatural :: Term s (PInteger :--> PNatural) pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) instance PTryFrom PData (PAsData PNatural) where - type PExcess PData (PAsData PNatural) = PNatural + type PTryFromExcess PData (PAsData PNatural) = PNatural ptryFrom opq = do (wrapped, unwrapped) <- ptryFrom @PData @(PAsData PInteger) opq ver <- tcont $ plet $ pmkNatural # unwrapped @@ -309,7 +318,7 @@ pfind = phoistAcyclic $ (pcon PNothing) xs -------------------- Mocking a transaction ------------------------------------------ +------------------- Mocking a ScriptContext ---------------------------------------- ctx :: [(DatumHash, Datum)] -> Term s PScriptContext ctx l = pconstant (ScriptContext (info' l) purpose) @@ -336,3 +345,23 @@ toDatadList = pdata . (foldr go pnil) where go :: Integer -> Term _ (PBuiltinList (PAsData PInteger)) -> Term _ (PBuiltinList (PAsData PInteger)) go i acc = pcons # (pdata $ pconstant i) # acc + +------------------- Special cases for maps ----------------------------------------- + +mapTestSucceeds :: ClosedTerm (PAsData (PBuiltinMap PByteString PInteger)) +mapTestSucceeds = unTermCont $ do + (val, _) <- ptryFrom @PData $ pforgetData sampleMap + pure val + +mapTestFails :: ClosedTerm (PAsData (PBuiltinMap PInteger PInteger)) +mapTestFails = unTermCont $ do + (val, _) <- ptryFrom @PData $ pforgetData sampleMap + pure val + +sampleMap :: Term _ (PAsData (PBuiltinMap PByteString PInteger)) +sampleMap = + pdata $ + pcons + # (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant 42)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant "bar") # (pdata $ pconstant 41)) + # pnil diff --git a/plutarch.cabal b/plutarch.cabal index e4fd5917b..50c90cae3 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -123,9 +123,9 @@ library Plutarch.String Plutarch.TermCont Plutarch.Trace + Plutarch.TryFrom Plutarch.Unit Plutarch.Unsafe - Plutarch.Verify build-depends: , base From 87eb945bed65306845dc11dc07a4d9f1ad722f45 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Wed, 2 Mar 2022 23:47:57 +0100 Subject: [PATCH 141/584] fix: - formatting --- Plutarch/DataRepr/Internal.hs | 5 +- Plutarch/TryFrom.hs | 67 ++++++++++++----------- plutarch-test/src/Plutarch/TryFromSpec.hs | 46 +++++++++------- 3 files changed, 60 insertions(+), 58 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index a7c099f5b..9d9fb75d4 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -175,10 +175,7 @@ type family PLabelIndex (name :: Symbol) (as :: [PLabeledType]) :: Nat where type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (name ':= a) = a -instance - {-# OVERLAPPABLE #-} - PIsData (PDataRecord xs) - where +instance {-# OVERLAPPABLE #-} PIsData (PDataRecord xs) where pfromData x = punsafeBuiltin PLC.UnListData # pforgetData x pdata x = punsafeBuiltin PLC.ListData # x diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 8ce704b92..1683daeec 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -12,10 +12,10 @@ module Plutarch.TryFrom ( pcheckMap, ) where -import GHC.TypeLits (Nat, KnownNat, natVal, type (+)) import Data.Proxy (Proxy (Proxy)) +import GHC.TypeLits (KnownNat, Nat, natVal, type (+)) ---import Data.Kind (Constraint) +-- import Data.Kind (Constraint) import Plutarch.Builtin ( PAsData, @@ -25,6 +25,7 @@ import Plutarch.Builtin ( PData, PIsData (pfromData), pasByteStr, + pasConstr, pasInt, pasList, pasMap, @@ -33,7 +34,6 @@ import Plutarch.Builtin ( pfstBuiltin, ppairDataBuiltin, psndBuiltin, - pasConstr, ) import Plutarch.ByteString (PByteString) @@ -238,50 +238,51 @@ instance # pdnil pure $ (punsafeCoerce opq, ver) -class SumValidation (n::Nat) (sum :: [[PLabeledType]] ) where +class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where validateSum :: Term s PData -> Term s (PBuiltinList PData) -instance +instance {-# OVERLAPPABLE #-} - forall n x xs. + forall n x xs. ( PTryFrom PData (PAsData (PDataRecord x)) - , SumValidation (n+1) xs + , SumValidation (n + 1) xs , KnownNat n - ) => - SumValidation n (x ': xs) where - validateSum s = unTermCont $ - do let n :: Integer - n = natVal (Proxy @n) - elem <- tcont $ plet $ pasConstr #$ s - let snd' :: Term _ (PBuiltinList PData) - snd' = pif (fromInteger n #== (pfstBuiltin # elem)) - (unTermCont $ do - let rec = pdata $ psndBuiltin # elem - y <- snd <$> (ptryFrom @PData @(PAsData (PDataRecord x)) $ pforgetData rec) - pure $ punsafeCoerce (y :: Term _ (PTryFromExcess PData (PAsData (PDataRecord x)))) - ) - (validateSum @(n+1) @xs $ punsafeCoerce s) - tcont $ plet snd' - - -instance - {-# OVERLAPPING #-} - SumValidation n '[] where + ) => + SumValidation n (x ': xs) + where + validateSum s = unTermCont $ + do + let n :: Integer + n = natVal (Proxy @n) + elem <- tcont $ plet $ pasConstr #$ s + let snd' :: Term _ (PBuiltinList PData) + snd' = + pif + (fromInteger n #== (pfstBuiltin # elem)) + ( unTermCont $ do + let rec = pdata $ psndBuiltin # elem + y <- snd <$> (ptryFrom @PData @(PAsData (PDataRecord x)) $ pforgetData rec) + pure $ punsafeCoerce (y :: Term _ (PTryFromExcess PData (PAsData (PDataRecord x)))) + ) + (validateSum @(n + 1) @xs $ punsafeCoerce s) + tcont $ plet snd' + +instance {-# OVERLAPPING #-} SumValidation n '[] where validateSum _ = perror -instance +instance {-# OVERLAPPING #-} forall ys. ( SumValidation 0 ys - --, AllRecordsPTryFrom ys - )=> - PTryFrom PData (PAsData (PDataSum ys)) where + -- , AllRecordsPTryFrom ys + ) => + PTryFrom PData (PAsData (PDataSum ys)) + where type PTryFromExcess PData (PAsData (PDataSum ys)) = PUnit - ptryFrom opq = do + ptryFrom opq = do _ <- tcont $ plet $ validateSum @0 @ys opq pure (punsafeCoerce opq, pcon PUnit) - ----------------------- POpaque Instances ----------------------------------------------- {- | diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index f225246e4..66b633d1c 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -1,6 +1,6 @@ {-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE UndecidableInstances #-} module Plutarch.TryFromSpec (spec) where @@ -15,7 +15,7 @@ import Plutus.V1.Ledger.Api ( ) import PlutusTx ( - Data (Constr, I, B), + Data (B, Constr, I), ) import Plutarch.Unsafe ( @@ -71,16 +71,18 @@ spec = do @-> pfails "Map Int String /= Map Int Int" @| mapTestFails @-> pfails - "PDataSum constr 2" + "PDataSum constr 2" @| checkDeep - @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ]]) - @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) - (punsafeCoerce $ pconstant $ Constr 1 [I 5, B "foo"]) @-> pfails - "PDataSum wrong record type" - @| checkDeep - @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PByteString, "b4" ':= PByteString ] ]) - @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) - (punsafeCoerce $ pconstant $ Constr 2 [I 5, B "foo"]) @-> pfails + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString]]) + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + (punsafeCoerce $ pconstant $ Constr 1 [I 5, B "foo"]) + @-> pfails + "PDataSum wrong record type" + @| checkDeep + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PByteString, "b4" ':= PByteString]]) + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + (punsafeCoerce $ pconstant $ Constr 2 [I 5, B "foo"]) + @-> pfails "working" @\ do "(String, String) == (String, String)" @| checkDeep @@ -114,16 +116,18 @@ spec = do @-> psucceeds "Map Int String == Map Int String" @| mapTestSucceeds @-> psucceeds - "PDataSum constr 0" - @| checkDeep - @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) - @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) - (punsafeCoerce $ pconstant $ Constr 0 [I 5, B "foo"]) @-> psucceeds - "PDataSum constr 1" - @| checkDeep - @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) - @(PDataSum '[ '[ "i1" ':= PInteger, "b2" ':= PByteString ], '[ "i3" ':= PInteger, "b4" ':= PByteString ] ]) - (punsafeCoerce $ pconstant $ Constr 1 [I 5, B "foo"]) @-> psucceeds + "PDataSum constr 0" + @| checkDeep + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + (punsafeCoerce $ pconstant $ Constr 0 [I 5, B "foo"]) + @-> psucceeds + "PDataSum constr 1" + @| checkDeep + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + (punsafeCoerce $ pconstant $ Constr 1 [I 5, B "foo"]) + @-> psucceeds "removing the data wrapper" @\ do "erroneous" @\ do "(String, Integer) /= (String, String)" From 945b57d9a43a228d254de0474da47d18d20e4e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 3 Mar 2022 08:30:59 -0500 Subject: [PATCH 142/584] Replaced GHC.Exts.Any with Data.Void.Void --- Plutarch/FFI.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index d9c3dae38..5fde43fca 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -16,7 +16,7 @@ module Plutarch.FFI ( import Data.ByteString (ByteString) import Data.Kind (Constraint, Type) import Data.Text (Text) -import GHC.Exts (Any) +import Data.Void (Void) import GHC.Generics (Generic) import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits @@ -91,8 +91,8 @@ foreignExport = unsafeForeignExport foreignImport :: p >~< t => CompiledCode t -> ClosedTerm p foreignImport = unsafeForeignImport --- | Export Plutarch term of any type as @CompiledCode Any@. -opaqueExport :: ClosedTerm p -> CompiledCode Any +-- | Export Plutarch term of any type as @CompiledCode Void@. +opaqueExport :: ClosedTerm p -> CompiledCode Void opaqueExport = unsafeForeignExport -- | Import compiled UPLC code of any type as a Plutarch opaque term. From ccea0088ca72796c4004f2d8dfb4ad45324a9171 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 2 Mar 2022 16:30:47 -0500 Subject: [PATCH 143/584] Add `psatisfyMaxBudget` for testing evaluation budget --- plutarch-test/src/Plutarch/IntegerSpec.hs | 4 ++- plutarch-test/src/Plutarch/Test.hs | 37 ++++++++++++++++---- plutarch-test/src/Plutarch/Test/Benchmark.hs | 5 ++- plutarch-test/src/Plutarch/Test/Golden.hs | 37 +++++++++++++++----- 4 files changed, 66 insertions(+), 17 deletions(-) diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/src/Plutarch/IntegerSpec.hs index 875dff874..f258cab6c 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/src/Plutarch/IntegerSpec.hs @@ -18,7 +18,9 @@ spec = do "fib" @\ do "lam" @| fib "app" @\ do - "9" @| fib # 9 + "9" @| fib # 9 @:-> \(p, bench) -> do + p `pshouldBe` (34 :: Term _ PInteger) + bench `psatisfyMaxBudget` Benchmark 1_000_000_000 1_000_000 100 "error" @| fib # perror @-> pfails "uglyDouble" @| uglyDouble diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index c07d3477b..b8af2f33d 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -11,6 +11,8 @@ module Plutarch.Test ( ptraces, pshouldBe, (#@?=), + -- | Budget expectation + psatisfyMaxBudget, -- * For Development flag tests plutarchDevFlagDescribe, @@ -19,10 +21,15 @@ module Plutarch.Test ( (@|), (@\), (@->), + (@:->), (@==), pgoldenSpec, PlutarchGoldens, + -- * Benchmark type for use in `(@:->)` + Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), + ScriptSizeBytes, + -- * Deprecated exports golden, goldens, @@ -48,11 +55,16 @@ import Test.Syd ( it, pureGoldenTextFile, shouldBe, + shouldSatisfyNamed, ) import Plutarch import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evalScript) +import Plutarch.Test.Benchmark ( + Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), + ScriptSizeBytes, + ) import Plutarch.Test.Golden ( PlutarchGoldens, TermExpectation, @@ -60,6 +72,7 @@ import Plutarch.Test.Golden ( evalScriptAlwaysWithBenchmark, pgoldenSpec, (@->), + (@:->), (@\), (@|), ) @@ -98,6 +111,23 @@ psucceeds p = (Left _, _, _) -> expectationFailure $ "Term failed to evaluate" (Right _, _, _) -> pure () +-- | Asserts the term evaluates without success +pfails :: ClosedTerm a -> Expectation +pfails p = do + case evalScript (compile p) of + (Left _, _, _) -> pure () + (Right _, _, _) -> expectationFailure $ "Term succeeded" + +-- | Expects the benchmark to be within the given max budget +psatisfyMaxBudget :: Benchmark -> Benchmark -> Expectation +psatisfyMaxBudget bench maxBudget = do + shouldSatisfyNamed bench ("cpu<=" <> show (exBudgetCPU maxBudget)) $ \_ -> + exBudgetCPU bench <= exBudgetCPU maxBudget + shouldSatisfyNamed bench ("mem<=" <> show (exBudgetMemory maxBudget)) $ \_ -> + exBudgetMemory bench <= exBudgetMemory maxBudget + shouldSatisfyNamed bench ("size<=" <> show (scriptSizeBytes maxBudget)) $ \_ -> + scriptSizeBytes bench <= scriptSizeBytes maxBudget + {- | Asserts that the term evaluates successfully with the given trace sequence See also: `plutarchDevFlagDescribe` @@ -136,13 +166,6 @@ plutarchDevFlagDescribe m = #endif {- ORMOLU_ENABLE -} --- | Asserts the term evaluates without success -pfails :: ClosedTerm a -> Expectation -pfails p = do - case evalScript (compile p) of - (Left _, _, _) -> pure () - (Right _, _, _) -> expectationFailure $ "Term succeeded" - -- | Convenient alias for `@-> pshouldBe x` (@==) :: ClosedTerm a -> ClosedTerm b -> TermExpectation a (@==) p x = p @-> pshouldBe x diff --git a/plutarch-test/src/Plutarch/Test/Benchmark.hs b/plutarch-test/src/Plutarch/Test/Benchmark.hs index 617d9b61b..544a706b0 100644 --- a/plutarch-test/src/Plutarch/Test/Benchmark.hs +++ b/plutarch-test/src/Plutarch/Test/Benchmark.hs @@ -1,6 +1,9 @@ module Plutarch.Test.Benchmark ( - Benchmark, + -- * Working with `Benchmark` type + Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), ScriptSizeBytes, + + -- * Producing benchmark values mkBenchmark, scriptSize, ) where diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index b8e6c16c7..bd42a2d55 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -1,8 +1,11 @@ +{-# LANGUAGE ImpredicativeTypes #-} + module Plutarch.Test.Golden ( pgoldenSpec, (@|), (@\), (@->), + (@:->), TermExpectation, PlutarchGoldens, goldenKeyString, @@ -42,9 +45,15 @@ import qualified Plutus.V1.Ledger.Scripts as Scripts data GoldenValue = GoldenValue { goldenValueUplcPreEval :: Text + -- ^ Golden string for UPLC , goldenValueUplcPostEval :: Text + -- ^ Golden string for evaluated UPLC , goldenValueBench :: Text - , goldenValueExpectation :: Maybe Expectation + -- ^ Golden string for benchmark JSON + , goldenValueBenchVal :: Benchmark + -- ^ `Benchmark` for evaluated UPLC + , goldenValueExpectation :: Maybe (Benchmark -> Expectation) + -- ^ User test's expectation function } {- | Class of types that represent `GoldenValue` @@ -54,7 +63,7 @@ data GoldenValue = GoldenValue class HasGoldenValue (t :: S -> PType -> Type) where mkGoldenValue :: forall a. (forall s. t s a) -> GoldenValue -mkGoldenValue' :: ClosedTerm a -> Maybe Expectation -> GoldenValue +mkGoldenValue' :: ClosedTerm a -> Maybe (Benchmark -> Expectation) -> GoldenValue mkGoldenValue' p mexp = let compiledScript = compileD p (evaluatedScript, bench) = evalScriptAlwaysWithBenchmark compiledScript @@ -62,6 +71,7 @@ mkGoldenValue' p mexp = (T.pack $ printScript compiledScript) (T.pack $ printScript evaluatedScript) (TL.toStrict $ Aeson.encodeToLazyText bench) + bench mexp -- We derive for `Term s a` only because GHC prevents us from deriving for @@ -70,23 +80,34 @@ mkGoldenValue' p mexp = instance HasGoldenValue Term where mkGoldenValue p = mkGoldenValue' (punsafeAsClosedTerm p) Nothing -{- | A `Term` paired with its evaluation expectation +{- | A `Term` paired with its evaluation/benchmark expectation Example: - >>> TermExpectation (pcon PTrue) $ \p -> pshouldBe (pcon PTrue) + >>> TermExpectation (pcon PTrue) $ \(p, _benchmark) -> pshouldBe (pcon PTrue) -} -data TermExpectation' s a = TermExpectation (Term s a) (Term s a -> Expectation) +data TermExpectation' s a = TermExpectation (Term s a) ((Term s a, Benchmark) -> Expectation) type TermExpectation a = forall s. TermExpectation' s a -- | Test an expectation on a golden Plutarch program (@->) :: ClosedTerm a -> (ClosedTerm a -> Expectation) -> TermExpectation a -(@->) p f = TermExpectation p (\p' -> f $ punsafeAsClosedTerm p') +(@->) p f = p @:-> \(p', _) -> f $ punsafeAsClosedTerm p' infixr 1 @-> +{- | Like `@->` but also takes the benchmark as an argument + + Useful to do assertion checks on post-evaluation benchmark (eg: to check if + script size is below certain threshold). Use in conjunction with + `psatisfyMaxBudget`. +-} +(@:->) :: ClosedTerm a -> ((ClosedTerm a, Benchmark) -> Expectation) -> TermExpectation a +(@:->) p f = TermExpectation p (\(p', b) -> f (punsafeAsClosedTerm p', b)) + +infixr 1 @:-> + instance HasGoldenValue TermExpectation' where - mkGoldenValue (TermExpectation p f) = mkGoldenValue' (punsafeAsClosedTerm p) (Just $ f p) + mkGoldenValue (TermExpectation p f) = mkGoldenValue' (punsafeAsClosedTerm p) (Just $ (\b -> f (p, b))) -- | The key used in the .golden files containing multiple golden values newtype GoldenKey = GoldenKey Text @@ -154,7 +175,7 @@ pgoldenSpec map = do pureGoldenTextFile (goldenPathWith "bench") $ combineGoldens $ fmap goldenValueBench <$> bs let asserts = flip mapMaybe bs $ \(k, b) -> do - (k,) <$> goldenValueExpectation b + (k,) . ($ goldenValueBenchVal b) <$> goldenValueExpectation b unless (null asserts) $ do forM_ asserts $ \(k, v) -> it (goldenKeyString $ "" <> k <> "assert") v From 4e4b1ebc7b8e68129e1b07934f8b8d5c7beccca9 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 3 Mar 2022 09:59:29 -0500 Subject: [PATCH 144/584] Rename to `psatisfyWithinBenchmark` for clarity; document more. --- plutarch-test/src/Plutarch/IntegerSpec.hs | 2 +- plutarch-test/src/Plutarch/Test.hs | 16 ++++++++++++---- plutarch-test/src/Plutarch/Test/Golden.hs | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/src/Plutarch/IntegerSpec.hs index f258cab6c..827a71096 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/src/Plutarch/IntegerSpec.hs @@ -20,7 +20,7 @@ spec = do "app" @\ do "9" @| fib # 9 @:-> \(p, bench) -> do p `pshouldBe` (34 :: Term _ PInteger) - bench `psatisfyMaxBudget` Benchmark 1_000_000_000 1_000_000 100 + bench `psatisfyWithinBenchmark` Benchmark 1_000_000_000 1_000_000 100 "error" @| fib # perror @-> pfails "uglyDouble" @| uglyDouble diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index b8af2f33d..fd550c20b 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -12,7 +12,7 @@ module Plutarch.Test ( pshouldBe, (#@?=), -- | Budget expectation - psatisfyMaxBudget, + psatisfyWithinBenchmark, -- * For Development flag tests plutarchDevFlagDescribe, @@ -118,9 +118,17 @@ pfails p = do (Left _, _, _) -> pure () (Right _, _, _) -> expectationFailure $ "Term succeeded" --- | Expects the benchmark to be within the given max budget -psatisfyMaxBudget :: Benchmark -> Benchmark -> Expectation -psatisfyMaxBudget bench maxBudget = do +{- | Check that the given benchmark is within certain maximum values. + + Use this to ensure that a program's benchmark doesn't exceed expected values + (such as script size or memory budget). You will need this because, + + - `Plutarch.Test`'s golden testing uses maximum possible ExBudget for evaluating + programs + - You may want to check that the script size is within a certain value +-} +psatisfyWithinBenchmark :: Benchmark -> Benchmark -> Expectation +psatisfyWithinBenchmark bench maxBudget = do shouldSatisfyNamed bench ("cpu<=" <> show (exBudgetCPU maxBudget)) $ \_ -> exBudgetCPU bench <= exBudgetCPU maxBudget shouldSatisfyNamed bench ("mem<=" <> show (exBudgetMemory maxBudget)) $ \_ -> diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index bd42a2d55..f9b96eeb4 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -99,7 +99,7 @@ infixr 1 @-> Useful to do assertion checks on post-evaluation benchmark (eg: to check if script size is below certain threshold). Use in conjunction with - `psatisfyMaxBudget`. + `psatisfyWithinBenchmark`. -} (@:->) :: ClosedTerm a -> ((ClosedTerm a, Benchmark) -> Expectation) -> TermExpectation a (@:->) p f = TermExpectation p (\(p', b) -> f (punsafeAsClosedTerm p', b)) From bc41076fd1afd9d52d00416e357117341ace7bc1 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Thu, 3 Mar 2022 18:38:23 +0100 Subject: [PATCH 145/584] feat: - set up plutarch-extra - add a new folder for testing plutarch-extra specific stuff --- flake.nix | 9 +- plutarch-extra/Plutarch/Extra.hs | 1 + plutarch-extra/plutarch-extra.cabal | 88 +++++++++++++++++++ plutarch-test/{src => plutarch-base}/Main.hs | 0 .../Plutarch/ApiSpec.hs | 0 .../Plutarch/BoolSpec.hs | 0 .../Plutarch/ByteStringSpec.hs | 0 .../Plutarch/EitherSpec.hs | 0 .../Plutarch/FieldSpec.hs | 0 .../Plutarch/IntegerSpec.hs | 0 .../Plutarch/LiftSpec.hs | 0 .../Plutarch/ListSpec.hs | 0 .../Plutarch/MaybeSpec.hs | 0 .../Plutarch/MonadicSpec.hs | 0 .../Plutarch/PIsDataSpec.hs | 0 .../Plutarch/PLamSpec.hs | 0 .../Plutarch/PairSpec.hs | 0 .../Plutarch/PlutusTypeSpec.hs | 0 .../Plutarch/RationalSpec.hs | 0 .../Plutarch/RecSpec.hs | 0 .../Plutarch/RecursionSpec.hs | 0 .../Plutarch/ScriptsSpec.hs | 0 .../Plutarch/StringSpec.hs | 0 .../{src => plutarch-base}/Plutarch/Test.hs | 0 .../Plutarch/Test/Benchmark.hs | 0 .../Plutarch/Test/Golden.hs | 0 .../Plutarch/Test/ListSyntax.hs | 0 .../Plutarch/TraceSpec.hs | 0 .../Plutarch/UPLCSpec.hs | 0 .../Plutarch/UnitSpec.hs | 0 plutarch-test/{src => plutarch-base}/Spec.hs | 0 plutarch-test/plutarch-extra/Main.hs | 10 +++ .../plutarch-extra/Plutarch/ExtraSpec.hs | 8 ++ plutarch-test/plutarch-extra/Spec.hs | 1 + plutarch-test/plutarch-test.cabal | 17 +++- 35 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 plutarch-extra/Plutarch/Extra.hs create mode 100644 plutarch-extra/plutarch-extra.cabal rename plutarch-test/{src => plutarch-base}/Main.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/ApiSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/BoolSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/ByteStringSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/EitherSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/FieldSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/IntegerSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/LiftSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/ListSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/MaybeSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/MonadicSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/PIsDataSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/PLamSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/PairSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/PlutusTypeSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/RationalSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/RecSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/RecursionSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/ScriptsSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/StringSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/Test.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/Test/Benchmark.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/Test/Golden.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/Test/ListSyntax.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/TraceSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/UPLCSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Plutarch/UnitSpec.hs (100%) rename plutarch-test/{src => plutarch-base}/Spec.hs (100%) create mode 100644 plutarch-test/plutarch-extra/Main.hs create mode 100644 plutarch-test/plutarch-extra/Plutarch/ExtraSpec.hs create mode 100644 plutarch-test/plutarch-extra/Spec.hs diff --git a/flake.nix b/flake.nix index fc5099c63..82355d8d4 100644 --- a/flake.nix +++ b/flake.nix @@ -469,9 +469,9 @@ # https://github.com/NorfairKing/sydtest/blob/master/sydtest-discover/src/Test/Syd/Discover.hs cp -rT ${./.} $out chmod -R u+w $out/plutarch-test - rm -f $out/plutarch-test/src/Plutarch/MonadicSpec.hs - rm -f $out/plutarch-test/src/Plutarch/FieldSpec.hs - rm -f $out/plutarch-test/src/Plutarch/RecSpec.hs + rm -f $out/plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs + rm -f $out/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs + rm -f $out/plutarch-test/plutarch-base/Plutarch/RecSpec.hs ''; compiler-nix-name = ghcName; inherit extraSources; @@ -600,7 +600,8 @@ program = checkedShellScript system "plutatch-test-${name}" '' cd ${self}/plutarch-test - ${flake.packages."plutarch-test:exe:plutarch-test"}/bin/plutarch-test; + ${flake.packages."plutarch-test:exe:plutarch-base"}/bin/plutarch-base; + ${flake.packages."plutarch-test:exe:plutarch-extra"}/bin/plutarch-extra; ''; }; diff --git a/plutarch-extra/Plutarch/Extra.hs b/plutarch-extra/Plutarch/Extra.hs new file mode 100644 index 000000000..b390b7b96 --- /dev/null +++ b/plutarch-extra/Plutarch/Extra.hs @@ -0,0 +1 @@ +module Plutarch.Extra () where diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal new file mode 100644 index 000000000..1996db33b --- /dev/null +++ b/plutarch-extra/plutarch-extra.cabal @@ -0,0 +1,88 @@ +cabal-version: 2.4 +name: plutarch-extra +version: 1.1.0 + +flag development + description: Enable tracing functions within plutarch. + manual: True + default: False + +common c + default-language: Haskell2010 + default-extensions: + NoStarIsType + BangPatterns + BinaryLiterals + ConstrainedClassMethods + ConstraintKinds + DataKinds + DeriveAnyClass + DeriveDataTypeable + DeriveFoldable + DeriveFunctor + DeriveGeneric + DeriveLift + DeriveTraversable + DerivingStrategies + DerivingVia + DoAndIfThenElse + EmptyCase + EmptyDataDecls + EmptyDataDeriving + ExistentialQuantification + ExplicitForAll + FlexibleContexts + FlexibleInstances + ForeignFunctionInterface + GADTSyntax + GeneralisedNewtypeDeriving + HexFloatLiterals + ImplicitPrelude + InstanceSigs + KindSignatures + LambdaCase + MonomorphismRestriction + MultiParamTypeClasses + NamedFieldPuns + NamedWildCards + NumericUnderscores + OverloadedStrings + PartialTypeSignatures + PatternGuards + PolyKinds + PostfixOperators + RankNTypes + RelaxedPolyRec + ScopedTypeVariables + StandaloneDeriving + StandaloneKindSignatures + TraditionalRecordSyntax + TupleSections + TypeApplications + TypeFamilies + TypeOperators + TypeSynonymInstances + ViewPatterns + + ghc-options: + -Wall -Wcompat -Wincomplete-uni-patterns -Wno-unused-do-bind + -Wno-partial-type-signatures -Wmissing-export-lists -Werror + -Wincomplete-record-updates -Wmissing-deriving-strategies + -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls + -fprint-explicit-kinds + +common deps + build-depends: + , base + , plutarch + +library + import: c, deps + exposed-modules: Plutarch.Extra + + -- other-modules: + + if flag(development) + cpp-options: -DDevelopment + + ghc-options: -threaded -rtsopts -with-rtsopts=-N diff --git a/plutarch-test/src/Main.hs b/plutarch-test/plutarch-base/Main.hs similarity index 100% rename from plutarch-test/src/Main.hs rename to plutarch-test/plutarch-base/Main.hs diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/ApiSpec.hs rename to plutarch-test/plutarch-base/Plutarch/ApiSpec.hs diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/BoolSpec.hs rename to plutarch-test/plutarch-base/Plutarch/BoolSpec.hs diff --git a/plutarch-test/src/Plutarch/ByteStringSpec.hs b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/ByteStringSpec.hs rename to plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs diff --git a/plutarch-test/src/Plutarch/EitherSpec.hs b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/EitherSpec.hs rename to plutarch-test/plutarch-base/Plutarch/EitherSpec.hs diff --git a/plutarch-test/src/Plutarch/FieldSpec.hs b/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/FieldSpec.hs rename to plutarch-test/plutarch-base/Plutarch/FieldSpec.hs diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/IntegerSpec.hs rename to plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs diff --git a/plutarch-test/src/Plutarch/LiftSpec.hs b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/LiftSpec.hs rename to plutarch-test/plutarch-base/Plutarch/LiftSpec.hs diff --git a/plutarch-test/src/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/ListSpec.hs rename to plutarch-test/plutarch-base/Plutarch/ListSpec.hs diff --git a/plutarch-test/src/Plutarch/MaybeSpec.hs b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/MaybeSpec.hs rename to plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs diff --git a/plutarch-test/src/Plutarch/MonadicSpec.hs b/plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/MonadicSpec.hs rename to plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs diff --git a/plutarch-test/src/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/PIsDataSpec.hs rename to plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs diff --git a/plutarch-test/src/Plutarch/PLamSpec.hs b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/PLamSpec.hs rename to plutarch-test/plutarch-base/Plutarch/PLamSpec.hs diff --git a/plutarch-test/src/Plutarch/PairSpec.hs b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/PairSpec.hs rename to plutarch-test/plutarch-base/Plutarch/PairSpec.hs diff --git a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/PlutusTypeSpec.hs rename to plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs diff --git a/plutarch-test/src/Plutarch/RationalSpec.hs b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/RationalSpec.hs rename to plutarch-test/plutarch-base/Plutarch/RationalSpec.hs diff --git a/plutarch-test/src/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/RecSpec.hs rename to plutarch-test/plutarch-base/Plutarch/RecSpec.hs diff --git a/plutarch-test/src/Plutarch/RecursionSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/RecursionSpec.hs rename to plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs diff --git a/plutarch-test/src/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/ScriptsSpec.hs rename to plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs diff --git a/plutarch-test/src/Plutarch/StringSpec.hs b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/StringSpec.hs rename to plutarch-test/plutarch-base/Plutarch/StringSpec.hs diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/plutarch-base/Plutarch/Test.hs similarity index 100% rename from plutarch-test/src/Plutarch/Test.hs rename to plutarch-test/plutarch-base/Plutarch/Test.hs diff --git a/plutarch-test/src/Plutarch/Test/Benchmark.hs b/plutarch-test/plutarch-base/Plutarch/Test/Benchmark.hs similarity index 100% rename from plutarch-test/src/Plutarch/Test/Benchmark.hs rename to plutarch-test/plutarch-base/Plutarch/Test/Benchmark.hs diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/plutarch-base/Plutarch/Test/Golden.hs similarity index 100% rename from plutarch-test/src/Plutarch/Test/Golden.hs rename to plutarch-test/plutarch-base/Plutarch/Test/Golden.hs diff --git a/plutarch-test/src/Plutarch/Test/ListSyntax.hs b/plutarch-test/plutarch-base/Plutarch/Test/ListSyntax.hs similarity index 100% rename from plutarch-test/src/Plutarch/Test/ListSyntax.hs rename to plutarch-test/plutarch-base/Plutarch/Test/ListSyntax.hs diff --git a/plutarch-test/src/Plutarch/TraceSpec.hs b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/TraceSpec.hs rename to plutarch-test/plutarch-base/Plutarch/TraceSpec.hs diff --git a/plutarch-test/src/Plutarch/UPLCSpec.hs b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/UPLCSpec.hs rename to plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs diff --git a/plutarch-test/src/Plutarch/UnitSpec.hs b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs similarity index 100% rename from plutarch-test/src/Plutarch/UnitSpec.hs rename to plutarch-test/plutarch-base/Plutarch/UnitSpec.hs diff --git a/plutarch-test/src/Spec.hs b/plutarch-test/plutarch-base/Spec.hs similarity index 100% rename from plutarch-test/src/Spec.hs rename to plutarch-test/plutarch-base/Spec.hs diff --git a/plutarch-test/plutarch-extra/Main.hs b/plutarch-test/plutarch-extra/Main.hs new file mode 100644 index 000000000..7350e094d --- /dev/null +++ b/plutarch-test/plutarch-extra/Main.hs @@ -0,0 +1,10 @@ +module Main (main) where + +import GHC.IO.Encoding (setLocaleEncoding, utf8) +import Spec (spec) +import Test.Syd (sydTest) + +main :: IO () +main = do + setLocaleEncoding utf8 + sydTest spec diff --git a/plutarch-test/plutarch-extra/Plutarch/ExtraSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ExtraSpec.hs new file mode 100644 index 000000000..03116ca12 --- /dev/null +++ b/plutarch-test/plutarch-extra/Plutarch/ExtraSpec.hs @@ -0,0 +1,8 @@ +module Plutarch.ExtraSpec (spec) where + +import Test.Syd (Spec, describe, it) + +spec :: Spec +spec = + describe "Hello Plutarch Extra" $ + it "says Hello Plutarch Extra" $ putStrLn "Hello Plutarch Extra" diff --git a/plutarch-test/plutarch-extra/Spec.hs b/plutarch-test/plutarch-extra/Spec.hs new file mode 100644 index 000000000..4c69623b5 --- /dev/null +++ b/plutarch-test/plutarch-extra/Spec.hs @@ -0,0 +1 @@ +{-# OPTIONS_GHC -F -pgmF sydtest-discover -optF --no-main #-} diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 3a57c37ea..15bfbc89c 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -80,6 +80,7 @@ common deps , generics-sop , mtl , plutarch + , plutarch-extra , plutus-core , plutus-ledger-api , plutus-tx @@ -94,17 +95,27 @@ common deps library import: c, deps - hs-source-dirs: src + hs-source-dirs: plutarch-base exposed-modules: Plutarch.Test other-modules: Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax -executable plutarch-test +executable plutarch-extra + import: c, deps + main-is: Main.hs + hs-source-dirs: plutarch-extra + other-modules: + Plutarch.ExtraSpec + Spec + + ghc-options: -threaded -rtsopts -with-rtsopts=-N + +executable plutarch-base import: c, deps main-is: Main.hs - hs-source-dirs: src + hs-source-dirs: plutarch-base build-depends: , base16-bytestring , cborg From 8172a1c7785d9fc9e1f11b80236824fd75f7914a Mon Sep 17 00:00:00 2001 From: Renegatto <46404781+Renegatto@users.noreply.github.com> Date: Thu, 3 Mar 2022 22:30:45 +0300 Subject: [PATCH 146/584] Add "Started by" --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41316f6bd..763c8c8c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ # Unreleased - Add `puncons` and `ptryUncons` functions for deconstructing list. + Started by: [#333](https://github.com/Plutonomicon/plutarch/pull/333) + - `TermCont`: Parametrize by result type; add `MonadFail` instance; etc. Also, export from `Plutarch.TermCont`, and then from `Plutarch.Prelude` (TermCont is no longer exported by `Plutarch.Internal`). From 90dda777fdde86f18d25f46cc3250a975877c588 Mon Sep 17 00:00:00 2001 From: Peter Dragos Date: Thu, 3 Mar 2022 17:13:32 -0500 Subject: [PATCH 147/584] allow polymorphic deriving of PConstant via newtype --- Plutarch/Lift.hs | 58 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 7dcec1f48..77158c350 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -3,6 +3,14 @@ {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableSuperClasses #-} +{- | +Module: Plutarch.Lift +Description: Conversion to and from Plutarch terms and Haskell types + +This module defines functions, associated type families, and newtypes for use with +[@DerivingVia@](https://ryanglscott.github.io/papers/deriving-via.pdf) to allow +Plutarch to convert to and from PTypes and Haskell types. +-} module Plutarch.Lift ( -- * Converstion between Plutarch terms and Haskell types pconstant, @@ -16,6 +24,7 @@ module Plutarch.Lift ( DerivePConstantDirect (..), DerivePConstantViaNewtype (..), DerivePConstantViaBuiltin (..), + PConstantable, -- * Internal use PUnsafeLiftDecl (..), @@ -23,7 +32,7 @@ module Plutarch.Lift ( import Control.Lens ((^?)) import Data.Coerce -import Data.Kind (Type) +import Data.Kind (Type, Constraint) import GHC.Stack (HasCallStack) import Plutarch.Evaluate (EvalError, evalScript) import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInternal) @@ -100,7 +109,11 @@ plift prog = case plift' prog of <> maybe "" (\x -> "cause: " <> show x) causeMaybe Left (LiftError_EvalError e) -> error $ "plift failed: erring term: " <> show e --- TODO: Add haddock +{- | Newtype wrapper for deriving @PConstant@ when the wrapped type is directly +represented by a builtin UPLC type that is /not/ @Data@. + + Ex: @PInteger@ is directly represented as a builtin integer. +-} newtype DerivePConstantDirect (h :: Type) (p :: PType) = DerivePConstantDirect h instance @@ -112,8 +125,45 @@ instance pconstantToRepr = coerce pconstantFromRepr = Just . coerce --- TODO: Add haddock -newtype DerivePConstantViaNewtype (h :: Type) (p :: PType) (p' :: PType) = DerivePConstantViaNewtype h +{-| Newtype wrapper for deriving @PConstant@ when the wrapped type is represented +indirectly by a builtin UPLC type that is /not/ @Data@. + + Ex: @PPubKeyHash@ is a newtype to a @PByteString@ and @PByteString@ is directly + represented as a builtin bytestring. + +Polymorphic types can be derived as follows: + +Usage: + + +> +> deriving via +> (DerivePConstantViaNewType +> (Foo a) +> (PFoo (PConstanted a)) +> (PConstanted a)) +> instance +> PConstantable a => +> PConstant (Foo a) +-} +newtype DerivePConstantViaNewtype + (h :: Type) -- | The Haskell newtype we are deriving a @PConstant@ instance for + (p :: PType) -- | PType to associate with the newtype + (p' :: PType) -- | Underlying UPLC representation type + = DerivePConstantViaNewtype h + +{-| Type synonym to simplify deriving of @PConstant@ via @DerivePConstantViaNewtype@. + +A newtype @Foo a@ is considered "Constantable" if: + +- The wrapped type @a@ has a @PConstant@ instance. +- The lifted type of @a@ has a @PUnsafeLiftDecl@ instance. +- There is type equality between @a@ and @PLifted (PConstanted a)@. + +These constraints are sufficient to derive a @PConstant@ instance for the newtype. +-} +type PConstantable :: Type -> Constraint +type PConstantable a = (a ~ (PLifted (PConstanted a)), PUnsafeLiftDecl (PConstanted a), PConstant a) instance (PLift p, PLift p', Coercible h (PLifted p')) => PConstant (DerivePConstantViaNewtype h p p') where type PConstantRepr (DerivePConstantViaNewtype h p p') = PConstantRepr (PLifted p') From 565974514968ca7271fe1719a3dd66d69b34e3d7 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 3 Mar 2022 17:36:54 -0500 Subject: [PATCH 148/584] Pass evaluated script in `@:->` This removes redundant evaluation in (@==). --- plutarch-test/src/Plutarch/IntegerSpec.hs | 2 +- plutarch-test/src/Plutarch/Test.hs | 17 +++++++++--- plutarch-test/src/Plutarch/Test/Golden.hs | 32 ++++++++++++++--------- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/src/Plutarch/IntegerSpec.hs index 827a71096..6b78a6813 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/src/Plutarch/IntegerSpec.hs @@ -18,7 +18,7 @@ spec = do "fib" @\ do "lam" @| fib "app" @\ do - "9" @| fib # 9 @:-> \(p, bench) -> do + "9" @| fib # 9 @:-> \(p, _script, bench) -> do p `pshouldBe` (34 :: Term _ PInteger) bench `psatisfyWithinBenchmark` Benchmark 1_000_000_000 1_000_000 100 "error" @| fib # perror @-> pfails diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index fd550c20b..716c84b28 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -83,15 +83,22 @@ import qualified Plutus.V1.Ledger.Scripts as Scripts -} pshouldBe :: ClosedTerm a -> ClosedTerm b -> Expectation pshouldBe x y = do - p1 <- fmap printScript $ eval $ compile x - p2 <- fmap printScript $ eval $ compile y - p1 `shouldBe` p2 + p1 <- eval $ compile x + p2 <- eval $ compile y + pscriptShouldBe p1 p2 where eval :: Scripts.Script -> IO Scripts.Script eval s = case evalScript s of (Left e, _, _) -> expectationFailure $ "Script evaluation failed: " <> show e (Right x', _, _) -> pure x' +{- | + Like `pshouldBe` but on `Script` +-} +pscriptShouldBe :: Scripts.Script -> Scripts.Script -> Expectation +pscriptShouldBe x y = + printScript x `shouldBe` printScript y + -- | Like `@?=` but for Plutarch terms (#@?=) :: ClosedTerm a -> ClosedTerm b -> Expectation (#@?=) = pshouldBe @@ -176,7 +183,9 @@ plutarchDevFlagDescribe m = -- | Convenient alias for `@-> pshouldBe x` (@==) :: ClosedTerm a -> ClosedTerm b -> TermExpectation a -(@==) p x = p @-> pshouldBe x +(@==) p x = p @:-> \(_, script, _) -> script `pscriptShouldBe` xScript + where + xScript = fst . evalScriptAlwaysWithBenchmark . compile $ x infixr 1 @== diff --git a/plutarch-test/src/Plutarch/Test/Golden.hs b/plutarch-test/src/Plutarch/Test/Golden.hs index f9b96eeb4..9960e77b5 100644 --- a/plutarch-test/src/Plutarch/Test/Golden.hs +++ b/plutarch-test/src/Plutarch/Test/Golden.hs @@ -41,6 +41,7 @@ import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Prelude import Plutarch.Test.Benchmark (Benchmark, mkBenchmark, scriptSize) import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) +import Plutus.V1.Ledger.Scripts (Script) import qualified Plutus.V1.Ledger.Scripts as Scripts data GoldenValue = GoldenValue @@ -50,9 +51,11 @@ data GoldenValue = GoldenValue -- ^ Golden string for evaluated UPLC , goldenValueBench :: Text -- ^ Golden string for benchmark JSON + , goldenValueEvaluated :: Script + -- ^ Evaluated result , goldenValueBenchVal :: Benchmark -- ^ `Benchmark` for evaluated UPLC - , goldenValueExpectation :: Maybe (Benchmark -> Expectation) + , goldenValueExpectation :: Maybe (Script -> Benchmark -> Expectation) -- ^ User test's expectation function } @@ -63,7 +66,7 @@ data GoldenValue = GoldenValue class HasGoldenValue (t :: S -> PType -> Type) where mkGoldenValue :: forall a. (forall s. t s a) -> GoldenValue -mkGoldenValue' :: ClosedTerm a -> Maybe (Benchmark -> Expectation) -> GoldenValue +mkGoldenValue' :: ClosedTerm a -> Maybe (Script -> Benchmark -> Expectation) -> GoldenValue mkGoldenValue' p mexp = let compiledScript = compileD p (evaluatedScript, bench) = evalScriptAlwaysWithBenchmark compiledScript @@ -71,6 +74,7 @@ mkGoldenValue' p mexp = (T.pack $ printScript compiledScript) (T.pack $ printScript evaluatedScript) (TL.toStrict $ Aeson.encodeToLazyText bench) + evaluatedScript bench mexp @@ -83,31 +87,33 @@ instance HasGoldenValue Term where {- | A `Term` paired with its evaluation/benchmark expectation Example: - >>> TermExpectation (pcon PTrue) $ \(p, _benchmark) -> pshouldBe (pcon PTrue) + >>> TermExpectation (pcon PTrue) $ \(p, _script, _benchmark) -> pshouldBe (pcon PTrue) -} -data TermExpectation' s a = TermExpectation (Term s a) ((Term s a, Benchmark) -> Expectation) +data TermExpectation' s a = TermExpectation (Term s a) ((Term s a, Script, Benchmark) -> Expectation) type TermExpectation a = forall s. TermExpectation' s a -- | Test an expectation on a golden Plutarch program (@->) :: ClosedTerm a -> (ClosedTerm a -> Expectation) -> TermExpectation a -(@->) p f = p @:-> \(p', _) -> f $ punsafeAsClosedTerm p' +(@->) p f = p @:-> \(p', _, _) -> f $ punsafeAsClosedTerm p' infixr 1 @-> -{- | Like `@->` but also takes the benchmark as an argument +{- | Like `@->` but also takes the evaluated script and benchmark as arguments Useful to do assertion checks on post-evaluation benchmark (eg: to check if - script size is below certain threshold). Use in conjunction with - `psatisfyWithinBenchmark`. + script size is below certain threshold) -- use in conjunction with + `psatisfyWithinBenchmark` -- or on evaluated script (ie., without + re-evaluating the program). -} -(@:->) :: ClosedTerm a -> ((ClosedTerm a, Benchmark) -> Expectation) -> TermExpectation a -(@:->) p f = TermExpectation p (\(p', b) -> f (punsafeAsClosedTerm p', b)) +(@:->) :: ClosedTerm a -> ((ClosedTerm a, Script, Benchmark) -> Expectation) -> TermExpectation a +(@:->) p f = TermExpectation p (\(p', pe, b) -> f (punsafeAsClosedTerm p', pe, b)) infixr 1 @:-> instance HasGoldenValue TermExpectation' where - mkGoldenValue (TermExpectation p f) = mkGoldenValue' (punsafeAsClosedTerm p) (Just $ (\b -> f (p, b))) + mkGoldenValue (TermExpectation p f) = + mkGoldenValue' (punsafeAsClosedTerm p) (Just $ (\pe b -> f (p, pe, b))) -- | The key used in the .golden files containing multiple golden values newtype GoldenKey = GoldenKey Text @@ -174,8 +180,8 @@ pgoldenSpec map = do it "bench" $ pureGoldenTextFile (goldenPathWith "bench") $ combineGoldens $ fmap goldenValueBench <$> bs - let asserts = flip mapMaybe bs $ \(k, b) -> do - (k,) . ($ goldenValueBenchVal b) <$> goldenValueExpectation b + let asserts = flip mapMaybe bs $ \(k, v) -> do + (k,) . (\f -> f (goldenValueEvaluated v) $ goldenValueBenchVal v) <$> goldenValueExpectation v unless (null asserts) $ do forM_ asserts $ \(k, v) -> it (goldenKeyString $ "" <> k <> "assert") v From 68701201c1491fb4533bb2bdc18cd6063fee439a Mon Sep 17 00:00:00 2001 From: Peter Dragos Date: Thu, 3 Mar 2022 18:55:59 -0500 Subject: [PATCH 149/584] add polymorphic DerivePConstantViaData helpers --- Plutarch/DataRepr.hs | 2 + Plutarch/DataRepr/Internal.hs | 85 +++++++++++++++++++++++++++++++++-- Plutarch/Lift.hs | 49 +++++++++++--------- 3 files changed, 113 insertions(+), 23 deletions(-) diff --git a/Plutarch/DataRepr.hs b/Plutarch/DataRepr.hs index 181952638..9ea32b016 100644 --- a/Plutarch/DataRepr.hs +++ b/Plutarch/DataRepr.hs @@ -15,6 +15,8 @@ module Plutarch.DataRepr ( I.pdropDataRecord, I.DerivePConstantViaData (DerivePConstantViaData), I.pasDataSum, + I.PConstantableData, + I.PLiftableData, -- * Fields F.PDataFields (ptoFields, type PFields), diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 15dd6f53a..b7f42fcd7 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -11,7 +11,9 @@ module Plutarch.DataRepr.Internal ( pdcons, pdnil, DataReprHandlers (..), + PConstantableData, PDataRecord (..), + PLiftableData, PLabeledType (..), type PLabelIndex, type PUnLabel, @@ -23,7 +25,7 @@ module Plutarch.DataRepr.Internal ( pasDataSum, ) where -import Data.Kind (Type) +import Data.Kind (Constraint, Type) import Data.List (groupBy, maximumBy, sortOn) import Data.Proxy (Proxy (Proxy)) import GHC.TypeLits ( @@ -94,7 +96,17 @@ import Plutarch.Integer (PInteger) import Plutarch.Internal (S (SI)) import Plutarch.Internal.Generic (MkSum (mkSum)) import Plutarch.Internal.TypeFamily (ToPType2) -import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) +import Plutarch.Lift ( + PConstant, + PConstantRepr, + PConstantable, + PConstanted, + PLift, + PLifted, + pconstant, + pconstantFromRepr, + pconstantToRepr, + ) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) import Plutarch.Unsafe (punsafeCoerce) @@ -364,7 +376,74 @@ instance PIsDataRepr a => PlutusType (PIsDataReprInstances a) where pcon' (PIsDataReprInstances x) = pconRepr x pmatch' x f = pmatchRepr x (f . PIsDataReprInstances) -newtype DerivePConstantViaData (h :: Type) (p :: PType) = DerivePConstantViaData h +{- | Type synonym to simplify deriving of @PConstant@ via @DerivePConstantViaData@. + +A type @Foo a@ is considered "ConstantableData" if: + +- The wrapped type @a@ has a @PConstant@ instance. +- The lifted type of @a@ has a @PUnsafeLiftDecl@ instance. +- There is type equality between @a@ and @PLifted (PConstanted a)@. +- The newtype has @FromData@ and @ToData@ instances + +These constraints are sufficient to derive a @PConstant@ instance for the newtype. + +For deriving @PConstant@ for a wrapped type represented in UPLC as @Data@, see +@DerivePConstantViaData@. + +Polymorphic types can be derived as follows: + +>data Bar a = Bar a deriving stock (GHC.Generic) +> +>PlutusTx.makeLift ''Bar +>PlutusTx.makeIsDataIndexed ''Bar [('Bar, 0)] +> +>data PBar (a :: PType) (s :: S) +> = PBar (Term s (PDataRecord '["_0" ':= a])) +> deriving stock (GHC.Generic) +> deriving anyclass (SOP.Generic, PIsDataRepr) +> deriving (PlutusType, PIsData, PDataFields) via PIsDataReprInstances (PBar a) +> +>instance +> forall a. +> PLiftableData a => +> PUnsafeLiftDecl (PBar a) +> where +> type PLifted (PBar a) = Bar (PLifted a) +> +>deriving via +> ( DerivePConstantViaData +> (Bar a) +> (PBar (PConstanted a)) +> ) +> instance +> PConstantableData a => +> PConstant (Bar a) +-} +type PConstantableData :: Type -> Constraint +type PConstantableData h = + ( PConstantable h + , Ledger.FromData (h) + , Ledger.ToData (h) + ) + +type PLiftableData :: PType -> Constraint +type PLiftableData p = + ( PLift p + , Ledger.FromData (PLifted p) + , Ledger.ToData (PLifted p) + ) + +{- | + +For deriving @PConstant@ for a wrapped type represented by a builtin type, see +@DerivePConstantViaNewtype@. +-} +newtype + DerivePConstantViaData + (h :: Type) + (p :: PType) -- The Plutarch synonym to the Haskell type + = -- | The Haskell type for which @PConstant is being derived. + DerivePConstantViaData h instance (PIsDataRepr p, PLift p, Ledger.FromData h, Ledger.ToData h) => PConstant (DerivePConstantViaData h p) where type PConstantRepr (DerivePConstantViaData h p) = Ledger.Data diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 77158c350..b4a6ccdb0 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -32,7 +32,7 @@ module Plutarch.Lift ( import Control.Lens ((^?)) import Data.Coerce -import Data.Kind (Type, Constraint) +import Data.Kind (Constraint, Type) import GHC.Stack (HasCallStack) import Plutarch.Evaluate (EvalError, evalScript) import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInternal) @@ -125,7 +125,7 @@ instance pconstantToRepr = coerce pconstantFromRepr = Just . coerce -{-| Newtype wrapper for deriving @PConstant@ when the wrapped type is represented +{- | Newtype wrapper for deriving @PConstant@ when the wrapped type is represented indirectly by a builtin UPLC type that is /not/ @Data@. Ex: @PPubKeyHash@ is a newtype to a @PByteString@ and @PByteString@ is directly @@ -133,26 +133,32 @@ indirectly by a builtin UPLC type that is /not/ @Data@. Polymorphic types can be derived as follows: -Usage: - - +>newtype Foo a = Foo a +> +>newtype PFoo a s = PFoo (Term s a) > -> deriving via -> (DerivePConstantViaNewType -> (Foo a) -> (PFoo (PConstanted a)) -> (PConstanted a)) -> instance -> PConstantable a => -> PConstant (Foo a) +>instance forall a. PLift a => PUnsafeLiftDecl (PFoo a) where +> type PLifted (PFoo a) = Foo (PLifted a) +> +>deriving via +> ( DerivePConstantViaNewtype +> (Foo a) +> (PFoo (PConstanted a)) +> (PConstanted a) +> ) +> instance +> PConstantable a => +> PConstant (Foo a) -} -newtype DerivePConstantViaNewtype - (h :: Type) -- | The Haskell newtype we are deriving a @PConstant@ instance for - (p :: PType) -- | PType to associate with the newtype - (p' :: PType) -- | Underlying UPLC representation type - = DerivePConstantViaNewtype h +newtype + DerivePConstantViaNewtype + (h :: Type) + (p :: PType) -- PType to associate with the newtype + (p' :: PType) -- Underlying UPLC representation type + = -- | The Haskell newtype we are deriving a @PConstant@ instance for + DerivePConstantViaNewtype h -{-| Type synonym to simplify deriving of @PConstant@ via @DerivePConstantViaNewtype@. +{- | Type synonym to simplify deriving of @PConstant@ via @DerivePConstantViaNewtype@. A newtype @Foo a@ is considered "Constantable" if: @@ -161,9 +167,12 @@ A newtype @Foo a@ is considered "Constantable" if: - There is type equality between @a@ and @PLifted (PConstanted a)@. These constraints are sufficient to derive a @PConstant@ instance for the newtype. + +For deriving @PConstant@ for a wrapped type represented in UPLC as @Data@, see +@DerivePConstantViaData@. -} type PConstantable :: Type -> Constraint -type PConstantable a = (a ~ (PLifted (PConstanted a)), PUnsafeLiftDecl (PConstanted a), PConstant a) +type PConstantable a = (a ~ (PLifted (PConstanted a)), PUnsafeLiftDecl (PConstanted a), PConstant a) instance (PLift p, PLift p', Coercible h (PLifted p')) => PConstant (DerivePConstantViaNewtype h p p') where type PConstantRepr (DerivePConstantViaNewtype h p p') = PConstantRepr (PLifted p') From 86308f076f26cab4b5e5718ae8264d64e1a29d4c Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 4 Mar 2022 10:17:53 +0100 Subject: [PATCH 150/584] fix: - renamed the executables as requested by srid - fixed the nix --- flake.nix | 9 ++++++--- .../monadic.api.example.signatory.dev=true.bench.golden | 4 ++-- .../monadic.api.example.signatory.dev=true.uplc.golden | 4 ++-- plutarch-test/plutarch-test.cabal | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 82355d8d4..dccf7fa35 100644 --- a/flake.nix +++ b/flake.nix @@ -480,7 +480,10 @@ { # Workaround missing support for build-tools: # https://github.com/input-output-hk/haskell.nix/issues/231 - packages.plutarch-test.components.exes.plutarch-test.build-tools = [ + packages.plutarch-test.components.exes.plutarch-base-test.build-tools = [ + pkgSet.hsPkgs.sydtest-discover + ]; + packages.plutarch-test.components.exes.plutarch-extra-test.build-tools = [ pkgSet.hsPkgs.sydtest-discover ]; packages.plutarch-test.flags.development = flagDevelopment; @@ -600,8 +603,8 @@ program = checkedShellScript system "plutatch-test-${name}" '' cd ${self}/plutarch-test - ${flake.packages."plutarch-test:exe:plutarch-base"}/bin/plutarch-base; - ${flake.packages."plutarch-test:exe:plutarch-extra"}/bin/plutarch-extra; + ${flake.packages."plutarch-test:exe:plutarch-base-test"}/bin/plutarch-base-test; + ${flake.packages."plutarch-test:exe:plutarch-extra-test"}/bin/plutarch-extra-test; ''; }; diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden index 3d0372498..c9963d505 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -1,2 +1,2 @@ -do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":382} -do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":378} \ No newline at end of file +do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":392} +do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":388} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden index 38d9d9c54..f975ba797 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -1,2 +1,2 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at plutarch-base/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at plutarch-base/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 15bfbc89c..f0ac33d41 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -102,7 +102,7 @@ library Plutarch.Test.Golden Plutarch.Test.ListSyntax -executable plutarch-extra +executable plutarch-extra-test import: c, deps main-is: Main.hs hs-source-dirs: plutarch-extra @@ -112,7 +112,7 @@ executable plutarch-extra ghc-options: -threaded -rtsopts -with-rtsopts=-N -executable plutarch-base +executable plutarch-base-test import: c, deps main-is: Main.hs hs-source-dirs: plutarch-base From 15b989693e2bb80103c7c4213fbbf2f200d7adb1 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 4 Mar 2022 13:00:45 +0100 Subject: [PATCH 151/584] fix: - refactor: moved the testing lib to a separate directory and added it as a proper dependency to both the testing exes --- flake.nix | 2 +- .../{plutarch-base => common}/Plutarch/Test.hs | 0 .../Plutarch/Test/Benchmark.hs | 0 .../{plutarch-base => common}/Plutarch/Test/Golden.hs | 0 .../Plutarch/Test/ListSyntax.hs | 0 plutarch-test/plutarch-test.cabal | 11 ++++++----- 6 files changed, 7 insertions(+), 6 deletions(-) rename plutarch-test/{plutarch-base => common}/Plutarch/Test.hs (100%) rename plutarch-test/{plutarch-base => common}/Plutarch/Test/Benchmark.hs (100%) rename plutarch-test/{plutarch-base => common}/Plutarch/Test/Golden.hs (100%) rename plutarch-test/{plutarch-base => common}/Plutarch/Test/ListSyntax.hs (100%) diff --git a/flake.nix b/flake.nix index dccf7fa35..421002504 100644 --- a/flake.nix +++ b/flake.nix @@ -600,7 +600,7 @@ in { type = "app"; - program = checkedShellScript system "plutatch-test-${name}" + program = checkedShellScript system "plutarch-test-${name}" '' cd ${self}/plutarch-test ${flake.packages."plutarch-test:exe:plutarch-base-test"}/bin/plutarch-base-test; diff --git a/plutarch-test/plutarch-base/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/Test.hs rename to plutarch-test/common/Plutarch/Test.hs diff --git a/plutarch-test/plutarch-base/Plutarch/Test/Benchmark.hs b/plutarch-test/common/Plutarch/Test/Benchmark.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/Test/Benchmark.hs rename to plutarch-test/common/Plutarch/Test/Benchmark.hs diff --git a/plutarch-test/plutarch-base/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/Test/Golden.hs rename to plutarch-test/common/Plutarch/Test/Golden.hs diff --git a/plutarch-test/plutarch-base/Plutarch/Test/ListSyntax.hs b/plutarch-test/common/Plutarch/Test/ListSyntax.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/Test/ListSyntax.hs rename to plutarch-test/common/Plutarch/Test/ListSyntax.hs diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index f0ac33d41..cb164c4d5 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -95,17 +95,21 @@ common deps library import: c, deps - hs-source-dirs: plutarch-base + hs-source-dirs: common exposed-modules: Plutarch.Test other-modules: Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax + if flag(development) + cpp-options: -DDevelopment + executable plutarch-extra-test import: c, deps main-is: Main.hs hs-source-dirs: plutarch-extra + build-depends: plutarch-test other-modules: Plutarch.ExtraSpec Spec @@ -119,6 +123,7 @@ executable plutarch-base-test build-depends: , base16-bytestring , cborg + , plutarch-test , rank2classes , serialise @@ -145,10 +150,6 @@ executable plutarch-base-test Plutarch.RecursionSpec Plutarch.ScriptsSpec Plutarch.StringSpec - Plutarch.Test - Plutarch.Test.Benchmark - Plutarch.Test.Golden - Plutarch.Test.ListSyntax Plutarch.TraceSpec Plutarch.UnitSpec Plutarch.UPLCSpec From d9d856a31e2531a479ea72a240818408d2b7b16d Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 4 Mar 2022 13:27:27 +0100 Subject: [PATCH 152/584] update changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9291e8c7e..f61ab8a3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,13 @@ - Add `Plutarch.Test` for testing Plutarch code with goldens for UPLC printing and Plutus benchmarks. +- `plutarch-extra`: Add a new directory scaffold "`plutarch-extra`" which will be home to everything too specific to not be in the + main Plutarch repo. Also refactored the test library. + + Directory: `plutarch-extra` + + Added by: [#329](https://github.com/Plutonomicon/plutarch/pull/329) + # 1.1.0 - General repository changes. From 0c34fc02d27e00324068e5f5619fd4140007d15a Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> Date: Fri, 4 Mar 2022 10:49:28 -0500 Subject: [PATCH 153/584] Delete CODEOWNERS Follow up to https://github.com/Plutonomicon/plutarch/pull/334 --- CODEOWNERS | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index 6c36d831a..000000000 --- a/CODEOWNERS +++ /dev/null @@ -1,15 +0,0 @@ -# CODEOWNERS file -# -# This file is used to describe who owns what in this repository. -# -# For documentation on this file, see https://help.github.com/articles/about-codeowners/ -# Mentioned users will get code review requests. -# -# IMPORTANT NOTE: in order to actually get pinged, commit access is required. -# This also holds true for GitHub teams. - -# This file -/.github/CODEOWNERS @MatthewCroughan - -# Any nix code -*.nix @MatthewCroughan @nixinator @DarthPJB From 451dcd73217be0c4fdb5f44447477542de6a11cd Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 4 Mar 2022 12:28:02 -0500 Subject: [PATCH 154/584] Fix GHC 8.10 build --- plutarch-test/src/Plutarch/Test.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs index 716c84b28..cdb137eab 100644 --- a/plutarch-test/src/Plutarch/Test.hs +++ b/plutarch-test/src/Plutarch/Test.hs @@ -181,11 +181,11 @@ plutarchDevFlagDescribe m = #endif {- ORMOLU_ENABLE -} --- | Convenient alias for `@-> pshouldBe x` +-- | Test that the Plutarch program evaluates to the given term (@==) :: ClosedTerm a -> ClosedTerm b -> TermExpectation a (@==) p x = p @:-> \(_, script, _) -> script `pscriptShouldBe` xScript where - xScript = fst . evalScriptAlwaysWithBenchmark . compile $ x + xScript = fst . evalScriptAlwaysWithBenchmark $ compile x infixr 1 @== From 97d509832abe1c08e33a3669cc8348d55d6726c9 Mon Sep 17 00:00:00 2001 From: gnumonik Date: Sat, 5 Mar 2022 00:15:31 +0000 Subject: [PATCH 155/584] Fixed an off-by-one error in the PlutusType instance for PDataSum --- Plutarch/DataRepr/Internal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index a27101040..9ed9e80a3 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -205,7 +205,7 @@ instance SListI (def:defs) => PlutusType (PDataSum (def:defs)) where pcon' = \case DSZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(def:defs)) # (f id) -- rewrite this with pconstrBuiltin? DSS rest -> case rest of - DSZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(def:defs)) # (f id) + DSZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(defs)) # (f id) dss@(DSS _) -> pcon' dss pmatch' :: forall From 8004ff2ee01c7e6aa99798915eb8bb8ae5464ffc Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 4 Mar 2022 17:52:03 +0100 Subject: [PATCH 156/584] wip #344: - added PTryFrom instance for PBuiltinMap -> PMap and hid the constructor of the latter --- Plutarch/Api/V1/AssocMap.hs | 27 ++++++++++++++++++++++++++- Plutarch/TryFrom.hs | 5 ++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index eeb3ff3ee..1f9b38d72 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -2,11 +2,12 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V1.AssocMap ( - PMap (PMap), + PMap, ) where import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap +import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom)) import Plutarch.Builtin (PBuiltinMap) import Plutarch.Lift ( @@ -56,3 +57,27 @@ instance x' <- Plutus.fromData x y' <- Plutus.fromData y Just (x', y') + +----------------------- PTryFrom instance ----------------------------------------------- + +instance + ( POrd k + , PIsData k + ) => + PTryFrom (PBuiltinMap k v) (PMap k v) where + type PTryFromExcess (PBuiltinMap k v) (PMap k v) = PUnit + ptryFrom oMap = do + sortVer <- tcont $ plet $ (pfix #$ plam $ + \self xs -> + pmatch xs $ \case + PNil -> pcon PUnit + PCons x ys -> + pmatch ys $ \case + PNil -> pcon PUnit + PCons y _ -> + pif + ((pfromData (pfstBuiltin # x)) #<= (pfromData (pfstBuiltin # y))) + (self # ys) + perror ) # oMap + pure ((pcon . PMap) oMap, sortVer) + diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 1683daeec..97ce721e7 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -19,7 +19,7 @@ import GHC.TypeLits (KnownNat, Nat, natVal, type (+)) import Plutarch.Builtin ( PAsData, - PBuiltinList, + PBuiltinList (PCons, PNil), PBuiltinMap, PBuiltinPair, PData, @@ -44,6 +44,8 @@ import Plutarch.Internal.Other ( Term, pcon, perror, + pfix, + pmatch, pforce, phoistAcyclic, plam, @@ -62,6 +64,7 @@ import Plutarch.DataRepr.Internal ( pdnil, ) + import Plutarch.Bool (pif, (#==)) import Plutarch.List ( From efb5f081af5f2d24abf568e56e563928e30a89ae Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 5 Mar 2022 17:35:58 +0100 Subject: [PATCH 157/584] wip #344: - added PTryFrom and PMaybeFrom instances for PValue wip #303: - added PFrom and PMaybeFrom --- Plutarch/Api/V1.hs | 4 +- Plutarch/Api/V1/AssocMap.hs | 73 +++++++++++++++++++++++++++---------- Plutarch/Api/V1/Value.hs | 37 ++++++++++++++++++- Plutarch/Bool.hs | 2 +- Plutarch/Maybe.hs | 16 +++++++- Plutarch/TryFrom.hs | 72 ++++++++++++++++++++++++++++++++---- 6 files changed, 172 insertions(+), 32 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index b519565cd..8bf19e4d4 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -25,7 +25,7 @@ module Plutarch.Api.V1 ( type PStakeValidator, -- ** Value - Value.PValue (PValue), + Value.PValue, Value.PCurrencySymbol (PCurrencySymbol), Value.PTokenName (PTokenName), @@ -66,7 +66,7 @@ module Plutarch.Api.V1 ( Tx.PTxInInfo (PTxInInfo), -- ** AssocMap - AssocMap.PMap (PMap), + AssocMap.PMap, -- ** Others Maybe.PMaybeData (PDJust, PDNothing), diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 1f9b38d72..b4663011f 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -5,9 +5,12 @@ module Plutarch.Api.V1.AssocMap ( PMap, ) where +import Plutarch.TryFrom ( + PMaybeFrom (PMaybeFromExcess, pmaybeFrom), + PTryFrom (PTryFromExcess, ptryFrom), + ) import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap -import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom)) import Plutarch.Builtin (PBuiltinMap) import Plutarch.Lift ( @@ -58,26 +61,58 @@ instance y' <- Plutus.fromData y Just (x', y') ------------------------ PTryFrom instance ----------------------------------------------- +----------------------- PTryFrom and PMaybeFrom instances ------------------------------- -instance - ( POrd k +instance + ( POrd k , PIsData k ) => - PTryFrom (PBuiltinMap k v) (PMap k v) where + PTryFrom (PBuiltinMap k v) (PMap k v) + where type PTryFromExcess (PBuiltinMap k v) (PMap k v) = PUnit - ptryFrom oMap = do - sortVer <- tcont $ plet $ (pfix #$ plam $ - \self xs -> - pmatch xs $ \case - PNil -> pcon PUnit - PCons x ys -> - pmatch ys $ \case - PNil -> pcon PUnit - PCons y _ -> - pif - ((pfromData (pfstBuiltin # x)) #<= (pfromData (pfstBuiltin # y))) - (self # ys) - perror ) # oMap - pure ((pcon . PMap) oMap, sortVer) + ptryFrom oMap = do + sortVer <- + tcont $ + plet $ + ( pfix #$ plam $ + \self xs -> + pmatch xs $ \case + PNil -> pcon PUnit + PCons x ys -> + pmatch ys $ \case + PNil -> pcon PUnit + PCons y _ -> + pif + ((pfromData (pfstBuiltin # x)) #<= (pfromData (pfstBuiltin # y))) + (self # ys) + perror + ) + # oMap + pure ((pcon . PMap) oMap, sortVer) +instance + ( POrd k + , PIsData k + ) => + PMaybeFrom (PBuiltinMap k v) (PMap k v) + where + type PMaybeFromExcess (PBuiltinMap k v) (PMap k v) = PUnit + pmaybeFrom oMap = do + sortVer <- + tcont $ + plet $ + ( pfix #$ plam $ + \self xs -> + pmatch xs $ \case + PNil -> pcon $ PJust $ pcon PUnit + PCons x ys -> + pmatch ys $ \case + PNil -> pcon $ PJust $ pcon PUnit + PCons y _ -> + pif + ((pfromData (pfstBuiltin # x)) #< (pfromData (pfstBuiltin # y))) + (self # ys) + (pcon PNothing) + ) + # oMap + pure ((pcon . PJust . pcon . PMap) oMap, sortVer) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 16063f2a5..9acb56733 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -2,7 +2,7 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V1.Value ( - PValue (PValue), + PValue, PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), ) where @@ -16,6 +16,12 @@ import Plutarch.Lift ( PLifted, PUnsafeLiftDecl, ) + +import Plutarch.TryFrom ( + PMaybeFrom (PMaybeFromExcess, pmaybeFrom), + PTryFrom (PTryFromExcess, ptryFrom), + ) + import Plutarch.Prelude newtype PTokenName (s :: S) = PTokenName (Term s PByteString) @@ -46,3 +52,32 @@ deriving via (DerivePConstantViaNewtype Plutus.Value PValue (PMap PCurrencySymbol (PMap PTokenName PInteger))) instance (PConstant Plutus.Value) + +----------------------- PTryFrom and PMaybeFrom instances ------------------------------- + +instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where + type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = PUnit + ptryFrom m = + let + predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) + predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) perror + predOuter :: Term _ (PBuiltinPair (PAsData PCurrencySymbol) (PAsData (PMap PTokenName PInteger)) :--> PBool) + predOuter = plam $ \tup -> pall # predInner # (pto $ pfromData $ psndBuiltin # tup) + res :: Term _ PBool + res = pall # predOuter # pto m + in do + _ <- tcont $ plet res + pure $ (pcon $ PValue m, pcon PUnit) + +instance PMaybeFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where + type PMaybeFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = PUnit + pmaybeFrom m = do + let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) + predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) (pcon PFalse) + predOuter :: Term _ (PBuiltinPair (PAsData PCurrencySymbol) (PAsData (PMap PTokenName PInteger)) :--> PBool) + predOuter = plam $ \tup -> pall # predInner # (pto $ pfromData $ psndBuiltin # tup) + res :: Term _ PBool + res = pall # predOuter # pto m + (tcont $ plet res) >>= (tcont . pmatch) >>= \case + PFalse -> pure (pcon PNothing, pcon PNothing) + PTrue -> pure ((pcon . PJust . pcon . PValue) m, (pcon . PJust . pcon) PUnit) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index e5a493ca9..04191ab15 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -60,7 +60,7 @@ class PEq t where infix 4 #== -class POrd t where +class PEq t => POrd t where (#<=) :: Term s t -> Term s t -> Term s PBool (#<) :: Term s t -> Term s t -> Term s PBool diff --git a/Plutarch/Maybe.hs b/Plutarch/Maybe.hs index 9c63c5467..276583149 100644 --- a/Plutarch/Maybe.hs +++ b/Plutarch/Maybe.hs @@ -1,4 +1,7 @@ -module Plutarch.Maybe (PMaybe (..)) where +module Plutarch.Maybe ( + PMaybe (PJust, PNothing), + pfromMaybe, +) where import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) @@ -7,6 +10,11 @@ import Plutarch ( PlutusType, S, Term, + perror, + phoistAcyclic, + plam, + pmatch, + type (:-->), ) -- | Plutus Maybe type, with Scott-encoded repr @@ -15,3 +23,9 @@ data PMaybe (a :: PType) (s :: S) | PNothing deriving stock (GHC.Generic) deriving anyclass (Generic, PlutusType) + +pfromMaybe :: Term s (PMaybe a :--> a) +pfromMaybe = phoistAcyclic $ + plam $ \maybe -> pmatch maybe $ \case + PNothing -> perror + PJust a -> a diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 97ce721e7..2716009c0 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -5,6 +5,8 @@ module Plutarch.TryFrom ( PTryFrom (PTryFromExcess, ptryFrom), + PFrom (pfrom), + PMaybeFrom (PMaybeFromExcess, pmaybeFrom), pcheckType, pcheckByteStr, pcheckInt, @@ -15,11 +17,9 @@ module Plutarch.TryFrom ( import Data.Proxy (Proxy (Proxy)) import GHC.TypeLits (KnownNat, Nat, natVal, type (+)) --- import Data.Kind (Constraint) - import Plutarch.Builtin ( PAsData, - PBuiltinList (PCons, PNil), + PBuiltinList, PBuiltinMap, PBuiltinPair, PData, @@ -36,6 +36,8 @@ import Plutarch.Builtin ( psndBuiltin, ) +import Plutarch.Maybe (PMaybe) + import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) import Plutarch.Internal.Other ( @@ -44,8 +46,6 @@ import Plutarch.Internal.Other ( Term, pcon, perror, - pfix, - pmatch, pforce, phoistAcyclic, plam, @@ -64,7 +64,6 @@ import Plutarch.DataRepr.Internal ( pdnil, ) - import Plutarch.Bool (pif, (#==)) import Plutarch.List ( @@ -93,12 +92,29 @@ import Plutarch.TermCont (TermCont, tcont, unTermCont) use it if you cannot establish trust otherwise (e.g. via only checking a part of your Data with PTryFrom) + Laws: + - the operation `ptryFrom` mustn't change the representation of the underlying data + - the operation `ptryFrom` must always prove the integrity of the whole target type + - example: + `ptryFrom PData (PAsData (PBuiltinList PData))` must only succeed if the underlying + representation is a `BuiltinList` containing any `PData` + - all conversion are fallible, this happens if the representation doesn't match + the expected type. + - the operation `ptryFrom` proves equality between the less expressive `PType` `a` and + the more expressive `PType` `b`, hence the first element of the resulting Tuple + must always be wrapped in `PAsData` if the origin type was `PData` (see law 1) + - the result type `b` must always be safe than the origin type `a`, i.e. it must carry + more information -} class PTryFrom (a :: PType) (b :: PType) where - -- "safest" type --^ ^-- target type type PTryFromExcess a b :: PType ptryFrom :: Term s a -> TermCont s (Term s b, Term s (PTryFromExcess a b)) + -- | this function is only used for `PFrom` and is not exported, + -- it makes use of PTryFrom being a bijection + ptryFromInverse :: Term s b -> Term s a + ptryFromInverse = punsafeCoerce + ----------------------- PData instances ------------------------------------------------- instance PTryFrom PData (PAsData PInteger) where @@ -277,7 +293,6 @@ instance {-# OVERLAPPING #-} forall ys. ( SumValidation 0 ys - -- , AllRecordsPTryFrom ys ) => PTryFrom PData (PAsData (PDataSum ys)) where @@ -309,6 +324,47 @@ instance ver <- tcont $ plet ver' pure $ (punsafeCoerce opq, ver) +instance + ( PTryFrom a b + , PIsData a + , PIsData b + ) => + PTryFrom (PAsData a) (PAsData b) + where + type PTryFromExcess (PAsData a) (PAsData b) = PTryFromExcess a b + ptryFrom opq = do + ver' <- ptryFrom @a @b $ pfromData opq + ver <- tcont $ plet $ snd ver' + pure $ (punsafeCoerce opq, ver) + +----------------------- The class PFrom ------------------------------------------------- + +{- | + Represents infallible conversion. + Laws: + - The result type must always carry less information than the origin + type +-} +class PFrom a b where + pfrom :: Term s a -> TermCont s (Term s b) + +{- | + This instance relies on all instances of `PTryFrom` being lawful +-} +instance + {-# OVERLAPPABLE #-} + ( PTryFrom b a + ) => + PFrom a b + where + pfrom = pure . ptryFromInverse + +----------------------- The class PMaybeFrom -------------------------------------------- + +class PMaybeFrom (a :: PType) (b :: PType) where + type PMaybeFromExcess a b :: PType + pmaybeFrom :: Term s a -> TermCont s (Term s (PMaybe b), Term s (PMaybe (PMaybeFromExcess a b))) + ----------------------- Helper functions ------------------------------------------------ pchooseData :: Term s (PData :--> a :--> a :--> a :--> a :--> a :--> a) From b812e747479bbb495eafaa49f3611f4e5e97ac55 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 5 Mar 2022 19:16:05 +0100 Subject: [PATCH 158/584] wip #344: - added tests for PMap and corrected the errors I found while testing --- Plutarch/Api/V1/AssocMap.hs | 7 +++- Plutarch/Api/V1/Value.hs | 17 ++++---- ...ion_untrusted_data.dev=false.bench.golden} | 6 +++ ...untrusted_data.dev=false.uplc.eval.golden} | 6 +++ ...tion_untrusted_data.dev=false.uplc.golden} | 6 +++ ...ation_untrusted_data.dev=true.bench.golden | 30 ++++++++++++++ ...n_untrusted_data.dev=true.uplc.eval.golden | 30 ++++++++++++++ ...cation_untrusted_data.dev=true.uplc.golden | 30 ++++++++++++++ plutarch-test/src/Plutarch/TryFromSpec.hs | 41 ++++++++++++++++++- 9 files changed, 161 insertions(+), 12 deletions(-) rename plutarch-test/goldens/{verification_untrusted_data.bench.golden => verification_untrusted_data.dev=false.bench.golden} (79%) rename plutarch-test/goldens/{verification_untrusted_data.uplc.eval.golden => verification_untrusted_data.dev=false.uplc.eval.golden} (83%) rename plutarch-test/goldens/{verification_untrusted_data.uplc.golden => verification_untrusted_data.dev=false.uplc.golden} (84%) create mode 100644 plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden create mode 100644 plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index b4663011f..33241e23e 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -83,7 +83,7 @@ instance PNil -> pcon PUnit PCons y _ -> pif - ((pfromData (pfstBuiltin # x)) #<= (pfromData (pfstBuiltin # y))) + ((pfromData (pfstBuiltin # x)) #< (pfromData (pfstBuiltin # y))) (self # ys) perror ) @@ -115,4 +115,7 @@ instance (pcon PNothing) ) # oMap - pure ((pcon . PJust . pcon . PMap) oMap, sortVer) + ver <- tcont $ pmatch sortVer + pure $ case ver of + PJust _ -> ((pcon . PJust . pcon . PMap) oMap, sortVer) + PNothing -> (pcon PNothing, sortVer) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 9acb56733..159b8aa6c 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -57,17 +57,16 @@ deriving via instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = PUnit - ptryFrom m = - let - predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) + ptryFrom m = + let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) perror predOuter :: Term _ (PBuiltinPair (PAsData PCurrencySymbol) (PAsData (PMap PTokenName PInteger)) :--> PBool) predOuter = plam $ \tup -> pall # predInner # (pto $ pfromData $ psndBuiltin # tup) res :: Term _ PBool res = pall # predOuter # pto m - in do - _ <- tcont $ plet res - pure $ (pcon $ PValue m, pcon PUnit) + in do + _ <- tcont $ plet res + pure $ (pcon $ PValue m, pcon PUnit) instance PMaybeFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where type PMaybeFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = PUnit @@ -78,6 +77,6 @@ instance PMaybeFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue whe predOuter = plam $ \tup -> pall # predInner # (pto $ pfromData $ psndBuiltin # tup) res :: Term _ PBool res = pall # predOuter # pto m - (tcont $ plet res) >>= (tcont . pmatch) >>= \case - PFalse -> pure (pcon PNothing, pcon PNothing) - PTrue -> pure ((pcon . PJust . pcon . PValue) m, (pcon . PJust . pcon) PUnit) + (tcont $ plet res) >>= (tcont . pmatch) >>= \case + PFalse -> pure (pcon PNothing, pcon PNothing) + PTrue -> pure ((pcon . PJust . pcon . PValue) m, (pcon . PJust . pcon) PUnit) diff --git a/plutarch-test/goldens/verification_untrusted_data.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden similarity index 79% rename from plutarch-test/goldens/verification_untrusted_data.bench.golden rename to plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden index 36934e45b..0920418f8 100644 --- a/plutarch-test/goldens/verification_untrusted_data.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden @@ -18,6 +18,12 @@ removing the data wrapper.working.(String, String) == (String, String) {"exBudge removing the data wrapper.working.[String] == [String] {"exBudgetCPU":6480136,"exBudgetMemory":13844,"scriptSizeBytes":92} removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} +checking PValue and PMap for validity.PMap.valid0 {"exBudgetCPU":13804861,"exBudgetMemory":25916,"scriptSizeBytes":169} +checking PValue and PMap for validity.PMap.invalid1 {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":169} +checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} +checking PValue and PMap for validity.PMap.valid0maybe {"exBudgetCPU":14519413,"exBudgetMemory":28316,"scriptSizeBytes":198} +checking PValue and PMap for validity.PMap.invalid1maybe {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":198} +checking PValue and PMap for validity.PMap.invalid2maybe {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} example.concatenate two lists, legal {"exBudgetCPU":63896970,"exBudgetMemory":125943,"scriptSizeBytes":656} example.concatenate two lists, illegal (list too short) {"exBudgetCPU":56513317,"exBudgetMemory":105217,"scriptSizeBytes":649} example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":63748105,"exBudgetMemory":125443,"scriptSizeBytes":656} diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden similarity index 83% rename from plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden rename to plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden index a399b62ae..dff3c9097 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden @@ -18,6 +18,12 @@ removing the data wrapper.working.(String, String) == (String, String) (program removing the data wrapper.working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) +checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 error) +checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) +checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) +checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 error) +checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 error) example.concatenate two lists, legal (program 1.0.0 ()) example.concatenate two lists, illegal (list too short) (program 1.0.0 error) example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) diff --git a/plutarch-test/goldens/verification_untrusted_data.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden similarity index 84% rename from plutarch-test/goldens/verification_untrusted_data.uplc.golden rename to plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden index c23e90631..aa143cbd4 100644 --- a/plutarch-test/goldens/verification_untrusted_data.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden @@ -18,6 +18,12 @@ removing the data wrapper.working.(String, String) == (String, String) (program removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))))) (force mkCons)) [ ])) removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 2) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) i12))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 8) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden new file mode 100644 index 000000000..93dfd9597 --- /dev/null +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden @@ -0,0 +1,30 @@ +erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} +erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":99} +erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} +erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":98} +erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":171} +working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} +working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} +working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} +working.PDataSum constr 0 {"exBudgetCPU":6024815,"exBudgetMemory":10910,"scriptSizeBytes":171} +working.PDataSum constr 1 {"exBudgetCPU":7028371,"exBudgetMemory":12876,"scriptSizeBytes":171} +removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":96} +removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":92} +removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":5889216,"exBudgetMemory":9972,"scriptSizeBytes":101} +removing the data wrapper.working.[String] == [String] {"exBudgetCPU":6480136,"exBudgetMemory":13844,"scriptSizeBytes":92} +removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} +removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} +checking PValue and PMap for validity.PMap.valid0 {"exBudgetCPU":13804861,"exBudgetMemory":25916,"scriptSizeBytes":169} +checking PValue and PMap for validity.PMap.invalid1 {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":169} +checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} +checking PValue and PMap for validity.PMap.valid0maybe {"exBudgetCPU":14519413,"exBudgetMemory":28316,"scriptSizeBytes":198} +checking PValue and PMap for validity.PMap.invalid1maybe {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":198} +checking PValue and PMap for validity.PMap.invalid2maybe {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} +example.concatenate two lists, legal {"exBudgetCPU":64762657,"exBudgetMemory":127907,"scriptSizeBytes":1060} +example.concatenate two lists, illegal (list too short) {"exBudgetCPU":56963317,"exBudgetMemory":105313,"scriptSizeBytes":1053} +example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":64198105,"exBudgetMemory":125539,"scriptSizeBytes":1060} +example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":68336627,"exBudgetMemory":126441,"scriptSizeBytes":1067} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden new file mode 100644 index 000000000..dff3c9097 --- /dev/null +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden @@ -0,0 +1,30 @@ +erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) +erroneous.[String] /= [Integer] (program 1.0.0 error) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 error) +erroneous.Map Int String /= Map Int Int (program 1.0.0 error) +erroneous.PDataSum constr 2 (program 1.0.0 error) +erroneous.PDataSum wrong record type (program 1.0.0 error) +working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) +working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) +working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) +working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) +working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) +removing the data wrapper.working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) +removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) +checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 error) +checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) +checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) +checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 error) +checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 error) +example.concatenate two lists, legal (program 1.0.0 ()) +example.concatenate two lists, illegal (list too short) (program 1.0.0 error) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden new file mode 100644 index 000000000..0df111619 --- /dev/null +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden @@ -0,0 +1,30 @@ +erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unIData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) +erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> i3 ((\i0 -> i5 i2) (unIData (i4 i1))) (i3 ((\i0 -> i5 (unListData (listData (i6 i2)))) (unBData (i4 (unListData (listData (i5 i1)))))) [ ])) (unListData (listData (force (force sndPair) i1))))) (delay error))) (unConstrData i4))) (force mkCons)) (force headList)) (force tailList)) #d87a9f0543666f6fff)) +erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unBData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87b9f0543666f6fff)) +working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unBData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) +working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d8799f0543666f6fff)) +working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87a9f0543666f6fff)) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (iData 42) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #62617a)))))) (force mkCons)) [ ])) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) +removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))))) (force mkCons)) [ ])) +removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 2) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:336:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:289:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:286:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:336:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:289:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:286:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) i14))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:336:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:289:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:286:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 8) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:336:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:289:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:286:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffd8799f41d003ffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index 66b633d1c..9c1d804bc 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -26,6 +26,7 @@ import Plutarch import Plutarch.Api.V1 ( PDatum, PDatumHash, + PMap, PMaybeData (PDJust), PScriptContext, PScriptPurpose (PSpending), @@ -41,15 +42,17 @@ import Plutarch.Builtin ( ) import Plutarch.Prelude import Plutarch.TryFrom ( + PMaybeFrom (pmaybeFrom), PTryFrom (PTryFromExcess, ptryFrom), ) import Plutarch.ApiSpec (info, purpose) +import Plutarch.Maybe (pfromMaybe) import Plutarch.Test spec :: Spec spec = do - describe "verification_untrusted_data" . pgoldenSpec $ do + describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do "erroneous" @\ do "(String, Integer) /= (String, String)" @| checkDeep @@ -164,6 +167,42 @@ spec = do -- ... than this "check structure partly" @| partialCheck @-> psucceeds + "checking PValue and PMap for validity" @\ do + "PMap" @\ do + let ms0 :: Term _ (PBuiltinMap PInteger PUnit) + ms0 = + pcons + # (ppairDataBuiltin # (pdata $ pconstant 1) # (pdata $ pcon PUnit)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant 2) # (pdata $ pcon PUnit)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant 42) # (pdata $ pcon PUnit)) + # pnil + mf1 :: Term _ (PBuiltinMap PInteger PUnit) + mf1 = + pcons + # (ppairDataBuiltin # (pdata $ pconstant 1) # (pdata $ pcon PUnit)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant 1) # (pdata $ pcon PUnit)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant 42) # (pdata $ pcon PUnit)) + # pnil + mf2 :: Term _ (PBuiltinMap PInteger PUnit) + mf2 = + pcons + # (ppairDataBuiltin # (pdata $ pconstant 1) # (pdata $ pcon PUnit)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant 2) # (pdata $ pcon PUnit)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant 3) # (pdata $ pcon PUnit)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant 2) # (pdata $ pcon PUnit)) + # pnil + "valid0" + @| (unTermCont $ fst <$> ptryFrom @_ @(PMap PInteger PUnit) ms0) @-> psucceeds + "invalid1" + @| (unTermCont $ fst <$> ptryFrom @_ @(PMap PInteger PUnit) mf1) @-> pfails + "invalid2" + @| (unTermCont $ fst <$> ptryFrom @_ @(PMap PInteger PUnit) mf2) @-> pfails + "valid0maybe" + @| (unTermCont $ ((pfromMaybe #) . fst) <$> pmaybeFrom @_ @(PMap PInteger PUnit) ms0) @-> psucceeds + "invalid1maybe" + @| (unTermCont $ ((pfromMaybe #) . fst) <$> pmaybeFrom @_ @(PMap PInteger PUnit) mf1) @-> pfails + "invalid2maybe" + @| (unTermCont $ fst <$> ptryFrom @_ @(PMap PInteger PUnit) mf2) @-> pfails "example" @\ do let validContext = ctx validList1 invalidContext = ctx invalidList1 From f8b76a3eae798d05f9cb4cb2d325755f8f8ee447 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 5 Mar 2022 21:07:07 +0100 Subject: [PATCH 159/584] fix: - until a proper fix is merged, the TryFrom test is ghc921 only --- flake.nix | 1 + plutarch-test/plutarch-test.cabal | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index fc5099c63..462083593 100644 --- a/flake.nix +++ b/flake.nix @@ -472,6 +472,7 @@ rm -f $out/plutarch-test/src/Plutarch/MonadicSpec.hs rm -f $out/plutarch-test/src/Plutarch/FieldSpec.hs rm -f $out/plutarch-test/src/Plutarch/RecSpec.hs + rm -f $out/plutarch-test/src/Plutarch/TryFromSpec.hs ''; compiler-nix-name = ghcName; inherit extraSources; diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index b7d818ac1..652785d44 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -116,6 +116,7 @@ executable plutarch-test Plutarch.FieldSpec Plutarch.MonadicSpec Plutarch.RecSpec + Plutarch.TryFromSpec other-modules: Plutarch.ApiSpec @@ -139,7 +140,6 @@ executable plutarch-test Plutarch.Test.Golden Plutarch.Test.ListSyntax Plutarch.TraceSpec - Plutarch.TryFromSpec Plutarch.UnitSpec Plutarch.UPLCSpec Spec From 304609e6b338fc7d644834b6cceec92411520de0 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 5 Mar 2022 22:35:46 +0100 Subject: [PATCH 160/584] fix: - removed stuff from TryFrom.hs that has been requested to be removed and adjusted docs as well as CHANGELOG --- CHANGELOG.md | 6 ++++++ Plutarch/TryFrom.hs | 36 +------------------------------- docs/GUIDE.md | 51 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9291e8c7e..e07edf596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,12 @@ - Add `Plutarch.Test` for testing Plutarch code with goldens for UPLC printing and Plutus benchmarks. +- Add Conversion types `PTryFrom`, `PMaybeFrom` and `PFrom` + + Module: `Plutarch.TryFrom` + + Added by: [#326](https://github.com/Plutonomicon/plutarch/pull/326) + # 1.1.0 - General repository changes. diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 2716009c0..519c32663 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -7,11 +7,6 @@ module Plutarch.TryFrom ( PTryFrom (PTryFromExcess, ptryFrom), PFrom (pfrom), PMaybeFrom (PMaybeFromExcess, pmaybeFrom), - pcheckType, - pcheckByteStr, - pcheckInt, - pcheckList, - pcheckMap, ) where import Data.Proxy (Proxy (Proxy)) @@ -46,8 +41,6 @@ import Plutarch.Internal.Other ( Term, pcon, perror, - pforce, - phoistAcyclic, plam, plet, (#), @@ -77,10 +70,6 @@ import qualified PlutusCore as PLC import Plutarch.TermCont (TermCont, tcont, unTermCont) -{- | - Note: PAsData POpaque ~ PData --} - ----------------------- The class PTryFrom ---------------------------------------------- {- | @@ -111,7 +100,7 @@ class PTryFrom (a :: PType) (b :: PType) where ptryFrom :: Term s a -> TermCont s (Term s b, Term s (PTryFromExcess a b)) -- | this function is only used for `PFrom` and is not exported, - -- it makes use of PTryFrom being a bijection + -- it makes use of PTryFrom being a class that always recovers data ptryFromInverse :: Term s b -> Term s a ptryFromInverse = punsafeCoerce @@ -364,26 +353,3 @@ instance class PMaybeFrom (a :: PType) (b :: PType) where type PMaybeFromExcess a b :: PType pmaybeFrom :: Term s a -> TermCont s (Term s (PMaybe b), Term s (PMaybe (PMaybeFromExcess a b))) - ------------------------ Helper functions ------------------------------------------------ - -pchooseData :: Term s (PData :--> a :--> a :--> a :--> a :--> a :--> a) -pchooseData = phoistAcyclic $ pforce $ punsafeBuiltin PLC.ChooseData - -pcheckType :: (Term s PInteger) -> Term _ (PData :--> PAsData b) -pcheckType i = plam $ \d -> - let con :: Term _ PInteger - con = pchooseData # d # 0 # 1 # 2 # 3 # 4 - in pif (con #== i) (punsafeCoerce d) perror - -pcheckMap :: Term s (PData :--> PAsData (PBuiltinMap PData PData)) -pcheckMap = pcheckType 1 - -pcheckList :: Term s (PData :--> PAsData (PBuiltinList PData)) -pcheckList = pcheckType 2 - -pcheckInt :: Term s (PData :--> PAsData PInteger) -pcheckInt = pcheckType 3 - -pcheckByteStr :: Term s (PData :--> PAsData PByteString) -pcheckByteStr = pcheckType 4 diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 66d7d40ae..1192ada5a 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -47,6 +47,7 @@ - [Alternatives to `OverloadedRecordDot`](#alternatives-to-overloadedrecorddot) - [All about constructing data values](#all-about-constructing-data-values) - [Implementing PIsDataRepr and friends](#implementing-pisdatarepr-and-friends) + - [PTryFrom, PMaybeFrom and PFrom](#ptryfrom-pmaybefrom-and-pfrom) - [Working with Types](#working-with-types) - [PInteger](#pinteger) - [PBool](#pbool) @@ -1358,6 +1359,56 @@ newtype PFoo (s :: S) = PMkFoo (Term s (PDataRecord '["foo" ':= PByteString])) ``` Just an extra `PDataFields` derivation compared to the sum type usage! (oh and also the ominous `UndecidableInstances`) +### PTryFrom, PMaybeFrom and PFrom + +```haskell +-- PTryFrom + +class PTryFrom (a :: PType) (b :: PType) where + type PTryFromExcess a b :: PType + ptryFrom :: Term s a -> TermCont s (Term s b, Term s (PTryFromExcess a b)) + + -- | this function is only used for `PFrom` and is not exported, + -- it makes use of PTryFrom being a class that always recovers data + ptryFromInverse :: Term s b -> Term s a + ptryFromInverse = punsafeCoerce + +-- PFrom + +class PFrom a b where + pfrom :: Term s a -> TermCont s (Term s b) + +-- PMaybeFrom + +class PMaybeFrom (a :: PType) (b :: PType) where + type PMaybeFromExcess a b :: PType + pmaybeFrom :: Term s a -> TermCont s (Term s (PMaybe b), Term s (PMaybe (PMaybeFromExcess a b))) +``` + +`PTryFrom` is a typeclass to prove equality between a type that in some way can't be trusted about its representation and another type that we want the untrusted type to be represented as. +`PTryFrom` proves the structure of the untrusted type and recovers it as the trusted, type which hence also carries more information. + +A good example is getting a `PData` from a redeemer and wanting to prove that it is of a certain kind, e.g. a `PAsData (PBuiltinList (PAsData PInteger))`. We could do this with: + +```haskell +recoverListFromPData = unTermCont $ fst <$> ptryFrom @PData @(PAsData (PBuiltinList (PAsData PInteger)) +``` + +An important note is, that `PTryFrom` carries a type `PExcess` which safes data that arose as "excess" during the act of verifying. For `PData (PAsData PSomething)` instances this most times +carries a `PSomething`, i.e. the type that has been proven equality for but without `PAsData` wrapper. In cases where this type is not useful, the `PExcess` type is just `PUnit`. + +In case we don't want to verify the whole structure but rather part of it (this can be a reasonable decision to lower the fees), we can just leave the part of the data that is not to be +verified a `PData` which serves as the base case: + +```haskell +recoverListPartially = ptryFrom @PData @(PAsData (PBuiltinList PData)) +``` + +As `ptryFrom` always *recovers* information and *never changes the representation* of the type to be verified, the reverse operation is always successful by `punsafeCoerce`. +This is why there is an instance for `PFrom` that always allows conversion to the "less lawful" type. + +There is also `PMaybeFrom` which allows conversion similary to `PTryFrom` but doesn't `perror` on failure but rather returns `PNothing` + ## Working with Types ### PInteger From 8f1c51f54e0cefd57f24ebe93dfe79755a7e86c0 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Mon, 7 Mar 2022 13:58:39 +0100 Subject: [PATCH 161/584] wip #303 - tracked attempts to write useful instances for PIsDataRepr - applied fixed requested by Las --- Plutarch/Api/V1/AssocMap.hs | 4 +- Plutarch/Api/V1/Value.hs | 9 +- Plutarch/TryFrom.hs | 107 +++++++++++++++------- plutarch-test/src/Plutarch/TryFromSpec.hs | 32 +++---- 4 files changed, 98 insertions(+), 54 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 33241e23e..fe822e3e7 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -70,7 +70,7 @@ instance PTryFrom (PBuiltinMap k v) (PMap k v) where type PTryFromExcess (PBuiltinMap k v) (PMap k v) = PUnit - ptryFrom oMap = do + ptryFrom oMap = runTermCont $ do sortVer <- tcont $ plet $ @@ -97,7 +97,7 @@ instance PMaybeFrom (PBuiltinMap k v) (PMap k v) where type PMaybeFromExcess (PBuiltinMap k v) (PMap k v) = PUnit - pmaybeFrom oMap = do + pmaybeFrom oMap = runTermCont $ do sortVer <- tcont $ plet $ diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 159b8aa6c..37daf0d4b 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -57,20 +57,19 @@ deriving via instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = PUnit - ptryFrom m = + ptryFrom m = runTermCont $ do let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) perror predOuter :: Term _ (PBuiltinPair (PAsData PCurrencySymbol) (PAsData (PMap PTokenName PInteger)) :--> PBool) predOuter = plam $ \tup -> pall # predInner # (pto $ pfromData $ psndBuiltin # tup) res :: Term _ PBool res = pall # predOuter # pto m - in do - _ <- tcont $ plet res - pure $ (pcon $ PValue m, pcon PUnit) + _ <- tcont $ plet res + pure $ (pcon $ PValue m, pcon PUnit) instance PMaybeFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where type PMaybeFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = PUnit - pmaybeFrom m = do + pmaybeFrom m = runTermCont $ do let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) (pcon PFalse) predOuter :: Term _ (PBuiltinPair (PAsData PCurrencySymbol) (PAsData (PMap PTokenName PInteger)) :--> PBool) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 519c32663..362f365e8 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -68,7 +68,7 @@ import Plutarch.List ( import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) import qualified PlutusCore as PLC -import Plutarch.TermCont (TermCont, tcont, unTermCont) +import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) ----------------------- The class PTryFrom ---------------------------------------------- @@ -97,7 +97,7 @@ import Plutarch.TermCont (TermCont, tcont, unTermCont) -} class PTryFrom (a :: PType) (b :: PType) where type PTryFromExcess a b :: PType - ptryFrom :: Term s a -> TermCont s (Term s b, Term s (PTryFromExcess a b)) + ptryFrom :: Term s a -> ((Term s b, Term s (PTryFromExcess a b)) -> Term s r) -> Term s r -- | this function is only used for `PFrom` and is not exported, -- it makes use of PTryFrom being a class that always recovers data @@ -108,23 +108,23 @@ class PTryFrom (a :: PType) (b :: PType) where instance PTryFrom PData (PAsData PInteger) where type PTryFromExcess PData (PAsData PInteger) = PInteger - ptryFrom opq = do + ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) pure $ (punsafeCoerce opq, ver) instance PTryFrom PData (PAsData PByteString) where type PTryFromExcess PData (PAsData PByteString) = PByteString - ptryFrom opq = do + ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) pure $ (punsafeCoerce opq, ver) instance PTryFrom PData PData where type PTryFromExcess PData PData = PUnit - ptryFrom opq = pure $ (opq, pcon PUnit) + ptryFrom opq = runTermCont $ pure $ (opq, pcon PUnit) instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) where type PTryFromExcess PData (PAsData (PBuiltinList PData)) = PBuiltinList PData - ptryFrom opq = do + ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasList # opq) pure $ (punsafeCoerce opq, ver) @@ -136,20 +136,20 @@ instance PTryFrom PData (PAsData (PBuiltinMap a b)) where type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = PBuiltinList (PBuiltinPair (PAsData a) (PAsData b)) - ptryFrom opq = do + ptryFrom opq = runTermCont $ do verMap <- tcont $ plet (pasMap # opq) -- I've not obtained a `PBuiltinList (PBuiltinPair a b)` let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) verifyPair = plam $ \tup -> unTermCont $ do - (verfst, _) <- ptryFrom @PData @(PAsData a) $ pfstBuiltin # tup - (versnd, _) <- ptryFrom @PData @(PAsData b) $ psndBuiltin # tup + (verfst, _) <- TermCont $ ptryFrom @PData @(PAsData a) $ pfstBuiltin # tup + (versnd, _) <- TermCont $ ptryFrom @PData @(PAsData b) $ psndBuiltin # tup pure $ ppairDataBuiltin # verfst # versnd ver <- tcont $ plet $ pmap # verifyPair # verMap pure (punsafeCoerce opq, ver) instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinMap POpaque POpaque)) where type PTryFromExcess PData (PAsData (PBuiltinMap POpaque POpaque)) = PBuiltinList (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) - ptryFrom opq = do + ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasMap # opq) pure $ (punsafeCoerce opq, punsafeCoerce ver) -- PAsData POpaque ~ PData @@ -162,17 +162,16 @@ instance PTryFrom PData (PAsData (PBuiltinList a)) where type PTryFromExcess PData (PAsData (PBuiltinList a)) = PBuiltinList a - ptryFrom opq = + ptryFrom opq = runTermCont $ do let lst :: Term _ (PBuiltinList a) lst = punsafeBuiltin PLC.UnListData # opq verify :: a ~ PAsData b => Term _ (PAsData b :--> a) verify = plam $ \e -> unTermCont $ do - (wrapped, _) <- ptryFrom @PData @a $ pforgetData e + (wrapped, _) <- TermCont $ ptryFrom @PData @a $ pforgetData e pure wrapped - in do - ver <- tcont $ plet $ pmap # verify # lst - pure $ (punsafeCoerce opq, ver) + ver <- tcont $ plet $ pmap # verify # lst + pure $ (punsafeCoerce opq, ver) instance {-# OVERLAPPABLE #-} @@ -186,12 +185,12 @@ instance PTryFrom PData (PAsData (PBuiltinPair a b)) where type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = PBuiltinPair a b - ptryFrom opq = do + ptryFrom opq = runTermCont $ do tup <- tcont $ plet (pfromData $ punsafeCoerce opq) let fst' :: Term _ a - fst' = unTermCont $ fst <$> (ptryFrom @PData @a $ pforgetData $ pfstBuiltin # tup) + fst' = unTermCont $ fst <$> TermCont (ptryFrom @PData @a $ pforgetData $ pfstBuiltin # tup) snd' :: Term _ b - snd' = unTermCont $ fst <$> (ptryFrom @PData @b $ pforgetData $ psndBuiltin # tup) + snd' = unTermCont $ fst <$> TermCont (ptryFrom @PData @b $ pforgetData $ psndBuiltin # tup) ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' pure $ (punsafeCoerce opq, ver) @@ -206,16 +205,16 @@ instance PTryFrom PData (PAsData (PDataRecord (x ': xs))) where type PTryFromExcess PData (PAsData (PDataRecord (x ': xs))) = PDataRecord (x ': xs) - ptryFrom opq = do + ptryFrom opq = runTermCont $ do lst <- tcont $ plet (pfromData @(PBuiltinList _) $ punsafeCoerce opq) let lsthead :: Term _ PData lsthead = phead # lst lsttail :: Term _ (PAsData (PBuiltinList PData)) lsttail = pdata $ ptail # lst verhead :: Term _ (PAsData b) - verhead = unTermCont $ fst <$> (ptryFrom @PData @(PAsData b) lsthead) + verhead = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData b) lsthead) vertail :: Term _ (PDataRecord xs) - vertail = unTermCont $ snd <$> (ptryFrom @PData @(PAsData (PDataRecord xs)) (pforgetData lsttail)) + vertail = unTermCont $ snd <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord xs)) (pforgetData lsttail)) ver <- tcont $ plet $ @@ -233,11 +232,11 @@ instance PTryFrom PData (PAsData (PDataRecord '[x])) where type PTryFromExcess PData (PAsData (PDataRecord '[x])) = PDataRecord '[x] - ptryFrom opq = do + ptryFrom opq = runTermCont $ do let lsthead :: Term _ PData lsthead = phead # (pfromData @(PBuiltinList _) $ punsafeCoerce opq) verhead :: Term _ (PAsData b) - verhead = unTermCont $ fst <$> (ptryFrom @PData @(PAsData b) lsthead) + verhead = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData b) lsthead) ver <- tcont $ plet $ @@ -269,7 +268,7 @@ instance (fromInteger n #== (pfstBuiltin # elem)) ( unTermCont $ do let rec = pdata $ psndBuiltin # elem - y <- snd <$> (ptryFrom @PData @(PAsData (PDataRecord x)) $ pforgetData rec) + y <- snd <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord x)) $ pforgetData rec) pure $ punsafeCoerce (y :: Term _ (PTryFromExcess PData (PAsData (PDataRecord x)))) ) (validateSum @(n + 1) @xs $ punsafeCoerce s) @@ -286,7 +285,7 @@ instance PTryFrom PData (PAsData (PDataSum ys)) where type PTryFromExcess PData (PAsData (PDataSum ys)) = PUnit - ptryFrom opq = do + ptryFrom opq = runTermCont $ do _ <- tcont $ plet $ validateSum @0 @ys opq pure (punsafeCoerce opq, pcon PUnit) @@ -306,10 +305,10 @@ instance PTryFrom POpaque a where type PTryFromExcess POpaque a = PAsData a - ptryFrom opq = do + ptryFrom opq = runTermCont $ do let prop :: Term _ a prop = punsafeCoerce opq - ver' <- fst <$> (ptryFrom @PData @(PAsData a) $ pforgetData $ pdata prop) + ver' <- fst <$> TermCont (ptryFrom @PData @(PAsData a) $ pforgetData $ pdata prop) ver <- tcont $ plet ver' pure $ (punsafeCoerce opq, ver) @@ -321,8 +320,8 @@ instance PTryFrom (PAsData a) (PAsData b) where type PTryFromExcess (PAsData a) (PAsData b) = PTryFromExcess a b - ptryFrom opq = do - ver' <- ptryFrom @a @b $ pfromData opq + ptryFrom opq = runTermCont $ do + ver' <- TermCont $ ptryFrom @a @b $ pfromData opq ver <- tcont $ plet $ snd ver' pure $ (punsafeCoerce opq, ver) @@ -335,7 +334,7 @@ instance type -} class PFrom a b where - pfrom :: Term s a -> TermCont s (Term s b) + pfrom :: Term s a -> (((Term s b) -> Term s r) -> Term s r) {- | This instance relies on all instances of `PTryFrom` being lawful @@ -346,10 +345,56 @@ instance ) => PFrom a b where + pfrom = runTermCont . pure . ptryFromInverse + +{- +-- My experimentations around adding `PIsDataRepr` to the +-- machinery + +type PFrom :: Constraint -> PType -> PType -> Constraint +class PFrom c a b where + pfrom :: c => Term s a -> TermCont s (Term s b) + +instance + {-# OVERLAPPABLE #-} + ( PTryFrom b a + ) => + PFrom a b + where + pfrom = pure . ptryFromInverse +instance + {-# OVERLAPPABLE #-} + ( PTryFrom PData (PAsData a) + , c ~ PInner a b + ) => + PTryFrom (PAsData a) c where + ptryFrom opq = do + let inner = pto opq + undefined + +instance + {-# OVERLAPPING #-} + forall a b c. + ( PlutusType b + , c ~ PInner a b + ) => + PFrom (PlutusType b) a c where + pfrom = pure . pto + +-- forall a b. newtype PTryFrom a b => TryFrommable b = MkTryFrommable b + +instance + {-# OVERLAPPABLE #-} + ( PFamFrom c b a + ) => + PFrom a b + where pfrom = pure . ptryFromInverse +-} + ----------------------- The class PMaybeFrom -------------------------------------------- class PMaybeFrom (a :: PType) (b :: PType) where type PMaybeFromExcess a b :: PType - pmaybeFrom :: Term s a -> TermCont s (Term s (PMaybe b), Term s (PMaybe (PMaybeFromExcess a b))) + pmaybeFrom :: Term s a -> (((Term s (PMaybe b), Term s (PMaybe (PMaybeFromExcess a b))) -> Term s r) -> Term s r) diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index 9c1d804bc..f5b1d097e 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -192,17 +192,17 @@ spec = do # (ppairDataBuiltin # (pdata $ pconstant 2) # (pdata $ pcon PUnit)) # pnil "valid0" - @| (unTermCont $ fst <$> ptryFrom @_ @(PMap PInteger PUnit) ms0) @-> psucceeds + @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) ms0)) @-> psucceeds "invalid1" - @| (unTermCont $ fst <$> ptryFrom @_ @(PMap PInteger PUnit) mf1) @-> pfails + @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) mf1)) @-> pfails "invalid2" - @| (unTermCont $ fst <$> ptryFrom @_ @(PMap PInteger PUnit) mf2) @-> pfails + @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) mf2)) @-> pfails "valid0maybe" - @| (unTermCont $ ((pfromMaybe #) . fst) <$> pmaybeFrom @_ @(PMap PInteger PUnit) ms0) @-> psucceeds + @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @_ @(PMap PInteger PUnit) ms0)) @-> psucceeds "invalid1maybe" - @| (unTermCont $ ((pfromMaybe #) . fst) <$> pmaybeFrom @_ @(PMap PInteger PUnit) mf1) @-> pfails + @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @_ @(PMap PInteger PUnit) mf1)) @-> pfails "invalid2maybe" - @| (unTermCont $ fst <$> ptryFrom @_ @(PMap PInteger PUnit) mf2) @-> pfails + @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) mf2)) @-> pfails "example" @\ do let validContext = ctx validList1 invalidContext = ctx invalidList1 @@ -233,7 +233,7 @@ checkDeep :: ) => ClosedTerm (PAsData actual) -> ClosedTerm (PAsData target) -checkDeep t = unTermCont $ fst <$> (ptryFrom $ pforgetData t) +checkDeep t = unTermCont $ fst <$> TermCont (ptryFrom $ pforgetData t) checkDeepUnwrap :: forall (target :: PType) (actual :: PType). @@ -243,7 +243,7 @@ checkDeepUnwrap :: ) => ClosedTerm (PAsData actual) -> ClosedTerm (PTryFromExcess PData (PAsData target)) -checkDeepUnwrap t = unTermCont $ snd <$> (ptryFrom @PData @(PAsData target) $ pforgetData t) +checkDeepUnwrap t = unTermCont $ snd <$> TermCont (ptryFrom @PData @(PAsData target) $ pforgetData t) sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1 .. 100] @@ -253,10 +253,10 @@ partialCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList PData)))) partialCheck = let dat :: Term _ PData dat = pforgetData sampleStructure - in unTermCont $ fst <$> (ptryFrom dat) + in unTermCont $ fst <$> TermCont (ptryFrom dat) fullCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) -fullCheck = unTermCont $ fst <$> (ptryFrom $ pforgetData sampleStructure) +fullCheck = unTermCont $ fst <$> TermCont (ptryFrom $ pforgetData sampleStructure) ------------------- Example: untrusted Redeemer ------------------------------------ @@ -269,16 +269,16 @@ pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (p instance PTryFrom PData (PAsData PNatural) where type PTryFromExcess PData (PAsData PNatural) = PNatural - ptryFrom opq = do - (wrapped, unwrapped) <- ptryFrom @PData @(PAsData PInteger) opq + ptryFrom opq = runTermCont $ do + (wrapped, unwrapped) <- TermCont $ ptryFrom @PData @(PAsData PInteger) opq ver <- tcont $ plet $ pmkNatural # unwrapped pure $ (punsafeCoerce wrapped, ver) validator :: Term s PValidator validator = phoistAcyclic $ plam $ \dat red ctx -> unTermCont $ do - (_, trustedRedeemer) <- ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red - (_, trustedDatum) <- (ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) dat) + (_, trustedRedeemer) <- TermCont $ ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red + (_, trustedDatum) <- TermCont (ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) dat) -- make the Datum and Redeemer trusted let ownHash :: Term _ PDatumHash @@ -393,12 +393,12 @@ toDatadList = pdata . (foldr go pnil) mapTestSucceeds :: ClosedTerm (PAsData (PBuiltinMap PByteString PInteger)) mapTestSucceeds = unTermCont $ do - (val, _) <- ptryFrom @PData $ pforgetData sampleMap + (val, _) <- TermCont $ ptryFrom @PData $ pforgetData sampleMap pure val mapTestFails :: ClosedTerm (PAsData (PBuiltinMap PInteger PInteger)) mapTestFails = unTermCont $ do - (val, _) <- ptryFrom @PData $ pforgetData sampleMap + (val, _) <- TermCont $ ptryFrom @PData $ pforgetData sampleMap pure val sampleMap :: Term _ (PAsData (PBuiltinMap PByteString PInteger)) From 59dc16a0567966da1376b7d9d0e32448f7afc6fa Mon Sep 17 00:00:00 2001 From: gnumonik Date: Mon, 7 Mar 2022 13:31:41 +0000 Subject: [PATCH 162/584] Updated PDataSum to be a real newtype over DRec, added DRec, refactored pcon' method to use punsafeCoerce/pconstrBuiltin --- Plutarch/DataRepr/Internal.hs | 110 +++++++++++++++++----------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 9ed9e80a3..1d4fa9ef6 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -33,7 +33,7 @@ import GHC.TypeLits ( Symbol, TypeError, natVal, - type (+) + type (+), ) import Generics.SOP ( All, @@ -41,11 +41,13 @@ import Generics.SOP ( AllZipN, Code, Generic, - I (I), + I (..), K (K), LiftedCoercible, NP (Nil, (:*)), + NS (..), POP, + SList (..), SListI, SOP (SOP), from, @@ -53,10 +55,9 @@ import Generics.SOP ( hcollapse, hfromI, hindex, - to, - I(..), + lengthSList, sList, - SList(..), lengthSList + to, ) import Plutarch ( Dig, @@ -95,14 +96,13 @@ import Plutarch.Builtin ( import Plutarch.DataRepr.Internal.Generic (MkSum (mkSum)) import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) import Plutarch.Integer (PInteger) -import Plutarch.Internal (S (SI), punsafeBuiltin) +import Plutarch.Internal (S (SI)) import Plutarch.Internal.TypeFamily (ToPType2) import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) import Plutarch.Unsafe (punsafeCoerce) import qualified Plutus.V1.Ledger.Api as Ledger -import qualified PlutusCore as PLC {- | A "record" of `exists a. PAsData a`. The underlying representation is `PBuiltinList PData`. @@ -183,56 +183,57 @@ type family PUnLabel (a :: PLabeledType) :: PType where This is how most data structures are stored on-chain. -} -type PDataSum :: [[PLabeledType]] -> PType -data PDataSum (defs :: [[PLabeledType]]) (s :: S) where - DSZ :: (forall {out :: PType}. (Term s (PDataRecord x) -> Term s out) -> Term s out) - -> PDataSum (x ': xs) s +newtype DRec s x = DRec (forall {out :: PType}. ((Term s (PDataRecord x) -> Term s out) -> Term s out)) - DSS :: PDataSum xs s -> PDataSum (x ': xs) s +type PDataSum :: [[PLabeledType]] -> PType +newtype PDataSum defs s = PDataSum (NS (DRec s) defs) -- the length functions in sop-core gives the actual length, we want length-1 -adjustedLength :: forall x xs proxy. SListI (x:xs) => proxy (x:xs) -> Integer -adjustedLength proxy = fromIntegral (lengthSList proxy) - 1 - -instance SListI (def:defs) => PlutusType (PDataSum (def:defs)) where - type PInner (PDataSum (def:defs)) _ = PData - - pcon' :: forall - {s :: S} - {b :: PType} - . PDataSum (def:defs) s - -> Term s (PInner (PDataSum (def:defs)) b) - pcon' = \case - DSZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(def:defs)) # (f id) -- rewrite this with pconstrBuiltin? - DSS rest -> case rest of - DSZ f -> punsafeBuiltin PLC.ConstrData # (pconstant @PInteger $ adjustedLength $ Proxy @(defs)) # (f id) - dss@(DSS _) -> pcon' dss - - pmatch' :: forall - {s :: S} - {b :: PType} - . Term s (PInner (PDataSum (def:defs)) b) - -> (PDataSum (def:defs) s -> Term s b) - -> Term s b - pmatch' d f = +adjustedLength :: forall x xs proxy. SListI (x : xs) => proxy (x : xs) -> Integer +adjustedLength proxy = fromIntegral (lengthSList proxy) - 1 + +instance SListI (def : defs) => PlutusType (PDataSum (def : defs)) where + type PInner (PDataSum (def : defs)) _ = PData + pcon' :: + forall + {s :: S} + {b :: PType}. + PDataSum (def : defs) s -> + Term s (PInner (PDataSum (def : defs)) b) + pcon' (PDataSum xss) = case xss of + Z (DRec f) -> punsafeCoerce $ pconstrBuiltin # (pconstant @PInteger $ adjustedLength $ Proxy @(def : defs)) # (punsafeCoerce $ f id) + S rest -> case rest of + Z (DRec f) -> punsafeCoerce $ pconstrBuiltin # (pconstant @PInteger $ adjustedLength $ Proxy @defs) # (punsafeCoerce $ f $ id) + dss@(S _) -> pcon' (PDataSum dss) + + pmatch' :: + forall + {s :: S} + {b :: PType}. + Term s (PInner (PDataSum (def : defs)) b) -> + (PDataSum (def : defs) s -> Term s b) -> + Term s b + pmatch' d f = plet (pasConstr #$ pforgetData $ pdata d) $ \d' -> - plet (pfstBuiltin # d') $ \constr -> - plet (psndBuiltin # d') $ \args -> - go constr args sList f - where - go :: forall {d :: [PLabeledType]} {ds :: [[PLabeledType]]} - . Term s PInteger -- the index of the constructor in the sum - -> Term s (PBuiltinList PData) -- the inner representation of the record at the index of the first argument - -> SList (d:ds) -- a GADT which represents the structure of the sum (can't construct it w/o this) - -> (PDataSum (d:ds) s -> Term s b) -- an accumulator function. represents an empty "left-hand side" of the sum - -> Term s b - go constr args SCons g = - case sList @ds of - SNil -> g $ DSZ $ \k -> k $ punsafeCoerce args - rest@SCons -> - pif (constr #== pconstant (adjustedLength $ Proxy @(d:ds))) -- if the index of the constructor matches the size of the sum - (g $ DSZ (\k -> k $ punsafeCoerce args)) -- then cons an injection (which contains an element) onto an empty tail, and append the empty left hand side at the front - (go constr args rest (g . DSS)) -- else recurse, "moving the accumulator forward by one" + plet (pfstBuiltin # d') $ \constr -> + plet (psndBuiltin # d') $ \args -> + go constr args sList (f . PDataSum) + where + go :: + forall {d :: [PLabeledType]} {ds :: [[PLabeledType]]}. + Term s PInteger -> + Term s (PBuiltinList PData) -> + SList (d : ds) -> + (NS (DRec s) (d : ds) -> Term s b) -> + Term s b + go constr args SCons g = + case sList @ds of + SNil -> g . Z $ DRec (\k -> k $ punsafeCoerce args) + rest@SCons -> + pif + (constr #== pconstant (adjustedLength $ Proxy @(d : ds))) + (g . Z $ DRec (\k -> k $ punsafeCoerce args)) + (go constr args rest (g . S)) instance PIsData (PDataSum defs) where pdata = punsafeCoerce @@ -280,7 +281,7 @@ pmatchDataSum d handlers = plet (pfstBuiltin # d') $ \constr -> plet (psndBuiltin # d') $ \args -> let handlers' = applyHandlers args handlers - in runTermCont (findCommon handlers') $ \common -> + in runTermCont (findCommon handlers') $ \common -> go common 0 @@ -433,4 +434,3 @@ class IsBuiltinList a where instance IsBuiltinList (PDataRecord l) where dataListFrom = punsafeCoerce - From 34bfad292528bf25a17471af8e3a8a2092594e2e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 3 Mar 2022 16:22:36 -0500 Subject: [PATCH 163/584] Add PShow, gpeq; derive a handful --- Plutarch/Bool.hs | 1 + Plutarch/Either.hs | 5 +- Plutarch/Maybe.hs | 5 +- Plutarch/Show.hs | 143 ++++++++++++++++++++ Plutarch/Unit.hs | 9 +- plutarch-test/goldens/show.bench.golden | 13 ++ plutarch-test/goldens/show.uplc.eval.golden | 13 ++ plutarch-test/goldens/show.uplc.golden | 13 ++ plutarch-test/plutarch-test.cabal | 1 + plutarch-test/src/Plutarch/ShowSpec.hs | 38 ++++++ plutarch.cabal | 1 + 11 files changed, 237 insertions(+), 5 deletions(-) create mode 100644 Plutarch/Show.hs create mode 100644 plutarch-test/goldens/show.bench.golden create mode 100644 plutarch-test/goldens/show.uplc.eval.golden create mode 100644 plutarch-test/goldens/show.uplc.golden create mode 100644 plutarch-test/src/Plutarch/ShowSpec.hs diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 62819836d..b50d31d11 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -61,6 +61,7 @@ import qualified PlutusCore as PLC -- | Plutus 'BuiltinBool' data PBool (s :: S) = PTrue | PFalse + deriving stock (Show) instance PUnsafeLiftDecl PBool where type PLifted PBool = Bool deriving via (DerivePConstantDirect Bool PBool) instance (PConstant Bool) diff --git a/Plutarch/Either.hs b/Plutarch/Either.hs index 74c280a57..d7cb4ffc8 100644 --- a/Plutarch/Either.hs +++ b/Plutarch/Either.hs @@ -1,12 +1,13 @@ module Plutarch.Either (PEither (..)) where import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +import Generics.SOP (Generic, HasDatatypeInfo, I (I)) import Plutarch (PType, PlutusType, S, Term) import Plutarch.Bool (PEq) +import Plutarch.Show (PShow) data PEither (a :: PType) (b :: PType) (s :: S) = PLeft (Term s a) | PRight (Term s b) deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType, PEq) + deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) diff --git a/Plutarch/Maybe.hs b/Plutarch/Maybe.hs index 4a45a4b46..49ebfd199 100644 --- a/Plutarch/Maybe.hs +++ b/Plutarch/Maybe.hs @@ -1,7 +1,7 @@ module Plutarch.Maybe (PMaybe (..)) where import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +import Generics.SOP (Generic, HasDatatypeInfo, I (I)) import Plutarch ( PType, PlutusType, @@ -9,10 +9,11 @@ import Plutarch ( Term, ) import Plutarch.Bool (PEq) +import Plutarch.Show (PShow) -- | Plutus Maybe type, with Scott-encoded repr data PMaybe (a :: PType) (s :: S) = PJust (Term s a) | PNothing deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType, PEq) + deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs new file mode 100644 index 000000000..0c114f1ab --- /dev/null +++ b/Plutarch/Show.hs @@ -0,0 +1,143 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE DefaultSignatures #-} + +module Plutarch.Show ( + PShow (pshow'), + pshow, +) where + +import Data.List.NonEmpty (NonEmpty ((:|))) +import qualified Data.List.NonEmpty as NE +import Data.Semigroup (sconcat) +import Data.String (IsString (fromString)) +import qualified Data.Text as T +import Generics.SOP ( + All, + All2, + ConstructorName, + HasDatatypeInfo, + K (K), + NP, + NS, + Proxy (Proxy), + SOP (SOP), + constructorInfo, + constructorName, + datatypeInfo, + hcmap, + hcollapse, + hindex, + hmap, + ) +import Plutarch.Bool (PBool, PEq ((#==)), POrd ((#<)), pif) +import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) +import Plutarch.Internal (punsafeAsClosedTerm) +import Plutarch.Internal.Generic (PCode, PGeneric, pfrom) +import Plutarch.Internal.Other ( + PlutusType, + Term, + perror, + pfix, + phoistAcyclic, + plam, + plet, + pmatch, + (#), + (#$), + type (:-->), + ) +import Plutarch.Lift (pconstant) +import Plutarch.String (PString) + +class PShow t where + -- | Return the string representation of a Plutarch value + -- + -- If the wrap argument is True, optionally wrap the output in `(..)` if it + -- represents multiple parameters. + pshow' :: Bool -> Term s t -> Term s PString + default pshow' :: (PGeneric s t, PlutusType t, HasDatatypeInfo (t s), All2 PShow (PCode s t)) => Bool -> Term s t -> Term s PString + pshow' wrap x = gpshow wrap # x + +-- | Return the string representation of a Plutarch value +pshow :: PShow a => Term s a -> Term s PString +pshow = pshow' False + +instance PShow PString where + -- FIXME: We ideally want to wrap the string in quotes, and escape it + -- appropriately just like Haskell's Show instance. However, there appears to + -- be no way to do this using Plutus' builtins. So we will just return the + -- string as is. + pshow' _ = id + +instance PShow PBool where + pshow' _ x = pmatch x (pconstant @PString . T.pack . show) + +instance PShow PInteger where + pshow' _ x = pshowInt # x + where + pshowInt = phoistAcyclic $ + pfix #$ plam $ \self n -> + let sign = pif (n #< 0) "-" "" + in sign + <> ( plet (pquot # abs n # 10) $ \q -> + plet (prem # abs n # 10) $ \r -> + pif + (q #== 0) + (pshowDigit # r) + ( plet (self # q) $ \prefix -> + prefix <> pshowDigit # r + ) + ) + pshowDigit :: Term s (PInteger :--> PString) + pshowDigit = phoistAcyclic $ + plam $ \digit -> + pcase perror digit $ + flip fmap [0 .. 9] $ \(x :: Integer) -> + (pconstant x, pconstant (T.pack . show $ x)) + pcase :: PEq a => Term s b -> Term s a -> [(Term s a, Term s b)] -> Term s b + pcase otherwise x = \case + [] -> otherwise + ((x', r) : cs) -> pif (x #== x') r $ pcase otherwise x cs + +-- | Generic version of `pshow` +gpshow :: + forall a s. + (PGeneric s a, HasDatatypeInfo (a s), PlutusType a, All2 PShow (PCode s a)) => + Bool -> + Term s (a :--> PString) +gpshow wrap = + phoistAcyclic $ + punsafeAsClosedTerm @s $ + plam $ \x -> + pmatch x $ \x' -> + productGroup wrap " " $ gpshow' @a (pfrom x') + +-- | Like `gpshow`, but returns the individual parameters list +gpshow' :: + forall a s. + (PGeneric s a, HasDatatypeInfo (a s), All2 PShow (PCode s a)) => + SOP (Term s) (PCode s a) -> + NonEmpty (Term s PString) +gpshow' (SOP x) = + let cName = constructorNames !! hindex x + in pconstant @PString (T.pack cName) :| showSum x + where + constructorNames :: [ConstructorName] = + hcollapse $ hmap (K . constructorName) $ constructorInfo $ datatypeInfo (Proxy @(a s)) + showSum :: NS (NP (Term s)) (PCode s a) -> [Term s PString] + showSum = + hcollapse . hcmap (Proxy @(All PShow)) showProd + showProd :: All PShow xs => NP (Term s) xs -> K [Term s PString] xs + showProd = + K . hcollapse . hcmap (Proxy @PShow) showTerm + showTerm :: forall b. PShow b => Term s b -> K (Term s PString) b + showTerm = + K . pshow' True + +-- | Group parameters list, preparing for final PShow output +productGroup :: (Monoid a, IsString a) => Bool -> a -> NonEmpty a -> a +productGroup wrap sep = \case + x :| [] -> x + xs -> + let xs' = sconcat $ NE.intersperse sep xs + in if wrap then fromString "(" <> xs' <> fromString ")" else xs' diff --git a/Plutarch/Unit.hs b/Plutarch/Unit.hs index 8b5f2df36..da6340124 100644 --- a/Plutarch/Unit.hs +++ b/Plutarch/Unit.hs @@ -3,7 +3,8 @@ module Plutarch.Unit (PUnit (..)) where -import Plutarch (PlutusType (PInner, pcon', pmatch'), Term, pcon) +import qualified Data.Text as T +import Plutarch (PlutusType (PInner, pcon', pmatch'), Term, pcon, pmatch) import Plutarch.Bool (PBool (PFalse, PTrue), PEq, POrd, (#<), (#<=), (#==)) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), @@ -12,8 +13,11 @@ import Plutarch.Lift ( PUnsafeLiftDecl, pconstant, ) +import Plutarch.Show (PShow (pshow')) data PUnit s = PUnit + deriving stock (Show) + instance PUnsafeLiftDecl PUnit where type PLifted PUnit = () deriving via (DerivePConstantDirect () PUnit) instance (PConstant ()) @@ -34,3 +38,6 @@ instance Semigroup (Term s PUnit) where instance Monoid (Term s PUnit) where mempty = pcon PUnit + +instance PShow PUnit where + pshow' _ = flip pmatch $ pconstant . T.pack . show diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden new file mode 100644 index 000000000..dbaa223ad --- /dev/null +++ b/plutarch-test/goldens/show.bench.golden @@ -0,0 +1,13 @@ +int.0 {"exBudgetCPU":6284427,"exBudgetMemory":14017,"scriptSizeBytes":317} +int.5 {"exBudgetCPU":8760152,"exBudgetMemory":20027,"scriptSizeBytes":317} +int.-5 {"exBudgetCPU":9393754,"exBudgetMemory":20832,"scriptSizeBytes":317} +int.10 {"exBudgetCPU":12293936,"exBudgetMemory":26039,"scriptSizeBytes":317} +int.-10 {"exBudgetCPU":12927538,"exBudgetMemory":26844,"scriptSizeBytes":317} +int.14 {"exBudgetCPU":14274516,"exBudgetMemory":30847,"scriptSizeBytes":317} +int.-14 {"exBudgetCPU":14908118,"exBudgetMemory":31652,"scriptSizeBytes":317} +int.102 {"exBudgetCPU":18800590,"exBudgetMemory":39265,"scriptSizeBytes":318} +int.-102 {"exBudgetCPU":19434192,"exBudgetMemory":40070,"scriptSizeBytes":318} +maybe.nothing {"exBudgetCPU":1458977,"exBudgetMemory":5000,"scriptSizeBytes":354} +maybe.just {"exBudgetCPU":15676121,"exBudgetMemory":34060,"scriptSizeBytes":356} +either.right {"exBudgetCPU":15766440,"exBudgetMemory":34361,"scriptSizeBytes":373} +maybe.either {"exBudgetCPU":17334403,"exBudgetMemory":37506,"scriptSizeBytes":434} \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden new file mode 100644 index 000000000..b8bd9617d --- /dev/null +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -0,0 +1,13 @@ +int.0 (program 1.0.0 "0") +int.5 (program 1.0.0 "5") +int.-5 (program 1.0.0 "-5") +int.10 (program 1.0.0 "10") +int.-10 (program 1.0.0 "-10") +int.14 (program 1.0.0 "14") +int.-14 (program 1.0.0 "-14") +int.102 (program 1.0.0 "102") +int.-102 (program 1.0.0 "-102") +maybe.nothing (program 1.0.0 "PNothing") +maybe.just (program 1.0.0 "PJust 42") +either.right (program 1.0.0 "PRight 42") +maybe.either (program 1.0.0 "PJust (PLeft 42)") \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden new file mode 100644 index 000000000..3b5ef7864 --- /dev/null +++ b/plutarch-test/goldens/show.uplc.golden @@ -0,0 +1,13 @@ +int.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 0) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.-5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 10) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.-10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -10) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 14) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.-14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -14) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.-102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +maybe.nothing (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> force i1)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +maybe.just (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> i2 42)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "PUnit")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +maybe.either (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString i16 (i1 (\i0 -> appendString i16 (appendString (appendString "PLeft" (appendString i17 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) i18)) (\i0 -> appendString i16 (appendString (appendString "PRight" (appendString i17 "PUnit")) i18))))) (delay "PNothing")) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i2 42))) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "(") " ") ")")) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 3a57c37ea..2376d7c78 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -133,6 +133,7 @@ executable plutarch-test Plutarch.RationalSpec Plutarch.RecursionSpec Plutarch.ScriptsSpec + Plutarch.ShowSpec Plutarch.StringSpec Plutarch.Test Plutarch.Test.Benchmark diff --git a/plutarch-test/src/Plutarch/ShowSpec.hs b/plutarch-test/src/Plutarch/ShowSpec.hs new file mode 100644 index 000000000..5bcb43177 --- /dev/null +++ b/plutarch-test/src/Plutarch/ShowSpec.hs @@ -0,0 +1,38 @@ +module Plutarch.ShowSpec (spec) where + +import Control.Monad (forM_) +import Data.String (IsString (fromString)) +import qualified Data.Text as T +import Test.Syd + +import Plutarch.Prelude +import Plutarch.Show +import Plutarch.Test + +spec :: Spec +spec = do + describe "show" . pgoldenSpec $ do + "int" @\ do + "0" @| pshow (pconstant @PInteger 0) @== pconstant @PString "0" + forM_ [5, 10, 14, 102] $ \n -> do + (fromString $ show n) + @| pshow (pconstant @PInteger n) + @== pconstant (T.pack $ show n) + (fromString $ show (-n)) + @| pshow (pconstant @PInteger (-n)) + @== pconstant (T.pack $ show (-n)) + "maybe" @\ do + "nothing" + @| pshow @(PMaybe PInteger) (pcon PNothing) + @== pconstant @PString "PNothing" + "just" + @| pshow @(PMaybe PInteger) (pcon $ PJust $ pconstant @PInteger 42) + @== pconstant @PString "PJust 42" + "either" @\ do + "right" + @| pshow (pcon @(PEither PUnit PInteger) $ PRight 42) + @== pconstant @PString "PRight 42" + -- Test automatic injection of `(..)`. + "maybe.either" + @| pshow (pcon $ PJust $ pcon @(PEither PInteger PUnit) $ PLeft 42) + @== pconstant @PString "PJust (PLeft 42)" diff --git a/plutarch.cabal b/plutarch.cabal index ff2efe4d8..3b57522bb 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -121,6 +121,7 @@ library Plutarch.Rational Plutarch.Rec Plutarch.Rec.TH + Plutarch.Show Plutarch.String Plutarch.TermCont Plutarch.Trace From df36cfdb1651cf581210efd8703bcb2b74e36059 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 7 Mar 2022 16:15:02 -0500 Subject: [PATCH 164/584] Derive PShow for lists --- Plutarch/Builtin.hs | 6 +++++- Plutarch/List.hs | 24 +++++++++++++++++++++ plutarch-test/goldens/show.bench.golden | 7 +++++- plutarch-test/goldens/show.uplc.eval.golden | 7 +++++- plutarch-test/goldens/show.uplc.golden | 7 +++++- plutarch-test/src/Plutarch/ListSpec.hs | 2 +- plutarch-test/src/Plutarch/ShowSpec.hs | 21 +++++++++++++----- 7 files changed, 64 insertions(+), 10 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 59d07cfe8..c044b9a7f 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -63,7 +63,8 @@ import Plutarch.Lift ( pconstantFromRepr, pconstantToRepr, ) -import Plutarch.List (PListLike (..), plistEquals) +import Plutarch.List (PListLike (..), plistEquals, pshowList) +import Plutarch.Show (PShow (pshow')) import Plutarch.Unit (PUnit) import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce, punsafeFrom) import qualified PlutusCore as PLC @@ -104,6 +105,9 @@ data PBuiltinList (a :: PType) (s :: S) = PCons (Term s a) (Term s (PBuiltinList a)) | PNil +instance (PShow a, PUnsafeLiftDecl a) => PShow (PBuiltinList a) where + pshow' _ x = pshowList @PBuiltinList @a # x + pheadBuiltin :: Term s (PBuiltinList a :--> a) pheadBuiltin = phoistAcyclic $ pforce $ punsafeBuiltin PLC.HeadList diff --git a/Plutarch/List.hs b/Plutarch/List.hs index 92f762af5..977540017 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -4,6 +4,7 @@ module Plutarch.List ( PListLike (..), PIsListLike, pconvertLists, + pshowList, -- * Comparison plistEquals, @@ -72,8 +73,10 @@ import Plutarch.Integer (PInteger) import Plutarch.Lift (pconstant) import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Pair (PPair (PPair)) +import Plutarch.String (PString) import Data.Kind +import Plutarch.Show (PShow (pshow'), pshow) data PList (a :: PType) (s :: S) = PSCons (Term s a) (Term s (PList a)) @@ -81,6 +84,27 @@ data PList (a :: PType) (s :: S) deriving stock (GHC.Generic) deriving anyclass (Generic, PlutusType) +instance PShow a => PShow (PList a) where + pshow' _ x = pshowList @PList @a # x + +pshowList :: forall list a s. (PShow a, PIsListLike list a) => Term s (list a :--> PString) +pshowList = + phoistAcyclic $ + plam $ \list -> + "[" <> pshowList' @list @a # list <> "]" + +pshowList' :: forall list a s. (PShow a, PIsListLike list a) => Term s (list a :--> PString) +pshowList' = + phoistAcyclic $ + precList + ( \self x xs -> + pelimList + (\_ _ -> pshow x <> ", " <> self # xs) + (pshow x) + xs + ) + (\_self -> "") + instance PEq a => PEq (PList a) where (#==) xs ys = plistEquals # xs # ys diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index dbaa223ad..21bea5049 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -10,4 +10,9 @@ int.-102 {"exBudgetCPU":19434192,"exBudgetMemory":40070,"scriptSizeBytes":318} maybe.nothing {"exBudgetCPU":1458977,"exBudgetMemory":5000,"scriptSizeBytes":354} maybe.just {"exBudgetCPU":15676121,"exBudgetMemory":34060,"scriptSizeBytes":356} either.right {"exBudgetCPU":15766440,"exBudgetMemory":34361,"scriptSizeBytes":373} -maybe.either {"exBudgetCPU":17334403,"exBudgetMemory":37506,"scriptSizeBytes":434} \ No newline at end of file +maybe.either {"exBudgetCPU":17334403,"exBudgetMemory":37506,"scriptSizeBytes":434} +list.nil {"exBudgetCPU":3787676,"exBudgetMemory":11335,"scriptSizeBytes":410} +list.1 {"exBudgetCPU":10989375,"exBudgetMemory":26452,"scriptSizeBytes":411} +list.1,2,3 {"exBudgetCPU":29411680,"exBudgetMemory":66720,"scriptSizeBytes":413} +builtinlist.nil {"exBudgetCPU":3519719,"exBudgetMemory":10435,"scriptSizeBytes":401} +builtinlist.1,2,3 {"exBudgetCPU":26855742,"exBudgetMemory":56248,"scriptSizeBytes":404} \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden index b8bd9617d..bcc35922c 100644 --- a/plutarch-test/goldens/show.uplc.eval.golden +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -10,4 +10,9 @@ int.-102 (program 1.0.0 "-102") maybe.nothing (program 1.0.0 "PNothing") maybe.just (program 1.0.0 "PJust 42") either.right (program 1.0.0 "PRight 42") -maybe.either (program 1.0.0 "PJust (PLeft 42)") \ No newline at end of file +maybe.either (program 1.0.0 "PJust (PLeft 42)") +list.nil (program 1.0.0 "[]") +list.1 (program 1.0.0 "[1]") +list.1,2,3 (program 1.0.0 "[1, 2, 3]") +builtinlist.nil (program 1.0.0 "[]") +builtinlist.1,2,3 (program 1.0.0 "[1, 2, 3]") \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index 3b5ef7864..880d6ba23 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -10,4 +10,9 @@ int.-102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> maybe.nothing (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> force i1)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) maybe.just (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> i2 42)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "PUnit")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -maybe.either (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString i16 (i1 (\i0 -> appendString i16 (appendString (appendString "PLeft" (appendString i17 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) i18)) (\i0 -> appendString i16 (appendString (appendString "PRight" (appendString i17 "PUnit")) i18))))) (delay "PNothing")) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i2 42))) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "(") " ") ")")) \ No newline at end of file +maybe.either (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString i16 (i1 (\i0 -> appendString i16 (appendString (appendString "PLeft" (appendString i17 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) i18)) (\i0 -> appendString i16 (appendString (appendString "PRight" (appendString i17 "PUnit")) i18))))) (delay "PNothing")) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i2 42))) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "(") " ") ")")) +list.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +list.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) []) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) +builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ListSpec.hs b/plutarch-test/src/Plutarch/ListSpec.hs index f7a61d75c..30149f4e3 100644 --- a/plutarch-test/src/Plutarch/ListSpec.hs +++ b/plutarch-test/src/Plutarch/ListSpec.hs @@ -1,4 +1,4 @@ -module Plutarch.ListSpec (spec) where +module Plutarch.ListSpec (spec, integerList) where import Test.Syd diff --git a/plutarch-test/src/Plutarch/ShowSpec.hs b/plutarch-test/src/Plutarch/ShowSpec.hs index 5bcb43177..75b388e91 100644 --- a/plutarch-test/src/Plutarch/ShowSpec.hs +++ b/plutarch-test/src/Plutarch/ShowSpec.hs @@ -5,6 +5,7 @@ import Data.String (IsString (fromString)) import qualified Data.Text as T import Test.Syd +import Plutarch.ListSpec (integerList) import Plutarch.Prelude import Plutarch.Show import Plutarch.Test @@ -12,8 +13,9 @@ import Plutarch.Test spec :: Spec spec = do describe "show" . pgoldenSpec $ do + let str x = pconstant @PString x "int" @\ do - "0" @| pshow (pconstant @PInteger 0) @== pconstant @PString "0" + "0" @| pshow (pconstant @PInteger 0) @== str "0" forM_ [5, 10, 14, 102] $ \n -> do (fromString $ show n) @| pshow (pconstant @PInteger n) @@ -24,15 +26,24 @@ spec = do "maybe" @\ do "nothing" @| pshow @(PMaybe PInteger) (pcon PNothing) - @== pconstant @PString "PNothing" + @== str "PNothing" "just" @| pshow @(PMaybe PInteger) (pcon $ PJust $ pconstant @PInteger 42) - @== pconstant @PString "PJust 42" + @== str "PJust 42" "either" @\ do "right" @| pshow (pcon @(PEither PUnit PInteger) $ PRight 42) - @== pconstant @PString "PRight 42" + @== str "PRight 42" -- Test automatic injection of `(..)`. "maybe.either" @| pshow (pcon $ PJust $ pcon @(PEither PInteger PUnit) $ PLeft 42) - @== pconstant @PString "PJust (PLeft 42)" + @== str "PJust (PLeft 42)" + "list" @\ do + "nil" @| pshow (integerList []) @== str "[]" + "1" @| pshow (integerList [1]) @== str "[1]" + "1,2,3" @| pshow (integerList [1, 2, 3]) @== str "[1, 2, 3]" + "builtinlist" @\ do + let xs3 = pconstant @(PBuiltinList PInteger) [1, 2, 3] + xs0 = pconstant @(PBuiltinList PInteger) [] + "nil" @| pshow xs0 @== str "[]" + "1,2,3" @| pshow xs3 @== str "[1, 2, 3]" From e2355f9c47ae0dbab1a9efcf5e59483d653b07ac Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 7 Mar 2022 16:15:18 -0500 Subject: [PATCH 165/584] Derive PShow for PPair --- Plutarch/Pair.hs | 5 +++-- plutarch-test/goldens/show.bench.golden | 4 +++- plutarch-test/goldens/show.uplc.eval.golden | 4 +++- plutarch-test/goldens/show.uplc.golden | 4 +++- plutarch-test/src/Plutarch/ShowSpec.hs | 7 +++++++ 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Plutarch/Pair.hs b/Plutarch/Pair.hs index e9fbd7d97..6c696b509 100644 --- a/Plutarch/Pair.hs +++ b/Plutarch/Pair.hs @@ -1,9 +1,10 @@ module Plutarch.Pair (PPair (..)) where import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +import Generics.SOP (Generic, HasDatatypeInfo, I (I)) import Plutarch.Bool (PEq) import Plutarch.Internal.Other (PType, PlutusType, S, Term) +import Plutarch.Show (PShow) {- | Plutus encoding of Pairs. @@ -13,4 +14,4 @@ import Plutarch.Internal.Other (PType, PlutusType, S, Term) data PPair (a :: PType) (b :: PType) (s :: S) = PPair (Term s a) (Term s b) deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType, PEq) + deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index 21bea5049..a29a79567 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -15,4 +15,6 @@ list.nil {"exBudgetCPU":3787676,"exBudgetMemory":11335,"scriptSizeBytes":410} list.1 {"exBudgetCPU":10989375,"exBudgetMemory":26452,"scriptSizeBytes":411} list.1,2,3 {"exBudgetCPU":29411680,"exBudgetMemory":66720,"scriptSizeBytes":413} builtinlist.nil {"exBudgetCPU":3519719,"exBudgetMemory":10435,"scriptSizeBytes":401} -builtinlist.1,2,3 {"exBudgetCPU":26855742,"exBudgetMemory":56248,"scriptSizeBytes":404} \ No newline at end of file +builtinlist.1,2,3 {"exBudgetCPU":26855742,"exBudgetMemory":56248,"scriptSizeBytes":404} +pair.int-str {"exBudgetCPU":16329624,"exBudgetMemory":35186,"scriptSizeBytes":365} +pair.int-list {"exBudgetCPU":41712616,"exBudgetMemory":86350,"scriptSizeBytes":443} \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden index bcc35922c..94472dcfc 100644 --- a/plutarch-test/goldens/show.uplc.eval.golden +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -15,4 +15,6 @@ list.nil (program 1.0.0 "[]") list.1 (program 1.0.0 "[1]") list.1,2,3 (program 1.0.0 "[1, 2, 3]") builtinlist.nil (program 1.0.0 "[]") -builtinlist.1,2,3 (program 1.0.0 "[1, 2, 3]") \ No newline at end of file +builtinlist.1,2,3 (program 1.0.0 "[1, 2, 3]") +pair.int-str (program 1.0.0 "PPair 42 hello") +pair.int-list (program 1.0.0 "PPair 42 [1, 2, 3]") \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index 880d6ba23..26e0de41b 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -15,4 +15,6 @@ list.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> list.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) []) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) -builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) \ No newline at end of file +builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) +pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i16 (appendString ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i2) (appendString i16 i1))))) (\i0 -> i1 42 "hello")) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) " ")) +pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i25 i2))) (delay (appendString (i9 (i25 i2)) (appendString ", " (i3 (i26 i2))))))) (i25 i1))))) i1) "]"))))))) (\i0 -> i1 42 [1,2,3])) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ShowSpec.hs b/plutarch-test/src/Plutarch/ShowSpec.hs index 75b388e91..c82848129 100644 --- a/plutarch-test/src/Plutarch/ShowSpec.hs +++ b/plutarch-test/src/Plutarch/ShowSpec.hs @@ -47,3 +47,10 @@ spec = do xs0 = pconstant @(PBuiltinList PInteger) [] "nil" @| pshow xs0 @== str "[]" "1,2,3" @| pshow xs3 @== str "[1, 2, 3]" + "pair" @\ do + "int-str" + @| pshow (pcon @(PPair PInteger PString) $ PPair 42 "hello") + @== str "PPair 42 hello" + "int-list" + @| pshow (pcon @(PPair PInteger (PBuiltinList PInteger)) $ PPair 42 $ pconstant [1, 2, 3]) + @== str "PPair 42 [1, 2, 3]" From 8f5172faf3c37e2692c724330288c466128d36b3 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 7 Mar 2022 16:19:32 -0500 Subject: [PATCH 166/584] Derive PShow for PRational --- Plutarch/Rational.hs | 9 +++++++++ plutarch-test/goldens/show.bench.golden | 3 ++- plutarch-test/goldens/show.uplc.eval.golden | 3 ++- plutarch-test/goldens/show.uplc.golden | 3 ++- plutarch-test/src/Plutarch/ShowSpec.hs | 6 ++++++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 2d6049d93..4935ee7d8 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -38,6 +38,7 @@ import Plutarch.Builtin ( import Plutarch.Integer (PInteger, PIntegral (pdiv, pmod)) import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) import Plutarch.Pair (PPair (..)) +import Plutarch.Show (PShow (pshow'), pshow) import Plutarch.Unsafe (punsafeCoerce) data PRational s @@ -45,6 +46,14 @@ data PRational s deriving stock (GHC.Generic) deriving anyclass (Generic, PlutusType) +instance PShow PRational where + pshow' _ x = + pshowRat # x + where + pshowRat = phoistAcyclic $ + plam $ \n -> pmatch n $ \(PRational x y) -> + pshow x <> "/" <> pshow y + instance PIsData PRational where pfromData x' = phoistAcyclic (plam $ \x -> pListToRat #$ pmap # pasInt #$ pasList # pforgetData x) # x' pdata x' = diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index a29a79567..8a6c0f34f 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -17,4 +17,5 @@ list.1,2,3 {"exBudgetCPU":29411680,"exBudgetMemory":66720,"scriptSizeBytes":413} builtinlist.nil {"exBudgetCPU":3519719,"exBudgetMemory":10435,"scriptSizeBytes":401} builtinlist.1,2,3 {"exBudgetCPU":26855742,"exBudgetMemory":56248,"scriptSizeBytes":404} pair.int-str {"exBudgetCPU":16329624,"exBudgetMemory":35186,"scriptSizeBytes":365} -pair.int-list {"exBudgetCPU":41712616,"exBudgetMemory":86350,"scriptSizeBytes":443} \ No newline at end of file +pair.int-list {"exBudgetCPU":41712616,"exBudgetMemory":86350,"scriptSizeBytes":443} +rational.1/2 {"exBudgetCPU":23497485,"exBudgetMemory":51676,"scriptSizeBytes":546} \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden index 94472dcfc..8b6378fa5 100644 --- a/plutarch-test/goldens/show.uplc.eval.golden +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -17,4 +17,5 @@ list.1,2,3 (program 1.0.0 "[1, 2, 3]") builtinlist.nil (program 1.0.0 "[]") builtinlist.1,2,3 (program 1.0.0 "[1, 2, 3]") pair.int-str (program 1.0.0 "PPair 42 hello") -pair.int-list (program 1.0.0 "PPair 42 [1, 2, 3]") \ No newline at end of file +pair.int-list (program 1.0.0 "PPair 42 [1, 2, 3]") +rational.1/2 (program 1.0.0 "1/2") \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index 26e0de41b..cf30d1f34 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -17,4 +17,5 @@ list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) []) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i16 (appendString ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i2) (appendString i16 i1))))) (\i0 -> i1 42 "hello")) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) " ")) -pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i25 i2))) (delay (appendString (i9 (i25 i2)) (appendString ", " (i3 (i26 i2))))))) (i25 i1))))) i1) "]"))))))) (\i0 -> i1 42 [1,2,3])) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) \ No newline at end of file +pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i25 i2))) (delay (appendString (i9 (i25 i2)) (appendString ", " (i3 (i26 i2))))))) (i25 i1))))) i1) "]"))))))) (\i0 -> i1 42 [1,2,3])) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ShowSpec.hs b/plutarch-test/src/Plutarch/ShowSpec.hs index c82848129..467988e04 100644 --- a/plutarch-test/src/Plutarch/ShowSpec.hs +++ b/plutarch-test/src/Plutarch/ShowSpec.hs @@ -54,3 +54,9 @@ spec = do "int-list" @| pshow (pcon @(PPair PInteger (PBuiltinList PInteger)) $ PPair 42 $ pconstant [1, 2, 3]) @== str "PPair 42 [1, 2, 3]" + "rational" @\ do + let rat :: Term s PRational -> Term s PRational + rat = id + "1/2" + @| pshow (rat $ 1 / 2) + @== str "1/2" From a74b3088b127aa880c80e3a4a171ccee3f12ebff Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 7 Mar 2022 16:29:28 -0500 Subject: [PATCH 167/584] Add ptraceShowId And update changelog. --- CHANGELOG.md | 5 +++++ Plutarch/Builtin.hs | 14 +++++++++++- Plutarch/Prelude.hs | 3 +++ Plutarch/Trace.hs | 22 +++++++++++++++++-- .../goldens/trace.dev=false.bench.golden | 1 + .../goldens/trace.dev=false.uplc.eval.golden | 1 + .../goldens/trace.dev=false.uplc.golden | 1 + .../goldens/trace.dev=true.bench.golden | 1 + .../goldens/trace.dev=true.uplc.eval.golden | 1 + .../goldens/trace.dev=true.uplc.golden | 1 + plutarch-test/src/Plutarch/ShowSpec.hs | 1 - plutarch-test/src/Plutarch/TraceSpec.hs | 4 ++++ 12 files changed, 51 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 048d03d20..f48276892 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Revision history for plutarch # Unreleased + +- Add `pshow` and `ptraceShowId` + + Started by [#352](https://github.com/Plutonomicon/plutarch/pull/352) + - Add `puncons` and `ptryUncons` functions for deconstructing list. Started by: [#333](https://github.com/Plutonomicon/plutarch/pull/333) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index c044b9a7f..251081cae 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -63,7 +63,19 @@ import Plutarch.Lift ( pconstantFromRepr, pconstantToRepr, ) -import Plutarch.List (PListLike (..), plistEquals, pshowList) +import Plutarch.List ( + PListLike ( + PElemConstraint, + pcons, + pelimList, + phead, + pnil, + pnull, + ptail + ), + plistEquals, + pshowList, + ) import Plutarch.Show (PShow (pshow')) import Plutarch.Unit (PUnit) import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce, punsafeFrom) diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 8fe129866..fe53408fa 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -115,9 +115,11 @@ module Plutarch.Prelude ( -- * Tracing ptrace, + ptraceShowId, ptraceIfFalse, ptraceIfTrue, ptraceError, + pshow, -- * Cryptographic hashes and signatures psha2_256, @@ -156,6 +158,7 @@ import Plutarch.List import Plutarch.Maybe import Plutarch.Pair import Plutarch.Rational +import Plutarch.Show import Plutarch.String import Plutarch.TermCont import Plutarch.Trace diff --git a/Plutarch/Trace.hs b/Plutarch/Trace.hs index 10cdbea3a..795b7c1b2 100644 --- a/Plutarch/Trace.hs +++ b/Plutarch/Trace.hs @@ -1,6 +1,12 @@ {-# LANGUAGE CPP #-} -module Plutarch.Trace (ptrace, ptraceIfTrue, ptraceIfFalse, ptraceError) where +module Plutarch.Trace ( + ptrace, + ptraceShowId, + ptraceIfTrue, + ptraceIfFalse, + ptraceError, +) where -- CPP support isn't great in fourmolu. {- ORMOLU_DISABLE -} @@ -15,7 +21,11 @@ import Plutarch.Bool (PBool, pif) import Plutarch.Bool (PBool) #endif import Plutarch.String (PString) - +#ifdef Development +import Plutarch.Show (PShow, pshow) +#else +import Plutarch.Show (PShow) +#endif #ifdef Development import Plutarch.Unsafe (punsafeBuiltin) import qualified PlutusCore as PLC @@ -34,6 +44,14 @@ ptrace s a = pforce $ ptrace' # s # pdelay a ptrace _ a = a #endif +-- | Like Haskell's `traceShowId` but for Plutarch +ptraceShowId :: PShow a => Term s a -> Term s a +#ifdef Development +ptraceShowId x = ptrace (pshow x) x +#else +ptraceShowId a = a +#endif + -- | Trace the given message and terminate evaluation with a 'perror'. ptraceError :: Term s PString -> Term s a #ifdef Development diff --git a/plutarch-test/goldens/trace.dev=false.bench.golden b/plutarch-test/goldens/trace.dev=false.bench.golden index 133e26e3a..e2a1b0baf 100644 --- a/plutarch-test/goldens/trace.dev=false.bench.golden +++ b/plutarch-test/goldens/trace.dev=false.bench.golden @@ -1,5 +1,6 @@ ptrace.one {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} ptrace.two {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceShowId.right-42 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} ptraceIfTrue.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} ptraceIfTrue.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} ptraceIfFalse.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} diff --git a/plutarch-test/goldens/trace.dev=false.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.uplc.eval.golden index f1804b70f..51bcda305 100644 --- a/plutarch-test/goldens/trace.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/trace.dev=false.uplc.eval.golden @@ -1,5 +1,6 @@ ptrace.one (program 1.0.0 ()) ptrace.two (program 1.0.0 ()) +ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) ptraceIfTrue.true (program 1.0.0 True) ptraceIfTrue.false (program 1.0.0 False) ptraceIfFalse.true (program 1.0.0 True) diff --git a/plutarch-test/goldens/trace.dev=false.uplc.golden b/plutarch-test/goldens/trace.dev=false.uplc.golden index f1804b70f..51bcda305 100644 --- a/plutarch-test/goldens/trace.dev=false.uplc.golden +++ b/plutarch-test/goldens/trace.dev=false.uplc.golden @@ -1,5 +1,6 @@ ptrace.one (program 1.0.0 ()) ptrace.two (program 1.0.0 ()) +ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) ptraceIfTrue.true (program 1.0.0 True) ptraceIfTrue.false (program 1.0.0 False) ptraceIfFalse.true (program 1.0.0 True) diff --git a/plutarch-test/goldens/trace.dev=true.bench.golden b/plutarch-test/goldens/trace.dev=true.bench.golden index 6af4df7e6..2c4e8ba62 100644 --- a/plutarch-test/goldens/trace.dev=true.bench.golden +++ b/plutarch-test/goldens/trace.dev=true.bench.golden @@ -1,5 +1,6 @@ ptrace.one {"exBudgetCPU":388284,"exBudgetMemory":932,"scriptSizeBytes":16} ptrace.two {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":30} +ptraceShowId.right-42 {"exBudgetCPU":16124851,"exBudgetMemory":35093,"scriptSizeBytes":382} ptraceIfTrue.true {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} ptraceIfTrue.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} ptraceIfFalse.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} diff --git a/plutarch-test/goldens/trace.dev=true.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.uplc.eval.golden index f1804b70f..51bcda305 100644 --- a/plutarch-test/goldens/trace.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/trace.dev=true.uplc.eval.golden @@ -1,5 +1,6 @@ ptrace.one (program 1.0.0 ()) ptrace.two (program 1.0.0 ()) +ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) ptraceIfTrue.true (program 1.0.0 True) ptraceIfTrue.false (program 1.0.0 False) ptraceIfFalse.true (program 1.0.0 True) diff --git a/plutarch-test/goldens/trace.dev=true.uplc.golden b/plutarch-test/goldens/trace.dev=true.uplc.golden index 603d96a97..535e3e9d4 100644 --- a/plutarch-test/goldens/trace.dev=true.uplc.golden +++ b/plutarch-test/goldens/trace.dev=true.uplc.golden @@ -1,5 +1,6 @@ ptrace.one (program 1.0.0 (force (force trace "foo" (delay ())))) ptrace.two (program 1.0.0 ((\i0 -> force (i1 "foo" (delay (force (i1 "bar" (delay ())))))) (force trace))) +ptraceShowId.right-42 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force trace ((\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "PUnit")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) (delay (\i0 -> \i0 -> i1 42)))) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) ptraceIfTrue.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) True)) ptraceIfTrue.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) False)) ptraceIfFalse.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) True)) diff --git a/plutarch-test/src/Plutarch/ShowSpec.hs b/plutarch-test/src/Plutarch/ShowSpec.hs index 467988e04..249668021 100644 --- a/plutarch-test/src/Plutarch/ShowSpec.hs +++ b/plutarch-test/src/Plutarch/ShowSpec.hs @@ -7,7 +7,6 @@ import Test.Syd import Plutarch.ListSpec (integerList) import Plutarch.Prelude -import Plutarch.Show import Plutarch.Test spec :: Spec diff --git a/plutarch-test/src/Plutarch/TraceSpec.hs b/plutarch-test/src/Plutarch/TraceSpec.hs index 3809555a2..7963e613a 100644 --- a/plutarch-test/src/Plutarch/TraceSpec.hs +++ b/plutarch-test/src/Plutarch/TraceSpec.hs @@ -13,6 +13,10 @@ spec = do ptraces p ["foo"] "two" @| ptrace "foo" (ptrace "bar" (pcon PUnit)) @-> \p -> ptraces p ["foo", "bar"] + "ptraceShowId" @\ do + let x = pcon @(PEither PUnit PInteger) $ PRight 42 + "right-42" @| ptraceShowId x @-> \p -> + p `ptraces` ["PRight 42"] "ptraceIfTrue" @\ do "true" @| ptraceIfTrue "foo" (pcon PTrue) @-> \p -> p `ptraces` ["foo"] From f95e78567f55c575d0712d8dcb90b148511b67f0 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 7 Mar 2022 17:19:13 -0500 Subject: [PATCH 168/584] Use the alias constraint --- Plutarch/Builtin.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 251081cae..7fe0d0214 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -117,7 +117,7 @@ data PBuiltinList (a :: PType) (s :: S) = PCons (Term s a) (Term s (PBuiltinList a)) | PNil -instance (PShow a, PUnsafeLiftDecl a) => PShow (PBuiltinList a) where +instance (PShow a, PLift a) => PShow (PBuiltinList a) where pshow' _ x = pshowList @PBuiltinList @a # x pheadBuiltin :: Term s (PBuiltinList a :--> a) From 8bb50d6c0876fb0b4300e2e40eb7ddf9df547468 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 7 Mar 2022 17:25:33 -0500 Subject: [PATCH 169/584] pshow(PUnit) == () --- Plutarch/Unit.hs | 3 +-- plutarch-test/goldens/show.bench.golden | 5 +++-- plutarch-test/goldens/show.uplc.eval.golden | 1 + plutarch-test/goldens/show.uplc.golden | 5 +++-- plutarch-test/goldens/trace.dev=true.bench.golden | 2 +- plutarch-test/goldens/trace.dev=true.uplc.golden | 2 +- plutarch-test/src/Plutarch/ShowSpec.hs | 1 + 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Plutarch/Unit.hs b/Plutarch/Unit.hs index da6340124..f049626da 100644 --- a/Plutarch/Unit.hs +++ b/Plutarch/Unit.hs @@ -3,7 +3,6 @@ module Plutarch.Unit (PUnit (..)) where -import qualified Data.Text as T import Plutarch (PlutusType (PInner, pcon', pmatch'), Term, pcon, pmatch) import Plutarch.Bool (PBool (PFalse, PTrue), PEq, POrd, (#<), (#<=), (#==)) import Plutarch.Lift ( @@ -40,4 +39,4 @@ instance Monoid (Term s PUnit) where mempty = pcon PUnit instance PShow PUnit where - pshow' _ = flip pmatch $ pconstant . T.pack . show + pshow' _ x = pmatch x $ \PUnit -> "()" diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index 8a6c0f34f..914f3dc28 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -1,3 +1,4 @@ +unit {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} int.0 {"exBudgetCPU":6284427,"exBudgetMemory":14017,"scriptSizeBytes":317} int.5 {"exBudgetCPU":8760152,"exBudgetMemory":20027,"scriptSizeBytes":317} int.-5 {"exBudgetCPU":9393754,"exBudgetMemory":20832,"scriptSizeBytes":317} @@ -9,8 +10,8 @@ int.102 {"exBudgetCPU":18800590,"exBudgetMemory":39265,"scriptSizeBytes":318} int.-102 {"exBudgetCPU":19434192,"exBudgetMemory":40070,"scriptSizeBytes":318} maybe.nothing {"exBudgetCPU":1458977,"exBudgetMemory":5000,"scriptSizeBytes":354} maybe.just {"exBudgetCPU":15676121,"exBudgetMemory":34060,"scriptSizeBytes":356} -either.right {"exBudgetCPU":15766440,"exBudgetMemory":34361,"scriptSizeBytes":373} -maybe.either {"exBudgetCPU":17334403,"exBudgetMemory":37506,"scriptSizeBytes":434} +either.right {"exBudgetCPU":15766440,"exBudgetMemory":34361,"scriptSizeBytes":370} +maybe.either {"exBudgetCPU":17334403,"exBudgetMemory":37506,"scriptSizeBytes":431} list.nil {"exBudgetCPU":3787676,"exBudgetMemory":11335,"scriptSizeBytes":410} list.1 {"exBudgetCPU":10989375,"exBudgetMemory":26452,"scriptSizeBytes":411} list.1,2,3 {"exBudgetCPU":29411680,"exBudgetMemory":66720,"scriptSizeBytes":413} diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden index 8b6378fa5..0bc84a816 100644 --- a/plutarch-test/goldens/show.uplc.eval.golden +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -1,3 +1,4 @@ +unit (program 1.0.0 "()") int.0 (program 1.0.0 "0") int.5 (program 1.0.0 "5") int.-5 (program 1.0.0 "-5") diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index cf30d1f34..dc4bc7b19 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -1,3 +1,4 @@ +unit (program 1.0.0 "()") int.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 0) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.-5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) @@ -9,8 +10,8 @@ int.102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> int.-102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) maybe.nothing (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> force i1)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) maybe.just (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> i2 42)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "PUnit")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -maybe.either (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString i16 (i1 (\i0 -> appendString i16 (appendString (appendString "PLeft" (appendString i17 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) i18)) (\i0 -> appendString i16 (appendString (appendString "PRight" (appendString i17 "PUnit")) i18))))) (delay "PNothing")) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i2 42))) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "(") " ") ")")) +either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +maybe.either (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString i16 (i1 (\i0 -> appendString i16 (appendString (appendString "PLeft" (appendString i17 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) i18)) (\i0 -> appendString i16 (appendString (appendString "PRight" (appendString i17 "()")) i18))))) (delay "PNothing")) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i2 42))) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "(") " ") ")")) list.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) list.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) diff --git a/plutarch-test/goldens/trace.dev=true.bench.golden b/plutarch-test/goldens/trace.dev=true.bench.golden index 2c4e8ba62..98057425d 100644 --- a/plutarch-test/goldens/trace.dev=true.bench.golden +++ b/plutarch-test/goldens/trace.dev=true.bench.golden @@ -1,6 +1,6 @@ ptrace.one {"exBudgetCPU":388284,"exBudgetMemory":932,"scriptSizeBytes":16} ptrace.two {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":30} -ptraceShowId.right-42 {"exBudgetCPU":16124851,"exBudgetMemory":35093,"scriptSizeBytes":382} +ptraceShowId.right-42 {"exBudgetCPU":16124851,"exBudgetMemory":35093,"scriptSizeBytes":379} ptraceIfTrue.true {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} ptraceIfTrue.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} ptraceIfFalse.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} diff --git a/plutarch-test/goldens/trace.dev=true.uplc.golden b/plutarch-test/goldens/trace.dev=true.uplc.golden index 535e3e9d4..5a77c4925 100644 --- a/plutarch-test/goldens/trace.dev=true.uplc.golden +++ b/plutarch-test/goldens/trace.dev=true.uplc.golden @@ -1,6 +1,6 @@ ptrace.one (program 1.0.0 (force (force trace "foo" (delay ())))) ptrace.two (program 1.0.0 ((\i0 -> force (i1 "foo" (delay (force (i1 "bar" (delay ())))))) (force trace))) -ptraceShowId.right-42 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force trace ((\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "PUnit")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) (delay (\i0 -> \i0 -> i1 42)))) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +ptraceShowId.right-42 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force trace ((\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) (delay (\i0 -> \i0 -> i1 42)))) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) ptraceIfTrue.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) True)) ptraceIfTrue.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) False)) ptraceIfFalse.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) True)) diff --git a/plutarch-test/src/Plutarch/ShowSpec.hs b/plutarch-test/src/Plutarch/ShowSpec.hs index 249668021..cfa67f02a 100644 --- a/plutarch-test/src/Plutarch/ShowSpec.hs +++ b/plutarch-test/src/Plutarch/ShowSpec.hs @@ -13,6 +13,7 @@ spec :: Spec spec = do describe "show" . pgoldenSpec $ do let str x = pconstant @PString x + "unit" @| pshow (pcon PUnit) @== str "()" "int" @\ do "0" @| pshow (pconstant @PInteger 0) @== str "0" forM_ [5, 10, 14, 102] $ \n -> do From cbf24be438913517f0052b64ae3ec83e3948f6be Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 4 Mar 2022 18:26:47 +0100 Subject: [PATCH 170/584] fix: - applied changes requested by Las and Chase (renaming, removing unnecessary stuff) --- flake.nix | 8 ++----- plutarch-extra/plutarch-extra.cabal | 12 +--------- plutarch-test/Main.hs | 13 +++++++++++ .../Spec.hs => plutarch-base/BaseSpec.hs} | 2 ++ plutarch-test/plutarch-base/Main.hs | 10 -------- .../Spec.hs => plutarch-extra/ExtraSpec.hs} | 0 plutarch-test/plutarch-extra/Main.hs | 10 -------- .../Plutarch/{ExtraSpec.hs => HelloSpec.hs} | 4 ++-- plutarch-test/plutarch-test.cabal | 23 ++++++++----------- 9 files changed, 29 insertions(+), 53 deletions(-) create mode 100644 plutarch-test/Main.hs rename plutarch-test/{plutarch-extra/Spec.hs => plutarch-base/BaseSpec.hs} (61%) delete mode 100644 plutarch-test/plutarch-base/Main.hs rename plutarch-test/{plutarch-base/Spec.hs => plutarch-extra/ExtraSpec.hs} (100%) delete mode 100644 plutarch-test/plutarch-extra/Main.hs rename plutarch-test/plutarch-extra/Plutarch/{ExtraSpec.hs => HelloSpec.hs} (63%) diff --git a/flake.nix b/flake.nix index 421002504..6fdbd6777 100644 --- a/flake.nix +++ b/flake.nix @@ -480,10 +480,7 @@ { # Workaround missing support for build-tools: # https://github.com/input-output-hk/haskell.nix/issues/231 - packages.plutarch-test.components.exes.plutarch-base-test.build-tools = [ - pkgSet.hsPkgs.sydtest-discover - ]; - packages.plutarch-test.components.exes.plutarch-extra-test.build-tools = [ + packages.plutarch-test.components.exes.plutarch-test.build-tools = [ pkgSet.hsPkgs.sydtest-discover ]; packages.plutarch-test.flags.development = flagDevelopment; @@ -603,8 +600,7 @@ program = checkedShellScript system "plutarch-test-${name}" '' cd ${self}/plutarch-test - ${flake.packages."plutarch-test:exe:plutarch-base-test"}/bin/plutarch-base-test; - ${flake.packages."plutarch-test:exe:plutarch-extra-test"}/bin/plutarch-extra-test; + ${flake.packages."plutarch-test:exe:plutarch-test"}/bin/plutarch-test; ''; }; diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index 1996db33b..f14051c82 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -2,11 +2,6 @@ cabal-version: 2.4 name: plutarch-extra version: 1.1.0 -flag development - description: Enable tracing functions within plutarch. - manual: True - default: False - common c default-language: Haskell2010 default-extensions: @@ -80,9 +75,4 @@ library import: c, deps exposed-modules: Plutarch.Extra - -- other-modules: - - if flag(development) - cpp-options: -DDevelopment - - ghc-options: -threaded -rtsopts -with-rtsopts=-N +-- other-modules: diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs new file mode 100644 index 000000000..a946e9271 --- /dev/null +++ b/plutarch-test/Main.hs @@ -0,0 +1,13 @@ +module Main (main) where + +import qualified BaseSpec +import qualified ExtraSpec +import GHC.IO.Encoding (setLocaleEncoding, utf8) +import Test.Syd (sydTest) + +main :: IO () +main = do + setLocaleEncoding utf8 + sydTest BaseSpec.spec + putStrLn "\n\n\n--------------------------------------------\n\n\n" + sydTest ExtraSpec.spec diff --git a/plutarch-test/plutarch-extra/Spec.hs b/plutarch-test/plutarch-base/BaseSpec.hs similarity index 61% rename from plutarch-test/plutarch-extra/Spec.hs rename to plutarch-test/plutarch-base/BaseSpec.hs index 4c69623b5..8bdf3b700 100644 --- a/plutarch-test/plutarch-extra/Spec.hs +++ b/plutarch-test/plutarch-base/BaseSpec.hs @@ -1 +1,3 @@ {-# OPTIONS_GHC -F -pgmF sydtest-discover -optF --no-main #-} + +module Plutarch.BaseSpec (spec) where diff --git a/plutarch-test/plutarch-base/Main.hs b/plutarch-test/plutarch-base/Main.hs deleted file mode 100644 index 7350e094d..000000000 --- a/plutarch-test/plutarch-base/Main.hs +++ /dev/null @@ -1,10 +0,0 @@ -module Main (main) where - -import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Spec (spec) -import Test.Syd (sydTest) - -main :: IO () -main = do - setLocaleEncoding utf8 - sydTest spec diff --git a/plutarch-test/plutarch-base/Spec.hs b/plutarch-test/plutarch-extra/ExtraSpec.hs similarity index 100% rename from plutarch-test/plutarch-base/Spec.hs rename to plutarch-test/plutarch-extra/ExtraSpec.hs diff --git a/plutarch-test/plutarch-extra/Main.hs b/plutarch-test/plutarch-extra/Main.hs deleted file mode 100644 index 7350e094d..000000000 --- a/plutarch-test/plutarch-extra/Main.hs +++ /dev/null @@ -1,10 +0,0 @@ -module Main (main) where - -import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Spec (spec) -import Test.Syd (sydTest) - -main :: IO () -main = do - setLocaleEncoding utf8 - sydTest spec diff --git a/plutarch-test/plutarch-extra/Plutarch/ExtraSpec.hs b/plutarch-test/plutarch-extra/Plutarch/HelloSpec.hs similarity index 63% rename from plutarch-test/plutarch-extra/Plutarch/ExtraSpec.hs rename to plutarch-test/plutarch-extra/Plutarch/HelloSpec.hs index 03116ca12..f14a9dae5 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ExtraSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/HelloSpec.hs @@ -1,8 +1,8 @@ -module Plutarch.ExtraSpec (spec) where +module Plutarch.HelloSpec (spec) where import Test.Syd (Spec, describe, it) spec :: Spec spec = - describe "Hello Plutarch Extra" $ + describe "Hello-Plutarch-Extra" $ it "says Hello Plutarch Extra" $ putStrLn "Hello Plutarch Extra" diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index cb164c4d5..347725c2b 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -105,21 +105,10 @@ library if flag(development) cpp-options: -DDevelopment -executable plutarch-extra-test - import: c, deps - main-is: Main.hs - hs-source-dirs: plutarch-extra - build-depends: plutarch-test - other-modules: - Plutarch.ExtraSpec - Spec - - ghc-options: -threaded -rtsopts -with-rtsopts=-N - -executable plutarch-base-test +executable plutarch-test import: c, deps main-is: Main.hs - hs-source-dirs: plutarch-base + hs-source-dirs: plutarch-base plutarch-extra common ./. build-depends: , base16-bytestring , cborg @@ -134,10 +123,13 @@ executable plutarch-base-test Plutarch.RecSpec other-modules: + BaseSpec + ExtraSpec Plutarch.ApiSpec Plutarch.BoolSpec Plutarch.ByteStringSpec Plutarch.EitherSpec + Plutarch.HelloSpec Plutarch.IntegerSpec Plutarch.LiftSpec Plutarch.ListSpec @@ -150,10 +142,13 @@ executable plutarch-base-test Plutarch.RecursionSpec Plutarch.ScriptsSpec Plutarch.StringSpec + Plutarch.Test + Plutarch.Test.Benchmark + Plutarch.Test.Golden + Plutarch.Test.ListSyntax Plutarch.TraceSpec Plutarch.UnitSpec Plutarch.UPLCSpec - Spec if flag(development) cpp-options: -DDevelopment From 4dac4bc6195a3cc1a445491e9ea987fe25ab25d6 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Mon, 7 Mar 2022 16:26:45 +0100 Subject: [PATCH 171/584] wip #344: - added smart constructor for PMap --- Plutarch/Api/V1.hs | 1 + Plutarch/Api/V1/AssocMap.hs | 27 +++++++++++++++++++ ...tion_untrusted_data.dev=false.bench.golden | 4 +++ ..._untrusted_data.dev=false.uplc.eval.golden | 4 +++ ...ation_untrusted_data.dev=false.uplc.golden | 8 ++++++ ...ation_untrusted_data.dev=true.bench.golden | 4 +++ ...n_untrusted_data.dev=true.uplc.eval.golden | 4 +++ ...cation_untrusted_data.dev=true.uplc.golden | 16 ++++++++--- plutarch-test/src/Plutarch/ApiSpec.hs | 9 +++++++ plutarch-test/src/Plutarch/TryFromSpec.hs | 21 +++++++++++++++ 10 files changed, 94 insertions(+), 4 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 8bf19e4d4..431c345dc 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -67,6 +67,7 @@ module Plutarch.Api.V1 ( -- ** AssocMap AssocMap.PMap, + AssocMap.pmkPMap, -- ** Others Maybe.PMaybeData (PDJust, PDNothing), diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index fe822e3e7..3be46c1b7 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -3,6 +3,7 @@ module Plutarch.Api.V1.AssocMap ( PMap, + pmkPMap, ) where import Plutarch.TryFrom ( @@ -61,6 +62,32 @@ instance y' <- Plutus.fromData y Just (x', y') +----------------------- Smart constructor to to create onchain instances ---------------- + +{- | + Smart constructor to enforce PMap invariants on the Haskell level for writing + onchain code +-} +pmkPMap :: + forall a b s. + ( PLifted (PConstanted a) ~ a + , PLifted (PConstanted b) ~ b + , PLift (PConstanted a) + , PLift (PConstanted b) + , Plutus.ToData a + , Plutus.ToData b + , Plutus.FromData a + , Plutus.FromData b + , Ord a + ) => + [(a, b)] -> + Maybe (Term s (PMap (PConstanted a) (PConstanted b))) +pmkPMap l = if sorted l then Just (pconstant $ PlutusMap.fromList l) else Nothing + where + sorted [] = True + sorted [_] = True + sorted (x : y : zs) = if fst x > fst y then False else sorted (y : zs) + ----------------------- PTryFrom and PMaybeFrom instances ------------------------------- instance diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden index 0920418f8..1adf44948 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden @@ -24,6 +24,10 @@ checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exB checking PValue and PMap for validity.PMap.valid0maybe {"exBudgetCPU":14519413,"exBudgetMemory":28316,"scriptSizeBytes":198} checking PValue and PMap for validity.PMap.invalid1maybe {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":198} checking PValue and PMap for validity.PMap.invalid2maybe {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} +checking PValue and PMap for validity.PValue.valid0 {"exBudgetCPU":7607387,"exBudgetMemory":19388,"scriptSizeBytes":137} +checking PValue and PMap for validity.PValue.invalid1 {"exBudgetCPU":2310477,"exBudgetMemory":521,"scriptSizeBytes":153} +checking PValue and PMap for validity.PValue.valid0maybe {"exBudgetCPU":8292167,"exBudgetMemory":21689,"scriptSizeBytes":160} +checking PValue and PMap for validity.PValue.invalid1maybe {"exBudgetCPU":8265080,"exBudgetMemory":20524,"scriptSizeBytes":176} example.concatenate two lists, legal {"exBudgetCPU":63896970,"exBudgetMemory":125943,"scriptSizeBytes":656} example.concatenate two lists, illegal (list too short) {"exBudgetCPU":56513317,"exBudgetMemory":105217,"scriptSizeBytes":649} example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":63748105,"exBudgetMemory":125443,"scriptSizeBytes":656} diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden index dff3c9097..52105acd6 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden @@ -24,6 +24,10 @@ checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 error) checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 error) +checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) +checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 error) +checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) +checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 error) example.concatenate two lists, legal (program 1.0.0 ()) example.concatenate two lists, illegal (list too short) (program 1.0.0 error) example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden index aa143cbd4..a45caf450 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden @@ -24,6 +24,14 @@ checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 2) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) +checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 + , #a149736f6d65546f6b656e01 ) ])) +checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 + , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) +checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 + , #a149736f6d65546f6b656e01 ) ])) +checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 + , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) i12))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 8) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden index 93dfd9597..3da1c8fee 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden @@ -24,6 +24,10 @@ checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exB checking PValue and PMap for validity.PMap.valid0maybe {"exBudgetCPU":14519413,"exBudgetMemory":28316,"scriptSizeBytes":198} checking PValue and PMap for validity.PMap.invalid1maybe {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":198} checking PValue and PMap for validity.PMap.invalid2maybe {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} +checking PValue and PMap for validity.PValue.valid0 {"exBudgetCPU":7607387,"exBudgetMemory":19388,"scriptSizeBytes":137} +checking PValue and PMap for validity.PValue.invalid1 {"exBudgetCPU":2310477,"exBudgetMemory":521,"scriptSizeBytes":153} +checking PValue and PMap for validity.PValue.valid0maybe {"exBudgetCPU":8292167,"exBudgetMemory":21689,"scriptSizeBytes":160} +checking PValue and PMap for validity.PValue.invalid1maybe {"exBudgetCPU":8265080,"exBudgetMemory":20524,"scriptSizeBytes":176} example.concatenate two lists, legal {"exBudgetCPU":64762657,"exBudgetMemory":127907,"scriptSizeBytes":1060} example.concatenate two lists, illegal (list too short) {"exBudgetCPU":56963317,"exBudgetMemory":105313,"scriptSizeBytes":1053} example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":64198105,"exBudgetMemory":125539,"scriptSizeBytes":1060} diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden index dff3c9097..52105acd6 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden @@ -24,6 +24,10 @@ checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 error) checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 error) +checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) +checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 error) +checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) +checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 error) example.concatenate two lists, legal (program 1.0.0 ()) example.concatenate two lists, illegal (list too short) (program 1.0.0 error) example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden index 0df111619..ebdd12041 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden @@ -24,7 +24,15 @@ checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 2) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:336:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:289:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:286:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:336:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:289:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:286:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) i14))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:336:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:289:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:286:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 8) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:336:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:289:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:286:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffd8799f41d003ffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) \ No newline at end of file +checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 + , #a149736f6d65546f6b656e01 ) ])) +checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 + , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) +checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 + , #a149736f6d65546f6b656e01 ) ])) +checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 + , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:357:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:310:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:307:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:357:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:310:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:307:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) i14))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:357:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:310:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:307:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 8) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:357:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:310:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:307:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffd8799f41d003ffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index 92983ff3a..b73d0d04f 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -3,6 +3,8 @@ module Plutarch.ApiSpec (spec, ctx, info, purpose) where import Test.Syd import Test.Tasty.HUnit +import Data.Maybe (isJust) + import Control.Monad.Trans.Cont (cont, runCont) import Plutus.V1.Ledger.Api import qualified Plutus.V1.Ledger.Interval as Interval @@ -18,11 +20,14 @@ import Plutarch.Api.V1 ( PTxInInfo, PTxInfo, PValue, + pmkPMap, ) import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude import Plutarch.Test +-- import PlutusTx.AssocMap as PlutusMap + spec :: Spec spec = do describe "api" $ do @@ -59,6 +64,10 @@ spec = do "fails" @| checkSignatoryTermCont # pconstant "41" # ctx @-> pfails describe "getFields" . pgoldenSpec $ do "0" @| getFields + describe "example2" $ do + it "succeeds0" $ (isJust (pmkPMap @Integer @Integer [(3, 42), (4, 42)]) @?= True) + it "succeeds1" $ (isJust (pmkPMap @Integer @Integer [(3, 42), (3, 42)]) @?= True) + it "fails0" $ (isJust (pmkPMap @Integer @Integer [(2, 42), (1, 42)]) @?= False) -------------------------------------------------------------------------------- diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index f5b1d097e..6a2f5dd05 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -18,22 +18,28 @@ import PlutusTx ( Data (B, Constr, I), ) +import PlutusTx.AssocMap (Map) +import qualified PlutusTx.AssocMap as PlutusMap + import Plutarch.Unsafe ( punsafeCoerce, ) import Plutarch import Plutarch.Api.V1 ( + PCurrencySymbol, PDatum, PDatumHash, PMap, PMaybeData (PDJust), PScriptContext, PScriptPurpose (PSpending), + PTokenName, PTuple, PTxInInfo, PTxOutRef, PValidator, + PValue, ) import Plutarch.Builtin ( PBuiltinMap, @@ -49,6 +55,8 @@ import Plutarch.TryFrom ( import Plutarch.ApiSpec (info, purpose) import Plutarch.Maybe (pfromMaybe) import Plutarch.Test +import Plutus.V1.Ledger.Value (Value) +import qualified Plutus.V1.Ledger.Value as Value spec :: Spec spec = do @@ -203,6 +211,19 @@ spec = do @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @_ @(PMap PInteger PUnit) mf1)) @-> pfails "invalid2maybe" @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) mf2)) @-> pfails + "PValue" @\ do + let legalValue0 :: Value + legalValue0 = Value.singleton "c0" "someToken" 1 + illegalValue1 :: Map Value.CurrencySymbol (Map Value.TokenName Integer) + illegalValue1 = PlutusMap.fromList [("c0", PlutusMap.fromList [("someToken", 1), ("someOtherToken", 0)])] + "valid0" + @| (unTermCont $ fst <$> TermCont (ptryFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ punsafeCoerce $ pconstant $ legalValue0)) @-> psucceeds + "invalid1" + @| (unTermCont $ fst <$> TermCont (ptryFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ pconstant $ illegalValue1)) @-> pfails + "valid0maybe" + @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ punsafeCoerce $ pconstant $ legalValue0)) @-> psucceeds + "invalid1maybe" + @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ pconstant $ illegalValue1)) @-> pfails "example" @\ do let validContext = ctx validList1 invalidContext = ctx invalidList1 From 5353d24ce1b4b63b8d753cdb860c76eda0dc5cd8 Mon Sep 17 00:00:00 2001 From: Peter Dragos Date: Tue, 8 Mar 2022 08:34:38 -0500 Subject: [PATCH 172/584] change `PLift` alias --- Plutarch/Lift.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index b4a6ccdb0..c74ae6aae 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -66,7 +66,8 @@ The Haskell type is determined by `PLifted p`. This typeclass is closely tied with 'PConstant'. -} -type PLift = PUnsafeLiftDecl +type PLift :: PType -> Constraint +type PLift p = (p ~ (PConstanted (PLifted p)), PUnsafeLiftDecl p) {- | Create a Plutarch-level constant, from a Haskell value. Example: From 3878452e6b1fb312451876f601d8ace9490a1ade Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 8 Mar 2022 10:37:45 -0500 Subject: [PATCH 173/584] Hoist `pshow @PBool` and add tests for it --- Plutarch/Show.hs | 7 ++++++- plutarch-test/goldens/show.bench.golden | 2 ++ plutarch-test/goldens/show.uplc.eval.golden | 2 ++ plutarch-test/goldens/show.uplc.golden | 2 ++ plutarch-test/src/Plutarch/ShowSpec.hs | 3 +++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs index 0c114f1ab..c47b07a83 100644 --- a/Plutarch/Show.hs +++ b/Plutarch/Show.hs @@ -70,7 +70,12 @@ instance PShow PString where pshow' _ = id instance PShow PBool where - pshow' _ x = pmatch x (pconstant @PString . T.pack . show) + pshow' _ x = pshowBool # x + where + pshowBool = phoistAcyclic $ + plam $ \x -> + -- Delegate to Haskell's Show instance + pmatch x $ pconstant @PString . T.pack . show instance PShow PInteger where pshow' _ x = pshowInt # x diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index 914f3dc28..b14cefadc 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -1,4 +1,6 @@ unit {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +bool.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":33} +bool.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":33} int.0 {"exBudgetCPU":6284427,"exBudgetMemory":14017,"scriptSizeBytes":317} int.5 {"exBudgetCPU":8760152,"exBudgetMemory":20027,"scriptSizeBytes":317} int.-5 {"exBudgetCPU":9393754,"exBudgetMemory":20832,"scriptSizeBytes":317} diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden index 0bc84a816..b406354f6 100644 --- a/plutarch-test/goldens/show.uplc.eval.golden +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -1,4 +1,6 @@ unit (program 1.0.0 "()") +bool.true (program 1.0.0 "PTrue") +bool.false (program 1.0.0 "PFalse") int.0 (program 1.0.0 "0") int.5 (program 1.0.0 "5") int.-5 (program 1.0.0 "-5") diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index dc4bc7b19..d6be49b23 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -1,4 +1,6 @@ unit (program 1.0.0 "()") +bool.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay "PTrue") (delay "PFalse"))) True)) +bool.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay "PTrue") (delay "PFalse"))) False)) int.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 0) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.-5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) diff --git a/plutarch-test/src/Plutarch/ShowSpec.hs b/plutarch-test/src/Plutarch/ShowSpec.hs index cfa67f02a..fd72f8cbf 100644 --- a/plutarch-test/src/Plutarch/ShowSpec.hs +++ b/plutarch-test/src/Plutarch/ShowSpec.hs @@ -14,6 +14,9 @@ spec = do describe "show" . pgoldenSpec $ do let str x = pconstant @PString x "unit" @| pshow (pcon PUnit) @== str "()" + "bool" @\ do + "true" @| pshow (pcon PTrue) @== str "PTrue" + "false" @| pshow (pcon PFalse) @== str "PFalse" "int" @\ do "0" @| pshow (pconstant @PInteger 0) @== str "0" forM_ [5, 10, 14, 102] $ \n -> do From 4f59aac68ae0deefec6b36676a180f4f00469804 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 8 Mar 2022 12:03:20 -0500 Subject: [PATCH 174/584] Derive PShow for PByteString --- Plutarch/Show.hs | 40 ++++++++++++++++++--- plutarch-test/goldens/show.bench.golden | 6 ++++ plutarch-test/goldens/show.uplc.eval.golden | 6 ++++ plutarch-test/goldens/show.uplc.golden | 6 ++++ plutarch-test/src/Plutarch/ShowSpec.hs | 7 ++++ 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs index c47b07a83..b48f61f33 100644 --- a/Plutarch/Show.hs +++ b/Plutarch/Show.hs @@ -6,6 +6,7 @@ module Plutarch.Show ( pshow, ) where +import Data.Char (intToDigit) import Data.List.NonEmpty (NonEmpty ((:|))) import qualified Data.List.NonEmpty as NE import Data.Semigroup (sconcat) @@ -30,6 +31,7 @@ import Generics.SOP ( hmap, ) import Plutarch.Bool (PBool, PEq ((#==)), POrd ((#<)), pif) +import Plutarch.ByteString (PByteString, pindexBS, plengthBS, psliceBS) import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Internal.Generic (PCode, PGeneric, pfrom) @@ -99,10 +101,40 @@ instance PShow PInteger where pcase perror digit $ flip fmap [0 .. 9] $ \(x :: Integer) -> (pconstant x, pconstant (T.pack . show $ x)) - pcase :: PEq a => Term s b -> Term s a -> [(Term s a, Term s b)] -> Term s b - pcase otherwise x = \case - [] -> otherwise - ((x', r) : cs) -> pif (x #== x') r $ pcase otherwise x cs + +instance PShow PByteString where + pshow' _ x = "0x" <> showByteString # x + where + showByteString = + phoistAcyclic $ + pfix #$ plam $ \self bs -> + plet (plengthBS # bs) $ \n -> + pif + (n #== 0) + (pconstant @PString "") + $ plet (pindexBS # bs # 0) $ \x -> + plet (psliceBS # 1 # (n - 1) # bs) $ \xs -> + showByte # x <> self # xs + showByte :: Term s (PInteger :--> PString) + showByte = phoistAcyclic $ + plam $ \n -> + plet (pquot # n # 16) $ \a -> + plet (prem # n # 16) $ \b -> + showNibble # a <> showNibble # b + showNibble :: Term s (PInteger :--> PString) + showNibble = + phoistAcyclic $ + plam $ \n -> + pcase perror n $ + flip fmap [0 .. 15] $ \(x :: Int) -> + ( pconstant $ toInteger x + , pconstant @PString $ T.pack $ intToDigit x : [] + ) + +pcase :: PEq a => Term s b -> Term s a -> [(Term s a, Term s b)] -> Term s b +pcase otherwise x = \case + [] -> otherwise + ((x', r) : cs) -> pif (x #== x') r $ pcase otherwise x cs -- | Generic version of `pshow` gpshow :: diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index b14cefadc..40cc9cf80 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -10,6 +10,12 @@ int.14 {"exBudgetCPU":14274516,"exBudgetMemory":30847,"scriptSizeBytes":317} int.-14 {"exBudgetCPU":14908118,"exBudgetMemory":31652,"scriptSizeBytes":317} int.102 {"exBudgetCPU":18800590,"exBudgetMemory":39265,"scriptSizeBytes":318} int.-102 {"exBudgetCPU":19434192,"exBudgetMemory":40070,"scriptSizeBytes":318} +bytestring.empty {"exBudgetCPU":3089766,"exBudgetMemory":9008,"scriptSizeBytes":401} +bytestring.1 {"exBudgetCPU":10795630,"exBudgetMemory":25140,"scriptSizeBytes":403} +bytestring.2 {"exBudgetCPU":28406394,"exBudgetMemory":65314,"scriptSizeBytes":404} +bytestring.3 {"exBudgetCPU":35125968,"exBudgetMemory":79046,"scriptSizeBytes":405} +bytestring.n {"exBudgetCPU":63349233,"exBudgetMemory":147560,"scriptSizeBytes":405} +bytestring.0 {"exBudgetCPU":18786183,"exBudgetMemory":39380,"scriptSizeBytes":405} maybe.nothing {"exBudgetCPU":1458977,"exBudgetMemory":5000,"scriptSizeBytes":354} maybe.just {"exBudgetCPU":15676121,"exBudgetMemory":34060,"scriptSizeBytes":356} either.right {"exBudgetCPU":15766440,"exBudgetMemory":34361,"scriptSizeBytes":370} diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden index b406354f6..dab615ab1 100644 --- a/plutarch-test/goldens/show.uplc.eval.golden +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -10,6 +10,12 @@ int.14 (program 1.0.0 "14") int.-14 (program 1.0.0 "-14") int.102 (program 1.0.0 "102") int.-102 (program 1.0.0 "-102") +bytestring.empty (program 1.0.0 "0x") +bytestring.1 (program 1.0.0 "0x14") +bytestring.2 (program 1.0.0 "0x14af") +bytestring.3 (program 1.0.0 "0x14af03") +bytestring.n (program 1.0.0 "0xffffff") +bytestring.0 (program 1.0.0 "0x000000") maybe.nothing (program 1.0.0 "PNothing") maybe.just (program 1.0.0 "PJust 42") either.right (program 1.0.0 "PRight 42") diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index d6be49b23..36fd44142 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -10,6 +10,12 @@ int.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ( int.-14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -14) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.-102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +bytestring.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #14)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #14af)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #14af03)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.n (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #ffffff)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #000000)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) maybe.nothing (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> force i1)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) maybe.just (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> i2 42)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) diff --git a/plutarch-test/src/Plutarch/ShowSpec.hs b/plutarch-test/src/Plutarch/ShowSpec.hs index fd72f8cbf..3834fa231 100644 --- a/plutarch-test/src/Plutarch/ShowSpec.hs +++ b/plutarch-test/src/Plutarch/ShowSpec.hs @@ -26,6 +26,13 @@ spec = do (fromString $ show (-n)) @| pshow (pconstant @PInteger (-n)) @== pconstant (T.pack $ show (-n)) + "bytestring" @\ do + "empty" @| pshow (phexByteStr "") @== str "0x" + "1" @| pshow (phexByteStr "14") @== str "0x14" + "2" @| pshow (phexByteStr "14AF") @== str "0x14af" + "3" @| pshow (phexByteStr "14AF03") @== str "0x14af03" + "n" @| pshow (phexByteStr "FFFFFF") @== str "0xffffff" + "0" @| pshow (phexByteStr "000000") @== str "0x000000" "maybe" @\ do "nothing" @| pshow @(PMaybe PInteger) (pcon PNothing) From 2555483368fbed3900ebd795ad86af7b7b5c981e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 8 Mar 2022 13:12:44 -0500 Subject: [PATCH 175/584] Reimplement `pshow @PString` using encoded PByteString --- Plutarch/ByteString.hs | 23 +++++++- Plutarch/Show.hs | 63 +++++++++++++-------- plutarch-test/goldens/show.bench.golden | 20 ++++--- plutarch-test/goldens/show.uplc.eval.golden | 8 ++- plutarch-test/goldens/show.uplc.golden | 20 ++++--- plutarch-test/src/Plutarch/ShowSpec.hs | 9 ++- 6 files changed, 101 insertions(+), 42 deletions(-) diff --git a/Plutarch/ByteString.hs b/Plutarch/ByteString.hs index 4b0f46d4d..1d17b9284 100644 --- a/Plutarch/ByteString.hs +++ b/Plutarch/ByteString.hs @@ -6,6 +6,7 @@ module Plutarch.ByteString ( phexByteStr, pbyteStr, pconsBS, + pelimBS, psliceBS, plengthBS, pindexBS, @@ -16,10 +17,13 @@ import qualified Data.ByteString as BS import Data.Char (toLower) import Data.Word (Word8) import GHC.Stack (HasCallStack) -import Plutarch.Bool (PEq, POrd, (#<), (#<=), (#==)) +import Plutarch.Bool (PEq, POrd, pif, (#<), (#<=), (#==)) import Plutarch.Integer (PInteger) import Plutarch.Internal.Other ( Term, + phoistAcyclic, + plam, + plet, (#), type (:-->), ) @@ -74,6 +78,23 @@ pbyteStr = pconstant pconsBS :: Term s (PInteger :--> PByteString :--> PByteString) pconsBS = punsafeBuiltin PLC.ConsByteString +-- | Case matching on bytestring, as if a list. +pelimBS :: + Term + s + ( PByteString + :--> a -- If bytestring is empty + :--> (PInteger :--> PByteString :--> a) -- If bytestring is non-empty + :--> a + ) +pelimBS = phoistAcyclic $ + plam $ \bs z f -> + plet (plengthBS # bs) $ \n -> + pif (n #== 0) z $ + plet (pindexBS # bs # 0) $ \x -> + plet (psliceBS # 1 # (n - 1) # bs) $ \xs -> + f # x # xs + {- | Slice a 'PByteString' with given start index and slice length. >>> (pslice # 2 # 3 phexByteStr "4102afde5b2a") #== phexByteStr "afde5b" diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs index b48f61f33..755c298de 100644 --- a/Plutarch/Show.hs +++ b/Plutarch/Show.hs @@ -31,7 +31,7 @@ import Generics.SOP ( hmap, ) import Plutarch.Bool (PBool, PEq ((#==)), POrd ((#<)), pif) -import Plutarch.ByteString (PByteString, pindexBS, plengthBS, psliceBS) +import Plutarch.ByteString (PByteString, pconsBS, pelimBS) import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Internal.Generic (PCode, PGeneric, pfrom) @@ -49,7 +49,7 @@ import Plutarch.Internal.Other ( type (:-->), ) import Plutarch.Lift (pconstant) -import Plutarch.String (PString) +import Plutarch.String (PString, pdecodeUtf8, pencodeUtf8) class PShow t where -- | Return the string representation of a Plutarch value @@ -65,11 +65,29 @@ pshow :: PShow a => Term s a -> Term s PString pshow = pshow' False instance PShow PString where - -- FIXME: We ideally want to wrap the string in quotes, and escape it - -- appropriately just like Haskell's Show instance. However, there appears to - -- be no way to do this using Plutus' builtins. So we will just return the - -- string as is. - pshow' _ = id + pshow' _ x = "\"" <> pshowStr # x <> "\"" + where + pshowStr :: Term s (PString :--> PString) + pshowStr = phoistAcyclic $ + plam $ \s -> + pdecodeUtf8 #$ pshowUtf8Bytes #$ pencodeUtf8 # s + pshowUtf8Bytes :: Term s (PByteString :--> PByteString) + pshowUtf8Bytes = phoistAcyclic $ + pfix #$ plam $ \self bs -> + pelimBS # bs + # bs + #$ plam + $ \x xs -> + -- Non-ascii byte sequence will not use bytes < 128. + -- So we are safe to rewrite the lower byte values. + -- https://en.wikipedia.org/wiki/UTF-8#Encoding + let doubleQuote = 34 :: Term _ PInteger -- `"` + escapeSlash = 92 :: Term _ PInteger -- `\` + rec = pconsBS # x #$ self # xs + in pif + (x #== doubleQuote) + (pconsBS # escapeSlash # rec) + rec instance PShow PBool where pshow' _ x = pshowBool # x @@ -105,16 +123,12 @@ instance PShow PInteger where instance PShow PByteString where pshow' _ x = "0x" <> showByteString # x where - showByteString = - phoistAcyclic $ - pfix #$ plam $ \self bs -> - plet (plengthBS # bs) $ \n -> - pif - (n #== 0) - (pconstant @PString "") - $ plet (pindexBS # bs # 0) $ \x -> - plet (psliceBS # 1 # (n - 1) # bs) $ \xs -> - showByte # x <> self # xs + showByteString = phoistAcyclic $ + pfix #$ plam $ \self bs -> + pelimBS # bs + # (pconstant @PString "") + #$ plam + $ \x xs -> showByte # x <> self # xs showByte :: Term s (PInteger :--> PString) showByte = phoistAcyclic $ plam $ \n -> @@ -122,14 +136,13 @@ instance PShow PByteString where plet (prem # n # 16) $ \b -> showNibble # a <> showNibble # b showNibble :: Term s (PInteger :--> PString) - showNibble = - phoistAcyclic $ - plam $ \n -> - pcase perror n $ - flip fmap [0 .. 15] $ \(x :: Int) -> - ( pconstant $ toInteger x - , pconstant @PString $ T.pack $ intToDigit x : [] - ) + showNibble = phoistAcyclic $ + plam $ \n -> + pcase perror n $ + flip fmap [0 .. 15] $ \(x :: Int) -> + ( pconstant $ toInteger x + , pconstant @PString $ T.pack $ intToDigit x : [] + ) pcase :: PEq a => Term s b -> Term s a -> [(Term s a, Term s b)] -> Term s b pcase otherwise x = \case diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index 40cc9cf80..d47050373 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -10,12 +10,18 @@ int.14 {"exBudgetCPU":14274516,"exBudgetMemory":30847,"scriptSizeBytes":317} int.-14 {"exBudgetCPU":14908118,"exBudgetMemory":31652,"scriptSizeBytes":317} int.102 {"exBudgetCPU":18800590,"exBudgetMemory":39265,"scriptSizeBytes":318} int.-102 {"exBudgetCPU":19434192,"exBudgetMemory":40070,"scriptSizeBytes":318} -bytestring.empty {"exBudgetCPU":3089766,"exBudgetMemory":9008,"scriptSizeBytes":401} -bytestring.1 {"exBudgetCPU":10795630,"exBudgetMemory":25140,"scriptSizeBytes":403} -bytestring.2 {"exBudgetCPU":28406394,"exBudgetMemory":65314,"scriptSizeBytes":404} -bytestring.3 {"exBudgetCPU":35125968,"exBudgetMemory":79046,"scriptSizeBytes":405} -bytestring.n {"exBudgetCPU":63349233,"exBudgetMemory":147560,"scriptSizeBytes":405} -bytestring.0 {"exBudgetCPU":18786183,"exBudgetMemory":39380,"scriptSizeBytes":405} +bytestring.empty {"exBudgetCPU":3268404,"exBudgetMemory":9608,"scriptSizeBytes":411} +bytestring.1 {"exBudgetCPU":11331544,"exBudgetMemory":26940,"scriptSizeBytes":413} +bytestring.2 {"exBudgetCPU":29299584,"exBudgetMemory":68314,"scriptSizeBytes":414} +bytestring.3 {"exBudgetCPU":36376434,"exBudgetMemory":83246,"scriptSizeBytes":415} +bytestring.n {"exBudgetCPU":64599699,"exBudgetMemory":151760,"scriptSizeBytes":415} +bytestring.0 {"exBudgetCPU":20036649,"exBudgetMemory":43580,"scriptSizeBytes":415} +str.empty {"exBudgetCPU":2529484,"exBudgetMemory":5617,"scriptSizeBytes":127} +str.hello123 {"exBudgetCPU":28810676,"exBudgetMemory":65009,"scriptSizeBytes":136} +str.quoted {"exBudgetCPU":32374917,"exBudgetMemory":72847,"scriptSizeBytes":137} +str.slash {"exBudgetCPU":25525527,"exBudgetMemory":57585,"scriptSizeBytes":135} +str.unicode {"exBudgetCPU":35389974,"exBudgetMemory":79858,"scriptSizeBytes":138} +str.unicode-quoted {"exBudgetCPU":42518456,"exBudgetMemory":95520,"scriptSizeBytes":140} maybe.nothing {"exBudgetCPU":1458977,"exBudgetMemory":5000,"scriptSizeBytes":354} maybe.just {"exBudgetCPU":15676121,"exBudgetMemory":34060,"scriptSizeBytes":356} either.right {"exBudgetCPU":15766440,"exBudgetMemory":34361,"scriptSizeBytes":370} @@ -25,6 +31,6 @@ list.1 {"exBudgetCPU":10989375,"exBudgetMemory":26452,"scriptSizeBytes":411} list.1,2,3 {"exBudgetCPU":29411680,"exBudgetMemory":66720,"scriptSizeBytes":413} builtinlist.nil {"exBudgetCPU":3519719,"exBudgetMemory":10435,"scriptSizeBytes":401} builtinlist.1,2,3 {"exBudgetCPU":26855742,"exBudgetMemory":56248,"scriptSizeBytes":404} -pair.int-str {"exBudgetCPU":16329624,"exBudgetMemory":35186,"scriptSizeBytes":365} +pair.int-str {"exBudgetCPU":35143888,"exBudgetMemory":77331,"scriptSizeBytes":464} pair.int-list {"exBudgetCPU":41712616,"exBudgetMemory":86350,"scriptSizeBytes":443} rational.1/2 {"exBudgetCPU":23497485,"exBudgetMemory":51676,"scriptSizeBytes":546} \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden index dab615ab1..fe0f3a9aa 100644 --- a/plutarch-test/goldens/show.uplc.eval.golden +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -16,6 +16,12 @@ bytestring.2 (program 1.0.0 "0x14af") bytestring.3 (program 1.0.0 "0x14af03") bytestring.n (program 1.0.0 "0xffffff") bytestring.0 (program 1.0.0 "0x000000") +str.empty (program 1.0.0 "\"\"") +str.hello123 (program 1.0.0 "\"hello123\"") +str.quoted (program 1.0.0 "\"hello\\\"123\"") +str.slash (program 1.0.0 "\"foo\\bar\"") +str.unicode (program 1.0.0 "\"vis-\224-vis\"") +str.unicode-quoted (program 1.0.0 "\"vis-\\\"\224\\\"-vis\"") maybe.nothing (program 1.0.0 "PNothing") maybe.just (program 1.0.0 "PJust 42") either.right (program 1.0.0 "PRight 42") @@ -25,6 +31,6 @@ list.1 (program 1.0.0 "[1]") list.1,2,3 (program 1.0.0 "[1, 2, 3]") builtinlist.nil (program 1.0.0 "[]") builtinlist.1,2,3 (program 1.0.0 "[1, 2, 3]") -pair.int-str (program 1.0.0 "PPair 42 hello") +pair.int-str (program 1.0.0 "PPair 42 \"hello\"") pair.int-list (program 1.0.0 "PPair 42 [1, 2, 3]") rational.1/2 (program 1.0.0 "1/2") \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index 36fd44142..b8be9c983 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -10,12 +10,18 @@ int.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ( int.-14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -14) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.-102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -bytestring.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #14)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #14af)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #14af03)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.n (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #ffffff)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> force (i20 (equalsInteger i1 0) (delay "") (delay ((\i0 -> (\i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i5 i1)) (sliceByteString 1 (subtractInteger i2 1) i3)) (indexByteString i2 0))))) (lengthOfByteString i1)) #000000)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #14)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #14af)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #14af03)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.n (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #ffffff)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #000000)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +str.empty (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "") i2)) (force ifThenElse)) "\"")) +str.hello123 (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "hello123") i2)) (force ifThenElse)) "\"")) +str.quoted (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "hello\"123") i2)) (force ifThenElse)) "\"")) +str.slash (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "foo\\bar") i2)) (force ifThenElse)) "\"")) +str.unicode (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "vis-\224-vis") i2)) (force ifThenElse)) "\"")) +str.unicode-quoted (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "vis-\"\224\"-vis") i2)) (force ifThenElse)) "\"")) maybe.nothing (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> force i1)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) maybe.just (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> i2 42)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) @@ -25,6 +31,6 @@ list.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ( list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) []) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) -pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i16 (appendString ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i2) (appendString i16 i1))))) (\i0 -> i1 42 "hello")) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) " ")) +pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i15 (appendString (i16 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i20 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i19 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i2) (appendString i15 (appendString i18 (appendString (decodeUtf8 (i16 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i21 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i18))))))) (\i0 -> i1 42 "hello")) (\i0 -> force (i14 (equalsInteger i1 0) (delay i2) (delay (force (i14 (equalsInteger i1 1) (delay i3) (delay (force (i14 (equalsInteger i1 2) (delay i4) (delay (force (i14 (equalsInteger i1 3) (delay i5) (delay (force (i14 (equalsInteger i1 4) (delay i6) (delay (force (i14 (equalsInteger i1 5) (delay i7) (delay (force (i14 (equalsInteger i1 6) (delay i8) (delay (force (i14 (equalsInteger i1 7) (delay i9) (delay (force (i14 (equalsInteger i1 8) (delay i10) (delay (force (i14 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") " ") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse)) "\"")) pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i25 i2))) (delay (appendString (i9 (i25 i2)) (appendString ", " (i3 (i26 i2))))))) (i25 i1))))) i1) "]"))))))) (\i0 -> i1 42 [1,2,3])) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ShowSpec.hs b/plutarch-test/src/Plutarch/ShowSpec.hs index 3834fa231..3a86e93a3 100644 --- a/plutarch-test/src/Plutarch/ShowSpec.hs +++ b/plutarch-test/src/Plutarch/ShowSpec.hs @@ -33,6 +33,13 @@ spec = do "3" @| pshow (phexByteStr "14AF03") @== str "0x14af03" "n" @| pshow (phexByteStr "FFFFFF") @== str "0xffffff" "0" @| pshow (phexByteStr "000000") @== str "0x000000" + "str" @\ do + "empty" @| pshow (str "") @== str "\"\"" + "hello123" @| pshow (str "hello123") @== str "\"hello123\"" + "quoted" @| pshow (str "hello\"123") @== str "\"hello\\\"123\"" + "slash" @| pshow (str "foo\\bar") @== str "\"foo\\bar\"" + "unicode" @| pshow (str "vis-à-vis") @== str "\"vis-à-vis\"" + "unicode-quoted" @| pshow (str "vis-\"à\"-vis") @== str "\"vis-\\\"à\\\"-vis\"" "maybe" @\ do "nothing" @| pshow @(PMaybe PInteger) (pcon PNothing) @@ -60,7 +67,7 @@ spec = do "pair" @\ do "int-str" @| pshow (pcon @(PPair PInteger PString) $ PPair 42 "hello") - @== str "PPair 42 hello" + @== str "PPair 42 \"hello\"" "int-list" @| pshow (pcon @(PPair PInteger (PBuiltinList PInteger)) $ PPair 42 $ pconstant [1, 2, 3]) @== str "PPair 42 [1, 2, 3]" From 5e6c0746a32229ad6fadf6a0b6d8305b4ffbebf0 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Tue, 8 Mar 2022 20:00:31 +0100 Subject: [PATCH 176/584] feat: more examples, small changes - added new instance for PData PAsData PDAta - added new test for Las that shows how you can partially verify a record - corrected test --- Plutarch/TryFrom.hs | 4 + ...tion_untrusted_data.dev=false.bench.golden | 10 +- ..._untrusted_data.dev=false.uplc.eval.golden | 2 + ...ation_untrusted_data.dev=false.uplc.golden | 10 +- ...ation_untrusted_data.dev=true.bench.golden | 10 +- ...n_untrusted_data.dev=true.uplc.eval.golden | 2 + ...cation_untrusted_data.dev=true.uplc.golden | 10 +- plutarch-test/src/Plutarch/ApiSpec.hs | 2 +- plutarch-test/src/Plutarch/TryFromSpec.hs | 117 +++++++++++++----- 9 files changed, 117 insertions(+), 50 deletions(-) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 362f365e8..2d7056f5c 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -122,6 +122,10 @@ instance PTryFrom PData PData where type PTryFromExcess PData PData = PUnit ptryFrom opq = runTermCont $ pure $ (opq, pcon PUnit) +instance PTryFrom PData (PAsData PData) where + type PTryFromExcess PData (PAsData PData) = PUnit + ptryFrom opq = runTermCont $ pure (pdata opq, pcon PUnit) + instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) where type PTryFromExcess PData (PAsData (PBuiltinList PData)) = PBuiltinList PData ptryFrom opq = runTermCont $ do diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden index 1adf44948..1979598d3 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden @@ -12,6 +12,8 @@ working.A { test := String, test2 := Integer } == { test := String, test2 := Int working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} working.PDataSum constr 0 {"exBudgetCPU":6024815,"exBudgetMemory":10910,"scriptSizeBytes":171} working.PDataSum constr 1 {"exBudgetCPU":7028371,"exBudgetMemory":12876,"scriptSizeBytes":171} +recovering a record partially vs completely.partially {"exBudgetCPU":5292621,"exBudgetMemory":8440,"scriptSizeBytes":84} +recovering a record partially vs completely.completely {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":96} removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":92} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":5889216,"exBudgetMemory":9972,"scriptSizeBytes":101} @@ -28,7 +30,7 @@ checking PValue and PMap for validity.PValue.valid0 {"exBudgetCPU":7607387,"exBu checking PValue and PMap for validity.PValue.invalid1 {"exBudgetCPU":2310477,"exBudgetMemory":521,"scriptSizeBytes":153} checking PValue and PMap for validity.PValue.valid0maybe {"exBudgetCPU":8292167,"exBudgetMemory":21689,"scriptSizeBytes":160} checking PValue and PMap for validity.PValue.invalid1maybe {"exBudgetCPU":8265080,"exBudgetMemory":20524,"scriptSizeBytes":176} -example.concatenate two lists, legal {"exBudgetCPU":63896970,"exBudgetMemory":125943,"scriptSizeBytes":656} -example.concatenate two lists, illegal (list too short) {"exBudgetCPU":56513317,"exBudgetMemory":105217,"scriptSizeBytes":649} -example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":63748105,"exBudgetMemory":125443,"scriptSizeBytes":656} -example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":67586627,"exBudgetMemory":126281,"scriptSizeBytes":663} \ No newline at end of file +example.concatenate two lists, legal {"exBudgetCPU":83427771,"exBudgetMemory":161141,"scriptSizeBytes":823} +example.concatenate two lists, illegal (list too short) {"exBudgetCPU":78038909,"exBudgetMemory":147115,"scriptSizeBytes":816} +example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":79319097,"exBudgetMemory":147341,"scriptSizeBytes":823} +example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":54379241,"exBudgetMemory":104804,"scriptSizeBytes":844} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden index 52105acd6..bef67719e 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden @@ -12,6 +12,8 @@ working.A { test := String, test2 := Integer } == { test := String, test2 := Int working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) +recovering a record partially vs completely.partially (program 1.0.0 #9f034362617aff) +recovering a record partially vs completely.completely (program 1.0.0 #9f034362617aff) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden index a45caf450..946033a69 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden @@ -12,6 +12,8 @@ working.A { test := String, test2 := Integer } == { test := String, test2 := Int working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d8799f0543666f6fff)) working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87a9f0543666f6fff)) +recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (iData 3) (i4 (bData i5) i6))) (i3 ((\i0 -> i3 i2) (unIData (i2 i1))) (i3 (i2 (unListData (listData (force tailList i1)))) i5))) (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unBData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force headList)) (force tailList)) (force mkCons)) #62617a) [ ])) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (iData 42) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #62617a)))))) (force mkCons)) [ ])) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) @@ -32,7 +34,7 @@ checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 ((\i0 -> , #a149736f6d65546f6b656e01 ) ])) checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) i12))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 8) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay error))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay error))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay error))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i18 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay error))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffd8799f41d003ffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (force (i18 (force nullList (i17 ((\i0 -> i15 (\i0 -> \i0 -> force (i18 i1 (delay i23) (delay ((\i0 -> force (i22 (i4 i1) (delay (i23 i1 (i3 (i21 i2)))) (delay (i3 (i21 i2))))) (i19 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay error) (delay (equalsByteString (unBData (i20 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger 0 i2) (delay (unBData (i24 i1))) (delay error))) (i19 i2)) (i15 i1)) (unConstrData ((\i0 -> i22 (i16 (i17 i1))) (i21 (i22 (i16 i1)))))) (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i11 (i12 i1))))) (unListData (i16 (i17 (i11 i1))))))) (delay (equalsData (i16 (i14 (\i0 -> \i0 -> force (i17 i1 (delay i22) (delay ((\i0 -> force (i21 (equalsByteString (unBData (i19 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (unBData (i23 i1))) (delay error))) (i18 i2)) (i14 i1)) (unConstrData ((\i0 -> i21 (i15 (i16 i1))) (i20 (i21 (i15 i1)))))) (delay error))) (delay (i22 (i19 (i20 i1)) (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i13 (i18 i1)))))) (unListData (i16 ((\i0 -> i18 (i18 (i18 (i18 (i18 (i18 (i11 i1))))))) (i11 i1)))))) (listData (i14 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (i21 (i18 i1) (i2 (i19 i1)))))) i2)))) (delay False))) (delay ()) (delay error))) (i15 (i10 i3))) (i11 (\i0 -> (\i0 -> (\i0 -> i3) (force (i18 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i10 (\i0 -> (\i0 -> (\i0 -> i3) (force (i17 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i16 (i11 i1)) (i15 i2)) ((\i0 -> i16 (i11 i1)) (i15 (i10 i1)))) ((\i0 -> unListData (i15 (i10 i1))) (i14 i4)))) (delay error))) (i9 i2)) (i5 i1)) (unConstrData (i11 (i12 i1)))) (i5 i1))) (i6 (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))))) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (force (i18 (force nullList (i17 ((\i0 -> i15 (\i0 -> \i0 -> force (i18 i1 (delay i23) (delay ((\i0 -> force (i22 (i4 i1) (delay (i23 i1 (i3 (i21 i2)))) (delay (i3 (i21 i2))))) (i19 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay error) (delay (equalsByteString (unBData (i20 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger 0 i2) (delay (unBData (i24 i1))) (delay error))) (i19 i2)) (i15 i1)) (unConstrData ((\i0 -> i22 (i16 (i17 i1))) (i21 (i22 (i16 i1)))))) (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i11 (i12 i1))))) (unListData (i16 (i17 (i11 i1))))))) (delay (equalsData (i16 (i14 (\i0 -> \i0 -> force (i17 i1 (delay i22) (delay ((\i0 -> force (i21 (equalsByteString (unBData (i19 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (unBData (i23 i1))) (delay error))) (i18 i2)) (i14 i1)) (unConstrData ((\i0 -> i21 (i15 (i16 i1))) (i20 (i21 (i15 i1)))))) (delay error))) (delay (i22 (i19 (i20 i1)) (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i13 (i18 i1)))))) (unListData (i16 ((\i0 -> i18 (i18 (i18 (i18 (i18 (i18 (i11 i1))))))) (i11 i1)))))) (listData (i14 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (i21 (i18 i1) (i2 (i19 i1)))))) i2)))) (delay False))) (delay ()) (delay error))) (i15 (i10 i3))) (i11 (\i0 -> (\i0 -> (\i0 -> i3) (force (i18 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i10 (\i0 -> (\i0 -> (\i0 -> i3) (force (i17 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) i14))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i16 (i11 i1)) (i15 i2)) ((\i0 -> i16 (i11 i1)) (i15 (i10 i1)))) ((\i0 -> unListData (i15 (i10 i1))) (i14 i4)))) (delay error))) (i9 i2)) (i5 i1)) (unConstrData (i11 (i12 i1)))) (i5 i1))) (i6 (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))))) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (force (i18 (force nullList (i17 ((\i0 -> i15 (\i0 -> \i0 -> force (i18 i1 (delay i23) (delay ((\i0 -> force (i22 (i4 i1) (delay (i23 i1 (i3 (i21 i2)))) (delay (i3 (i21 i2))))) (i19 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay error) (delay (equalsByteString (unBData (i20 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger 0 i2) (delay (unBData (i24 i1))) (delay error))) (i19 i2)) (i15 i1)) (unConstrData ((\i0 -> i22 (i16 (i17 i1))) (i21 (i22 (i16 i1)))))) (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i11 (i12 i1))))) (unListData (i16 (i17 (i11 i1))))))) (delay (equalsData (i16 (i14 (\i0 -> \i0 -> force (i17 i1 (delay i22) (delay ((\i0 -> force (i21 (equalsByteString (unBData (i19 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (unBData (i23 i1))) (delay error))) (i18 i2)) (i14 i1)) (unConstrData ((\i0 -> i21 (i15 (i16 i1))) (i20 (i21 (i15 i1)))))) (delay error))) (delay (i22 (i19 (i20 i1)) (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i13 (i18 i1)))))) (unListData (i16 ((\i0 -> i18 (i18 (i18 (i18 (i18 (i18 (i11 i1))))))) (i11 i1)))))) (listData (i14 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (i21 (i18 i1) (i2 (i19 i1)))))) i2)))) (delay False))) (delay ()) (delay error))) (i15 (i10 i3))) (i11 (\i0 -> (\i0 -> (\i0 -> i3) (force (i18 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i10 (\i0 -> (\i0 -> (\i0 -> i3) (force (i17 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 8) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i16 (i11 i1)) (i15 i2)) ((\i0 -> i16 (i11 i1)) (i15 (i10 i1)))) ((\i0 -> unListData (i15 (i10 i1))) (i14 i4)))) (delay error))) (i9 i2)) (i5 i1)) (unConstrData (i11 (i12 i1)))) (i5 i1))) (i6 (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))))) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (force (i18 (force nullList (i17 ((\i0 -> i15 (\i0 -> \i0 -> force (i18 i1 (delay i23) (delay ((\i0 -> force (i22 (i4 i1) (delay (i23 i1 (i3 (i21 i2)))) (delay (i3 (i21 i2))))) (i19 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay error) (delay (equalsByteString (unBData (i20 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger 0 i2) (delay (unBData (i24 i1))) (delay error))) (i19 i2)) (i15 i1)) (unConstrData ((\i0 -> i22 (i16 (i17 i1))) (i21 (i22 (i16 i1)))))) (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i11 (i12 i1))))) (unListData (i16 (i17 (i11 i1))))))) (delay (equalsData (i16 (i14 (\i0 -> \i0 -> force (i17 i1 (delay i22) (delay ((\i0 -> force (i21 (equalsByteString (unBData (i19 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (unBData (i23 i1))) (delay error))) (i18 i2)) (i14 i1)) (unConstrData ((\i0 -> i21 (i15 (i16 i1))) (i20 (i21 (i15 i1)))))) (delay error))) (delay (i22 (i19 (i20 i1)) (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i13 (i18 i1)))))) (unListData (i16 ((\i0 -> i18 (i18 (i18 (i18 (i18 (i18 (i11 i1))))))) (i11 i1)))))) (listData (i14 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (i21 (i18 i1) (i2 (i19 i1)))))) i2)))) (delay False))) (delay ()) (delay error))) (i15 (i10 i3))) (i11 (\i0 -> (\i0 -> (\i0 -> i3) (force (i18 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i10 (\i0 -> (\i0 -> (\i0 -> i3) (force (i17 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i16 (i11 i1)) (i15 i2)) ((\i0 -> i16 (i11 i1)) (i15 (i10 i1)))) ((\i0 -> unListData (i15 (i10 i1))) (i14 i4)))) (delay error))) (i9 i2)) (i5 i1)) (unConstrData (i11 (i12 i1)))) (i5 i1))) (i6 (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))))) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden index 3da1c8fee..b843873da 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden @@ -12,6 +12,8 @@ working.A { test := String, test2 := Integer } == { test := String, test2 := Int working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} working.PDataSum constr 0 {"exBudgetCPU":6024815,"exBudgetMemory":10910,"scriptSizeBytes":171} working.PDataSum constr 1 {"exBudgetCPU":7028371,"exBudgetMemory":12876,"scriptSizeBytes":171} +recovering a record partially vs completely.partially {"exBudgetCPU":5292621,"exBudgetMemory":8440,"scriptSizeBytes":84} +recovering a record partially vs completely.completely {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":96} removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":92} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":5889216,"exBudgetMemory":9972,"scriptSizeBytes":101} @@ -28,7 +30,7 @@ checking PValue and PMap for validity.PValue.valid0 {"exBudgetCPU":7607387,"exBu checking PValue and PMap for validity.PValue.invalid1 {"exBudgetCPU":2310477,"exBudgetMemory":521,"scriptSizeBytes":153} checking PValue and PMap for validity.PValue.valid0maybe {"exBudgetCPU":8292167,"exBudgetMemory":21689,"scriptSizeBytes":160} checking PValue and PMap for validity.PValue.invalid1maybe {"exBudgetCPU":8265080,"exBudgetMemory":20524,"scriptSizeBytes":176} -example.concatenate two lists, legal {"exBudgetCPU":64762657,"exBudgetMemory":127907,"scriptSizeBytes":1060} -example.concatenate two lists, illegal (list too short) {"exBudgetCPU":56963317,"exBudgetMemory":105313,"scriptSizeBytes":1053} -example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":64198105,"exBudgetMemory":125539,"scriptSizeBytes":1060} -example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":68336627,"exBudgetMemory":126441,"scriptSizeBytes":1067} \ No newline at end of file +example.concatenate two lists, legal {"exBudgetCPU":84561415,"exBudgetMemory":164005,"scriptSizeBytes":1301} +example.concatenate two lists, illegal (list too short) {"exBudgetCPU":78488909,"exBudgetMemory":147211,"scriptSizeBytes":1294} +example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":79769097,"exBudgetMemory":147437,"scriptSizeBytes":1301} +example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":54529241,"exBudgetMemory":104836,"scriptSizeBytes":1322} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden index 52105acd6..bef67719e 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden @@ -12,6 +12,8 @@ working.A { test := String, test2 := Integer } == { test := String, test2 := Int working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) +recovering a record partially vs completely.partially (program 1.0.0 #9f034362617aff) +recovering a record partially vs completely.completely (program 1.0.0 #9f034362617aff) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden index ebdd12041..0b5e6bcc4 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden @@ -12,6 +12,8 @@ working.A { test := String, test2 := Integer } == { test := String, test2 := Int working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d8799f0543666f6fff)) working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87a9f0543666f6fff)) +recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (iData 3) (i4 (bData i5) i6))) (i3 ((\i0 -> i3 i2) (unIData (i2 i1))) (i3 (i2 (unListData (listData (force tailList i1)))) i5))) (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unBData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force headList)) (force tailList)) (force mkCons)) #62617a) [ ])) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (iData 42) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #62617a)))))) (force mkCons)) [ ])) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) @@ -32,7 +34,7 @@ checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 ((\i0 -> , #a149736f6d65546f6b656e01 ) ])) checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:357:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:310:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:307:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:357:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:310:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:307:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) i14))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:357:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:310:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:307:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 8) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsData ((\i0 -> force (i16 (force nullList (i15 i1)) (delay (i14 i1)) (delay (force (i17 "not a single output" (delay error)))))) (i11 (\i0 -> \i0 -> force (i14 i1 (delay i21) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay (i18 (\i0 -> \i0 -> \i0 -> force (i22 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i25 (i2 (i23 i1)) (delay (\i0 -> \i0 -> i2 (i25 i3))) (delay (i3 i2 (i24 i1)))))))) (\i0 -> equalsData ((\i0 -> i22 (i17 i1)) (i21 i2)) ((\i0 -> i22 (i17 i1)) (i21 (i16 i1)))) ((\i0 -> unListData (i21 (i16 i1))) (i20 i4)))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:357:5-22" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i18 i1)))) (i11 i6) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:310:11-26" (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData ((\i0 -> i18 (i12 (i13 i1))) (i17 (i18 (i12 i1)))))) (delay (force (i19 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:307:11-24" (delay error)))))) (delay (force (i19 "appended something" (delay i21)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i10 (i15 i1)))))) ((\i0 -> unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i9 i1))))))) (i9 i1)))) (i13 (i8 i3))))) (listData (i11 (\i0 -> \i0 -> force (i14 i1 (delay i4) (delay (i20 (i15 i1) (i2 (i16 i1)))))) i1))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i9 (\i0 -> (\i0 -> (\i0 -> i3) (force (i16 (lessThanInteger i1 0) (delay (force (i17 i18 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i8 (\i0 -> (\i0 -> (\i0 -> i3) (force (i15 (lessThanInteger i1 0) (delay (force (i16 i17 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffd8799f41d003ffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) \ No newline at end of file +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (force (i21 (force nullList (i20 ((\i0 -> i18 (\i0 -> \i0 -> force (i21 i1 (delay i28) (delay ((\i0 -> force (i25 (i4 i1) (delay (i28 i1 (i3 (i24 i2)))) (delay (i3 (i24 i2))))) (i22 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (equalsByteString (unBData (i23 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i29 (equalsInteger 1 i2) (delay (force (i30 i18 (delay error)))) (delay (unBData (i27 i1))))) (i22 i2)) (i17 i1)) (unConstrData ((\i0 -> i25 (i19 (i20 i1))) (i24 (i25 (i19 i1)))))) (delay (force (i26 i16 (delay error))))))) (delay (force (i26 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:364:15-26" (delay error)))))) (i18 i2)) (i13 i1)) (unConstrData (i20 (i14 (i15 i1))))) (unListData (i19 (i20 (i14 i1))))))) (delay (equalsData (i19 (i17 (\i0 -> \i0 -> force (i20 i1 (delay i27) (delay ((\i0 -> force (i25 "iteration" (delay (force (i24 (equalsByteString (unBData (i22 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i28 (equalsInteger 1 i2) (delay (force (i29 i17 (delay error)))) (delay (unBData (i26 i1))))) (i21 i2)) (i16 i1)) (unConstrData ((\i0 -> i24 (i18 (i19 i1))) (i23 (i24 (i18 i1)))))) (delay (force (i25 i15 (delay error)))))) (delay (force (i25 "appended something" (delay i27)) (i22 (i23 i1)) (i3 (i23 i2)))) (delay (force (i25 "called without appending" (delay i3)) (i23 i2)))))))) (i16 (i21 i1)))))) (unListData (i19 ((\i0 -> i21 (i21 (i21 (i21 (i21 (i21 (i14 i1))))))) (i14 i1)))))) (listData (i17 (\i0 -> \i0 -> force (i20 i1 (delay i5) (delay (i26 (i21 i1) (i2 (i22 i1)))))) i2)))) (delay False))) (delay ()) (delay (force (i22 "not valid" (delay error)))))) (i18 (i13 i3))) (i14 (\i0 -> (\i0 -> (\i0 -> i3) (force (i21 (lessThanInteger i1 0) (delay (force (i22 i23 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i13 (\i0 -> (\i0 -> (\i0 -> i3) (force (i20 (lessThanInteger i1 0) (delay (force (i21 i22 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i18 (iData 1) (i18 (iData 2) (i18 (iData 3) (i18 (iData 4) (i18 (iData 5) i19)))))) (listData (i18 (iData 6) (i18 (iData 7) (i18 (iData 8) (i18 (iData 9) (i18 (iData 10) i19)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i19 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i19 (i14 i1)) (i18 i2)) ((\i0 -> i19 (i14 i1)) (i18 (i13 i1)))) ((\i0 -> unListData (i18 (i13 i1))) (i17 i4)))) (delay (force (i20 i7 (delay error)))))) (i12 i2)) (i7 i1)) (unConstrData (i14 (i15 i1)))) (i8 i1))) (i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i16 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22") "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:332:11-26") (force (force fstPair))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:329:11-24") (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (force (i21 (force nullList (i20 ((\i0 -> i18 (\i0 -> \i0 -> force (i21 i1 (delay i28) (delay ((\i0 -> force (i25 (i4 i1) (delay (i28 i1 (i3 (i24 i2)))) (delay (i3 (i24 i2))))) (i22 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (equalsByteString (unBData (i23 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i29 (equalsInteger 1 i2) (delay (force (i30 i18 (delay error)))) (delay (unBData (i27 i1))))) (i22 i2)) (i17 i1)) (unConstrData ((\i0 -> i25 (i19 (i20 i1))) (i24 (i25 (i19 i1)))))) (delay (force (i26 i16 (delay error))))))) (delay (force (i26 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:364:15-26" (delay error)))))) (i18 i2)) (i13 i1)) (unConstrData (i20 (i14 (i15 i1))))) (unListData (i19 (i20 (i14 i1))))))) (delay (equalsData (i19 (i17 (\i0 -> \i0 -> force (i20 i1 (delay i27) (delay ((\i0 -> force (i25 "iteration" (delay (force (i24 (equalsByteString (unBData (i22 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i28 (equalsInteger 1 i2) (delay (force (i29 i17 (delay error)))) (delay (unBData (i26 i1))))) (i21 i2)) (i16 i1)) (unConstrData ((\i0 -> i24 (i18 (i19 i1))) (i23 (i24 (i18 i1)))))) (delay (force (i25 i15 (delay error)))))) (delay (force (i25 "appended something" (delay i27)) (i22 (i23 i1)) (i3 (i23 i2)))) (delay (force (i25 "called without appending" (delay i3)) (i23 i2)))))))) (i16 (i21 i1)))))) (unListData (i19 ((\i0 -> i21 (i21 (i21 (i21 (i21 (i21 (i14 i1))))))) (i14 i1)))))) (listData (i17 (\i0 -> \i0 -> force (i20 i1 (delay i5) (delay (i26 (i21 i1) (i2 (i22 i1)))))) i2)))) (delay False))) (delay ()) (delay (force (i22 "not valid" (delay error)))))) (i18 (i13 i3))) (i14 (\i0 -> (\i0 -> (\i0 -> i3) (force (i21 (lessThanInteger i1 0) (delay (force (i22 i23 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i13 (\i0 -> (\i0 -> (\i0 -> i3) (force (i20 (lessThanInteger i1 0) (delay (force (i21 i22 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i18 (iData 1) (i18 (iData 2) (i18 (iData 3) (i18 (iData 4) (i18 (iData 5) i19)))))) (listData (i18 (iData 6) (i18 (iData 7) (i18 (iData 8) (i18 (iData 9) i19))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i19 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i19 (i14 i1)) (i18 i2)) ((\i0 -> i19 (i14 i1)) (i18 (i13 i1)))) ((\i0 -> unListData (i18 (i13 i1))) (i17 i4)))) (delay (force (i20 i7 (delay error)))))) (i12 i2)) (i7 i1)) (unConstrData (i14 (i15 i1)))) (i8 i1))) (i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i16 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22") "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:332:11-26") (force (force fstPair))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:329:11-24") (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (force (i21 (force nullList (i20 ((\i0 -> i18 (\i0 -> \i0 -> force (i21 i1 (delay i28) (delay ((\i0 -> force (i25 (i4 i1) (delay (i28 i1 (i3 (i24 i2)))) (delay (i3 (i24 i2))))) (i22 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (equalsByteString (unBData (i23 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i29 (equalsInteger 1 i2) (delay (force (i30 i18 (delay error)))) (delay (unBData (i27 i1))))) (i22 i2)) (i17 i1)) (unConstrData ((\i0 -> i25 (i19 (i20 i1))) (i24 (i25 (i19 i1)))))) (delay (force (i26 i16 (delay error))))))) (delay (force (i26 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:364:15-26" (delay error)))))) (i18 i2)) (i13 i1)) (unConstrData (i20 (i14 (i15 i1))))) (unListData (i19 (i20 (i14 i1))))))) (delay (equalsData (i19 (i17 (\i0 -> \i0 -> force (i20 i1 (delay i27) (delay ((\i0 -> force (i25 "iteration" (delay (force (i24 (equalsByteString (unBData (i22 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i28 (equalsInteger 1 i2) (delay (force (i29 i17 (delay error)))) (delay (unBData (i26 i1))))) (i21 i2)) (i16 i1)) (unConstrData ((\i0 -> i24 (i18 (i19 i1))) (i23 (i24 (i18 i1)))))) (delay (force (i25 i15 (delay error)))))) (delay (force (i25 "appended something" (delay i27)) (i22 (i23 i1)) (i3 (i23 i2)))) (delay (force (i25 "called without appending" (delay i3)) (i23 i2)))))))) (i16 (i21 i1)))))) (unListData (i19 ((\i0 -> i21 (i21 (i21 (i21 (i21 (i21 (i14 i1))))))) (i14 i1)))))) (listData (i17 (\i0 -> \i0 -> force (i20 i1 (delay i5) (delay (i26 (i21 i1) (i2 (i22 i1)))))) i2)))) (delay False))) (delay ()) (delay (force (i22 "not valid" (delay error)))))) (i18 (i13 i3))) (i14 (\i0 -> (\i0 -> (\i0 -> i3) (force (i21 (lessThanInteger i1 0) (delay (force (i22 i23 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i13 (\i0 -> (\i0 -> (\i0 -> i3) (force (i20 (lessThanInteger i1 0) (delay (force (i21 i22 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i18 (iData 1) (i18 (iData 2) (i18 (iData 3) (i18 (iData 4) (i18 (iData 5) i19)))))) (listData (i18 (iData 6) (i18 (iData 8) (i18 (iData 8) (i18 (iData 9) (i18 (iData 10) i19)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i19 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i19 (i14 i1)) (i18 i2)) ((\i0 -> i19 (i14 i1)) (i18 (i13 i1)))) ((\i0 -> unListData (i18 (i13 i1))) (i17 i4)))) (delay (force (i20 i7 (delay error)))))) (i12 i2)) (i7 i1)) (unConstrData (i14 (i15 i1)))) (i8 i1))) (i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i16 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22") "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:332:11-26") (force (force fstPair))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:329:11-24") (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (force (i21 (force nullList (i20 ((\i0 -> i18 (\i0 -> \i0 -> force (i21 i1 (delay i28) (delay ((\i0 -> force (i25 (i4 i1) (delay (i28 i1 (i3 (i24 i2)))) (delay (i3 (i24 i2))))) (i22 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (equalsByteString (unBData (i23 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i29 (equalsInteger 1 i2) (delay (force (i30 i18 (delay error)))) (delay (unBData (i27 i1))))) (i22 i2)) (i17 i1)) (unConstrData ((\i0 -> i25 (i19 (i20 i1))) (i24 (i25 (i19 i1)))))) (delay (force (i26 i16 (delay error))))))) (delay (force (i26 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:364:15-26" (delay error)))))) (i18 i2)) (i13 i1)) (unConstrData (i20 (i14 (i15 i1))))) (unListData (i19 (i20 (i14 i1))))))) (delay (equalsData (i19 (i17 (\i0 -> \i0 -> force (i20 i1 (delay i27) (delay ((\i0 -> force (i25 "iteration" (delay (force (i24 (equalsByteString (unBData (i22 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i28 (equalsInteger 1 i2) (delay (force (i29 i17 (delay error)))) (delay (unBData (i26 i1))))) (i21 i2)) (i16 i1)) (unConstrData ((\i0 -> i24 (i18 (i19 i1))) (i23 (i24 (i18 i1)))))) (delay (force (i25 i15 (delay error)))))) (delay (force (i25 "appended something" (delay i27)) (i22 (i23 i1)) (i3 (i23 i2)))) (delay (force (i25 "called without appending" (delay i3)) (i23 i2)))))))) (i16 (i21 i1)))))) (unListData (i19 ((\i0 -> i21 (i21 (i21 (i21 (i21 (i21 (i14 i1))))))) (i14 i1)))))) (listData (i17 (\i0 -> \i0 -> force (i20 i1 (delay i5) (delay (i26 (i21 i1) (i2 (i22 i1)))))) i2)))) (delay False))) (delay ()) (delay (force (i22 "not valid" (delay error)))))) (i18 (i13 i3))) (i14 (\i0 -> (\i0 -> (\i0 -> i3) (force (i21 (lessThanInteger i1 0) (delay (force (i22 i23 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i13 (\i0 -> (\i0 -> (\i0 -> i3) (force (i20 (lessThanInteger i1 0) (delay (force (i21 i22 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i18 (iData 1) (i18 (iData 2) (i18 (iData 3) (i18 (iData 4) (i18 (iData 5) i19)))))) (listData (i18 (iData 6) (i18 (iData 7) (i18 (iData 8) (i18 (iData 9) (i18 (iData 10) i19)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i19 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i19 (i14 i1)) (i18 i2)) ((\i0 -> i19 (i14 i1)) (i18 (i13 i1)))) ((\i0 -> unListData (i18 (i13 i1))) (i17 i4)))) (delay (force (i20 i7 (delay error)))))) (i12 i2)) (i7 i1)) (unConstrData (i14 (i15 i1)))) (i8 i1))) (i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i16 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22") "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:332:11-26") (force (force fstPair))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:329:11-24") (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index b73d0d04f..1c0eabe56 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -1,4 +1,4 @@ -module Plutarch.ApiSpec (spec, ctx, info, purpose) where +module Plutarch.ApiSpec (spec, ctx, info, purpose, validator, datum) where import Test.Syd import Test.Tasty.HUnit diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index 6a2f5dd05..a7fb0abab 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -1,4 +1,5 @@ {-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-} @@ -7,11 +8,14 @@ module Plutarch.TryFromSpec (spec) where import Test.Syd import Plutus.V1.Ledger.Api ( + Address (Address), + Credential (ScriptCredential), Datum (Datum), DatumHash, ScriptContext (ScriptContext), ToData (toBuiltinData), - TxInfo (txInfoData), + TxInfo (txInfoData, txInfoOutputs), + TxOut (TxOut, txOutAddress, txOutDatumHash, txOutValue), ) import PlutusTx ( @@ -37,6 +41,8 @@ import Plutarch.Api.V1 ( PTokenName, PTuple, PTxInInfo, + PTxInfo, + PTxOut, PTxOutRef, PValidator, PValue, @@ -53,6 +59,7 @@ import Plutarch.TryFrom ( ) import Plutarch.ApiSpec (info, purpose) +import qualified Plutarch.ApiSpec as Api import Plutarch.Maybe (pfromMaybe) import Plutarch.Test import Plutus.V1.Ledger.Value (Value) @@ -132,12 +139,25 @@ spec = do @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) (punsafeCoerce $ pconstant $ Constr 0 [I 5, B "foo"]) - @-> psucceeds + @-> psucceeds "PDataSum constr 1" @| checkDeep @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) (punsafeCoerce $ pconstant $ Constr 1 [I 5, B "foo"]) + @-> psucceeds + "recovering a record partially vs completely" @\ do + "partially" + @| checkDeep + @(PDataRecord '["foo" ':= PInteger, "bar" ':= PData]) + @(PDataRecord '["foo" ':= PInteger, "bar" ':= PByteString]) + (pdata $ pdcons @"foo" # (pdata $ pconstant 3) #$ pdcons @"bar" # (pdata $ pconstant "baz") # pdnil) + @-> psucceeds + "completely" + @| checkDeep + @(PDataRecord '["foo" ':= PInteger, "bar" ':= PByteString]) + @(PDataRecord '["foo" ':= PInteger, "bar" ':= PByteString]) + (pdata (pdcons @"foo" # (pdata $ pconstant 3) #$ pdcons @"bar" # (pdata $ pconstant "baz") # pdnil)) @-> psucceeds "removing the data wrapper" @\ do "erroneous" @\ do @@ -225,8 +245,8 @@ spec = do "invalid1maybe" @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ pconstant $ illegalValue1)) @-> pfails "example" @\ do - let validContext = ctx validList1 - invalidContext = ctx invalidList1 + let validContext0 = ctx validOutputs0 validList1 + invalidContext1 = ctx invalidOutputs1 validList1 l1 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) l1 = toDatadList [1 .. 5] l2 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) @@ -236,13 +256,13 @@ spec = do l4 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) l4 = toDatadList [6, 8, 8, 9, 10] "concatenate two lists, legal" - @| validator # pforgetData l1 # pforgetData l2 # validContext @-> psucceeds + @| validator # pforgetData l1 # pforgetData l2 # validContext0 @-> psucceeds "concatenate two lists, illegal (list too short)" - @| validator # pforgetData l1 # pforgetData l3 # validContext @-> pfails + @| validator # pforgetData l1 # pforgetData l3 # validContext0 @-> pfails "concatenate two lists, illegal (wrong elements in list)" - @| validator # pforgetData l1 # pforgetData l4 # validContext @-> pfails + @| validator # pforgetData l1 # pforgetData l4 # validContext0 @-> pfails "concatenate two lists, illegal (more than one output)" - @| validator # pforgetData l1 # pforgetData l2 # invalidContext @-> pfails + @| validator # pforgetData l1 # pforgetData l2 # invalidContext1 @-> pfails ------------------- Checking deeply, shallowly and unwrapping ---------------------- @@ -302,6 +322,8 @@ validator = phoistAcyclic $ (_, trustedDatum) <- TermCont (ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) dat) -- make the Datum and Redeemer trusted + txInfo :: (Term _ PTxInfo) <- tcont $ plet $ pfield @"txInfo" # ctx + let ownHash :: Term _ PDatumHash ownHash = unTermCont $ do PJust ownInput <- tcont $ pmatch $ pfindOwnInput # ctx @@ -311,8 +333,11 @@ validator = phoistAcyclic $ pure $ pfield @"_0" # datumHash -- find own script address matching DatumHash - outputs :: Term _ (PBuiltinList (PAsData (PTuple PDatumHash PDatum))) - outputs = pfield @"data" #$ pfield @"txInfo" # ctx + data' :: Term _ (PBuiltinList (PAsData (PTuple PDatumHash PDatum))) + data' = pfield @"data" # txInfo + + outputs :: Term _ (PBuiltinList (PAsData PTxOut)) + outputs = pfield @"outputs" # txInfo -- find the list of the outputs matchingHashDatum :: Term _ (PBuiltinList PDatum) @@ -322,21 +347,23 @@ validator = phoistAcyclic $ \tup -> ptrace "iteration" $ pif - (hrecField @"_0" tup #== ownHash) - (ptrace "appended something" pcons # (hrecField @"_1" tup) # (self # xs)) + (tup._0 #== ownHash) + (ptrace "appended something" pcons # (tup._1) # (self # xs)) (ptrace "called without appending" self # xs) ) (const pnil) - #$ outputs + #$ data' -- filter and map at the same time, as there is no efficient way -- to do that with tools available, I wrote it by hand - singleOutput :: Term _ PDatum - singleOutput = plet matchingHashDatum $ \dat -> - pif - (pnull #$ ptail # dat) - (phead # dat) - (ptraceError "not a single output") + singleOutput :: Term _ PBool + singleOutput = pnull #$ ptail #$ pfilter # pred # outputs + where + pred :: Term _ (PAsData PTxOut :--> PBool) + pred = plam $ \out -> unTermCont $ do + PDJust dhash <- tcont $ pmatch (pfield @"datumHash" # out) + pure $ pfield @"_0" # dhash #== ownHash + -- make sure that after filtering the outputs, only one output -- remains @@ -345,7 +372,7 @@ validator = phoistAcyclic $ -- the resulting list with trusted datum and trusted redeemer isValid :: Term _ PBool - isValid = (pto singleOutput) #== pforgetData resultList + isValid = pif singleOutput (pto (phead # matchingHashDatum) #== pforgetData resultList) (pcon PFalse) -- the final check for validity pure $ pif isValid (popaque $ pcon PUnit) (ptraceError "not valid") @@ -354,9 +381,9 @@ pfindOwnInput :: Term s (PScriptContext :--> PMaybe (PAsData PTxInInfo)) pfindOwnInput = phoistAcyclic $ plam $ \ctx' -> unTermCont $ do ctx <- tcont $ pletFields @["txInfo", "purpose"] ctx' - PSpending txoutRef <- tcont $ pmatch $ hrecField @"purpose" ctx + PSpending txoutRef <- tcont $ pmatch $ ctx.purpose let txInInfos :: Term _ (PBuiltinList (PAsData PTxInInfo)) - txInInfos = pfield @"inputs" #$ hrecField @"txInfo" ctx + txInInfos = pfield @"inputs" #$ ctx.txInfo target :: Term _ PTxOutRef target = pfield @"_0" # txoutRef pred :: Term _ (PAsData PTxInInfo :--> PBool) @@ -384,11 +411,41 @@ pfind = phoistAcyclic $ ------------------- Mocking a ScriptContext ---------------------------------------- -ctx :: [(DatumHash, Datum)] -> Term s PScriptContext -ctx l = pconstant (ScriptContext (info' l) purpose) - -info' :: [(DatumHash, Datum)] -> TxInfo -info' dat = info {txInfoData = dat} +ctx :: [TxOut] -> [(DatumHash, Datum)] -> Term s PScriptContext +ctx outs l = pconstant (ScriptContext (info' outs l) purpose) + +info' :: [TxOut] -> [(DatumHash, Datum)] -> TxInfo +info' outs dat = + info + { txInfoData = dat + , txInfoOutputs = outs + } + +validOutputs0 :: [TxOut] +validOutputs0 = + [ TxOut + { txOutAddress = + Address (ScriptCredential Api.validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Just Api.datum + } + ] + +invalidOutputs1 :: [TxOut] +invalidOutputs1 = + [ TxOut + { txOutAddress = + Address (ScriptCredential Api.validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Just Api.datum + } + , TxOut + { txOutAddress = + Address (ScriptCredential Api.validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Nothing + } + ] validList1 :: [(DatumHash, Datum)] validList1 = @@ -396,12 +453,6 @@ validList1 = dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] in [("d0", dat)] -invalidList1 :: [(DatumHash, Datum)] -invalidList1 = - let dat :: Datum - dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] - in [("d0", dat), ("d0", Datum $ toBuiltinData @Integer 3)] - ------------------- Helpers -------------------------------------------------------- toDatadList :: [Integer] -> Term s (PAsData (PBuiltinList (PAsData PInteger))) From c143038d1792f3ac25dadaee6a36ae48fc73b3d2 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 8 Mar 2022 14:51:16 -0500 Subject: [PATCH 177/584] Refactor old Generic code to use PGeneric, pfrom, pto Also adds `pto`, analogous to `pfrom`. As a consequence, we are able to eliminate a bunch of coercible related constraints from our generic code. --- Plutarch/DataRepr/Internal.hs | 63 ++++++++++++--------------- Plutarch/Internal/Generic.hs | 28 +++++++----- Plutarch/Internal/PlutusType.hs | 75 ++++++++++----------------------- 3 files changed, 67 insertions(+), 99 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 15dd6f53a..60d0ab788 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -38,22 +38,15 @@ import GHC.TypeLits ( import Generics.SOP ( All, All2, - AllZipN, Code, Generic, - I (I), K (K), - LiftedCoercible, NP (Nil, (:*)), - POP, SListI, SOP (SOP), - from, hcmap, hcollapse, - hfromI, hindex, - to, ) import Plutarch ( Dig, @@ -92,8 +85,8 @@ import Plutarch.Builtin ( import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) import Plutarch.Integer (PInteger) import Plutarch.Internal (S (SI)) -import Plutarch.Internal.Generic (MkSum (mkSum)) -import Plutarch.Internal.TypeFamily (ToPType2) +import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, pfrom) +import qualified Plutarch.Internal.Generic as G import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) @@ -151,10 +144,10 @@ data PLabeledType = Symbol := PType {- Get the product types of a data record sum constructor -} -type PDataRecordFields :: [Type] -> [PLabeledType] +type PDataRecordFields :: [PType] -> [PLabeledType] type family PDataRecordFields as where PDataRecordFields '[] = '[] - PDataRecordFields '[Term s (PDataRecord fs)] = fs + PDataRecordFields '[(PDataRecord fs)] = fs PDataRecordFields '[t] = TypeError ( 'Text "Expected PDataRecord" ':<>: 'Text "but got" ':<>: 'ShowType t) PDataRecordFields ts = TypeError ( 'Text "Expected none or PDataRecord" ':<>: 'Text "but got" ':<>: 'ShowType ts) @@ -162,7 +155,7 @@ type family PDataRecordFields as where NOTE: Unfortunately we can't write a generic FMap due to ghc's arity limitations. -} -type PDataRecordFields2 :: [[Type]] -> [[PLabeledType]] +type PDataRecordFields2 :: [[PType]] -> [[PLabeledType]] type family PDataRecordFields2 as where PDataRecordFields2 '[] = '[] PDataRecordFields2 (a ': as) = PDataRecordFields a ': PDataRecordFields2 as @@ -276,81 +269,81 @@ newtype PIsDataReprInstances (a :: PType) (s :: S) = PIsDataReprInstances (a s) -- TODO: This 'PMatch' constraint needs to be changed to 'PlutusType (breaking change). class (PMatch a, PIsData a) => PIsDataRepr (a :: PType) where type PIsDataReprRepr a :: [[PLabeledType]] - type PIsDataReprRepr a = PDataRecordFields2 (Code (a 'SI)) + type PIsDataReprRepr a = PDataRecordFields2 (PCode 'SI a) pconRepr :: a s -> Term s (PDataSum (PIsDataReprRepr a)) default pconRepr :: forall s code pcode. - ( Generic (a s) + ( PGeneric s a , code ~ Code (a s) - , pcode ~ ToPType2 code + , pcode ~ PCode s a , All SListI pcode , All Singleton code , All2 IsBuiltinList pcode - , AllZipN POP (LiftedCoercible I (Term s)) code pcode ) => a s -> Term s (PDataSum (PIsDataReprRepr a)) pconRepr x = punsafeCoerce expected where expected :: Term _ (PAsData (PBuiltinPair PInteger (PBuiltinList PData))) - expected = gpconRepr @a $ from x + expected = gpconRepr @a $ pfrom x pmatchRepr :: forall s b. Term s (PDataSum (PIsDataReprRepr a)) -> (a s -> Term s b) -> Term s b default pmatchRepr :: - forall s b code. + forall s b code pcode. ( code ~ Code (a s) - , PDataRecordFields2 code ~ PIsDataReprRepr a - , MkDataReprHandler s a 0 code + , pcode ~ PCode s a + , PDataRecordFields2 pcode ~ PIsDataReprRepr a + , MkDataReprHandler s a 0 pcode ) => Term s (PDataSum (PIsDataReprRepr a)) -> (a s -> Term s b) -> Term s b pmatchRepr dat = - pmatchDataSum dat . mkDataReprHandler @s @a @0 @code + pmatchDataSum dat . mkDataReprHandler @s @a @0 @pcode gpconRepr :: forall a s code pcode. ( Generic (a s) , code ~ Code (a s) - , pcode ~ ToPType2 code + , pcode ~ PCode s a , All SListI pcode , All Singleton code , All2 IsBuiltinList pcode - , AllZipN POP (LiftedCoercible I (Term s)) code pcode ) => - SOP I (Code (a s)) -> + SOP (Term s) pcode -> Term s (PAsData (PBuiltinPair PInteger (PBuiltinList PData))) gpconRepr x = pconstrBuiltin # pconstant (toInteger $ hindex sop) # head (hcollapse sop) where sop :: SOP (K (Term s (PBuiltinList PData))) pcode - sop = hcmap (Proxy @IsBuiltinList) (K . dataListFrom) $ hfromI x + sop = hcmap (Proxy @IsBuiltinList) (K . dataListFrom) x -- | Create a `DataReprhandlers` starting from `n`th sum constructor -class MkDataReprHandler (s :: S) (a :: PType) (n :: Nat) (rest :: [[Type]]) where +class MkDataReprHandler (s :: S) (a :: PType) (n :: Nat) (rest :: [[PType]]) where mkDataReprHandler :: forall out. (a s -> Term s out) -> DataReprHandlers out (PDataRecordFields2 rest) s instance MkDataReprHandler s a n '[] where mkDataReprHandler _ = DRHNil instance - ( Generic (a s) + ( PGeneric s a , code ~ Code (a s) - , r ~ IndexList n code - , r ~ '[Term s (PDataRecord fs)] - , MkSum n code + , pcode ~ PCode s a + , r ~ IndexList n pcode + , r ~ '[(PDataRecord fs)] + , MkSum n pcode (Term s) , MkDataReprHandler s a (n + 1) rs ) => MkDataReprHandler s a n (r ': rs) where mkDataReprHandler f = - DRHCons (f . to . mkSOP . mkProduct) $ + DRHCons (f . G.pto . mkSOP . mkProduct) $ mkDataReprHandler @s @a @(n + 1) @rs f where - mkProduct :: Term s (PDataRecord fs) -> NP I r - mkProduct x = I x :* Nil - mkSOP :: NP I r -> SOP I (Code (a s)) - mkSOP = SOP . mkSum @n @code + mkProduct :: Term s (PDataRecord fs) -> NP (Term s) r + mkProduct x = x :* Nil + mkSOP :: NP (Term s) r -> SOP (Term s) (PCode s a) + mkSOP = SOP . mkSum @_ @n @pcode pasDataSum :: PIsDataRepr a => Term s a -> Term s (PDataSum (PIsDataReprRepr a)) pasDataSum = punsafeCoerce diff --git a/Plutarch/Internal/Generic.hs b/Plutarch/Internal/Generic.hs index 0d466bc88..8fb074c49 100644 --- a/Plutarch/Internal/Generic.hs +++ b/Plutarch/Internal/Generic.hs @@ -8,6 +8,7 @@ module Plutarch.Internal.Generic ( PGeneric, PCode, pfrom, + pto, -- * Helpers for when existing generics-sop combinators are insufficient. MkSum (mkSum), @@ -15,7 +16,7 @@ module Plutarch.Internal.Generic ( import Data.Kind (Constraint, Type) import GHC.TypeLits (Nat, type (-)) -import Generics.SOP (All, AllZip, Code, Generic (from), I, LiftedCoercible, NP, NS (S, Z), SOP, SameShapeAs, Top, hfromI) +import Generics.SOP (All, AllZip, Code, Generic (from, to), I, LiftedCoercible, NP, NS (S, Z), SOP, SameShapeAs, Top, hfromI, htoI) import Generics.SOP.Constraint (AllZipF) import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Internal (PType, S, Term) @@ -25,10 +26,11 @@ import Plutarch.Internal.TypeFamily (ToPType2) type PGeneric :: S -> PType -> Constraint type PGeneric s a = ( Generic (a s) - , SameShapeAs (Code (a s)) (ToPType2 (Code (a s))) - , SameShapeAs (ToPType2 (Code (a s))) (Code (a s)) - , AllZipF (AllZip (LiftedCoercible I (Term s))) (Code (a s)) (ToPType2 (Code (a s))) - , All Top (ToPType2 (Code (a s))) + , SameShapeAs (Code (a s)) (PCode s a) + , SameShapeAs (PCode s a) (Code (a s)) + , AllZipF (AllZip (LiftedCoercible I (Term s))) (Code (a s)) (PCode s a) + , AllZipF (AllZip (LiftedCoercible (Term s) I)) (PCode s a) (Code (a s)) + , All Top (PCode s a) ) -- | Like `Code` but for Plutarch types @@ -41,6 +43,10 @@ type PCode s a = ToPType2 (Code (a s)) pfrom :: PGeneric s a => a s -> SOP (Term s) (PCode s a) pfrom = hfromI . from +-- | Like `to` but for Plutarch terms. Analogous to `pfrom`. +pto :: PGeneric s a => SOP (Term s) (PCode s a) -> a s +pto = to . htoI + {- | Infrastructure to create a single sum constructor given its type index and value. @@ -50,17 +56,17 @@ Infrastructure to create a single sum constructor given its type index and value It is type-checked that the `x` here matches the type of nth constructor of `a`. -} -class MkSum (idx :: Nat) (xss :: [[Type]]) where - mkSum :: NP I (IndexList idx xss) -> NS (NP I) xss +class MkSum (idx :: Nat) (xss :: [[k]]) (f :: k -> Type) where + mkSum :: NP f (IndexList idx xss) -> NS (NP f) xss -instance {-# OVERLAPPING #-} MkSum 0 (xs ': xss) where +instance {-# OVERLAPPING #-} MkSum 0 (xs ': xss) f where mkSum = Z instance {-# OVERLAPPABLE #-} - ( MkSum (idx - 1) xss + ( MkSum (idx - 1) xss f , IndexList idx (xs ': xss) ~ IndexList (idx - 1) xss ) => - MkSum idx (xs ': xss) + MkSum idx (xs ': xss) f where - mkSum x = S $ mkSum @(idx - 1) @xss x + mkSum x = S $ mkSum @_ @(idx - 1) @xss x diff --git a/Plutarch/Internal/PlutusType.hs b/Plutarch/Internal/PlutusType.hs index e2a0db443..ea5e0941f 100644 --- a/Plutarch/Internal/PlutusType.hs +++ b/Plutarch/Internal/PlutusType.hs @@ -9,28 +9,19 @@ module Plutarch.Internal.PlutusType ( ) where import Data.Kind (Type) -import Data.SOP.Constraint (AllZipF) import GHC.TypeLits (ErrorMessage (Text), Nat, TypeError, type (+)) import Generics.SOP ( All, - AllZip, - AllZipN, - Generic (..), - I, - LiftedCoercible, - NP (..), - NS (..), - Prod, + Generic (Code), + NP (Nil, (:*)), + NS (S, Z), SOP (SOP), - SameShapeAs, Top, - hcoerce, - unSOP, ) import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Internal (PType, S, Term, pforce, plam', punsafeCoerce, (:-->)) import qualified Plutarch.Internal as PI -import Plutarch.Internal.Generic (MkSum (mkSum)) +import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, pfrom, pto) import Plutarch.Internal.PLam ((#)) import Plutarch.Internal.TypeFamily (ToPType, ToPType2) @@ -99,27 +90,24 @@ class (PCon a, PMatch a) => PlutusType (a :: PType) where default pcon' :: forall s b code pcode. ( code ~ Code (a s) - , pcode ~ ToPType2 code - , Generic (a s) + , pcode ~ PCode s a + , PGeneric s a , GPCon pcode b s , PLamL (ScottList' s pcode b) b s , ScottFn' (ScottList s pcode b) b ~ PInner a b , ScottFn (ScottList' s pcode b) b ~ PInner a b - , AllZipF (AllZip (LiftedCoercible I (Term s))) code pcode - , SameShapeAs code pcode - , SameShapeAs pcode code , All Top pcode ) => a s -> Term s (PInner a b) - pcon' x = gpcon @a @b $ from x + pcon' x = gpcon @a @b $ pfrom x pmatch' :: forall s b. (Term s (PInner a b)) -> (a s -> Term s b) -> Term s b default pmatch' :: forall s b code pcode. ( code ~ Code (a s) - , pcode ~ ToPType2 code - , Generic (a s) + , pcode ~ PCode s a + , PGeneric s a , AppL b (ScottList' s pcode b) , GPMatch a 0 code b s , PInner a b ~ ScottFn (ScottList' s pcode b) b @@ -127,7 +115,7 @@ class (PCon a, PMatch a) => PlutusType (a :: PType) where (Term s (PInner a b)) -> (a s -> Term s b) -> Term s b - pmatch' x f = gpmatch @a x (f . to) + pmatch' x f = gpmatch @a x (f . pto) instance {-# OVERLAPPABLE #-} PlutusType a => PMatch a where pmatch x f = pmatch' (punsafeCoerce x) f @@ -147,23 +135,18 @@ class PMatch a where gpcon :: forall a c s code pcode. ( PlutusType a - , Generic (a s) + , PGeneric s a , code ~ Code (a s) - , pcode ~ ToPType2 code + , pcode ~ PCode s a , GPCon pcode c s , PLamL (ScottList' s pcode c) c s , ScottFn (ScottList' s pcode c) c ~ ScottFn' (ScottList s pcode c) c - , AllZipN (Prod SOP) (LiftedCoercible I (Term s)) code pcode ) => - SOP I (Code (a s)) -> + SOP (Term s) pcode -> Term s (ScottFn' (ScottList s pcode c) c) -gpcon val = +gpcon (SOP val) = plamL @(ScottList' s pcode c) @c $ \(f :: NP (Term s) (ScottList' s pcode c)) -> - gpcon' @pcode @c @s f $ - unSOP $ pSop val - where - pSop :: AllZipN (Prod SOP) (LiftedCoercible I (Term s)) xss (ToPType2 xss) => SOP I xss -> SOP (Term s) (ToPType2 xss) - pSop = hcoerce + gpcon' @pcode @c @s f val {- | `gpcon'`, given a *partial* scott encoding (as a `PLamL`) and a sum choice, applies @@ -188,14 +171,14 @@ instance (GPCon xs c s, AppL c x) => GPCon (x ': xs) c s where -} gpmatch :: forall a s c code pcode. - ( Generic (a s) + ( PGeneric s a , code ~ Code (a s) - , pcode ~ ToPType2 code + , pcode ~ PCode s a , AppL c (ScottList' s pcode c) , GPMatch a 0 code c s ) => Term s (ScottFn (ScottList' s pcode c) c) -> - (SOP I (Code (a s)) -> Term s c) -> + (SOP (Term s) pcode -> Term s c) -> Term s c gpmatch x f = x `appL` gpmatch' @a @0 @code @c @s f @@ -205,39 +188,25 @@ gpmatch x f = scott encoding function. -} class GPMatch (a :: PType) (n :: Nat) (xss :: [[Type]]) (c :: PType) (s :: S) where - gpmatch' :: (SOP I (Code (a s)) -> Term s c) -> NP (Term s) (ScottList' s (ToPType2 xss) c) + gpmatch' :: (SOP (Term s) (PCode s a) -> Term s c) -> NP (Term s) (ScottList' s (ToPType2 xss) c) instance GPMatch a n '[] c s where gpmatch' _ = Nil instance ( code ~ Code (a s) - , xs ~ IndexList n code + , ToPType xs ~ IndexList n (PCode s a) , GPMatch a (n + 1) xss c s , PLamL (ToPType xs) c s - , MkSum n (Code (a s)) - , AllZipF (LiftedCoercible (Term s) I) (ToPType xs) xs - , SameShapeAs xs (ToPType xs) - , SameShapeAs (ToPType xs) xs + , MkSum n (PCode s a) (Term s) , All Top (ToPType xs) , All Top xs ) => GPMatch a n (xs : xss) c s where gpmatch' f = - plamL @(ToPType xs) @c (f . SOP . mkSum @n @(Code (a s)) . unPsop) + plamL @(ToPType xs) @c (f . SOP . mkSum @_ @n @(PCode s a) @(Term s)) :* gpmatch' @a @(n + 1) @xss @c @s f - where - unPsop :: - ( AllZipF (LiftedCoercible (Term s) I) (ToPType xs) xs - , SameShapeAs xs (ToPType xs) - , SameShapeAs (ToPType xs) xs - , All Top (ToPType xs) - , All Top xs - ) => - NP (Term s) (ToPType xs) -> - NP I xs - unPsop = hcoerce {- | `plamL` is like `plamL'`, but pdelays the 0-arity case. From 98b24cda78cedde3ab277ec1c4914ae9c3809b78 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 8 Mar 2022 19:19:12 -0500 Subject: [PATCH 178/584] pshow: hoist @PString, @PByteString; unexport pelimBS --- Plutarch/ByteString.hs | 23 +------------------- Plutarch/Show.hs | 28 +++++++++++++++++++++---- plutarch-test/goldens/show.bench.golden | 24 ++++++++++----------- plutarch-test/goldens/show.uplc.golden | 24 ++++++++++----------- 4 files changed, 49 insertions(+), 50 deletions(-) diff --git a/Plutarch/ByteString.hs b/Plutarch/ByteString.hs index 1d17b9284..4b0f46d4d 100644 --- a/Plutarch/ByteString.hs +++ b/Plutarch/ByteString.hs @@ -6,7 +6,6 @@ module Plutarch.ByteString ( phexByteStr, pbyteStr, pconsBS, - pelimBS, psliceBS, plengthBS, pindexBS, @@ -17,13 +16,10 @@ import qualified Data.ByteString as BS import Data.Char (toLower) import Data.Word (Word8) import GHC.Stack (HasCallStack) -import Plutarch.Bool (PEq, POrd, pif, (#<), (#<=), (#==)) +import Plutarch.Bool (PEq, POrd, (#<), (#<=), (#==)) import Plutarch.Integer (PInteger) import Plutarch.Internal.Other ( Term, - phoistAcyclic, - plam, - plet, (#), type (:-->), ) @@ -78,23 +74,6 @@ pbyteStr = pconstant pconsBS :: Term s (PInteger :--> PByteString :--> PByteString) pconsBS = punsafeBuiltin PLC.ConsByteString --- | Case matching on bytestring, as if a list. -pelimBS :: - Term - s - ( PByteString - :--> a -- If bytestring is empty - :--> (PInteger :--> PByteString :--> a) -- If bytestring is non-empty - :--> a - ) -pelimBS = phoistAcyclic $ - plam $ \bs z f -> - plet (plengthBS # bs) $ \n -> - pif (n #== 0) z $ - plet (pindexBS # bs # 0) $ \x -> - plet (psliceBS # 1 # (n - 1) # bs) $ \xs -> - f # x # xs - {- | Slice a 'PByteString' with given start index and slice length. >>> (pslice # 2 # 3 phexByteStr "4102afde5b2a") #== phexByteStr "afde5b" diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs index 755c298de..d794d11c9 100644 --- a/Plutarch/Show.hs +++ b/Plutarch/Show.hs @@ -31,7 +31,7 @@ import Generics.SOP ( hmap, ) import Plutarch.Bool (PBool, PEq ((#==)), POrd ((#<)), pif) -import Plutarch.ByteString (PByteString, pconsBS, pelimBS) +import Plutarch.ByteString (PByteString, pconsBS, pindexBS, plengthBS, psliceBS) import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Internal.Generic (PCode, PGeneric, pfrom) @@ -65,12 +65,12 @@ pshow :: PShow a => Term s a -> Term s PString pshow = pshow' False instance PShow PString where - pshow' _ x = "\"" <> pshowStr # x <> "\"" + pshow' _ x = pshowStr # x where pshowStr :: Term s (PString :--> PString) pshowStr = phoistAcyclic $ plam $ \s -> - pdecodeUtf8 #$ pshowUtf8Bytes #$ pencodeUtf8 # s + "\"" <> (pdecodeUtf8 #$ pshowUtf8Bytes #$ pencodeUtf8 # s) <> "\"" pshowUtf8Bytes :: Term s (PByteString :--> PByteString) pshowUtf8Bytes = phoistAcyclic $ pfix #$ plam $ \self bs -> @@ -121,9 +121,12 @@ instance PShow PInteger where (pconstant x, pconstant (T.pack . show $ x)) instance PShow PByteString where - pshow' _ x = "0x" <> showByteString # x + pshow' _ x = showByteString # x where showByteString = phoistAcyclic $ + plam $ \bs -> + "0x" <> showByteString' # bs + showByteString' = phoistAcyclic $ pfix #$ plam $ \self bs -> pelimBS # bs # (pconstant @PString "") @@ -144,6 +147,23 @@ instance PShow PByteString where , pconstant @PString $ T.pack $ intToDigit x : [] ) +-- | Case matching on bytestring, as if a list. +pelimBS :: + Term + s + ( PByteString + :--> a -- If bytestring is empty + :--> (PInteger :--> PByteString :--> a) -- If bytestring is non-empty + :--> a + ) +pelimBS = phoistAcyclic $ + plam $ \bs z f -> + plet (plengthBS # bs) $ \n -> + pif (n #== 0) z $ + plet (pindexBS # bs # 0) $ \x -> + plet (psliceBS # 1 # (n - 1) # bs) $ \xs -> + f # x # xs + pcase :: PEq a => Term s b -> Term s a -> [(Term s a, Term s b)] -> Term s b pcase otherwise x = \case [] -> otherwise diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index d47050373..e583af80d 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -10,18 +10,18 @@ int.14 {"exBudgetCPU":14274516,"exBudgetMemory":30847,"scriptSizeBytes":317} int.-14 {"exBudgetCPU":14908118,"exBudgetMemory":31652,"scriptSizeBytes":317} int.102 {"exBudgetCPU":18800590,"exBudgetMemory":39265,"scriptSizeBytes":318} int.-102 {"exBudgetCPU":19434192,"exBudgetMemory":40070,"scriptSizeBytes":318} -bytestring.empty {"exBudgetCPU":3268404,"exBudgetMemory":9608,"scriptSizeBytes":411} -bytestring.1 {"exBudgetCPU":11331544,"exBudgetMemory":26940,"scriptSizeBytes":413} -bytestring.2 {"exBudgetCPU":29299584,"exBudgetMemory":68314,"scriptSizeBytes":414} -bytestring.3 {"exBudgetCPU":36376434,"exBudgetMemory":83246,"scriptSizeBytes":415} -bytestring.n {"exBudgetCPU":64599699,"exBudgetMemory":151760,"scriptSizeBytes":415} -bytestring.0 {"exBudgetCPU":20036649,"exBudgetMemory":43580,"scriptSizeBytes":415} -str.empty {"exBudgetCPU":2529484,"exBudgetMemory":5617,"scriptSizeBytes":127} -str.hello123 {"exBudgetCPU":28810676,"exBudgetMemory":65009,"scriptSizeBytes":136} -str.quoted {"exBudgetCPU":32374917,"exBudgetMemory":72847,"scriptSizeBytes":137} -str.slash {"exBudgetCPU":25525527,"exBudgetMemory":57585,"scriptSizeBytes":135} -str.unicode {"exBudgetCPU":35389974,"exBudgetMemory":79858,"scriptSizeBytes":138} -str.unicode-quoted {"exBudgetCPU":42518456,"exBudgetMemory":95520,"scriptSizeBytes":140} +bytestring.empty {"exBudgetCPU":3357723,"exBudgetMemory":9908,"scriptSizeBytes":414} +bytestring.1 {"exBudgetCPU":11420863,"exBudgetMemory":27240,"scriptSizeBytes":416} +bytestring.2 {"exBudgetCPU":29388903,"exBudgetMemory":68614,"scriptSizeBytes":417} +bytestring.3 {"exBudgetCPU":36465753,"exBudgetMemory":83546,"scriptSizeBytes":418} +bytestring.n {"exBudgetCPU":64689018,"exBudgetMemory":152060,"scriptSizeBytes":418} +bytestring.0 {"exBudgetCPU":20125968,"exBudgetMemory":43880,"scriptSizeBytes":418} +str.empty {"exBudgetCPU":2529484,"exBudgetMemory":5617,"scriptSizeBytes":128} +str.hello123 {"exBudgetCPU":28810676,"exBudgetMemory":65009,"scriptSizeBytes":137} +str.quoted {"exBudgetCPU":32374917,"exBudgetMemory":72847,"scriptSizeBytes":138} +str.slash {"exBudgetCPU":25525527,"exBudgetMemory":57585,"scriptSizeBytes":136} +str.unicode {"exBudgetCPU":35389974,"exBudgetMemory":79858,"scriptSizeBytes":139} +str.unicode-quoted {"exBudgetCPU":42518456,"exBudgetMemory":95520,"scriptSizeBytes":141} maybe.nothing {"exBudgetCPU":1458977,"exBudgetMemory":5000,"scriptSizeBytes":354} maybe.just {"exBudgetCPU":15676121,"exBudgetMemory":34060,"scriptSizeBytes":356} either.right {"exBudgetCPU":15766440,"exBudgetMemory":34361,"scriptSizeBytes":370} diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index b8be9c983..ba0751890 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -10,18 +10,18 @@ int.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ( int.-14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -14) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) int.-102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -bytestring.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #14)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #14af)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #14af03)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.n (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #ffffff)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -bytestring.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i22 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i7 i2) (i7 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) #000000)) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) -str.empty (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "") i2)) (force ifThenElse)) "\"")) -str.hello123 (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "hello123") i2)) (force ifThenElse)) "\"")) -str.quoted (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "hello\"123") i2)) (force ifThenElse)) "\"")) -str.slash (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "foo\\bar") i2)) (force ifThenElse)) "\"")) -str.unicode (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "vis-\224-vis") i2)) (force ifThenElse)) "\"")) -str.unicode-quoted (program 1.0.0 ((\i0 -> (\i0 -> appendString i2 (appendString ((\i0 -> decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) "vis-\"\224\"-vis") i2)) (force ifThenElse)) "\"")) +bytestring.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #14) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #14af) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #14af03) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.n (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #ffffff) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #000000) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +str.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "") (force ifThenElse)) "\"")) +str.hello123 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "hello123") (force ifThenElse)) "\"")) +str.quoted (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "hello\"123") (force ifThenElse)) "\"")) +str.slash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "foo\\bar") (force ifThenElse)) "\"")) +str.unicode (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "vis-\224-vis") (force ifThenElse)) "\"")) +str.unicode-quoted (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "vis-\"\224\"-vis") (force ifThenElse)) "\"")) maybe.nothing (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> force i1)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) maybe.just (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> i2 42)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) From bfa17965b924c7725cb928a2d10f43c3a6c0c0c8 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 8 Mar 2022 19:24:04 -0500 Subject: [PATCH 179/584] Simplify PUnit's instance, to be consistent with other instances None of the other instances does a `pmatch` on the argument. They ignore it with a wildcard. --- Plutarch/Unit.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Plutarch/Unit.hs b/Plutarch/Unit.hs index f049626da..ec9f14f80 100644 --- a/Plutarch/Unit.hs +++ b/Plutarch/Unit.hs @@ -3,7 +3,7 @@ module Plutarch.Unit (PUnit (..)) where -import Plutarch (PlutusType (PInner, pcon', pmatch'), Term, pcon, pmatch) +import Plutarch (PlutusType (PInner, pcon', pmatch'), Term, pcon) import Plutarch.Bool (PBool (PFalse, PTrue), PEq, POrd, (#<), (#<=), (#==)) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), @@ -15,7 +15,6 @@ import Plutarch.Lift ( import Plutarch.Show (PShow (pshow')) data PUnit s = PUnit - deriving stock (Show) instance PUnsafeLiftDecl PUnit where type PLifted PUnit = () deriving via (DerivePConstantDirect () PUnit) instance (PConstant ()) @@ -39,4 +38,4 @@ instance Monoid (Term s PUnit) where mempty = pcon PUnit instance PShow PUnit where - pshow' _ x = pmatch x $ \PUnit -> "()" + pshow' _ _ = "()" From 0ad3416797b48f58bc04c05fe4b7a733f9386049 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 9 Mar 2022 10:10:50 -0500 Subject: [PATCH 180/584] Rename to gpfrom, gpto --- Plutarch/Bool.hs | 4 ++-- Plutarch/DataRepr/Internal.hs | 7 +++---- Plutarch/Internal/Generic.hs | 14 +++++++------- Plutarch/Internal/PlutusType.hs | 6 +++--- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 62819836d..cb3fdfc97 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -32,7 +32,7 @@ import Generics.SOP ( hcliftA2, ) import Plutarch.Internal (punsafeAsClosedTerm) -import Plutarch.Internal.Generic (PCode, PGeneric, pfrom) +import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) import Plutarch.Internal.Other ( DerivePNewtype, PDelayed, @@ -154,7 +154,7 @@ gpeq = plam $ \x y -> pmatch x $ \x' -> pmatch y $ \y' -> - gpeq' @t (pfrom x') (pfrom y') + gpeq' @t (gpfrom x') (gpfrom y') gpeq' :: forall a s. diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 60d0ab788..9272ed116 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -85,8 +85,7 @@ import Plutarch.Builtin ( import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) import Plutarch.Integer (PInteger) import Plutarch.Internal (S (SI)) -import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, pfrom) -import qualified Plutarch.Internal.Generic as G +import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) @@ -286,7 +285,7 @@ class (PMatch a, PIsData a) => PIsDataRepr (a :: PType) where pconRepr x = punsafeCoerce expected where expected :: Term _ (PAsData (PBuiltinPair PInteger (PBuiltinList PData))) - expected = gpconRepr @a $ pfrom x + expected = gpconRepr @a $ gpfrom x pmatchRepr :: forall s b. Term s (PDataSum (PIsDataReprRepr a)) -> (a s -> Term s b) -> Term s b default pmatchRepr :: @@ -337,7 +336,7 @@ instance MkDataReprHandler s a n (r ': rs) where mkDataReprHandler f = - DRHCons (f . G.pto . mkSOP . mkProduct) $ + DRHCons (f . gpto . mkSOP . mkProduct) $ mkDataReprHandler @s @a @(n + 1) @rs f where mkProduct :: Term s (PDataRecord fs) -> NP (Term s) r diff --git a/Plutarch/Internal/Generic.hs b/Plutarch/Internal/Generic.hs index 8fb074c49..15c721f47 100644 --- a/Plutarch/Internal/Generic.hs +++ b/Plutarch/Internal/Generic.hs @@ -7,8 +7,8 @@ module Plutarch.Internal.Generic ( -- * Plutarch adapters for generics-sop API PGeneric, PCode, - pfrom, - pto, + gpfrom, + gpto, -- * Helpers for when existing generics-sop combinators are insufficient. MkSum (mkSum), @@ -40,12 +40,12 @@ type PCode s a = ToPType2 (Code (a s)) Instead of `I`, this uses `Term s` as the container type. -} -pfrom :: PGeneric s a => a s -> SOP (Term s) (PCode s a) -pfrom = hfromI . from +gpfrom :: PGeneric s a => a s -> SOP (Term s) (PCode s a) +gpfrom = hfromI . from --- | Like `to` but for Plutarch terms. Analogous to `pfrom`. -pto :: PGeneric s a => SOP (Term s) (PCode s a) -> a s -pto = to . htoI +-- | Like `to` but for Plutarch terms. Analogous to `gpfrom`. +gpto :: PGeneric s a => SOP (Term s) (PCode s a) -> a s +gpto = to . htoI {- | Infrastructure to create a single sum constructor given its type index and value. diff --git a/Plutarch/Internal/PlutusType.hs b/Plutarch/Internal/PlutusType.hs index ea5e0941f..4b0d18b46 100644 --- a/Plutarch/Internal/PlutusType.hs +++ b/Plutarch/Internal/PlutusType.hs @@ -21,7 +21,7 @@ import Generics.SOP ( import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Internal (PType, S, Term, pforce, plam', punsafeCoerce, (:-->)) import qualified Plutarch.Internal as PI -import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, pfrom, pto) +import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) import Plutarch.Internal.PLam ((#)) import Plutarch.Internal.TypeFamily (ToPType, ToPType2) @@ -100,7 +100,7 @@ class (PCon a, PMatch a) => PlutusType (a :: PType) where ) => a s -> Term s (PInner a b) - pcon' x = gpcon @a @b $ pfrom x + pcon' x = gpcon @a @b $ gpfrom x pmatch' :: forall s b. (Term s (PInner a b)) -> (a s -> Term s b) -> Term s b default pmatch' :: @@ -115,7 +115,7 @@ class (PCon a, PMatch a) => PlutusType (a :: PType) where (Term s (PInner a b)) -> (a s -> Term s b) -> Term s b - pmatch' x f = gpmatch @a x (f . pto) + pmatch' x f = gpmatch @a x (f . gpto) instance {-# OVERLAPPABLE #-} PlutusType a => PMatch a where pmatch x f = pmatch' (punsafeCoerce x) f From 16bb4a5d9768d4c0020c6d54879a0bffdbcbaa3b Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 9 Mar 2022 14:00:01 -0500 Subject: [PATCH 181/584] PShow: use gpfrom --- Plutarch/Show.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs index d794d11c9..9ae075a6d 100644 --- a/Plutarch/Show.hs +++ b/Plutarch/Show.hs @@ -34,7 +34,7 @@ import Plutarch.Bool (PBool, PEq ((#==)), POrd ((#<)), pif) import Plutarch.ByteString (PByteString, pconsBS, pindexBS, plengthBS, psliceBS) import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) import Plutarch.Internal (punsafeAsClosedTerm) -import Plutarch.Internal.Generic (PCode, PGeneric, pfrom) +import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) import Plutarch.Internal.Other ( PlutusType, Term, @@ -180,7 +180,7 @@ gpshow wrap = punsafeAsClosedTerm @s $ plam $ \x -> pmatch x $ \x' -> - productGroup wrap " " $ gpshow' @a (pfrom x') + productGroup wrap " " $ gpshow' @a (gpfrom x') -- | Like `gpshow`, but returns the individual parameters list gpshow' :: From 46292e7c6ff456ea8860de2cc7d6c83b252be239 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 15:06:39 +0530 Subject: [PATCH 182/584] Eta reductions in boolean and list utils --- Plutarch/Bool.hs | 6 +++--- Plutarch/List.hs | 16 +++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 916afdfff..e8d23df66 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -111,7 +111,7 @@ pif b case_true case_false = pmatch b $ \case -- | Boolean negation for 'PBool' terms. pnot :: Term s (PBool :--> PBool) -pnot = phoistAcyclic $ plam $ \x -> pif x (pcon PFalse) $ pcon PTrue +pnot = phoistAcyclic $ plam $ \x -> pif' # x # pconstant False # pconstant True -- | Lazily evaluated boolean and for 'PBool' terms. infixr 3 #&& @@ -135,11 +135,11 @@ pand' = phoistAcyclic $ plam $ \x y -> pif' # x # y # (pcon PFalse) -- | Hoisted, Plutarch level, lazily evaluated boolean or function. por :: Term s (PBool :--> PDelayed PBool :--> PDelayed PBool) -por = phoistAcyclic $ plam $ \x y -> pif' # x # (phoistAcyclic $ pdelay $ pcon PTrue) # y +por = phoistAcyclic $ plam $ \x -> pif' # x # (phoistAcyclic $ pdelay $ pcon PTrue) -- | Hoisted, Plutarch level, strictly evaluated boolean or function. por' :: Term s (PBool :--> PBool :--> PBool) -por' = phoistAcyclic $ plam $ \x y -> pif' # x # (pcon PTrue) # y +por' = phoistAcyclic $ plam $ \x -> pif' # x # (pcon PTrue) -- | Generic version of (#==) gpeq :: diff --git a/Plutarch/List.hs b/Plutarch/List.hs index 977540017..e53df8043 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -213,11 +213,11 @@ pelem = -- | / O(n) /. Count the number of elements in the list plength :: PIsListLike list a => Term s (list a :--> PInteger) -plength = phoistAcyclic $ - plam $ \xs -> - let go :: PIsListLike list a => Term s (list a :--> PInteger :--> PInteger) - go = (pfix #$ plam $ \self ls n -> pelimList (\_ xs -> self # xs # n + 1) n ls) - in go # xs # 0 +plength = + phoistAcyclic $ + let go :: PIsListLike list a => Term s (PInteger :--> list a :--> PInteger) + go = pfix #$ plam $ \self n -> pelimList (\_ xs -> self # (n + 1) # xs) n + in go # 0 -- | Index a BuiltinList, throwing an error if the index is out of bounds. ptryIndex :: (PIsListLike list a) => Natural -> Term s (list a) -> Term s a @@ -244,20 +244,18 @@ pdrop n xs = pdrop' n # xs pfoldl :: PIsListLike list a => Term s ((b :--> a :--> b) :--> b :--> list a :--> b) pfoldl = phoistAcyclic $ plam $ \f -> - pfix #$ plam $ \self z l -> + pfix #$ plam $ \self z -> pelimList (\x xs -> self # (f # z # x) # xs) z - l -- | The same as 'pfoldl', but with Haskell-level reduction function. pfoldl' :: PIsListLike list a => (forall s. Term s b -> Term s a -> Term s b) -> Term s (b :--> list a :--> b) pfoldl' f = phoistAcyclic $ - pfix #$ plam $ \self z l -> + pfix #$ plam $ \self z -> pelimList (\x xs -> self # f z x # xs) z - l -- | / O(n) /. Fold on a list right-associatively. pfoldr :: PIsListLike list a => Term s ((a :--> b :--> b) :--> b :--> list a :--> b) From 1c87d59c1fd814c944ceae45c0f1d7270a4d02d2 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Thu, 10 Mar 2022 00:40:23 +0100 Subject: [PATCH 183/584] fix: a lot of fixes to finalize this PR - removed unwanted classes - corrected redeeemer script - changed the type of the Excess type family - other more minor changes --- Plutarch/Api/V1/AssocMap.hs | 50 +----- Plutarch/Api/V1/Value.hs | 21 +-- Plutarch/DataRepr/Internal.hs | 3 +- Plutarch/Maybe.hs | 9 +- Plutarch/TryFrom.hs | 167 +++++------------- .../api.example2.Map examples.bench.golden | 3 + ...api.example2.Map examples.uplc.eval.golden | 3 + .../api.example2.Map examples.uplc.golden | 3 + ...tion_untrusted_data.dev=false.bench.golden | 21 +-- ..._untrusted_data.dev=false.uplc.eval.golden | 9 +- ...ation_untrusted_data.dev=false.uplc.golden | 23 +-- ...ation_untrusted_data.dev=true.bench.golden | 21 +-- ...n_untrusted_data.dev=true.uplc.eval.golden | 9 +- ...cation_untrusted_data.dev=true.uplc.golden | 23 +-- plutarch-test/plutarch-test.cabal | 1 + plutarch-test/src/Plutarch/ApiSpec.hs | 12 +- plutarch-test/src/Plutarch/TryFromSpec.hs | 52 +++--- 17 files changed, 141 insertions(+), 289 deletions(-) create mode 100644 plutarch-test/goldens/api.example2.Map examples.bench.golden create mode 100644 plutarch-test/goldens/api.example2.Map examples.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.example2.Map examples.uplc.golden diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 3be46c1b7..f7f572898 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -6,8 +6,10 @@ module Plutarch.Api.V1.AssocMap ( pmkPMap, ) where +import Data.Map (Map, toList) + import Plutarch.TryFrom ( - PMaybeFrom (PMaybeFromExcess, pmaybeFrom), + Flip (Flip), PTryFrom (PTryFromExcess, ptryFrom), ) import qualified Plutus.V1.Ledger.Api as Plutus @@ -80,15 +82,11 @@ pmkPMap :: , Plutus.FromData b , Ord a ) => - [(a, b)] -> - Maybe (Term s (PMap (PConstanted a) (PConstanted b))) -pmkPMap l = if sorted l then Just (pconstant $ PlutusMap.fromList l) else Nothing - where - sorted [] = True - sorted [_] = True - sorted (x : y : zs) = if fst x > fst y then False else sorted (y : zs) + Map a b -> + Term s (PMap (PConstanted a) (PConstanted b)) +pmkPMap (toList -> l) = pconstant $ PlutusMap.fromList l ------------------------ PTryFrom and PMaybeFrom instances ------------------------------- +----------------------- PTryFrom insances ----------------------------------------------- instance ( POrd k @@ -96,7 +94,7 @@ instance ) => PTryFrom (PBuiltinMap k v) (PMap k v) where - type PTryFromExcess (PBuiltinMap k v) (PMap k v) = PUnit + type PTryFromExcess (PBuiltinMap k v) (PMap k v) = Flip Term PUnit ptryFrom oMap = runTermCont $ do sortVer <- tcont $ @@ -115,34 +113,4 @@ instance perror ) # oMap - pure ((pcon . PMap) oMap, sortVer) - -instance - ( POrd k - , PIsData k - ) => - PMaybeFrom (PBuiltinMap k v) (PMap k v) - where - type PMaybeFromExcess (PBuiltinMap k v) (PMap k v) = PUnit - pmaybeFrom oMap = runTermCont $ do - sortVer <- - tcont $ - plet $ - ( pfix #$ plam $ - \self xs -> - pmatch xs $ \case - PNil -> pcon $ PJust $ pcon PUnit - PCons x ys -> - pmatch ys $ \case - PNil -> pcon $ PJust $ pcon PUnit - PCons y _ -> - pif - ((pfromData (pfstBuiltin # x)) #< (pfromData (pfstBuiltin # y))) - (self # ys) - (pcon PNothing) - ) - # oMap - ver <- tcont $ pmatch sortVer - pure $ case ver of - PJust _ -> ((pcon . PJust . pcon . PMap) oMap, sortVer) - PNothing -> (pcon PNothing, sortVer) + pure ((pcon . PMap) oMap, Flip sortVer) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 37daf0d4b..8cf2e546a 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -18,7 +18,7 @@ import Plutarch.Lift ( ) import Plutarch.TryFrom ( - PMaybeFrom (PMaybeFromExcess, pmaybeFrom), + Flip (Flip), PTryFrom (PTryFromExcess, ptryFrom), ) @@ -53,10 +53,10 @@ deriving via instance (PConstant Plutus.Value) ------------------------ PTryFrom and PMaybeFrom instances ------------------------------- +----------------------- PTryFrom instances ---------------------------------------------- instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where - type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = PUnit + type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = Flip Term PUnit ptryFrom m = runTermCont $ do let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) perror @@ -65,17 +65,4 @@ instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where res :: Term _ PBool res = pall # predOuter # pto m _ <- tcont $ plet res - pure $ (pcon $ PValue m, pcon PUnit) - -instance PMaybeFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where - type PMaybeFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = PUnit - pmaybeFrom m = runTermCont $ do - let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) - predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) (pcon PFalse) - predOuter :: Term _ (PBuiltinPair (PAsData PCurrencySymbol) (PAsData (PMap PTokenName PInteger)) :--> PBool) - predOuter = plam $ \tup -> pall # predInner # (pto $ pfromData $ psndBuiltin # tup) - res :: Term _ PBool - res = pall # predOuter # pto m - (tcont $ plet res) >>= (tcont . pmatch) >>= \case - PFalse -> pure (pcon PNothing, pcon PNothing) - PTrue -> pure ((pcon . PJust . pcon . PValue) m, (pcon . PJust . pcon) PUnit) + pure $ (pcon $ PValue m, Flip $ pcon PUnit) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index bb70eee32..cf025a6f2 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -82,6 +82,7 @@ import Plutarch.Builtin ( PData, PIsData, pasConstr, + pasList, pconstrBuiltin, pdata, pforgetData, @@ -176,7 +177,7 @@ type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (name ':= a) = a instance {-# OVERLAPPABLE #-} PIsData (PDataRecord xs) where - pfromData x = punsafeBuiltin PLC.UnListData # pforgetData x + pfromData x = punsafeCoerce $ pasList # pforgetData x pdata x = punsafeBuiltin PLC.ListData # x {- | A sum of 'PDataRecord's. The underlying representation is the `PDataConstr` constructor, diff --git a/Plutarch/Maybe.hs b/Plutarch/Maybe.hs index 083cad0c0..0e9129086 100644 --- a/Plutarch/Maybe.hs +++ b/Plutarch/Maybe.hs @@ -1,6 +1,6 @@ module Plutarch.Maybe ( PMaybe (PJust, PNothing), - pfromMaybe, + pfromJust, ) where import qualified GHC.Generics as GHC @@ -25,8 +25,11 @@ data PMaybe (a :: PType) (s :: S) deriving stock (GHC.Generic) deriving anyclass (Generic, PlutusType, PEq) -pfromMaybe :: Term s (PMaybe a :--> a) -pfromMaybe = phoistAcyclic $ +{- | + fallible unwrapping from @PMaybe@ +-} +pfromJust :: Term s (PMaybe a :--> a) +pfromJust = phoistAcyclic $ plam $ \maybe -> pmatch maybe $ \case PNothing -> perror PJust a -> a diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 2d7056f5c..cdb294dc4 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -1,16 +1,15 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -Wredundant-constraints #-} module Plutarch.TryFrom ( PTryFrom (PTryFromExcess, ptryFrom), - PFrom (pfrom), - PMaybeFrom (PMaybeFromExcess, pmaybeFrom), + Flip (Flip, unFlip), ) where +import Data.Kind (Type) import Data.Proxy (Proxy (Proxy)) -import GHC.TypeLits (KnownNat, Nat, natVal, type (+)) +import GHC.TypeLits (KnownNat, Nat, Symbol, natVal, type (+)) import Plutarch.Builtin ( PAsData, @@ -31,13 +30,12 @@ import Plutarch.Builtin ( psndBuiltin, ) -import Plutarch.Maybe (PMaybe) - import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) import Plutarch.Internal.Other ( POpaque, PType, + S, Term, pcon, perror, @@ -97,40 +95,38 @@ import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) -} class PTryFrom (a :: PType) (b :: PType) where type PTryFromExcess a b :: PType - ptryFrom :: Term s a -> ((Term s b, Term s (PTryFromExcess a b)) -> Term s r) -> Term s r - - -- | this function is only used for `PFrom` and is not exported, - -- it makes use of PTryFrom being a class that always recovers data - ptryFromInverse :: Term s b -> Term s a - ptryFromInverse = punsafeCoerce + ptryFrom :: Term s a -> ((Term s b, PTryFromExcess a b s) -> Term s r) -> Term s r ----------------------- PData instances ------------------------------------------------- +type Flip :: (a -> b -> Type) -> b -> a -> Type +newtype Flip (f :: a -> b -> Type) (y :: b) (x :: a) = Flip {unFlip :: f x y} + instance PTryFrom PData (PAsData PInteger) where - type PTryFromExcess PData (PAsData PInteger) = PInteger + type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) - pure $ (punsafeCoerce opq, ver) + pure $ (punsafeCoerce opq, Flip ver) instance PTryFrom PData (PAsData PByteString) where - type PTryFromExcess PData (PAsData PByteString) = PByteString + type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) - pure $ (punsafeCoerce opq, ver) + pure $ (punsafeCoerce opq, Flip ver) instance PTryFrom PData PData where - type PTryFromExcess PData PData = PUnit - ptryFrom opq = runTermCont $ pure $ (opq, pcon PUnit) + type PTryFromExcess PData PData = Flip Term PUnit + ptryFrom opq = runTermCont $ pure $ (opq, Flip $ pcon PUnit) instance PTryFrom PData (PAsData PData) where - type PTryFromExcess PData (PAsData PData) = PUnit - ptryFrom opq = runTermCont $ pure (pdata opq, pcon PUnit) + type PTryFromExcess PData (PAsData PData) = Flip Term PUnit + ptryFrom opq = runTermCont $ pure (pdata opq, Flip $ pcon PUnit) instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) where - type PTryFromExcess PData (PAsData (PBuiltinList PData)) = PBuiltinList PData + type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasList # opq) - pure $ (punsafeCoerce opq, ver) + pure $ (punsafeCoerce opq, Flip ver) instance {-# OVERLAPPABLE #-} @@ -139,7 +135,7 @@ instance ) => PTryFrom PData (PAsData (PBuiltinMap a b)) where - type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = PBuiltinList (PBuiltinPair (PAsData a) (PAsData b)) + type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = Flip Term (PBuiltinList (PBuiltinPair (PAsData a) (PAsData b))) ptryFrom opq = runTermCont $ do verMap <- tcont $ plet (pasMap # opq) -- I've not obtained a `PBuiltinList (PBuiltinPair a b)` @@ -149,13 +145,13 @@ instance (versnd, _) <- TermCont $ ptryFrom @PData @(PAsData b) $ psndBuiltin # tup pure $ ppairDataBuiltin # verfst # versnd ver <- tcont $ plet $ pmap # verifyPair # verMap - pure (punsafeCoerce opq, ver) + pure (punsafeCoerce opq, Flip ver) instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinMap POpaque POpaque)) where - type PTryFromExcess PData (PAsData (PBuiltinMap POpaque POpaque)) = PBuiltinList (PBuiltinPair (PAsData POpaque) (PAsData POpaque)) + type PTryFromExcess PData (PAsData (PBuiltinMap POpaque POpaque)) = Flip Term (PBuiltinList (PBuiltinPair (PAsData POpaque) (PAsData POpaque))) ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasMap # opq) - pure $ (punsafeCoerce opq, punsafeCoerce ver) -- PAsData POpaque ~ PData + pure $ (punsafeCoerce opq, Flip $ punsafeCoerce ver) -- PAsData POpaque ~ PData instance {-# OVERLAPPABLE #-} @@ -165,7 +161,7 @@ instance ) => PTryFrom PData (PAsData (PBuiltinList a)) where - type PTryFromExcess PData (PAsData (PBuiltinList a)) = PBuiltinList a + type PTryFromExcess PData (PAsData (PBuiltinList a)) = Flip Term (PBuiltinList a) ptryFrom opq = runTermCont $ do let lst :: Term _ (PBuiltinList a) lst = punsafeBuiltin PLC.UnListData # opq @@ -175,7 +171,7 @@ instance (wrapped, _) <- TermCont $ ptryFrom @PData @a $ pforgetData e pure wrapped ver <- tcont $ plet $ pmap # verify # lst - pure $ (punsafeCoerce opq, ver) + pure $ (punsafeCoerce opq, Flip ver) instance {-# OVERLAPPABLE #-} @@ -188,7 +184,7 @@ instance ) => PTryFrom PData (PAsData (PBuiltinPair a b)) where - type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = PBuiltinPair a b + type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = Flip Term (PBuiltinPair a b) ptryFrom opq = runTermCont $ do tup <- tcont $ plet (pfromData $ punsafeCoerce opq) let fst' :: Term _ a @@ -196,19 +192,20 @@ instance snd' :: Term _ b snd' = unTermCont $ fst <$> TermCont (ptryFrom @PData @b $ pforgetData $ psndBuiltin # tup) ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' - pure $ (punsafeCoerce opq, ver) + pure $ (punsafeCoerce opq, Flip ver) instance {-# OVERLAPPABLE #-} + forall (b :: PType) (xs :: [PLabeledType]) (name :: Symbol) (x :: PLabeledType) (s :: S). ( PTryFrom PData (PAsData b) , PTryFrom PData (PAsData (PDataRecord xs)) - , x ~ (s ':= b) + , x ~ (name ':= b) , PIsData (PDataRecord xs) - , PTryFromExcess PData (PAsData (PDataRecord xs)) ~ PDataRecord xs + , PTryFromExcess PData (PAsData (PDataRecord xs)) s ~ Flip Term (PDataRecord xs) s ) => PTryFrom PData (PAsData (PDataRecord (x ': xs))) where - type PTryFromExcess PData (PAsData (PDataRecord (x ': xs))) = PDataRecord (x ': xs) + type PTryFromExcess PData (PAsData (PDataRecord (x ': xs))) = Flip Term (PDataRecord (x ': xs)) ptryFrom opq = runTermCont $ do lst <- tcont $ plet (pfromData @(PBuiltinList _) $ punsafeCoerce opq) let lsthead :: Term _ PData @@ -218,14 +215,14 @@ instance verhead :: Term _ (PAsData b) verhead = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData b) lsthead) vertail :: Term _ (PDataRecord xs) - vertail = unTermCont $ snd <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord xs)) (pforgetData lsttail)) + vertail = unTermCont $ (unFlip . snd) <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord xs)) (pforgetData lsttail)) ver <- tcont $ plet $ - pdcons @s + pdcons @name # verhead # vertail - pure (punsafeCoerce opq, ver) + pure (punsafeCoerce opq, Flip ver) instance {-# OVERLAPPING #-} @@ -235,7 +232,7 @@ instance ) => PTryFrom PData (PAsData (PDataRecord '[x])) where - type PTryFromExcess PData (PAsData (PDataRecord '[x])) = PDataRecord '[x] + type PTryFromExcess PData (PAsData (PDataRecord '[x])) = Flip Term (PDataRecord '[x]) ptryFrom opq = runTermCont $ do let lsthead :: Term _ PData lsthead = phead # (pfromData @(PBuiltinList _) $ punsafeCoerce opq) @@ -247,17 +244,18 @@ instance pdcons @s # verhead # pdnil - pure $ (punsafeCoerce opq, ver) + pure $ (punsafeCoerce opq, Flip ver) class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where validateSum :: Term s PData -> Term s (PBuiltinList PData) instance {-# OVERLAPPABLE #-} - forall n x xs. + forall n x xs s. ( PTryFrom PData (PAsData (PDataRecord x)) , SumValidation (n + 1) xs , KnownNat n + , PTryFromExcess PData (PAsData (PDataRecord x)) s ~ Flip Term (PDataRecord x) s ) => SumValidation n (x ': xs) where @@ -272,8 +270,8 @@ instance (fromInteger n #== (pfstBuiltin # elem)) ( unTermCont $ do let rec = pdata $ psndBuiltin # elem - y <- snd <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord x)) $ pforgetData rec) - pure $ punsafeCoerce (y :: Term _ (PTryFromExcess PData (PAsData (PDataRecord x)))) + y <- (unFlip . snd) <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord x)) $ pforgetData rec) + pure $ punsafeCoerce (y :: Term _ (PDataRecord x)) ) (validateSum @(n + 1) @xs $ punsafeCoerce s) tcont $ plet snd' @@ -288,10 +286,10 @@ instance ) => PTryFrom PData (PAsData (PDataSum ys)) where - type PTryFromExcess PData (PAsData (PDataSum ys)) = PUnit + type PTryFromExcess PData (PAsData (PDataSum ys)) = Flip Term PUnit ptryFrom opq = runTermCont $ do _ <- tcont $ plet $ validateSum @0 @ys opq - pure (punsafeCoerce opq, pcon PUnit) + pure (punsafeCoerce opq, Flip $ pcon PUnit) ----------------------- POpaque Instances ----------------------------------------------- @@ -308,13 +306,13 @@ instance ) => PTryFrom POpaque a where - type PTryFromExcess POpaque a = PAsData a + type PTryFromExcess POpaque a = Flip Term (PAsData a) ptryFrom opq = runTermCont $ do let prop :: Term _ a prop = punsafeCoerce opq ver' <- fst <$> TermCont (ptryFrom @PData @(PAsData a) $ pforgetData $ pdata prop) ver <- tcont $ plet ver' - pure $ (punsafeCoerce opq, ver) + pure $ (punsafeCoerce opq, Flip ver) instance ( PTryFrom a b @@ -325,80 +323,5 @@ instance where type PTryFromExcess (PAsData a) (PAsData b) = PTryFromExcess a b ptryFrom opq = runTermCont $ do - ver' <- TermCont $ ptryFrom @a @b $ pfromData opq - ver <- tcont $ plet $ snd ver' - pure $ (punsafeCoerce opq, ver) - ------------------------ The class PFrom ------------------------------------------------- - -{- | - Represents infallible conversion. - Laws: - - The result type must always carry less information than the origin - type --} -class PFrom a b where - pfrom :: Term s a -> (((Term s b) -> Term s r) -> Term s r) - -{- | - This instance relies on all instances of `PTryFrom` being lawful --} -instance - {-# OVERLAPPABLE #-} - ( PTryFrom b a - ) => - PFrom a b - where - pfrom = runTermCont . pure . ptryFromInverse - -{- --- My experimentations around adding `PIsDataRepr` to the --- machinery - -type PFrom :: Constraint -> PType -> PType -> Constraint -class PFrom c a b where - pfrom :: c => Term s a -> TermCont s (Term s b) - -instance - {-# OVERLAPPABLE #-} - ( PTryFrom b a - ) => - PFrom a b - where - pfrom = pure . ptryFromInverse -instance - {-# OVERLAPPABLE #-} - ( PTryFrom PData (PAsData a) - , c ~ PInner a b - ) => - PTryFrom (PAsData a) c where - ptryFrom opq = do - let inner = pto opq - undefined - -instance - {-# OVERLAPPING #-} - forall a b c. - ( PlutusType b - , c ~ PInner a b - ) => - PFrom (PlutusType b) a c where - pfrom = pure . pto - --- forall a b. newtype PTryFrom a b => TryFrommable b = MkTryFrommable b - -instance - {-# OVERLAPPABLE #-} - ( PFamFrom c b a - ) => - PFrom a b - where - pfrom = pure . ptryFromInverse - --} - ------------------------ The class PMaybeFrom -------------------------------------------- - -class PMaybeFrom (a :: PType) (b :: PType) where - type PMaybeFromExcess a b :: PType - pmaybeFrom :: Term s a -> (((Term s (PMaybe b), Term s (PMaybe (PMaybeFromExcess a b))) -> Term s r) -> Term s r) + ver' <- snd <$> TermCont (ptryFrom @a @b (pfromData opq)) + pure $ (punsafeCoerce opq, ver') diff --git a/plutarch-test/goldens/api.example2.Map examples.bench.golden b/plutarch-test/goldens/api.example2.Map examples.bench.golden new file mode 100644 index 000000000..f8fffa304 --- /dev/null +++ b/plutarch-test/goldens/api.example2.Map examples.bench.golden @@ -0,0 +1,3 @@ +sorted0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":29} +sorted1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":19} +unsorted2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":29} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example2.Map examples.uplc.eval.golden b/plutarch-test/goldens/api.example2.Map examples.uplc.eval.golden new file mode 100644 index 000000000..5d84225a2 --- /dev/null +++ b/plutarch-test/goldens/api.example2.Map examples.uplc.eval.golden @@ -0,0 +1,3 @@ +sorted0 (program 1.0.0 [(#03, #182a), (#04, #182a)]) +sorted1 (program 1.0.0 [(#03, #182a)]) +unsorted2 (program 1.0.0 [(#01, #182a), (#02, #182a)]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example2.Map examples.uplc.golden b/plutarch-test/goldens/api.example2.Map examples.uplc.golden new file mode 100644 index 000000000..5d84225a2 --- /dev/null +++ b/plutarch-test/goldens/api.example2.Map examples.uplc.golden @@ -0,0 +1,3 @@ +sorted0 (program 1.0.0 [(#03, #182a), (#04, #182a)]) +sorted1 (program 1.0.0 [(#03, #182a)]) +unsorted2 (program 1.0.0 [(#01, #182a), (#02, #182a)]) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden index 1979598d3..ed8da4762 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden @@ -14,23 +14,18 @@ working.PDataSum constr 0 {"exBudgetCPU":6024815,"exBudgetMemory":10910,"scriptS working.PDataSum constr 1 {"exBudgetCPU":7028371,"exBudgetMemory":12876,"scriptSizeBytes":171} recovering a record partially vs completely.partially {"exBudgetCPU":5292621,"exBudgetMemory":8440,"scriptSizeBytes":84} recovering a record partially vs completely.completely {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} -removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":96} -removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":92} -removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":5889216,"exBudgetMemory":9972,"scriptSizeBytes":101} -removing the data wrapper.working.[String] == [String] {"exBudgetCPU":6480136,"exBudgetMemory":13844,"scriptSizeBytes":92} +removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} +removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} +removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} +removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} checking PValue and PMap for validity.PMap.valid0 {"exBudgetCPU":13804861,"exBudgetMemory":25916,"scriptSizeBytes":169} checking PValue and PMap for validity.PMap.invalid1 {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":169} checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} -checking PValue and PMap for validity.PMap.valid0maybe {"exBudgetCPU":14519413,"exBudgetMemory":28316,"scriptSizeBytes":198} -checking PValue and PMap for validity.PMap.invalid1maybe {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":198} -checking PValue and PMap for validity.PMap.invalid2maybe {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} checking PValue and PMap for validity.PValue.valid0 {"exBudgetCPU":7607387,"exBudgetMemory":19388,"scriptSizeBytes":137} checking PValue and PMap for validity.PValue.invalid1 {"exBudgetCPU":2310477,"exBudgetMemory":521,"scriptSizeBytes":153} -checking PValue and PMap for validity.PValue.valid0maybe {"exBudgetCPU":8292167,"exBudgetMemory":21689,"scriptSizeBytes":160} -checking PValue and PMap for validity.PValue.invalid1maybe {"exBudgetCPU":8265080,"exBudgetMemory":20524,"scriptSizeBytes":176} -example.concatenate two lists, legal {"exBudgetCPU":83427771,"exBudgetMemory":161141,"scriptSizeBytes":823} -example.concatenate two lists, illegal (list too short) {"exBudgetCPU":78038909,"exBudgetMemory":147115,"scriptSizeBytes":816} -example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":79319097,"exBudgetMemory":147341,"scriptSizeBytes":823} -example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":54379241,"exBudgetMemory":104804,"scriptSizeBytes":844} \ No newline at end of file +example.concatenate two lists, legal {"exBudgetCPU":55650750,"exBudgetMemory":105851,"scriptSizeBytes":713} +example.concatenate two lists, illegal (list too short) {"exBudgetCPU":48177778,"exBudgetMemory":84825,"scriptSizeBytes":707} +example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":55412566,"exBudgetMemory":105051,"scriptSizeBytes":713} +example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35832714,"exBudgetMemory":63544,"scriptSizeBytes":734} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden index bef67719e..a01a31c3f 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden @@ -16,20 +16,15 @@ recovering a record partially vs completely.partially (program 1.0.0 #9f03436261 recovering a record partially vs completely.completely (program 1.0.0 #9f034362617aff) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) -removing the data wrapper.working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) +removing the data wrapper.working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 error) checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) -checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) -checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 error) -checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 error) checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 error) -checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) -checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 error) example.concatenate two lists, legal (program 1.0.0 ()) example.concatenate two lists, illegal (list too short) (program 1.0.0 error) example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden index 946033a69..8f6b57945 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden @@ -14,27 +14,20 @@ working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 - working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87a9f0543666f6fff)) recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (iData 3) (i4 (bData i5) i6))) (i3 ((\i0 -> i3 i2) (unIData (i2 i1))) (i3 (i2 (unListData (listData (force tailList i1)))) i5))) (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))) (force headList)) (force mkCons)) #62617a) [ ])) recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unBData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force headList)) (force tailList)) (force mkCons)) #62617a) [ ])) -removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (iData 42) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) -removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #62617a)))))) (force mkCons)) [ ])) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) -removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))))) (force mkCons)) [ ])) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 2) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a149736f6d65546f6b656e01 ) ])) checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 - , #a149736f6d65546f6b656e01 ) ])) -checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 - , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (force (i18 (force nullList (i17 ((\i0 -> i15 (\i0 -> \i0 -> force (i18 i1 (delay i23) (delay ((\i0 -> force (i22 (i4 i1) (delay (i23 i1 (i3 (i21 i2)))) (delay (i3 (i21 i2))))) (i19 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay error) (delay (equalsByteString (unBData (i20 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger 0 i2) (delay (unBData (i24 i1))) (delay error))) (i19 i2)) (i15 i1)) (unConstrData ((\i0 -> i22 (i16 (i17 i1))) (i21 (i22 (i16 i1)))))) (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i11 (i12 i1))))) (unListData (i16 (i17 (i11 i1))))))) (delay (equalsData (i16 (i14 (\i0 -> \i0 -> force (i17 i1 (delay i22) (delay ((\i0 -> force (i21 (equalsByteString (unBData (i19 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (unBData (i23 i1))) (delay error))) (i18 i2)) (i14 i1)) (unConstrData ((\i0 -> i21 (i15 (i16 i1))) (i20 (i21 (i15 i1)))))) (delay error))) (delay (i22 (i19 (i20 i1)) (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i13 (i18 i1)))))) (unListData (i16 ((\i0 -> i18 (i18 (i18 (i18 (i18 (i18 (i11 i1))))))) (i11 i1)))))) (listData (i14 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (i21 (i18 i1) (i2 (i19 i1)))))) i2)))) (delay False))) (delay ()) (delay error))) (i15 (i10 i3))) (i11 (\i0 -> (\i0 -> (\i0 -> i3) (force (i18 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i10 (\i0 -> (\i0 -> (\i0 -> i3) (force (i17 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i16 (i11 i1)) (i15 i2)) ((\i0 -> i16 (i11 i1)) (i15 (i10 i1)))) ((\i0 -> unListData (i15 (i10 i1))) (i14 i4)))) (delay error))) (i9 i2)) (i5 i1)) (unConstrData (i11 (i12 i1)))) (i5 i1))) (i6 (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))))) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (force (i18 (force nullList (i17 ((\i0 -> i15 (\i0 -> \i0 -> force (i18 i1 (delay i23) (delay ((\i0 -> force (i22 (i4 i1) (delay (i23 i1 (i3 (i21 i2)))) (delay (i3 (i21 i2))))) (i19 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay error) (delay (equalsByteString (unBData (i20 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger 0 i2) (delay (unBData (i24 i1))) (delay error))) (i19 i2)) (i15 i1)) (unConstrData ((\i0 -> i22 (i16 (i17 i1))) (i21 (i22 (i16 i1)))))) (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i11 (i12 i1))))) (unListData (i16 (i17 (i11 i1))))))) (delay (equalsData (i16 (i14 (\i0 -> \i0 -> force (i17 i1 (delay i22) (delay ((\i0 -> force (i21 (equalsByteString (unBData (i19 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (unBData (i23 i1))) (delay error))) (i18 i2)) (i14 i1)) (unConstrData ((\i0 -> i21 (i15 (i16 i1))) (i20 (i21 (i15 i1)))))) (delay error))) (delay (i22 (i19 (i20 i1)) (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i13 (i18 i1)))))) (unListData (i16 ((\i0 -> i18 (i18 (i18 (i18 (i18 (i18 (i11 i1))))))) (i11 i1)))))) (listData (i14 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (i21 (i18 i1) (i2 (i19 i1)))))) i2)))) (delay False))) (delay ()) (delay error))) (i15 (i10 i3))) (i11 (\i0 -> (\i0 -> (\i0 -> i3) (force (i18 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i10 (\i0 -> (\i0 -> (\i0 -> i3) (force (i17 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) i14))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i16 (i11 i1)) (i15 i2)) ((\i0 -> i16 (i11 i1)) (i15 (i10 i1)))) ((\i0 -> unListData (i15 (i10 i1))) (i14 i4)))) (delay error))) (i9 i2)) (i5 i1)) (unConstrData (i11 (i12 i1)))) (i5 i1))) (i6 (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))))) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (force (i18 (force nullList (i17 ((\i0 -> i15 (\i0 -> \i0 -> force (i18 i1 (delay i23) (delay ((\i0 -> force (i22 (i4 i1) (delay (i23 i1 (i3 (i21 i2)))) (delay (i3 (i21 i2))))) (i19 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay error) (delay (equalsByteString (unBData (i20 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger 0 i2) (delay (unBData (i24 i1))) (delay error))) (i19 i2)) (i15 i1)) (unConstrData ((\i0 -> i22 (i16 (i17 i1))) (i21 (i22 (i16 i1)))))) (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i11 (i12 i1))))) (unListData (i16 (i17 (i11 i1))))))) (delay (equalsData (i16 (i14 (\i0 -> \i0 -> force (i17 i1 (delay i22) (delay ((\i0 -> force (i21 (equalsByteString (unBData (i19 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (unBData (i23 i1))) (delay error))) (i18 i2)) (i14 i1)) (unConstrData ((\i0 -> i21 (i15 (i16 i1))) (i20 (i21 (i15 i1)))))) (delay error))) (delay (i22 (i19 (i20 i1)) (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i13 (i18 i1)))))) (unListData (i16 ((\i0 -> i18 (i18 (i18 (i18 (i18 (i18 (i11 i1))))))) (i11 i1)))))) (listData (i14 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (i21 (i18 i1) (i2 (i19 i1)))))) i2)))) (delay False))) (delay ()) (delay error))) (i15 (i10 i3))) (i11 (\i0 -> (\i0 -> (\i0 -> i3) (force (i18 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i10 (\i0 -> (\i0 -> (\i0 -> i3) (force (i17 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 8) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i16 (i11 i1)) (i15 i2)) ((\i0 -> i16 (i11 i1)) (i15 (i10 i1)))) ((\i0 -> unListData (i15 (i10 i1))) (i14 i4)))) (delay error))) (i9 i2)) (i5 i1)) (unConstrData (i11 (i12 i1)))) (i5 i1))) (i6 (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))))) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (force (i18 (force nullList (i17 ((\i0 -> i15 (\i0 -> \i0 -> force (i18 i1 (delay i23) (delay ((\i0 -> force (i22 (i4 i1) (delay (i23 i1 (i3 (i21 i2)))) (delay (i3 (i21 i2))))) (i19 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 1 i2) (delay error) (delay (equalsByteString (unBData (i20 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger 0 i2) (delay (unBData (i24 i1))) (delay error))) (i19 i2)) (i15 i1)) (unConstrData ((\i0 -> i22 (i16 (i17 i1))) (i21 (i22 (i16 i1)))))) (delay error)))))) (i15 i2)) (i11 i1)) (unConstrData (i17 (i11 (i12 i1))))) (unListData (i16 (i17 (i11 i1))))))) (delay (equalsData (i16 (i14 (\i0 -> \i0 -> force (i17 i1 (delay i22) (delay ((\i0 -> force (i21 (equalsByteString (unBData (i19 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (unBData (i23 i1))) (delay error))) (i18 i2)) (i14 i1)) (unConstrData ((\i0 -> i21 (i15 (i16 i1))) (i20 (i21 (i15 i1)))))) (delay error))) (delay (i22 (i19 (i20 i1)) (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i13 (i18 i1)))))) (unListData (i16 ((\i0 -> i18 (i18 (i18 (i18 (i18 (i18 (i11 i1))))))) (i11 i1)))))) (listData (i14 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (i21 (i18 i1) (i2 (i19 i1)))))) i2)))) (delay False))) (delay ()) (delay error))) (i15 (i10 i3))) (i11 (\i0 -> (\i0 -> (\i0 -> i3) (force (i18 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i4))) (i10 (\i0 -> (\i0 -> (\i0 -> i3) (force (i17 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i13 (iData 1) (i13 (iData 2) (i13 (iData 3) (i13 (iData 4) (i13 (iData 5) i14)))))) (listData (i13 (iData 6) (i13 (iData 7) (i13 (iData 8) (i13 (iData 9) (i13 (iData 10) i14)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i16 (i11 i1)) (i15 i2)) ((\i0 -> i16 (i11 i1)) (i15 (i10 i1)))) ((\i0 -> unListData (i15 (i10 i1))) (i14 i4)))) (delay error))) (i9 i2)) (i5 i1)) (unConstrData (i11 (i12 i1)))) (i5 i1))) (i6 (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))))) (force (force fstPair))) (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) i10))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 8) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden index b843873da..28e2b4028 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden @@ -14,23 +14,18 @@ working.PDataSum constr 0 {"exBudgetCPU":6024815,"exBudgetMemory":10910,"scriptS working.PDataSum constr 1 {"exBudgetCPU":7028371,"exBudgetMemory":12876,"scriptSizeBytes":171} recovering a record partially vs completely.partially {"exBudgetCPU":5292621,"exBudgetMemory":8440,"scriptSizeBytes":84} recovering a record partially vs completely.completely {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} -removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":96} -removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":92} -removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":5889216,"exBudgetMemory":9972,"scriptSizeBytes":101} -removing the data wrapper.working.[String] == [String] {"exBudgetCPU":6480136,"exBudgetMemory":13844,"scriptSizeBytes":92} +removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} +removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} +removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} +removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} checking PValue and PMap for validity.PMap.valid0 {"exBudgetCPU":13804861,"exBudgetMemory":25916,"scriptSizeBytes":169} checking PValue and PMap for validity.PMap.invalid1 {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":169} checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} -checking PValue and PMap for validity.PMap.valid0maybe {"exBudgetCPU":14519413,"exBudgetMemory":28316,"scriptSizeBytes":198} -checking PValue and PMap for validity.PMap.invalid1maybe {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":198} -checking PValue and PMap for validity.PMap.invalid2maybe {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} checking PValue and PMap for validity.PValue.valid0 {"exBudgetCPU":7607387,"exBudgetMemory":19388,"scriptSizeBytes":137} checking PValue and PMap for validity.PValue.invalid1 {"exBudgetCPU":2310477,"exBudgetMemory":521,"scriptSizeBytes":153} -checking PValue and PMap for validity.PValue.valid0maybe {"exBudgetCPU":8292167,"exBudgetMemory":21689,"scriptSizeBytes":160} -checking PValue and PMap for validity.PValue.invalid1maybe {"exBudgetCPU":8265080,"exBudgetMemory":20524,"scriptSizeBytes":176} -example.concatenate two lists, legal {"exBudgetCPU":84561415,"exBudgetMemory":164005,"scriptSizeBytes":1301} -example.concatenate two lists, illegal (list too short) {"exBudgetCPU":78488909,"exBudgetMemory":147211,"scriptSizeBytes":1294} -example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":79769097,"exBudgetMemory":147437,"scriptSizeBytes":1301} -example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":54529241,"exBudgetMemory":104836,"scriptSizeBytes":1322} \ No newline at end of file +example.concatenate two lists, legal {"exBudgetCPU":56427118,"exBudgetMemory":107515,"scriptSizeBytes":1085} +example.concatenate two lists, illegal (list too short) {"exBudgetCPU":48627778,"exBudgetMemory":84921,"scriptSizeBytes":1078} +example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":55862566,"exBudgetMemory":105147,"scriptSizeBytes":1085} +example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35982714,"exBudgetMemory":63576,"scriptSizeBytes":1106} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden index bef67719e..a01a31c3f 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden @@ -16,20 +16,15 @@ recovering a record partially vs completely.partially (program 1.0.0 #9f03436261 recovering a record partially vs completely.completely (program 1.0.0 #9f034362617aff) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 (#43666f6f, #43626172)) -removing the data wrapper.working.[String] == [String] (program 1.0.0 [#43666f6f, #43626172]) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) +removing the data wrapper.working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 error) checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) -checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) -checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 error) -checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 error) checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 error) -checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) -checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 error) example.concatenate two lists, legal (program 1.0.0 ()) example.concatenate two lists, illegal (list too short) (program 1.0.0 error) example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden index 0b5e6bcc4..e492de2e9 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden @@ -14,27 +14,20 @@ working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 - working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87a9f0543666f6fff)) recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (iData 3) (i4 (bData i5) i6))) (i3 ((\i0 -> i3 i2) (unIData (i2 i1))) (i3 (i2 (unListData (listData (force tailList i1)))) i5))) (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))) (force headList)) (force mkCons)) #62617a) [ ])) recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unBData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force headList)) (force tailList)) (force mkCons)) #62617a) [ ])) -removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (iData 42) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) -removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #62617a)))))) (force mkCons)) [ ])) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData ((\i0 -> i4 i2) (unBData (i3 i1))) ((\i0 -> i6 i2) (unBData (i5 i1)))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i5 (unConstrData i1))) ((\i0 -> constrData 0 (i4 (i3 i1) (i4 (i5 i1) [ ]))) (mkPairData (bData #666f6f) (bData #626172))))) (force headList)) (force (force fstPair))) (force mkCons)) (force (force sndPair)))) -removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (i4 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i1 (bData #666f6f) ((\i0 -> i2 i1 i3) (bData #626172)))))) (force mkCons)) [ ])) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 2) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i3 (\i0 -> \i0 -> i2 (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 1) i11) (i10 (mkPairData (iData 42) i11) i12))))) (delay (i2 (\i0 -> \i0 -> force i1)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> i2 ())) (delay ((\i0 -> force (i5 i1 (delay (\i0 -> \i0 -> i2 ())) (delay (force (force ifThenElse (lessThanInteger (unIData (i6 (i7 i2))) (unIData (i6 (i7 i1)))) (delay (i3 (i8 i2))) (delay (\i0 -> \i0 -> force i1))))))) (i7 i1))))) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))))) (\i0 -> i1 (\i0 -> i1) (delay error))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.invalid2maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a149736f6d65546f6b656e01 ) ])) checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -checking PValue and PMap for validity.PValue.valid0maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 - , #a149736f6d65546f6b656e01 ) ])) -checking PValue and PMap for validity.PValue.invalid1maybe (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 i1 (delay (i2 (\i0 -> \i0 -> i2 i14))) (delay (i2 (\i0 -> \i0 -> force i1))))) (i2 (\i0 -> i3 (\i0 -> force (i11 (lessThanInteger 0 (unIData (i12 i1))) (delay True) (delay False))) (unMapData (i11 i1))) i11)) (\i0 -> i1 (\i0 -> i1) (delay error))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 - , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (force (i21 (force nullList (i20 ((\i0 -> i18 (\i0 -> \i0 -> force (i21 i1 (delay i28) (delay ((\i0 -> force (i25 (i4 i1) (delay (i28 i1 (i3 (i24 i2)))) (delay (i3 (i24 i2))))) (i22 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (equalsByteString (unBData (i23 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i29 (equalsInteger 1 i2) (delay (force (i30 i18 (delay error)))) (delay (unBData (i27 i1))))) (i22 i2)) (i17 i1)) (unConstrData ((\i0 -> i25 (i19 (i20 i1))) (i24 (i25 (i19 i1)))))) (delay (force (i26 i16 (delay error))))))) (delay (force (i26 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:364:15-26" (delay error)))))) (i18 i2)) (i13 i1)) (unConstrData (i20 (i14 (i15 i1))))) (unListData (i19 (i20 (i14 i1))))))) (delay (equalsData (i19 (i17 (\i0 -> \i0 -> force (i20 i1 (delay i27) (delay ((\i0 -> force (i25 "iteration" (delay (force (i24 (equalsByteString (unBData (i22 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i28 (equalsInteger 1 i2) (delay (force (i29 i17 (delay error)))) (delay (unBData (i26 i1))))) (i21 i2)) (i16 i1)) (unConstrData ((\i0 -> i24 (i18 (i19 i1))) (i23 (i24 (i18 i1)))))) (delay (force (i25 i15 (delay error)))))) (delay (force (i25 "appended something" (delay i27)) (i22 (i23 i1)) (i3 (i23 i2)))) (delay (force (i25 "called without appending" (delay i3)) (i23 i2)))))))) (i16 (i21 i1)))))) (unListData (i19 ((\i0 -> i21 (i21 (i21 (i21 (i21 (i21 (i14 i1))))))) (i14 i1)))))) (listData (i17 (\i0 -> \i0 -> force (i20 i1 (delay i5) (delay (i26 (i21 i1) (i2 (i22 i1)))))) i2)))) (delay False))) (delay ()) (delay (force (i22 "not valid" (delay error)))))) (i18 (i13 i3))) (i14 (\i0 -> (\i0 -> (\i0 -> i3) (force (i21 (lessThanInteger i1 0) (delay (force (i22 i23 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i13 (\i0 -> (\i0 -> (\i0 -> i3) (force (i20 (lessThanInteger i1 0) (delay (force (i21 i22 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i18 (iData 1) (i18 (iData 2) (i18 (iData 3) (i18 (iData 4) (i18 (iData 5) i19)))))) (listData (i18 (iData 6) (i18 (iData 7) (i18 (iData 8) (i18 (iData 9) (i18 (iData 10) i19)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i19 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i19 (i14 i1)) (i18 i2)) ((\i0 -> i19 (i14 i1)) (i18 (i13 i1)))) ((\i0 -> unListData (i18 (i13 i1))) (i17 i4)))) (delay (force (i20 i7 (delay error)))))) (i12 i2)) (i7 i1)) (unConstrData (i14 (i15 i1)))) (i8 i1))) (i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i16 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22") "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:332:11-26") (force (force fstPair))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:329:11-24") (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (force (i21 (force nullList (i20 ((\i0 -> i18 (\i0 -> \i0 -> force (i21 i1 (delay i28) (delay ((\i0 -> force (i25 (i4 i1) (delay (i28 i1 (i3 (i24 i2)))) (delay (i3 (i24 i2))))) (i22 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (equalsByteString (unBData (i23 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i29 (equalsInteger 1 i2) (delay (force (i30 i18 (delay error)))) (delay (unBData (i27 i1))))) (i22 i2)) (i17 i1)) (unConstrData ((\i0 -> i25 (i19 (i20 i1))) (i24 (i25 (i19 i1)))))) (delay (force (i26 i16 (delay error))))))) (delay (force (i26 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:364:15-26" (delay error)))))) (i18 i2)) (i13 i1)) (unConstrData (i20 (i14 (i15 i1))))) (unListData (i19 (i20 (i14 i1))))))) (delay (equalsData (i19 (i17 (\i0 -> \i0 -> force (i20 i1 (delay i27) (delay ((\i0 -> force (i25 "iteration" (delay (force (i24 (equalsByteString (unBData (i22 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i28 (equalsInteger 1 i2) (delay (force (i29 i17 (delay error)))) (delay (unBData (i26 i1))))) (i21 i2)) (i16 i1)) (unConstrData ((\i0 -> i24 (i18 (i19 i1))) (i23 (i24 (i18 i1)))))) (delay (force (i25 i15 (delay error)))))) (delay (force (i25 "appended something" (delay i27)) (i22 (i23 i1)) (i3 (i23 i2)))) (delay (force (i25 "called without appending" (delay i3)) (i23 i2)))))))) (i16 (i21 i1)))))) (unListData (i19 ((\i0 -> i21 (i21 (i21 (i21 (i21 (i21 (i14 i1))))))) (i14 i1)))))) (listData (i17 (\i0 -> \i0 -> force (i20 i1 (delay i5) (delay (i26 (i21 i1) (i2 (i22 i1)))))) i2)))) (delay False))) (delay ()) (delay (force (i22 "not valid" (delay error)))))) (i18 (i13 i3))) (i14 (\i0 -> (\i0 -> (\i0 -> i3) (force (i21 (lessThanInteger i1 0) (delay (force (i22 i23 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i13 (\i0 -> (\i0 -> (\i0 -> i3) (force (i20 (lessThanInteger i1 0) (delay (force (i21 i22 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i18 (iData 1) (i18 (iData 2) (i18 (iData 3) (i18 (iData 4) (i18 (iData 5) i19)))))) (listData (i18 (iData 6) (i18 (iData 7) (i18 (iData 8) (i18 (iData 9) i19))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i19 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i19 (i14 i1)) (i18 i2)) ((\i0 -> i19 (i14 i1)) (i18 (i13 i1)))) ((\i0 -> unListData (i18 (i13 i1))) (i17 i4)))) (delay (force (i20 i7 (delay error)))))) (i12 i2)) (i7 i1)) (unConstrData (i14 (i15 i1)))) (i8 i1))) (i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i16 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22") "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:332:11-26") (force (force fstPair))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:329:11-24") (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (force (i21 (force nullList (i20 ((\i0 -> i18 (\i0 -> \i0 -> force (i21 i1 (delay i28) (delay ((\i0 -> force (i25 (i4 i1) (delay (i28 i1 (i3 (i24 i2)))) (delay (i3 (i24 i2))))) (i22 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (equalsByteString (unBData (i23 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i29 (equalsInteger 1 i2) (delay (force (i30 i18 (delay error)))) (delay (unBData (i27 i1))))) (i22 i2)) (i17 i1)) (unConstrData ((\i0 -> i25 (i19 (i20 i1))) (i24 (i25 (i19 i1)))))) (delay (force (i26 i16 (delay error))))))) (delay (force (i26 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:364:15-26" (delay error)))))) (i18 i2)) (i13 i1)) (unConstrData (i20 (i14 (i15 i1))))) (unListData (i19 (i20 (i14 i1))))))) (delay (equalsData (i19 (i17 (\i0 -> \i0 -> force (i20 i1 (delay i27) (delay ((\i0 -> force (i25 "iteration" (delay (force (i24 (equalsByteString (unBData (i22 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i28 (equalsInteger 1 i2) (delay (force (i29 i17 (delay error)))) (delay (unBData (i26 i1))))) (i21 i2)) (i16 i1)) (unConstrData ((\i0 -> i24 (i18 (i19 i1))) (i23 (i24 (i18 i1)))))) (delay (force (i25 i15 (delay error)))))) (delay (force (i25 "appended something" (delay i27)) (i22 (i23 i1)) (i3 (i23 i2)))) (delay (force (i25 "called without appending" (delay i3)) (i23 i2)))))))) (i16 (i21 i1)))))) (unListData (i19 ((\i0 -> i21 (i21 (i21 (i21 (i21 (i21 (i14 i1))))))) (i14 i1)))))) (listData (i17 (\i0 -> \i0 -> force (i20 i1 (delay i5) (delay (i26 (i21 i1) (i2 (i22 i1)))))) i2)))) (delay False))) (delay ()) (delay (force (i22 "not valid" (delay error)))))) (i18 (i13 i3))) (i14 (\i0 -> (\i0 -> (\i0 -> i3) (force (i21 (lessThanInteger i1 0) (delay (force (i22 i23 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i13 (\i0 -> (\i0 -> (\i0 -> i3) (force (i20 (lessThanInteger i1 0) (delay (force (i21 i22 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i18 (iData 1) (i18 (iData 2) (i18 (iData 3) (i18 (iData 4) (i18 (iData 5) i19)))))) (listData (i18 (iData 6) (i18 (iData 8) (i18 (iData 8) (i18 (iData 9) (i18 (iData 10) i19)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i19 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i19 (i14 i1)) (i18 i2)) ((\i0 -> i19 (i14 i1)) (i18 (i13 i1)))) ((\i0 -> unListData (i18 (i13 i1))) (i17 i4)))) (delay (force (i20 i7 (delay error)))))) (i12 i2)) (i7 i1)) (unConstrData (i14 (i15 i1)))) (i8 i1))) (i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i16 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22") "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:332:11-26") (force (force fstPair))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:329:11-24") (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i21 (force (i21 (force nullList (i20 ((\i0 -> i18 (\i0 -> \i0 -> force (i21 i1 (delay i28) (delay ((\i0 -> force (i25 (i4 i1) (delay (i28 i1 (i3 (i24 i2)))) (delay (i3 (i24 i2))))) (i22 i1)))))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i25 (equalsInteger 0 i2) (delay (equalsByteString (unBData (i23 i1)) (i11 i8 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i29 (equalsInteger 1 i2) (delay (force (i30 i18 (delay error)))) (delay (unBData (i27 i1))))) (i22 i2)) (i17 i1)) (unConstrData ((\i0 -> i25 (i19 (i20 i1))) (i24 (i25 (i19 i1)))))) (delay (force (i26 i16 (delay error))))))) (delay (force (i26 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:364:15-26" (delay error)))))) (i18 i2)) (i13 i1)) (unConstrData (i20 (i14 (i15 i1))))) (unListData (i19 (i20 (i14 i1))))))) (delay (equalsData (i19 (i17 (\i0 -> \i0 -> force (i20 i1 (delay i27) (delay ((\i0 -> force (i25 "iteration" (delay (force (i24 (equalsByteString (unBData (i22 i1)) (i10 i7 (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i28 (equalsInteger 1 i2) (delay (force (i29 i17 (delay error)))) (delay (unBData (i26 i1))))) (i21 i2)) (i16 i1)) (unConstrData ((\i0 -> i24 (i18 (i19 i1))) (i23 (i24 (i18 i1)))))) (delay (force (i25 i15 (delay error)))))) (delay (force (i25 "appended something" (delay i27)) (i22 (i23 i1)) (i3 (i23 i2)))) (delay (force (i25 "called without appending" (delay i3)) (i23 i2)))))))) (i16 (i21 i1)))))) (unListData (i19 ((\i0 -> i21 (i21 (i21 (i21 (i21 (i21 (i14 i1))))))) (i14 i1)))))) (listData (i17 (\i0 -> \i0 -> force (i20 i1 (delay i5) (delay (i26 (i21 i1) (i2 (i22 i1)))))) i2)))) (delay False))) (delay ()) (delay (force (i22 "not valid" (delay error)))))) (i18 (i13 i3))) (i14 (\i0 -> (\i0 -> (\i0 -> i3) (force (i21 (lessThanInteger i1 0) (delay (force (i22 i23 (delay error)))) (delay i1)))) (unIData i1)) (unListData i4))) (i13 (\i0 -> (\i0 -> (\i0 -> i3) (force (i20 (lessThanInteger i1 0) (delay (force (i21 i22 (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i18 (iData 1) (i18 (iData 2) (i18 (iData 3) (i18 (iData 4) (i18 (iData 5) i19)))))) (listData (i18 (iData 6) (i18 (iData 7) (i18 (iData 8) (i18 (iData 9) (i18 (iData 10) i19)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i19 (equalsInteger 1 i2) (delay (i6 (\i0 -> equalsData ((\i0 -> i19 (i14 i1)) (i18 i2)) ((\i0 -> i19 (i14 i1)) (i18 (i13 i1)))) ((\i0 -> unListData (i18 (i13 i1))) (i17 i4)))) (delay (force (i20 i7 (delay error)))))) (i12 i2)) (i7 i1)) (unConstrData (i14 (i15 i1)))) (i8 i1))) (i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i16 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22") "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:332:11-26") (force (force fstPair))) "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:329:11-24") (\i0 -> i8 (i8 i1))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i12) (delay (i11 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) "could not make natural") (force mkCons)) [ ])) \ No newline at end of file +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:378:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:328:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:319:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:378:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:328:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:319:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:378:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:328:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:319:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:378:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:328:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:319:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 652785d44..155eb1f35 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -108,6 +108,7 @@ executable plutarch-test build-depends: , base16-bytestring , cborg + , containers , rank2classes , serialise diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/src/Plutarch/ApiSpec.hs index 1c0eabe56..0dc6da04d 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/src/Plutarch/ApiSpec.hs @@ -3,9 +3,8 @@ module Plutarch.ApiSpec (spec, ctx, info, purpose, validator, datum) where import Test.Syd import Test.Tasty.HUnit -import Data.Maybe (isJust) - import Control.Monad.Trans.Cont (cont, runCont) +import qualified Data.Map as Map import Plutus.V1.Ledger.Api import qualified Plutus.V1.Ledger.Interval as Interval import qualified Plutus.V1.Ledger.Value as Value @@ -64,10 +63,11 @@ spec = do "fails" @| checkSignatoryTermCont # pconstant "41" # ctx @-> pfails describe "getFields" . pgoldenSpec $ do "0" @| getFields - describe "example2" $ do - it "succeeds0" $ (isJust (pmkPMap @Integer @Integer [(3, 42), (4, 42)]) @?= True) - it "succeeds1" $ (isJust (pmkPMap @Integer @Integer [(3, 42), (3, 42)]) @?= True) - it "fails0" $ (isJust (pmkPMap @Integer @Integer [(2, 42), (1, 42)]) @?= False) + describe "example2" $ do + describe "Map examples" . pgoldenSpec $ do + "sorted0" @| pmkPMap @Integer @Integer (Map.fromList [(3, 42), (4, 42)]) @-> psucceeds + "sorted1" @| pmkPMap @Integer @Integer (Map.fromList [(3, 42), (3, 42)]) @-> psucceeds + "unsorted2" @| pmkPMap @Integer @Integer (Map.fromList [(2, 42), (1, 42)]) @-> psucceeds -------------------------------------------------------------------------------- diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index a7fb0abab..b1b4e5444 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -31,6 +31,7 @@ import Plutarch.Unsafe ( import Plutarch import Plutarch.Api.V1 ( + PAddress, PCurrencySymbol, PDatum, PDatumHash, @@ -54,13 +55,12 @@ import Plutarch.Builtin ( ) import Plutarch.Prelude import Plutarch.TryFrom ( - PMaybeFrom (pmaybeFrom), + Flip (Flip, unFlip), PTryFrom (PTryFromExcess, ptryFrom), ) import Plutarch.ApiSpec (info, purpose) import qualified Plutarch.ApiSpec as Api -import Plutarch.Maybe (pfromMaybe) import Plutarch.Test import Plutus.V1.Ledger.Value (Value) import qualified Plutus.V1.Ledger.Value as Value @@ -225,12 +225,6 @@ spec = do @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) mf1)) @-> pfails "invalid2" @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) mf2)) @-> pfails - "valid0maybe" - @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @_ @(PMap PInteger PUnit) ms0)) @-> psucceeds - "invalid1maybe" - @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @_ @(PMap PInteger PUnit) mf1)) @-> pfails - "invalid2maybe" - @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) mf2)) @-> pfails "PValue" @\ do let legalValue0 :: Value legalValue0 = Value.singleton "c0" "someToken" 1 @@ -240,10 +234,6 @@ spec = do @| (unTermCont $ fst <$> TermCont (ptryFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ punsafeCoerce $ pconstant $ legalValue0)) @-> psucceeds "invalid1" @| (unTermCont $ fst <$> TermCont (ptryFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ pconstant $ illegalValue1)) @-> pfails - "valid0maybe" - @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ punsafeCoerce $ pconstant $ legalValue0)) @-> psucceeds - "invalid1maybe" - @| (unTermCont $ ((pfromMaybe #) . fst) <$> TermCont (pmaybeFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ pconstant $ illegalValue1)) @-> pfails "example" @\ do let validContext0 = ctx validOutputs0 validList1 invalidContext1 = ctx invalidOutputs1 validList1 @@ -281,10 +271,11 @@ checkDeepUnwrap :: ( PTryFrom PData (PAsData target) , PIsData actual , PIsData target + , PTryFromExcess PData (PAsData target) ~ Flip Term target ) => ClosedTerm (PAsData actual) -> - ClosedTerm (PTryFromExcess PData (PAsData target)) -checkDeepUnwrap t = unTermCont $ snd <$> TermCont (ptryFrom @PData @(PAsData target) $ pforgetData t) + ClosedTerm (PAsData target) +checkDeepUnwrap t = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData target) $ pforgetData t) sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1 .. 100] @@ -309,30 +300,34 @@ pmkNatural :: Term s (PInteger :--> PNatural) pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) instance PTryFrom PData (PAsData PNatural) where - type PTryFromExcess PData (PAsData PNatural) = PNatural + type PTryFromExcess PData (PAsData PNatural) = Flip Term PNatural ptryFrom opq = runTermCont $ do - (wrapped, unwrapped) <- TermCont $ ptryFrom @PData @(PAsData PInteger) opq - ver <- tcont $ plet $ pmkNatural # unwrapped - pure $ (punsafeCoerce wrapped, ver) + tup <- TermCont $ ptryFrom @PData @(PAsData PInteger) opq + ver <- tcont $ plet $ pmkNatural # unFlip (snd tup) + pure $ (punsafeCoerce (fst tup), Flip ver) validator :: Term s PValidator validator = phoistAcyclic $ plam $ \dat red ctx -> unTermCont $ do - (_, trustedRedeemer) <- TermCont $ ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red - (_, trustedDatum) <- TermCont (ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) dat) + trustedRedeemer <- (unFlip . snd) <$> (TermCont $ ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red) + let trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) + trustedDatum = pfromData $ punsafeCoerce dat -- make the Datum and Redeemer trusted txInfo :: (Term _ PTxInfo) <- tcont $ plet $ pfield @"txInfo" # ctx - let ownHash :: Term _ PDatumHash - ownHash = unTermCont $ do - PJust ownInput <- tcont $ pmatch $ pfindOwnInput # ctx - let maybeHash :: Term _ (PMaybeData PDatumHash) - maybeHash = pfield @"datumHash" #$ pfield @"resolved" #$ (pfromData ownInput) - PDJust datumHash <- tcont $ pmatch maybeHash - pure $ pfield @"_0" # datumHash + PJust ownInput <- tcont $ pmatch $ pfindOwnInput # ctx + resolved <- tcont $ pletFields @["address", "datumHash"] $ pfield @"resolved" # ownInput + + let ownAddress :: Term _ PAddress + ownAddress = resolved.address -- find own script address matching DatumHash + ownHash :: Term _ PDatumHash + ownHash = unTermCont $ do + PDJust dhash <- tcont $ pmatch resolved.datumHash + pure $ pfield @"_0" # dhash + data' :: Term _ (PBuiltinList (PAsData (PTuple PDatumHash PDatum))) data' = pfield @"data" # txInfo @@ -361,8 +356,7 @@ validator = phoistAcyclic $ where pred :: Term _ (PAsData PTxOut :--> PBool) pred = plam $ \out -> unTermCont $ do - PDJust dhash <- tcont $ pmatch (pfield @"datumHash" # out) - pure $ pfield @"_0" # dhash #== ownHash + pure $ pfield @"address" # out #== (pdata $ ownAddress) -- make sure that after filtering the outputs, only one output -- remains From c240c0f056780548d967b15bfcdea1ffe64e76df Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 15:21:56 +0530 Subject: [PATCH 184/584] Update goldens --- plutarch-test/goldens/bool.bench.golden | 20 +++++++++---------- plutarch-test/goldens/bool.uplc.eval.golden | 2 +- plutarch-test/goldens/bool.uplc.golden | 20 +++++++++---------- plutarch-test/goldens/list.fun.bench.golden | 4 ++-- plutarch-test/goldens/list.fun.uplc.golden | 4 ++-- .../goldens/pisdata.equality.bench.golden | 4 ++-- .../goldens/pisdata.equality.uplc.golden | 4 ++-- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/plutarch-test/goldens/bool.bench.golden b/plutarch-test/goldens/bool.bench.golden index e67edfc40..01924390f 100644 --- a/plutarch-test/goldens/bool.bench.golden +++ b/plutarch-test/goldens/bool.bench.golden @@ -1,5 +1,5 @@ -pnot.lam {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":14} -pnot.app {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +pnot.lam {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":13} +pnot.app {"exBudgetCPU":327604,"exBudgetMemory":1201,"scriptSizeBytes":15} pand.tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} pand.ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} pand.tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} @@ -9,13 +9,13 @@ pand.laziness.op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":1 pand.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} pand.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} pand.laziness.pand.perror.op {"exBudgetCPU":101,"exBudgetMemory":101,"scriptSizeBytes":18} -por.tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -por.ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -por.tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -por.ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -por.laziness.por {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} -por.laziness.op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} +por.tf {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.ft {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.tt {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.ff {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.laziness.por {"exBudgetCPU":327604,"exBudgetMemory":1201,"scriptSizeBytes":15} +por.laziness.op {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":15} por.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} por.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} -por.laziness.pand.perror.op.true {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} -por.laziness.pand.perror.op.false {"exBudgetCPU":101,"exBudgetMemory":101,"scriptSizeBytes":18} \ No newline at end of file +por.laziness.pand.perror.op.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":15} +por.laziness.pand.perror.op.false {"exBudgetCPU":101,"exBudgetMemory":101,"scriptSizeBytes":15} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.uplc.eval.golden b/plutarch-test/goldens/bool.uplc.eval.golden index afaff81bb..4e839c9bd 100644 --- a/plutarch-test/goldens/bool.uplc.eval.golden +++ b/plutarch-test/goldens/bool.uplc.eval.golden @@ -1,4 +1,4 @@ -pnot.lam (program 1.0.0 (\i0 -> force (force ifThenElse i1 (delay False) (delay True)))) +pnot.lam (program 1.0.0 (\i0 -> force ifThenElse i1 False True)) pnot.app (program 1.0.0 False) pand.tf (program 1.0.0 False) pand.ft (program 1.0.0 False) diff --git a/plutarch-test/goldens/bool.uplc.golden b/plutarch-test/goldens/bool.uplc.golden index 06af53167..eb80239f8 100644 --- a/plutarch-test/goldens/bool.uplc.golden +++ b/plutarch-test/goldens/bool.uplc.golden @@ -1,5 +1,5 @@ -pnot.lam (program 1.0.0 (\i0 -> force (force ifThenElse i1 (delay False) (delay True)))) -pnot.app (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) True)) +pnot.lam (program 1.0.0 (\i0 -> force ifThenElse i1 False True)) +pnot.app (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) True)) pand.tf (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay False)))) pand.ft (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay True)))) pand.tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay True)))) @@ -9,13 +9,13 @@ pand.laziness.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (d pand.laziness.pand.perror.false (program 1.0.0 error) pand.laziness.pand.perror.true (program 1.0.0 error) pand.laziness.pand.perror.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay error)))) -por.tf (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay False)))) -por.ft (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay True)))) -por.tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay True)))) -por.ff (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay False)))) -por.laziness.por (program 1.0.0 ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error))) -por.laziness.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error)))) +por.tf (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay False)))) +por.ft (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) False (delay True)))) +por.tt (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay True)))) +por.ff (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) False (delay False)))) +por.laziness.por (program 1.0.0 ((\i0 -> force ifThenElse i1 (delay True)) True (delay error))) +por.laziness.op (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay error)))) por.laziness.pand.perror.false (program 1.0.0 error) por.laziness.pand.perror.true (program 1.0.0 error) -por.laziness.pand.perror.op.true (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error)))) -por.laziness.pand.perror.op.false (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay error)))) \ No newline at end of file +por.laziness.pand.perror.op.true (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay error)))) +por.laziness.pand.perror.op.false (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) False (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.fun.bench.golden b/plutarch-test/goldens/list.fun.bench.golden index 4449d5a2b..30f3399de 100644 --- a/plutarch-test/goldens/list.fun.bench.golden +++ b/plutarch-test/goldens/list.fun.bench.golden @@ -1,7 +1,7 @@ pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -pnull.nonempty {"exBudgetCPU":16261571,"exBudgetMemory":40093,"scriptSizeBytes":85} +pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} pconcat.identity {"exBudgetCPU":2054437,"exBudgetMemory":7000,"scriptSizeBytes":64} -plength {"exBudgetCPU":27522836,"exBudgetMemory":71312,"scriptSizeBytes":95} +plength {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} pelem {"exBudgetCPU":21833687,"exBudgetMemory":56502,"scriptSizeBytes":97} pall {"exBudgetCPU":16886804,"exBudgetMemory":42193,"scriptSizeBytes":100} plistEquals.true {"exBudgetCPU":46644574,"exBudgetMemory":122904,"scriptSizeBytes":126} diff --git a/plutarch-test/goldens/list.fun.uplc.golden b/plutarch-test/goldens/list.fun.uplc.golden index 3013d33f4..0f2818f47 100644 --- a/plutarch-test/goldens/list.fun.uplc.golden +++ b/plutarch-test/goldens/list.fun.uplc.golden @@ -1,7 +1,7 @@ pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) -pnull.nonempty (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +pnull.nonempty (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 i2 (i4 i1)) (delay i3)) i2) ((\i0 -> i2 i1 (\i0 -> \i0 -> force i1)) 0) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -plength (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> addInteger (i5 i1 i3) 1) (delay i1)) i1 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +plength (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (addInteger i4 1) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) pelem (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i2 i5) (delay True) (delay (i4 i1)))) (delay False))) 5 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) pall (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i5 i2) (delay (i4 i1)))) (delay True))) (\i0 -> False) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) plistEquals.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) diff --git a/plutarch-test/goldens/pisdata.equality.bench.golden b/plutarch-test/goldens/pisdata.equality.bench.golden index 1e7a0c8e3..823f5cf55 100644 --- a/plutarch-test/goldens/pisdata.equality.bench.golden +++ b/plutarch-test/goldens/pisdata.equality.bench.golden @@ -1,4 +1,4 @@ PData.1 {"exBudgetCPU":518284,"exBudgetMemory":901,"scriptSizeBytes":22} -PData.2 {"exBudgetCPU":696242,"exBudgetMemory":1802,"scriptSizeBytes":31} +PData.2 {"exBudgetCPU":636696,"exBudgetMemory":1602,"scriptSizeBytes":30} PAsData.1 {"exBudgetCPU":768057,"exBudgetMemory":1065,"scriptSizeBytes":15} -PAsData.1 {"exBudgetCPU":1125334,"exBudgetMemory":2266,"scriptSizeBytes":32} \ No newline at end of file +PAsData.1 {"exBudgetCPU":1065788,"exBudgetMemory":2066,"scriptSizeBytes":31} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.equality.uplc.golden b/plutarch-test/goldens/pisdata.equality.uplc.golden index d0755c998..a6c36e050 100644 --- a/plutarch-test/goldens/pisdata.equality.uplc.golden +++ b/plutarch-test/goldens/pisdata.equality.uplc.golden @@ -1,4 +1,4 @@ PData.1 (program 1.0.0 ((\i0 -> equalsData i1 i1) #9fd87a9f00ffff)) -PData.2 (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) (equalsData #d87980 #182a))) +PData.2 (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) (equalsData #d87980 #182a))) PAsData.1 (program 1.0.0 (equalsData (iData 42) (iData 42))) -PAsData.1 (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) (equalsData (bData #12) (bData #ab)))) \ No newline at end of file +PAsData.1 (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) (equalsData (bData #12) (bData #ab)))) \ No newline at end of file From 9631116b189d12c22e2c2e4e711fd1cd2bd7dac8 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:12:46 +0530 Subject: [PATCH 185/584] `PEq` and `POrd` instances for `PBool` --- Plutarch/Bool.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 916afdfff..74458f37b 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -31,7 +31,7 @@ import Generics.SOP ( ccompare_NS, hcliftA2, ) -import Plutarch.Internal (punsafeAsClosedTerm) +import Plutarch.Internal (plet, punsafeAsClosedTerm) import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) import Plutarch.Internal.Other ( DerivePNewtype, @@ -47,6 +47,7 @@ import Plutarch.Internal.Other ( pmatch, pto, (#), + (#$), type (:-->), ) import Plutarch.Lift ( @@ -83,13 +84,20 @@ class PEq t where infix 4 #== -class POrd t where +class PEq t => POrd t where (#<=) :: Term s t -> Term s t -> Term s PBool (#<) :: Term s t -> Term s t -> Term s PBool infix 4 #<= infix 4 #< +instance PEq PBool where + x #== y' = plet y' $ \y -> pif' # x # y #$ pnot # y + +instance POrd PBool where + x #< y = pif' # x # pconstant False # y + x #<= y = pif' # x # y # pconstant True + instance PEq b => PEq (DerivePNewtype a b) where x #== y = pto x #== pto y From ae4c8c2400fa20a53bb3f0b344373fc1065e4217 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:13:20 +0530 Subject: [PATCH 186/584] Special `PEq` and `PIsData` instances for `PBuiltinList` --- Plutarch/Builtin.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 7fe0d0214..651d04360 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -170,6 +170,12 @@ instance PListLike PBuiltinList where instance (PLift a, PEq a) => PEq (PBuiltinList a) where (#==) xs ys = plistEquals # xs # ys +instance {-# OVERLAPPING #-} PIsData a => PEq (PBuiltinList (PAsData a)) where + xs #== ys = pdata xs #== pdata ys + +instance {-# OVERLAPPING #-} PEq (PBuiltinList PData) where + xs #== ys = pdata xs #== pdata ys + data PData s = PDataConstr (Term s (PBuiltinPair PInteger (PBuiltinList PData))) | PDataMap (Term s (PBuiltinList (PBuiltinPair PData PData))) @@ -236,6 +242,10 @@ instance PIsData PData where pfromData = punsafeCoerce pdata = punsafeCoerce +instance PIsData (PBuiltinList PData) where + pfromData x = punsafeCoerce $ pasList # pforgetData x + pdata x = punsafeBuiltin PLC.ListData # x + instance PIsData a => PIsData (PBuiltinList (PAsData a)) where pfromData x = punsafeCoerce $ pasList # pforgetData x pdata x = punsafeBuiltin PLC.ListData # x From 75c40eb15d22d2341208b87f1b8ebc6578bb6a13 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:14:10 +0530 Subject: [PATCH 187/584] Add `PEq`/`POrd` deriving for data encoded types --- Plutarch/DataRepr/Internal.hs | 137 +++++++++++++++++++++++++++++++--- 1 file changed, 128 insertions(+), 9 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 9272ed116..a5bbc1430 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -21,6 +21,8 @@ module Plutarch.DataRepr.Internal ( pdropDataRecord, DerivePConstantViaData (..), pasDataSum, + pdToBuiltin, + LTReprHandlers (..), ) where import Data.Kind (Type) @@ -61,13 +63,14 @@ import Plutarch ( phoistAcyclic, plam, plet, + pmatch, pmatch', pto, (#), (#$), type (:-->), ) -import Plutarch.Bool (pif, (#==)) +import Plutarch.Bool (PBool, PEq, POrd, pif, (#<), (#<=), (#==), (#||)) import Plutarch.Builtin ( PAsData, PBuiltinList, @@ -88,7 +91,7 @@ import Plutarch.Internal (S (SI)) import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) -import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) +import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont, tcont, unTermCont) import Plutarch.Unsafe (punsafeCoerce) import qualified Plutus.V1.Ledger.Api as Ledger @@ -121,6 +124,35 @@ instance PlutusType (PDataRecord '[]) where pcon' PDNil = pnil pmatch' _ f = f PDNil +-- | This uses data equality. 'PEq' instances of elements don't make any difference. +instance PEq (PDataRecord xs) where + x #== y = pdToBuiltin x #== pdToBuiltin y + +-- Lexicographic ordering based 'Ord' instances for 'PDataRecord'. + +instance POrd (PDataRecord '[]) where + _ #<= _ = pconstant True + _ #< _ = pconstant False + +instance (POrd x, PIsData x) => POrd (PDataRecord '[label ':= x]) where + l1 #< l2 = unTermCont $ do + PDCons x _ <- tcont $ pmatch l1 + PDCons y _ <- tcont $ pmatch l2 + + pure $ pfromData x #< pfromData y + l1 #<= l2 = pdata (pto l1) #== pdata (pto l2) #|| l1 #< l2 + +instance (POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord ((label ':= x) ': x' ': xs)) where + l1 #< l2 = unTermCont $ do + PDCons x xs <- tcont $ pmatch l1 + PDCons y ys <- tcont $ pmatch l2 + + a <- tcont . plet $ pfromData x + b <- tcont . plet $ pfromData y + + pure $ pif (a #< b) (pconstant True) $ pif (a #== b) (xs #< ys) $ pconstant False + l1 #<= l2 = pdata (pto l1) #== pdata (pto l2) #|| l1 #< l2 + {- | Cons a field to a data record. You can specify the label to associate with the field using type applications- @@ -139,6 +171,10 @@ pdcons = punsafeCoerce $ pcons @PBuiltinList @PData pdnil :: Term s (PDataRecord '[]) pdnil = punsafeCoerce $ pnil @PBuiltinList @PData +-- | Convert a 'PDataRecord' into a builtin list of data values, losing type information in the process. +pdToBuiltin :: Term s (PDataRecord xs) -> Term s (PBuiltinList PData) +pdToBuiltin = punsafeCoerce + data PLabeledType = Symbol := PType {- Get the product types of a data record sum constructor @@ -178,6 +214,16 @@ instance PIsData (PDataSum defs) where pdata = punsafeCoerce pfromData = punsafeCoerce +instance PEq (PDataSum defs) where + x #== y = pdata x #== pdata y + +instance MkLtReprHandler defs => POrd (PDataSum defs) where + x #< y = pmatchLT x y mkLtReprHandler + x #<= y = x #== y #|| x #< y + +pasDataSum :: PIsDataRepr a => Term s a -> Term s (PDataSum (PIsDataReprRepr a)) +pasDataSum = punsafeCoerce + -- | If there is only a single variant, then we can safely extract it. punDataSum :: Term s (PDataSum '[def] :--> PDataRecord def) punDataSum = phoistAcyclic $ @@ -260,11 +306,6 @@ pmatchDataSum d handlers = handler $ go common (idx + 1) rest constr -{- | Use this for implementing the necessary instances for getting the `Data` representation. - You must implement 'PIsDataRepr' to use this. --} -newtype PIsDataReprInstances (a :: PType) (s :: S) = PIsDataReprInstances (a s) - -- TODO: This 'PMatch' constraint needs to be changed to 'PlutusType (breaking change). class (PMatch a, PIsData a) => PIsDataRepr (a :: PType) where type PIsDataReprRepr a :: [[PLabeledType]] @@ -344,8 +385,77 @@ instance mkSOP :: NP (Term s) r -> SOP (Term s) (PCode s a) mkSOP = SOP . mkSum @_ @n @pcode -pasDataSum :: PIsDataRepr a => Term s a -> Term s (PDataSum (PIsDataReprRepr a)) -pasDataSum = punsafeCoerce +data LTReprHandlers (defs :: [[PLabeledType]]) (s :: S) where + LTRHNil :: LTReprHandlers '[] s + LTRHCons :: + (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s PBool) -> + LTReprHandlers defs s -> + LTReprHandlers (def : defs) s + +-- | Optimized dual pmatch specialized for lexicographic '#<' (and potentially) '#<=' implementation. +pmatchLT :: Term s (PDataSum defs) -> Term s (PDataSum defs) -> LTReprHandlers defs s -> Term s PBool +pmatchLT d1 d2 (LTRHCons handler LTRHNil) = handler (punDataSum # d1) (punDataSum # d2) +pmatchLT d1 d2 handlers = unTermCont $ do + a <- tcont . plet $ pasConstr #$ pforgetData $ pdata d1 + b <- tcont . plet $ pasConstr #$ pforgetData $ pdata d2 + + cid1 <- tcont . plet $ pfstBuiltin # a + cid2 <- tcont . plet $ pfstBuiltin # b + + pure $ + pif + (cid1 #< cid2) + -- Left arg's constructor id is less, no need to continue. + (pconstant True) + $ pif + (cid1 #== cid2) + -- Matching constructors, compare fields now. + ( plet (psndBuiltin # a) $ \flds1 -> + plet (psndBuiltin # b) $ \flds2 -> + go 0 (applyHandlers flds1 flds2 handlers) cid1 + ) + -- Left arg's constructor id is greater, no need to continue. + $ pconstant False + where + applyHandlers :: Term s (PBuiltinList PData) -> Term s (PBuiltinList PData) -> LTReprHandlers defs s -> [Term s PBool] + applyHandlers _ _ LTRHNil = [] + applyHandlers args1 args2 (LTRHCons handler rest) = + handler (punsafeCoerce args1) (punsafeCoerce args2) : + applyHandlers args1 args2 rest + + go :: + Integer -> + [Term s PBool] -> + Term s PInteger -> + Term s PBool + go _ [] _ = error "pmatchDataSum2:go:empty handlers" -- empty 'PDataSum' shouldn't exist. + go idx [handler1, handler2] c = + pif + (fromInteger idx #== c) + handler1 + handler2 + go idx (handler : rest) c = + pif + (fromInteger idx #== c) + handler + $ go (idx + 1) rest c + +class MkLtReprHandler defs where + type FirstDef defs :: [PLabeledType] + mkLtReprHandler :: LTReprHandlers defs s + +instance POrd (PDataRecord def) => MkLtReprHandler '[def] where + type FirstDef '[def] = def + mkLtReprHandler = LTRHCons (#<) LTRHNil + +instance (POrd (PDataRecord def), MkLtReprHandler (def' ': defs)) => MkLtReprHandler (def ': def' ': defs) where + type FirstDef (def ': def' ': defs) = def + mkLtReprHandler = LTRHCons (#<) mkLtReprHandler + +{- | Use this for implementing the necessary instances for getting the `Data` representation. + You must implement 'PIsDataRepr' to use this. +-} +newtype PIsDataReprInstances (a :: PType) (s :: S) = PIsDataReprInstances (a s) instance PIsDataRepr a => PIsData (PIsDataReprInstances a) where pdata = punsafeCoerce @@ -356,6 +466,15 @@ instance PIsDataRepr a => PlutusType (PIsDataReprInstances a) where pcon' (PIsDataReprInstances x) = pconRepr x pmatch' x f = pmatchRepr x (f . PIsDataReprInstances) +-- | This uses data equality. 'PEq' instances of elements don't make any difference. +instance PIsDataRepr a => PEq (PIsDataReprInstances a) where + x #== y = pdata x #== pdata y + +-- | This uses lexicographic ordering. Actually uses PDataSum '(#<)' implementation. +instance (PIsDataRepr a, MkLtReprHandler (PIsDataReprRepr a)) => POrd (PIsDataReprInstances a) where + x #< y = pto x #< pto y + x #<= y = x #== y #|| x #< y + newtype DerivePConstantViaData (h :: Type) (p :: PType) = DerivePConstantViaData h instance (PIsDataRepr p, PLift p, Ledger.FromData h, Ledger.ToData h) => PConstant (DerivePConstantViaData h p) where From 74232dda98ef992812582f81801ee610021b6cb1 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:16:01 +0530 Subject: [PATCH 188/584] `PEq` and `POrd` instances for API types --- Plutarch/Api/V1/Address.hs | 6 +++--- Plutarch/Api/V1/Contexts.hs | 6 +++--- Plutarch/Api/V1/DCert.hs | 2 +- Plutarch/Api/V1/Interval.hs | 8 ++++---- Plutarch/Api/V1/Maybe.hs | 39 +++++++++++++++++++++++++++++++++++-- Plutarch/Api/V1/Tx.hs | 8 ++++---- 6 files changed, 52 insertions(+), 17 deletions(-) diff --git a/Plutarch/Api/V1/Address.hs b/Plutarch/Api/V1/Address.hs index 888270717..40412de7e 100644 --- a/Plutarch/Api/V1/Address.hs +++ b/Plutarch/Api/V1/Address.hs @@ -33,7 +33,7 @@ data PCredential (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq, POrd) via (PIsDataReprInstances PCredential) instance PUnsafeLiftDecl PCredential where type PLifted PCredential = Plutus.Credential @@ -55,7 +55,7 @@ data PStakingCredential (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq, POrd) via PIsDataReprInstances PStakingCredential instance PUnsafeLiftDecl PStakingCredential where type PLifted PStakingCredential = Plutus.StakingCredential @@ -75,7 +75,7 @@ newtype PAddress (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via PIsDataReprInstances PAddress instance PUnsafeLiftDecl PAddress where type PLifted PAddress = Plutus.Address diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 7299b6ae3..8be0264eb 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -56,7 +56,7 @@ newtype PTxInfo (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq) via PIsDataReprInstances PTxInfo instance PUnsafeLiftDecl PTxInfo where type PLifted PTxInfo = Plutus.TxInfo @@ -76,7 +76,7 @@ newtype PScriptContext (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq) via PIsDataReprInstances PScriptContext instance PUnsafeLiftDecl PScriptContext where type PLifted PScriptContext = Plutus.ScriptContext @@ -93,7 +93,7 @@ data PScriptPurpose (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq) via (PIsDataReprInstances PScriptPurpose) instance PUnsafeLiftDecl PScriptPurpose where type PLifted PScriptPurpose = Plutus.ScriptPurpose diff --git a/Plutarch/Api/V1/DCert.hs b/Plutarch/Api/V1/DCert.hs index 42994748c..9375a36a6 100644 --- a/Plutarch/Api/V1/DCert.hs +++ b/Plutarch/Api/V1/DCert.hs @@ -47,7 +47,7 @@ data PDCert (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq, POrd) via (PIsDataReprInstances PDCert) instance PUnsafeLiftDecl PDCert where type PLifted PDCert = Plutus.DCert diff --git a/Plutarch/Api/V1/Interval.hs b/Plutarch/Api/V1/Interval.hs index d4e0b3950..7eba3d261 100644 --- a/Plutarch/Api/V1/Interval.hs +++ b/Plutarch/Api/V1/Interval.hs @@ -30,7 +30,7 @@ newtype PInterval a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via PIsDataReprInstances (PInterval a) newtype PLowerBound a (s :: S) @@ -47,7 +47,7 @@ newtype PLowerBound a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via (PIsDataReprInstances (PLowerBound a)) newtype PUpperBound a (s :: S) @@ -64,7 +64,7 @@ newtype PUpperBound a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via (PIsDataReprInstances (PUpperBound a)) data PExtended a (s :: S) @@ -75,5 +75,5 @@ data PExtended a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq, POrd) via (PIsDataReprInstances (PExtended a)) diff --git a/Plutarch/Api/V1/Maybe.hs b/Plutarch/Api/V1/Maybe.hs index b8494911d..38d353808 100644 --- a/Plutarch/Api/V1/Maybe.hs +++ b/Plutarch/Api/V1/Maybe.hs @@ -7,8 +7,11 @@ module Plutarch.Api.V1.Maybe ( import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) +import Plutarch.Builtin (pasConstr, pforgetData) +import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances), PIsDataReprRepr) +import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Prelude +import Plutarch.Unsafe (punsafeCoerce) -- | Data encoded Maybe type. Used in various ledger api types. data PMaybeData a (s :: S) @@ -18,5 +21,37 @@ data PMaybeData a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq) via PIsDataReprInstances (PMaybeData a) + +-- Have to manually write this instance because the constructor id ordering is screwed for 'Maybe'.... +instance (PIsData a, POrd a) => POrd (PMaybeData a) where + x #< y = unTermCont $ do + a <- tcont . plet $ pasConstr #$ pforgetData $ pdata x + b <- tcont . plet $ pasConstr #$ pforgetData $ pdata y + + cid1 <- tcont . plet $ pfstBuiltin # a + cid2 <- tcont . plet $ pfstBuiltin # b + + pure $ + pif + (cid1 #< cid2) + (pconstant False) + $ pif + (cid1 #== cid2) + {- Some hand optimization here: usually, the fields would be 'plet'ed here if using 'POrd' derivation + machinery. However, in this case - there's no need for the fields for the 'Nothing' case. + + Would be nice if this could be done on the auto derivation case.... + -} + ( pif + (cid1 #== 0) + (lt0 (punsafeCoerce $ psndBuiltin # a) (punsafeCoerce $ psndBuiltin # b)) + -- Both are 'Nothing'. '#<' is False. + $ pconstant False + ) + $ pconstant True + where + lt0 = (#<) @(PDataRecord (IndexList 0 (PIsDataReprRepr (PMaybeData a)))) + + x #<= y = x #== y #|| x #< y diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index dcd9a52fd..dc49ca0d9 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -34,7 +34,7 @@ newtype PTxId (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via PIsDataReprInstances PTxId instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId @@ -54,7 +54,7 @@ newtype PTxOutRef (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via PIsDataReprInstances PTxOutRef instance PUnsafeLiftDecl PTxOutRef where type PLifted PTxOutRef = Plutus.TxOutRef @@ -74,7 +74,7 @@ newtype PTxInInfo (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq) via PIsDataReprInstances PTxInInfo instance PUnsafeLiftDecl PTxInInfo where type PLifted PTxInInfo = Plutus.TxInInfo @@ -95,7 +95,7 @@ newtype PTxOut (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq) via (PIsDataReprInstances PTxOut) instance PUnsafeLiftDecl PTxOut where type PLifted PTxOut = Plutus.TxOut From 994ce972ec6f00975b974c8acd5142c9c0f26b2e Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:31:41 +0530 Subject: [PATCH 189/584] Use `pdtoBuiltin` rather than `pdata . pto` --- Plutarch/DataRepr/Internal.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index a5bbc1430..fd2f6bf58 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -140,7 +140,7 @@ instance (POrd x, PIsData x) => POrd (PDataRecord '[label ':= x]) where PDCons y _ <- tcont $ pmatch l2 pure $ pfromData x #< pfromData y - l1 #<= l2 = pdata (pto l1) #== pdata (pto l2) #|| l1 #< l2 + l1 #<= l2 = pdToBuiltin l1 #== pdToBuiltin l1 #|| l1 #< l2 instance (POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord ((label ':= x) ': x' ': xs)) where l1 #< l2 = unTermCont $ do @@ -151,7 +151,7 @@ instance (POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord b <- tcont . plet $ pfromData y pure $ pif (a #< b) (pconstant True) $ pif (a #== b) (xs #< ys) $ pconstant False - l1 #<= l2 = pdata (pto l1) #== pdata (pto l2) #|| l1 #< l2 + l1 #<= l2 = pdToBuiltin l1 #== pdToBuiltin l2 #|| l1 #< l2 {- | Cons a field to a data record. From 9f805a7d9fcfd73b2712c1172909b5cdcfffd2f2 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:32:32 +0530 Subject: [PATCH 190/584] Update CHANGELOG --- CHANGELOG.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61fcda3e1..e61f016d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # Unreleased -- Add `pshow` and `ptraceShowId` +- Add `pshow` and `ptraceShowId` Started by [#352](https://github.com/Plutonomicon/plutarch/pull/352) @@ -53,7 +53,7 @@ - Added APIs for constructing, compiling, serialising & hashing Plutarch scripts. Type synonyms for Plutarch-typed scripts `PValidator`,`PMintingPolicy` & `PStakeValidator`. - + `mkValidator`, `mkStakeValidator` & `mkMintingPolicy` functions, for creating Plutus API compatible scripts. `validatorHash`, `mintingPolicySymbol` & `stakeValidatorHash` to obtain script hashes. @@ -85,13 +85,17 @@ - Add `Plutarch.Test` for testing Plutarch code with goldens for UPLC printing and Plutus benchmarks. -- `plutarch-extra`: Add a new directory scaffold "`plutarch-extra`" which will be home to everything too specific to not be in the +- `plutarch-extra`: Add a new directory scaffold "`plutarch-extra`" which will be home to everything too specific to not be in the main Plutarch repo. Also refactored the test library. Directory: `plutarch-extra` Added by: [#329](https://github.com/Plutonomicon/plutarch/pull/329) +- Add `POrd` and `PEq` derivation for data encoded types via `PIsDataReprInstances`. + + Added by: [#371](https://github.com/Plutonomicon/plutarch/pull/371) + # 1.1.0 - General repository changes. From 5d3477014614681305df6649e989c70cbd2f5d54 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 19:13:14 +0530 Subject: [PATCH 191/584] Property tests for `PEq` and `POrd` impl --- Plutarch/Api/V1/Maybe.hs | 30 +++++- .../plutarch-base/Plutarch/FieldSpec.hs | 52 +++------- .../plutarch-base/Plutarch/PIsDataSpec.hs | 30 +----- .../plutarch-base/Plutarch/POrdSpec.hs | 95 +++++++++++++++++++ .../plutarch-base/Plutarch/SpecTypes.hs | 69 ++++++++++++++ plutarch-test/plutarch-test.cabal | 5 +- 6 files changed, 212 insertions(+), 69 deletions(-) create mode 100644 plutarch-test/plutarch-base/Plutarch/POrdSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/SpecTypes.hs diff --git a/Plutarch/Api/V1/Maybe.hs b/Plutarch/Api/V1/Maybe.hs index 38d353808..d02fabcb7 100644 --- a/Plutarch/Api/V1/Maybe.hs +++ b/Plutarch/Api/V1/Maybe.hs @@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V1.Maybe ( PMaybeData (PDJust, PDNothing), @@ -6,10 +7,19 @@ module Plutarch.Api.V1.Maybe ( import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) +import qualified PlutusTx import Plutarch.Builtin (pasConstr, pforgetData) -import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances), PIsDataReprRepr) +import Plutarch.DataRepr.Internal ( + DerivePConstantViaData (DerivePConstantViaData), + PIsDataReprInstances (PIsDataReprInstances), + PIsDataReprRepr, + ) import Plutarch.DataRepr.Internal.HList.Utils (IndexList) +import Plutarch.Lift ( + PConstant (PConstanted), + PUnsafeLiftDecl (..), + ) import Plutarch.Prelude import Plutarch.Unsafe (punsafeCoerce) @@ -24,6 +34,24 @@ data PMaybeData a (s :: S) (PlutusType, PIsData, PEq) via PIsDataReprInstances (PMaybeData a) +instance + ( PConstanted (PLifted a) ~ a + , PlutusTx.FromData (PLifted a) + , PlutusTx.ToData (PLifted a) + ) => + PUnsafeLiftDecl (PMaybeData a) + where + type PLifted (PMaybeData a) = Maybe (PLifted a) + +deriving via + (DerivePConstantViaData (Maybe a) (PMaybeData (PConstanted a))) + instance + ( PlutusTx.FromData a + , PlutusTx.ToData a + , PLifted (PConstanted a) ~ a + ) => + PConstant (Maybe a) + -- Have to manually write this instance because the constructor id ordering is screwed for 'Maybe'.... instance (PIsData a, POrd a) => POrd (PMaybeData a) where x #< y = unTermCont $ do diff --git a/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs b/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs index 8e773f25f..f6cef6642 100644 --- a/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs @@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedRecordDot #-} -{-# LANGUAGE UndecidableInstances #-} module Plutarch.FieldSpec (spec) where @@ -10,15 +9,10 @@ import qualified PlutusTx import Test.Syd import Test.Tasty.HUnit -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) import Plutarch.Api.V1 (PAddress (PAddress)) import Plutarch.Builtin (ppairDataBuiltin) -import Plutarch.DataRepr ( - PDataFields, - PIsDataReprInstances (PIsDataReprInstances), - ) import Plutarch.Prelude +import Plutarch.SpecTypes (PTriplet) import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) @@ -90,32 +84,8 @@ spec = do -------------------------------------------------------------------------------- -{- | - We can defined a data-type using PDataRecord, with labeled fields. - - With an appropriate instance of 'PIsDataRepr', we can automatically - derive 'PDataFields'. --} -newtype Triplet (a :: PType) (s :: S) - = Triplet - ( Term - s - ( PDataRecord - '[ "x" ':= a - , "y" ':= a - , "z" ':= a - ] - ) - ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields) - via (PIsDataReprInstances (Triplet a)) - mkTrip :: - forall a s. (PIsData a) => Term s a -> Term s a -> Term s a -> Term s (Triplet a) + forall a s. (PIsData a) => Term s a -> Term s a -> Term s a -> Term s (PTriplet a) mkTrip x y z = punsafeBuiltin PLC.ConstrData # (0 :: Term _ PInteger) # ( ( pcons # (pdata x) @@ -127,19 +97,19 @@ mkTrip x y z = ) -- | An example term -tripA :: Term s (Triplet PInteger) +tripA :: Term s (PTriplet PInteger) tripA = mkTrip 150 750 100 -- | Another -tripB :: Term s (Triplet PInteger) +tripB :: Term s (PTriplet PInteger) tripB = mkTrip 50 10 40 -- | Another -tripC :: Term s (Triplet PInteger) +tripC :: Term s (PTriplet PInteger) tripC = mkTrip 1 8 1 --- | Nested triplet -tripTrip :: Term s (Triplet (Triplet PInteger)) +-- | Nested PTriplet +tripTrip :: Term s (PTriplet (PTriplet PInteger)) tripTrip = mkTrip tripA tripB tripC {- | @@ -149,7 +119,7 @@ tripTrip = mkTrip tripA tripB tripC The fields in the 'HRec' can them be accessed with RecordDotSyntax. -} -tripSum :: Term s ((Triplet PInteger) :--> PInteger) +tripSum :: Term s ((PTriplet PInteger) :--> PInteger) tripSum = plam $ \x -> pletFields @["x", "y", "z"] x $ \fs -> @@ -160,7 +130,7 @@ tripSum = {- | A subset of fields can be specified. -} -tripYZ :: Term s ((Triplet PInteger) :--> PInteger) +tripYZ :: Term s ((PTriplet PInteger) :--> PInteger) tripYZ = plam $ \x -> pletFields @["y", "z"] x $ \fs -> @@ -170,7 +140,7 @@ tripYZ = The ordering of fields specified is irrelevant, this is equivalent to 'tripYZ'. -} -tripZY :: Term s ((Triplet PInteger) :--> PInteger) +tripZY :: Term s ((PTriplet PInteger) :--> PInteger) tripZY = plam $ \x -> pletFields @["z", "y"] x $ \fs -> @@ -185,7 +155,7 @@ tripZY = by :: Term s PInteger by = pfield @"y" # tripB -getY :: Term s (Triplet PInteger :--> PAsData PInteger) +getY :: Term s (PTriplet PInteger :--> PAsData PInteger) getY = pfield @"y" {- | diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index 9e48ddc1d..b150ec0ba 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -23,9 +23,10 @@ import Test.Tasty.QuickCheck (Arbitrary, property) import Plutarch.Api.V1 import Plutarch.Api.V1.Tuple (pbuiltinPairFromTuple, ptupleFromBuiltin) import Plutarch.Builtin (pforgetData, ppairDataBuiltin) -import Plutarch.DataRepr (PDataFields, PIsDataReprInstances (PIsDataReprInstances)) +import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) import Plutarch.Lift (PLifted) import Plutarch.Prelude +import Plutarch.SpecTypes (PTriplet (PTriplet)) import Plutarch.Test spec :: Spec @@ -96,7 +97,7 @@ spec = do "prod" @\ do "1" @| pcon - ( Triplet $ + ( PTriplet $ pdcons # pconstantData @PCurrencySymbol "ab" #$ pdcons # pconstantData "41" #$ pdcons @@ -116,7 +117,7 @@ spec = do rewarding = Rewarding . StakingHash $ PubKeyCredential "da" "2" @| pcon - ( Triplet $ + ( PTriplet $ pdcons # pconstantData minting #$ pdcons # pconstantData spending #$ pdcons @@ -199,29 +200,6 @@ pdataCompat :: IO () pdataCompat x = PlutusTx.fromData @(PLifted p) (plift $ pforgetData $ pdata $ pconstant @p x) `shouldBe` Just x -{- | - We can defined a data-type using PDataRecord, with labeled fields. - - With an appropriate instance of 'PIsDataRepr', we can automatically - derive 'PDataFields'. --} -newtype Triplet (a :: PType) (s :: S) - = Triplet - ( Term - s - ( PDataRecord - '[ "x" ':= a - , "y" ':= a - , "z" ':= a - ] - ) - ) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields) - via (PIsDataReprInstances (Triplet a)) - data PVehicle (s :: S) = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs new file mode 100644 index 000000000..c3800c478 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -0,0 +1,95 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.POrdSpec (spec) where + +import Data.ByteString (ByteString) + +import Plutus.V1.Ledger.Api ( + Address (Address), + Credential (PubKeyCredential, ScriptCredential), + PubKeyHash (PubKeyHash), + StakingCredential (StakingHash, StakingPtr), + ValidatorHash (ValidatorHash), + ) +import qualified PlutusTx as PlutusTx +import qualified PlutusTx.Builtins as PlutusTx + +import Test.QuickCheck.Instances () +import Test.Syd +import Test.Tasty.QuickCheck (Arbitrary, arbitrary, oneof, property) + +import Plutarch.Api.V1 +import Plutarch.Lift ( + DerivePConstantViaNewtype (DerivePConstantViaNewtype), + PConstant (PConstanted), + PUnsafeLiftDecl (PLifted), + ) +import Plutarch.Prelude +import Plutarch.SpecTypes (PTriplet) + +spec :: Spec +spec = do + describe "ord.pisdata" $ do + propertySet @PBool "PBool" + propertySet @(PMaybeData PInteger) "PMaybeData PInteger" + propertySet @(PTriplet PInteger) "PMaybeData PInteger" + propertySet @PAddress' "PAddress" + +propertySet :: + forall p. + ( PIsData p + , PLift p + , POrd p + , PlutusTx.ToData (PLifted p) + , PlutusTx.FromData (PLifted p) + , Ord (PLifted p) + , Show (PLifted p) + , Arbitrary (PLifted p) + ) => + String -> + Spec +propertySet typeName' = do + describe typeName' $ do + let typeName = '(' : typeName' ++ ")" + specify ("(#<) @" <> typeName <> " ≡ (<) @" <> typeName) $ + property $ pltIso @p + specify ("(#<=) @" <> typeName <> " ≡ (<=) @" <> typeName) $ + property $ plteIso @p + specify ("(#==) @" <> typeName <> " ≡ (==) @" <> typeName) $ + property $ peqIso @p + +pltIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Ord h, POrd p) => h -> h -> IO () +pltIso a b = plift (pconstant @p a #< pconstant b) `shouldBe` (a < b) + +plteIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Ord h, POrd p) => h -> h -> IO () +plteIso a b = plift (pconstant @p a #<= pconstant b) `shouldBe` (a <= b) + +peqIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Eq h, PEq p) => h -> h -> IO () +peqIso a b = plift (pconstant @p a #== pconstant b) `shouldBe` (a == b) + +newtype PAddress' s = PAddress' (Term s PAddress) + deriving (PlutusType, PIsData, PEq, POrd) via DerivePNewtype PAddress' PAddress + +instance PUnsafeLiftDecl PAddress' where type PLifted PAddress' = Address' + +newtype Address' = Address' Address + deriving stock (Show, Eq, Ord) + deriving newtype (PlutusTx.FromData, PlutusTx.ToData) + deriving (PConstant) via (DerivePConstantViaNewtype Address' PAddress' PAddress) + +instance Arbitrary Address' where + arbitrary = Address' <$> arbitraryAddr + where + arbitraryAddr = Address <$> arbitraryCred <*> arbitraryMaybeStakingCred + arbitraryCred = + oneof + [ PubKeyCredential . PubKeyHash . PlutusTx.toBuiltin @ByteString <$> arbitrary + , ScriptCredential . ValidatorHash . PlutusTx.toBuiltin @ByteString <$> arbitrary + ] + arbitraryStakingCred = + oneof + [ StakingHash <$> arbitraryCred + , StakingPtr <$> arbitrary <*> arbitrary <*> arbitrary + ] + arbitraryMaybeStakingCred = oneof [pure Nothing, Just <$> arbitraryStakingCred] diff --git a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs new file mode 100644 index 000000000..823bc34d8 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs @@ -0,0 +1,69 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.SpecTypes (Triplet (..), PTriplet (..)) where + +import qualified GHC.Generics as GHC +import Generics.SOP (Generic, I (I)) +import qualified PlutusTx + +import Plutarch.DataRepr ( + DerivePConstantViaData (DerivePConstantViaData), + PDataFields, + PIsDataReprInstances (PIsDataReprInstances), + ) +import Plutarch.Lift ( + PConstant (PConstanted), + PUnsafeLiftDecl (PLifted), + ) +import Plutarch.Prelude +import Test.Tasty.QuickCheck (Arbitrary, arbitrary) + +data Triplet a = Triplet a a a + deriving stock (Show, Eq, Ord) + +{- | + We can defined a data-type using PDataRecord, with labeled fields. + + With an appropriate instance of 'PIsDataRepr', we can automatically + derive 'PDataFields'. +-} +newtype PTriplet (a :: PType) (s :: S) + = PTriplet + ( Term + s + ( PDataRecord + '[ "x" ':= a + , "y" ':= a + , "z" ':= a + ] + ) + ) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData, PDataFields, PEq, POrd) + via (PIsDataReprInstances (PTriplet a)) + +PlutusTx.makeIsDataIndexed ''Triplet ([('Triplet, 0)]) + +instance + ( PConstanted (PLifted a) ~ a + , PlutusTx.FromData (PLifted a) + , PlutusTx.ToData (PLifted a) + ) => + PUnsafeLiftDecl (PTriplet a) + where + type PLifted (PTriplet a) = Triplet (PLifted a) + +deriving via + (DerivePConstantViaData (Triplet a) (PTriplet (PConstanted a))) + instance + ( PlutusTx.FromData a + , PlutusTx.ToData a + , PLifted (PConstanted a) ~ a + ) => + PConstant (Triplet a) + +instance Arbitrary a => Arbitrary (Triplet a) where + arbitrary = Triplet <$> arbitrary <*> arbitrary <*> arbitrary diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 7f36f0197..a4cf9fbfe 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -73,7 +73,7 @@ common c common deps build-depends: - , aeson >=2.0 + , aeson >=2.0 , base , bytestring , filepath @@ -84,6 +84,7 @@ common deps , plutus-core , plutus-ledger-api , plutus-tx + , quickcheck-instances , serialise , sydtest , sydtest-discover @@ -138,10 +139,12 @@ executable plutarch-test Plutarch.PIsDataSpec Plutarch.PLamSpec Plutarch.PlutusTypeSpec + Plutarch.POrdSpec Plutarch.RationalSpec Plutarch.RecursionSpec Plutarch.ScriptsSpec Plutarch.ShowSpec + Plutarch.SpecTypes Plutarch.StringSpec Plutarch.Test Plutarch.Test.Benchmark From 49e44a760f8a0bef0bd53e80ee520c4e5d8f6f39 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 19:17:39 +0530 Subject: [PATCH 192/584] Use `pcon` where shorter --- Plutarch/Bool.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index e8d23df66..3d25661c3 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -111,7 +111,7 @@ pif b case_true case_false = pmatch b $ \case -- | Boolean negation for 'PBool' terms. pnot :: Term s (PBool :--> PBool) -pnot = phoistAcyclic $ plam $ \x -> pif' # x # pconstant False # pconstant True +pnot = phoistAcyclic $ plam $ \x -> pif' # x # pcon PFalse # pcon PTrue -- | Lazily evaluated boolean and for 'PBool' terms. infixr 3 #&& From d5d15711f46a5486e020b69417110b2b9ae95844 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 22:01:45 +0530 Subject: [PATCH 193/584] Special case for common handler --- Plutarch/DataRepr/Internal.hs | 45 ++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index fd2f6bf58..b9f70dd7a 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -410,13 +410,28 @@ pmatchLT d1 d2 handlers = unTermCont $ do $ pif (cid1 #== cid2) -- Matching constructors, compare fields now. - ( plet (psndBuiltin # a) $ \flds1 -> - plet (psndBuiltin # b) $ \flds2 -> - go 0 (applyHandlers flds1 flds2 handlers) cid1 + ( unTermCont $ do + flds1 <- tcont . plet $ psndBuiltin # a + flds2 <- tcont . plet $ psndBuiltin # b + let handlers' = applyHandlers flds1 flds2 handlers + common <- findCommon handlers' + pure $ go common 0 (applyHandlers flds1 flds2 handlers) cid1 ) -- Left arg's constructor id is greater, no need to continue. $ pconstant False where + hashHandlers :: [Term s PBool] -> TermCont s [(Dig, Term s PBool)] + hashHandlers [] = pure [] + hashHandlers (handler : rest) = do + hash <- hashOpenTerm handler + hashes <- hashHandlers rest + pure $ (hash, handler) : hashes + + findCommon :: [Term s PBool] -> TermCont s (Dig, Term s PBool) + findCommon handlers = do + l <- hashHandlers handlers + pure $ head . maximumBy (\x y -> length x `compare` length y) . groupBy (\x y -> fst x == fst y) . sortOn fst $ l + applyHandlers :: Term s (PBuiltinList PData) -> Term s (PBuiltinList PData) -> LTReprHandlers defs s -> [Term s PBool] applyHandlers _ _ LTRHNil = [] applyHandlers args1 args2 (LTRHCons handler rest) = @@ -424,21 +439,19 @@ pmatchLT d1 d2 handlers = unTermCont $ do applyHandlers args1 args2 rest go :: + (Dig, Term s out) -> Integer -> - [Term s PBool] -> + [Term s out] -> Term s PInteger -> - Term s PBool - go _ [] _ = error "pmatchDataSum2:go:empty handlers" -- empty 'PDataSum' shouldn't exist. - go idx [handler1, handler2] c = - pif - (fromInteger idx #== c) - handler1 - handler2 - go idx (handler : rest) c = - pif - (fromInteger idx #== c) - handler - $ go (idx + 1) rest c + Term s out + go common _ [] _ = snd common + go common idx (handler : rest) c = runTermCont (hashOpenTerm handler) $ \hhash -> + if hhash == fst common + then go common (idx + 1) rest c + else pif + (fromInteger idx #== c) + handler + $ go common (idx + 1) rest c class MkLtReprHandler defs where type FirstDef defs :: [PLabeledType] From 01f38ca36a59362a8c23f046f136e5e24c70d29c Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 22:02:51 +0530 Subject: [PATCH 194/584] Fix formatting --- Plutarch/DataRepr/Internal.hs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index b9f70dd7a..183063b58 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -411,11 +411,11 @@ pmatchLT d1 d2 handlers = unTermCont $ do (cid1 #== cid2) -- Matching constructors, compare fields now. ( unTermCont $ do - flds1 <- tcont . plet $ psndBuiltin # a - flds2 <- tcont . plet $ psndBuiltin # b - let handlers' = applyHandlers flds1 flds2 handlers - common <- findCommon handlers' - pure $ go common 0 (applyHandlers flds1 flds2 handlers) cid1 + flds1 <- tcont . plet $ psndBuiltin # a + flds2 <- tcont . plet $ psndBuiltin # b + let handlers' = applyHandlers flds1 flds2 handlers + common <- findCommon handlers' + pure $ go common 0 (applyHandlers flds1 flds2 handlers) cid1 ) -- Left arg's constructor id is greater, no need to continue. $ pconstant False @@ -448,10 +448,11 @@ pmatchLT d1 d2 handlers = unTermCont $ do go common idx (handler : rest) c = runTermCont (hashOpenTerm handler) $ \hhash -> if hhash == fst common then go common (idx + 1) rest c - else pif - (fromInteger idx #== c) - handler - $ go common (idx + 1) rest c + else + pif + (fromInteger idx #== c) + handler + $ go common (idx + 1) rest c class MkLtReprHandler defs where type FirstDef defs :: [PLabeledType] From f4ac296af45fb2e77dafb6e2fab6e1e2cbf99ba3 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 10 Mar 2022 22:36:33 +0530 Subject: [PATCH 195/584] Include instance change --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e61f016d2..db6272256 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,10 @@ Added by: [#371](https://github.com/Plutonomicon/plutarch/pull/371) +- Add `PConstant` instance for `Maybe`, with corresponding `PLift` instance for `PMaybeData`. + + Added by: [#371](https://github.com/Plutonomicon/plutarch/pull/371) + # 1.1.0 - General repository changes. From b29f34affe74f3104e3751368f47c60dfcd7e510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 11 Mar 2022 11:26:08 -0500 Subject: [PATCH 196/584] Renamed PDelayedList to PTxList to avoid clashing with existing PDCons & PDNil --- Plutarch/FFI.hs | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 5fde43fca..7627e4124 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -2,13 +2,13 @@ module Plutarch.FFI ( type (>~<), - PDelayedList (PDCons, PDNil), + PTxList (PTxCons, PTxNil), foreignExport, foreignImport, opaqueExport, opaqueImport, - pdelayList, - pforceList, + plistFromTx, + plistToTx, unsafeForeignExport, unsafeForeignImport, ) where @@ -70,17 +70,17 @@ data PhorallPhantom :: PType data Delayed :: Type -> Type data DelayedList :: Type -> Type -{- | Plutarch type of delayed lists, compatible with the PlutusTx encoding of - Haskell lists and convertible with the regular 'PList' using 'pdelayList' - and 'pforceList'. +{- | Plutarch type of lists compatible with the PlutusTx encoding of Haskell + lists and convertible with the regular 'PList' using 'plistToTx' and + 'plistFromTx'. -} -data PDelayedList (a :: PType) (s :: S) - = PDCons (Term s a) (Term s (PDelayedList a)) - | PDNil +data PTxList (a :: PType) (s :: S) + = PTxCons (Term s a) (Term s (PTxList a)) + | PTxNil deriving stock (Generic) deriving anyclass (SOP.Generic) -instance PEq a => PEq (PDelayedList a) where +instance PEq a => PEq (PTxList a) where (#==) xs ys = plistEquals # xs # ys -- | Compile and export a Plutarch term so it can be used by `PlutusTx.applyCode`. @@ -113,25 +113,25 @@ unsafeForeignExport t = DeserializedCode program Nothing mempty unsafeForeignImport :: CompiledCode t -> ClosedTerm p unsafeForeignImport c = Term $ const $ TermResult (RCompiled $ UPLC._progTerm $ unScript $ fromCompiledCode c) [] --- | Convert a strict 'PList' to a 'PDelayList', perhaps before exporting it with 'foreignExport'. -pdelayList :: Term s (PList a :--> PDelayedList a) -pdelayList = pconvertLists +-- | Convert a 'PList' to a 'PTxList', perhaps before exporting it with 'foreignExport'. +plistToTx :: Term s (PList a :--> PTxList a) +plistToTx = pconvertLists --- | Convert a 'PDelayList' to a strict 'PList', probably after importing it with 'foreignImport'. -pforceList :: Term s (PDelayedList a :--> PList a) -pforceList = pconvertLists +-- | Convert a 'PTxList' to a 'PList', probably after importing it with 'foreignImport'. +plistFromTx :: Term s (PTxList a :--> PList a) +plistFromTx = pconvertLists -instance PlutusType (PDelayedList a) where - type PInner (PDelayedList a) r = PDelayed (r :--> (a :--> PDelayedList a :--> r) :--> r) - pcon' (PDCons x xs) = pdelay $ plam $ \_nil cons -> cons # x # xs - pcon' PDNil = phoistAcyclic $ pdelay $ plam $ \nil _cons -> nil - pmatch' elim f = pforce elim # f PDNil # (plam $ \x xs -> f $ PDCons x xs) +instance PlutusType (PTxList a) where + type PInner (PTxList a) r = PDelayed (r :--> (a :--> PTxList a :--> r) :--> r) + pcon' (PTxCons x xs) = pdelay $ plam $ \_nil cons -> cons # x # xs + pcon' PTxNil = phoistAcyclic $ pdelay $ plam $ \nil _cons -> nil + pmatch' elim f = pforce elim # f PTxNil # (plam $ \x xs -> f $ PTxCons x xs) -instance PListLike PDelayedList where - type PElemConstraint PDelayedList _ = () +instance PListLike PTxList where + type PElemConstraint PTxList _ = () pelimList cons nil list = pforce (pto list) # nil # plam cons - pcons = phoistAcyclic $ plam $ \x xs -> pcon (PDCons x xs) - pnil = pcon PDNil + pcons = phoistAcyclic $ plam $ \x xs -> pcon (PTxCons x xs) + pnil = pcon PTxNil -- | Equality of inner types - Plutarch on the left and Haskell on the right. type p >~< t = PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom @@ -154,7 +154,7 @@ type family PlutarchInner (p :: PType) (any :: PType) :: Type where PlutarchInner (PAsData a :--> b) x = PlutarchInner (PData :--> b) x PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x PlutarchInner (PDelayed a) x = Delayed (PlutarchInner a x) - PlutarchInner (PDelayedList a) x = DelayedList (PlutarchInner a x) + PlutarchInner (PTxList a) x = DelayedList (PlutarchInner a x) PlutarchInner p x = PlutarchInner (PInner p x) x type family PlutusTxInner (t :: Type) (any :: Type) :: Type where From e0cc05535f74456b79450ae8a44df604f01f33aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 11 Mar 2022 11:46:16 -0500 Subject: [PATCH 197/584] Added PTxMaybe --- Plutarch/FFI.hs | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 7627e4124..3ab480d05 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -9,6 +9,8 @@ module Plutarch.FFI ( opaqueImport, plistFromTx, plistToTx, + pmaybeFromTx, + pmaybeToTx, unsafeForeignExport, unsafeForeignImport, ) where @@ -38,6 +40,7 @@ import Plutarch ( pforce, phoistAcyclic, plam, + pmatch, pto, (#), (:-->), @@ -55,6 +58,8 @@ import Plutarch.Internal ( ) import Plutarch.Internal.PlutusType (PlutusType (PInner, pcon', pmatch')) import Plutarch.List (PList, PListLike (PElemConstraint, pcons, pelimList, pnil), pconvertLists, plistEquals) +import Plutarch.Maybe (PMaybe (PJust, PNothing)) +import Plutarch.Show (PShow) import Plutarch.String (PString) import Plutarch.Unit (PUnit) import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) @@ -78,7 +83,16 @@ data PTxList (a :: PType) (s :: S) = PTxCons (Term s a) (Term s (PTxList a)) | PTxNil deriving stock (Generic) - deriving anyclass (SOP.Generic) + deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo, PShow) + +{- | Plutarch type compatible with the PlutusTx encoding of Haskell 'Maybe' and + convertible with the regular 'PMaybe' using 'pmaybeToTx' and 'pmaybeFromTx'. +-} +data PTxMaybe (a :: PType) (s :: S) + = PTxJust (Term s a) + | PTxNothing + deriving stock (Generic) + deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo, PEq, PShow) instance PEq a => PEq (PTxList a) where (#==) xs ys = plistEquals # xs # ys @@ -121,6 +135,18 @@ plistToTx = pconvertLists plistFromTx :: Term s (PTxList a :--> PList a) plistFromTx = pconvertLists +-- | Convert a 'PMaybe' to a 'PTxMaybe', perhaps before exporting it with 'foreignExport'. +pmaybeToTx :: Term s (PMaybe a :--> PTxMaybe a) +pmaybeToTx = plam $ flip pmatch $ pcon . \case + PNothing -> PTxNothing + PJust x -> PTxJust x + +-- | Convert a 'PTxMaybe' to a 'PMaybe', probably after importing it with 'foreignImport'. +pmaybeFromTx :: Term s (PTxMaybe a :--> PMaybe a) +pmaybeFromTx = plam $ flip pmatch $ pcon . \case + PTxNothing -> PNothing + PTxJust x -> PJust x + instance PlutusType (PTxList a) where type PInner (PTxList a) r = PDelayed (r :--> (a :--> PTxList a :--> r) :--> r) pcon' (PTxCons x xs) = pdelay $ plam $ \_nil cons -> cons # x # xs @@ -133,6 +159,12 @@ instance PListLike PTxList where pcons = phoistAcyclic $ plam $ \x xs -> pcon (PTxCons x xs) pnil = pcon PTxNil +instance PlutusType (PTxMaybe a) where + type PInner (PTxMaybe a) r = PDelayed (r :--> (a :--> r) :--> r) + pcon' (PTxJust x) = pdelay $ plam $ \_nothing just -> just # x + pcon' PTxNothing = phoistAcyclic $ pdelay $ plam $ \nothing _just -> nothing + pmatch' elim f = pforce elim # f PTxNothing # (plam $ f . PTxJust) + -- | Equality of inner types - Plutarch on the left and Haskell on the right. type p >~< t = PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom From afcecb423e79ec718e634f05d157e881aade07b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 11 Mar 2022 11:58:29 -0500 Subject: [PATCH 198/584] Formatting --- Plutarch/FFI.hs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 3ab480d05..674ead940 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -137,15 +137,21 @@ plistFromTx = pconvertLists -- | Convert a 'PMaybe' to a 'PTxMaybe', perhaps before exporting it with 'foreignExport'. pmaybeToTx :: Term s (PMaybe a :--> PTxMaybe a) -pmaybeToTx = plam $ flip pmatch $ pcon . \case - PNothing -> PTxNothing - PJust x -> PTxJust x +pmaybeToTx = + plam $ + flip pmatch $ + pcon . \case + PNothing -> PTxNothing + PJust x -> PTxJust x -- | Convert a 'PTxMaybe' to a 'PMaybe', probably after importing it with 'foreignImport'. pmaybeFromTx :: Term s (PTxMaybe a :--> PMaybe a) -pmaybeFromTx = plam $ flip pmatch $ pcon . \case - PTxNothing -> PNothing - PTxJust x -> PJust x +pmaybeFromTx = + plam $ + flip pmatch $ + pcon . \case + PTxNothing -> PNothing + PTxJust x -> PJust x instance PlutusType (PTxList a) where type PInner (PTxList a) r = PDelayed (r :--> (a :--> PTxList a :--> r) :--> r) From de963f641d7474d14f9089bbf97cb1754c35093f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 11 Mar 2022 12:40:49 -0500 Subject: [PATCH 199/584] Fixed the PTxMaybe constructor order and exported --- Plutarch/FFI.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 674ead940..3a810edbd 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -3,6 +3,7 @@ module Plutarch.FFI ( type (>~<), PTxList (PTxCons, PTxNil), + PTxMaybe (PTxJust, PTxNothing), foreignExport, foreignImport, opaqueExport, @@ -166,10 +167,10 @@ instance PListLike PTxList where pnil = pcon PTxNil instance PlutusType (PTxMaybe a) where - type PInner (PTxMaybe a) r = PDelayed (r :--> (a :--> r) :--> r) - pcon' (PTxJust x) = pdelay $ plam $ \_nothing just -> just # x - pcon' PTxNothing = phoistAcyclic $ pdelay $ plam $ \nothing _just -> nothing - pmatch' elim f = pforce elim # f PTxNothing # (plam $ f . PTxJust) + type PInner (PTxMaybe a) r = PDelayed ((a :--> r) :--> r :--> r) + pcon' (PTxJust x) = pdelay $ plam $ \just _nothing -> just # x + pcon' PTxNothing = phoistAcyclic $ pdelay $ plam $ \_just nothing -> nothing + pmatch' elim f = pforce elim # (plam $ f . PTxJust) # f PTxNothing -- | Equality of inner types - Plutarch on the left and Haskell on the right. type p >~< t = PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom From 6dd0a4d883e1157b59c6ba4c7e436f2afc79c522 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 12 Mar 2022 00:32:27 +0100 Subject: [PATCH 200/584] feat: make excess usable - new system of tracking excess - new typelevel heterogeneous tree --- Plutarch/Api/V1/AssocMap.hs | 9 +- Plutarch/Api/V1/Value.hs | 7 +- Plutarch/TryFrom.hs | 258 ++++++++++++++-------- plutarch-test/src/Plutarch/TryFromSpec.hs | 35 ++- 4 files changed, 212 insertions(+), 97 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index f7f572898..b9f8aff10 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -9,7 +9,8 @@ module Plutarch.Api.V1.AssocMap ( import Data.Map (Map, toList) import Plutarch.TryFrom ( - Flip (Flip), + HSTree (HSRoot), + HTree (HNode), PTryFrom (PTryFromExcess, ptryFrom), ) import qualified Plutus.V1.Ledger.Api as Plutus @@ -94,9 +95,9 @@ instance ) => PTryFrom (PBuiltinMap k v) (PMap k v) where - type PTryFromExcess (PBuiltinMap k v) (PMap k v) = Flip Term PUnit + type PTryFromExcess (PBuiltinMap k v) (PMap k v) = 'HNode '[] ptryFrom oMap = runTermCont $ do - sortVer <- + _ <- tcont $ plet $ ( pfix #$ plam $ @@ -113,4 +114,4 @@ instance perror ) # oMap - pure ((pcon . PMap) oMap, Flip sortVer) + pure ((pcon . PMap) oMap, HSRoot) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 8cf2e546a..43e88a2f6 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -18,7 +18,8 @@ import Plutarch.Lift ( ) import Plutarch.TryFrom ( - Flip (Flip), + HSTree (HSRoot), + HTree (HNode), PTryFrom (PTryFromExcess, ptryFrom), ) @@ -56,7 +57,7 @@ deriving via ----------------------- PTryFrom instances ---------------------------------------------- instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where - type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = Flip Term PUnit + type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = 'HNode '[] ptryFrom m = runTermCont $ do let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) perror @@ -65,4 +66,4 @@ instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where res :: Term _ PBool res = pall # predOuter # pto m _ <- tcont $ plet res - pure $ (pcon $ PValue m, Flip $ pcon PUnit) + pure $ (pcon $ PValue m, HSRoot) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index cdb294dc4..7af1a3a25 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -1,15 +1,18 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-unused-top-binds #-} module Plutarch.TryFrom ( PTryFrom (PTryFromExcess, ptryFrom), - Flip (Flip, unFlip), + HTree (HNode, HLeaf), + HSTree (HSLeaf, HSRoot, (:<<:)), + hsing, ) where import Data.Kind (Type) import Data.Proxy (Proxy (Proxy)) -import GHC.TypeLits (KnownNat, Nat, Symbol, natVal, type (+)) +import GHC.TypeLits (AppendSymbol, ErrorMessage (Text), KnownNat, Nat, Symbol, TypeError, natVal, type (+)) import Plutarch.Builtin ( PAsData, @@ -51,6 +54,7 @@ import Plutarch.DataRepr.Internal ( PDataRecord, PDataSum, PLabeledType ((:=)), + PUnLabel, pdcons, pdnil, ) @@ -93,49 +97,117 @@ import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) - the result type `b` must always be safe than the origin type `a`, i.e. it must carry more information -} -class PTryFrom (a :: PType) (b :: PType) where - type PTryFromExcess a b :: PType - ptryFrom :: Term s a -> ((Term s b, PTryFromExcess a b s) -> Term s r) -> Term s r +class PTryFrom (a :: PType) (b :: PType) (s :: S) where + type PTryFromExcess a b :: HTree + ptryFrom :: Term s a -> ((Term s b, HSTree (PTryFromExcess a b) s) -> Term s r) -> Term s r + +----------------------- HTree and friends ----------------------------------------------- + +data HTree + = HLeaf Symbol PType + | HNode Symbol [HTree] + +data HSTree (as :: HTree) (s :: S) where + HSLeaf :: forall label typ s. Term s typ -> HSTree ( 'HLeaf label typ) s + HSRoot :: forall label s. HSTree ( 'HNode label '[]) s + (:<<:) :: forall label tree trees s. HSTree tree s -> HSTree ( 'HNode label trees) s -> HSTree ( 'HNode label (tree ': trees)) s + +infixr 5 :<<: + +type (:<->:) :: HTree -> HTree -> HTree +type family n0 :<->: n1 where + 'HNode l n0 :<->: 'HNode l n1 = 'HNode l (n0 ++ n1) + 'HNode l0 _ :<->: 'HNode l1 _ = TypeError ( 'Text "We can only merge nodes with the same label") + _ :<->: _ = TypeError ( 'Text "We can only merge nodes") + +infixr 5 :<->: + +type (++) :: [a] -> [a] -> [a] +type family l1 ++ l2 where + '[] ++ ys = ys + (x ': xs) ++ ys = xs ++ x ': ys + +infixr 5 ++ + +htreeNode :: + forall name e s tree. + ( TreeElemOf name e tree + ) => + HSTree tree s -> + Term s e +htreeNode tree = indexHTree tree $ treeElemOf @name @e @tree + +indexHTree :: forall name s tree. HSTree tree s -> (forall e. TreeElem name e tree -> Term s e) +indexHTree (_ :<<: node) (There rest) = indexHTree node rest +indexHTree (HSLeaf x :<<: _) Here = x +-- indexHTree (tree :<<: _) HereTree = tree +indexHTree _ _ = error "impossible" + +class TreeElemOf (name :: Symbol) (typ :: PType) (tree :: HTree) where + treeElemOf :: TreeElem name typ tree + +instance {-# OVERLAPPING #-} TreeElemOf name e ( 'HNode sym ( 'HLeaf name e ': trees)) where + treeElemOf = Here + +instance + {-# OVERLAPPING #-} + ( HSTree ( 'HNode name tree) ~ e + ) => + TreeElemOf name e ( 'HNode sym ( 'HNode name tree ': trees)) + where + treeElemOf = HereTree + +instance + {-# OVERLAPPABLE #-} + ( TreeElemOf name e ( 'HNode sym trees) + ) => + TreeElemOf name e ( 'HNode sym (tree ': trees)) + where + treeElemOf = There treeElemOf + +data TreeElem (name :: Symbol) (typ :: PType) (tree :: HTree) where + Here :: TreeElem name typ ( 'HNode sym ( 'HLeaf name typ ': trees)) + HereTree :: TreeElem name (HSTree ( 'HNode name inner)) ( 'HNode sym ( 'HNode name inner ': trees)) + There :: TreeElem name typ ( 'HNode sym l) -> TreeElem name typ ( 'HNode sym (tree ': l)) + +deriving stock instance Show (TreeElem a b c) ----------------------- PData instances ------------------------------------------------- +hsing :: forall sym a (s :: S). Term s a -> HSTree ( 'HLeaf sym a) s +hsing = HSLeaf @sym + type Flip :: (a -> b -> Type) -> b -> a -> Type newtype Flip (f :: a -> b -> Type) (y :: b) (x :: a) = Flip {unFlip :: f x y} -instance PTryFrom PData (PAsData PInteger) where - type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger +instance PTryFrom PData (PAsData PInteger) (s :: S) where + type PTryFromExcess PData (PAsData PInteger) = 'HLeaf "unwrapped" PInteger ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) - pure $ (punsafeCoerce opq, Flip ver) + pure $ (punsafeCoerce opq, hsing ver) -instance PTryFrom PData (PAsData PByteString) where - type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString +instance PTryFrom PData (PAsData PByteString) s where + type PTryFromExcess PData (PAsData PByteString) = 'HLeaf "unwrapped" PByteString ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) - pure $ (punsafeCoerce opq, Flip ver) + pure $ (punsafeCoerce opq, hsing ver) -instance PTryFrom PData PData where - type PTryFromExcess PData PData = Flip Term PUnit - ptryFrom opq = runTermCont $ pure $ (opq, Flip $ pcon PUnit) +instance PTryFrom PData PData s where + type PTryFromExcess PData PData = 'HNode "empty" '[] + ptryFrom opq = runTermCont $ pure $ (opq, HSRoot) -instance PTryFrom PData (PAsData PData) where - type PTryFromExcess PData (PAsData PData) = Flip Term PUnit - ptryFrom opq = runTermCont $ pure (pdata opq, Flip $ pcon PUnit) - -instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) where - type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) - ptryFrom opq = runTermCont $ do - ver <- tcont $ plet (pasList # opq) - pure $ (punsafeCoerce opq, Flip ver) +instance PTryFrom PData (PAsData PData) s where + type PTryFromExcess PData (PAsData PData) = 'HNode "empty" '[] + ptryFrom opq = runTermCont $ pure (pdata opq, HSRoot) +-- TODO: add the excess inner type instance - {-# OVERLAPPABLE #-} - ( PTryFrom PData (PAsData a) - , PTryFrom PData (PAsData b) + ( PTryFrom PData (PAsData a) s + , PTryFrom PData (PAsData b) s ) => - PTryFrom PData (PAsData (PBuiltinMap a b)) + PTryFrom PData (PAsData (PBuiltinMap a b)) s where - type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = Flip Term (PBuiltinList (PBuiltinPair (PAsData a) (PAsData b))) + type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = 'HLeaf "unwrapped" (PBuiltinMap a b) ptryFrom opq = runTermCont $ do verMap <- tcont $ plet (pasMap # opq) -- I've not obtained a `PBuiltinList (PBuiltinPair a b)` @@ -145,46 +217,48 @@ instance (versnd, _) <- TermCont $ ptryFrom @PData @(PAsData b) $ psndBuiltin # tup pure $ ppairDataBuiltin # verfst # versnd ver <- tcont $ plet $ pmap # verifyPair # verMap - pure (punsafeCoerce opq, Flip ver) + pure (punsafeCoerce opq, hsing ver) -instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinMap POpaque POpaque)) where - type PTryFromExcess PData (PAsData (PBuiltinMap POpaque POpaque)) = Flip Term (PBuiltinList (PBuiltinPair (PAsData POpaque) (PAsData POpaque))) +-- TODO: add the excess inner type list +instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) s where + type PTryFromExcess PData (PAsData (PBuiltinList PData)) = 'HLeaf "unwrapped" (PBuiltinList PData) ptryFrom opq = runTermCont $ do - ver <- tcont $ plet (pasMap # opq) - pure $ (punsafeCoerce opq, Flip $ punsafeCoerce ver) -- PAsData POpaque ~ PData + ver <- tcont $ plet (pasList # opq) + pure $ (punsafeCoerce opq, hsing ver) instance {-# OVERLAPPABLE #-} - ( PTryFrom PData a + forall a b s. + ( PTryFrom PData a s , a ~ PAsData b , PIsData b ) => - PTryFrom PData (PAsData (PBuiltinList a)) + PTryFrom PData (PAsData (PBuiltinList a)) s where - type PTryFromExcess PData (PAsData (PBuiltinList a)) = Flip Term (PBuiltinList a) + type PTryFromExcess PData (PAsData (PBuiltinList a)) = 'HLeaf "unwrapped" (PBuiltinList a) ptryFrom opq = runTermCont $ do let lst :: Term _ (PBuiltinList a) lst = punsafeBuiltin PLC.UnListData # opq verify :: a ~ PAsData b => Term _ (PAsData b :--> a) verify = plam $ \e -> unTermCont $ do - (wrapped, _) <- TermCont $ ptryFrom @PData @a $ pforgetData e + (wrapped, _) <- TermCont $ ptryFrom @PData @a @s $ pforgetData e pure wrapped ver <- tcont $ plet $ pmap # verify # lst - pure $ (punsafeCoerce opq, Flip ver) + pure $ (punsafeCoerce opq, hsing ver) instance {-# OVERLAPPABLE #-} - ( PTryFrom PData a + ( PTryFrom PData a s , a ~ PAsData a' , PIsData a' - , PTryFrom PData b + , PTryFrom PData b s , b ~ PAsData b' , PIsData b' ) => - PTryFrom PData (PAsData (PBuiltinPair a b)) + PTryFrom PData (PAsData (PBuiltinPair a b)) s where - type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = Flip Term (PBuiltinPair a b) + type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = 'HLeaf "unwrapped" (PBuiltinPair a b) ptryFrom opq = runTermCont $ do tup <- tcont $ plet (pfromData $ punsafeCoerce opq) let fst' :: Term _ a @@ -192,60 +266,71 @@ instance snd' :: Term _ b snd' = unTermCont $ fst <$> TermCont (ptryFrom @PData @b $ pforgetData $ psndBuiltin # tup) ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' - pure $ (punsafeCoerce opq, Flip ver) + pure $ (punsafeCoerce opq, hsing ver) + +type FromRecordField :: PLabeledType -> HTree +type family FromRecordField field where + FromRecordField (label ':= ptyp) = 'HLeaf label ptyp + +type FromRecordFields :: [PLabeledType] -> [HTree] +type family FromRecordFields xs where + FromRecordFields '[] = '[] + FromRecordFields (x ': xs) = FromRecordField x ': FromRecordFields xs instance - {-# OVERLAPPABLE #-} - forall (b :: PType) (xs :: [PLabeledType]) (name :: Symbol) (x :: PLabeledType) (s :: S). - ( PTryFrom PData (PAsData b) - , PTryFrom PData (PAsData (PDataRecord xs)) - , x ~ (name ':= b) - , PIsData (PDataRecord xs) - , PTryFromExcess PData (PAsData (PDataRecord xs)) s ~ Flip Term (PDataRecord xs) s + ( FromRecordFields xs ~ ValidationExcess xs + , RecordValidation xs s ) => - PTryFrom PData (PAsData (PDataRecord (x ': xs))) + PTryFrom PData (PAsData (PDataRecord xs)) (s :: S) where - type PTryFromExcess PData (PAsData (PDataRecord (x ': xs))) = Flip Term (PDataRecord (x ': xs)) + type + PTryFromExcess PData (PAsData (PDataRecord xs)) = + 'HNode + "record" + ( '[ 'HLeaf "unwrapped" (PDataRecord xs) + ] + ++ FromRecordFields xs + ) ptryFrom opq = runTermCont $ do - lst <- tcont $ plet (pfromData @(PBuiltinList _) $ punsafeCoerce opq) - let lsthead :: Term _ PData - lsthead = phead # lst - lsttail :: Term _ (PAsData (PBuiltinList PData)) - lsttail = pdata $ ptail # lst - verhead :: Term _ (PAsData b) - verhead = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData b) lsthead) - vertail :: Term _ (PDataRecord xs) - vertail = unTermCont $ (unFlip . snd) <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord xs)) (pforgetData lsttail)) - ver <- - tcont $ - plet $ - pdcons @name - # verhead - # vertail - pure (punsafeCoerce opq, Flip ver) + let lst :: Term _ (PBuiltinList PData) + lst = pfromData $ punsafeCoerce opq + (rec', exc) <- recoverRecord @xs @s lst + rec <- tcont $ plet rec' + let excess :: HSTree (PTryFromExcess PData (PAsData (PDataRecord xs))) s + excess = HSLeaf @"unwrapped" rec :<<: exc + pure (punsafeCoerce opq, excess) + +class RecordValidation xs s where + type ValidationExcess xs :: [HTree] + recoverRecord :: + Term s (PBuiltinList PData) -> + TermCont s (Term s (PDataRecord xs), HSTree ( 'HNode "record" (ValidationExcess xs)) s) instance - {-# OVERLAPPING #-} - ( PTryFrom PData (PAsData b) - , PIsData b - , x ~ (s ':= b) + {-# OVERLAPPABLE #-} + ( RecordValidation xs s + , PTryFrom PData (PAsData a) s + , PTryFrom PData (PAsData (PDataRecord xs)) s + , TreeElemOf "unwrapped" (PDataRecord xs) ( 'HNode "record" (ValidationExcess xs)) ) => - PTryFrom PData (PAsData (PDataRecord '[x])) + RecordValidation ((label ':= a) ': xs) s where - type PTryFromExcess PData (PAsData (PDataRecord '[x])) = Flip Term (PDataRecord '[x]) - ptryFrom opq = runTermCont $ do - let lsthead :: Term _ PData - lsthead = phead # (pfromData @(PBuiltinList _) $ punsafeCoerce opq) - verhead :: Term _ (PAsData b) - verhead = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData b) lsthead) - ver <- - tcont $ - plet $ - pdcons @s - # verhead - # pdnil - pure $ (punsafeCoerce opq, Flip ver) + type ValidationExcess ((label ':= a) ': xs) = (PTryFromExcess PData (PAsData a)) ': ValidationExcess xs + recoverRecord lst = do + let lsthead :: Term s PData + lsthead = phead # lst + lsttail :: Term s (PBuiltinList PData) + lsttail = ptail # lst + (verhead, exchead) <- TermCont $ ptryFrom @PData @(PAsData a) @s lsthead + (_, exctail) <- recoverRecord @xs @s lsttail + rec <- tcont $ plet $ pdcons @label # verhead # (htreeNode @"unwrapped" exctail) + pure (rec, exchead :<<: exctail) + +instance {-# OVERLAPPING #-} RecordValidation '[] s where + type ValidationExcess '[] = '[] + recoverRecord _ = pure (pdnil, HSRoot) +{- class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where validateSum :: Term s PData -> Term s (PBuiltinList PData) @@ -325,3 +410,4 @@ instance ptryFrom opq = runTermCont $ do ver' <- snd <$> TermCont (ptryFrom @a @b (pfromData opq)) pure $ (punsafeCoerce opq, ver') + -} diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index b1b4e5444..7d0e9d659 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -7,6 +7,10 @@ module Plutarch.TryFromSpec (spec) where import Test.Syd +import qualified GHC.Generics as GHC + +import Generics.SOP (Generic, I (I)) + import Plutus.V1.Ledger.Api ( Address (Address), Credential (ScriptCredential), @@ -61,6 +65,7 @@ import Plutarch.TryFrom ( import Plutarch.ApiSpec (info, purpose) import qualified Plutarch.ApiSpec as Api +import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) import Plutarch.Test import Plutus.V1.Ledger.Value (Value) import qualified Plutus.V1.Ledger.Value as Value @@ -93,13 +98,13 @@ spec = do @| checkDeep @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString]]) @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) - (punsafeCoerce $ pconstant $ Constr 1 [I 5, B "foo"]) + (punsafeCoerce $ pconstant $ Constr 1 [PlutusTx.I 5, B "foo"]) @-> pfails "PDataSum wrong record type" @| checkDeep @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PByteString, "b4" ':= PByteString]]) @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) - (punsafeCoerce $ pconstant $ Constr 2 [I 5, B "foo"]) + (punsafeCoerce $ pconstant $ Constr 2 [PlutusTx.I 5, B "foo"]) @-> pfails "working" @\ do "(String, String) == (String, String)" @@ -138,13 +143,13 @@ spec = do @| checkDeep @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) - (punsafeCoerce $ pconstant $ Constr 0 [I 5, B "foo"]) + (punsafeCoerce $ pconstant $ Constr 0 [PlutusTx.I 5, B "foo"]) @-> psucceeds "PDataSum constr 1" @| checkDeep @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) - (punsafeCoerce $ pconstant $ Constr 1 [I 5, B "foo"]) + (punsafeCoerce $ pconstant $ Constr 1 [PlutusTx.I 5, B "foo"]) @-> psucceeds "recovering a record partially vs completely" @\ do "partially" @@ -474,3 +479,25 @@ sampleMap = # (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant 42)) #$ pcons # (ppairDataBuiltin # (pdata $ pconstant "bar") # (pdata $ pconstant 41)) # pnil + +{- +------------------- Sample type with PIsDataRepr ----------------------------------- + +sampleAB :: Term s (PAsData PAB) +sampleAB = pdata $ pcon $ PA (pdcons @"_0" # (pdata $ pconstant 4) #$ pdcons # (pdata $ pconstant "foo") # pdnil) + +sampleABdata :: Term s PData +sampleABdata = pforgetData sampleAB + +recoverAB :: Term s (PAsData PAB) +recoverAB = unTermCont $ do + ver <- fst <$> TermCont (ptryFrom sampleABdata) + +data PAB (s::S) + = PA (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PByteString] )) + | PB (Term s (PDataRecord '["_0" ':= PBuiltinList (PAsData PInteger), "_1" ':= PByteString] )) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving (PlutusType, PIsData) + via PIsDataReprInstances PAB +-} From 54555e79c21a84301b01446e8ef81ba7ae0c9f87 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sun, 13 Mar 2022 18:40:10 +0100 Subject: [PATCH 201/584] feat: make excess usable - added HasField instance - fix tests - fix all instances - use unwrapped excess types wherever possible --- Plutarch/Api/V1/AssocMap.hs | 4 +- Plutarch/Api/V1/Value.hs | 4 +- Plutarch/TryFrom.hs | 152 ++++++++++-------- ...tion_untrusted_data.dev=false.bench.golden | 20 +-- ...ation_untrusted_data.dev=false.uplc.golden | 20 +-- ...ation_untrusted_data.dev=true.bench.golden | 20 +-- ...cation_untrusted_data.dev=true.uplc.golden | 28 ++-- plutarch-test/src/Plutarch/TryFromSpec.hs | 43 ++--- 8 files changed, 159 insertions(+), 132 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index b9f8aff10..0e5d7dd57 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -93,9 +93,9 @@ instance ( POrd k , PIsData k ) => - PTryFrom (PBuiltinMap k v) (PMap k v) + PTryFrom (PBuiltinMap k v) (PMap k v) s where - type PTryFromExcess (PBuiltinMap k v) (PMap k v) = 'HNode '[] + type PTryFromExcess (PBuiltinMap k v) (PMap k v) = 'HNode "empty" '[] ptryFrom oMap = runTermCont $ do _ <- tcont $ diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 43e88a2f6..471e5a6c1 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -56,8 +56,8 @@ deriving via ----------------------- PTryFrom instances ---------------------------------------------- -instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where - type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = 'HNode '[] +instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue s where + type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = 'HNode "empty" '[] ptryFrom m = runTermCont $ do let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) perror diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 7af1a3a25..3fcf280ef 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -1,18 +1,18 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -Wno-unused-top-binds #-} module Plutarch.TryFrom ( PTryFrom (PTryFromExcess, ptryFrom), HTree (HNode, HLeaf), HSTree (HSLeaf, HSRoot, (:<<:)), + (:<->:), hsing, + htreeNode, ) where -import Data.Kind (Type) import Data.Proxy (Proxy (Proxy)) -import GHC.TypeLits (AppendSymbol, ErrorMessage (Text), KnownNat, Nat, Symbol, TypeError, natVal, type (+)) +import GHC.TypeLits (ErrorMessage (Text), KnownNat, Nat, Symbol, TypeError, natVal, type (+)) import Plutarch.Builtin ( PAsData, @@ -40,21 +40,17 @@ import Plutarch.Internal.Other ( PType, S, Term, - pcon, perror, plam, plet, (#), - (#$), type (:-->), ) -import Plutarch.Unit (PUnit (PUnit)) import Plutarch.DataRepr.Internal ( PDataRecord, PDataSum, PLabeledType ((:=)), - PUnLabel, pdcons, pdnil, ) @@ -67,9 +63,9 @@ import Plutarch.List ( ptail, ) -import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) -import qualified PlutusCore as PLC +import Plutarch.Unsafe (punsafeCoerce) +import GHC.Records (HasField (getField)) import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) ----------------------- The class PTryFrom ---------------------------------------------- @@ -137,18 +133,33 @@ htreeNode :: Term s e htreeNode tree = indexHTree tree $ treeElemOf @name @e @tree -indexHTree :: forall name s tree. HSTree tree s -> (forall e. TreeElem name e tree -> Term s e) +indexHTree :: + forall (name :: Symbol) (tree :: HTree) (s :: S). + HSTree tree s -> + (forall (e :: PType). TreeElem name e tree -> Term s e) indexHTree (_ :<<: node) (There rest) = indexHTree node rest indexHTree (HSLeaf x :<<: _) Here = x --- indexHTree (tree :<<: _) HereTree = tree -indexHTree _ _ = error "impossible" +indexHTree (HSLeaf x) HereLeaf = x +indexHTree (_tree :<<: _) HereTree = error "while trying to access tree" +indexHTree _ _ = error "impossible while indexing HTree" -class TreeElemOf (name :: Symbol) (typ :: PType) (tree :: HTree) where +{- +type TreeOrTerm :: HTree -> S -> Type +type family TreeOrTerm tree s where + TreeOrTerm ('HLeaf l1 ptyp) s = Term s ptyp + TreeOrTerm ('HNode l0 ('HLeaf l1 ptyp ': trees)) s = Term s ptyp + TreeOrTerm ('HNode l trees) s = HSTree ('HNode l trees) s + -} + +class TreeElemOf (name :: Symbol) (typ :: PType) (tree :: HTree) | name tree -> typ where treeElemOf :: TreeElem name typ tree instance {-# OVERLAPPING #-} TreeElemOf name e ( 'HNode sym ( 'HLeaf name e ': trees)) where treeElemOf = Here +instance TreeElemOf name e ( 'HLeaf name e) where + treeElemOf = HereLeaf + instance {-# OVERLAPPING #-} ( HSTree ( 'HNode name tree) ~ e @@ -167,19 +178,32 @@ instance data TreeElem (name :: Symbol) (typ :: PType) (tree :: HTree) where Here :: TreeElem name typ ( 'HNode sym ( 'HLeaf name typ ': trees)) + HereLeaf :: TreeElem name typ ( 'HLeaf name typ) HereTree :: TreeElem name (HSTree ( 'HNode name inner)) ( 'HNode sym ( 'HNode name inner ': trees)) There :: TreeElem name typ ( 'HNode sym l) -> TreeElem name typ ( 'HNode sym (tree ': l)) deriving stock instance Show (TreeElem a b c) +type family Relabel sym old where + Relabel sym ( 'HNode _ inner) = 'HNode sym inner + Relabel sym ( 'HLeaf _ inner) = 'HLeaf sym inner + +class SRelabel sym tree s where + srelabel :: HSTree tree s -> HSTree (Relabel sym tree) s + +instance SRelabel sym ( 'HNode old inner) s where + srelabel HSRoot = HSRoot + srelabel (x :<<: HSRoot) = (x :<<: HSRoot) + srelabel _ = error "impossible while relabeling" + +instance SRelabel sym ( 'HLeaf old ptyp) s where + srelabel (HSLeaf x) = (HSLeaf x) + ----------------------- PData instances ------------------------------------------------- hsing :: forall sym a (s :: S). Term s a -> HSTree ( 'HLeaf sym a) s hsing = HSLeaf @sym -type Flip :: (a -> b -> Type) -> b -> a -> Type -newtype Flip (f :: a -> b -> Type) (y :: b) (x :: a) = Flip {unFlip :: f x y} - instance PTryFrom PData (PAsData PInteger) (s :: S) where type PTryFromExcess PData (PAsData PInteger) = 'HLeaf "unwrapped" PInteger ptryFrom opq = runTermCont $ do @@ -197,8 +221,8 @@ instance PTryFrom PData PData s where ptryFrom opq = runTermCont $ pure $ (opq, HSRoot) instance PTryFrom PData (PAsData PData) s where - type PTryFromExcess PData (PAsData PData) = 'HNode "empty" '[] - ptryFrom opq = runTermCont $ pure (pdata opq, HSRoot) + type PTryFromExcess PData (PAsData PData) = 'HLeaf "unwrapped" PData + ptryFrom opq = runTermCont $ pure (pdata opq, hsing opq) -- TODO: add the excess inner type instance @@ -210,7 +234,6 @@ instance type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = 'HLeaf "unwrapped" (PBuiltinMap a b) ptryFrom opq = runTermCont $ do verMap <- tcont $ plet (pasMap # opq) - -- I've not obtained a `PBuiltinList (PBuiltinPair a b)` let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) verifyPair = plam $ \tup -> unTermCont $ do (verfst, _) <- TermCont $ ptryFrom @PData @(PAsData a) $ pfstBuiltin # tup @@ -228,21 +251,20 @@ instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) s whe instance {-# OVERLAPPABLE #-} - forall a b s. - ( PTryFrom PData a s - , a ~ PAsData b - , PIsData b + forall a s. + ( PTryFrom PData (PAsData a) s + , PIsData a ) => - PTryFrom PData (PAsData (PBuiltinList a)) s + PTryFrom PData (PAsData (PBuiltinList (PAsData a))) s where - type PTryFromExcess PData (PAsData (PBuiltinList a)) = 'HLeaf "unwrapped" (PBuiltinList a) + type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = 'HLeaf "unwrapped" (PBuiltinList (PAsData a)) ptryFrom opq = runTermCont $ do - let lst :: Term _ (PBuiltinList a) - lst = punsafeBuiltin PLC.UnListData # opq - verify :: a ~ PAsData b => Term _ (PAsData b :--> a) + let lst :: Term _ (PBuiltinList PData) + lst = pasList # opq + verify :: Term _ (PData :--> PAsData a) verify = plam $ \e -> unTermCont $ do - (wrapped, _) <- TermCont $ ptryFrom @PData @a @s $ pforgetData e + (wrapped, _) <- TermCont $ ptryFrom @PData @(PAsData a) @s $ e pure wrapped ver <- tcont $ plet $ pmap # verify # lst pure $ (punsafeCoerce opq, hsing ver) @@ -311,71 +333,71 @@ instance ( RecordValidation xs s , PTryFrom PData (PAsData a) s , PTryFrom PData (PAsData (PDataRecord xs)) s - , TreeElemOf "unwrapped" (PDataRecord xs) ( 'HNode "record" (ValidationExcess xs)) + , SRelabel label (PTryFromExcess PData (PAsData a)) s ) => RecordValidation ((label ':= a) ': xs) s where - type ValidationExcess ((label ':= a) ': xs) = (PTryFromExcess PData (PAsData a)) ': ValidationExcess xs + type ValidationExcess ((label ':= a) ': xs) = Relabel label (PTryFromExcess PData (PAsData a)) ': ValidationExcess xs recoverRecord lst = do let lsthead :: Term s PData lsthead = phead # lst lsttail :: Term s (PBuiltinList PData) lsttail = ptail # lst (verhead, exchead) <- TermCont $ ptryFrom @PData @(PAsData a) @s lsthead - (_, exctail) <- recoverRecord @xs @s lsttail - rec <- tcont $ plet $ pdcons @label # verhead # (htreeNode @"unwrapped" exctail) - pure (rec, exchead :<<: exctail) + (vertail, exctail) <- recoverRecord @xs @s lsttail + rec <- tcont $ plet $ pdcons @label # verhead # vertail + pure (rec, (srelabel @label exchead) :<<: exctail) instance {-# OVERLAPPING #-} RecordValidation '[] s where type ValidationExcess '[] = '[] recoverRecord _ = pure (pdnil, HSRoot) -{- -class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where +instance + {-# OVERLAPPING #-} + forall ys (s :: S). + ( SumValidation 0 ys s + ) => + PTryFrom PData (PAsData (PDataSum ys)) s + where + type PTryFromExcess PData (PAsData (PDataSum ys)) = 'HNode "empty" '[] + ptryFrom opq = runTermCont $ do + _ <- tcont $ plet $ validateSum @0 @ys opq + pure (punsafeCoerce opq, HSRoot) + +class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) s where validateSum :: Term s PData -> Term s (PBuiltinList PData) instance {-# OVERLAPPABLE #-} - forall n x xs s. - ( PTryFrom PData (PAsData (PDataRecord x)) - , SumValidation (n + 1) xs + forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]) (s :: S). + ( PTryFrom PData (PAsData (PDataRecord x)) s + , SumValidation (n + 1) xs s , KnownNat n - , PTryFromExcess PData (PAsData (PDataRecord x)) s ~ Flip Term (PDataRecord x) s + , FromRecordFields x ~ ValidationExcess x + , RecordValidation x s ) => - SumValidation n (x ': xs) + SumValidation n (x ': xs) s where validateSum s = unTermCont $ do let n :: Integer n = natVal (Proxy @n) - elem <- tcont $ plet $ pasConstr #$ s + elem <- tcont $ plet $ pasConstr # s let snd' :: Term _ (PBuiltinList PData) snd' = pif (fromInteger n #== (pfstBuiltin # elem)) ( unTermCont $ do let rec = pdata $ psndBuiltin # elem - y <- (unFlip . snd) <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord x)) $ pforgetData rec) + y <- (htreeNode @"unwrapped" . snd) <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord x)) @s $ pforgetData rec) pure $ punsafeCoerce (y :: Term _ (PDataRecord x)) ) (validateSum @(n + 1) @xs $ punsafeCoerce s) tcont $ plet snd' -instance {-# OVERLAPPING #-} SumValidation n '[] where +instance {-# OVERLAPPING #-} SumValidation n '[] s where validateSum _ = perror -instance - {-# OVERLAPPING #-} - forall ys. - ( SumValidation 0 ys - ) => - PTryFrom PData (PAsData (PDataSum ys)) - where - type PTryFromExcess PData (PAsData (PDataSum ys)) = Flip Term PUnit - ptryFrom opq = runTermCont $ do - _ <- tcont $ plet $ validateSum @0 @ys opq - pure (punsafeCoerce opq, Flip $ pcon PUnit) - ----------------------- POpaque Instances ----------------------------------------------- {- | @@ -386,28 +408,32 @@ instance your POpaque safely -} instance - ( PTryFrom PData (PAsData a) + ( PTryFrom PData (PAsData a) s , PIsData a ) => - PTryFrom POpaque a + PTryFrom POpaque a s where - type PTryFromExcess POpaque a = Flip Term (PAsData a) + type PTryFromExcess POpaque a = 'HLeaf "wrapped" (PAsData a) ptryFrom opq = runTermCont $ do let prop :: Term _ a prop = punsafeCoerce opq ver' <- fst <$> TermCont (ptryFrom @PData @(PAsData a) $ pforgetData $ pdata prop) ver <- tcont $ plet ver' - pure $ (punsafeCoerce opq, Flip ver) + pure $ (punsafeCoerce opq, hsing ver) instance - ( PTryFrom a b + ( PTryFrom a b s , PIsData a , PIsData b ) => - PTryFrom (PAsData a) (PAsData b) + PTryFrom (PAsData a) (PAsData b) s where type PTryFromExcess (PAsData a) (PAsData b) = PTryFromExcess a b ptryFrom opq = runTermCont $ do ver' <- snd <$> TermCont (ptryFrom @a @b (pfromData opq)) pure $ (punsafeCoerce opq, ver') - -} + +----------------------- HasField instance ----------------------------------------------- + +instance TreeElemOf name ptyp tree => HasField name (HSTree tree s) (Term s ptyp) where + getField = htreeNode @name @ptyp diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden index ed8da4762..cdaade3ce 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden @@ -1,19 +1,19 @@ erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":99} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":140} erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} -erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":98} -erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":171} +erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":110} +erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":190} working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} -working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":9720590,"exBudgetMemory":14348,"scriptSizeBytes":136} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":9720590,"exBudgetMemory":14348,"scriptSizeBytes":136} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":9809909,"exBudgetMemory":14648,"scriptSizeBytes":140} working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} -working.PDataSum constr 0 {"exBudgetCPU":6024815,"exBudgetMemory":10910,"scriptSizeBytes":171} -working.PDataSum constr 1 {"exBudgetCPU":7028371,"exBudgetMemory":12876,"scriptSizeBytes":171} -recovering a record partially vs completely.partially {"exBudgetCPU":5292621,"exBudgetMemory":8440,"scriptSizeBytes":84} -recovering a record partially vs completely.completely {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} +working.PDataSum constr 0 {"exBudgetCPU":7072545,"exBudgetMemory":12070,"scriptSizeBytes":190} +working.PDataSum constr 1 {"exBudgetCPU":8076101,"exBudgetMemory":14036,"scriptSizeBytes":190} +recovering a record partially vs completely.partially {"exBudgetCPU":7626265,"exBudgetMemory":11560,"scriptSizeBytes":113} +recovering a record partially vs completely.completely {"exBudgetCPU":9809909,"exBudgetMemory":14648,"scriptSizeBytes":140} removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden index 8f6b57945..60eafe0f9 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden @@ -1,19 +1,19 @@ erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unIData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (iData 42) i9))) (i7 (i5 (unListData (listData (i7 (bData i6) (i7 (iData 42) i8))))) i1)) (i6 (i4 (i3 (unListData (listData (i6 (bData i5) (i6 (iData 42) i7)))))) i7)) (unIData (i3 (i2 (unListData (listData (i5 (bData i4) (i5 (iData 42) i6)))))))) (unIData (i2 (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> i3 ((\i0 -> i5 i2) (unIData (i4 i1))) (i3 ((\i0 -> i5 (unListData (listData (i6 i2)))) (unBData (i4 (unListData (listData (i5 i1)))))) [ ])) (unListData (listData (force (force sndPair) i1))))) (delay error))) (unConstrData i4))) (force mkCons)) (force headList)) (force tailList)) #d87a9f0543666f6fff)) -erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unBData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87b9f0543666f6fff)) +erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i5 (i7 (unListData (listData (i8 i4)))) i1) (i4 (i6 (i5 (unListData (listData (i7 i3))))) [ ])) (unBData (i5 (i4 (unListData (listData (i6 i2))))))) (unIData (i4 (unListData (listData (i5 i1))))))) (delay error))) (unConstrData i5))) (force mkCons)) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) +erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unBData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d87b9f0543666f6fff)) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unBData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 7) (i7 (iData 42) i8))) (i6 (i5 (unListData (listData (i6 (iData 7) (i6 (iData 42) i7))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 7) (i5 (iData 42) i6)))))) i6)) (unIData (i3 (i2 (unListData (listData (i4 (iData 7) (i4 (iData 42) i5)))))))) (unIData (i2 (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 7) (i7 (iData 42) i8))) (i6 (i5 (unListData (listData (i6 (iData 7) (i6 (iData 42) i7))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 7) (i5 (iData 42) i6)))))) i6)) (unIData (i3 (i2 (unListData (listData (i4 (iData 7) (i4 (iData 42) i5)))))))) (unIData (i2 (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (iData 42) i9))) (i7 (i5 (unListData (listData (i7 (bData i6) (i7 (iData 42) i8))))) i1)) (i6 (i4 (i3 (unListData (listData (i6 (bData i5) (i6 (iData 42) i7)))))) i7)) (unIData (i3 (i2 (unListData (listData (i5 (bData i4) (i5 (iData 42) i6)))))))) (unBData (i2 (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d8799f0543666f6fff)) -working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87a9f0543666f6fff)) -recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (iData 3) (i4 (bData i5) i6))) (i3 ((\i0 -> i3 i2) (unIData (i2 i1))) (i3 (i2 (unListData (listData (force tailList i1)))) i5))) (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))) (force headList)) (force mkCons)) #62617a) [ ])) -recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unBData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force headList)) (force tailList)) (force mkCons)) #62617a) [ ])) +working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unIData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d8799f0543666f6fff)) +working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unIData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) +recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 (i3 (unListData (listData (i4 (iData 3) (i4 (bData i5) i6))))) i1)) (i3 (i2 (force tailList (unListData (listData (i3 (iData 3) (i3 (bData i4) i5)))))) i5)) (unIData (i1 (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))))) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 3) (i7 (bData i8) i9))) (i6 (i5 (unListData (listData (i6 (iData 3) (i6 (bData i7) i8))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 3) (i5 (bData i6) i7)))))) i7)) (unBData (i3 (i2 (unListData (listData (i4 (iData 3) (i4 (bData i5) i6)))))))) (unIData (i2 (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden index 28e2b4028..0377079a0 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden @@ -1,19 +1,19 @@ erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":99} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":140} erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} -erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":98} -erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":171} +erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":110} +erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":190} working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} -working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":6429670,"exBudgetMemory":9900,"scriptSizeBytes":93} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":9720590,"exBudgetMemory":14348,"scriptSizeBytes":136} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":9720590,"exBudgetMemory":14348,"scriptSizeBytes":136} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":9809909,"exBudgetMemory":14648,"scriptSizeBytes":140} working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} -working.PDataSum constr 0 {"exBudgetCPU":6024815,"exBudgetMemory":10910,"scriptSizeBytes":171} -working.PDataSum constr 1 {"exBudgetCPU":7028371,"exBudgetMemory":12876,"scriptSizeBytes":171} -recovering a record partially vs completely.partially {"exBudgetCPU":5292621,"exBudgetMemory":8440,"scriptSizeBytes":84} -recovering a record partially vs completely.completely {"exBudgetCPU":6518989,"exBudgetMemory":10200,"scriptSizeBytes":99} +working.PDataSum constr 0 {"exBudgetCPU":7072545,"exBudgetMemory":12070,"scriptSizeBytes":190} +working.PDataSum constr 1 {"exBudgetCPU":8076101,"exBudgetMemory":14036,"scriptSizeBytes":190} +recovering a record partially vs completely.partially {"exBudgetCPU":7626265,"exBudgetMemory":11560,"scriptSizeBytes":113} +recovering a record partially vs completely.completely {"exBudgetCPU":9809909,"exBudgetMemory":14648,"scriptSizeBytes":140} removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden index e492de2e9..46aea73a6 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden @@ -1,19 +1,19 @@ erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unIData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (iData 42) i9))) (i7 (i5 (unListData (listData (i7 (bData i6) (i7 (iData 42) i8))))) i1)) (i6 (i4 (i3 (unListData (listData (i6 (bData i5) (i6 (iData 42) i7)))))) i7)) (unIData (i3 (i2 (unListData (listData (i5 (bData i4) (i5 (iData 42) i6)))))))) (unIData (i2 (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> i3 ((\i0 -> i5 i2) (unIData (i4 i1))) (i3 ((\i0 -> i5 (unListData (listData (i6 i2)))) (unBData (i4 (unListData (listData (i5 i1)))))) [ ])) (unListData (listData (force (force sndPair) i1))))) (delay error))) (unConstrData i4))) (force mkCons)) (force headList)) (force tailList)) #d87a9f0543666f6fff)) -erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unBData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87b9f0543666f6fff)) +erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i5 (i7 (unListData (listData (i8 i4)))) i1) (i4 (i6 (i5 (unListData (listData (i7 i3))))) [ ])) (unBData (i5 (i4 (unListData (listData (i6 i2))))))) (unIData (i4 (unListData (listData (i5 i1))))))) (delay error))) (unConstrData i5))) (force mkCons)) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) +erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unBData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d87b9f0543666f6fff)) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 7) (i5 (iData 42) i6))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i5))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force headList)) (force tailList)) (force mkCons)) [ ])) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i6 (bData i5) (i6 (iData 42) i7))) (i5 ((\i0 -> i3 i2) (unBData (i2 i1))) (i5 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unIData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force headList)) (force tailList)) #62617a) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 7) (i7 (iData 42) i8))) (i6 (i5 (unListData (listData (i6 (iData 7) (i6 (iData 42) i7))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 7) (i5 (iData 42) i6)))))) i6)) (unIData (i3 (i2 (unListData (listData (i4 (iData 7) (i4 (iData 42) i5)))))))) (unIData (i2 (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 7) (i7 (iData 42) i8))) (i6 (i5 (unListData (listData (i6 (iData 7) (i6 (iData 42) i7))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 7) (i5 (iData 42) i6)))))) i6)) (unIData (i3 (i2 (unListData (listData (i4 (iData 7) (i4 (iData 42) i5)))))))) (unIData (i2 (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (iData 42) i9))) (i7 (i5 (unListData (listData (i7 (bData i6) (i7 (iData 42) i8))))) i1)) (i6 (i4 (i3 (unListData (listData (i6 (bData i5) (i6 (iData 42) i7)))))) i7)) (unIData (i3 (i2 (unListData (listData (i5 (bData i4) (i5 (iData 42) i6)))))))) (unBData (i2 (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d8799f0543666f6fff)) -working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> i5 ((\i0 -> i7 i2) (unIData (i6 i1))) (i5 ((\i0 -> i7 (unListData (listData (i8 i2)))) (unBData (i6 (unListData (listData (i7 i1)))))) i8)) (unListData (listData (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> i6 ((\i0 -> i8 i2) (unIData (i7 i1))) (i6 ((\i0 -> i8 (unListData (listData (i9 i2)))) (unBData (i7 (unListData (listData (i8 i1)))))) i9)) (unListData (listData (i9 i1))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) (force headList)) (force tailList)) [ ]) (force (force sndPair))) #d87a9f0543666f6fff)) -recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (iData 3) (i4 (bData i5) i6))) (i3 ((\i0 -> i3 i2) (unIData (i2 i1))) (i3 (i2 (unListData (listData (force tailList i1)))) i5))) (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))) (force headList)) (force mkCons)) #62617a) [ ])) -recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 ((\i0 -> i3 i2) (unIData (i2 i1))) (i4 ((\i0 -> i3 (unListData (listData (i4 i2)))) (unBData (i2 (unListData (listData (i3 i1)))))) i6))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force headList)) (force tailList)) (force mkCons)) #62617a) [ ])) +working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unIData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d8799f0543666f6fff)) +working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unIData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) +recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 (i3 (unListData (listData (i4 (iData 3) (i4 (bData i5) i6))))) i1)) (i3 (i2 (force tailList (unListData (listData (i3 (iData 3) (i3 (bData i4) i5)))))) i5)) (unIData (i1 (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))))) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 3) (i7 (bData i8) i9))) (i6 (i5 (unListData (listData (i6 (iData 3) (i6 (bData i7) i8))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 3) (i5 (bData i6) i7)))))) i7)) (unBData (i3 (i2 (unListData (listData (i4 (iData 3) (i4 (bData i5) i6)))))))) (unIData (i2 (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) @@ -27,7 +27,7 @@ checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 , #a149736f6d65546f6b656e01 ) ])) checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:378:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:328:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:319:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:378:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:328:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:319:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:378:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:328:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:319:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:378:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:328:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:319:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) \ No newline at end of file +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:334:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:325:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:334:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:325:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:334:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:325:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:334:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:325:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index 7d0e9d659..a74cd608a 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -7,9 +7,9 @@ module Plutarch.TryFromSpec (spec) where import Test.Syd -import qualified GHC.Generics as GHC +-- import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +-- import Generics.SOP (Generic, I (I)) import Plutus.V1.Ledger.Api ( Address (Address), @@ -59,13 +59,15 @@ import Plutarch.Builtin ( ) import Plutarch.Prelude import Plutarch.TryFrom ( - Flip (Flip, unFlip), + HTree (HLeaf), PTryFrom (PTryFromExcess, ptryFrom), + hsing, ) import Plutarch.ApiSpec (info, purpose) import qualified Plutarch.ApiSpec as Api -import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) + +-- import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) import Plutarch.Test import Plutus.V1.Ledger.Value (Value) import qualified Plutus.V1.Ledger.Value as Value @@ -262,25 +264,24 @@ spec = do ------------------- Checking deeply, shallowly and unwrapping ---------------------- checkDeep :: - forall (target :: PType) (actual :: PType). - ( PTryFrom PData (PAsData target) + forall (target :: PType) (actual :: PType) (s :: S). + ( PTryFrom PData (PAsData target) s , PIsData actual , PIsData target ) => - ClosedTerm (PAsData actual) -> - ClosedTerm (PAsData target) -checkDeep t = unTermCont $ fst <$> TermCont (ptryFrom $ pforgetData t) + Term s (PAsData actual) -> + Term s (PAsData target) +checkDeep t = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData target) @s $ pforgetData t) checkDeepUnwrap :: - forall (target :: PType) (actual :: PType). - ( PTryFrom PData (PAsData target) + forall (target :: PType) (actual :: PType) (s :: S). + ( PTryFrom PData (PAsData target) s , PIsData actual , PIsData target - , PTryFromExcess PData (PAsData target) ~ Flip Term target ) => - ClosedTerm (PAsData actual) -> - ClosedTerm (PAsData target) -checkDeepUnwrap t = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData target) $ pforgetData t) + Term s (PAsData actual) -> + Term s (PAsData target) +checkDeepUnwrap t = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData target) @s $ pforgetData t) sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1 .. 100] @@ -304,17 +305,17 @@ newtype PNatural (s :: S) = PMkNatural (Term s PInteger) pmkNatural :: Term s (PInteger :--> PNatural) pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) -instance PTryFrom PData (PAsData PNatural) where - type PTryFromExcess PData (PAsData PNatural) = Flip Term PNatural +instance PTryFrom PData (PAsData PNatural) s where + type PTryFromExcess PData (PAsData PNatural) = 'HLeaf "unwrapped" PNatural ptryFrom opq = runTermCont $ do - tup <- TermCont $ ptryFrom @PData @(PAsData PInteger) opq - ver <- tcont $ plet $ pmkNatural # unFlip (snd tup) - pure $ (punsafeCoerce (fst tup), Flip ver) + (ter, exc) <- TermCont $ ptryFrom @PData @(PAsData PInteger) opq + ver <- tcont $ plet $ pmkNatural # exc.unwrapped + pure $ (punsafeCoerce ter, hsing ver) validator :: Term s PValidator validator = phoistAcyclic $ plam $ \dat red ctx -> unTermCont $ do - trustedRedeemer <- (unFlip . snd) <$> (TermCont $ ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red) + trustedRedeemer <- (\(snd -> red) -> red.unwrapped) <$> (TermCont $ ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red) let trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) trustedDatum = pfromData $ punsafeCoerce dat -- make the Datum and Redeemer trusted From 94d48ca117ef126af1a6e1f0630976fd429a84e0 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 4 Mar 2022 12:32:00 +0100 Subject: [PATCH 202/584] feat: - add PPRelude which reexports base's Prelude --- docs/GUIDE.md | 13 +++++++++++++ plutarch-extra/plutarch-extra.cabal | 5 +++++ plutarch-extra/preludes/PPrelude.hs | 6 ++++++ 3 files changed, 24 insertions(+) create mode 100644 plutarch-extra/preludes/PPrelude.hs diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 66d7d40ae..20f78abf5 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -6,6 +6,7 @@ - [Overview](#overview) - [Compiling and Running](#compiling-and-running) - [Common Extensions and GHC options](#common-extensions-and-ghc-options) + - [Using the Plutarch Prelude](#using-the-plutarch-prelude) - [Evaluation](#evaluation) - [Syntax](#syntax) - [Constants](#constants) @@ -99,6 +100,18 @@ You generally want to adhere to the same extensions and GHC options the [Plutarch repo](https://github.com/Plutonomicon/plutarch/blob/master/plutarch.cabal) uses. +### Using the Plutarch Prelude + +Plutarch exports a Prelude (`Plutarch.Prelude`) that contains the most commonly used Plutarch functions, types and constructors. + +The Plutarch Prelude `Plutarch.Prelude` has no overlap with `base` Prelude, which is the reason why you can use both of them together +without trouble. If you want to avoid importing `Plutarch.Prelude` in each of your modules, add the following to your `*.cabal` file: + +```haskell + mixins: base hiding (Prelude) + , plutarch-preludes (PPrelude as Prelude) +``` + ### Evaluation You can compile a Plutarch term using `compile`(from `Plutarch` module), making sure it has no free variables. `compile` returns a `Script`- you can use this as you would any other Plutus script. The API in `Plutus.V1.Ledger.Scripts` should prove helpful. diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index f14051c82..5a9f953bf 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -71,6 +71,11 @@ common deps , base , plutarch +library plutarch-preludes + import: c, deps + hs-source-dirs: preludes + exposed-modules: PPrelude + library import: c, deps exposed-modules: Plutarch.Extra diff --git a/plutarch-extra/preludes/PPrelude.hs b/plutarch-extra/preludes/PPrelude.hs new file mode 100644 index 000000000..a28ad9766 --- /dev/null +++ b/plutarch-extra/preludes/PPrelude.hs @@ -0,0 +1,6 @@ +module PPrelude ( module Prelude + , module Plutarch.Prelude + ) where + +import Prelude +import Plutarch.Prelude From 8beb09c8123827850b9b1629d83a11394d7eb6a2 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 4 Mar 2022 13:30:39 +0100 Subject: [PATCH 203/584] fix: update changelog + format --- CHANGELOG.md | 6 ++++++ plutarch-extra/preludes/PPrelude.hs | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61fcda3e1..d36d651a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,6 +92,12 @@ Added by: [#329](https://github.com/Plutonomicon/plutarch/pull/329) +- `plutarch-extra` export merged Prelude + + Module: `Plutarch.PPrelude` + + Added by: [#356](https://github.com/Plutonomicon/plutarch/pull/356) + # 1.1.0 - General repository changes. diff --git a/plutarch-extra/preludes/PPrelude.hs b/plutarch-extra/preludes/PPrelude.hs index a28ad9766..3a8025b4b 100644 --- a/plutarch-extra/preludes/PPrelude.hs +++ b/plutarch-extra/preludes/PPrelude.hs @@ -1,6 +1,7 @@ -module PPrelude ( module Prelude - , module Plutarch.Prelude - ) where +module PPrelude ( + module Prelude, + module Plutarch.Prelude, +) where -import Prelude import Plutarch.Prelude +import Prelude From c2cc7196d90b92473cb71bb937fc2d3f9ce040d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 15 Mar 2022 09:51:18 -0400 Subject: [PATCH 204/584] Added FFI test suite --- flake.nix | 45 ++- .../plutarch-base/Plutarch/FFISpec.hs | 382 ++++++++++++++++++ plutarch-test/plutarch-test.cabal | 7 + 3 files changed, 420 insertions(+), 14 deletions(-) create mode 100644 plutarch-test/plutarch-base/Plutarch/FFISpec.hs diff --git a/flake.nix b/flake.nix index 6fdbd6777..c05e90ee8 100644 --- a/flake.nix +++ b/flake.nix @@ -267,9 +267,6 @@ }; cabalProjectLocal = '' - package plutus-tx-plugin - flags: +use-ghc-stub - allow-newer: cardano-binary:base , cardano-crypto-class:base @@ -461,20 +458,40 @@ projectForGhc = ghcName: flagDevelopment: system: let pkgs = nixpkgsFor system; in let pkgs' = nixpkgsFor' system; in + let addSubDir = target: subdir: source: + if source.src == target + then source // { subdirs = source.subdirs ++ [ subdir ]; } + else source; in let pkgSet = (nixpkgsFor system).haskell-nix.cabalProject' ({ # This is truly a horrible hack but is necessary for sydtest-discover to work. - src = if ghcName == ghcVersion then ./. else - pkgs.runCommand "fake-src" { } '' - # Prevent `sydtest-discover` from using GHC9 only modules when building with GHC810 - # https://github.com/NorfairKing/sydtest/blob/master/sydtest-discover/src/Test/Syd/Discover.hs - cp -rT ${./.} $out - chmod -R u+w $out/plutarch-test - rm -f $out/plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs - rm -f $out/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs - rm -f $out/plutarch-test/plutarch-base/Plutarch/RecSpec.hs - ''; + src = + if ghcName == ghcVersion + then + pkgs.runCommand "fake-src" { } '' + # Prevent `sydtest-discover` from using GHC810 only modules when building with GHC9 + # https://github.com/NorfairKing/sydtest/blob/master/sydtest-discover/src/Test/Syd/Discover.hs + cp -rT ${./.} $out + chmod -R u+w $out/plutarch-test + rm -f $out/plutarch-test/plutarch-base/Plutarch/FFISpec.hs + '' + else + pkgs.runCommand "fake-src" { } '' + # Prevent `sydtest-discover` from using GHC9 only modules when building with GHC810 + # https://github.com/NorfairKing/sydtest/blob/master/sydtest-discover/src/Test/Syd/Discover.hs + cp -rT ${./.} $out + chmod -R u+w $out/plutarch-test + rm -f $out/plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs + rm -f $out/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs + rm -f $out/plutarch-test/plutarch-base/Plutarch/RecSpec.hs + ''; compiler-nix-name = ghcName; - inherit extraSources; + extraSources = + if ghcName == ghcVersion then extraSources + else map (addSubDir inputs.plutus "plutus-tx-plugin") extraSources + ++ [{ + src = inputs.Shrinker; + subdirs = [ "." ]; + }]; modules = [ (haskellModule system) { diff --git a/plutarch-test/plutarch-base/Plutarch/FFISpec.hs b/plutarch-test/plutarch-base/Plutarch/FFISpec.hs new file mode 100644 index 000000000..c2d05b8e1 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/FFISpec.hs @@ -0,0 +1,382 @@ +{-# LANGUAGE ImportQualifiedPost #-} +{-# LANGUAGE TemplateHaskell #-} + +module Plutarch.FFISpec (spec) where + +import GHC.Generics (Generic) +import Generics.SOP qualified as SOP +import Plutarch (ClosedTerm, compile, printScript, printTerm) +import Plutarch.Api.V1 (PCurrencySymbol, PPubKeyHash, PScriptContext, PTokenName, PTxInfo) +import Plutarch.Evaluate (EvalError, evalScript) +import Plutarch.FFI ( + PTxList, + PTxMaybe (PTxJust, PTxNothing), + foreignExport, + foreignImport, + opaqueExport, + opaqueImport, + pmaybeFromTx, + pmaybeToTx, + ) +import Plutarch.List (pconvertLists) +import Plutarch.Prelude +import Plutarch.Rec qualified as Rec +import Plutarch.Rec.TH (deriveAll) +import Plutus.V1.Ledger.Api ( + Address (Address), + Credential (ScriptCredential), + CurrencySymbol, + DatumHash, + PubKeyHash (..), + ScriptContext (ScriptContext), + ScriptPurpose (Spending), + TxInInfo (TxInInfo, txInInfoOutRef, txInInfoResolved), + TxInfo ( + TxInfo, + txInfoDCert, + txInfoData, + txInfoFee, + txInfoId, + txInfoInputs, + txInfoMint, + txInfoOutputs, + txInfoSignatories, + txInfoValidRange, + txInfoWdrl + ), + TxOut (TxOut, txOutAddress, txOutDatumHash, txOutValue), + TxOutRef (TxOutRef), + ValidatorHash, + Value, + adaSymbol, + adaToken, + getTxId, + ) +import Plutus.V1.Ledger.Contexts qualified as Contexts +import Plutus.V1.Ledger.Interval qualified as Interval +import Plutus.V1.Ledger.Scripts (fromCompiledCode) +import Plutus.V1.Ledger.Value qualified as Value +import PlutusTx (CompiledCode, applyCode) +import PlutusTx qualified +import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinUnit) +import PlutusTx.Prelude +import Shrink (shrinkScript, shrinkScriptSp, withoutTactics) + +import Test.Syd +import Test.Tasty.HUnit ((@?=)) + +-- import Test.Tasty.Plutus.Internal.Context (ContextBuilder (cbSignatories), TransactionConfig(..), compileSpending) +import Prelude (String) +import Prelude qualified + +printCode :: CompiledCode a -> String +printCode = printScript . fromCompiledCode + +printShrunkCode :: CompiledCode a -> String +printShrunkCode = printScript . shrink . shrink . shrink . fromCompiledCode + where + shrink = shrinkScriptSp (withoutTactics ["strongUnsubs", "weakUnsubs"]) + +printEvaluatedCode :: CompiledCode a -> Either EvalError String +printEvaluatedCode = fmap printScript . fstOf3 . evalScript . fromCompiledCode + +printShrunkTerm :: ClosedTerm a -> String +printShrunkTerm x = printScript $ shrinkScript $ compile x + +printEvaluatedTerm :: ClosedTerm a -> Either EvalError String +printEvaluatedTerm s = fmap printScript . fstOf3 . evalScript $ compile s + +fstOf3 :: (a, _, _) -> a +fstOf3 (x, _, _) = x + +double :: CompiledCode (Integer -> Integer) +double = $$(PlutusTx.compile [||(2 *) :: Integer -> Integer||]) + +doubleImported :: Term s (PInteger :--> PInteger) +doubleImported = foreignImport double + +doubleExported :: CompiledCode (Integer -> Integer) +doubleExported = foreignExport (plam $ \(x :: Term _ PInteger) -> 2 Prelude.* x) + +data SampleRecord = SampleRecord + { sampleBool :: BuiltinBool + , sampleInt :: Integer + , sampleString :: BuiltinString + } + deriving stock (Generic) + deriving anyclass (SOP.Generic) + +data PSampleRecord f = PSampleRecord + { psampleBool :: f PBool + , psampleInt :: f PInteger + , psampleString :: f PString + } +$(deriveAll ''PSampleRecord) + +importedField :: Term _ (PDelayed (Rec.PRecord PSampleRecord) :--> PInteger) +importedField = foreignImport ($$(PlutusTx.compile [||sampleInt||]) :: CompiledCode (SampleRecord -> Integer)) + +exportedField :: CompiledCode (SampleRecord -> Integer) +exportedField = + foreignExport + ( (plam $ \r -> pmatch (pforce r) $ \(Rec.PRecord rr) -> psampleInt rr) :: + Term _ (PDelayed (Rec.PRecord PSampleRecord) :--> PInteger) + ) + +getTxInfo :: Term _ (PAsData PScriptContext :--> PAsData PTxInfo) +getTxInfo = pfield @"txInfo" + +exportedTxInfo :: CompiledCode (PlutusTx.BuiltinData -> PlutusTx.BuiltinData) +exportedTxInfo = foreignExport getTxInfo + +importedTxSignedBy :: Term _ (PAsData PTxInfo :--> PAsData PPubKeyHash :--> PBool) +importedTxSignedBy = foreignImport $$(PlutusTx.compile [||txDataSignedBy||]) + where + txDataSignedBy :: BuiltinData -> BuiltinData -> BuiltinBool + txDataSignedBy tx pkh = toBuiltin $ any id (Contexts.txSignedBy <$> PlutusTx.fromBuiltinData tx <*> PlutusTx.fromBuiltinData pkh) + +importedTxSignedBy' :: Term _ (PAsData PTxInfo :--> PPubKeyHash :--> PBool) +importedTxSignedBy' = foreignImport $$(PlutusTx.compile [||txDataSignedBy||]) + where + txDataSignedBy :: BuiltinData -> PubKeyHash -> BuiltinBool + txDataSignedBy tx pkh = toBuiltin $ any id (flip Contexts.txSignedBy pkh <$> PlutusTx.fromBuiltinData tx) + +type PSValue = PSMap PCurrencySymbol (PSMap PTokenName PInteger) + +type PSMap k v = PTxList (PDelayed (PPair k v)) + +sumValueAmounts :: Term _ (PSValue :--> PInteger) +sumValueAmounts = + pfoldl + # (plam $ \s vals -> pfoldl # (plam $ \s' p -> s' Prelude.+ psnd # p) # s # (psnd # vals)) + # 0 + +pfst :: Term s (PDelayed (PPair a b) :--> a) +pfst = plam $ \p -> pmatch (pforce p) $ \(PPair x _) -> x + +psnd :: Term s (PDelayed (PPair a b) :--> b) +psnd = plam $ \p -> pmatch (pforce p) $ \(PPair _ y) -> y + +---- lifted from https://github.com/Plutonomicon/plutarch/blob/master/examples/Examples/Api.hs ---- + +{- | + An example 'PScriptContext' Term, + lifted with 'pconstant' +-} +ctx :: ScriptContext +ctx = ScriptContext info purpose + +-- | Simple script context, with minting and a single input +info :: TxInfo +info = + TxInfo + { txInfoInputs = [inp] + , txInfoOutputs = [] + , txInfoFee = mempty + , txInfoMint = val + , txInfoDCert = [] + , txInfoWdrl = [] + , txInfoValidRange = Interval.always + , txInfoSignatories = signatories + , txInfoData = [] + , txInfoId = "b0" + } + +-- | A script input +inp :: TxInInfo +inp = + TxInInfo + { txInInfoOutRef = ref + , txInInfoResolved = + TxOut + { txOutAddress = + Address (ScriptCredential validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Just datum + } + } + +val :: Value +val = Value.singleton sym "sometoken" 1 <> Value.singleton adaSymbol adaToken 2 + +ref :: TxOutRef +ref = TxOutRef "a0" 0 + +purpose :: ScriptPurpose +purpose = Spending ref + +validator :: ValidatorHash +validator = "a1" + +datum :: DatumHash +datum = "d0" + +sym :: CurrencySymbol +sym = "c0" + +signatories :: [PubKeyHash] +signatories = ["ab01fe235c", "123014", "abcdef"] + +{- | Project wide tests + + @since 0.1 +-} +spec :: Spec +spec = do + describe "Test.PlutarchFFI" $ do + describe "Simple types" $ do + it "integer literal" $ + printCode $$(PlutusTx.compile [||42 :: Integer||]) @?= "(program 1.0.0 42)" + it "PlutusTx integer function" $ + printCode double @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Plutarch integer function" $ + printTerm (plam $ \(x :: Term _ PInteger) -> 2 Prelude.* x) @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Imported PlutusTx integer function" $ + printTerm doubleImported @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Exported Plutarch integer function" $ + printCode doubleExported @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Imported and applied PlutusTx integer function" $ + printTerm (plam $ \n -> doubleImported #$ doubleImported # n) + @?= "(program 1.0.0 (\\i0 -> (\\i0 -> multiplyInteger 2 i1) (multiplyInteger 2 i1)))" + it "Exported and applied Plutarch integer function" $ + printCode (doubleExported `applyCode` $$(PlutusTx.compile [||21 :: Integer||])) + @?= "(program 1.0.0 ((\\i0 -> multiplyInteger 2 i1) 21))" + it "Bool->Integer in Plutarch" $ + printShrunkTerm (plam $ \x -> pif x (1 :: Term _ PInteger) 0) + @?= "(program 1.0.0 (\\i0 -> force (force ifThenElse i1 (delay 1) (delay 0))))" + it "Bool->Integer in PlutusTx" $ + printShrunkCode $$(PlutusTx.compile [||\x -> if x then 1 :: Integer else 0||]) + @?= "(program 1.0.0 (\\i0 -> force i1 1 0))" + it "newtype in PlutusTx" $ + printShrunkCode $$(PlutusTx.compile [||PubKeyHash||]) @?= "(program 1.0.0 (\\i0 -> i1))" + it "export unit to PlutusTx" $ + printShrunkCode (foreignExport (pconstant ()) :: CompiledCode BuiltinUnit) @?= "(program 1.0.0 ())" + it "import unit from PlutusTx" $ + printShrunkTerm (foreignImport $$(PlutusTx.compile [||toBuiltin ()||]) :: ClosedTerm PUnit) @?= "(program 1.0.0 ())" + describe "Opaque" $ do + it "Export an integer and ignore it" $ + printCode ($$(PlutusTx.compile [||const (7 :: Integer)||]) `applyCode` opaqueExport (4 :: ClosedTerm PInteger)) + @?= "(program 1.0.0 ((\\i0 -> 7) 4))" + it "Import an integer and ignore it" $ + printTerm (plam (\_ -> 4 :: ClosedTerm PInteger) # opaqueImport (PlutusTx.liftCode (7 :: Integer))) + @?= "(program 1.0.0 ((\\i0 -> 4) 7))" + describe "Records" $ do + it "PlutusTx record value" $ + printShrunkCode $$(PlutusTx.compile [||SampleRecord (toBuiltin False) 6 "Hello"||]) @?= sampleScottEncoding + it "Plutarch record value" $ + printTerm (pdelay $ Rec.rcon $ PSampleRecord (pcon PFalse) 6 "Hello") @?= sampleScottEncoding + it "PlutusTx record function" $ + printShrunkCode $$(PlutusTx.compile [||sampleInt||]) @?= sampleScottField + it "Plutarch record function" $ + printTerm (plam $ \r -> pforce r # Rec.field psampleInt) @?= sampleScottField + it "Apply PlutusTx record function in Plutarch" $ + printShrunkTerm (importedField #$ pdelay $ pcon $ Rec.PRecord $ PSampleRecord (pcon PFalse) 6 "Hello") @?= "(program 1.0.0 6)" + it "Apply Plutarch record function in PlutusTx" $ + printShrunkCode (exportedField `applyCode` $$(PlutusTx.compile [||SampleRecord (toBuiltin False) 6 "Hello"||])) + @?= "(program 1.0.0 6)" + it "import a pair" $ + printEvaluatedTerm + ( foreignImport (PlutusTx.liftCode ("foo" :: BuiltinString, 4 :: Integer)) :: + Term _ (PDelayed (PPair PString PInteger)) + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> i1 \"foo\" 4)))" + it "import a pair" $ + printEvaluatedTerm + ( foreignImport (PlutusTx.liftCode ("foo" :: Value.TokenName, 4 :: Integer)) :: + Term _ (PDelayed (PPair PTokenName PInteger)) + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> i1 #666f6f 4)))" + describe "Maybe" $ do + it "a PlutusTx Just Integer" $ + printShrunkCode (PlutusTx.liftCode (Just 4 :: Maybe Integer)) @?= justFour + it "a converted Plutarch PJust PInteger" $ + printShrunkTerm (pmaybeToTx # (pcon (PJust 4) :: Term _ (PMaybe PInteger))) @?= justFour + it "a Plutarch PTxJust PInteger" $ + printTerm (pcon (PTxJust 4) :: Term _ (PTxMaybe PInteger)) @?= justFour + it "a converted Plutarch PTxJust PInteger" $ + printShrunkTerm (pmaybeFromTx # (pcon $ PTxJust 4) :: Term _ (PMaybe PInteger)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> i2 4))" + it "a PlutusTx Nothing" $ + printShrunkCode (PlutusTx.liftCode (Nothing :: Maybe Integer)) @?= nothing + it "a converted Plutarch PNothing" $ + printShrunkTerm (pmaybeToTx # (pcon PNothing :: Term _ (PMaybe PInteger))) @?= nothing + it "a Plutarch PTxNothing" $ + printTerm (pcon PTxNothing :: Term _ (PTxMaybe PInteger)) @?= nothing + it "a converted Plutarch PTxNothing" $ + printShrunkTerm (pmaybeFromTx # (pcon PTxNothing) :: Term _ (PMaybe PInteger)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> force i1))" + it "import a Just Integer" $ + printEvaluatedTerm (foreignImport (PlutusTx.liftCode (Just 4 :: Maybe Integer)) :: Term _ (PTxMaybe PInteger)) @?= Right justFour + it "export a PTxJust PInteger" $ + printEvaluatedCode + ( (foreignExport (pcon (PTxJust 4) :: Term _ (PTxMaybe PInteger))) :: + CompiledCode (Maybe Integer) + ) + @?= Right justFour + describe "Lists" $ do + it "a PlutusTx list of integers" $ + printShrunkCode (PlutusTx.liftCode [1 :: Integer .. 3]) @?= oneTwoThree + it "import a list of integers" $ + printEvaluatedTerm (foreignImport (PlutusTx.liftCode [1 :: Integer .. 3]) :: Term _ (PTxList PInteger)) @?= Right oneTwoThree + it "import and map over a Value" $ + printEvaluatedTerm (pmap # pfst # (foreignImport (PlutusTx.liftCode val) :: Term _ PSValue)) + @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1 #c0 (delay (\\i0 -> \\i0 -> i1 # (delay (\\i0 -> \\i0 -> i2)))))))" + it "import and fold over a Value" $ + printEvaluatedTerm + (sumValueAmounts # (foreignImport (PlutusTx.liftCode val) :: Term _ PSValue)) + @?= Right "(program 1.0.0 3)" + it "export a list of integers" $ + printEvaluatedCode + ( foreignExport (pconvertLists #$ pconstant @(PBuiltinList PInteger) [1 .. 3] :: Term _ (PTxList PInteger)) :: + CompiledCode [Integer] + ) + @?= Right oneTwoThree + it "export a fold and apply it to a Value" $ + printEvaluatedCode + ((foreignExport sumValueAmounts :: CompiledCode (Value -> Integer)) `PlutusTx.applyCode` PlutusTx.liftCode val) + @?= Right "(program 1.0.0 3)" + + describe "Data" $ do + describe "Export and use a PData :--> PData function" $ do + it "evaluate a field" $ + printEvaluatedCode + ( $$(PlutusTx.compile [||\gti ctx -> maybe "undecoded" (getTxId . txInfoId) (PlutusTx.fromBuiltinData (gti ctx))||]) + `applyCode` exportedTxInfo + `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) + ) + @?= Right "(program 1.0.0 #b0)" + it "evaluate a function to True" $ + printEvaluatedCode + ( $$(PlutusTx.compile [||\gti ctx pkh -> any (`Contexts.txSignedBy` pkh) (PlutusTx.fromBuiltinData (gti ctx))||]) + `applyCode` exportedTxInfo + `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) + `applyCode` PlutusTx.liftCode (head signatories) + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i2)))" + it "evaluate a function to False" $ + printEvaluatedCode + ( $$(PlutusTx.compile [||\gti ctx pkh -> any (`Contexts.txSignedBy` pkh) (PlutusTx.fromBuiltinData (gti ctx))||]) + `applyCode` exportedTxInfo + `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) + `applyCode` PlutusTx.liftCode "0123" + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1)))" + + describe "Import and use a BuiltinData -> x function" $ do + it "evaluate a Data -> Data -> Bool function to True" $ + printEvaluatedTerm (importedTxSignedBy # pconstantData info # pconstantData (head signatories)) + @?= Right "(program 1.0.0 True)" + it "evaluate a Data -> Data -> Bool function to False" $ + printEvaluatedTerm (importedTxSignedBy # pconstantData info # pconstantData "0123") + @?= Right "(program 1.0.0 False)" + it "evaluate a Data -> PubKeyHash -> Bool function to True" $ + printEvaluatedTerm (importedTxSignedBy' # pconstantData info # pconstant (head signatories)) + @?= Right "(program 1.0.0 True)" + it "evaluate a Data -> PubKeyHash -> Bool function to False" $ + printEvaluatedTerm (importedTxSignedBy' # pconstantData info # pconstant "0123") + @?= Right "(program 1.0.0 False)" + where + sampleScottEncoding = "(program 1.0.0 (delay (\\i0 -> i1 False 6 \"Hello\")))" + sampleScottField = "(program 1.0.0 (\\i0 -> force i1 (\\i0 -> \\i0 -> \\i0 -> i2)))" + oneTwoThree, justFour :: String + oneTwoThree = "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1 1 (delay (\\i0 -> \\i0 -> i1 2 (delay (\\i0 -> \\i0 -> i1 3 (delay (\\i0 -> \\i0 -> i2)))))))))" + justFour = "(program 1.0.0 (delay (\\i0 -> \\i0 -> i2 4)))" + nothing = "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1)))" diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 7f36f0197..8c1db796c 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -116,6 +116,13 @@ executable plutarch-test , rank2classes , serialise + if impl(ghc <9.0) + build-depends: + , plutus-tx-plugin + , shrinker + + other-modules: Plutarch.FFISpec + if impl(ghc >=9.0) other-modules: Plutarch.FieldSpec From a7807098515f58222156c97ffdc83e6a80a48292 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Wed, 16 Mar 2022 16:28:39 +0100 Subject: [PATCH 205/584] fix: switch to HRec instead of HTree - written new HRecP type that corresponds with HRec that mirrors a type level list - adjusted all instances - adjusted all tests - wrote convience functions --- Plutarch/Api/V1/AssocMap.hs | 8 +- Plutarch/Api/V1/Value.hs | 8 +- Plutarch/TryFrom.hs | 230 ++++++++---------- ...cation_untrusted_data.dev=true.uplc.golden | 8 +- plutarch-test/src/Plutarch/TryFromSpec.hs | 38 +-- 5 files changed, 133 insertions(+), 159 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 0e5d7dd57..e808e427d 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -9,9 +9,9 @@ module Plutarch.Api.V1.AssocMap ( import Data.Map (Map, toList) import Plutarch.TryFrom ( - HSTree (HSRoot), - HTree (HNode), + HRecP (HSNil), PTryFrom (PTryFromExcess, ptryFrom), + RecKind (HNil), ) import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap @@ -95,7 +95,7 @@ instance ) => PTryFrom (PBuiltinMap k v) (PMap k v) s where - type PTryFromExcess (PBuiltinMap k v) (PMap k v) = 'HNode "empty" '[] + type PTryFromExcess (PBuiltinMap k v) (PMap k v) = HRecP 'HNil ptryFrom oMap = runTermCont $ do _ <- tcont $ @@ -114,4 +114,4 @@ instance perror ) # oMap - pure ((pcon . PMap) oMap, HSRoot) + pure ((pcon . PMap) oMap, HSNil) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 471e5a6c1..f49ae0921 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -18,9 +18,9 @@ import Plutarch.Lift ( ) import Plutarch.TryFrom ( - HSTree (HSRoot), - HTree (HNode), + HRecP (HSNil), PTryFrom (PTryFromExcess, ptryFrom), + RecKind (HNil), ) import Plutarch.Prelude @@ -57,7 +57,7 @@ deriving via ----------------------- PTryFrom instances ---------------------------------------------- instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue s where - type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = 'HNode "empty" '[] + type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = HRecP 'HNil ptryFrom m = runTermCont $ do let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) perror @@ -66,4 +66,4 @@ instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue s whe res :: Term _ PBool res = pall # predOuter # pto m _ <- tcont $ plet res - pure $ (pcon $ PValue m, HSRoot) + pure $ (pcon $ PValue m, HSNil) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 3fcf280ef..9f2615a71 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -4,15 +4,17 @@ module Plutarch.TryFrom ( PTryFrom (PTryFromExcess, ptryFrom), - HTree (HNode, HLeaf), - HSTree (HSLeaf, HSRoot, (:<<:)), - (:<->:), hsing, - htreeNode, + getExcessField, + HRecP (HSNil, HSCons), + RecKind (HNil, HCons), + HSing, + HSSing, + Flip (MkFlip, unFlip), ) where import Data.Proxy (Proxy (Proxy)) -import GHC.TypeLits (ErrorMessage (Text), KnownNat, Nat, Symbol, TypeError, natVal, type (+)) +import GHC.TypeLits (KnownNat, Nat, Symbol, natVal, type (+)) import Plutarch.Builtin ( PAsData, @@ -66,6 +68,7 @@ import Plutarch.List ( import Plutarch.Unsafe (punsafeCoerce) import GHC.Records (HasField (getField)) + import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) ----------------------- The class PTryFrom ---------------------------------------------- @@ -94,134 +97,101 @@ import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) more information -} class PTryFrom (a :: PType) (b :: PType) (s :: S) where - type PTryFromExcess a b :: HTree - ptryFrom :: Term s a -> ((Term s b, HSTree (PTryFromExcess a b) s) -> Term s r) -> Term s r + type PTryFromExcess a b :: PType + ptryFrom :: Term s a -> ((Term s b, PTryFromExcess a b s) -> Term s r) -> Term s r ----------------------- HTree and friends ----------------------------------------------- -data HTree - = HLeaf Symbol PType - | HNode Symbol [HTree] - -data HSTree (as :: HTree) (s :: S) where - HSLeaf :: forall label typ s. Term s typ -> HSTree ( 'HLeaf label typ) s - HSRoot :: forall label s. HSTree ( 'HNode label '[]) s - (:<<:) :: forall label tree trees s. HSTree tree s -> HSTree ( 'HNode label trees) s -> HSTree ( 'HNode label (tree ': trees)) s +newtype Flip f a b = MkFlip {unFlip :: f b a} -infixr 5 :<<: +data RecKind + = HNil + | HCons Symbol PType RecKind -type (:<->:) :: HTree -> HTree -> HTree -type family n0 :<->: n1 where - 'HNode l n0 :<->: 'HNode l n1 = 'HNode l (n0 ++ n1) - 'HNode l0 _ :<->: 'HNode l1 _ = TypeError ( 'Text "We can only merge nodes with the same label") - _ :<->: _ = TypeError ( 'Text "We can only merge nodes") +type HSing :: Symbol -> PType -> RecKind +type family HSing sym typ where + HSing sym typ = 'HCons sym (Flip Term typ) 'HNil -infixr 5 :<->: +data HRecP (as :: RecKind) (s :: S) where + HSNil :: HRecP 'HNil s + HSCons :: + forall name a s as. + a s -> + HRecP as s -> + HRecP ( 'HCons name a as) s -type (++) :: [a] -> [a] -> [a] -type family l1 ++ l2 where - '[] ++ ys = ys - (x ': xs) ++ ys = xs ++ x ': ys +type HSSing :: Symbol -> PType -> PType +type HSSing sym a = HRecP (HSing sym a) -infixr 5 ++ +hsing :: forall sym a (s :: S). Term s a -> HSSing sym a s +hsing ter = HSCons @sym (MkFlip ter) HSNil -htreeNode :: - forall name e s tree. - ( TreeElemOf name e tree +getExcessField :: + forall name a b as s. + ( ElemOf name a as + , MaybeUnFlip a s b ) => - HSTree tree s -> - Term s e -htreeNode tree = indexHTree tree $ treeElemOf @name @e @tree - -indexHTree :: - forall (name :: Symbol) (tree :: HTree) (s :: S). - HSTree tree s -> - (forall (e :: PType). TreeElem name e tree -> Term s e) -indexHTree (_ :<<: node) (There rest) = indexHTree node rest -indexHTree (HSLeaf x :<<: _) Here = x -indexHTree (HSLeaf x) HereLeaf = x -indexHTree (_tree :<<: _) HereTree = error "while trying to access tree" -indexHTree _ _ = error "impossible while indexing HTree" - -{- -type TreeOrTerm :: HTree -> S -> Type -type family TreeOrTerm tree s where - TreeOrTerm ('HLeaf l1 ptyp) s = Term s ptyp - TreeOrTerm ('HNode l0 ('HLeaf l1 ptyp ': trees)) s = Term s ptyp - TreeOrTerm ('HNode l trees) s = HSTree ('HNode l trees) s - -} - -class TreeElemOf (name :: Symbol) (typ :: PType) (tree :: HTree) | name tree -> typ where - treeElemOf :: TreeElem name typ tree - -instance {-# OVERLAPPING #-} TreeElemOf name e ( 'HNode sym ( 'HLeaf name e ': trees)) where - treeElemOf = Here - -instance TreeElemOf name e ( 'HLeaf name e) where - treeElemOf = HereLeaf + HRecP as s -> + b +getExcessField xs = maybeUnFlip $ indexHRec xs $ elemOf @name @a @as -instance - {-# OVERLAPPING #-} - ( HSTree ( 'HNode name tree) ~ e - ) => - TreeElemOf name e ( 'HNode sym ( 'HNode name tree ': trees)) - where - treeElemOf = HereTree +class MaybeUnFlip a s b | a s -> b where + maybeUnFlip :: a s -> b -instance - {-# OVERLAPPABLE #-} - ( TreeElemOf name e ( 'HNode sym trees) - ) => - TreeElemOf name e ( 'HNode sym (tree ': trees)) - where - treeElemOf = There treeElemOf +instance {-# OVERLAPPING #-} MaybeUnFlip (Flip Term a) s (Term s a) where + maybeUnFlip = unFlip -data TreeElem (name :: Symbol) (typ :: PType) (tree :: HTree) where - Here :: TreeElem name typ ( 'HNode sym ( 'HLeaf name typ ': trees)) - HereLeaf :: TreeElem name typ ( 'HLeaf name typ) - HereTree :: TreeElem name (HSTree ( 'HNode name inner)) ( 'HNode sym ( 'HNode name inner ': trees)) - There :: TreeElem name typ ( 'HNode sym l) -> TreeElem name typ ( 'HNode sym (tree ': l)) +instance {-# OVERLAPPABLE #-} MaybeUnFlip (HRecP reck) s ((HRecP reck) s) where + maybeUnFlip = id -deriving stock instance Show (TreeElem a b c) +-- | Index HRec using Elem +indexHRec :: forall s as. HRecP as s -> (forall a name. Elem name a as -> a s) +indexHRec (HSCons x _) Here = x +indexHRec (HSCons _ xs) (There i) = indexHRec xs i +indexHRec HSNil impossible = case impossible of {} -type family Relabel sym old where - Relabel sym ( 'HNode _ inner) = 'HNode sym inner - Relabel sym ( 'HLeaf _ inner) = 'HLeaf sym inner +data Elem (sym :: Symbol) (a :: PType) (as :: RecKind) where + Here :: Elem sym a ( 'HCons sym a as) + There :: Elem a sym as -> Elem a sym ( 'HCons sym' b as) -class SRelabel sym tree s where - srelabel :: HSTree tree s -> HSTree (Relabel sym tree) s +class + ElemOf (name :: Symbol) (a :: PType) (as :: RecKind) + | as name -> a + where + elemOf :: Elem name a as -instance SRelabel sym ( 'HNode old inner) s where - srelabel HSRoot = HSRoot - srelabel (x :<<: HSRoot) = (x :<<: HSRoot) - srelabel _ = error "impossible while relabeling" +instance {-# OVERLAPPING #-} ElemOf name a ( 'HCons name a as) where + elemOf = Here -instance SRelabel sym ( 'HLeaf old ptyp) s where - srelabel (HSLeaf x) = (HSLeaf x) +instance + {-# OVERLAPPABLE #-} + ( ElemOf name a as + ) => + ElemOf name a ( 'HCons name' b as) + where + elemOf :: Elem name a ( 'HCons name' b as) + elemOf = There (elemOf @name @a @as) ----------------------- PData instances ------------------------------------------------- -hsing :: forall sym a (s :: S). Term s a -> HSTree ( 'HLeaf sym a) s -hsing = HSLeaf @sym - instance PTryFrom PData (PAsData PInteger) (s :: S) where - type PTryFromExcess PData (PAsData PInteger) = 'HLeaf "unwrapped" PInteger + type PTryFromExcess PData (PAsData PInteger) = HSSing "unwrapped" PInteger ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) pure $ (punsafeCoerce opq, hsing ver) instance PTryFrom PData (PAsData PByteString) s where - type PTryFromExcess PData (PAsData PByteString) = 'HLeaf "unwrapped" PByteString + type PTryFromExcess PData (PAsData PByteString) = HSSing "unwrapped" PByteString ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) pure $ (punsafeCoerce opq, hsing ver) instance PTryFrom PData PData s where - type PTryFromExcess PData PData = 'HNode "empty" '[] - ptryFrom opq = runTermCont $ pure $ (opq, HSRoot) + type PTryFromExcess PData PData = HRecP 'HNil + ptryFrom opq = runTermCont $ pure $ (opq, HSNil) instance PTryFrom PData (PAsData PData) s where - type PTryFromExcess PData (PAsData PData) = 'HLeaf "unwrapped" PData + type PTryFromExcess PData (PAsData PData) = HSSing "unwrapped" PData ptryFrom opq = runTermCont $ pure (pdata opq, hsing opq) -- TODO: add the excess inner type @@ -231,7 +201,7 @@ instance ) => PTryFrom PData (PAsData (PBuiltinMap a b)) s where - type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = 'HLeaf "unwrapped" (PBuiltinMap a b) + type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = HSSing "unwrapped" (PBuiltinMap a b) ptryFrom opq = runTermCont $ do verMap <- tcont $ plet (pasMap # opq) let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) @@ -244,7 +214,7 @@ instance -- TODO: add the excess inner type list instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) s where - type PTryFromExcess PData (PAsData (PBuiltinList PData)) = 'HLeaf "unwrapped" (PBuiltinList PData) + type PTryFromExcess PData (PAsData (PBuiltinList PData)) = HSSing "unwrapped" (PBuiltinList PData) ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasList # opq) pure $ (punsafeCoerce opq, hsing ver) @@ -257,7 +227,7 @@ instance ) => PTryFrom PData (PAsData (PBuiltinList (PAsData a))) s where - type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = 'HLeaf "unwrapped" (PBuiltinList (PAsData a)) + type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = HSSing "unwrapped" (PBuiltinList (PAsData a)) ptryFrom opq = runTermCont $ do let lst :: Term _ (PBuiltinList PData) lst = pasList # opq @@ -280,7 +250,7 @@ instance ) => PTryFrom PData (PAsData (PBuiltinPair a b)) s where - type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = 'HLeaf "unwrapped" (PBuiltinPair a b) + type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = HSSing "unwrapped" (PBuiltinPair a b) ptryFrom opq = runTermCont $ do tup <- tcont $ plet (pfromData $ punsafeCoerce opq) let fst' :: Term _ a @@ -290,14 +260,15 @@ instance ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' pure $ (punsafeCoerce opq, hsing ver) -type FromRecordField :: PLabeledType -> HTree -type family FromRecordField field where - FromRecordField (label ':= ptyp) = 'HLeaf label ptyp - -type FromRecordFields :: [PLabeledType] -> [HTree] +type FromRecordFields :: [PLabeledType] -> RecKind type family FromRecordFields xs where - FromRecordFields '[] = '[] - FromRecordFields (x ': xs) = FromRecordField x ': FromRecordFields xs + FromRecordFields '[] = 'HNil + FromRecordFields ((label ':= ptyp) ': xs) = 'HCons label (HSSing "unwrapped" ptyp) (FromRecordFields xs) + +type (++) :: RecKind -> RecKind -> RecKind +type family r0 ++ r1 where + 'HNil ++ l = l + 'HCons sym typ l0 ++ l1 = l0 ++ 'HCons sym typ l1 instance ( FromRecordFields xs ~ ValidationExcess xs @@ -307,37 +278,32 @@ instance where type PTryFromExcess PData (PAsData (PDataRecord xs)) = - 'HNode - "record" - ( '[ 'HLeaf "unwrapped" (PDataRecord xs) - ] - ++ FromRecordFields xs - ) + HRecP (HSing "unwrapped" (PDataRecord xs) ++ FromRecordFields xs) + ptryFrom opq = runTermCont $ do let lst :: Term _ (PBuiltinList PData) lst = pfromData $ punsafeCoerce opq (rec', exc) <- recoverRecord @xs @s lst rec <- tcont $ plet rec' - let excess :: HSTree (PTryFromExcess PData (PAsData (PDataRecord xs))) s - excess = HSLeaf @"unwrapped" rec :<<: exc + let excess :: PTryFromExcess PData (PAsData (PDataRecord xs)) s + excess = HSCons @"unwrapped" (MkFlip rec) exc pure (punsafeCoerce opq, excess) class RecordValidation xs s where - type ValidationExcess xs :: [HTree] + type ValidationExcess xs :: RecKind recoverRecord :: Term s (PBuiltinList PData) -> - TermCont s (Term s (PDataRecord xs), HSTree ( 'HNode "record" (ValidationExcess xs)) s) + TermCont s (Term s (PDataRecord xs), HRecP (ValidationExcess xs) s) instance {-# OVERLAPPABLE #-} ( RecordValidation xs s , PTryFrom PData (PAsData a) s , PTryFrom PData (PAsData (PDataRecord xs)) s - , SRelabel label (PTryFromExcess PData (PAsData a)) s ) => RecordValidation ((label ':= a) ': xs) s where - type ValidationExcess ((label ':= a) ': xs) = Relabel label (PTryFromExcess PData (PAsData a)) ': ValidationExcess xs + type ValidationExcess ((label ':= a) ': xs) = 'HCons label (PTryFromExcess PData (PAsData a)) (ValidationExcess xs) recoverRecord lst = do let lsthead :: Term s PData lsthead = phead # lst @@ -346,11 +312,11 @@ instance (verhead, exchead) <- TermCont $ ptryFrom @PData @(PAsData a) @s lsthead (vertail, exctail) <- recoverRecord @xs @s lsttail rec <- tcont $ plet $ pdcons @label # verhead # vertail - pure (rec, (srelabel @label exchead) :<<: exctail) + pure (rec, HSCons @label exchead exctail) instance {-# OVERLAPPING #-} RecordValidation '[] s where - type ValidationExcess '[] = '[] - recoverRecord _ = pure (pdnil, HSRoot) + type ValidationExcess '[] = 'HNil + recoverRecord _ = pure (pdnil, HSNil) instance {-# OVERLAPPING #-} @@ -359,10 +325,10 @@ instance ) => PTryFrom PData (PAsData (PDataSum ys)) s where - type PTryFromExcess PData (PAsData (PDataSum ys)) = 'HNode "empty" '[] + type PTryFromExcess PData (PAsData (PDataSum ys)) = HRecP 'HNil ptryFrom opq = runTermCont $ do _ <- tcont $ plet $ validateSum @0 @ys opq - pure (punsafeCoerce opq, HSRoot) + pure (punsafeCoerce opq, HSNil) class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) s where validateSum :: Term s PData -> Term s (PBuiltinList PData) @@ -389,7 +355,7 @@ instance (fromInteger n #== (pfstBuiltin # elem)) ( unTermCont $ do let rec = pdata $ psndBuiltin # elem - y <- (htreeNode @"unwrapped" . snd) <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord x)) @s $ pforgetData rec) + y <- (getExcessField @"unwrapped" . snd) <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord x)) @s $ pforgetData rec) pure $ punsafeCoerce (y :: Term _ (PDataRecord x)) ) (validateSum @(n + 1) @xs $ punsafeCoerce s) @@ -413,13 +379,13 @@ instance ) => PTryFrom POpaque a s where - type PTryFromExcess POpaque a = 'HLeaf "wrapped" (PAsData a) + type PTryFromExcess POpaque a = Flip Term (PAsData a) ptryFrom opq = runTermCont $ do let prop :: Term _ a prop = punsafeCoerce opq ver' <- fst <$> TermCont (ptryFrom @PData @(PAsData a) $ pforgetData $ pdata prop) ver <- tcont $ plet ver' - pure $ (punsafeCoerce opq, hsing ver) + pure $ (punsafeCoerce opq, MkFlip ver) instance ( PTryFrom a b s @@ -435,5 +401,5 @@ instance ----------------------- HasField instance ----------------------------------------------- -instance TreeElemOf name ptyp tree => HasField name (HSTree tree s) (Term s ptyp) where - getField = htreeNode @name @ptyp +instance (MaybeUnFlip ptyp s out, ElemOf name ptyp rec) => HasField name (HRecP rec s) out where + getField = getExcessField @name diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden index 46aea73a6..b41aabcde 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden @@ -27,7 +27,7 @@ checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 , #a149736f6d65546f6b656e01 ) ])) checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:334:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:325:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:334:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:325:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:334:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:325:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:384:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:334:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:325:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) \ No newline at end of file +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:383:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:333:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:324:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:383:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:333:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:324:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:383:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:333:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:324:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:383:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:333:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at src/Plutarch/TryFromSpec.hs:324:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index a74cd608a..ab30d846b 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -7,9 +7,9 @@ module Plutarch.TryFromSpec (spec) where import Test.Syd --- import qualified GHC.Generics as GHC +import qualified GHC.Generics as GHC --- import Generics.SOP (Generic, I (I)) +import Generics.SOP (Generic, I (I)) import Plutus.V1.Ledger.Api ( Address (Address), @@ -31,6 +31,7 @@ import qualified PlutusTx.AssocMap as PlutusMap import Plutarch.Unsafe ( punsafeCoerce, + punsafeFrom, ) import Plutarch @@ -59,7 +60,7 @@ import Plutarch.Builtin ( ) import Plutarch.Prelude import Plutarch.TryFrom ( - HTree (HLeaf), + HSSing, PTryFrom (PTryFromExcess, ptryFrom), hsing, ) @@ -67,7 +68,7 @@ import Plutarch.TryFrom ( import Plutarch.ApiSpec (info, purpose) import qualified Plutarch.ApiSpec as Api --- import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) +import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) import Plutarch.Test import Plutus.V1.Ledger.Value (Value) import qualified Plutus.V1.Ledger.Value as Value @@ -306,10 +307,10 @@ pmkNatural :: Term s (PInteger :--> PNatural) pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) instance PTryFrom PData (PAsData PNatural) s where - type PTryFromExcess PData (PAsData PNatural) = 'HLeaf "unwrapped" PNatural + type PTryFromExcess PData (PAsData PNatural) = HSSing "unwrapped" PNatural ptryFrom opq = runTermCont $ do (ter, exc) <- TermCont $ ptryFrom @PData @(PAsData PInteger) opq - ver <- tcont $ plet $ pmkNatural # exc.unwrapped + ver <- tcont $ plet $ pmkNatural #$ exc.unwrapped pure $ (punsafeCoerce ter, hsing ver) validator :: Term s PValidator @@ -481,7 +482,6 @@ sampleMap = # (ppairDataBuiltin # (pdata $ pconstant "bar") # (pdata $ pconstant 41)) # pnil -{- ------------------- Sample type with PIsDataRepr ----------------------------------- sampleAB :: Term s (PAsData PAB) @@ -490,15 +490,23 @@ sampleAB = pdata $ pcon $ PA (pdcons @"_0" # (pdata $ pconstant 4) #$ pdcons # ( sampleABdata :: Term s PData sampleABdata = pforgetData sampleAB -recoverAB :: Term s (PAsData PAB) +{- +recoverAB :: Term s PAB recoverAB = unTermCont $ do - ver <- fst <$> TermCont (ptryFrom sampleABdata) + (ter, exc) <- TermCont (ptryFrom sampleABdata) + pure exc.unwrapped + -} -data PAB (s::S) - = PA (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PByteString] )) - | PB (Term s (PDataRecord '["_0" ':= PBuiltinList (PAsData PInteger), "_1" ':= PByteString] )) +recoverAB :: Term s PAB +recoverAB = unTermCont $ do + exc <- TermCont (ptryFrom sampleABdata) + pure $ fst exc + +data PAB (s :: S) + = PA (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PByteString])) + | PB (Term s (PDataRecord '["_0" ':= PBuiltinList (PAsData PInteger), "_1" ':= PByteString])) deriving stock (GHC.Generic) deriving anyclass (Generic, PIsDataRepr) - deriving (PlutusType, PIsData) - via PIsDataReprInstances PAB --} + deriving + (PlutusType, PIsData) + via PIsDataReprInstances PAB From 0dae82ad0f77714e38fbde25c288599652865af2 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 16 Mar 2022 11:33:50 -0400 Subject: [PATCH 206/584] PEq: use non-empty fold to remove redundant #&& This happens in all but 0-ary product case --- Plutarch/Bool.hs | 12 +++++++++--- plutarch-test/goldens/either.bench.golden | 10 +++++----- plutarch-test/goldens/either.uplc.golden | 10 +++++----- plutarch-test/goldens/maybe.bench.golden | 8 ++++---- plutarch-test/goldens/maybe.uplc.golden | 8 ++++---- plutarch-test/goldens/pair.bench.golden | 8 ++++---- plutarch-test/goldens/pair.uplc.golden | 8 ++++---- 7 files changed, 35 insertions(+), 29 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 3d25661c3..6066f5d53 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -19,7 +19,7 @@ module Plutarch.Bool ( por', ) where -import Data.Foldable (foldl') +import Data.List.NonEmpty (nonEmpty) import Generics.SOP ( All, All2, @@ -141,6 +141,13 @@ por = phoistAcyclic $ plam $ \x -> pif' # x # (phoistAcyclic $ pdelay $ pcon PTr por' :: Term s (PBool :--> PBool :--> PBool) por' = phoistAcyclic $ plam $ \x -> pif' # x # (pcon PTrue) +-- | Like Haskell's `and` but for Plutarch terms +pands :: [Term s PBool] -> Term s PBool +pands ts' = + case nonEmpty ts' of + Nothing -> pcon PTrue + Just ts -> foldl1 (#&&) ts + -- | Generic version of (#==) gpeq :: forall t s. @@ -168,8 +175,7 @@ gpeq' (SOP c1) (SOP c2) = where eqProd :: All PEq xs => NP (Term s) xs -> NP (Term s) xs -> Term s PBool eqProd p1 p2 = - foldl' (#&&) (pcon PTrue) $ - hcollapse $ hcliftA2 (Proxy :: Proxy PEq) eqTerm p1 p2 + pands $ hcollapse $ hcliftA2 (Proxy :: Proxy PEq) eqTerm p1 p2 where eqTerm :: forall a. PEq a => Term s a -> Term s a -> K (Term s PBool) a eqTerm a b = diff --git a/plutarch-test/goldens/either.bench.golden b/plutarch-test/goldens/either.bench.golden index abcf70dd9..d12cf9cfb 100644 --- a/plutarch-test/goldens/either.bench.golden +++ b/plutarch-test/goldens/either.bench.golden @@ -1,5 +1,5 @@ -eq.true.left {"exBudgetCPU":1715938,"exBudgetMemory":5402,"scriptSizeBytes":67} -eq.true.right {"exBudgetCPU":1715938,"exBudgetMemory":5402,"scriptSizeBytes":67} -eq.false.left-right {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":67} -eq.false.left-left {"exBudgetCPU":1715938,"exBudgetMemory":5402,"scriptSizeBytes":67} -eq.false.right-right {"exBudgetCPU":1715938,"exBudgetMemory":5402,"scriptSizeBytes":67} \ No newline at end of file +eq.true.left {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} +eq.true.right {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} +eq.false.left-right {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":42} +eq.false.left-left {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} +eq.false.right-right {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} \ No newline at end of file diff --git a/plutarch-test/goldens/either.uplc.golden b/plutarch-test/goldens/either.uplc.golden index b5a97c524..588755f46 100644 --- a/plutarch-test/goldens/either.uplc.golden +++ b/plutarch-test/goldens/either.uplc.golden @@ -1,5 +1,5 @@ -eq.true.left (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) -eq.true.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i1 42) (\i0 -> \i0 -> i1 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) -eq.false.left-right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i1 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) -eq.false.left-left (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) -eq.false.right-right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> force (i5 True (delay (equalsInteger i2 i1)))))) (\i0 -> \i0 -> i1 24) (\i0 -> \i0 -> i1 42)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) \ No newline at end of file +eq.true.left (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42))) +eq.true.right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i1 42) (\i0 -> \i0 -> i1 42))) +eq.false.left-right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i1 42))) +eq.false.left-left (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) +eq.false.right-right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i1 24) (\i0 -> \i0 -> i1 42))) \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.bench.golden b/plutarch-test/goldens/maybe.bench.golden index 061701efb..5187c86d7 100644 --- a/plutarch-test/goldens/maybe.bench.golden +++ b/plutarch-test/goldens/maybe.bench.golden @@ -1,4 +1,4 @@ -eq.true.nothing {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":46} -eq.true.just {"exBudgetCPU":1447981,"exBudgetMemory":4502,"scriptSizeBytes":51} -eq.false.nothing-just {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":48} -eq.false.just-just {"exBudgetCPU":1447981,"exBudgetMemory":4502,"scriptSizeBytes":51} \ No newline at end of file +eq.true.nothing {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":34} +eq.true.just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} +eq.false.nothing-just {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":36} +eq.false.just-just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.golden b/plutarch-test/goldens/maybe.uplc.golden index 225ed9921..2fde37e08 100644 --- a/plutarch-test/goldens/maybe.uplc.golden +++ b/plutarch-test/goldens/maybe.uplc.golden @@ -1,4 +1,4 @@ -eq.true.nothing (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay (equalsInteger i2 i1)))) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> force i1))) -eq.true.just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay (equalsInteger i2 i1)))) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42))) -eq.false.nothing-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay (equalsInteger i2 i1)))) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> i2 42))) -eq.false.just-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay (equalsInteger i2 i1)))) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) \ No newline at end of file +eq.true.nothing (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> force i1))) +eq.true.just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42))) +eq.false.nothing-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> i2 42))) +eq.false.just-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) \ No newline at end of file diff --git a/plutarch-test/goldens/pair.bench.golden b/plutarch-test/goldens/pair.bench.golden index e527cf562..a85af75ee 100644 --- a/plutarch-test/goldens/pair.bench.golden +++ b/plutarch-test/goldens/pair.bench.golden @@ -1,4 +1,4 @@ -eq.true {"exBudgetCPU":2496172,"exBudgetMemory":7504,"scriptSizeBytes":72} -eq.false.fst {"exBudgetCPU":2222080,"exBudgetMemory":7103,"scriptSizeBytes":72} -eq.false.snd {"exBudgetCPU":2406853,"exBudgetMemory":7204,"scriptSizeBytes":76} -eq.false.both {"exBudgetCPU":2132761,"exBudgetMemory":6803,"scriptSizeBytes":76} \ No newline at end of file +eq.true {"exBudgetCPU":1811392,"exBudgetMemory":5203,"scriptSizeBytes":59} +eq.false.fst {"exBudgetCPU":1537300,"exBudgetMemory":4802,"scriptSizeBytes":59} +eq.false.snd {"exBudgetCPU":1722073,"exBudgetMemory":4903,"scriptSizeBytes":64} +eq.false.both {"exBudgetCPU":1447981,"exBudgetMemory":4502,"scriptSizeBytes":64} \ No newline at end of file diff --git a/plutarch-test/goldens/pair.uplc.golden b/plutarch-test/goldens/pair.uplc.golden index 9ab076b98..f522de39b 100644 --- a/plutarch-test/goldens/pair.uplc.golden +++ b/plutarch-test/goldens/pair.uplc.golden @@ -1,4 +1,4 @@ -eq.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 (force (i7 True (delay (equalsInteger i4 i2)))) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i5) (\i0 -> i1 42 i5)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) "Hello")) -eq.false.fst (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 (force (i7 True (delay (equalsInteger i4 i2)))) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i5) (\i0 -> i1 24 i5)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) "Hello")) -eq.false.snd (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 (force (i7 True (delay (equalsInteger i4 i2)))) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 42 "World")) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) -eq.false.both (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 (force (i7 True (delay (equalsInteger i4 i2)))) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 24 "World")) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) \ No newline at end of file +eq.true (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i2) (\i0 -> i1 42 i2)) "Hello")) +eq.false.fst (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i2) (\i0 -> i1 24 i2)) "Hello")) +eq.false.snd (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 42 "World"))) +eq.false.both (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 24 "World"))) \ No newline at end of file From bfecb48d393f492c9817ee60e2501a32b48db9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 15 Mar 2022 14:55:38 -0400 Subject: [PATCH 207/584] Eliminated an AllowAmbiguousTypes pragma --- Plutarch/Bool.hs | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 6066f5d53..3de8f81ff 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -1,6 +1,4 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DefaultSignatures #-} -{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -162,21 +160,16 @@ gpeq = plam $ \x y -> pmatch x $ \x' -> pmatch y $ \y' -> - gpeq' @t (gpfrom x') (gpfrom y') - -gpeq' :: - forall a s. - All2 PEq (PCode s a) => - SOP (Term s) (PCode s a) -> - SOP (Term s) (PCode s a) -> - Term s PBool + gpeq' (gpfrom x') (gpfrom y') + +gpeq' :: All2 PEq a => SOP (Term s) a -> SOP (Term s) a -> Term s PBool gpeq' (SOP c1) (SOP c2) = ccompare_NS (Proxy @(All PEq)) (pcon PFalse) eqProd (pcon PFalse) c1 c2 + +eqProd :: All PEq xs => NP (Term s) xs -> NP (Term s) xs -> Term s PBool +eqProd p1 p2 = + pands $ hcollapse $ hcliftA2 (Proxy :: Proxy PEq) eqTerm p1 p2 where - eqProd :: All PEq xs => NP (Term s) xs -> NP (Term s) xs -> Term s PBool - eqProd p1 p2 = - pands $ hcollapse $ hcliftA2 (Proxy :: Proxy PEq) eqTerm p1 p2 - where - eqTerm :: forall a. PEq a => Term s a -> Term s a -> K (Term s PBool) a - eqTerm a b = - K $ a #== b + eqTerm :: forall s a. PEq a => Term s a -> Term s a -> K (Term s PBool) a + eqTerm a b = + K $ a #== b From 332148212f97c53facd8c8ae48287501536fae3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 15 Mar 2022 16:28:24 -0400 Subject: [PATCH 208/584] Added three items to changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d36d651a7..7a2a9a9d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,12 @@ Started by [#335](https://github.com/Plutonomicon/plutarch/pull/335) +- Added module `Plutarch.FFI` for interoperability with PlutusTx. + +- Added module `Plutarch.Show` with the `PShow` type class. + +- Added `DerivePConstantViaBuiltin`, deprecating `DerivePConstantViaNewtype`. + - `TermCont`: Parametrize by result type; add `MonadFail` instance; etc. Also, export from `Plutarch.TermCont`, and then from `Plutarch.Prelude` (TermCont is no longer exported by `Plutarch.Internal`). From bb04b7749ff6cdaf5a6d4c5ba61ff89d7212accb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 16 Mar 2022 10:50:28 -0400 Subject: [PATCH 209/584] Applied suggested changes --- CHANGELOG.md | 4 +--- Plutarch/Bool.hs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a2a9a9d0..c2526d4b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # Unreleased -- Add `pshow` and `ptraceShowId` +- Added module `Plutarch.Show` with the `PShow` type class, as well as functions `pshow` and `ptraceShowId`. Started by [#352](https://github.com/Plutonomicon/plutarch/pull/352) @@ -16,8 +16,6 @@ - Added module `Plutarch.FFI` for interoperability with PlutusTx. -- Added module `Plutarch.Show` with the `PShow` type class. - - Added `DerivePConstantViaBuiltin`, deprecating `DerivePConstantViaNewtype`. - `TermCont`: Parametrize by result type; add `MonadFail` instance; etc. diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 3de8f81ff..89fb10e96 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -162,10 +162,10 @@ gpeq = pmatch y $ \y' -> gpeq' (gpfrom x') (gpfrom y') -gpeq' :: All2 PEq a => SOP (Term s) a -> SOP (Term s) a -> Term s PBool +gpeq' :: All2 PEq xss => SOP (Term s) xss -> SOP (Term s) xss -> Term s PBool gpeq' (SOP c1) (SOP c2) = ccompare_NS (Proxy @(All PEq)) (pcon PFalse) eqProd (pcon PFalse) c1 c2 - + eqProd :: All PEq xs => NP (Term s) xs -> NP (Term s) xs -> Term s PBool eqProd p1 p2 = pands $ hcollapse $ hcliftA2 (Proxy :: Proxy PEq) eqTerm p1 p2 From 85f7e3e6d77362dc71bf73305830b5d24da37e36 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:43:19 +0530 Subject: [PATCH 210/584] Add golden tests for `POrd` derivation --- plutarch-test/goldens/pisdata.lt.bench.golden | 12 ++ .../goldens/pisdata.lt.uplc.eval.golden | 12 ++ plutarch-test/goldens/pisdata.lt.uplc.golden | 12 ++ .../goldens/pisdata.lte.bench.golden | 18 ++ .../goldens/pisdata.lte.uplc.eval.golden | 18 ++ plutarch-test/goldens/pisdata.lte.uplc.golden | 18 ++ .../plutarch-base/Plutarch/POrdSpec.hs | 173 +++++++++++++++++- 7 files changed, 256 insertions(+), 7 deletions(-) create mode 100644 plutarch-test/goldens/pisdata.lt.bench.golden create mode 100644 plutarch-test/goldens/pisdata.lt.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.lt.uplc.golden create mode 100644 plutarch-test/goldens/pisdata.lte.bench.golden create mode 100644 plutarch-test/goldens/pisdata.lte.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.lte.uplc.golden diff --git a/plutarch-test/goldens/pisdata.lt.bench.golden b/plutarch-test/goldens/pisdata.lt.bench.golden new file mode 100644 index 000000000..b21cd6687 --- /dev/null +++ b/plutarch-test/goldens/pisdata.lt.bench.golden @@ -0,0 +1,12 @@ +PCredential.derived.true {"exBudgetCPU":2298711,"exBudgetMemory":5330,"scriptSizeBytes":96} +PCredential.derived.false {"exBudgetCPU":2793856,"exBudgetMemory":6532,"scriptSizeBytes":96} +PCredential.pmatch.true {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.true {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PTriplet.derived.true {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} +PTriplet.derived.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} +PTriplet.pmatch.true {"exBudgetCPU":6915430,"exBudgetMemory":15054,"scriptSizeBytes":163} +PTriplet.pmatch.false {"exBudgetCPU":7589213,"exBudgetMemory":16856,"scriptSizeBytes":163} +PTriplet.pmatch-pdatarecord.true {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} +PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lt.uplc.eval.golden b/plutarch-test/goldens/pisdata.lt.uplc.eval.golden new file mode 100644 index 000000000..b4f436f15 --- /dev/null +++ b/plutarch-test/goldens/pisdata.lt.uplc.eval.golden @@ -0,0 +1,12 @@ +PCredential.derived.true (program 1.0.0 True) +PCredential.derived.false (program 1.0.0 False) +PCredential.pmatch.true (program 1.0.0 True) +PCredential.pmatch.false (program 1.0.0 False) +PCredential.pmatch-pdatarecord.true (program 1.0.0 True) +PCredential.pmatch-pdatarecord.false (program 1.0.0 False) +PTriplet.derived.true (program 1.0.0 True) +PTriplet.derived.false (program 1.0.0 False) +PTriplet.pmatch.true (program 1.0.0 True) +PTriplet.pmatch.false (program 1.0.0 False) +PTriplet.pmatch-pdatarecord.true (program 1.0.0 True) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lt.uplc.golden b/plutarch-test/goldens/pisdata.lt.uplc.golden new file mode 100644 index 000000000..1cc6b6285 --- /dev/null +++ b/plutarch-test/goldens/pisdata.lt.uplc.golden @@ -0,0 +1,12 @@ +PCredential.derived.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData #d87a9f4141ff)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData #d8799f40ff)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PTriplet.derived.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch-pdatarecord.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.bench.golden b/plutarch-test/goldens/pisdata.lte.bench.golden new file mode 100644 index 000000000..a1db5b8ff --- /dev/null +++ b/plutarch-test/goldens/pisdata.lte.bench.golden @@ -0,0 +1,18 @@ +PCredential.derived.true.eq {"exBudgetCPU":1431021,"exBudgetMemory":4102,"scriptSizeBytes":107} +PCredential.derived.true.less {"exBudgetCPU":3253264,"exBudgetMemory":7732,"scriptSizeBytes":118} +PCredential.derived.false {"exBudgetCPU":3748409,"exBudgetMemory":8934,"scriptSizeBytes":118} +PCredential.pmatch.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} +PCredential.pmatch.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":4812231,"exBudgetMemory":10762,"scriptSizeBytes":167} +PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":3617224,"exBudgetMemory":8496,"scriptSizeBytes":175} +PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3617224,"exBudgetMemory":8496,"scriptSizeBytes":175} +PTriplet.derived.true.eq {"exBudgetCPU":1590567,"exBudgetMemory":4302,"scriptSizeBytes":164} +PTriplet.derived.true.less {"exBudgetCPU":7076793,"exBudgetMemory":14456,"scriptSizeBytes":175} +PTriplet.derived.false {"exBudgetCPU":7571938,"exBudgetMemory":15658,"scriptSizeBytes":175} +PTriplet.pmatch.true.eq {"exBudgetCPU":9201542,"exBudgetMemory":18949,"scriptSizeBytes":158} +PTriplet.pmatch.true.less {"exBudgetCPU":6915430,"exBudgetMemory":15054,"scriptSizeBytes":163} +PTriplet.pmatch.false {"exBudgetCPU":7589213,"exBudgetMemory":16856,"scriptSizeBytes":163} +PTriplet.pmatch-pdatarecord.true.eq {"exBudgetCPU":3026481,"exBudgetMemory":6294,"scriptSizeBytes":171} +PTriplet.pmatch-pdatarecord.true.less {"exBudgetCPU":8512707,"exBudgetMemory":16448,"scriptSizeBytes":183} +PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":9007852,"exBudgetMemory":17650,"scriptSizeBytes":183} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.uplc.eval.golden b/plutarch-test/goldens/pisdata.lte.uplc.eval.golden new file mode 100644 index 000000000..69302c643 --- /dev/null +++ b/plutarch-test/goldens/pisdata.lte.uplc.eval.golden @@ -0,0 +1,18 @@ +PCredential.derived.true.eq (program 1.0.0 True) +PCredential.derived.true.less (program 1.0.0 True) +PCredential.derived.false (program 1.0.0 False) +PCredential.pmatch.true.eq (program 1.0.0 True) +PCredential.pmatch.true.less (program 1.0.0 True) +PCredential.pmatch.false (program 1.0.0 False) +PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 True) +PCredential.pmatch-pdatarecord.true.less (program 1.0.0 True) +PCredential.pmatch-pdatarecord.false (program 1.0.0 False) +PTriplet.derived.true.eq (program 1.0.0 True) +PTriplet.derived.true.less (program 1.0.0 True) +PTriplet.derived.false (program 1.0.0 False) +PTriplet.pmatch.true.eq (program 1.0.0 True) +PTriplet.pmatch.true.less (program 1.0.0 True) +PTriplet.pmatch.false (program 1.0.0 False) +PTriplet.pmatch-pdatarecord.true.eq (program 1.0.0 True) +PTriplet.pmatch-pdatarecord.true.less (program 1.0.0 True) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.uplc.golden b/plutarch-test/goldens/pisdata.lte.uplc.golden new file mode 100644 index 000000000..6b271da34 --- /dev/null +++ b/plutarch-test/goldens/pisdata.lte.uplc.golden @@ -0,0 +1,18 @@ +PCredential.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i5 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i5))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i6 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i6))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d87a9f4141ff) #d8799f40ff)) +PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i6 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i6))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff) #d87a9f4141ff)) +PCredential.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))))) (i5 i2)) (i5 i1)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay False) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i10 i2)) (i10 i1)) (unConstrData i10))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay True) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i10 i2)) (i10 i1)) (unConstrData i10))))) (i7 i2)) (i7 i1)) (unConstrData i7)) (\i0 -> \i0 -> i3 i2 i4 i1)) (force ifThenElse)) (delay True)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay False) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i11 i2)) (i11 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay True) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i11 i2)) (i11 i1)) (unConstrData i8))))) (i8 i2)) (i8 i1)) (unConstrData #d8799f40ff)) (\i0 -> \i0 -> i3 i2 i4 i1)) (force ifThenElse)) (delay True)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay False) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i11 i2)) (i11 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay True) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i11 i2)) (i11 i1)) (unConstrData i8))))) (i8 i2)) (i8 i1)) (unConstrData #d87a9f4141ff)) (\i0 -> \i0 -> i3 i2 i4 i1)) (force ifThenElse)) (delay True)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PTriplet.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i6 i6) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6))))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010305ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010203ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010305ff)) +PTriplet.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 i12)) (i8 i1)) (i8 i10)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData (listData (i4 i6)) (listData (i4 i6))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6))))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData (listData (i5 i7)) (listData (i5 i4))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010305ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData (listData (i5 i7)) (listData (i5 i4))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010203ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010305ff)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index c3800c478..c730b484f 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -19,22 +19,83 @@ import Test.QuickCheck.Instances () import Test.Syd import Test.Tasty.QuickCheck (Arbitrary, arbitrary, oneof, property) -import Plutarch.Api.V1 +import Plutarch.Api.V1 (PAddress, PCredential (PPubKeyCredential, PScriptCredential), PMaybeData) import Plutarch.Lift ( DerivePConstantViaNewtype (DerivePConstantViaNewtype), PConstant (PConstanted), PUnsafeLiftDecl (PLifted), ) import Plutarch.Prelude -import Plutarch.SpecTypes (PTriplet) + +import Plutarch.SpecTypes (PTriplet (PTriplet), Triplet (Triplet)) +import Plutarch.Test spec :: Spec spec = do - describe "ord.pisdata" $ do - propertySet @PBool "PBool" - propertySet @(PMaybeData PInteger) "PMaybeData PInteger" - propertySet @(PTriplet PInteger) "PMaybeData PInteger" - propertySet @PAddress' "PAddress" + describe "pisdata" $ do + describe "ord.property" $ do + propertySet @PBool "PBool" + propertySet @(PMaybeData PInteger) "PMaybeData PInteger" + propertySet @(PTriplet PInteger) "PMaybeData PInteger" + propertySet @PAddress' "PAddress" + describe "lt" . pgoldenSpec $ do + "PCredential" @\ do + let c1 = PubKeyCredential "" + c2 = ScriptCredential "41" + "derived" @\ ltWith (#<) c1 c2 + "pmatch" @\ ltWith ltCred c1 c2 + "pmatch-pdatarecord" @\ ltWith ltCred' c1 c2 + "PTriplet" @\ do + let c1 = Triplet @Integer 1 2 3 + c2 = Triplet 1 3 5 + "derived" @\ ltWith (#<) c1 c2 + "pmatch" @\ ltWith ltTrip c1 c2 + "pmatch-pdatarecord" @\ ltWith ltTrip' c1 c2 + describe "lte" . pgoldenSpec $ do + "PCredential" @\ do + let c1 = PubKeyCredential "" + c2 = ScriptCredential "41" + "derived" @\ lteWith (#<=) c1 c2 + "pmatch" @\ lteWith lteCred c1 c2 + "pmatch-pdatarecord" @\ lteWith lteCred' c1 c2 + "PTriplet" @\ do + let c1 = Triplet @Integer 1 2 3 + c2 = Triplet 1 3 5 + "derived" @\ lteWith (#<=) c1 c2 + "pmatch" @\ lteWith lteTrip c1 c2 + "pmatch-pdatarecord" @\ lteWith lteTrip' c1 c2 + where + ltWith :: + PLift p => + (forall s. Term s p -> Term s p -> Term s PBool) -> + PLifted p -> + PLifted p -> + PlutarchGoldens + ltWith f x y = do + "true" + @| (pconstant x `f` pconstant y) + @-> passert + "false" + @| (pconstant y `f` pconstant x) + @-> passertNot + lteWith :: + PLift p => + (forall s. Term s p -> Term s p -> Term s PBool) -> + PLifted p -> + PLifted p -> + PlutarchGoldens + lteWith f x y = do + "true" + @\ do + "eq" + @| (pconstant x `f` pconstant x) + @-> passert + "less" + @| (pconstant x `f` pconstant y) + @-> passert + "false" + @| (pconstant y `f` pconstant x) + @-> passertNot propertySet :: forall p. @@ -93,3 +154,101 @@ instance Arbitrary Address' where , StakingPtr <$> arbitrary <*> arbitrary <*> arbitrary ] arbitraryMaybeStakingCred = oneof [pure Nothing, Just <$> arbitraryStakingCred] + +-- A bunch of boilerplate purely for a bit more informative benchmarks. + +-- manual 'pmatch' + manual field extraction impl. +_pmatchHelperCred :: + (Term s PByteString -> Term s PByteString -> Term s PBool) -> + Term s PCredential -> + Term s PCredential -> + Term s PBool +_pmatchHelperCred f cred1 cred2 = unTermCont $ do + x <- tcont $ pmatch cred1 + y <- tcont $ pmatch cred2 + pure $ case (x, y) of + (PPubKeyCredential a, PPubKeyCredential b) -> + pto (pfromData $ pfield @"_0" # a) `f` pto (pfromData $ pfield @"_0" # b) + (PPubKeyCredential _, PScriptCredential _) -> pconstant True + (PScriptCredential _, PPubKeyCredential _) -> pconstant False + (PScriptCredential a, PScriptCredential b) -> + pto (pfromData $ pfield @"_0" # a) `f` pto (pfromData $ pfield @"_0" # b) + +ltCred :: Term s PCredential -> Term s PCredential -> Term s PBool +ltCred = _pmatchHelperCred (#<) + +lteCred :: Term s PCredential -> Term s PCredential -> Term s PBool +lteCred = _pmatchHelperCred (#<=) + +-- manual 'pmatch' + 'PDataRecord' Ord impl. +_pmatchDataRecHelperCred :: + (forall l. POrd (PDataRecord l) => Term s (PDataRecord l) -> Term s (PDataRecord l) -> Term s PBool) -> + Term s PCredential -> + Term s PCredential -> + Term s PBool +_pmatchDataRecHelperCred f cred1 cred2 = unTermCont $ do + x <- tcont $ pmatch cred1 + y <- tcont $ pmatch cred2 + pure $ case (x, y) of + (PPubKeyCredential a, PPubKeyCredential b) -> a `f` b + (PPubKeyCredential _, PScriptCredential _) -> pconstant True + (PScriptCredential _, PPubKeyCredential _) -> pconstant False + (PScriptCredential a, PScriptCredential b) -> a `f` b + +ltCred' :: Term s PCredential -> Term s PCredential -> Term s PBool +ltCred' = _pmatchDataRecHelperCred (#<) + +lteCred' :: Term s PCredential -> Term s PCredential -> Term s PBool +lteCred' = _pmatchDataRecHelperCred (#<=) + +-- manual 'pmatch' + manual field extraction impl. +ltTrip :: Term s (PTriplet PInteger) -> Term s (PTriplet PInteger) -> Term s PBool +ltTrip trip1 trip2 = unTermCont $ do + a <- tcont $ pletFields @'["x", "y", "z"] trip1 + b <- tcont $ pletFields @'["x", "y", "z"] trip2 + + x <- tcont . plet . pfromData $ hrecField @"x" a + x' <- tcont . plet . pfromData $ hrecField @"x" b + pure $ + x #< x' + #|| ( x #== x' + #&& ( unTermCont $ do + y <- tcont . plet . pfromData $ hrecField @"y" a + y' <- tcont . plet . pfromData $ hrecField @"y" b + pure $ y #< y' #|| (y #== y' #&& pfromData (hrecField @"z" a) #< pfromData (hrecField @"z" b)) + ) + ) + +lteTrip :: Term s (PTriplet PInteger) -> Term s (PTriplet PInteger) -> Term s PBool +lteTrip trip1 trip2 = unTermCont $ do + a <- tcont $ pletFields @'["x", "y", "z"] trip1 + b <- tcont $ pletFields @'["x", "y", "z"] trip2 + + x <- tcont . plet . pfromData $ hrecField @"x" a + x' <- tcont . plet . pfromData $ hrecField @"x" b + pure $ + x #< x' + #|| ( x #== x' + #&& ( unTermCont $ do + y <- tcont . plet . pfromData $ hrecField @"y" a + y' <- tcont . plet . pfromData $ hrecField @"y" b + pure $ y #< y' #|| (y #== y' #&& pfromData (hrecField @"z" a) #<= pfromData (hrecField @"z" b)) + ) + ) + +-- manual 'pmatch' + 'PDataRecord' Ord impl. +_pmatchDataRecHelperTrip :: + (forall l. POrd (PDataRecord l) => Term s (PDataRecord l) -> Term s (PDataRecord l) -> Term s PBool) -> + Term s (PTriplet PInteger) -> + Term s (PTriplet PInteger) -> + Term s PBool +_pmatchDataRecHelperTrip f trip1 trip2 = unTermCont $ do + PTriplet a <- tcont $ pmatch trip1 + PTriplet b <- tcont $ pmatch trip2 + pure $ a `f` b + +ltTrip' :: Term s (PTriplet PInteger) -> Term s (PTriplet PInteger) -> Term s PBool +ltTrip' = _pmatchDataRecHelperTrip (#<) + +lteTrip' :: Term s (PTriplet PInteger) -> Term s (PTriplet PInteger) -> Term s PBool +lteTrip' = _pmatchDataRecHelperTrip (#<=) From 6f0b12f648139281924358abd55443abbf177d4b Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 17 Mar 2022 19:56:40 +0530 Subject: [PATCH 211/584] Update goldens --- plutarch-test/goldens/pisdata.lt.bench.golden | 4 +-- plutarch-test/goldens/pisdata.lt.uplc.golden | 4 +-- .../goldens/pisdata.lte.bench.golden | 30 +++++++++---------- plutarch-test/goldens/pisdata.lte.uplc.golden | 30 +++++++++---------- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/plutarch-test/goldens/pisdata.lt.bench.golden b/plutarch-test/goldens/pisdata.lt.bench.golden index b21cd6687..f150b4791 100644 --- a/plutarch-test/goldens/pisdata.lt.bench.golden +++ b/plutarch-test/goldens/pisdata.lt.bench.golden @@ -6,7 +6,7 @@ PCredential.pmatch-pdatarecord.true {"exBudgetCPU":3438586,"exBudgetMemory":7896 PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PTriplet.derived.true {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} PTriplet.derived.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} -PTriplet.pmatch.true {"exBudgetCPU":6915430,"exBudgetMemory":15054,"scriptSizeBytes":163} -PTriplet.pmatch.false {"exBudgetCPU":7589213,"exBudgetMemory":16856,"scriptSizeBytes":163} +PTriplet.pmatch.true {"exBudgetCPU":6736792,"exBudgetMemory":14454,"scriptSizeBytes":161} +PTriplet.pmatch.false {"exBudgetCPU":7410575,"exBudgetMemory":16256,"scriptSizeBytes":161} PTriplet.pmatch-pdatarecord.true {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lt.uplc.golden b/plutarch-test/goldens/pisdata.lt.uplc.golden index 1cc6b6285..4ecf94f62 100644 --- a/plutarch-test/goldens/pisdata.lt.uplc.golden +++ b/plutarch-test/goldens/pisdata.lt.uplc.golden @@ -6,7 +6,7 @@ PCredential.pmatch-pdatarecord.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) PTriplet.derived.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -PTriplet.pmatch.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.pmatch-pdatarecord.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.bench.golden b/plutarch-test/goldens/pisdata.lte.bench.golden index a1db5b8ff..5df1ba073 100644 --- a/plutarch-test/goldens/pisdata.lte.bench.golden +++ b/plutarch-test/goldens/pisdata.lte.bench.golden @@ -1,18 +1,18 @@ -PCredential.derived.true.eq {"exBudgetCPU":1431021,"exBudgetMemory":4102,"scriptSizeBytes":107} -PCredential.derived.true.less {"exBudgetCPU":3253264,"exBudgetMemory":7732,"scriptSizeBytes":118} -PCredential.derived.false {"exBudgetCPU":3748409,"exBudgetMemory":8934,"scriptSizeBytes":118} +PCredential.derived.true.eq {"exBudgetCPU":1341702,"exBudgetMemory":3802,"scriptSizeBytes":104} +PCredential.derived.true.less {"exBudgetCPU":3163945,"exBudgetMemory":7432,"scriptSizeBytes":115} +PCredential.derived.false {"exBudgetCPU":3659090,"exBudgetMemory":8634,"scriptSizeBytes":115} PCredential.pmatch.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} PCredential.pmatch.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":4812231,"exBudgetMemory":10762,"scriptSizeBytes":167} -PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":3617224,"exBudgetMemory":8496,"scriptSizeBytes":175} -PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3617224,"exBudgetMemory":8496,"scriptSizeBytes":175} -PTriplet.derived.true.eq {"exBudgetCPU":1590567,"exBudgetMemory":4302,"scriptSizeBytes":164} -PTriplet.derived.true.less {"exBudgetCPU":7076793,"exBudgetMemory":14456,"scriptSizeBytes":175} -PTriplet.derived.false {"exBudgetCPU":7571938,"exBudgetMemory":15658,"scriptSizeBytes":175} -PTriplet.pmatch.true.eq {"exBudgetCPU":9201542,"exBudgetMemory":18949,"scriptSizeBytes":158} -PTriplet.pmatch.true.less {"exBudgetCPU":6915430,"exBudgetMemory":15054,"scriptSizeBytes":163} -PTriplet.pmatch.false {"exBudgetCPU":7589213,"exBudgetMemory":16856,"scriptSizeBytes":163} -PTriplet.pmatch-pdatarecord.true.eq {"exBudgetCPU":3026481,"exBudgetMemory":6294,"scriptSizeBytes":171} -PTriplet.pmatch-pdatarecord.true.less {"exBudgetCPU":8512707,"exBudgetMemory":16448,"scriptSizeBytes":183} -PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":9007852,"exBudgetMemory":17650,"scriptSizeBytes":183} \ No newline at end of file +PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":4722912,"exBudgetMemory":10462,"scriptSizeBytes":164} +PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":3617224,"exBudgetMemory":8496,"scriptSizeBytes":172} +PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3617224,"exBudgetMemory":8496,"scriptSizeBytes":172} +PTriplet.derived.true.eq {"exBudgetCPU":1501248,"exBudgetMemory":4002,"scriptSizeBytes":161} +PTriplet.derived.true.less {"exBudgetCPU":6987474,"exBudgetMemory":14156,"scriptSizeBytes":173} +PTriplet.derived.false {"exBudgetCPU":7482619,"exBudgetMemory":15358,"scriptSizeBytes":173} +PTriplet.pmatch.true.eq {"exBudgetCPU":9022904,"exBudgetMemory":18349,"scriptSizeBytes":155} +PTriplet.pmatch.true.less {"exBudgetCPU":6736792,"exBudgetMemory":14454,"scriptSizeBytes":161} +PTriplet.pmatch.false {"exBudgetCPU":7410575,"exBudgetMemory":16256,"scriptSizeBytes":161} +PTriplet.pmatch-pdatarecord.true.eq {"exBudgetCPU":2937162,"exBudgetMemory":5994,"scriptSizeBytes":169} +PTriplet.pmatch-pdatarecord.true.less {"exBudgetCPU":8423388,"exBudgetMemory":16148,"scriptSizeBytes":181} +PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":8918533,"exBudgetMemory":17350,"scriptSizeBytes":181} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.uplc.golden b/plutarch-test/goldens/pisdata.lte.uplc.golden index 6b271da34..80df3bd16 100644 --- a/plutarch-test/goldens/pisdata.lte.uplc.golden +++ b/plutarch-test/goldens/pisdata.lte.uplc.golden @@ -1,18 +1,18 @@ -PCredential.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i5 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i5))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) -PCredential.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i6 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i6))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d87a9f4141ff) #d8799f40ff)) -PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i6 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i6))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff) #d87a9f4141ff)) +PCredential.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i5 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i5))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i6 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i6))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d87a9f4141ff) #d8799f40ff)) +PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i6 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i6))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff) #d87a9f4141ff)) PCredential.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))))) (i5 i2)) (i5 i1)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) PCredential.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) -PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay False) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i10 i2)) (i10 i1)) (unConstrData i10))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay True) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i10 i2)) (i10 i1)) (unConstrData i10))))) (i7 i2)) (i7 i1)) (unConstrData i7)) (\i0 -> \i0 -> i3 i2 i4 i1)) (force ifThenElse)) (delay True)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) -PCredential.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay False) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i11 i2)) (i11 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay True) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i11 i2)) (i11 i1)) (unConstrData i8))))) (i8 i2)) (i8 i1)) (unConstrData #d8799f40ff)) (\i0 -> \i0 -> i3 i2 i4 i1)) (force ifThenElse)) (delay True)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) -PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay False) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i11 i2)) (i11 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay True) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))))) (i11 i2)) (i11 i1)) (unConstrData i8))))) (i8 i2)) (i8 i1)) (unConstrData #d87a9f4141ff)) (\i0 -> \i0 -> i3 i2 i4 i1)) (force ifThenElse)) (delay True)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) -PTriplet.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i6 i6) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6))))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010305ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010203ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010305ff)) -PTriplet.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 i12)) (i8 i1)) (i8 i10)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> \i0 -> i5 i2 i3 i1)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -PTriplet.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData (listData (i4 i6)) (listData (i4 i6))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6))))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData (listData (i5 i7)) (listData (i5 i4))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010305ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i3 i2 (delay True) i1) (equalsData (listData (i5 i7)) (listData (i5 i4))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010203ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010305ff)) \ No newline at end of file +PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay True))) (i10 i2)) (i10 i1)) (unConstrData i10))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay False))) (i10 i2)) (i10 i1)) (unConstrData i10))))) (i7 i2)) (i7 i1)) (unConstrData i7)) (\i0 -> i2 i1 i3)) (force ifThenElse)) (delay True)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay True))) (i11 i2)) (i11 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay False))) (i11 i2)) (i11 i1)) (unConstrData i8))))) (i8 i2)) (i8 i1)) (unConstrData #d8799f40ff)) (\i0 -> i2 i1 i3)) (force ifThenElse)) (delay True)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay True))) (i11 i2)) (i11 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay False))) (i11 i2)) (i11 i1)) (unConstrData i8))))) (i8 i2)) (i8 i1)) (unConstrData #d87a9f4141ff)) (\i0 -> i2 i1 i3)) (force ifThenElse)) (delay True)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PTriplet.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i6 i6) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6))))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010305ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010203ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010305ff)) +PTriplet.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 i12)) (i8 i1)) (i8 i10)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData (listData (i4 i6)) (listData (i4 i6))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6))))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData (listData (i5 i7)) (listData (i5 i4))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010305ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData (listData (i5 i7)) (listData (i5 i4))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010203ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010305ff)) \ No newline at end of file From c8bf117155277926743b448a2948afc827e94486 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 17 Mar 2022 20:45:38 +0530 Subject: [PATCH 212/584] Single field `PDataRecord` optimization --- Plutarch/DataRepr/Internal.hs | 6 +++++- plutarch-test/goldens/pisdata.lte.bench.golden | 6 +++--- plutarch-test/goldens/pisdata.lte.uplc.golden | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 183063b58..6b9116d81 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -140,7 +140,11 @@ instance (POrd x, PIsData x) => POrd (PDataRecord '[label ':= x]) where PDCons y _ <- tcont $ pmatch l2 pure $ pfromData x #< pfromData y - l1 #<= l2 = pdToBuiltin l1 #== pdToBuiltin l1 #|| l1 #< l2 + l1 #<= l2 = unTermCont $ do + PDCons x _ <- tcont $ pmatch l1 + PDCons y _ <- tcont $ pmatch l2 + + pure $ pfromData x #<= pfromData y instance (POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord ((label ':= x) ': x' ': xs)) where l1 #< l2 = unTermCont $ do diff --git a/plutarch-test/goldens/pisdata.lte.bench.golden b/plutarch-test/goldens/pisdata.lte.bench.golden index 5df1ba073..88186b0d6 100644 --- a/plutarch-test/goldens/pisdata.lte.bench.golden +++ b/plutarch-test/goldens/pisdata.lte.bench.golden @@ -4,9 +4,9 @@ PCredential.derived.false {"exBudgetCPU":3659090,"exBudgetMemory":8634,"scriptSi PCredential.pmatch.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} PCredential.pmatch.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":4722912,"exBudgetMemory":10462,"scriptSizeBytes":164} -PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":3617224,"exBudgetMemory":8496,"scriptSizeBytes":172} -PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3617224,"exBudgetMemory":8496,"scriptSizeBytes":172} +PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} +PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PTriplet.derived.true.eq {"exBudgetCPU":1501248,"exBudgetMemory":4002,"scriptSizeBytes":161} PTriplet.derived.true.less {"exBudgetCPU":6987474,"exBudgetMemory":14156,"scriptSizeBytes":173} PTriplet.derived.false {"exBudgetCPU":7482619,"exBudgetMemory":15358,"scriptSizeBytes":173} diff --git a/plutarch-test/goldens/pisdata.lte.uplc.golden b/plutarch-test/goldens/pisdata.lte.uplc.golden index 80df3bd16..a8bb83acd 100644 --- a/plutarch-test/goldens/pisdata.lte.uplc.golden +++ b/plutarch-test/goldens/pisdata.lte.uplc.golden @@ -4,9 +4,9 @@ PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 - PCredential.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))))) (i5 i2)) (i5 i1)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) PCredential.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) -PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay True))) (i10 i2)) (i10 i1)) (unConstrData i10))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay False))) (i10 i2)) (i10 i1)) (unConstrData i10))))) (i7 i2)) (i7 i1)) (unConstrData i7)) (\i0 -> i2 i1 i3)) (force ifThenElse)) (delay True)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) -PCredential.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay True))) (i11 i2)) (i11 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay False))) (i11 i2)) (i11 i1)) (unConstrData i8))))) (i8 i2)) (i8 i1)) (unConstrData #d8799f40ff)) (\i0 -> i2 i1 i3)) (force ifThenElse)) (delay True)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) -PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 0 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay True))) (i11 i2)) (i11 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay (force (i7 (equalsData (listData i4) (listData i4)) (delay (lessThanByteString (unBData (i10 i4)) (unBData (i10 i1))))))) (delay False))) (i11 i2)) (i11 i1)) (unConstrData i8))))) (i8 i2)) (i8 i1)) (unConstrData #d87a9f4141ff)) (\i0 -> i2 i1 i3)) (force ifThenElse)) (delay True)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))))) (i5 i2)) (i5 i1)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) PTriplet.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i6 i6) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6))))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) PTriplet.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010305ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010203ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010305ff)) From f7b501d943c740a6f915c6cf58c45e1bdaeb5b18 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Thu, 17 Mar 2022 16:56:57 +0100 Subject: [PATCH 213/584] wip: add class to make try from derivable for PIsDataRepr --- Plutarch/DataRepr/Internal.hs | 2 +- Plutarch/TryFrom.hs | 57 ++++++++++++++++++++--- plutarch-test/src/Plutarch/TryFromSpec.hs | 18 +++---- 3 files changed, 60 insertions(+), 17 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index cf025a6f2..f04f08eec 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -171,7 +171,7 @@ type family PDataRecordFields2 as where type family PLabelIndex (name :: Symbol) (as :: [PLabeledType]) :: Nat where PLabelIndex name ((name ':= a) ': as) = 0 - PLabelIndex name (_' : as) = (PLabelIndex name as) + 1 + PLabelIndex name (_ ': as) = (PLabelIndex name as) + 1 type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (name ':= a) = a diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 9f2615a71..524b99c9a 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -1,16 +1,18 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE DefaultSignatures #-} module Plutarch.TryFrom ( - PTryFrom (PTryFromExcess, ptryFrom), - hsing, - getExcessField, - HRecP (HSNil, HSCons), - RecKind (HNil, HCons), + PTryFrom (..), + PTryFromData (..), + HRecP (..), + RecKind (..), + Flip (..), HSing, HSSing, - Flip (MkFlip, unFlip), + hsing, + getExcessField, ) where import Data.Proxy (Proxy (Proxy)) @@ -42,6 +44,7 @@ import Plutarch.Internal.Other ( PType, S, Term, + PInner, perror, plam, plet, @@ -65,12 +68,14 @@ import Plutarch.List ( ptail, ) -import Plutarch.Unsafe (punsafeCoerce) +import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) import GHC.Records (HasField (getField)) import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) +import Plutarch.DataRepr.Internal (PIsDataReprInstances, PIsDataRepr (PIsDataReprRepr)) + ----------------------- The class PTryFrom ---------------------------------------------- {- | @@ -399,6 +404,44 @@ instance ver' <- snd <$> TermCont (ptryFrom @a @b (pfromData opq)) pure $ (punsafeCoerce opq, ver') +----------------------- PIsDataReprInstances -------------------------------------------- + +class PTryFromData s b where + type PTryFromDataExcess b :: PType + type PTryFromDataExcess b = PTryFromExcess PData b + ptryFromData :: Term s PData -> ((Term s b, PTryFromDataExcess b s) -> Term s r) -> Term s r + {- + default ptryFromData :: + ( PTryFromExcess PData b s ~ PTryFromDataExcess b s + , PTryFrom PData b s + ) => + Term s PData -> ((Term s b, PTryFromDataExcess b s) -> Term s r) -> Term s r + ptryFromData = ptryFrom @PData @b + +deriving anyclass instance (PTryFrom PData b s) => PTryFromData s b +-} + +instance + ( PTryFrom PData (PAsData (PIsDataReprInstances a)) s + ) => + PTryFromData s (PAsData (PIsDataReprInstances a)) where + ptryFromData = ptryFrom + +instance + ( PIsDataRepr a + , SumValidation 0 (PIsDataReprRepr a) s + , PInner a b ~ PDataSum (PIsDataReprRepr a) + ) => + PTryFrom PData (PAsData (PIsDataReprInstances a)) s + where + type PTryFromExcess PData (PAsData (PIsDataReprInstances a)) = HRecP 'HNil + ptryFrom opq = runTermCont $ do + let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) + reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) + pure $ (pdata $ punsafeFrom reprsum, HSNil) + +-- TODO: add overlapping instance for single constructor types that has actual excess + ----------------------- HasField instance ----------------------------------------------- instance (MaybeUnFlip ptyp s out, ElemOf name ptyp rec) => HasField name (HRecP rec s) out where diff --git a/plutarch-test/src/Plutarch/TryFromSpec.hs b/plutarch-test/src/Plutarch/TryFromSpec.hs index ab30d846b..16f3c7b17 100644 --- a/plutarch-test/src/Plutarch/TryFromSpec.hs +++ b/plutarch-test/src/Plutarch/TryFromSpec.hs @@ -2,11 +2,14 @@ {-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -ddump-deriv #-} module Plutarch.TryFromSpec (spec) where import Test.Syd +import Data.Kind (Constraint) + import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) @@ -62,6 +65,7 @@ import Plutarch.Prelude import Plutarch.TryFrom ( HSSing, PTryFrom (PTryFromExcess, ptryFrom), + PTryFromData (ptryFromData), hsing, ) @@ -490,17 +494,11 @@ sampleAB = pdata $ pcon $ PA (pdcons @"_0" # (pdata $ pconstant 4) #$ pdcons # ( sampleABdata :: Term s PData sampleABdata = pforgetData sampleAB -{- -recoverAB :: Term s PAB +recoverAB :: Term s (PAsData PAB) recoverAB = unTermCont $ do - (ter, exc) <- TermCont (ptryFrom sampleABdata) - pure exc.unwrapped - -} + (ter , _) <- TermCont (ptryFromData sampleABdata) + pure ter -recoverAB :: Term s PAB -recoverAB = unTermCont $ do - exc <- TermCont (ptryFrom sampleABdata) - pure $ fst exc data PAB (s :: S) = PA (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PByteString])) @@ -510,3 +508,5 @@ data PAB (s :: S) deriving (PlutusType, PIsData) via PIsDataReprInstances PAB + +deriving via PAsData (PIsDataReprInstances PAB) instance PTryFromData s (PAsData PAB) From a72213ca4f6679bff8b68b36fc5ed481b27dd093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 17 Mar 2022 12:36:41 -0400 Subject: [PATCH 214/584] Moved FFISpec out of sytest-discover domain and made it conditional --- plutarch-test/Main.hs | 11 +++++++++++ .../Plutarch/FFISpec.hs | 0 plutarch-test/plutarch-test.cabal | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) rename plutarch-test/{plutarch-base => conditional}/Plutarch/FFISpec.hs (100%) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index a946e9271..2f9f9704e 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -1,7 +1,13 @@ +{-# LANGUAGE CPP #-} module Main (main) where import qualified BaseSpec import qualified ExtraSpec + +#if !MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +import qualified Plutarch.FFISpec as FFISpec +#endif + import GHC.IO.Encoding (setLocaleEncoding, utf8) import Test.Syd (sydTest) @@ -11,3 +17,8 @@ main = do sydTest BaseSpec.spec putStrLn "\n\n\n--------------------------------------------\n\n\n" sydTest ExtraSpec.spec + +#if !MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + putStrLn "\n\n\n--------------------------------------------\n\n\n" + sydTest FFISpec.spec +#endif diff --git a/plutarch-test/plutarch-base/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/FFISpec.hs rename to plutarch-test/conditional/Plutarch/FFISpec.hs diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 8c1db796c..c4c3a6e9e 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -108,7 +108,7 @@ library executable plutarch-test import: c, deps main-is: Main.hs - hs-source-dirs: plutarch-base plutarch-extra common ./. + hs-source-dirs: plutarch-base plutarch-extra common conditional ./. build-depends: , base16-bytestring , cborg From 2da442151be4164c99a81de1e9340a251a01fdb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 17 Mar 2022 12:53:16 -0400 Subject: [PATCH 215/584] RecSpec works for GHC 8.10 --- flake.nix | 1 - plutarch-test/plutarch-test.cabal | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index c05e90ee8..d31743e21 100644 --- a/flake.nix +++ b/flake.nix @@ -482,7 +482,6 @@ chmod -R u+w $out/plutarch-test rm -f $out/plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs rm -f $out/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs - rm -f $out/plutarch-test/plutarch-base/Plutarch/RecSpec.hs ''; compiler-nix-name = ghcName; extraSources = diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index c4c3a6e9e..cd1774101 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -127,7 +127,6 @@ executable plutarch-test other-modules: Plutarch.FieldSpec Plutarch.MonadicSpec - Plutarch.RecSpec other-modules: BaseSpec @@ -146,6 +145,7 @@ executable plutarch-test Plutarch.PLamSpec Plutarch.PlutusTypeSpec Plutarch.RationalSpec + Plutarch.RecSpec Plutarch.RecursionSpec Plutarch.ScriptsSpec Plutarch.ShowSpec From 99f5a4d06985dbcb57c2f785e96d246cfac2121d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 17 Mar 2022 13:12:12 -0400 Subject: [PATCH 216/584] plutarch-test: remove deprecated code --- plutarch-test/common/Plutarch/Test.hs | 97 +-------------------------- 1 file changed, 1 insertion(+), 96 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index cdb137eab..67e9a9099 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -29,36 +29,20 @@ module Plutarch.Test ( -- * Benchmark type for use in `(@:->)` Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), ScriptSizeBytes, - - -- * Deprecated exports - golden, - goldens, - PlutarchGolden (All, Bench, PrintTerm), - getGoldenFilePrefix, - goldenFilePath, ) where -import Control.Monad (when) -import qualified Data.Aeson.Text as Aeson import Data.Kind (Type) import Data.Text (Text) -import qualified Data.Text as T -import qualified Data.Text.Lazy as TL -import System.FilePath import Test.Syd ( Expectation, - Spec, TestDefM, describe, expectationFailure, - getTestDescriptionPath, - it, - pureGoldenTextFile, shouldBe, shouldSatisfyNamed, ) -import Plutarch +import Plutarch (ClosedTerm, PCon (pcon), compile, printScript) import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evalScript) import Plutarch.Test.Benchmark ( @@ -68,7 +52,6 @@ import Plutarch.Test.Benchmark ( import Plutarch.Test.Golden ( PlutarchGoldens, TermExpectation, - compileD, evalScriptAlwaysWithBenchmark, pgoldenSpec, (@->), @@ -188,81 +171,3 @@ plutarchDevFlagDescribe m = xScript = fst . evalScriptAlwaysWithBenchmark $ compile x infixr 1 @== - --- TODO: All the code below will be deleted, in favour of Golden.hs. - -{- | Whether to run all or a particular golden test - - Typically you want to use `All` -- this produces printTerm and benchmark - goldens. - - Occasionally you want `PrintTerm` because you don't care to benchmark that - program. - - Use `Bench` to only benchmark the program. --} -data PlutarchGolden - = All - | Bench - | PrintTerm - deriving stock (Eq, Show) - --- | Run golden tests on the given Plutarch program -{-# DEPRECATED golden "Use `pgoldenSpec` instead." #-} -golden :: PlutarchGolden -> ClosedTerm a -> Spec -golden pg p = - goldens pg [("0", popaque p)] - -{- | Like `golden` but for multiple programs - - Multiple programs use a single golden file. Each output separated from the - keyword with a space. --} -{-# DEPRECATED goldens "Use `pgoldenSpec` instead." #-} -goldens :: PlutarchGolden -> [(String, ClosedTerm a)] -> Spec -goldens pg ps = do - name <- getGoldenFilePrefix - describe "golden" $ do - -- Golden test for UPLC - when (hasPrintTermGolden pg) $ do - it "uplc" $ - pureGoldenTextFile (goldenFilePath "goldens" name "uplc") $ - multiGolden ps $ \p -> - T.pack $ printScript $ compileD p - it "uplc.eval" $ - pureGoldenTextFile (goldenFilePath "goldens" name "uplc.eval") $ - multiGolden ps $ \p -> - T.pack $ printScript $ fst $ evalScriptAlwaysWithBenchmark $ compileD p - -- Golden test for Plutus benchmarks - when (hasBenchGolden pg) $ - it "bench" $ - pureGoldenTextFile (goldenFilePath "goldens" name "bench") $ - multiGolden ps $ \p -> - TL.toStrict $ Aeson.encodeToLazyText $ snd $ evalScriptAlwaysWithBenchmark $ compileD p - where - hasBenchGolden :: PlutarchGolden -> Bool - hasBenchGolden = \case - PrintTerm -> False - _ -> True - hasPrintTermGolden :: PlutarchGolden -> Bool - hasPrintTermGolden = \case - Bench -> False - _ -> True - --- | Get a golden filename prefix from the test description path -getGoldenFilePrefix :: - forall (outers :: [Type]) (inner :: Type). - TestDefM outers inner String -getGoldenFilePrefix = - T.unpack . T.intercalate "." . drop 1 . reverse <$> getTestDescriptionPath - --- | Get the golden file name given the basepath, an optional suffix and a name -goldenFilePath :: FilePath -> String -> String -> FilePath -goldenFilePath base name suffix = - base - (name <> "." <> suffix <> ".golden") - -multiGolden :: forall a. [(String, a)] -> (a -> T.Text) -> Text -multiGolden xs f = - T.intercalate "\n" $ - (\(s, x) -> T.pack s <> " " <> f x) <$> xs From 4d03f1148d947fc0ebb40590f998d12d9b753ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 17 Mar 2022 13:22:28 -0400 Subject: [PATCH 217/584] Removed half the hack --- flake.nix | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index d31743e21..9cd05611a 100644 --- a/flake.nix +++ b/flake.nix @@ -466,14 +466,7 @@ # This is truly a horrible hack but is necessary for sydtest-discover to work. src = if ghcName == ghcVersion - then - pkgs.runCommand "fake-src" { } '' - # Prevent `sydtest-discover` from using GHC810 only modules when building with GHC9 - # https://github.com/NorfairKing/sydtest/blob/master/sydtest-discover/src/Test/Syd/Discover.hs - cp -rT ${./.} $out - chmod -R u+w $out/plutarch-test - rm -f $out/plutarch-test/plutarch-base/Plutarch/FFISpec.hs - '' + then ./. else pkgs.runCommand "fake-src" { } '' # Prevent `sydtest-discover` from using GHC9 only modules when building with GHC810 From 0a4cf64c925e9941daf34ec3e79f421d4f4d4e98 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 17 Mar 2022 13:37:14 -0400 Subject: [PATCH 218/584] Rewrite ScriptsSpec.hs golden stub to use Plutarch.Test.Golden --- plutarch-test/common/Plutarch/Test/Golden.hs | 8 ++++++++ plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs | 13 +++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 9960e77b5..f908d8264 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -1,6 +1,7 @@ {-# LANGUAGE ImpredicativeTypes #-} module Plutarch.Test.Golden ( + -- * DSL pgoldenSpec, (@|), (@\), @@ -8,7 +9,14 @@ module Plutarch.Test.Golden ( (@:->), TermExpectation, PlutarchGoldens, + + -- * Golden key + GoldenKey, + currentGoldenKey, goldenKeyString, + goldenPath, + + -- * Evaluation evalScriptAlwaysWithBenchmark, compileD, ) where diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 4c519272b..b5d6e53dd 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -45,6 +45,7 @@ import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude import Plutarch.Test +import Plutarch.Test.Golden (currentGoldenKey, goldenPath) import Test.Syd (Spec, describe, it, pureGoldenTextFile) spec :: Spec @@ -52,24 +53,24 @@ spec = do describe "scripts" $ do describe "auth_validator" $ do pgoldenSpec $ "0" @| authValidatorTerm - prefix <- getGoldenFilePrefix + prefix <- currentGoldenKey it "hash" $ do pureGoldenTextFile - (goldenFilePath "goldens" prefix "hash") + (goldenPath "goldens" $ prefix <> "hash") validatorHashEncoded describe "auth_policy" $ do pgoldenSpec $ "0" @| authPolicyTerm - prefix <- getGoldenFilePrefix + prefix <- currentGoldenKey it "hash" $ pureGoldenTextFile - (goldenFilePath "goldens" prefix "hash") + (goldenPath "goldens" $ prefix <> "hash") policySymEncoded describe "auth_stake_validator" $ do pgoldenSpec $ "0" @| authStakeValidatorTerm - prefix <- getGoldenFilePrefix + prefix <- currentGoldenKey it "hash" $ pureGoldenTextFile - (goldenFilePath "goldens" prefix "hash") + (goldenPath "goldens" $ prefix <> "hash") stakeValidatorHashEncoded encodeSerialise :: Serialise a => a -> Text From 6fb564ed1b4e64e320fecd59985bed4e87be6e4c Mon Sep 17 00:00:00 2001 From: mangoiv Date: Thu, 17 Mar 2022 18:42:59 +0100 Subject: [PATCH 219/584] fix: tidy upstream list functions - removed deprecations - restructured tests - cleaned up goldens - adjusted to project structure - "cleaned up git history" --- CHANGELOG.md | 3 + Plutarch/List.hs | 34 ++- Plutarch/Prelude.hs | 2 + Plutarch/Rational.hs | 2 - flake.lock | 6 +- flake.nix | 6 +- plutarch-extra/Plutarch/ListUtils.hs | 21 ++ plutarch-extra/plutarch-extra.cabal | 4 +- .../common/Plutarch/Test/Property/Gen.hs | 54 ++++ .../common/Plutarch/Test/Property/Util.hs | 286 ++++++++++++++++++ .../extra.listutils.goldens.bench.golden | 4 + .../extra.listutils.goldens.uplc.eval.golden | 4 + .../extra.listutils.goldens.uplc.golden | 4 + plutarch-test/goldens/list.bench.bench.golden | 5 - .../goldens/list.bench.uplc.eval.golden | 5 - plutarch-test/goldens/list.bench.uplc.golden | 5 - plutarch-test/goldens/list.fun.bench.golden | 18 -- .../goldens/list.fun.uplc.eval.golden | 18 -- plutarch-test/goldens/list.fun.uplc.golden | 18 -- .../goldens/list.goldens.bench.golden | 20 ++ .../goldens/list.goldens.uplc.eval.golden | 20 ++ .../goldens/list.goldens.uplc.golden | 20 ++ .../list.pconcat.identity.bench.golden | 1 + .../list.pconcat.identity.uplc.eval.golden | 1 + .../goldens/list.pconcat.identity.uplc.golden | 1 + .../goldens/list.pfilter.bench.golden | 2 + .../goldens/list.pfilter.uplc.eval.golden | 2 + .../goldens/list.pfilter.uplc.golden | 2 + .../goldens/list.pfoldl.bench.golden | 4 + .../goldens/list.pfoldl.uplc.eval.golden | 4 + plutarch-test/goldens/list.pfoldl.uplc.golden | 4 + plutarch-test/goldens/list.phead.bench.golden | 1 + .../goldens/list.phead.uplc.eval.golden | 1 + plutarch-test/goldens/list.phead.uplc.golden | 1 + plutarch-test/goldens/list.pmap.bench.golden | 1 + .../goldens/list.pmap.uplc.eval.golden | 1 + plutarch-test/goldens/list.pmap.uplc.golden | 1 + .../goldens/list.pmatch.uplc.eval.golden | 1 + plutarch-test/goldens/list.pmatch.uplc.golden | 1 + plutarch-test/goldens/list.pnull.bench.golden | 2 + .../goldens/list.pnull.uplc.eval.golden | 2 + plutarch-test/goldens/list.pnull.uplc.golden | 2 + .../goldens/list.property.elemAt.bench.golden | 3 + .../list.property.elemAt.uplc.eval.golden | 3 + .../goldens/list.property.elemAt.uplc.golden | 3 + .../goldens/list.property.find.bench.golden | 2 + .../list.property.find.uplc.eval.golden | 2 + .../goldens/list.property.find.uplc.golden | 2 + .../list.property.reverse.bench.golden | 2 + .../list.property.reverse.uplc.eval.golden | 2 + .../goldens/list.property.reverse.uplc.golden | 2 + plutarch-test/goldens/list.ptail.bench.golden | 1 + .../goldens/list.ptail.uplc.eval.golden | 1 + plutarch-test/goldens/list.ptail.uplc.golden | 1 + .../goldens/list.pzipWith.bench.golden | 1 + .../goldens/list.pzipWith.uplc.eval.golden | 1 + .../goldens/list.pzipWith.uplc.golden | 1 + plutarch-test/goldens/list.type.bench.golden | 3 - .../goldens/list.type.uplc.eval.golden | 3 - plutarch-test/goldens/list.type.uplc.golden | 3 - .../plutarch-base/Plutarch/ListSpec.hs | 148 ++++----- .../plutarch-extra/Plutarch/HelloSpec.hs | 8 - .../plutarch-extra/Plutarch/ListUtilSpec.hs | 36 +++ plutarch-test/plutarch-test.cabal | 7 +- 64 files changed, 649 insertions(+), 180 deletions(-) create mode 100644 plutarch-extra/Plutarch/ListUtils.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property/Gen.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property/Util.hs create mode 100644 plutarch-test/goldens/extra.listutils.goldens.bench.golden create mode 100644 plutarch-test/goldens/extra.listutils.goldens.uplc.eval.golden create mode 100644 plutarch-test/goldens/extra.listutils.goldens.uplc.golden delete mode 100644 plutarch-test/goldens/list.bench.bench.golden delete mode 100644 plutarch-test/goldens/list.bench.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.bench.uplc.golden delete mode 100644 plutarch-test/goldens/list.fun.bench.golden delete mode 100644 plutarch-test/goldens/list.fun.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.fun.uplc.golden create mode 100644 plutarch-test/goldens/list.goldens.bench.golden create mode 100644 plutarch-test/goldens/list.goldens.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.goldens.uplc.golden create mode 100644 plutarch-test/goldens/list.pconcat.identity.bench.golden create mode 100644 plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.pconcat.identity.uplc.golden create mode 100644 plutarch-test/goldens/list.pfilter.bench.golden create mode 100644 plutarch-test/goldens/list.pfilter.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.pfilter.uplc.golden create mode 100644 plutarch-test/goldens/list.pfoldl.bench.golden create mode 100644 plutarch-test/goldens/list.pfoldl.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.pfoldl.uplc.golden create mode 100644 plutarch-test/goldens/list.phead.bench.golden create mode 100644 plutarch-test/goldens/list.phead.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.phead.uplc.golden create mode 100644 plutarch-test/goldens/list.pmap.bench.golden create mode 100644 plutarch-test/goldens/list.pmap.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.pmap.uplc.golden create mode 100644 plutarch-test/goldens/list.pmatch.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.pmatch.uplc.golden create mode 100644 plutarch-test/goldens/list.pnull.bench.golden create mode 100644 plutarch-test/goldens/list.pnull.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.pnull.uplc.golden create mode 100644 plutarch-test/goldens/list.property.elemAt.bench.golden create mode 100644 plutarch-test/goldens/list.property.elemAt.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.property.elemAt.uplc.golden create mode 100644 plutarch-test/goldens/list.property.find.bench.golden create mode 100644 plutarch-test/goldens/list.property.find.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.property.find.uplc.golden create mode 100644 plutarch-test/goldens/list.property.reverse.bench.golden create mode 100644 plutarch-test/goldens/list.property.reverse.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.property.reverse.uplc.golden create mode 100644 plutarch-test/goldens/list.ptail.bench.golden create mode 100644 plutarch-test/goldens/list.ptail.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.ptail.uplc.golden create mode 100644 plutarch-test/goldens/list.pzipWith.bench.golden create mode 100644 plutarch-test/goldens/list.pzipWith.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.pzipWith.uplc.golden delete mode 100644 plutarch-test/goldens/list.type.bench.golden delete mode 100644 plutarch-test/goldens/list.type.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.type.uplc.golden delete mode 100644 plutarch-test/plutarch-extra/Plutarch/HelloSpec.hs create mode 100644 plutarch-test/plutarch-extra/Plutarch/ListUtilSpec.hs diff --git a/CHANGELOG.md b/CHANGELOG.md index 61fcda3e1..752d748a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ - Add generic deriving for `PEq` Started by [#335](https://github.com/Plutonomicon/plutarch/pull/335) +- `Plutarch.Prelude` and `Plutarch.List` now export pfind, pelemAt, preverse and pcheckSroted. + + Started by: [#306](https://github.com/Plutonomicon/plutarch/pull/306) - `TermCont`: Parametrize by result type; add `MonadFail` instance; etc. diff --git a/Plutarch/List.hs b/Plutarch/List.hs index 977540017..ea471920b 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -14,6 +14,8 @@ module Plutarch.List ( plength, ptryIndex, pdrop, + pfind, + pelemAt, -- * Construction psingleton, @@ -68,7 +70,7 @@ import Plutarch ( (#$), type (:-->), ) -import Plutarch.Bool (PBool (PFalse, PTrue), PEq, pif, (#&&), (#==), (#||)) +import Plutarch.Bool (PBool (PFalse, PTrue), PEq, pif, (#&&), (#<), (#==), (#||)) import Plutarch.Integer (PInteger) import Plutarch.Lift (pconstant) import Plutarch.Maybe (PMaybe (PJust, PNothing)) @@ -77,6 +79,7 @@ import Plutarch.String (PString) import Data.Kind import Plutarch.Show (PShow (pshow'), pshow) +import Plutarch.Trace (ptraceError) data PList (a :: PType) (s :: S) = PSCons (Term s a) (Term s (PList a)) @@ -410,3 +413,32 @@ plistEquals = ) (pelimList (\_ _ -> pconstant False) (pconstant True) ylist) xlist + +pelemAt :: (PIsListLike l a) => Term s (PInteger :--> l a :--> a) +pelemAt = phoistAcyclic $ + plam $ \n xs -> + pif + (n #< 0) + (ptraceError "pelemAt: negative index") + (pelemAt' # n # xs) + +pelemAt' :: (PIsListLike l a) => Term s (PInteger :--> l a :--> a) +pelemAt' = phoistAcyclic $ + pfix #$ plam $ \self n xs -> + pif + (n #== 0) + (phead # xs) + (self # (n - 1) #$ ptail # xs) + +pfind :: (PIsListLike l a) => Term s ((a :--> PBool) :--> l a :--> PMaybe a) +pfind = phoistAcyclic $ + pfix #$ plam $ \self f xs -> + pelimList + ( \y ys -> + pif + (f # y) + (pcon $ PJust y) + (self # f # ys) + ) + (pcon PNothing) + xs diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index fe53408fa..8893b6257 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -64,6 +64,7 @@ module Plutarch.Prelude ( PIsListLike, plistEquals, pelem, + pelemAt, plength, ptryIndex, pdrop, @@ -74,6 +75,7 @@ module Plutarch.Prelude ( pzip, pmap, pfilter, + pfind, precList, pfoldr, pfoldrLazy, diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 4935ee7d8..88d6cd891 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -252,8 +252,6 @@ pround = phoistAcyclic $ (pif (rem #< pdiv # b # 2) 0 1) ) --- (pdiv # b # 2 + pmod # b # 2 #<= pmod # a # b) 1 0 - ptruncate :: Term s (PRational :--> PInteger) ptruncate = phoistAcyclic $ plam $ \x -> diff --git a/flake.lock b/flake.lock index 5ba2ad14d..8079a093c 100644 --- a/flake.lock +++ b/flake.lock @@ -975,11 +975,11 @@ "sydtest": { "flake": false, "locked": { - "lastModified": 1644358460, - "narHash": "sha256-1ZxTLL5YVxktyHqfMywwsNGx5nxNMPXnq33QI6BcvUI=", + "lastModified": 1645114028, + "narHash": "sha256-P6ZwwfFeN8fpi3fziz9yERTn7BfxdE/j/OofUu+4GdA=", "owner": "srid", "repo": "sydtest", - "rev": "5b572105c30f79c5e20637c6af4eedf39e0ac85a", + "rev": "9c6c7678f7aabe22e075aab810a6a2e304591d24", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 6fdbd6777..da69a9382 100644 --- a/flake.nix +++ b/flake.nix @@ -124,6 +124,7 @@ "sydtest" "sydtest-discover" "sydtest-aeson" + "sydtest-hedgehog" ]; } { @@ -510,6 +511,7 @@ # sydtest dependencies ps.sydtest ps.sydtest-discover + ps.sydtest-hedgehog ps.sydtest-aeson ps.validity ps.validity-aeson @@ -606,7 +608,7 @@ # Take a flake app (identified as the key in the 'apps' set), and return a # derivation that runs it in the compile phase. - # + # # In effect, this allows us to run an 'app' as part of the build process (eg: in CI). flakeApp2Derivation = system: appName: (nixpkgsFor system).runCommand appName { } "${self.apps.${system}.${appName}.program} | tee $out"; @@ -647,7 +649,7 @@ "ghc810-plutarch:lib:plutarch" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch:lib:plutarch"; "ghc810-plutarch:lib:plutarch-test" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch-test:lib:plutarch-test"; }); - # Because `nix flake check` does not work with haskell.nix (due to IFD), + # Because `nix flake check` does not work with haskell.nix (due to IFD), # we provide this attribute for running the checks locally, using: # nix build .#check.x86_64-linux check = perSystem (system: diff --git a/plutarch-extra/Plutarch/ListUtils.hs b/plutarch-extra/Plutarch/ListUtils.hs new file mode 100644 index 000000000..b0d10eacb --- /dev/null +++ b/plutarch-extra/Plutarch/ListUtils.hs @@ -0,0 +1,21 @@ +module Plutarch.ListUtils (preverse, pcheckSorted) where + +import Plutarch.Prelude + +preverse :: (PIsListLike l a) => Term s (l a :--> l a) +preverse = + phoistAcyclic $ + pfoldl # plam (\ys y -> pcons # y # ys) # pnil + +pcheckSorted :: (PIsListLike l a, POrd a) => Term s (l a :--> PBool) +pcheckSorted = + pfix #$ plam $ \self xs -> + pelimList + ( \x1 xs -> + pelimList + (\x2 _ -> x1 #<= x2 #&& (self # xs)) + (pcon PTrue) + xs + ) + (pcon PTrue) + xs diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index f14051c82..52da78ed4 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -73,6 +73,8 @@ common deps library import: c, deps - exposed-modules: Plutarch.Extra + exposed-modules: + Plutarch.Extra + Plutarch.ListUtils -- other-modules: diff --git a/plutarch-test/common/Plutarch/Test/Property/Gen.hs b/plutarch-test/common/Plutarch/Test/Property/Gen.hs new file mode 100644 index 000000000..1b30b464a --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property/Gen.hs @@ -0,0 +1,54 @@ +module Plutarch.Test.Property.Gen ( + rationalGen, + integerGen, + genList, + genNonEmpty, + genMaybe, + genPair, + genPair', + genPosInt, + genPosRat, + genPerm, +) where + +import Control.Monad (MonadPlus, join, liftM2, mfilter) +import Data.List (sortOn) +import Data.Ratio ((%)) + +import Hedgehog (MonadGen) + +import qualified Hedgehog.Gen as Gen +import qualified Hedgehog.Range as Range + +integerGen :: MonadGen g => g Integer +integerGen = Gen.integral (Range.linear (-1_000_000_000) 1_000_000_000) + +rationalGen :: (MonadPlus g, MonadGen g) => g Rational +rationalGen = liftM2 (%) integerGen (mfilter (/= 0) integerGen) + +genList :: MonadGen g => g a -> g [a] +genList = Gen.list (Range.linear 0 100) + +genNonEmpty :: MonadGen g => g a -> g [a] +genNonEmpty = Gen.list (Range.linear 1 100) + +genMaybe :: MonadGen g => g a -> g (Maybe a) +genMaybe g = Gen.choice [pure Nothing, Just <$> g] + +genPair :: MonadGen g => g a -> g b -> g (a, b) +genPair = liftM2 (,) + +genPair' :: MonadGen g => g a -> g (a, a) +genPair' = join genPair + +genPosInt :: MonadGen g => g Integer +genPosInt = Gen.integral (Range.linear 1 1_000_000_000) + +genPosRat :: MonadGen g => g Rational +genPosRat = liftM2 (%) genPosInt genPosInt + +genPerm :: MonadGen g => [a] -> g [a] +genPerm xs = do + vs <- Gen.list (Range.singleton $ length xs) integerGen + let xs' = map snd $ sortOn fst $ zip vs xs + return xs' diff --git a/plutarch-test/common/Plutarch/Test/Property/Util.hs b/plutarch-test/common/Plutarch/Test/Property/Util.hs new file mode 100644 index 000000000..d36dfb16a --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property/Util.hs @@ -0,0 +1,286 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.Test.Property.Util ( + Marshal (marshal), + NotLambda, + haskPlutEquiv, + leftInverse, + viaData, + viaPEq, + viaBoth, + viaPEqPartial, + viaDataPartial, + viaBothPartial, + testDataEq, + testPEq, + run, +) where + +import Plutarch.Prelude + +import Plutarch (ClosedTerm, compile) + +import Plutarch.Evaluate (EvalError, evalScript) + +import Control.Exception (SomeException, evaluate, try) +import Control.Monad.IO.Class (liftIO) +import Data.Proxy (Proxy (Proxy)) +import Data.Text (Text) + +import Plutus.V1.Ledger.Scripts (Script (..)) +import PlutusCore.Evaluation.Machine.ExBudget (ExBudget) + +import Hedgehog (Gen, Property, PropertyT, annotate, annotateShow, assert, forAll, property, (===)) + +class Marshal h (p :: PType) | h -> p where + marshal :: h -> ClosedTerm p + +data EquivalenceMethod + = -- test equivalence by converting to data with pdata + -- and then comparing the Script output in haskell + ViaPData + | -- test equivalence inside plutarch with + -- #== using the type's PEq instance + ViaPEq + | -- Partial modifies an EquivalenceMethod + -- to allow testing partial functions + -- if the haskell fails but the plutarch succeds + -- or vice versa the test will fail + -- but if both fail or both succed and agree + -- up to the modified EquivalenceMethod + -- the test will pass + Partial EquivalenceMethod + | -- And runs the same test with two + -- equivalence methods and fails + -- if either test fails + And EquivalenceMethod EquivalenceMethod + +-- The 'ed classes use tupples like (a,(b,c,())) which are more convenient to abstract over +-- the un'ed classes use regular tuples like (a,b,c) which are more convenient to use + +class GensForArgs' h ~ args => HaskellPlutarchEquivalence' (e :: EquivalenceMethod) h (p :: PType) args | h -> p where + runTest' :: Proxy e -> h -> ClosedTerm p -> args -> PropertyT IO () + +class GensForArgs h ~ args => HaskellPlutarchEquivalence (e :: EquivalenceMethod) h (p :: PType) args | h -> p where + runTest :: Proxy e -> h -> ClosedTerm p -> AsTuple (GensForArgs' h) -> PropertyT IO () + +{- + - e is the EquivalenceMethod indicating which sort of equivalence to use + - ha is the haskell level type while pa is analogous PType + + - when h is a function args contains the generators for it's arguments + - the first few instances start args as () + - then the last instance in this block add generators to the left with tuples + - when ha is + - pa , (pb :--> pa) , (pc :--> pb :--> pa) , (pd :--> pc :--> pb :--> pa) + - args is + - () , (Gen hb,()) , (Gen hc,(Gen hb,())) , (Gen hd,(Gen hc,(Gen hb,()))) ... + -} + +instance (PIsData p, Marshal h p, NotLambda h) => HaskellPlutarchEquivalence' 'ViaPData h p () where + runTest' Proxy ht pt () = testDataEq (marshal ht) pt + +instance (PEq p, Marshal h p, NotLambda h) => HaskellPlutarchEquivalence' 'ViaPEq h p () where + runTest' Proxy ht pt () = testPEq (marshal ht) pt + +instance + HaskellPlutarchEquivalence' e h p () => + HaskellPlutarchEquivalence' ( 'Partial e) h p () + where + runTest' Proxy ht pt () = testPartial baseTest ht pt + where + baseTest :: h -> ClosedTerm p -> PropertyT IO () + baseTest h p = runTest' (Proxy :: Proxy e) h p () + +instance + ( HaskellPlutarchEquivalence' l h p () + , HaskellPlutarchEquivalence' r h p () + ) => + HaskellPlutarchEquivalence' ( 'And l r) h p () + where + runTest' Proxy h p () = do + runTest' (Proxy :: Proxy l) h p () + runTest' (Proxy :: Proxy r) h p () + +instance + ( Show ha + , Marshal ha pa + , HaskellPlutarchEquivalence' e hb pb args + ) => + HaskellPlutarchEquivalence' e (ha -> hb) (pa :--> pb) (Gen ha, args) + where + runTest' e hf pf (g, args) = do + x <- forAll g + runTest' e (hf x) (pf # marshal x) args + +{- + - the next instance moves from the 'ed to the un'ed class + - to provide less cluttered options for args + - when ha is + - pa , (bp :--> pa) , (pc :--> pb :--> pa) , (pd :--> pc :--> pb :--> pa) ... + - args is now + - () , Gen hb , (Gen hc,Gen hb) , (Gen hd,Gen hc,Gen hb) ... + - if we encounter higher arity functions + - it would be easy enough to add + - instances for clean tuples for them too + -} + +instance + ( HaskellPlutarchEquivalence' e h p args' + , AsTuple args' ~ args + , IsTuple args' + ) => + HaskellPlutarchEquivalence e h p args + where + runTest e hf pf args = runTest' e hf pf $ fromTuple args + +{- + - the functions haskPlutEquiv and the proxies viaData viaBoth etc + - are exposed in the module (runtest and the HaskellPlutarchEquivalence class are not) + - and are the intended way to indicate which sort + - of test to use and to run haskell agreement tests in general +-} + +haskPlutEquiv :: + HaskellPlutarchEquivalence e h p args => + Proxy (e :: EquivalenceMethod) -> + h -> + ClosedTerm p -> + args -> + Property +haskPlutEquiv proxy h p args = property $ runTest proxy h p args + +leftInverse :: + forall h e p p'. + HaskellPlutarchEquivalence e (h -> h) (p :--> p) (Gen h) => + Proxy (e :: EquivalenceMethod) -> + ClosedTerm (p' :--> p) -> + ClosedTerm (p :--> p') -> + Gen h -> + Property +leftInverse proxy l r = + haskPlutEquiv proxy (id :: h -> h) (plam $ \x -> l #$ r # x) + +viaData :: Proxy 'ViaPData +viaData = Proxy + +viaPEq :: Proxy 'ViaPEq +viaPEq = Proxy + +viaBoth :: Proxy ( 'And 'ViaPEq 'ViaPData) +viaBoth = Proxy + +viaPEqPartial :: Proxy ( 'Partial 'ViaPEq) +viaPEqPartial = Proxy + +viaDataPartial :: Proxy ( 'Partial 'ViaPData) +viaDataPartial = Proxy + +viaBothPartial :: Proxy ( 'Partial ( 'And 'ViaPEq 'ViaPData)) +viaBothPartial = Proxy + +testDataEq :: PIsData a => ClosedTerm a -> ClosedTerm a -> PropertyT IO () +testDataEq x y = testOutputEq (pdata x) (pdata y) + +testPartial :: (h -> ClosedTerm p -> PropertyT IO ()) -> h -> ClosedTerm p -> PropertyT IO () +testPartial baseTest h p = + liftIO (try $ evaluate h) >>= \case + Left (_ :: SomeException) -> + case run p of + (Left _, _, _) -> assert True + (Right _, _, _) -> do + annotate "plutarch didn't fail but haskell did" + assert False + Right _ -> baseTest h p + +testPEq :: PEq a => ClosedTerm a -> ClosedTerm a -> PropertyT IO () +testPEq x y = + case (run x, run y) of + ((Right (Script x'), _, _), (Right (Script y'), _, _)) -> do + annotateShow x' + annotateShow y' + testOutputEq (pcon PTrue) (x #== y) + _ -> assert False + +-- testing equality of Scott encoded types +-- this way is generally prone to false errors +-- hence this function not being directly exposed +testOutputEq :: ClosedTerm ha -> ClosedTerm ha -> PropertyT IO () +testOutputEq x y = + case (run x, run y) of + ((Right lb, _, la), (Right rb, _, ra)) -> do + annotateShow la + annotateShow ra + annotateShow $ unScript lb + annotateShow $ unScript rb + la === ra + lb === rb + _ -> assert False + +run :: ClosedTerm h -> (Either EvalError Script, ExBudget, [Text]) +run t = evalScript $ compile t + +instance Marshal h p => Marshal [h] (PList p) where + marshal xs = foldr (\h t -> pcons # marshal h # t) pnil xs + +instance Marshal ha pa => Marshal (Maybe ha) (PMaybe pa) where + marshal (Just x) = pcon $ PJust $ marshal x + marshal Nothing = pcon PNothing + +instance (Marshal ha pa, Marshal hb pb) => Marshal (ha, hb) (PPair pa pb) where + marshal (a, b) = pcon $ PPair (marshal a) (marshal b) + +instance Marshal Integer PInteger where + marshal n = fromInteger n + +instance Marshal Rational PRational where + marshal r = fromRational r + +instance Marshal Bool PBool where + marshal True = pcon PTrue + marshal False = pcon PFalse + +instance Marshal () PUnit where + marshal () = pcon PUnit + +-- GensForArgs f is the tuple of generators for the arguments of F +-- i.e. GensForArgs (a -> b -> c) ~ (Gen a,Gen b) +type family GensForArgs f :: Type where + GensForArgs f = AsTuple (GensForArgs' f) + +-- GensForArgs is the same as GenArgsFor except it uses tuples like (Gen a,(Gen b,())) +type family GensForArgs' f :: Type where + GensForArgs' (a -> b) = (Gen a, GensForArgs' b) + GensForArgs' h = () + +class IsTuple t where + type AsTuple t + fromTuple :: AsTuple t -> t + +instance IsTuple (a, ()) where + type AsTuple (a, ()) = a + fromTuple a = (a, ()) + +instance IsTuple (a, (b, ())) where + type AsTuple (a, (b, ())) = (a, b) + fromTuple (a, b) = (a, fromTuple b) + +instance IsTuple (a, (b, (c, ()))) where + type AsTuple (a, (b, (c, ()))) = (a, b, c) + fromTuple (a, b, c) = (a, fromTuple (b, c)) + +instance IsTuple (a, (b, (c, (d, ())))) where + type AsTuple (a, (b, (c, (d, ())))) = (a, b, c, d) + fromTuple (a, b, c, d) = (a, fromTuple (b, c, d)) + +instance IsTuple (a, (b, (c, (d, (e, ()))))) where + type AsTuple (a, (b, (c, (d, (e, ()))))) = (a, b, c, d, e) + fromTuple (a, b, c, d, e) = (a, fromTuple (b, c, d, e)) + +instance IsTuple (a, (b, (c, (d, (e, (f, ())))))) where + type AsTuple (a, (b, (c, (d, (e, (f, ())))))) = (a, b, c, d, e, f) + fromTuple (a, b, c, d, e, f) = (a, fromTuple (b, c, d, e, f)) + +type NotLambda a = GensForArgs' a ~ () diff --git a/plutarch-test/goldens/extra.listutils.goldens.bench.golden b/plutarch-test/goldens/extra.listutils.goldens.bench.golden new file mode 100644 index 000000000..b4d4dfe2c --- /dev/null +++ b/plutarch-test/goldens/extra.listutils.goldens.bench.golden @@ -0,0 +1,4 @@ +reverse.reverse_[1..5] {"exBudgetCPU":7592215,"exBudgetMemory":25600,"scriptSizeBytes":87} +isSorted.[1..10] {"exBudgetCPU":18915730,"exBudgetMemory":59218,"scriptSizeBytes":115} +isSorted.reverse_[1..10] {"exBudgetCPU":4106553,"exBudgetMemory":13403,"scriptSizeBytes":128} +isSorted.reverse_[] {"exBudgetCPU":803971,"exBudgetMemory":2800,"scriptSizeBytes":56} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.listutils.goldens.uplc.eval.golden b/plutarch-test/goldens/extra.listutils.goldens.uplc.eval.golden new file mode 100644 index 000000000..f33a1f36b --- /dev/null +++ b/plutarch-test/goldens/extra.listutils.goldens.uplc.eval.golden @@ -0,0 +1,4 @@ +reverse.reverse_[1..5] (program 1.0.0 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 1 (\i0 -> \i0 -> force i1))))))) +isSorted.[1..10] (program 1.0.0 True) +isSorted.reverse_[1..10] (program 1.0.0 True) +isSorted.reverse_[] (program 1.0.0 (\i0 -> \i0 -> force i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.listutils.goldens.uplc.golden b/plutarch-test/goldens/extra.listutils.goldens.uplc.golden new file mode 100644 index 000000000..555d6dd46 --- /dev/null +++ b/plutarch-test/goldens/extra.listutils.goldens.uplc.golden @@ -0,0 +1,4 @@ +reverse.reverse_[1..5] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> i3 i1 i2) (\i0 -> \i0 -> force i1) (i1 1 (i1 2 (i1 3 (i1 4 (i1 5 (\i0 -> \i0 -> force i1))))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +isSorted.[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (lessThanEqualsInteger i4 i2) (delay (i6 i3)))) (delay True)) (delay True)) (i1 1 (i1 2 (i1 3 (i1 4 (i1 5 (i1 6 (i1 7 (i1 8 (i1 9 (i1 10 (\i0 -> \i0 -> force i1)))))))))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +isSorted.reverse_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i2 i1 (delay False) (delay True))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (lessThanEqualsInteger i4 i2) (delay (i6 i3)))) (delay True)) (delay True)) (i2 10 (i2 9 (i2 8 (i2 7 (i2 6 (i2 5 (i2 4 (i2 3 (i2 2 (i2 1 (\i0 -> \i0 -> force i1))))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +isSorted.reverse_[] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i3 i4) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> force i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.bench.bench.golden b/plutarch-test/goldens/list.bench.bench.golden deleted file mode 100644 index 6115fae29..000000000 --- a/plutarch-test/goldens/list.bench.bench.golden +++ /dev/null @@ -1,5 +0,0 @@ -x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} -x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} -uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} -uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} -uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.bench.uplc.eval.golden b/plutarch-test/goldens/list.bench.uplc.eval.golden deleted file mode 100644 index 20730efd7..000000000 --- a/plutarch-test/goldens/list.bench.uplc.eval.golden +++ /dev/null @@ -1,5 +0,0 @@ -x1+x2.builtin (program 1.0.0 3) -x1+x2.pmatch (program 1.0.0 3) -uncons.ChooseList (program 1.0.0 [2,3,4,5]) -uncons.head-and-tail (program 1.0.0 [2,3,4,5]) -uncons.head-and-tail-and-null (program 1.0.0 [2,3,4,5]) \ No newline at end of file diff --git a/plutarch-test/goldens/list.bench.uplc.golden b/plutarch-test/goldens/list.bench.uplc.golden deleted file mode 100644 index 8b2e1c0aa..000000000 --- a/plutarch-test/goldens/list.bench.uplc.golden +++ /dev/null @@ -1,5 +0,0 @@ -x1+x2.builtin (program 1.0.0 ((\i0 -> (\i0 -> addInteger (i1 (force tailList i2)) (i1 i2)) (force headList)) [1,2,3,4,5])) -x1+x2.pmatch (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i1 i3 (delay error) (delay ((\i0 -> force (i2 i1 (delay error) (delay (addInteger (i3 i4) (i3 i1))))) (force tailList i3))))) (force (force chooseList))) (force headList)) [1,2,3,4,5])) -uncons.ChooseList (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay error) (delay (force tailList i1)))) [1,2,3,4,5])) -uncons.head-and-tail (program 1.0.0 ((\i0 -> (\i0 -> force tailList i2) (force headList i1)) [1,2,3,4,5])) -uncons.head-and-tail-and-null (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse i1 (delay error) (delay ((\i0 -> force tailList i3) (force headList i2))))) (force nullList i1)) [1,2,3,4,5])) \ No newline at end of file diff --git a/plutarch-test/goldens/list.fun.bench.golden b/plutarch-test/goldens/list.fun.bench.golden deleted file mode 100644 index 4449d5a2b..000000000 --- a/plutarch-test/goldens/list.fun.bench.golden +++ /dev/null @@ -1,18 +0,0 @@ -pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -pnull.nonempty {"exBudgetCPU":16261571,"exBudgetMemory":40093,"scriptSizeBytes":85} -pconcat.identity {"exBudgetCPU":2054437,"exBudgetMemory":7000,"scriptSizeBytes":64} -plength {"exBudgetCPU":27522836,"exBudgetMemory":71312,"scriptSizeBytes":95} -pelem {"exBudgetCPU":21833687,"exBudgetMemory":56502,"scriptSizeBytes":97} -pall {"exBudgetCPU":16886804,"exBudgetMemory":42193,"scriptSizeBytes":100} -plistEquals.true {"exBudgetCPU":46644574,"exBudgetMemory":122904,"scriptSizeBytes":126} -plistEquals.false {"exBudgetCPU":25469562,"exBudgetMemory":64918,"scriptSizeBytes":128} -plistEquals.empty {"exBudgetCPU":16381797,"exBudgetMemory":40024,"scriptSizeBytes":125} -pmap.eg {"exBudgetCPU":29309216,"exBudgetMemory":77312,"scriptSizeBytes":99} -pmap.identity {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":54} -pfilter.1 {"exBudgetCPU":35949366,"exBudgetMemory":87322,"scriptSizeBytes":115} -pfilter.2 {"exBudgetCPU":30925386,"exBudgetMemory":83312,"scriptSizeBytes":110} -pzipWith {"exBudgetCPU":46106600,"exBudgetMemory":119104,"scriptSizeBytes":120} -pfoldl.primed.nonempty {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -pfoldl.primed.empty {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} -pfoldl.primed.nonempty {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -pfoldl.primed.empty {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} \ No newline at end of file diff --git a/plutarch-test/goldens/list.fun.uplc.eval.golden b/plutarch-test/goldens/list.fun.uplc.eval.golden deleted file mode 100644 index 9f48bf982..000000000 --- a/plutarch-test/goldens/list.fun.uplc.eval.golden +++ /dev/null @@ -1,18 +0,0 @@ -pnull.empty (program 1.0.0 True) -pnull.nonempty (program 1.0.0 True) -pconcat.identity (program 1.0.0 (\i0 -> \i0 -> i2 0 (\i0 -> \i0 -> force i1))) -plength (program 1.0.0 10) -pelem (program 1.0.0 True) -pall (program 1.0.0 False) -plistEquals.true (program 1.0.0 True) -plistEquals.false (program 1.0.0 False) -plistEquals.empty (program 1.0.0 False) -pmap.eg (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) -pmap.identity (program 1.0.0 (\i0 -> \i0 -> force i1)) -pfilter.1 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) -pfilter.2 (program 1.0.0 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) -pzipWith (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) -pfoldl.primed.nonempty (program 1.0.0 -55) -pfoldl.primed.empty (program 1.0.0 0) -pfoldl.primed.nonempty (program 1.0.0 -55) -pfoldl.primed.empty (program 1.0.0 0) \ No newline at end of file diff --git a/plutarch-test/goldens/list.fun.uplc.golden b/plutarch-test/goldens/list.fun.uplc.golden deleted file mode 100644 index 3013d33f4..000000000 --- a/plutarch-test/goldens/list.fun.uplc.golden +++ /dev/null @@ -1,18 +0,0 @@ -pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) -pnull.nonempty (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) -pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 i2 (i4 i1)) (delay i3)) i2) ((\i0 -> i2 i1 (\i0 -> \i0 -> force i1)) 0) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -plength (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> addInteger (i5 i1 i3) 1) (delay i1)) i1 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pelem (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i2 i5) (delay True) (delay (i4 i1)))) (delay False))) 5 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pall (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i5 i2) (delay (i4 i1)))) (delay True))) (\i0 -> False) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -plistEquals.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) -plistEquals.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [1,2,3,4,5,6,7,8,9,10]) (i1 [1,2,3])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -plistEquals.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [1,2,3,4,5,6,7,8,9,10]) (i1 [])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -pmap.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1))) -pfilter.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -pfilter.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -pzipWith (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i11 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) -pfoldl.primed.nonempty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.primed.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.primed.nonempty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.primed.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.bench.golden b/plutarch-test/goldens/list.goldens.bench.golden new file mode 100644 index 000000000..d448bc420 --- /dev/null +++ b/plutarch-test/goldens/list.goldens.bench.golden @@ -0,0 +1,20 @@ +pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} +phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} +ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} +pnull.nonempty {"exBudgetCPU":16261571,"exBudgetMemory":40093,"scriptSizeBytes":85} +pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} +pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} +pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} +pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} +pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} +pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} +pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} +pfoldl.nonempty0 {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.nonempty1 {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.empty0 {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +pfoldl.empty1 {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +elemAt.elemAt_3_[1..10] {"exBudgetCPU":8885733,"exBudgetMemory":25516,"scriptSizeBytes":138} +elemAt.elemAt_0_[1..10] {"exBudgetCPU":4039782,"exBudgetMemory":12604,"scriptSizeBytes":138} +elemAt.elemAt_9_[1..10] {"exBudgetCPU":18577635,"exBudgetMemory":51340,"scriptSizeBytes":138} +find.find_(==3)_[1..4] {"exBudgetCPU":5088068,"exBudgetMemory":15806,"scriptSizeBytes":89} +find.find_(==5)_[1..4] {"exBudgetCPU":7190955,"exBudgetMemory":22408,"scriptSizeBytes":89} \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.uplc.eval.golden b/plutarch-test/goldens/list.goldens.uplc.eval.golden new file mode 100644 index 000000000..3ca4a85d6 --- /dev/null +++ b/plutarch-test/goldens/list.goldens.uplc.eval.golden @@ -0,0 +1,20 @@ +pmatch (program 1.0.0 error) +phead (program 1.0.0 True) +ptail (program 1.0.0 True) +pnull.nonempty (program 1.0.0 True) +pnull.empty (program 1.0.0 True) +pconcat.identity (program 1.0.0 True) +pmap.eg (program 1.0.0 True) +pmap.identity (program 1.0.0 True) +pfilter.evens (program 1.0.0 True) +pfilter.gt5 (program 1.0.0 True) +pzipWith.double (program 1.0.0 True) +pfoldl.nonempty0 (program 1.0.0 True) +pfoldl.nonempty1 (program 1.0.0 True) +pfoldl.empty0 (program 1.0.0 True) +pfoldl.empty1 (program 1.0.0 True) +elemAt.elemAt_3_[1..10] (program 1.0.0 4) +elemAt.elemAt_0_[1..10] (program 1.0.0 1) +elemAt.elemAt_9_[1..10] (program 1.0.0 10) +find.find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) +find.find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.uplc.golden b/plutarch-test/goldens/list.goldens.uplc.golden new file mode 100644 index 000000000..c251d7ee7 --- /dev/null +++ b/plutarch-test/goldens/list.goldens.uplc.golden @@ -0,0 +1,20 @@ +pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) +phead (program 1.0.0 (equalsInteger 1 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +ptail (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [2,3,4,5,6,7,8,9,10]) ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (i1 [1,2,3,4,5,6,7,8,9,10]))) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pnull.nonempty (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) +pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i4 i2 i1 (delay False)) (i1 (i3 (i4 i10) (\i0 -> \i0 -> force i1)) (i3 (\i0 -> \i0 -> force i1) (i4 i10))) (delay (i1 (i3 (\i0 -> \i0 -> force i1) (i4 i10)) (i4 i10))))) (i4 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))))) (force ifThenElse)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i10 i2 (i4 i1)) (delay i3)) i2)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) +pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i3 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i9 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 [1,2,3,4,5,6,7,8,9,10])) (i1 [2,4,6,8,10,12,14,16,18,20])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pmap.identity (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> force i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfilter.evens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [2,4,6,8,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfilter.gt5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [6,7,8,9,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pzipWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i2 i1) (i2 i1)) (i2 [2,4,6,8,10,12,14,16,18,20])) [1,2,3,4,5,6,7,8,9,10]) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfoldl.nonempty0 (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.nonempty1 (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty0 (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty1 (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +elemAt.elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +elemAt.elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +find.find_(==3)_[1..4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 1 (i1 2 (i1 3 (i1 4 (\i0 -> \i0 -> force i1)))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +find.find_(==5)_[1..4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 1 (i1 2 (i1 3 (i1 4 (\i0 -> \i0 -> force i1)))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.bench.golden b/plutarch-test/goldens/list.pconcat.identity.bench.golden new file mode 100644 index 000000000..520fbab6c --- /dev/null +++ b/plutarch-test/goldens/list.pconcat.identity.bench.golden @@ -0,0 +1 @@ +0 {"exBudgetCPU":2054437,"exBudgetMemory":7000,"scriptSizeBytes":64} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden b/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden new file mode 100644 index 000000000..a6fe1ca52 --- /dev/null +++ b/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden @@ -0,0 +1 @@ +0 (program 1.0.0 (\i0 -> \i0 -> i2 0 (\i0 -> \i0 -> force i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.uplc.golden b/plutarch-test/goldens/list.pconcat.identity.uplc.golden new file mode 100644 index 000000000..c2c095d0d --- /dev/null +++ b/plutarch-test/goldens/list.pconcat.identity.uplc.golden @@ -0,0 +1 @@ +0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 i2 (i4 i1)) (delay i3)) i2) ((\i0 -> i2 i1 (\i0 -> \i0 -> force i1)) 0) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.bench.golden b/plutarch-test/goldens/list.pfilter.bench.golden new file mode 100644 index 000000000..fa1a61ba1 --- /dev/null +++ b/plutarch-test/goldens/list.pfilter.bench.golden @@ -0,0 +1,2 @@ +p1 {"exBudgetCPU":35949366,"exBudgetMemory":87322,"scriptSizeBytes":115} +p2 {"exBudgetCPU":30925386,"exBudgetMemory":83312,"scriptSizeBytes":110} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.uplc.eval.golden b/plutarch-test/goldens/list.pfilter.uplc.eval.golden new file mode 100644 index 000000000..6ae3f0591 --- /dev/null +++ b/plutarch-test/goldens/list.pfilter.uplc.eval.golden @@ -0,0 +1,2 @@ +p1 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) +p2 (program 1.0.0 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.uplc.golden b/plutarch-test/goldens/list.pfilter.uplc.golden new file mode 100644 index 000000000..091b0f066 --- /dev/null +++ b/plutarch-test/goldens/list.pfilter.uplc.golden @@ -0,0 +1,2 @@ +p1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +p2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.bench.golden b/plutarch-test/goldens/list.pfoldl.bench.golden new file mode 100644 index 000000000..5f2f40417 --- /dev/null +++ b/plutarch-test/goldens/list.pfoldl.bench.golden @@ -0,0 +1,4 @@ +p1 {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} +p1' {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} +p2 {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} +p2' {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.uplc.eval.golden b/plutarch-test/goldens/list.pfoldl.uplc.eval.golden new file mode 100644 index 000000000..934031787 --- /dev/null +++ b/plutarch-test/goldens/list.pfoldl.uplc.eval.golden @@ -0,0 +1,4 @@ +p1 (program 1.0.0 -55) +p1' (program 1.0.0 -55) +p2 (program 1.0.0 0) +p2' (program 1.0.0 0) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.uplc.golden b/plutarch-test/goldens/list.pfoldl.uplc.golden new file mode 100644 index 000000000..20449fe5f --- /dev/null +++ b/plutarch-test/goldens/list.pfoldl.uplc.golden @@ -0,0 +1,4 @@ +p1 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +p1' (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +p2 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +p2' (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.bench.golden b/plutarch-test/goldens/list.phead.bench.golden new file mode 100644 index 000000000..df2056587 --- /dev/null +++ b/plutarch-test/goldens/list.phead.bench.golden @@ -0,0 +1 @@ +0 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.uplc.eval.golden b/plutarch-test/goldens/list.phead.uplc.eval.golden new file mode 100644 index 000000000..bfe2c27c9 --- /dev/null +++ b/plutarch-test/goldens/list.phead.uplc.eval.golden @@ -0,0 +1 @@ +0 (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.uplc.golden b/plutarch-test/goldens/list.phead.uplc.golden new file mode 100644 index 000000000..5e1f40f29 --- /dev/null +++ b/plutarch-test/goldens/list.phead.uplc.golden @@ -0,0 +1 @@ +0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.bench.golden b/plutarch-test/goldens/list.pmap.bench.golden new file mode 100644 index 000000000..978a33629 --- /dev/null +++ b/plutarch-test/goldens/list.pmap.bench.golden @@ -0,0 +1 @@ +0 {"exBudgetCPU":29309216,"exBudgetMemory":77312,"scriptSizeBytes":99} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.uplc.eval.golden b/plutarch-test/goldens/list.pmap.uplc.eval.golden new file mode 100644 index 000000000..f5958794f --- /dev/null +++ b/plutarch-test/goldens/list.pmap.uplc.eval.golden @@ -0,0 +1 @@ +0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.uplc.golden b/plutarch-test/goldens/list.pmap.uplc.golden new file mode 100644 index 000000000..ad1169d66 --- /dev/null +++ b/plutarch-test/goldens/list.pmap.uplc.golden @@ -0,0 +1 @@ +0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmatch.uplc.eval.golden b/plutarch-test/goldens/list.pmatch.uplc.eval.golden new file mode 100644 index 000000000..046ef4db8 --- /dev/null +++ b/plutarch-test/goldens/list.pmatch.uplc.eval.golden @@ -0,0 +1 @@ +0 (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmatch.uplc.golden b/plutarch-test/goldens/list.pmatch.uplc.golden new file mode 100644 index 000000000..7c74576bf --- /dev/null +++ b/plutarch-test/goldens/list.pmatch.uplc.golden @@ -0,0 +1 @@ +0 (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.bench.golden b/plutarch-test/goldens/list.pnull.bench.golden new file mode 100644 index 000000000..b1909ab24 --- /dev/null +++ b/plutarch-test/goldens/list.pnull.bench.golden @@ -0,0 +1,2 @@ +p0 {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} +p1 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.uplc.eval.golden b/plutarch-test/goldens/list.pnull.uplc.eval.golden new file mode 100644 index 000000000..13f0e5ad0 --- /dev/null +++ b/plutarch-test/goldens/list.pnull.uplc.eval.golden @@ -0,0 +1,2 @@ +p0 (program 1.0.0 True) +p1 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.uplc.golden b/plutarch-test/goldens/list.pnull.uplc.golden new file mode 100644 index 000000000..a685f05af --- /dev/null +++ b/plutarch-test/goldens/list.pnull.uplc.golden @@ -0,0 +1,2 @@ +p0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) +p1 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.elemAt.bench.golden b/plutarch-test/goldens/list.property.elemAt.bench.golden new file mode 100644 index 000000000..e0f185c98 --- /dev/null +++ b/plutarch-test/goldens/list.property.elemAt.bench.golden @@ -0,0 +1,3 @@ +elemAt_3_[1..10] {"exBudgetCPU":8885733,"exBudgetMemory":25516,"scriptSizeBytes":138} +elemAt_0_[1..10] {"exBudgetCPU":4039782,"exBudgetMemory":12604,"scriptSizeBytes":138} +elemAt_9_[1..10] {"exBudgetCPU":18577635,"exBudgetMemory":51340,"scriptSizeBytes":138} \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.elemAt.uplc.eval.golden b/plutarch-test/goldens/list.property.elemAt.uplc.eval.golden new file mode 100644 index 000000000..a32910aaa --- /dev/null +++ b/plutarch-test/goldens/list.property.elemAt.uplc.eval.golden @@ -0,0 +1,3 @@ +elemAt_3_[1..10] (program 1.0.0 4) +elemAt_0_[1..10] (program 1.0.0 1) +elemAt_9_[1..10] (program 1.0.0 10) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.elemAt.uplc.golden b/plutarch-test/goldens/list.property.elemAt.uplc.golden new file mode 100644 index 000000000..bb9ef3be2 --- /dev/null +++ b/plutarch-test/goldens/list.property.elemAt.uplc.golden @@ -0,0 +1,3 @@ +elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.find.bench.golden b/plutarch-test/goldens/list.property.find.bench.golden new file mode 100644 index 000000000..2e8c316ce --- /dev/null +++ b/plutarch-test/goldens/list.property.find.bench.golden @@ -0,0 +1,2 @@ +find_(==3)_[1..4] {"exBudgetCPU":5088068,"exBudgetMemory":15806,"scriptSizeBytes":89} +find_(==5)_[1..4] {"exBudgetCPU":7190955,"exBudgetMemory":22408,"scriptSizeBytes":89} \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.find.uplc.eval.golden b/plutarch-test/goldens/list.property.find.uplc.eval.golden new file mode 100644 index 000000000..21aa624f7 --- /dev/null +++ b/plutarch-test/goldens/list.property.find.uplc.eval.golden @@ -0,0 +1,2 @@ +find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) +find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.find.uplc.golden b/plutarch-test/goldens/list.property.find.uplc.golden new file mode 100644 index 000000000..a6509aada --- /dev/null +++ b/plutarch-test/goldens/list.property.find.uplc.golden @@ -0,0 +1,2 @@ +find_(==3)_[1..4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 1 (i1 2 (i1 3 (i1 4 (\i0 -> \i0 -> force i1)))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +find_(==5)_[1..4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 1 (i1 2 (i1 3 (i1 4 (\i0 -> \i0 -> force i1)))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.reverse.bench.golden b/plutarch-test/goldens/list.property.reverse.bench.golden new file mode 100644 index 000000000..0c17e9093 --- /dev/null +++ b/plutarch-test/goldens/list.property.reverse.bench.golden @@ -0,0 +1,2 @@ +reverse_[1..5] {"exBudgetCPU":7681534,"exBudgetMemory":25900,"scriptSizeBytes":90} +reverse_[] {"exBudgetCPU":893290,"exBudgetMemory":3100,"scriptSizeBytes":59} \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.reverse.uplc.eval.golden b/plutarch-test/goldens/list.property.reverse.uplc.eval.golden new file mode 100644 index 000000000..02077b9d6 --- /dev/null +++ b/plutarch-test/goldens/list.property.reverse.uplc.eval.golden @@ -0,0 +1,2 @@ +reverse_[1..5] (program 1.0.0 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 1 (\i0 -> \i0 -> force i1))))))) +reverse_[] (program 1.0.0 (\i0 -> \i0 -> force i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.reverse.uplc.golden b/plutarch-test/goldens/list.property.reverse.uplc.golden new file mode 100644 index 000000000..ae1160ee8 --- /dev/null +++ b/plutarch-test/goldens/list.property.reverse.uplc.golden @@ -0,0 +1,2 @@ +reverse_[1..5] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> i4 i1 i2) (\i0 -> \i0 -> force i1) i1) (i1 1 (i1 2 (i1 3 (i1 4 (i1 5 (\i0 -> \i0 -> force i1))))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +reverse_[] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i3 i4) (\i0 -> \i0 -> force i1) i1) (\i0 -> \i0 -> force i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.bench.golden b/plutarch-test/goldens/list.ptail.bench.golden new file mode 100644 index 000000000..df2056587 --- /dev/null +++ b/plutarch-test/goldens/list.ptail.bench.golden @@ -0,0 +1 @@ +0 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.uplc.eval.golden b/plutarch-test/goldens/list.ptail.uplc.eval.golden new file mode 100644 index 000000000..1dbbd6e3c --- /dev/null +++ b/plutarch-test/goldens/list.ptail.uplc.eval.golden @@ -0,0 +1 @@ +0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.uplc.golden b/plutarch-test/goldens/list.ptail.uplc.golden new file mode 100644 index 000000000..0d8e97d35 --- /dev/null +++ b/plutarch-test/goldens/list.ptail.uplc.golden @@ -0,0 +1 @@ +0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.bench.golden b/plutarch-test/goldens/list.pzipWith.bench.golden new file mode 100644 index 000000000..7d51287d0 --- /dev/null +++ b/plutarch-test/goldens/list.pzipWith.bench.golden @@ -0,0 +1 @@ +0 {"exBudgetCPU":46106600,"exBudgetMemory":119104,"scriptSizeBytes":120} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.uplc.eval.golden b/plutarch-test/goldens/list.pzipWith.uplc.eval.golden new file mode 100644 index 000000000..f5958794f --- /dev/null +++ b/plutarch-test/goldens/list.pzipWith.uplc.eval.golden @@ -0,0 +1 @@ +0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.uplc.golden b/plutarch-test/goldens/list.pzipWith.uplc.golden new file mode 100644 index 000000000..d44aef59c --- /dev/null +++ b/plutarch-test/goldens/list.pzipWith.uplc.golden @@ -0,0 +1 @@ +0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i11 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) \ No newline at end of file diff --git a/plutarch-test/goldens/list.type.bench.golden b/plutarch-test/goldens/list.type.bench.golden deleted file mode 100644 index bd37603c4..000000000 --- a/plutarch-test/goldens/list.type.bench.golden +++ /dev/null @@ -1,3 +0,0 @@ -phead {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} -ptail {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} -pmatch {"exBudgetCPU":5579001,"exBudgetMemory":14120,"scriptSizeBytes":64} \ No newline at end of file diff --git a/plutarch-test/goldens/list.type.uplc.eval.golden b/plutarch-test/goldens/list.type.uplc.eval.golden deleted file mode 100644 index d56f978c6..000000000 --- a/plutarch-test/goldens/list.type.uplc.eval.golden +++ /dev/null @@ -1,3 +0,0 @@ -phead (program 1.0.0 1) -ptail (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))))))) -pmatch (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/list.type.uplc.golden b/plutarch-test/goldens/list.type.uplc.golden deleted file mode 100644 index 79e740165..000000000 --- a/plutarch-test/goldens/list.type.uplc.golden +++ /dev/null @@ -1,3 +0,0 @@ -phead (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) -ptail (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) -pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> i2) (delay error))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index 30149f4e3..a71631212 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -1,103 +1,83 @@ module Plutarch.ListSpec (spec, integerList) where import Test.Syd +import Test.Syd.Hedgehog () import Plutarch.List (pconvertLists, pfoldl') import Plutarch.Prelude import Plutarch.Test +import Hedgehog (Property) + +import Data.List (find) + +import Plutarch.Test.Property.Gen (genList, integerGen) +import Plutarch.Test.Property.Util (haskPlutEquiv, marshal, viaBothPartial, viaPEq) + +import qualified Hedgehog.Gen as Gen +import qualified Hedgehog.Range as Range + integerList :: [Integer] -> Term s (PList PInteger) integerList xs = pconvertLists #$ pconstant @(PBuiltinList PInteger) xs spec :: Spec spec = do describe "list" $ do - let xs10 :: Term _ (PList PInteger) - xs10 = integerList [1 .. 10] - describe "type" . pgoldenSpec $ do - "phead" @| phead # xs10 @== pconstant @PInteger 1 - "ptail" @| ptail # xs10 @== integerList [2 .. 10] - let matchP = pmatch (integerList [1, 3, 1]) $ \case - PSNil -> perror - PSCons x _ -> x - "pmatch" @| matchP @== pconstant @PInteger 1 - describe "fun" . pgoldenSpec $ do + describe "properties" $ do + describe "find" $ do + it "baseAgreement" $ findTest + describe "elemAt" $ do + it "base agreement" elemAtTest + describe "goldens" . pgoldenSpec $ do + let xs10 :: Term _ (PList PInteger) + xs10 = integerList [1 .. 10] + "pmatch" @| (pmatch (integerList [1, 3, 1]) $ \_ -> perror) @-> pfails + "phead" @| 1 #== (phead # xs10) @-> passert + "ptail" @| integerList [2 .. 10] #== ptail # xs10 @-> passert "pnull" @\ do - "empty" @| pnull # (integerList []) @-> passert - "nonempty" @| pnot # (pnull # xs10) @-> passert + "nonempty" @| (pnot #$ pnull # xs10) @-> passert + "empty" @| (pnull # integerList []) @-> passert "pconcat" @\ do - let xs :: Term s (PList PInteger) - xs = psingleton # (fromInteger @(Term _ PInteger) 0) - "identity" @| pconcat # xs # pnil @== xs - "plength" - @| plength # xs10 @== pconstant @PInteger 10 - "pelem" - @| pelem # 5 # xs10 @-> passert - "pall" - @| pall # plam (const $ pconstant @PBool False) # xs10 @-> passertNot - "plistEquals" @\ do - "true" @| plistEquals # xs10 # integerList [1 .. 10] @-> passert - "false" @| plistEquals # xs10 # integerList [1 .. 3] @-> passertNot - "empty" @| plistEquals # xs10 # integerList [] @-> passertNot + "identity" @| (pconcat # xs10 # pnil #== pconcat # pnil # xs10) #&& (pconcat # pnil # xs10 #== xs10) @-> passert "pmap" @\ do - "eg" @| pmap # (plam $ \x -> x + x) # xs10 - @== (integerList $ fmap (* 2) [1 .. 10]) - "identity" @| pmap @PList # (plam $ \(x :: Term _ PInteger) -> x) # pnil - @== pnil @PList + "eg" @| pmap # (plam $ \x -> x + x) # xs10 #== (integerList $ fmap (* 2) [1 .. 10]) @-> passert + "identity" @| pmap @PList # (plam $ \(x :: Term _ PInteger) -> x) # pnil #== pnil @-> passert "pfilter" @\ do - "1" @| pfilter # (plam $ \x -> pmod # x # 2 #== 0) # xs10 - @== integerList [2, 4, 6, 8, 10] - "2" @| pfilter # (plam $ \x -> 5 #< x) # xs10 - @== integerList [6 .. 10] - "pzipWith" @| pzipWith' (+) # xs10 # xs10 - @== (integerList (fmap (* 2) [1 .. 10])) + "evens" @| pfilter # (plam $ \x -> pmod # x # 2 #== 0) # xs10 #== integerList [2, 4, 6, 8, 10] @-> passert + "gt5" @| pfilter # (plam $ \x -> 5 #< x) # xs10 #== integerList [6 .. 10] @-> passert + "pzipWith" @\ do + "double" @| pzipWith' (+) # xs10 # xs10 #== integerList (fmap (* 2) [1 .. 10]) @-> passert "pfoldl" @\ do - "primed" @\ do - "nonempty" @| pfoldl' (-) # 0 # xs10 - @== pconstant @PInteger (foldl (-) 0 [1 .. 10]) - "empty" @| pfoldl' (-) # 0 # integerList [] - @== pconstant @PInteger 0 - "primed" @\ do - "nonempty" @| pfoldl # plam (-) # 0 # xs10 - @== pconstant @PInteger (foldl (-) 0 [1 .. 10]) - "empty" @| pfoldl # plam (-) # 0 # integerList [] - @== pconstant @PInteger 0 - -- Benchmarking different ways of using lists - describe "bench" . pgoldenSpec $ do - let numList = pconstant @(PBuiltinList PInteger) [1 .. 5] - -- Two ways of matching on a list - "x1+x2" @\ do - -- Via HeadList and TailList only. - "builtin" @| (phead #$ ptail # numList) + (phead # numList) - -- Via ChooseList (twice invoked) - "pmatch" - @| pmatch numList - $ \case - PNil -> perror - PCons x xs -> - pmatch xs $ \case - PNil -> perror - PCons y _ -> - x + y - -- Various ways of uncons'ing a list - "uncons" @\ do - -- ChooseList builtin, like uncons but fails on null lists - "ChooseList" - @| pmatch numList - $ \case - PNil -> perror - PCons _x xs -> - xs - -- Retrieving head and tail of a list - "head-and-tail" - @| plet (phead # numList) - $ \_x -> - ptail # numList - -- Retrieve head and tail using builtins, but fail on null lists. - "head-and-tail-and-null" - @| plet (pnull # numList) - $ \isEmpty -> - pmatch isEmpty $ \case - PTrue -> perror - PFalse -> plet (phead # numList) $ \_x -> - ptail # numList + "nonempty0" @| pfoldl # plam (-) # 0 # xs10 #== pconstant (foldl (-) 0 [1 .. 10]) @-> passert + "nonempty1" @| pfoldl' (-) # 0 # xs10 #== pconstant (foldl (-) 0 [1 .. 10]) @-> passert + "empty0" @| pfoldl # plam (-) # 0 # integerList [] #== pconstant 0 @-> passert + "empty1" @| pfoldl' (-) # 0 # integerList [] #== pconstant 0 @-> passert + "elemAt" @\ do + "elemAt_3_[1..10]" @| pelemAt # 3 # marshal [1 .. 10 :: Integer] + "elemAt_0_[1..10]" @| pelemAt # 0 # marshal [1 .. 10 :: Integer] + "elemAt_9_[1..10]" @| pelemAt # 9 # marshal [1 .. 10 :: Integer] + "find" @\ do + "find_(==3)_[1..4]" @| pfind # plam (#== 3) #$ marshal [1 .. 4 :: Integer] + "find_(==5)_[1..4]" @| pfind # plam (#== 5) #$ marshal [1 .. 4 :: Integer] + +findTest :: Property +findTest = + haskPlutEquiv + viaPEq + (find @[] @Integer even) + (pfind # peven) + (genList integerGen) + where + peven :: Term s (PInteger :--> PBool) + peven = plam $ \n -> pmod # n # 2 #== 0 + +elemAtTest :: Property +elemAtTest = + haskPlutEquiv + viaBothPartial + elemAt + pelemAt + (Gen.integral $ Range.linear (-10) 100, Gen.list (Range.linear 0 100) integerGen) + +elemAt :: Integer -> [Integer] -> Integer +elemAt n xs = xs !! fromInteger n diff --git a/plutarch-test/plutarch-extra/Plutarch/HelloSpec.hs b/plutarch-test/plutarch-extra/Plutarch/HelloSpec.hs deleted file mode 100644 index f14a9dae5..000000000 --- a/plutarch-test/plutarch-extra/Plutarch/HelloSpec.hs +++ /dev/null @@ -1,8 +0,0 @@ -module Plutarch.HelloSpec (spec) where - -import Test.Syd (Spec, describe, it) - -spec :: Spec -spec = - describe "Hello-Plutarch-Extra" $ - it "says Hello Plutarch Extra" $ putStrLn "Hello Plutarch Extra" diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilSpec.hs new file mode 100644 index 000000000..ce7b30a61 --- /dev/null +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilSpec.hs @@ -0,0 +1,36 @@ +module Plutarch.ListUtilSpec (spec) where + +import Test.Syd +import Test.Syd.Hedgehog () + +import Plutarch.Prelude +import Plutarch.Test + +import Hedgehog (Property) + +import Plutarch.Test.Property.Gen (genList, integerGen) +import Plutarch.Test.Property.Util (haskPlutEquiv, marshal, viaPEq) + +import Plutarch.ListUtils (pcheckSorted, preverse) + +spec :: Spec +spec = do + describe "extra.listutils" $ do + describe "properties" $ do + describe "reverse" $ do + it "base agreement" reverseTest + describe "goldens" . pgoldenSpec $ do + "reverse" @\ do + "reverse_[1..5]" @| preverse # marshal [1 .. 5 :: Integer] + "isSorted" @\ do + "[1..10]" @| pcheckSorted # marshal [1 .. 10 :: Integer] @-> passert + "reverse_[1..10]" @| (pnot #$ pcheckSorted #$ marshal $ reverse [1 .. 10 :: Integer]) @-> passert + "reverse_[]" @| preverse # marshal ([] :: [Integer]) + +reverseTest :: Property +reverseTest = + haskPlutEquiv + viaPEq + (reverse :: [Integer] -> [Integer]) + preverse + (genList integerGen) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 7f36f0197..0f5726490 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -34,6 +34,7 @@ common c FlexibleContexts FlexibleInstances ForeignFunctionInterface + FunctionalDependencies GADTSyntax GeneralisedNewtypeDeriving HexFloatLiterals @@ -78,6 +79,7 @@ common deps , bytestring , filepath , generics-sop + , hedgehog , mtl , plutarch , plutarch-extra @@ -87,6 +89,7 @@ common deps , serialise , sydtest , sydtest-discover + , sydtest-hedgehog , tasty , tasty-hunit , tasty-quickcheck @@ -129,10 +132,10 @@ executable plutarch-test Plutarch.BoolSpec Plutarch.ByteStringSpec Plutarch.EitherSpec - Plutarch.HelloSpec Plutarch.IntegerSpec Plutarch.LiftSpec Plutarch.ListSpec + Plutarch.ListUtilSpec Plutarch.MaybeSpec Plutarch.PairSpec Plutarch.PIsDataSpec @@ -147,6 +150,8 @@ executable plutarch-test Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax + Plutarch.Test.Property.Gen + Plutarch.Test.Property.Util Plutarch.TraceSpec Plutarch.UnitSpec Plutarch.UPLCSpec From ba9a62480c5ee5e5e642f8eadaed5d6899aa3d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 17 Mar 2022 13:58:19 -0400 Subject: [PATCH 220/584] Removed the rest of the hack --- flake.nix | 14 +------------- plutarch-test/Main.hs | 14 ++++++++++---- .../Plutarch/FieldSpec.hs | 0 .../Plutarch/MonadicSpec.hs | 0 ...dic.api.example.signatory.dev=true.bench.golden | 4 ++-- ...adic.api.example.signatory.dev=true.uplc.golden | 4 ++-- 6 files changed, 15 insertions(+), 21 deletions(-) rename plutarch-test/{plutarch-base => conditional}/Plutarch/FieldSpec.hs (100%) rename plutarch-test/{plutarch-base => conditional}/Plutarch/MonadicSpec.hs (100%) diff --git a/flake.nix b/flake.nix index 9cd05611a..baf0d72f7 100644 --- a/flake.nix +++ b/flake.nix @@ -463,19 +463,7 @@ then source // { subdirs = source.subdirs ++ [ subdir ]; } else source; in let pkgSet = (nixpkgsFor system).haskell-nix.cabalProject' ({ - # This is truly a horrible hack but is necessary for sydtest-discover to work. - src = - if ghcName == ghcVersion - then ./. - else - pkgs.runCommand "fake-src" { } '' - # Prevent `sydtest-discover` from using GHC9 only modules when building with GHC810 - # https://github.com/NorfairKing/sydtest/blob/master/sydtest-discover/src/Test/Syd/Discover.hs - cp -rT ${./.} $out - chmod -R u+w $out/plutarch-test - rm -f $out/plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs - rm -f $out/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs - ''; + src = ./.; compiler-nix-name = ghcName; extraSources = if ghcName == ghcVersion then extraSources diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 2f9f9704e..0b52dab73 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -4,12 +4,15 @@ module Main (main) where import qualified BaseSpec import qualified ExtraSpec -#if !MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +import qualified Plutarch.FieldSpec as FieldSpec +import qualified Plutarch.MonadicSpec as MonadicSpec +#else import qualified Plutarch.FFISpec as FFISpec #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Test.Syd (sydTest) +import Test.Syd (describe, sydTest) main :: IO () main = do @@ -18,7 +21,10 @@ main = do putStrLn "\n\n\n--------------------------------------------\n\n\n" sydTest ExtraSpec.spec -#if !MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) putStrLn "\n\n\n--------------------------------------------\n\n\n" - sydTest FFISpec.spec +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + sydTest $ describe "field" FieldSpec.spec + sydTest $ describe "monadic" MonadicSpec.spec +#else + sydTest $ describe "FFI" FFISpec.spec #endif diff --git a/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/FieldSpec.hs rename to plutarch-test/conditional/Plutarch/FieldSpec.hs diff --git a/plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs b/plutarch-test/conditional/Plutarch/MonadicSpec.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs rename to plutarch-test/conditional/Plutarch/MonadicSpec.hs diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden index c9963d505..332672742 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -1,2 +1,2 @@ -do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":392} -do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":388} \ No newline at end of file +do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":390} +do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":386} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden index f975ba797..fced1596f 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -1,2 +1,2 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at plutarch-base/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at plutarch-base/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file From 0e2e8d17f2a0e838ccae72eb218c5a7a0c0fe95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 17 Mar 2022 14:11:05 -0400 Subject: [PATCH 221/584] Formatting --- plutarch-test/Main.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 0b52dab73..2ce7c1c59 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -1,4 +1,5 @@ {-# LANGUAGE CPP #-} + module Main (main) where import qualified BaseSpec From dbc2739170af091a87a5150b9f3437c6672b8d44 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Thu, 17 Mar 2022 21:57:39 +0100 Subject: [PATCH 222/584] fix: switch structure of HRec proposed by Las' - adjust all instances - fix functions - fix tests - fix errors --- Plutarch/Api/V1/AssocMap.hs | 9 +- Plutarch/Api/V1/Value.hs | 9 +- Plutarch/Builtin.hs | 1 + Plutarch/TryFrom.hs | 323 ++++++++---------- ...tion_untrusted_data.dev=false.bench.golden | 22 +- ...ation_untrusted_data.dev=false.uplc.golden | 22 +- ...ation_untrusted_data.dev=true.bench.golden | 22 +- ...cation_untrusted_data.dev=true.uplc.golden | 30 +- .../plutarch-base/Plutarch/TryFromSpec.hs | 24 +- plutarch-test/plutarch-test.cabal | 2 +- 10 files changed, 208 insertions(+), 256 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index e808e427d..8da6f37f8 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -9,9 +9,8 @@ module Plutarch.Api.V1.AssocMap ( import Data.Map (Map, toList) import Plutarch.TryFrom ( - HRecP (HSNil), + HRecP (HNil), PTryFrom (PTryFromExcess, ptryFrom), - RecKind (HNil), ) import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap @@ -93,9 +92,9 @@ instance ( POrd k , PIsData k ) => - PTryFrom (PBuiltinMap k v) (PMap k v) s + PTryFrom (PBuiltinMap k v) (PMap k v) where - type PTryFromExcess (PBuiltinMap k v) (PMap k v) = HRecP 'HNil + type PTryFromExcess (PBuiltinMap k v) (PMap k v) = HRecP '[] ptryFrom oMap = runTermCont $ do _ <- tcont $ @@ -114,4 +113,4 @@ instance perror ) # oMap - pure ((pcon . PMap) oMap, HSNil) + pure ((pcon . PMap) oMap, HNil) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index f49ae0921..4d9e33da9 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -18,9 +18,8 @@ import Plutarch.Lift ( ) import Plutarch.TryFrom ( - HRecP (HSNil), + HRecP (HNil), PTryFrom (PTryFromExcess, ptryFrom), - RecKind (HNil), ) import Plutarch.Prelude @@ -56,8 +55,8 @@ deriving via ----------------------- PTryFrom instances ---------------------------------------------- -instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue s where - type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = HRecP 'HNil +instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where + type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = HRecP '[] ptryFrom m = runTermCont $ do let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) perror @@ -66,4 +65,4 @@ instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue s whe res :: Term _ PBool res = pall # predOuter # pto m _ <- tcont $ plet res - pure $ (pcon $ PValue m, HSNil) + pure $ (pcon $ PValue m, HNil) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 9ec7a2113..a04f897f7 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -23,6 +23,7 @@ module Plutarch.Builtin ( PAsData, pforgetData, ppairDataBuiltin, + pchooseListBuiltin, type PBuiltinMap, ) where diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index c5acdf178..c19e1a32a 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -1,18 +1,13 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FunctionalDependencies #-} +{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.TryFrom ( PTryFrom (..), - PTryFromData (..), HRecP (..), - RecKind (..), Flip (..), - HSing, - HSSing, - hsing, - getExcessField, ) where import Data.Proxy (Proxy (Proxy)) @@ -30,6 +25,7 @@ import Plutarch.Builtin ( pasInt, pasList, pasMap, + pchooseListBuiltin, pdata, pforgetData, pfstBuiltin, @@ -45,13 +41,19 @@ import Plutarch.Internal.Other ( PType, S, Term, - perror, + pcon, + pdelay, + pforce, plam, plet, (#), type (:-->), ) +import Plutarch.Trace (ptraceError) + +import Plutarch.Unit (PUnit (PUnit)) + import Plutarch.DataRepr.Internal ( PDataRecord, PDataSum, @@ -76,6 +78,11 @@ import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) import Plutarch.DataRepr.Internal (PIsDataRepr (PIsDataReprRepr), PIsDataReprInstances) +import Data.Coerce (Coercible) +import Data.Kind (Type) + +import Data.Function ((&)) + ----------------------- The class PTryFrom ---------------------------------------------- {- | @@ -101,253 +108,211 @@ import Plutarch.DataRepr.Internal (PIsDataRepr (PIsDataReprRepr), PIsDataReprIns - the result type `b` must always be safe than the origin type `a`, i.e. it must carry more information -} -class PTryFrom (a :: PType) (b :: PType) (s :: S) where +class PTryFrom (a :: PType) (b :: PType) where type PTryFromExcess a b :: PType - ptryFrom :: Term s a -> ((Term s b, PTryFromExcess a b s) -> Term s r) -> Term s r + ptryFrom :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r ------------------------ HTree and friends ----------------------------------------------- +----------------------- Reducible and Flip ---------------------------------------------- -newtype Flip f a b = MkFlip {unFlip :: f b a} +class (Coercible (Reduce x) x) => Reducible (x :: Type) where + type Reduce x :: Type + type Reduce x = x -data RecKind - = HNil - | HCons Symbol PType RecKind +instance Reducible () where type Reduce () = () -type HSing :: Symbol -> PType -> RecKind -type family HSing sym typ where - HSing sym typ = 'HCons sym (Flip Term typ) 'HNil +instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecP as s -data HRecP (as :: RecKind) (s :: S) where - HSNil :: HRecP 'HNil s - HSCons :: - forall name a s as. - a s -> - HRecP as s -> - HRecP ( 'HCons name a as) s +instance Reducible (Term s a) where type Reduce (Term s a) = Term s a -type HSSing :: Symbol -> PType -> PType -type HSSing sym a = HRecP (HSing sym a) +instance Reducible (f x y) => Reducible (Flip f y x) where + type Reduce (Flip f y x) = Reduce (f x y) -hsing :: forall sym a (s :: S). Term s a -> HSSing sym a s -hsing ter = HSCons @sym (MkFlip ter) HSNil +newtype Flip f a b = MkFlip {unFlip :: f b a} + +----------------------- HRecP and friends ----------------------------------------------- + +data HRecP (as :: [(Symbol, PType)]) (s :: S) where + HNil :: HRecP '[] s + HCons :: forall name a as s. Reduce (a s) -> HRecP as s -> HRecP ('(name, a) ': as) s getExcessField :: - forall name a b as s. + forall name a as s. ( ElemOf name a as - , MaybeUnFlip a s b ) => HRecP as s -> - b -getExcessField xs = maybeUnFlip $ indexHRec xs $ elemOf @name @a @as - -class MaybeUnFlip a s b | a s -> b where - maybeUnFlip :: a s -> b - -instance {-# OVERLAPPING #-} MaybeUnFlip (Flip Term a) s (Term s a) where - maybeUnFlip = unFlip - -instance {-# OVERLAPPABLE #-} MaybeUnFlip (HRecP reck) s ((HRecP reck) s) where - maybeUnFlip = id + Reduce (a s) +getExcessField xs = indexHRec xs $ elemOf @name @a @as -- | Index HRec using Elem -indexHRec :: forall s as. HRecP as s -> (forall a name. Elem name a as -> a s) -indexHRec (HSCons x _) Here = x -indexHRec (HSCons _ xs) (There i) = indexHRec xs i -indexHRec HSNil impossible = case impossible of {} +indexHRec :: forall s as. HRecP as s -> (forall a name. Elem name a as -> Reduce (a s)) +indexHRec (HCons x _) Here = x +indexHRec (HCons _ xs) (There i) = indexHRec xs i +indexHRec HNil impossible = case impossible of {} -data Elem (sym :: Symbol) (a :: PType) (as :: RecKind) where - Here :: Elem sym a ( 'HCons sym a as) - There :: Elem a sym as -> Elem a sym ( 'HCons sym' b as) +data Elem (sym :: Symbol) (a :: PType) (as :: [(Symbol, PType)]) where + Here :: Elem sym a ('(sym, a) ': as) + There :: Elem a sym as -> Elem a sym ('(sym', b) ': as) class - ElemOf (name :: Symbol) (a :: PType) (as :: RecKind) + ElemOf (name :: Symbol) (a :: PType) (as :: [(Symbol, PType)]) | as name -> a where elemOf :: Elem name a as -instance {-# OVERLAPPING #-} ElemOf name a ( 'HCons name a as) where +instance {-# OVERLAPPING #-} ElemOf name a ('(name, a) ': as) where elemOf = Here instance {-# OVERLAPPABLE #-} ( ElemOf name a as ) => - ElemOf name a ( 'HCons name' b as) + ElemOf name a ('(name', b) ': as) where - elemOf :: Elem name a ( 'HCons name' b as) + elemOf :: Elem name a ('(name', b) ': as) elemOf = There (elemOf @name @a @as) ----------------------- PData instances ------------------------------------------------- -instance PTryFrom PData (PAsData PInteger) (s :: S) where - type PTryFromExcess PData (PAsData PInteger) = HSSing "unwrapped" PInteger +instance PTryFrom PData (PAsData PInteger) where + type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) - pure $ (punsafeCoerce opq, hsing ver) + pure $ (punsafeCoerce opq, ver) -instance PTryFrom PData (PAsData PByteString) s where - type PTryFromExcess PData (PAsData PByteString) = HSSing "unwrapped" PByteString +instance PTryFrom PData (PAsData PByteString) where + type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) - pure $ (punsafeCoerce opq, hsing ver) + pure $ (punsafeCoerce opq, ver) -instance PTryFrom PData PData s where - type PTryFromExcess PData PData = HRecP 'HNil - ptryFrom opq = runTermCont $ pure $ (opq, HSNil) +instance PTryFrom PData PData where + type PTryFromExcess PData PData = HRecP '[] + ptryFrom opq = runTermCont $ pure $ (opq, HNil) -instance PTryFrom PData (PAsData PData) s where - type PTryFromExcess PData (PAsData PData) = HSSing "unwrapped" PData - ptryFrom opq = runTermCont $ pure (pdata opq, hsing opq) +instance PTryFrom PData (PAsData PData) where + type PTryFromExcess PData (PAsData PData) = Flip Term PData + ptryFrom opq = runTermCont $ pure (pdata opq, opq) -- TODO: add the excess inner type instance - ( PTryFrom PData (PAsData a) s - , PTryFrom PData (PAsData b) s + ( PTryFrom PData (PAsData a) + , PTryFrom PData (PAsData b) ) => - PTryFrom PData (PAsData (PBuiltinMap a b)) s + PTryFrom PData (PAsData (PBuiltinMap a b)) where - type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = HSSing "unwrapped" (PBuiltinMap a b) + type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = Flip Term (PBuiltinMap a b) ptryFrom opq = runTermCont $ do verMap <- tcont $ plet (pasMap # opq) let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) verifyPair = plam $ \tup -> unTermCont $ do - (verfst, _) <- TermCont $ ptryFrom @PData @(PAsData a) $ pfstBuiltin # tup - (versnd, _) <- TermCont $ ptryFrom @PData @(PAsData b) $ psndBuiltin # tup + (verfst, _) <- tcont $ ptryFrom @PData @(PAsData a) $ pfstBuiltin # tup + (versnd, _) <- tcont $ ptryFrom @PData @(PAsData b) $ psndBuiltin # tup pure $ ppairDataBuiltin # verfst # versnd ver <- tcont $ plet $ pmap # verifyPair # verMap - pure (punsafeCoerce opq, hsing ver) + pure (punsafeCoerce opq, ver) -- TODO: add the excess inner type list -instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) s where - type PTryFromExcess PData (PAsData (PBuiltinList PData)) = HSSing "unwrapped" (PBuiltinList PData) +instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) where + type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasList # opq) - pure $ (punsafeCoerce opq, hsing ver) + pure $ (punsafeCoerce opq, ver) instance {-# OVERLAPPABLE #-} - forall a s. - ( PTryFrom PData (PAsData a) s + ( PTryFrom PData (PAsData a) , PIsData a ) => - PTryFrom PData (PAsData (PBuiltinList (PAsData a))) s + PTryFrom PData (PAsData (PBuiltinList (PAsData a))) where - type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = HSSing "unwrapped" (PBuiltinList (PAsData a)) + type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = Flip Term (PBuiltinList (PAsData a)) ptryFrom opq = runTermCont $ do let lst :: Term _ (PBuiltinList PData) lst = pasList # opq verify :: Term _ (PData :--> PAsData a) verify = plam $ \e -> unTermCont $ do - (wrapped, _) <- TermCont $ ptryFrom @PData @(PAsData a) @s $ e + (wrapped, _) <- tcont $ ptryFrom @PData @(PAsData a) $ e pure wrapped ver <- tcont $ plet $ pmap # verify # lst - pure $ (punsafeCoerce opq, hsing ver) + pure $ (punsafeCoerce opq, ver) instance {-# OVERLAPPABLE #-} - ( PTryFrom PData a s + ( PTryFrom PData a , a ~ PAsData a' , PIsData a' - , PTryFrom PData b s + , PTryFrom PData b , b ~ PAsData b' , PIsData b' ) => - PTryFrom PData (PAsData (PBuiltinPair a b)) s + PTryFrom PData (PAsData (PBuiltinPair a b)) where - type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = HSSing "unwrapped" (PBuiltinPair a b) + type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = Flip Term (PBuiltinPair a b) ptryFrom opq = runTermCont $ do tup <- tcont $ plet (pfromData $ punsafeCoerce opq) let fst' :: Term _ a - fst' = unTermCont $ fst <$> TermCont (ptryFrom @PData @a $ pforgetData $ pfstBuiltin # tup) + fst' = unTermCont $ fst <$> tcont (ptryFrom @PData @a $ pforgetData $ pfstBuiltin # tup) snd' :: Term _ b - snd' = unTermCont $ fst <$> TermCont (ptryFrom @PData @b $ pforgetData $ psndBuiltin # tup) + snd' = unTermCont $ fst <$> tcont (ptryFrom @PData @b $ pforgetData $ psndBuiltin # tup) ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' - pure $ (punsafeCoerce opq, hsing ver) + pure $ (punsafeCoerce opq, ver) -type FromRecordFields :: [PLabeledType] -> RecKind +type FromRecordFields :: [PLabeledType] -> [(Symbol, PType)] type family FromRecordFields xs where - FromRecordFields '[] = 'HNil - FromRecordFields ((label ':= ptyp) ': xs) = 'HCons label (HSSing "unwrapped" ptyp) (FromRecordFields xs) - -type (++) :: RecKind -> RecKind -> RecKind -type family r0 ++ r1 where - 'HNil ++ l = l - 'HCons sym typ l0 ++ l1 = l0 ++ 'HCons sym typ l1 - -instance - ( FromRecordFields xs ~ ValidationExcess xs - , RecordValidation xs s - ) => - PTryFrom PData (PAsData (PDataRecord xs)) (s :: S) - where - type - PTryFromExcess PData (PAsData (PDataRecord xs)) = - HRecP (HSing "unwrapped" (PDataRecord xs) ++ FromRecordFields xs) + FromRecordFields '[] = '[] + FromRecordFields ((label ':= ptyp) ': xs) = '(label, Flip Term ptyp) ': (FromRecordFields xs) +instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where + type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] ptryFrom opq = runTermCont $ do - let lst :: Term _ (PBuiltinList PData) - lst = pfromData $ punsafeCoerce opq - (rec', exc) <- recoverRecord @xs @s lst - rec <- tcont $ plet rec' - let excess :: PTryFromExcess PData (PAsData (PDataRecord xs)) s - excess = HSCons @"unwrapped" (MkFlip rec) exc - pure (punsafeCoerce opq, excess) - -class RecordValidation xs s where - type ValidationExcess xs :: RecKind - recoverRecord :: - Term s (PBuiltinList PData) -> - TermCont s (Term s (PDataRecord xs), HRecP (ValidationExcess xs) s) + _ :: Term _ PUnit <- + pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") + & pforce + & plet + & tcont + pure (pdnil, HNil) instance - {-# OVERLAPPABLE #-} - ( RecordValidation xs s - , PTryFrom PData (PAsData a) s - , PTryFrom PData (PAsData (PDataRecord xs)) s + ( PTryFrom (PBuiltinList PData) (PDataRecord xs) + , PTryFrom PData (PAsData a) + , PTryFromExcess PData (PAsData a) ~ Flip Term a + , PTryFromExcess (PBuiltinList PData) (PDataRecord xs) ~ HRecP (FromRecordFields xs) ) => - RecordValidation ((label ':= a) ': xs) s + PTryFrom (PBuiltinList PData) (PDataRecord ((label ':= a) ': xs)) where - type ValidationExcess ((label ':= a) ': xs) = 'HCons label (PTryFromExcess PData (PAsData a)) (ValidationExcess xs) - recoverRecord lst = do - let lsthead :: Term s PData - lsthead = phead # lst - lsttail :: Term s (PBuiltinList PData) - lsttail = ptail # lst - (verhead, exchead) <- TermCont $ ptryFrom @PData @(PAsData a) @s lsthead - (vertail, exctail) <- recoverRecord @xs @s lsttail + type + PTryFromExcess (PBuiltinList PData) (PDataRecord ((label ':= a) ': xs)) = + HRecP ('(label, (PTryFromExcess PData (PAsData a))) ': FromRecordFields xs) + ptryFrom lst = runTermCont $ do + (verhead, exchead) <- tcont $ ptryFrom @PData @(PAsData a) $ phead # lst + (vertail, exctail) <- tcont $ ptryFrom @(PBuiltinList PData) @(PDataRecord xs) $ ptail # lst rec <- tcont $ plet $ pdcons @label # verhead # vertail - pure (rec, HSCons @label exchead exctail) - -instance {-# OVERLAPPING #-} RecordValidation '[] s where - type ValidationExcess '[] = 'HNil - recoverRecord _ = pure (pdnil, HSNil) + pure (rec, HCons exchead exctail) instance - {-# OVERLAPPING #-} - forall ys (s :: S). - ( SumValidation 0 ys s + forall ys. + ( SumValidation 0 ys ) => - PTryFrom PData (PAsData (PDataSum ys)) s + PTryFrom PData (PAsData (PDataSum ys)) where - type PTryFromExcess PData (PAsData (PDataSum ys)) = HRecP 'HNil + type PTryFromExcess PData (PAsData (PDataSum ys)) = HRecP '[] ptryFrom opq = runTermCont $ do _ <- tcont $ plet $ validateSum @0 @ys opq - pure (punsafeCoerce opq, HSNil) + pure (punsafeCoerce opq, HNil) -class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) s where +class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where validateSum :: Term s PData -> Term s (PBuiltinList PData) instance {-# OVERLAPPABLE #-} - forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]) (s :: S). - ( PTryFrom PData (PAsData (PDataRecord x)) s - , SumValidation (n + 1) xs s + forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). + ( PTryFrom PData (PAsData (PDataRecord x)) + , SumValidation (n + 1) xs , KnownNat n - , FromRecordFields x ~ ValidationExcess x - , RecordValidation x s + , PTryFrom (PBuiltinList PData) (PDataRecord x) ) => - SumValidation n (x ': xs) s + SumValidation n (x ': xs) where validateSum s = unTermCont $ do @@ -359,15 +324,14 @@ instance pif (fromInteger n #== (pfstBuiltin # elem)) ( unTermCont $ do - let rec = pdata $ psndBuiltin # elem - y <- (getExcessField @"unwrapped" . snd) <$> TermCont (ptryFrom @PData @(PAsData (PDataRecord x)) @s $ pforgetData rec) + y <- fst <$> tcont (ptryFrom @(PBuiltinList PData) @(PDataRecord x) (psndBuiltin # elem)) pure $ punsafeCoerce (y :: Term _ (PDataRecord x)) ) (validateSum @(n + 1) @xs $ punsafeCoerce s) tcont $ plet snd' -instance {-# OVERLAPPING #-} SumValidation n '[] s where - validateSum _ = perror +instance {-# OVERLAPPING #-} SumValidation n '[] where + validateSum _ = ptraceError "reached end of sum while still not having found the constructor" ----------------------- POpaque Instances ----------------------------------------------- @@ -379,10 +343,10 @@ instance {-# OVERLAPPING #-} SumValidation n '[] s where your POpaque safely -} instance - ( PTryFrom PData (PAsData a) s + ( PTryFrom PData (PAsData a) , PIsData a ) => - PTryFrom POpaque a s + PTryFrom POpaque a where type PTryFromExcess POpaque a = Flip Term (PAsData a) ptryFrom opq = runTermCont $ do @@ -390,61 +354,52 @@ instance prop = punsafeCoerce opq ver' <- fst <$> TermCont (ptryFrom @PData @(PAsData a) $ pforgetData $ pdata prop) ver <- tcont $ plet ver' - pure $ (punsafeCoerce opq, MkFlip ver) + pure $ (punsafeCoerce opq, ver) instance - ( PTryFrom a b s + ( PTryFrom a b , PIsData a , PIsData b ) => - PTryFrom (PAsData a) (PAsData b) s + PTryFrom (PAsData a) (PAsData b) where type PTryFromExcess (PAsData a) (PAsData b) = PTryFromExcess a b ptryFrom opq = runTermCont $ do ver' <- snd <$> TermCont (ptryFrom @a @b (pfromData opq)) pure $ (punsafeCoerce opq, ver') ------------------------ PIsDataReprInstances -------------------------------------------- - -class PTryFromData s b where - type PTryFromDataExcess b :: PType - type PTryFromDataExcess b = PTryFromExcess PData b - ptryFromData :: Term s PData -> ((Term s b, PTryFromDataExcess b s) -> Term s r) -> Term s r - -{- - default ptryFromData :: - ( PTryFromExcess PData b s ~ PTryFromDataExcess b s - , PTryFrom PData b s - ) => - Term s PData -> ((Term s b, PTryFromDataExcess b s) -> Term s r) -> Term s r - ptryFromData = ptryFrom @PData @b - -deriving anyclass instance (PTryFrom PData b s) => PTryFromData s b --} - instance - ( PTryFrom PData (PAsData (PIsDataReprInstances a)) s + ( PTryFromExcess (PBuiltinList PData) (PDataRecord xs) ~ HRecP (FromRecordFields xs) + , PTryFrom (PBuiltinList PData) (PDataRecord xs) ) => - PTryFromData s (PAsData (PIsDataReprInstances a)) + PTryFrom PData (PAsData (PDataRecord xs)) where - ptryFromData = ptryFrom + type + PTryFromExcess PData (PAsData (PDataRecord xs)) = + HRecP ('("unwrapped", (Flip Term (PDataRecord xs))) ': FromRecordFields xs) + ptryFrom opq = runTermCont $ do + lst <- snd <$> tcont (ptryFrom @PData @(PAsData (PBuiltinList PData)) opq) + (rec, exc) <- tcont $ (ptryFrom @(PBuiltinList PData) @(PDataRecord xs) lst) + pure (punsafeCoerce opq, HCons @"unwrapped" rec exc) + +----------------------- PIsDataReprInstances -------------------------------------------- instance ( PIsDataRepr a - , SumValidation 0 (PIsDataReprRepr a) s + , SumValidation 0 (PIsDataReprRepr a) , PInner a b ~ PDataSum (PIsDataReprRepr a) ) => - PTryFrom PData (PAsData (PIsDataReprInstances a)) s + PTryFrom PData (PAsData (PIsDataReprInstances a)) where - type PTryFromExcess PData (PAsData (PIsDataReprInstances a)) = HRecP 'HNil + type PTryFromExcess PData (PAsData (PIsDataReprInstances a)) = HRecP '[] ptryFrom opq = runTermCont $ do let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) - pure $ (pdata $ punsafeFrom reprsum, HSNil) + pure $ (pdata $ punsafeFrom reprsum, HNil) -- TODO: add overlapping instance for single constructor types that has actual excess ----------------------- HasField instance ----------------------------------------------- -instance (MaybeUnFlip ptyp s out, ElemOf name ptyp rec) => HasField name (HRecP rec s) out where +instance (ElemOf name ptyp rec, Reduce (ptyp s) ~ out) => HasField name (HRecP rec s) out where getField = getExcessField @name diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden index 44afbe66a..3912255f5 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden @@ -1,19 +1,19 @@ erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":140} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":108} erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} -erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":110} -erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":190} +erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":111} +erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":193} working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":9720590,"exBudgetMemory":14348,"scriptSizeBytes":136} -working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":9720590,"exBudgetMemory":14348,"scriptSizeBytes":136} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":9809909,"exBudgetMemory":14648,"scriptSizeBytes":140} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":6636946,"exBudgetMemory":11068,"scriptSizeBytes":101} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":6636946,"exBudgetMemory":11068,"scriptSizeBytes":101} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":6726265,"exBudgetMemory":11368,"scriptSizeBytes":108} working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} -working.PDataSum constr 0 {"exBudgetCPU":7072545,"exBudgetMemory":12070,"scriptSizeBytes":190} -working.PDataSum constr 1 {"exBudgetCPU":8076101,"exBudgetMemory":14036,"scriptSizeBytes":190} -recovering a record partially vs completely.partially {"exBudgetCPU":7626265,"exBudgetMemory":11560,"scriptSizeBytes":113} -recovering a record partially vs completely.completely {"exBudgetCPU":9809909,"exBudgetMemory":14648,"scriptSizeBytes":140} +working.PDataSum constr 0 {"exBudgetCPU":6651183,"exBudgetMemory":12542,"scriptSizeBytes":193} +working.PDataSum constr 1 {"exBudgetCPU":7654739,"exBudgetMemory":14508,"scriptSizeBytes":193} +recovering a record partially vs completely.partially {"exBudgetCPU":6008308,"exBudgetMemory":10372,"scriptSizeBytes":99} +recovering a record partially vs completely.completely {"exBudgetCPU":6726265,"exBudgetMemory":11368,"scriptSizeBytes":107} removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} @@ -29,4 +29,4 @@ example.concatenate two lists, legal {"exBudgetCPU":55650750,"exBudgetMemory":10 example.concatenate two lists, illegal (list too short) {"exBudgetCPU":48177778,"exBudgetMemory":84825,"scriptSizeBytes":707} example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":55412566,"exBudgetMemory":105051,"scriptSizeBytes":713} example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35832714,"exBudgetMemory":63544,"scriptSizeBytes":734} -example2.recovering a record succeeds {"exBudgetCPU":9525281,"exBudgetMemory":15590,"scriptSizeBytes":285} \ No newline at end of file +example2.recovering a record succeeds {"exBudgetCPU":9103919,"exBudgetMemory":16062,"scriptSizeBytes":287} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden index 9087b91ae..2486c001e 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden @@ -1,19 +1,19 @@ erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (iData 42) i9))) (i7 (i5 (unListData (listData (i7 (bData i6) (i7 (iData 42) i8))))) i1)) (i6 (i4 (i3 (unListData (listData (i6 (bData i5) (i6 (iData 42) i7)))))) i7)) (unIData (i3 (i2 (unListData (listData (i5 (bData i4) (i5 (iData 42) i6)))))))) (unIData (i2 (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (bData i9) (i10 (iData 42) i11))) (i9 (i7 i5) i1)) (i8 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i5 (i7 (unListData (listData (i8 i4)))) i1) (i4 (i6 (i5 (unListData (listData (i7 i3))))) [ ])) (unBData (i5 (i4 (unListData (listData (i6 i2))))))) (unIData (i4 (unListData (listData (i5 i1))))))) (delay error))) (unConstrData i5))) (force mkCons)) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) -erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unBData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d87b9f0543666f6fff)) +erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (i8 (i9 i5)) i1) (i5 (i7 (i6 (i8 i4))) [ ])) (force (force (force chooseList) (i5 (i5 (i7 i3))) (delay ()) (delay error)))) (unBData (i5 (i4 (i6 i2))))) (unIData (i4 (i5 i1))))) (delay error))) (unConstrData i5))) (force mkCons)) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) +erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i12 (i13 i5)) i1) (i7 (i11 (i10 (i12 i4))) i8)) (force (i8 (i9 (i9 (i11 i3))) (delay ()) (delay error)))) (unBData (i9 (i8 (i10 i2))))) (unIData (i8 (i9 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i13 (i14 i5)) i1) (i8 (i12 (i11 (i13 i4))) i9)) (force (i9 (i10 (i10 (i12 i3))) (delay ()) (delay error)))) (unBData (i10 (i9 (i11 i2))))) (unBData (i9 (i10 i1))))) (delay error))) (unConstrData i10))))) (unConstrData i9))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) #d87b9f0543666f6fff)) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 7) (i7 (iData 42) i8))) (i6 (i5 (unListData (listData (i6 (iData 7) (i6 (iData 42) i7))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 7) (i5 (iData 42) i6)))))) i6)) (unIData (i3 (i2 (unListData (listData (i4 (iData 7) (i4 (iData 42) i5)))))))) (unIData (i2 (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 7) (i7 (iData 42) i8))) (i6 (i5 (unListData (listData (i6 (iData 7) (i6 (iData 42) i7))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 7) (i5 (iData 42) i6)))))) i6)) (unIData (i3 (i2 (unListData (listData (i4 (iData 7) (i4 (iData 42) i5)))))))) (unIData (i2 (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (iData 42) i9))) (i7 (i5 (unListData (listData (i7 (bData i6) (i7 (iData 42) i8))))) i1)) (i6 (i4 (i3 (unListData (listData (i6 (bData i5) (i6 (iData 42) i7)))))) i7)) (unIData (i3 (i2 (unListData (listData (i5 (bData i4) (i5 (iData 42) i6)))))))) (unBData (i2 (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 7) (i9 (iData 42) i10))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i8)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 7) (i9 (iData 42) i10))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i8)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (bData i9) (i10 (iData 42) i11))) (i9 (i7 i5) i1)) (i8 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unIData (i4 (i3 i2)))) (unBData (i3 i1))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unIData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d8799f0543666f6fff)) -working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unIData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) -recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 (i3 (unListData (listData (i4 (iData 3) (i4 (bData i5) i6))))) i1)) (i3 (i2 (force tailList (unListData (listData (i3 (iData 3) (i3 (bData i4) i5)))))) i5)) (unIData (i1 (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))))) (force headList)) (force mkCons)) #62617a) [ ])) -recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 3) (i7 (bData i8) i9))) (i6 (i5 (unListData (listData (i6 (iData 3) (i6 (bData i7) i8))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 3) (i5 (bData i6) i7)))))) i7)) (unBData (i3 (i2 (unListData (listData (i4 (iData 3) (i4 (bData i5) i6)))))))) (unIData (i2 (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i12 (i13 i5)) i1) (i7 (i11 (i10 (i12 i4))) i8)) (force (i8 (i9 (i9 (i11 i3))) (delay ()) (delay error)))) (unBData (i9 (i8 (i10 i2))))) (unIData (i8 (i9 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i13 (i14 i5)) i1) (i8 (i12 (i11 (i13 i4))) i9)) (force (i9 (i10 (i10 (i12 i3))) (delay ()) (delay error)))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay error))) (unConstrData i10))))) (unConstrData i9))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) #d8799f0543666f6fff)) +working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i12 (i13 i5)) i1) (i7 (i11 (i10 (i12 i4))) i8)) (force (i8 (i9 (i9 (i11 i3))) (delay ()) (delay error)))) (unBData (i9 (i8 (i10 i2))))) (unIData (i8 (i9 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i13 (i14 i5)) i1) (i8 (i12 (i11 (i13 i4))) i9)) (force (i9 (i10 (i10 (i12 i3))) (delay ()) (delay error)))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay error))) (unConstrData i10))))) (unConstrData i9))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) +recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (iData 3) (i8 (bData i9) i10))) (i7 (i6 i4) i1)) (i6 (i5 (i4 i3)) i8)) (force (force (force chooseList) (i3 (i3 i2)) (delay ()) (delay error)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 3) (i9 (bData i10) i11))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unBData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) @@ -31,4 +31,4 @@ example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) i10))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 8) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i7 (iData 4) (i7 (bData i8) i9))) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i10 (i8 (unListData (listData (i9 i4)))) i1) (i9 (i7 (i6 (unListData (listData (i8 i3))))) i11)) (unBData (i6 (i5 (unListData (listData (i7 i2))))))) (unIData (i5 (unListData (listData (i6 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i11 (i9 (unListData (listData (i10 i4)))) i1) (i10 (i8 (i7 (unListData (listData (i9 i3))))) i12)) (unBData (i7 (i6 (unListData (listData (i8 i2))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i13) (delay (i11 (i3 (i9 i1)) (i2 (i8 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i6 (unListData (listData (i7 i1)))))))) (delay error))) (unConstrData (constrData 0 (i7 (iData 4) (i7 (bData i8) i9)))))))) (unConstrData (constrData 0 (i6 (iData 4) (i6 (bData i7) i8)))))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) (force (force sndPair))) (force mkCons)) #666f6f) [ ])) \ No newline at end of file +example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i8 (iData 4) (i8 (bData i9) i10))) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i12 (i10 (i11 i5)) i1) (i11 (i9 (i8 (i10 i4))) i13)) (force (i6 (i7 (i7 (i9 i3))) (delay ()) (delay error)))) (unBData (i7 (i6 (i8 i2))))) (unIData (i6 (i7 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i13 (i11 (i12 i5)) i1) (i12 (i10 (i9 (i11 i4))) i14)) (force (i7 (i8 (i8 (i10 i3))) (delay ()) (delay error)))) (unBData (i8 (i7 (i9 i2))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i8 i1 (delay i14) (delay (i12 (i3 (i10 i1)) (i2 (i9 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i7 (i8 i1)))))) (delay error))) (unConstrData (constrData 0 (i8 (iData 4) (i8 (bData i9) i10)))))))) (unConstrData (constrData 0 (i7 (iData 4) (i7 (bData i8) i9)))))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) (force mkCons)) #666f6f) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden index c23279b9a..683137b4e 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden @@ -1,19 +1,19 @@ erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":140} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":139} erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} -erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":110} -erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":190} +erroneous.PDataSum constr 2 {"exBudgetCPU":587969,"exBudgetMemory":198,"scriptSizeBytes":215} +erroneous.PDataSum wrong record type {"exBudgetCPU":1025838,"exBudgetMemory":264,"scriptSizeBytes":307} working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":9720590,"exBudgetMemory":14348,"scriptSizeBytes":136} -working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":9720590,"exBudgetMemory":14348,"scriptSizeBytes":136} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":9809909,"exBudgetMemory":14648,"scriptSizeBytes":140} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":6636946,"exBudgetMemory":11068,"scriptSizeBytes":133} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":6636946,"exBudgetMemory":11068,"scriptSizeBytes":133} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":6726265,"exBudgetMemory":11368,"scriptSizeBytes":139} working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} -working.PDataSum constr 0 {"exBudgetCPU":7072545,"exBudgetMemory":12070,"scriptSizeBytes":190} -working.PDataSum constr 1 {"exBudgetCPU":8076101,"exBudgetMemory":14036,"scriptSizeBytes":190} -recovering a record partially vs completely.partially {"exBudgetCPU":7626265,"exBudgetMemory":11560,"scriptSizeBytes":113} -recovering a record partially vs completely.completely {"exBudgetCPU":9809909,"exBudgetMemory":14648,"scriptSizeBytes":140} +working.PDataSum constr 0 {"exBudgetCPU":6859594,"exBudgetMemory":13242,"scriptSizeBytes":307} +working.PDataSum constr 1 {"exBudgetCPU":7863150,"exBudgetMemory":15208,"scriptSizeBytes":307} +recovering a record partially vs completely.partially {"exBudgetCPU":6008308,"exBudgetMemory":10372,"scriptSizeBytes":131} +recovering a record partially vs completely.completely {"exBudgetCPU":6726265,"exBudgetMemory":11368,"scriptSizeBytes":139} removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} @@ -29,4 +29,4 @@ example.concatenate two lists, legal {"exBudgetCPU":56427118,"exBudgetMemory":10 example.concatenate two lists, illegal (list too short) {"exBudgetCPU":48627778,"exBudgetMemory":84921,"scriptSizeBytes":1108} example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":55862566,"exBudgetMemory":105147,"scriptSizeBytes":1115} example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35982714,"exBudgetMemory":63576,"scriptSizeBytes":1136} -example2.recovering a record succeeds {"exBudgetCPU":9525281,"exBudgetMemory":15590,"scriptSizeBytes":285} \ No newline at end of file +example2.recovering a record succeeds {"exBudgetCPU":9312330,"exBudgetMemory":16762,"scriptSizeBytes":399} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden index 8588a9d93..366610c35 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden @@ -1,19 +1,19 @@ erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (iData 42) i9))) (i7 (i5 (unListData (listData (i7 (bData i6) (i7 (iData 42) i8))))) i1)) (i6 (i4 (i3 (unListData (listData (i6 (bData i5) (i6 (iData 42) i7)))))) i7)) (unIData (i3 (i2 (unListData (listData (i5 (bData i4) (i5 (iData 42) i6)))))))) (unIData (i2 (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (bData i9) (i10 (iData 42) i11))) (i9 (i7 i5) i1)) (i8 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i5 (i7 (unListData (listData (i8 i4)))) i1) (i4 (i6 (i5 (unListData (listData (i7 i3))))) [ ])) (unBData (i5 (i4 (unListData (listData (i6 i2))))))) (unIData (i4 (unListData (listData (i5 i1))))))) (delay error))) (unConstrData i5))) (force mkCons)) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) -erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unBData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d87b9f0543666f6fff)) +erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (i8 (i9 i5)) i1) (i5 (i7 (i6 (i8 i4))) [ ])) (force (force (force chooseList) (i5 (i5 (i7 i3))) (delay ()) (delay (force (i8 "list is longer than zero" (delay error))))))) (unBData (i5 (i4 (i6 i2))))) (unIData (i4 (i5 i1))))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData i6))) (force mkCons)) (force tailList)) (force headList)) (force (force sndPair))) (force trace)) #d87a9f0543666f6fff)) +erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i12) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i13 (i14 i5)) i1) (i7 (i12 (i11 (i13 i4))) i8)) (force (i8 (i10 (i10 (i12 i3))) (delay ()) (delay (force (i13 i9 (delay error))))))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i14 (i15 i5)) i1) (i8 (i13 (i12 (i14 i4))) i9)) (force (i9 (i11 (i11 (i13 i3))) (delay ()) (delay (force (i14 i10 (delay error))))))) (unBData (i11 (i10 (i12 i2))))) (unBData (i10 (i11 i1))))) (delay (force (i12 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData i12))))) (unConstrData i11))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force (force sndPair))) (force trace)) #d87b9f0543666f6fff)) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 7) (i7 (iData 42) i8))) (i6 (i5 (unListData (listData (i6 (iData 7) (i6 (iData 42) i7))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 7) (i5 (iData 42) i6)))))) i6)) (unIData (i3 (i2 (unListData (listData (i4 (iData 7) (i4 (iData 42) i5)))))))) (unIData (i2 (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 7) (i7 (iData 42) i8))) (i6 (i5 (unListData (listData (i6 (iData 7) (i6 (iData 42) i7))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 7) (i5 (iData 42) i6)))))) i6)) (unIData (i3 (i2 (unListData (listData (i4 (iData 7) (i4 (iData 42) i5)))))))) (unIData (i2 (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (iData 42) i9))) (i7 (i5 (unListData (listData (i7 (bData i6) (i7 (iData 42) i8))))) i1)) (i6 (i4 (i3 (unListData (listData (i6 (bData i5) (i6 (iData 42) i7)))))) i7)) (unIData (i3 (i2 (unListData (listData (i5 (bData i4) (i5 (iData 42) i6)))))))) (unBData (i2 (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 7) (i9 (iData 42) i10))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i8)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 7) (i9 (iData 42) i10))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i8)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (bData i9) (i10 (iData 42) i11))) (i9 (i7 i5) i1)) (i8 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i4 (i3 i2)))) (unBData (i3 i1))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unIData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d8799f0543666f6fff)) -working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i7 (i10 (unListData (listData (i11 i4)))) i1) (i6 (i9 (i8 (unListData (listData (i10 i3))))) i7)) (unBData (i8 (i7 (unListData (listData (i9 i2))))))) (unIData (i7 (unListData (listData (i8 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i8 (i11 (unListData (listData (i12 i4)))) i1) (i7 (i10 (i9 (unListData (listData (i11 i3))))) i8)) (unBData (i9 (i8 (unListData (listData (i10 i2))))))) (unIData (i8 (unListData (listData (i9 i1))))))) (delay error))) (unConstrData i9))))) (unConstrData i8))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) -recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i5 (iData 3) (i5 (bData i6) i7))) (i4 (i3 (unListData (listData (i4 (iData 3) (i4 (bData i5) i6))))) i1)) (i3 (i2 (force tailList (unListData (listData (i3 (iData 3) (i3 (bData i4) i5)))))) i5)) (unIData (i1 (unListData (listData (i2 (iData 3) (i2 (bData i3) i4))))))) (force headList)) (force mkCons)) #62617a) [ ])) -recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (iData 3) (i7 (bData i8) i9))) (i6 (i5 (unListData (listData (i6 (iData 3) (i6 (bData i7) i8))))) i1)) (i5 (i4 (i3 (unListData (listData (i5 (iData 3) (i5 (bData i6) i7)))))) i7)) (unBData (i3 (i2 (unListData (listData (i4 (iData 3) (i4 (bData i5) i6)))))))) (unIData (i2 (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i12) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i13 (i14 i5)) i1) (i7 (i12 (i11 (i13 i4))) i8)) (force (i8 (i10 (i10 (i12 i3))) (delay ()) (delay (force (i13 i9 (delay error))))))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i14 (i15 i5)) i1) (i8 (i13 (i12 (i14 i4))) i9)) (force (i9 (i11 (i11 (i13 i3))) (delay ()) (delay (force (i14 i10 (delay error))))))) (unBData (i11 (i10 (i12 i2))))) (unIData (i10 (i11 i1))))) (delay (force (i12 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData i12))))) (unConstrData i11))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force (force sndPair))) (force trace)) #d8799f0543666f6fff)) +working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i12) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i13 (i14 i5)) i1) (i7 (i12 (i11 (i13 i4))) i8)) (force (i8 (i10 (i10 (i12 i3))) (delay ()) (delay (force (i13 i9 (delay error))))))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i14 (i15 i5)) i1) (i8 (i13 (i12 (i14 i4))) i9)) (force (i9 (i11 (i11 (i13 i3))) (delay ()) (delay (force (i14 i10 (delay error))))))) (unBData (i11 (i10 (i12 i2))))) (unIData (i10 (i11 i1))))) (delay (force (i12 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData i12))))) (unConstrData i11))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force (force sndPair))) (force trace)) #d87a9f0543666f6fff)) +recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (iData 3) (i8 (bData i9) i10))) (i7 (i6 i4) i1)) (i6 (i5 (i4 i3)) i8)) (force (force (force chooseList) (i3 (i3 i2)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i3 i1))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 3) (i9 (bData i10) i11))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unBData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) @@ -27,8 +27,8 @@ checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 , #a149736f6d65546f6b656e01 ) ])) checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:388:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:338:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:329:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:388:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:338:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:329:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:388:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:338:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:329:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:388:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:338:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:329:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i7 (iData 4) (i7 (bData i8) i9))) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i10 (i8 (unListData (listData (i9 i4)))) i1) (i9 (i7 (i6 (unListData (listData (i8 i3))))) i11)) (unBData (i6 (i5 (unListData (listData (i7 i2))))))) (unIData (i5 (unListData (listData (i6 i1))))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> i11 (i9 (unListData (listData (i10 i4)))) i1) (i10 (i8 (i7 (unListData (listData (i9 i3))))) i12)) (unBData (i7 (i6 (unListData (listData (i8 i2))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i13) (delay (i11 (i3 (i9 i1)) (i2 (i8 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i6 (unListData (listData (i7 i1)))))))) (delay error))) (unConstrData (constrData 0 (i7 (iData 4) (i7 (bData i8) i9)))))))) (unConstrData (constrData 0 (i6 (iData 4) (i6 (bData i7) i8)))))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) (force (force sndPair))) (force mkCons)) #666f6f) [ ])) \ No newline at end of file +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:386:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:336:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:327:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:386:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:336:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:327:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:386:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:336:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:327:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:386:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:336:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:327:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i10 (iData 4) (i10 (bData i11) i12))) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i14 (i11 (i12 i5)) i1) (i13 (i10 (i9 (i11 i4))) i15)) (force (i7 (i8 (i8 (i10 i3))) (delay ()) (delay (force (i11 i6 (delay error))))))) (unBData (i8 (i7 (i9 i2))))) (unIData (i7 (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i15 (i12 (i13 i5)) i1) (i14 (i11 (i10 (i12 i4))) i16)) (force (i8 (i9 (i9 (i11 i3))) (delay ()) (delay (force (i12 i7 (delay error))))))) (unBData (i9 (i8 (i10 i2))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 i1 (delay i16) (delay (i14 (i3 (i11 i1)) (i2 (i10 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i8 (i9 i1)))))) (delay (force (i10 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData (constrData 0 (i10 (iData 4) (i10 (bData i11) i12)))))))) (unConstrData (constrData 0 (i9 (iData 4) (i9 (bData i10) i11)))))) (force ifThenElse)) (force (force fstPair))) "list is longer than zero") (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) (force trace)) (force mkCons)) #666f6f) [ ])) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs b/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs index 378c11b34..b0184d2d9 100644 --- a/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs @@ -59,10 +59,8 @@ import Plutarch.Builtin ( ) import Plutarch.Prelude import Plutarch.TryFrom ( - HSSing, + Flip, PTryFrom (PTryFromExcess, ptryFrom), - PTryFromData (ptryFromData), - hsing, ) import Plutarch.ApiSpec (info, purpose) @@ -262,14 +260,14 @@ spec = do "concatenate two lists, illegal (more than one output)" @| validator # pforgetData l1 # pforgetData l2 # invalidContext1 @-> pfails "example2" @\ do - "recovering a record succeeds" + "recovering a record succeeds" @| recoverAB @-> psucceeds ------------------- Checking deeply, shallowly and unwrapping ---------------------- checkDeep :: forall (target :: PType) (actual :: PType) (s :: S). - ( PTryFrom PData (PAsData target) s + ( PTryFrom PData (PAsData target) , PIsData actual , PIsData target ) => @@ -279,7 +277,7 @@ checkDeep t = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData target) @ checkDeepUnwrap :: forall (target :: PType) (actual :: PType) (s :: S). - ( PTryFrom PData (PAsData target) s + ( PTryFrom PData (PAsData target) , PIsData actual , PIsData target ) => @@ -309,17 +307,17 @@ newtype PNatural (s :: S) = PMkNatural (Term s PInteger) pmkNatural :: Term s (PInteger :--> PNatural) pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) -instance PTryFrom PData (PAsData PNatural) s where - type PTryFromExcess PData (PAsData PNatural) = HSSing "unwrapped" PNatural +instance PTryFrom PData (PAsData PNatural) where + type PTryFromExcess PData (PAsData PNatural) = Flip Term PNatural ptryFrom opq = runTermCont $ do (ter, exc) <- TermCont $ ptryFrom @PData @(PAsData PInteger) opq - ver <- tcont $ plet $ pmkNatural #$ exc.unwrapped - pure $ (punsafeCoerce ter, hsing ver) + ver <- tcont $ plet $ pmkNatural #$ exc + pure $ (punsafeCoerce ter, ver) validator :: Term s PValidator validator = phoistAcyclic $ plam $ \dat red ctx -> unTermCont $ do - trustedRedeemer <- (\(snd -> red) -> red.unwrapped) <$> (TermCont $ ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red) + trustedRedeemer <- (\(snd -> red) -> red) <$> (TermCont $ ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red) let trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) trustedDatum = pfromData $ punsafeCoerce dat -- make the Datum and Redeemer trusted @@ -494,7 +492,7 @@ sampleABdata :: Term s PData sampleABdata = pforgetData sampleAB recoverAB :: Term s (PAsData PAB) -recoverAB = unTermCont $ fst <$> (tcont $ ptryFromData sampleABdata) +recoverAB = unTermCont $ fst <$> (tcont $ ptryFrom sampleABdata) data PAB (s :: S) = PA (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PByteString])) @@ -505,4 +503,4 @@ data PAB (s :: S) (PlutusType, PIsData) via PIsDataReprInstances PAB -deriving via PAsData (PIsDataReprInstances PAB) instance PTryFromData s (PAsData PAB) +deriving via PAsData (PIsDataReprInstances PAB) instance PTryFrom PData (PAsData PAB) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 80f89996f..25df8ac76 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -164,4 +164,4 @@ executable plutarch-test cpp-options: -DDevelopment -- FIXME remove -Wwarn=deprecations - ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wwarn=deprecations -Wwarn=missing-home-modules + ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wwarn=deprecations From fc6a995573c4d69f7b62cbb80811e0bc128c6223 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 18 Mar 2022 15:58:26 -0400 Subject: [PATCH 223/584] plutarch-test: Look for unused goldens and fail. Consequently, normalize 'custom' goldens in ScriptsSpec to use the existing golden tree for easy tracking. This uses `pconstant` to build the Plutarch term for constant string, which nevertheless exists in the golden file. --- plutarch-test/Main.hs | 28 ++++-- plutarch-test/common/Plutarch/Test/Golden.hs | 91 +++++++++++++------ plutarch-test/common/Plutarch/Test/Run.hs | 80 ++++++++++++++++ .../goldens/scripts.auth_policy.bench.golden | 1 - .../goldens/scripts.auth_policy.hash.golden | 1 - .../scripts.auth_policy.uplc.eval.golden | 1 - .../goldens/scripts.auth_policy.uplc.golden | 1 - .../scripts.auth_stake_validator.bench.golden | 1 - .../scripts.auth_stake_validator.hash.golden | 1 - ...ipts.auth_stake_validator.uplc.eval.golden | 1 - .../scripts.auth_stake_validator.uplc.golden | 1 - .../scripts.auth_validator.bench.golden | 1 - .../scripts.auth_validator.hash.golden | 1 - .../scripts.auth_validator.uplc.eval.golden | 1 - .../scripts.auth_validator.uplc.golden | 1 - plutarch-test/goldens/scripts.bench.golden | 6 ++ .../goldens/scripts.uplc.eval.golden | 6 ++ plutarch-test/goldens/scripts.uplc.golden | 6 ++ .../plutarch-base/Plutarch/ScriptsSpec.hs | 35 +++---- plutarch-test/plutarch-test.cabal | 4 + 20 files changed, 195 insertions(+), 73 deletions(-) create mode 100644 plutarch-test/common/Plutarch/Test/Run.hs delete mode 100644 plutarch-test/goldens/scripts.auth_policy.bench.golden delete mode 100644 plutarch-test/goldens/scripts.auth_policy.hash.golden delete mode 100644 plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden delete mode 100644 plutarch-test/goldens/scripts.auth_policy.uplc.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.bench.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.hash.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.bench.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.hash.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.uplc.golden create mode 100644 plutarch-test/goldens/scripts.bench.golden create mode 100644 plutarch-test/goldens/scripts.uplc.eval.golden create mode 100644 plutarch-test/goldens/scripts.uplc.golden diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 2ce7c1c59..d2973aee0 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -8,24 +8,36 @@ import qualified ExtraSpec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) import qualified Plutarch.FieldSpec as FieldSpec import qualified Plutarch.MonadicSpec as MonadicSpec +import Plutarch.Test.Run (runPlutarchSpec) +import Test.Syd (Spec, describe) #else import qualified Plutarch.FFISpec as FFISpec +import Test.Syd (Spec, describe, sydTest) #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Test.Syd (describe, sydTest) main :: IO () main = do setLocaleEncoding utf8 - sydTest BaseSpec.spec - putStrLn "\n\n\n--------------------------------------------\n\n\n" - sydTest ExtraSpec.spec - putStrLn "\n\n\n--------------------------------------------\n\n\n" +-- We use 'runPlutarchSpec' to test for unused goldens, but do so only in GHC +-- 9. Because, under GHC 8 certain modules are disabled (see the CPP below) +-- which leads to legitimately unused goldens detected leading to false +-- positive in test failure. #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) - sydTest $ describe "field" FieldSpec.spec - sydTest $ describe "monadic" MonadicSpec.spec + runPlutarchSpec spec #else - sydTest $ describe "FFI" FFISpec.spec + sydTest spec +#endif + +spec :: Spec +spec = do + BaseSpec.spec + ExtraSpec.spec +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + describe "field" FieldSpec.spec + describe "monadic" MonadicSpec.spec +#else + describe "FFI" FFISpec.spec #endif diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index f908d8264..2c10c8e94 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -10,11 +10,13 @@ module Plutarch.Test.Golden ( TermExpectation, PlutarchGoldens, - -- * Golden key + -- * Golden key and path GoldenKey, currentGoldenKey, goldenKeyString, - goldenPath, + mkGoldenKeyFromSpecPath, + defaultGoldenBasePath, + goldenTestPath, -- * Evaluation evalScriptAlwaysWithBenchmark, @@ -133,16 +135,24 @@ goldenKeyString (GoldenKey s) = T.unpack s instance Semigroup GoldenKey where GoldenKey s1 <> GoldenKey s2 = GoldenKey $ s1 <> "." <> s2 +currentGoldenKey :: HasCallStack => forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey +currentGoldenKey = do + mkGoldenKeyFromSpecPath <$> getTestDescriptionPath + +mkGoldenKeyFromSpecPath :: HasCallStack => [Text] -> GoldenKey +mkGoldenKeyFromSpecPath path = + case nonEmpty path of + Nothing -> error "cannot use currentGoldenKey from top-level spec" + Just anc -> + case nonEmpty (NE.drop 1 . NE.reverse $ anc) of + Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" + Just path -> + sconcat $ fmap GoldenKey path + goldenPath :: FilePath -> GoldenKey -> FilePath goldenPath baseDir (GoldenKey k) = baseDir T.unpack k <> ".golden" --- | Group multiple goldens values in the same file -combineGoldens :: [(GoldenKey, Text)] -> Text -combineGoldens xs = - T.intercalate "\n" $ - (\(GoldenKey k, v) -> k <> " " <> v) <$> xs - type PlutarchGoldens = ListSyntax (GoldenKey, GoldenValue) -- | Specify goldens for the given Plutarch program @@ -173,36 +183,59 @@ infixr 0 @| Hierarchy is represented by intercalating with a dot; for instance, the key for 'qux' will be "bar.qux". -} -pgoldenSpec :: HasCallStack => ListSyntax (GoldenKey, GoldenValue) -> Spec +pgoldenSpec :: HasCallStack => PlutarchGoldens -> Spec pgoldenSpec map = do - name <- currentGoldenKey + base <- currentGoldenKey let bs = runListSyntax map - goldenPathWith k = goldenPath "goldens" $ name <> k + -- Golden tests describe "golden" $ do - it "uplc" $ - pureGoldenTextFile (goldenPathWith "uplc") $ - combineGoldens $ fmap goldenValueUplcPreEval <$> bs - it "uplc.eval" $ - pureGoldenTextFile (goldenPathWith "uplc.eval") $ - combineGoldens $ fmap goldenValueUplcPostEval <$> bs - it "bench" $ - pureGoldenTextFile (goldenPathWith "bench") $ - combineGoldens $ fmap goldenValueBench <$> bs + goldenTestSpec base bs `mapM_` [minBound .. maxBound] + -- Assertion tests (if any) let asserts = flip mapMaybe bs $ \(k, v) -> do (k,) . (\f -> f (goldenValueEvaluated v) $ goldenValueBenchVal v) <$> goldenValueExpectation v unless (null asserts) $ do forM_ asserts $ \(k, v) -> it (goldenKeyString $ "" <> k <> "assert") v -currentGoldenKey :: HasCallStack => forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey -currentGoldenKey = do - fmap nonEmpty getTestDescriptionPath >>= \case - Nothing -> error "cannot use currentGoldenKey from top-level spec" - Just anc -> - case nonEmpty (NE.drop 1 . NE.reverse $ anc) of - Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" - Just path -> - pure $ sconcat $ fmap GoldenKey path +data GoldenTest + = -- | The unevaluated UPLC (compiled target of Plutarch term) + UPLCPreEval + | -- | The evaluated UPLC (evaluated result of Plutarch term) + UPLCPostEval + | -- | Benchmark of Plutarch term (will never fail) + Bench + deriving stock (Eq, Show, Ord, Enum, Bounded) + +goldenTestKey :: GoldenTest -> GoldenKey +goldenTestKey = \case + UPLCPreEval -> "uplc" + UPLCPostEval -> "uplc.eval" + Bench -> "bench" + +defaultGoldenBasePath :: FilePath +defaultGoldenBasePath = "goldens" + +goldenTestPath :: GoldenKey -> GoldenTest -> FilePath +goldenTestPath base gt = + goldenPath defaultGoldenBasePath $ base <> goldenTestKey gt + +goldenTestVal :: GoldenTest -> GoldenValue -> Text +goldenTestVal t v = case t of + UPLCPreEval -> goldenValueUplcPreEval v + UPLCPostEval -> goldenValueUplcPostEval v + Bench -> goldenValueBench v + +goldenTestSpec :: GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> Spec +goldenTestSpec base vals gt = do + it (goldenKeyString $ goldenTestKey gt) $ + pureGoldenTextFile (goldenTestPath base gt) $ + combineGoldens $ fmap (goldenTestVal gt) <$> vals + where + -- Group multiple goldens values in the same file + combineGoldens :: [(GoldenKey, Text)] -> Text + combineGoldens xs = + T.intercalate "\n" $ + (\(GoldenKey k, v) -> k <> " " <> v) <$> xs {- | Like `evalScript` but doesn't throw `EvalError`, and returns `Benchmark`. diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs new file mode 100644 index 000000000..5f7e39017 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -0,0 +1,80 @@ +module Plutarch.Test.Run (runPlutarchSpec) where + +import Control.Monad (forM_, void) +import Data.Set (Set) +import qualified Data.Set as Set +import qualified Data.Text as T +import Plutarch.Test.Golden (GoldenKey, defaultGoldenBasePath, goldenTestPath, mkGoldenKeyFromSpecPath) +import System.Directory (listDirectory) +import System.Exit (ExitCode (ExitFailure), exitWith) +import System.FilePath (()) +import Test.Syd ( + Spec, + SpecTree (..), + Timed (timedValue), + shouldExitFail, + sydTestResult, + ) +import Test.Syd.OptParse (getSettings) + +-- | Like `sydTest`, but ensures that there are no unused goldens left behind. +runPlutarchSpec :: Spec -> IO () +runPlutarchSpec spec = do + usedGoldens <- goldenPathsUsedBy <$> sydTest' spec + unusedGoldens usedGoldens >>= \case + [] -> pure () + unused -> do + putStrLn "ERROR: Unused golden files found lying around! Namely:" + forM_ unused $ \fp -> + putStrLn $ "- " <> fp + exitWith (ExitFailure 1) + +-- | Given a list of "used" goldens, return any unused golden files on disk. +unusedGoldens :: [FilePath] -> IO [FilePath] +unusedGoldens usedGoldens' = do + let usedGoldens = foldMap knownGoldens usedGoldens' + allGoldens <- Set.fromList . fmap (defaultGoldenBasePath ) <$> listDirectory defaultGoldenBasePath + pure $ Set.toList $ allGoldens `Set.difference` usedGoldens + where + knownGoldens :: FilePath -> Set FilePath + knownGoldens fp = + Set.fromList + [ fp + , -- Inject goldens for other flag values to be comprehensive in our + -- search. + replace "dev=true" "dev=false" fp + , replace "dev=false" "dev=true" fp + ] + replace a b = T.unpack . T.replace a b . T.pack + +goldenPathsUsedBy :: [SpecTree a] -> [FilePath] +goldenPathsUsedBy trees = do + flip foldMap (queryGoldens trees) $ \k -> + flip fmap [minBound .. maxBound] $ \t -> + goldenTestPath k t + +-- | Retrieve all golden keys used by the given test tree. +queryGoldens :: [SpecTree a] -> [GoldenKey] +queryGoldens = + fmap mkGoldenKeyFromSpecPath . concatMap (go []) + where + go ancestors = \case + DescribeNode "golden" _children -> + ancestors : [] + DescribeNode k children -> + concatMap (go $ k : ancestors) children + SubForestNode trees -> + concatMap (go ancestors) trees + SpecifyNode _ _ -> + mempty + PendingNode _ _ -> + mempty + +-- | Like `sydTest` but returns the test tree. +sydTest' :: Spec -> IO [SpecTree ()] +sydTest' spec = do + config <- getSettings + resultForest <- timedValue <$> sydTestResult config spec + if shouldExitFail config resultForest + then exitWith $ ExitFailure 1 + else pure $ void <$> resultForest diff --git a/plutarch-test/goldens/scripts.auth_policy.bench.golden b/plutarch-test/goldens/scripts.auth_policy.bench.golden deleted file mode 100644 index 85921866a..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.hash.golden b/plutarch-test/goldens/scripts.auth_policy.hash.golden deleted file mode 100644 index a64f01b91..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.hash.golden +++ /dev/null @@ -1 +0,0 @@ -581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden deleted file mode 100644 index b66a171ce..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.uplc.golden b/plutarch-test/goldens/scripts.auth_policy.uplc.golden deleted file mode 100644 index d6b3b2803..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.bench.golden b/plutarch-test/goldens/scripts.auth_stake_validator.bench.golden deleted file mode 100644 index 85921866a..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.hash.golden b/plutarch-test/goldens/scripts.auth_stake_validator.hash.golden deleted file mode 100644 index a64f01b91..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.hash.golden +++ /dev/null @@ -1 +0,0 @@ -581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden deleted file mode 100644 index b66a171ce..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden b/plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden deleted file mode 100644 index d6b3b2803..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.bench.golden b/plutarch-test/goldens/scripts.auth_validator.bench.golden deleted file mode 100644 index fcc1ac79d..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":155} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.hash.golden b/plutarch-test/goldens/scripts.auth_validator.hash.golden deleted file mode 100644 index cc553ffba..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.hash.golden +++ /dev/null @@ -1 +0,0 @@ -581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden deleted file mode 100644 index 22be3c42a..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.uplc.golden b/plutarch-test/goldens/scripts.auth_validator.uplc.golden deleted file mode 100644 index 22be3c42a..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.bench.golden b/plutarch-test/goldens/scripts.bench.golden new file mode 100644 index 000000000..f3e924bf2 --- /dev/null +++ b/plutarch-test/goldens/scripts.bench.golden @@ -0,0 +1,6 @@ +auth_validator.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":155} +auth_validator.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} +auth_policy.0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} +auth_policy.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} +auth_stake_validator.0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} +auth_stake_validator.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.uplc.eval.golden b/plutarch-test/goldens/scripts.uplc.eval.golden new file mode 100644 index 000000000..c3daaad0a --- /dev/null +++ b/plutarch-test/goldens/scripts.uplc.eval.golden @@ -0,0 +1,6 @@ +auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) +auth_validator.hash (program 1.0.0 "581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047") +auth_policy.0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) +auth_policy.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") +auth_stake_validator.0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) +auth_stake_validator.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.uplc.golden b/plutarch-test/goldens/scripts.uplc.golden new file mode 100644 index 000000000..b08743053 --- /dev/null +++ b/plutarch-test/goldens/scripts.uplc.golden @@ -0,0 +1,6 @@ +auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) +auth_validator.hash (program 1.0.0 "581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047") +auth_policy.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +auth_policy.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") +auth_stake_validator.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +auth_stake_validator.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index b5d6e53dd..693f87259 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -45,33 +45,20 @@ import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude import Plutarch.Test -import Plutarch.Test.Golden (currentGoldenKey, goldenPath) -import Test.Syd (Spec, describe, it, pureGoldenTextFile) +import Test.Syd (Spec, describe) spec :: Spec spec = do - describe "scripts" $ do - describe "auth_validator" $ do - pgoldenSpec $ "0" @| authValidatorTerm - prefix <- currentGoldenKey - it "hash" $ do - pureGoldenTextFile - (goldenPath "goldens" $ prefix <> "hash") - validatorHashEncoded - describe "auth_policy" $ do - pgoldenSpec $ "0" @| authPolicyTerm - prefix <- currentGoldenKey - it "hash" $ - pureGoldenTextFile - (goldenPath "goldens" $ prefix <> "hash") - policySymEncoded - describe "auth_stake_validator" $ do - pgoldenSpec $ "0" @| authStakeValidatorTerm - prefix <- currentGoldenKey - it "hash" $ - pureGoldenTextFile - (goldenPath "goldens" $ prefix <> "hash") - stakeValidatorHashEncoded + describe "scripts" . pgoldenSpec $ do + "auth_validator" @\ do + "0" @| authValidatorTerm + "hash" @| pconstant validatorHashEncoded + "auth_policy" @\ do + "0" @| authPolicyTerm + "hash" @| pconstant policySymEncoded + "auth_stake_validator" @\ do + "0" @| authStakeValidatorTerm + "hash" @| pconstant stakeValidatorHashEncoded encodeSerialise :: Serialise a => a -> Text encodeSerialise = TE.decodeUtf8 . Base16.encode . Write.toStrictByteString . encode diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index cd1774101..6d84cca1c 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -76,6 +76,8 @@ common deps , aeson >=2.0 , base , bytestring + , containers + , directory , filepath , generics-sop , mtl @@ -101,6 +103,7 @@ library Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax + Plutarch.Test.Run if flag(development) cpp-options: -DDevelopment @@ -154,6 +157,7 @@ executable plutarch-test Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax + Plutarch.Test.Run Plutarch.TraceSpec Plutarch.UnitSpec Plutarch.UPLCSpec From eefcd99b9379fd8fe8f514083874ec8ce3d9b244 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 18 Mar 2022 23:11:11 +0100 Subject: [PATCH 224/584] fix: a lot of fixes and big clean up - fixed bug that made working with nested records impossible - added example for nested record and excess use - comments and formatting - import and extension cleanup --- Plutarch/Api/V1/AssocMap.hs | 2 +- Plutarch/Api/V1/Value.hs | 2 +- Plutarch/DataRepr/Internal/HList.hs | 8 - Plutarch/TryFrom.hs | 199 +++++++++++------- ...tion_untrusted_data.dev=false.bench.golden | 3 + ..._untrusted_data.dev=false.uplc.eval.golden | 3 + ...ation_untrusted_data.dev=false.uplc.golden | 3 + ...ation_untrusted_data.dev=true.bench.golden | 3 + ...n_untrusted_data.dev=true.uplc.eval.golden | 3 + ...cation_untrusted_data.dev=true.uplc.golden | 11 +- .../plutarch-base/Plutarch/TryFromSpec.hs | 87 ++++++-- 11 files changed, 211 insertions(+), 113 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 8da6f37f8..1211c5e45 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -2,7 +2,7 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V1.AssocMap ( - PMap, + PMap (PMap), pmkPMap, ) where diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 4d9e33da9..bd2e1e82b 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -2,7 +2,7 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V1.Value ( - PValue, + PValue (PValue), PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), ) where diff --git a/Plutarch/DataRepr/Internal/HList.hs b/Plutarch/DataRepr/Internal/HList.hs index f5eeca8f3..c7d3c9f19 100644 --- a/Plutarch/DataRepr/Internal/HList.hs +++ b/Plutarch/DataRepr/Internal/HList.hs @@ -124,14 +124,6 @@ hrecField :: Term s c hrecField xs = pmaybeFromAsData $ hrecField' @name xs -{- TODO: - - add instance for PVerified b - - add function that - - either uses id, in case it is already verified - - or verifies the structure - - also add that Class constraint to the HasField instance --} - ---------- HasField instances instance forall name a as b c s. diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index c19e1a32a..0e3fcde8d 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -1,40 +1,29 @@ {-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FunctionalDependencies #-} -{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.TryFrom ( PTryFrom (..), HRecP (..), Flip (..), + ptryFromData, ) where +import Data.Coerce (Coercible) +import Data.Function ((&)) +import Data.Kind (Type) import Data.Proxy (Proxy (Proxy)) + +import GHC.Records (HasField (getField)) import GHC.TypeLits (KnownNat, Nat, Symbol, natVal, type (+)) -import Plutarch.Builtin ( - PAsData, - PBuiltinList, - PBuiltinMap, - PBuiltinPair, - PData, - PIsData (pfromData), - pasByteStr, - pasConstr, - pasInt, - pasList, - pasMap, - pchooseListBuiltin, - pdata, - pforgetData, - pfstBuiltin, - ppairDataBuiltin, - psndBuiltin, - ) +import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) +import Plutarch.Bool (pif, (#==)) import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) +import Plutarch.Unit (PUnit (PUnit)) + import Plutarch.Internal.Other ( PInner, POpaque, @@ -52,8 +41,6 @@ import Plutarch.Internal.Other ( import Plutarch.Trace (ptraceError) -import Plutarch.Unit (PUnit (PUnit)) - import Plutarch.DataRepr.Internal ( PDataRecord, PDataSum, @@ -62,34 +49,43 @@ import Plutarch.DataRepr.Internal ( pdnil, ) -import Plutarch.Bool (pif, (#==)) - import Plutarch.List ( phead, pmap, ptail, ) -import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) - -import GHC.Records (HasField (getField)) +import Plutarch.Builtin ( + PAsData, + PBuiltinList, + PBuiltinMap, + PBuiltinPair, + PData, + PIsData (pfromData), + pasByteStr, + pasConstr, + pasInt, + pasList, + pasMap, + pchooseListBuiltin, + pdata, + pforgetData, + pfstBuiltin, + ppairDataBuiltin, + psndBuiltin, + ) import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) import Plutarch.DataRepr.Internal (PIsDataRepr (PIsDataReprRepr), PIsDataReprInstances) -import Data.Coerce (Coercible) -import Data.Kind (Type) - -import Data.Function ((&)) - ----------------------- The class PTryFrom ---------------------------------------------- {- | - This checks the datastructure for validity. - If you don't care about parts of the datastructure - don't verify those parts, just let it return a PData - instead + This checks the data structure for validity. + If you don't care about parts of the structure + don't verify those parts, just put a `PData` at + the places you don't care about. Be aware this might get really expensive, so only use it if you cannot establish trust otherwise (e.g. via only checking a part of your Data with @@ -100,9 +96,9 @@ import Data.Function ((&)) - example: `ptryFrom PData (PAsData (PBuiltinList PData))` must only succeed if the underlying representation is a `BuiltinList` containing any `PData` - - all conversion are fallible, this happens if the representation doesn't match + - all conversions are fallible, this happens if the representation doesn't match the expected type. - - the operation `ptryFrom` proves equality between the less expressive `PType` `a` and + - the operation `ptryFrom @a @b` proves equality between the less expressive `PType` `a` and the more expressive `PType` `b`, hence the first element of the resulting Tuple must always be wrapped in `PAsData` if the origin type was `PData` (see law 1) - the result type `b` must always be safe than the origin type `a`, i.e. it must carry @@ -112,11 +108,20 @@ class PTryFrom (a :: PType) (b :: PType) where type PTryFromExcess a b :: PType ptryFrom :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r +-- | Utility function that saves a type application, `ptryFromData @b === ptryFrom @PData @b` +ptryFromData :: + forall b s r. + ( PTryFrom PData b + ) => + Term s PData -> + ((Term s b, Reduce (PTryFromExcess PData b s)) -> Term s r) -> + Term s r +ptryFromData = ptryFrom @PData @b + ----------------------- Reducible and Flip ---------------------------------------------- class (Coercible (Reduce x) x) => Reducible (x :: Type) where type Reduce x :: Type - type Reduce x = x instance Reducible () where type Reduce () = () @@ -131,10 +136,14 @@ newtype Flip f a b = MkFlip {unFlip :: f b a} ----------------------- HRecP and friends ----------------------------------------------- +-- | Like @HRec@ but parametrised over a list of `PType`s, not `Type`s. data HRecP (as :: [(Symbol, PType)]) (s :: S) where HNil :: HRecP '[] s HCons :: forall name a as s. Reduce (a s) -> HRecP as s -> HRecP ('(name, a) ': as) s +{- | allows accessing excess fields in an HRec, as of ghc921 you can + also use `OverloadedRecordDot` with this. +-} getExcessField :: forall name a as s. ( ElemOf name a as @@ -173,27 +182,24 @@ instance ----------------------- PData instances ------------------------------------------------- +-- | recover a PInteger instance PTryFrom PData (PAsData PInteger) where type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) pure $ (punsafeCoerce opq, ver) +-- | recover a PByteString instance PTryFrom PData (PAsData PByteString) where type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) pure $ (punsafeCoerce opq, ver) -instance PTryFrom PData PData where - type PTryFromExcess PData PData = HRecP '[] - ptryFrom opq = runTermCont $ pure $ (opq, HNil) - -instance PTryFrom PData (PAsData PData) where - type PTryFromExcess PData (PAsData PData) = Flip Term PData - ptryFrom opq = runTermCont $ pure (pdata opq, opq) - --- TODO: add the excess inner type +{- | + recover a `PBuiltinMap`, the excess type contains the unwrapped map + as well as a list containing the excess of all contained tuples +-} instance ( PTryFrom PData (PAsData a) , PTryFrom PData (PAsData b) @@ -205,21 +211,27 @@ instance verMap <- tcont $ plet (pasMap # opq) let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) verifyPair = plam $ \tup -> unTermCont $ do - (verfst, _) <- tcont $ ptryFrom @PData @(PAsData a) $ pfstBuiltin # tup - (versnd, _) <- tcont $ ptryFrom @PData @(PAsData b) $ psndBuiltin # tup + (verfst, _) <- tcont $ ptryFromData @(PAsData a) $ pfstBuiltin # tup + (versnd, _) <- tcont $ ptryFromData @(PAsData b) $ psndBuiltin # tup pure $ ppairDataBuiltin # verfst # versnd ver <- tcont $ plet $ pmap # verifyPair # verMap pure (punsafeCoerce opq, ver) --- TODO: add the excess inner type list -instance {-# OVERLAPPING #-} PTryFrom PData (PAsData (PBuiltinList PData)) where +{- | + This verifies a list to be indeed a list but doesn't recover the inner data + use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData PData)))` + as it is significantly faster +-} +instance PTryFrom PData (PAsData (PBuiltinList PData)) where type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasList # opq) pure $ (punsafeCoerce opq, ver) +{- | + Recover a `PBuiltinList (PAsData a)` +-} instance - {-# OVERLAPPABLE #-} ( PTryFrom PData (PAsData a) , PIsData a ) => @@ -232,13 +244,15 @@ instance verify :: Term _ (PData :--> PAsData a) verify = plam $ \e -> unTermCont $ do - (wrapped, _) <- tcont $ ptryFrom @PData @(PAsData a) $ e + (wrapped, _) <- tcont $ ptryFromData @(PAsData a) $ e pure wrapped ver <- tcont $ plet $ pmap # verify # lst pure $ (punsafeCoerce opq, ver) +{- | + Recover a `PAsData (PBuiltinPair a b)` +-} instance - {-# OVERLAPPABLE #-} ( PTryFrom PData a , a ~ PAsData a' , PIsData a' @@ -252,17 +266,20 @@ instance ptryFrom opq = runTermCont $ do tup <- tcont $ plet (pfromData $ punsafeCoerce opq) let fst' :: Term _ a - fst' = unTermCont $ fst <$> tcont (ptryFrom @PData @a $ pforgetData $ pfstBuiltin # tup) + fst' = unTermCont $ fst <$> tcont (ptryFromData @a $ pforgetData $ pfstBuiltin # tup) snd' :: Term _ b - snd' = unTermCont $ fst <$> tcont (ptryFrom @PData @b $ pforgetData $ psndBuiltin # tup) + snd' = unTermCont $ fst <$> tcont (ptryFromData @b $ pforgetData $ psndBuiltin # tup) ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' pure $ (punsafeCoerce opq, ver) +----------------------- PDataRecord instances ------------------------------------------- + type FromRecordFields :: [PLabeledType] -> [(Symbol, PType)] type family FromRecordFields xs where FromRecordFields '[] = '[] FromRecordFields ((label ':= ptyp) ': xs) = '(label, Flip Term ptyp) ': (FromRecordFields xs) +-- | Try to transform a `PBuiltinList PData` to a `PDataRecord` instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] ptryFrom opq = runTermCont $ do @@ -276,20 +293,46 @@ instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where instance ( PTryFrom (PBuiltinList PData) (PDataRecord xs) , PTryFrom PData (PAsData a) - , PTryFromExcess PData (PAsData a) ~ Flip Term a , PTryFromExcess (PBuiltinList PData) (PDataRecord xs) ~ HRecP (FromRecordFields xs) ) => PTryFrom (PBuiltinList PData) (PDataRecord ((label ':= a) ': xs)) where type PTryFromExcess (PBuiltinList PData) (PDataRecord ((label ':= a) ': xs)) = - HRecP ('(label, (PTryFromExcess PData (PAsData a))) ': FromRecordFields xs) + HRecP ('(label, PTryFromExcess PData (PAsData a)) ': FromRecordFields xs) ptryFrom lst = runTermCont $ do - (verhead, exchead) <- tcont $ ptryFrom @PData @(PAsData a) $ phead # lst + (verhead, exchead) <- tcont $ ptryFromData @(PAsData a) $ phead # lst (vertail, exctail) <- tcont $ ptryFrom @(PBuiltinList PData) @(PDataRecord xs) $ ptail # lst rec <- tcont $ plet $ pdcons @label # verhead # vertail pure (rec, HCons exchead exctail) +{- | recover a record from `PData`, the unwrapped record can be found in a field + called "unwrapped" +-} +instance + ( PTryFromExcess (PBuiltinList PData) (PDataRecord xs) ~ HRecP y + , PTryFrom (PBuiltinList PData) (PDataRecord xs) + ) => + PTryFrom PData (PAsData (PDataRecord xs)) + where + type + PTryFromExcess PData (PAsData (PDataRecord xs)) = + HRecP '[ '("unwrapped", (Flip Term (PDataRecord xs)))] `HConcat` PTryFromExcess (PBuiltinList PData) (PDataRecord xs) + ptryFrom opq = runTermCont $ do + lst <- snd <$> tcont (ptryFromData @(PAsData (PBuiltinList PData)) opq) + (rec, exc) <- tcont $ (ptryFrom @(PBuiltinList PData) @(PDataRecord xs) lst) + pure (punsafeCoerce opq, HCons rec exc) + +type family rec1 `HConcat` rec2 where + HRecP '[] `HConcat` HRecP l1 = HRecP l1 + HRecP (e ': l0) `HConcat` HRecP l1 = HRecP l0 `HConcat` HRecP (e ': l1) + +----------------------- PDataSum Instances ---------------------------------------------- + +{- | recover a PDataSum, this is really slow as it requires the whole record to be recovered + if possible try to first recover a `PDataSum` containing only `PAsData PData`and then recover + the field itself after matching on the constructor +-} instance forall ys. ( SumValidation 0 ys @@ -333,7 +376,7 @@ instance instance {-# OVERLAPPING #-} SumValidation n '[] where validateSum _ = ptraceError "reached end of sum while still not having found the constructor" ------------------------ POpaque Instances ----------------------------------------------- +----------------------- POpaque ans other utility instances ----------------------------- {- | for none of the opaque instances it can be verified @@ -352,10 +395,13 @@ instance ptryFrom opq = runTermCont $ do let prop :: Term _ a prop = punsafeCoerce opq - ver' <- fst <$> TermCont (ptryFrom @PData @(PAsData a) $ pforgetData $ pdata prop) + ver' <- fst <$> TermCont (ptryFromData @(PAsData a) $ pforgetData $ pdata prop) ver <- tcont $ plet ver' pure $ (punsafeCoerce opq, ver) +{- | if there is an instance to recover something that is unwrapped from something that is + unwrapped, then there is also the possibility to recover the whole thing but wrapped +-} instance ( PTryFrom a b , PIsData a @@ -368,22 +414,19 @@ instance ver' <- snd <$> TermCont (ptryFrom @a @b (pfromData opq)) pure $ (punsafeCoerce opq, ver') -instance - ( PTryFromExcess (PBuiltinList PData) (PDataRecord xs) ~ HRecP (FromRecordFields xs) - , PTryFrom (PBuiltinList PData) (PDataRecord xs) - ) => - PTryFrom PData (PAsData (PDataRecord xs)) - where - type - PTryFromExcess PData (PAsData (PDataRecord xs)) = - HRecP ('("unwrapped", (Flip Term (PDataRecord xs))) ': FromRecordFields xs) - ptryFrom opq = runTermCont $ do - lst <- snd <$> tcont (ptryFrom @PData @(PAsData (PBuiltinList PData)) opq) - (rec, exc) <- tcont $ (ptryFrom @(PBuiltinList PData) @(PDataRecord xs) lst) - pure (punsafeCoerce opq, HCons @"unwrapped" rec exc) +-- | serves as the base case for some conversions +instance PTryFrom PData PData where + type PTryFromExcess PData PData = HRecP '[] + ptryFrom opq = runTermCont $ pure $ (opq, HNil) ------------------------ PIsDataReprInstances -------------------------------------------- +-- | serves as the base case for some conversions +instance PTryFrom PData (PAsData PData) where + type PTryFromExcess PData (PAsData PData) = Flip Term PData + ptryFrom opq = runTermCont $ pure (pdata opq, opq) + +----------------------- PIsDataReprInstances instance ----------------------------------- +-- | you can instantiate `PTryFrom` for your own datatype as demonstrated in the spec instance ( PIsDataRepr a , SumValidation 0 (PIsDataReprRepr a) @@ -397,8 +440,6 @@ instance reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) pure $ (pdata $ punsafeFrom reprsum, HNil) --- TODO: add overlapping instance for single constructor types that has actual excess - ----------------------- HasField instance ----------------------------------------------- instance (ElemOf name ptyp rec, Reduce (ptyp s) ~ out) => HasField name (HRecP rec s) out where diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden index 3912255f5..153644d85 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden @@ -20,6 +20,9 @@ removing the data wrapper.working.(String, String) == (String, String) {"exBudge removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} +removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":6784676,"exBudgetMemory":12036,"scriptSizeBytes":107} +removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":107} +removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":5874814,"exBudgetMemory":10877,"scriptSizeBytes":97} checking PValue and PMap for validity.PMap.valid0 {"exBudgetCPU":13804861,"exBudgetMemory":25916,"scriptSizeBytes":169} checking PValue and PMap for validity.PMap.invalid1 {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":169} checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden index 88518c12e..841f3a87a 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden @@ -20,6 +20,9 @@ removing the data wrapper.working.(String, String) == (String, String) (program removing the data wrapper.working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 #9f9f182affff) +removing the data wrapper.recovering a nested record.fails (program 1.0.0 error) +removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 True) checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 error) checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden index 2486c001e..743aa7cee 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden @@ -20,6 +20,9 @@ removing the data wrapper.working.(String, String) == (String, String) (program removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (listData (i11 (iData 42) i12)) i12)) (i10 (i9 i6) i11)) (force (i6 (i7 i5) (delay ()) (delay error)))) (i8 (i7 i3) i9)) (force (i4 (i5 i2) (delay ()) (delay error)))) (unIData (i5 i1))) (unListData (i4 i1))) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5)))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (listData (i11 (iData 42) i12)) i12)) (i10 (i9 i6) i11)) (force (i6 (i7 i5) (delay ()) (delay error)))) (i8 (i7 i3) i9)) (force (i4 (i5 i2) (delay ()) (delay error)))) (unBData (i5 i1))) (unListData (i4 i1))) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5)))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (i10 (i9 i6) i11)) (force (i6 (i7 i5) (delay ()) (delay error)))) (i8 (i7 i3) i9)) (force (i4 (i5 i2) (delay ()) (delay error)))) (unIData (i5 i1))) (unListData (i4 i1))) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5))))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden index 683137b4e..2200df41a 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden @@ -20,6 +20,9 @@ removing the data wrapper.working.(String, String) == (String, String) {"exBudge removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} +removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":6993087,"exBudgetMemory":12736,"scriptSizeBytes":149} +removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":149} +removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":6083225,"exBudgetMemory":11577,"scriptSizeBytes":139} checking PValue and PMap for validity.PMap.valid0 {"exBudgetCPU":13804861,"exBudgetMemory":25916,"scriptSizeBytes":169} checking PValue and PMap for validity.PMap.invalid1 {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":169} checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden index 88518c12e..841f3a87a 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden @@ -20,6 +20,9 @@ removing the data wrapper.working.(String, String) == (String, String) (program removing the data wrapper.working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 #9f9f182affff) +removing the data wrapper.recovering a nested record.fails (program 1.0.0 error) +removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 True) checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 error) checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden index 366610c35..8c9dee94e 100644 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden +++ b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden @@ -20,6 +20,9 @@ removing the data wrapper.working.(String, String) == (String, String) (program removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i13 (listData (i13 (iData 42) i14)) i14)) (i12 (i11 i6) i13)) (force (i6 (i7 i5) (delay ()) (delay (force (i8 i9 (delay error))))))) (i10 (i9 i3) i11)) (force (i4 (i5 i2) (delay ()) (delay (force (i6 i7 (delay error))))))) (unIData (i7 i1))) (unListData (i6 i1))) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force tailList)) (force trace)) "list is longer than zero") (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i13 (listData (i13 (iData 42) i14)) i14)) (i12 (i11 i6) i13)) (force (i6 (i7 i5) (delay ()) (delay (force (i8 i9 (delay error))))))) (i10 (i9 i3) i11)) (force (i4 (i5 i2) (delay ()) (delay (force (i6 i7 (delay error))))))) (unBData (i7 i1))) (unListData (i6 i1))) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force tailList)) (force trace)) "list is longer than zero") (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (i12 (i11 i6) i13)) (force (i6 (i7 i5) (delay ()) (delay (force (i8 i9 (delay error))))))) (i10 (i9 i3) i11)) (force (i4 (i5 i2) (delay ()) (delay (force (i6 i7 (delay error))))))) (unIData (i7 i1))) (unListData (i6 i1))) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7))))) (force (force chooseList))) (force tailList)) (force trace)) "list is longer than zero") (force headList)) (force mkCons)) [ ])) checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) @@ -27,8 +30,8 @@ checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 , #a149736f6d65546f6b656e01 ) ])) checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:386:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:336:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:327:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:386:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:336:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:327:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:386:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:336:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:327:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:386:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:336:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:327:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:418:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:368:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:359:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:418:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:368:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:359:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:418:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:368:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:359:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:418:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:368:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:359:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i10 (iData 4) (i10 (bData i11) i12))) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i14 (i11 (i12 i5)) i1) (i13 (i10 (i9 (i11 i4))) i15)) (force (i7 (i8 (i8 (i10 i3))) (delay ()) (delay (force (i11 i6 (delay error))))))) (unBData (i8 (i7 (i9 i2))))) (unIData (i7 (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i15 (i12 (i13 i5)) i1) (i14 (i11 (i10 (i12 i4))) i16)) (force (i8 (i9 (i9 (i11 i3))) (delay ()) (delay (force (i12 i7 (delay error))))))) (unBData (i9 (i8 (i10 i2))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 i1 (delay i16) (delay (i14 (i3 (i11 i1)) (i2 (i10 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i8 (i9 i1)))))) (delay (force (i10 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData (constrData 0 (i10 (iData 4) (i10 (bData i11) i12)))))))) (unConstrData (constrData 0 (i9 (iData 4) (i9 (bData i10) i11)))))) (force ifThenElse)) (force (force fstPair))) "list is longer than zero") (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) (force trace)) (force mkCons)) #666f6f) [ ])) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs b/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs index b0184d2d9..7b9a2e291 100644 --- a/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs @@ -1,16 +1,16 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE OverloadedRecordDot #-} -{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.TryFromSpec (spec) where -import Test.Syd - +-- Haskell imports import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) +import Test.Syd + +-- Plutus and PlutusTx imports import Plutus.V1.Ledger.Api ( Address (Address), Credential (ScriptCredential), @@ -22,6 +22,9 @@ import Plutus.V1.Ledger.Api ( TxOut (TxOut, txOutAddress, txOutDatumHash, txOutValue), ) +import Plutus.V1.Ledger.Value (Value) +import qualified Plutus.V1.Ledger.Value as Value + import PlutusTx ( Data (B, Constr, I), ) @@ -29,11 +32,26 @@ import PlutusTx ( import PlutusTx.AssocMap (Map) import qualified PlutusTx.AssocMap as PlutusMap +-- Plutarch imports +import Plutarch.Prelude + +import Plutarch.Test ( + passert, + pfails, + pgoldenSpec, + plutarchDevFlagDescribe, + psucceeds, + (@->), + (@\), + (@|), + ) + +import Plutarch (ClosedTerm, popaque) + import Plutarch.Unsafe ( punsafeCoerce, ) -import Plutarch import Plutarch.Api.V1 ( PAddress, PCurrencySymbol, @@ -52,24 +70,23 @@ import Plutarch.Api.V1 ( PValidator, PValue, ) + import Plutarch.Builtin ( PBuiltinMap, pforgetData, ppairDataBuiltin, ) -import Plutarch.Prelude + import Plutarch.TryFrom ( Flip, PTryFrom (PTryFromExcess, ptryFrom), + ptryFromData, ) import Plutarch.ApiSpec (info, purpose) import qualified Plutarch.ApiSpec as Api import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) -import Plutarch.Test -import Plutus.V1.Ledger.Value (Value) -import qualified Plutus.V1.Ledger.Value as Value spec :: Spec spec = do @@ -158,13 +175,13 @@ spec = do @(PDataRecord '["foo" ':= PInteger, "bar" ':= PData]) @(PDataRecord '["foo" ':= PInteger, "bar" ':= PByteString]) (pdata $ pdcons @"foo" # (pdata $ pconstant 3) #$ pdcons @"bar" # (pdata $ pconstant "baz") # pdnil) - @-> psucceeds + @-> psucceeds "completely" @| checkDeep @(PDataRecord '["foo" ':= PInteger, "bar" ':= PByteString]) @(PDataRecord '["foo" ':= PInteger, "bar" ':= PByteString]) (pdata (pdcons @"foo" # (pdata $ pconstant 3) #$ pdcons @"bar" # (pdata $ pconstant "baz") # pdnil)) - @-> psucceeds + @-> psucceeds "removing the data wrapper" @\ do "erroneous" @\ do "(String, Integer) /= (String, String)" @@ -201,6 +218,21 @@ spec = do -- ... than this "check structure partly" @| partialCheck @-> psucceeds + "recovering a nested record" @\ do + "succeeds" + @| checkDeep + @(PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])]) + @(PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])]) + (pdata $ pdcons # (pdata $ pdcons # pdata (pconstant 42) # pdnil) # pdnil) + @-> psucceeds + "fails" + @| checkDeep + @(PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PByteString])]) + @(PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])]) + (pdata $ pdcons # (pdata $ pdcons # pdata (pconstant 42) # pdnil) # pdnil) + @-> pfails + "sample usage contains the right value" + @| pconstant 42 #== theField @-> passert "checking PValue and PMap for validity" @\ do "PMap" @\ do let ms0 :: Term _ (PBuiltinMap PInteger PUnit) @@ -266,14 +298,14 @@ spec = do ------------------- Checking deeply, shallowly and unwrapping ---------------------- checkDeep :: - forall (target :: PType) (actual :: PType) (s :: S). + forall (target :: PType) (actual :: PType). ( PTryFrom PData (PAsData target) , PIsData actual , PIsData target ) => - Term s (PAsData actual) -> - Term s (PAsData target) -checkDeep t = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData target) @s $ pforgetData t) + ClosedTerm (PAsData actual) -> + ClosedTerm (PAsData target) +checkDeep t = unTermCont $ fst <$> TermCont (ptryFromData @(PAsData target) $ pforgetData t) checkDeepUnwrap :: forall (target :: PType) (actual :: PType) (s :: S). @@ -283,7 +315,7 @@ checkDeepUnwrap :: ) => Term s (PAsData actual) -> Term s (PAsData target) -checkDeepUnwrap t = unTermCont $ fst <$> TermCont (ptryFrom @PData @(PAsData target) @s $ pforgetData t) +checkDeepUnwrap t = unTermCont $ fst <$> TermCont (ptryFromData @(PAsData target) @s $ pforgetData t) sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1 .. 100] @@ -310,14 +342,14 @@ pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (p instance PTryFrom PData (PAsData PNatural) where type PTryFromExcess PData (PAsData PNatural) = Flip Term PNatural ptryFrom opq = runTermCont $ do - (ter, exc) <- TermCont $ ptryFrom @PData @(PAsData PInteger) opq + (ter, exc) <- TermCont $ ptryFromData @(PAsData PInteger) opq ver <- tcont $ plet $ pmkNatural #$ exc pure $ (punsafeCoerce ter, ver) validator :: Term s PValidator validator = phoistAcyclic $ plam $ \dat red ctx -> unTermCont $ do - trustedRedeemer <- (\(snd -> red) -> red) <$> (TermCont $ ptryFrom @PData @(PAsData (PBuiltinList (PAsData PNatural))) red) + trustedRedeemer <- (\(snd -> red) -> red) <$> (TermCont $ ptryFromData @(PAsData (PBuiltinList (PAsData PNatural))) red) let trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) trustedDatum = pfromData $ punsafeCoerce dat -- make the Datum and Redeemer trusted @@ -467,12 +499,12 @@ toDatadList = pdata . (foldr go pnil) mapTestSucceeds :: ClosedTerm (PAsData (PBuiltinMap PByteString PInteger)) mapTestSucceeds = unTermCont $ do - (val, _) <- TermCont $ ptryFrom @PData $ pforgetData sampleMap + (val, _) <- TermCont $ ptryFromData $ pforgetData sampleMap pure val mapTestFails :: ClosedTerm (PAsData (PBuiltinMap PInteger PInteger)) mapTestFails = unTermCont $ do - (val, _) <- TermCont $ ptryFrom @PData $ pforgetData sampleMap + (val, _) <- TermCont $ ptryFromData $ pforgetData sampleMap pure val sampleMap :: Term _ (PAsData (PBuiltinMap PByteString PInteger)) @@ -503,4 +535,19 @@ data PAB (s :: S) (PlutusType, PIsData) via PIsDataReprInstances PAB +-- here we can derive the `PTryFrom` instance for PAB via the newtype wrapper +-- `PIsDataReprInstances` deriving via PAsData (PIsDataReprInstances PAB) instance PTryFrom PData (PAsData PAB) + +------------------- Sample usage with recovered record type ------------------------ + +untrustedRecord :: Term s PData +untrustedRecord = + let rec :: Term s (PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) + rec = pdata $ pdcons # (pdata $ pdcons # pdata (pconstant 42) # pdnil) # pdnil + in pforgetData rec + +theField :: Term s PInteger +theField = unTermCont $ do + (_, exc) <- tcont (ptryFrom @_ @(PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) untrustedRecord) + pure $ exc._0._1 From b0c4dd8a434093d669b2a3b92f2bfb637ee7b33b Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 19 Mar 2022 12:59:08 +0100 Subject: [PATCH 225/584] merge: merge staging - merged staging and resolved conflicts --- CHANGELOG.md | 6 +- Plutarch/Bool.hs | 27 ++---- flake.nix | 23 +---- plutarch-test/Main.hs | 38 +++++++- plutarch-test/common/Plutarch/Test.hs | 97 +------------------ plutarch-test/common/Plutarch/Test/Golden.hs | 95 ++++++++++++------ plutarch-test/common/Plutarch/Test/Run.hs | 80 +++++++++++++++ .../Plutarch/FFISpec.hs | 0 .../Plutarch/FieldSpec.hs | 0 .../Plutarch/MonadicSpec.hs | 0 .../Plutarch/TryFromSpec.hs | 0 ...pi.example.signatory.dev=true.bench.golden | 4 +- ...api.example.signatory.dev=true.uplc.golden | 4 +- .../goldens/scripts.auth_policy.bench.golden | 1 - .../goldens/scripts.auth_policy.hash.golden | 1 - .../scripts.auth_policy.uplc.eval.golden | 1 - .../goldens/scripts.auth_policy.uplc.golden | 1 - .../scripts.auth_stake_validator.bench.golden | 1 - .../scripts.auth_stake_validator.hash.golden | 1 - ...ipts.auth_stake_validator.uplc.eval.golden | 1 - .../scripts.auth_stake_validator.uplc.golden | 1 - .../scripts.auth_validator.bench.golden | 1 - .../scripts.auth_validator.hash.golden | 1 - .../scripts.auth_validator.uplc.eval.golden | 1 - .../scripts.auth_validator.uplc.golden | 1 - plutarch-test/goldens/scripts.bench.golden | 6 ++ .../goldens/scripts.uplc.eval.golden | 6 ++ plutarch-test/goldens/scripts.uplc.golden | 6 ++ ...tion_untrusted_data.dev=false.bench.golden | 35 ------- ..._untrusted_data.dev=false.uplc.eval.golden | 35 ------- ...ation_untrusted_data.dev=false.uplc.golden | 37 ------- ...ation_untrusted_data.dev=true.bench.golden | 35 ------- ...n_untrusted_data.dev=true.uplc.eval.golden | 35 ------- ...cation_untrusted_data.dev=true.uplc.golden | 37 ------- .../plutarch-base/Plutarch/ScriptsSpec.hs | 34 +++---- plutarch-test/plutarch-test.cabal | 8 +- 36 files changed, 238 insertions(+), 422 deletions(-) create mode 100644 plutarch-test/common/Plutarch/Test/Run.hs rename plutarch-test/{plutarch-base => conditional}/Plutarch/FFISpec.hs (100%) rename plutarch-test/{plutarch-base => conditional}/Plutarch/FieldSpec.hs (100%) rename plutarch-test/{plutarch-base => conditional}/Plutarch/MonadicSpec.hs (100%) rename plutarch-test/{plutarch-base => conditional}/Plutarch/TryFromSpec.hs (100%) delete mode 100644 plutarch-test/goldens/scripts.auth_policy.bench.golden delete mode 100644 plutarch-test/goldens/scripts.auth_policy.hash.golden delete mode 100644 plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden delete mode 100644 plutarch-test/goldens/scripts.auth_policy.uplc.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.bench.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.hash.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.bench.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.hash.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.uplc.golden create mode 100644 plutarch-test/goldens/scripts.bench.golden create mode 100644 plutarch-test/goldens/scripts.uplc.eval.golden create mode 100644 plutarch-test/goldens/scripts.uplc.golden delete mode 100644 plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aa796bce..5680031b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # Unreleased -- Add `pshow` and `ptraceShowId` +- Added module `Plutarch.Show` with the `PShow` type class, as well as functions `pshow` and `ptraceShowId`. Started by [#352](https://github.com/Plutonomicon/plutarch/pull/352) @@ -14,6 +14,10 @@ Started by [#335](https://github.com/Plutonomicon/plutarch/pull/335) +- Added module `Plutarch.FFI` for interoperability with PlutusTx. + +- Added `DerivePConstantViaBuiltin`, deprecating `DerivePConstantViaNewtype`. + - `TermCont`: Parametrize by result type; add `MonadFail` instance; etc. Also, export from `Plutarch.TermCont`, and then from `Plutarch.Prelude` (TermCont is no longer exported by `Plutarch.Internal`). diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 63fe2814b..ee2882767 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -1,6 +1,4 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DefaultSignatures #-} -{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -162,21 +160,16 @@ gpeq = plam $ \x y -> pmatch x $ \x' -> pmatch y $ \y' -> - gpeq' @t (gpfrom x') (gpfrom y') - -gpeq' :: - forall a s. - All2 PEq (PCode s a) => - SOP (Term s) (PCode s a) -> - SOP (Term s) (PCode s a) -> - Term s PBool + gpeq' (gpfrom x') (gpfrom y') + +gpeq' :: All2 PEq xss => SOP (Term s) xss -> SOP (Term s) xss -> Term s PBool gpeq' (SOP c1) (SOP c2) = ccompare_NS (Proxy @(All PEq)) (pcon PFalse) eqProd (pcon PFalse) c1 c2 + +eqProd :: All PEq xs => NP (Term s) xs -> NP (Term s) xs -> Term s PBool +eqProd p1 p2 = + pands $ hcollapse $ hcliftA2 (Proxy :: Proxy PEq) eqTerm p1 p2 where - eqProd :: All PEq xs => NP (Term s) xs -> NP (Term s) xs -> Term s PBool - eqProd p1 p2 = - pands $ hcollapse $ hcliftA2 (Proxy :: Proxy PEq) eqTerm p1 p2 - where - eqTerm :: forall a. PEq a => Term s a -> Term s a -> K (Term s PBool) a - eqTerm a b = - K $ a #== b + eqTerm :: forall s a. PEq a => Term s a -> Term s a -> K (Term s PBool) a + eqTerm a b = + K $ a #== b diff --git a/flake.nix b/flake.nix index 3b3c8fc2e..baf0d72f7 100644 --- a/flake.nix +++ b/flake.nix @@ -463,28 +463,7 @@ then source // { subdirs = source.subdirs ++ [ subdir ]; } else source; in let pkgSet = (nixpkgsFor system).haskell-nix.cabalProject' ({ - # This is truly a horrible hack but is necessary for sydtest-discover to work. - src = - if ghcName == ghcVersion - then - pkgs.runCommand "fake-src" { } '' - # Prevent `sydtest-discover` from using GHC810 only modules when building with GHC9 - # https://github.com/NorfairKing/sydtest/blob/master/sydtest-discover/src/Test/Syd/Discover.hs - cp -rT ${./.} $out - chmod -R u+w $out/plutarch-test - rm -f $out/plutarch-test/plutarch-base/Plutarch/FFISpec.hs - '' - else - pkgs.runCommand "fake-src" { } '' - # Prevent `sydtest-discover` from using GHC9 only modules when building with GHC810 - # https://github.com/NorfairKing/sydtest/blob/master/sydtest-discover/src/Test/Syd/Discover.hs - cp -rT ${./.} $out - chmod -R u+w $out/plutarch-test - rm -f $out/plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs - rm -f $out/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs - rm -f $out/plutarch-test/plutarch-base/Plutarch/RecSpec.hs - rm -f $out/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs - ''; + src = ./.; compiler-nix-name = ghcName; extraSources = if ghcName == ghcVersion then extraSources diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index a946e9271..d2973aee0 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -1,13 +1,43 @@ +{-# LANGUAGE CPP #-} + module Main (main) where import qualified BaseSpec import qualified ExtraSpec + +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +import qualified Plutarch.FieldSpec as FieldSpec +import qualified Plutarch.MonadicSpec as MonadicSpec +import Plutarch.Test.Run (runPlutarchSpec) +import Test.Syd (Spec, describe) +#else +import qualified Plutarch.FFISpec as FFISpec +import Test.Syd (Spec, describe, sydTest) +#endif + import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Test.Syd (sydTest) main :: IO () main = do setLocaleEncoding utf8 - sydTest BaseSpec.spec - putStrLn "\n\n\n--------------------------------------------\n\n\n" - sydTest ExtraSpec.spec + +-- We use 'runPlutarchSpec' to test for unused goldens, but do so only in GHC +-- 9. Because, under GHC 8 certain modules are disabled (see the CPP below) +-- which leads to legitimately unused goldens detected leading to false +-- positive in test failure. +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + runPlutarchSpec spec +#else + sydTest spec +#endif + +spec :: Spec +spec = do + BaseSpec.spec + ExtraSpec.spec +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + describe "field" FieldSpec.spec + describe "monadic" MonadicSpec.spec +#else + describe "FFI" FFISpec.spec +#endif diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index cdb137eab..67e9a9099 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -29,36 +29,20 @@ module Plutarch.Test ( -- * Benchmark type for use in `(@:->)` Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), ScriptSizeBytes, - - -- * Deprecated exports - golden, - goldens, - PlutarchGolden (All, Bench, PrintTerm), - getGoldenFilePrefix, - goldenFilePath, ) where -import Control.Monad (when) -import qualified Data.Aeson.Text as Aeson import Data.Kind (Type) import Data.Text (Text) -import qualified Data.Text as T -import qualified Data.Text.Lazy as TL -import System.FilePath import Test.Syd ( Expectation, - Spec, TestDefM, describe, expectationFailure, - getTestDescriptionPath, - it, - pureGoldenTextFile, shouldBe, shouldSatisfyNamed, ) -import Plutarch +import Plutarch (ClosedTerm, PCon (pcon), compile, printScript) import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evalScript) import Plutarch.Test.Benchmark ( @@ -68,7 +52,6 @@ import Plutarch.Test.Benchmark ( import Plutarch.Test.Golden ( PlutarchGoldens, TermExpectation, - compileD, evalScriptAlwaysWithBenchmark, pgoldenSpec, (@->), @@ -188,81 +171,3 @@ plutarchDevFlagDescribe m = xScript = fst . evalScriptAlwaysWithBenchmark $ compile x infixr 1 @== - --- TODO: All the code below will be deleted, in favour of Golden.hs. - -{- | Whether to run all or a particular golden test - - Typically you want to use `All` -- this produces printTerm and benchmark - goldens. - - Occasionally you want `PrintTerm` because you don't care to benchmark that - program. - - Use `Bench` to only benchmark the program. --} -data PlutarchGolden - = All - | Bench - | PrintTerm - deriving stock (Eq, Show) - --- | Run golden tests on the given Plutarch program -{-# DEPRECATED golden "Use `pgoldenSpec` instead." #-} -golden :: PlutarchGolden -> ClosedTerm a -> Spec -golden pg p = - goldens pg [("0", popaque p)] - -{- | Like `golden` but for multiple programs - - Multiple programs use a single golden file. Each output separated from the - keyword with a space. --} -{-# DEPRECATED goldens "Use `pgoldenSpec` instead." #-} -goldens :: PlutarchGolden -> [(String, ClosedTerm a)] -> Spec -goldens pg ps = do - name <- getGoldenFilePrefix - describe "golden" $ do - -- Golden test for UPLC - when (hasPrintTermGolden pg) $ do - it "uplc" $ - pureGoldenTextFile (goldenFilePath "goldens" name "uplc") $ - multiGolden ps $ \p -> - T.pack $ printScript $ compileD p - it "uplc.eval" $ - pureGoldenTextFile (goldenFilePath "goldens" name "uplc.eval") $ - multiGolden ps $ \p -> - T.pack $ printScript $ fst $ evalScriptAlwaysWithBenchmark $ compileD p - -- Golden test for Plutus benchmarks - when (hasBenchGolden pg) $ - it "bench" $ - pureGoldenTextFile (goldenFilePath "goldens" name "bench") $ - multiGolden ps $ \p -> - TL.toStrict $ Aeson.encodeToLazyText $ snd $ evalScriptAlwaysWithBenchmark $ compileD p - where - hasBenchGolden :: PlutarchGolden -> Bool - hasBenchGolden = \case - PrintTerm -> False - _ -> True - hasPrintTermGolden :: PlutarchGolden -> Bool - hasPrintTermGolden = \case - Bench -> False - _ -> True - --- | Get a golden filename prefix from the test description path -getGoldenFilePrefix :: - forall (outers :: [Type]) (inner :: Type). - TestDefM outers inner String -getGoldenFilePrefix = - T.unpack . T.intercalate "." . drop 1 . reverse <$> getTestDescriptionPath - --- | Get the golden file name given the basepath, an optional suffix and a name -goldenFilePath :: FilePath -> String -> String -> FilePath -goldenFilePath base name suffix = - base - (name <> "." <> suffix <> ".golden") - -multiGolden :: forall a. [(String, a)] -> (a -> T.Text) -> Text -multiGolden xs f = - T.intercalate "\n" $ - (\(s, x) -> T.pack s <> " " <> f x) <$> xs diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 9960e77b5..2c10c8e94 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -1,6 +1,7 @@ {-# LANGUAGE ImpredicativeTypes #-} module Plutarch.Test.Golden ( + -- * DSL pgoldenSpec, (@|), (@\), @@ -8,7 +9,16 @@ module Plutarch.Test.Golden ( (@:->), TermExpectation, PlutarchGoldens, + + -- * Golden key and path + GoldenKey, + currentGoldenKey, goldenKeyString, + mkGoldenKeyFromSpecPath, + defaultGoldenBasePath, + goldenTestPath, + + -- * Evaluation evalScriptAlwaysWithBenchmark, compileD, ) where @@ -125,16 +135,24 @@ goldenKeyString (GoldenKey s) = T.unpack s instance Semigroup GoldenKey where GoldenKey s1 <> GoldenKey s2 = GoldenKey $ s1 <> "." <> s2 +currentGoldenKey :: HasCallStack => forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey +currentGoldenKey = do + mkGoldenKeyFromSpecPath <$> getTestDescriptionPath + +mkGoldenKeyFromSpecPath :: HasCallStack => [Text] -> GoldenKey +mkGoldenKeyFromSpecPath path = + case nonEmpty path of + Nothing -> error "cannot use currentGoldenKey from top-level spec" + Just anc -> + case nonEmpty (NE.drop 1 . NE.reverse $ anc) of + Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" + Just path -> + sconcat $ fmap GoldenKey path + goldenPath :: FilePath -> GoldenKey -> FilePath goldenPath baseDir (GoldenKey k) = baseDir T.unpack k <> ".golden" --- | Group multiple goldens values in the same file -combineGoldens :: [(GoldenKey, Text)] -> Text -combineGoldens xs = - T.intercalate "\n" $ - (\(GoldenKey k, v) -> k <> " " <> v) <$> xs - type PlutarchGoldens = ListSyntax (GoldenKey, GoldenValue) -- | Specify goldens for the given Plutarch program @@ -165,36 +183,59 @@ infixr 0 @| Hierarchy is represented by intercalating with a dot; for instance, the key for 'qux' will be "bar.qux". -} -pgoldenSpec :: HasCallStack => ListSyntax (GoldenKey, GoldenValue) -> Spec +pgoldenSpec :: HasCallStack => PlutarchGoldens -> Spec pgoldenSpec map = do - name <- currentGoldenKey + base <- currentGoldenKey let bs = runListSyntax map - goldenPathWith k = goldenPath "goldens" $ name <> k + -- Golden tests describe "golden" $ do - it "uplc" $ - pureGoldenTextFile (goldenPathWith "uplc") $ - combineGoldens $ fmap goldenValueUplcPreEval <$> bs - it "uplc.eval" $ - pureGoldenTextFile (goldenPathWith "uplc.eval") $ - combineGoldens $ fmap goldenValueUplcPostEval <$> bs - it "bench" $ - pureGoldenTextFile (goldenPathWith "bench") $ - combineGoldens $ fmap goldenValueBench <$> bs + goldenTestSpec base bs `mapM_` [minBound .. maxBound] + -- Assertion tests (if any) let asserts = flip mapMaybe bs $ \(k, v) -> do (k,) . (\f -> f (goldenValueEvaluated v) $ goldenValueBenchVal v) <$> goldenValueExpectation v unless (null asserts) $ do forM_ asserts $ \(k, v) -> it (goldenKeyString $ "" <> k <> "assert") v -currentGoldenKey :: HasCallStack => forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey -currentGoldenKey = do - fmap nonEmpty getTestDescriptionPath >>= \case - Nothing -> error "cannot use currentGoldenKey from top-level spec" - Just anc -> - case nonEmpty (NE.drop 1 . NE.reverse $ anc) of - Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" - Just path -> - pure $ sconcat $ fmap GoldenKey path +data GoldenTest + = -- | The unevaluated UPLC (compiled target of Plutarch term) + UPLCPreEval + | -- | The evaluated UPLC (evaluated result of Plutarch term) + UPLCPostEval + | -- | Benchmark of Plutarch term (will never fail) + Bench + deriving stock (Eq, Show, Ord, Enum, Bounded) + +goldenTestKey :: GoldenTest -> GoldenKey +goldenTestKey = \case + UPLCPreEval -> "uplc" + UPLCPostEval -> "uplc.eval" + Bench -> "bench" + +defaultGoldenBasePath :: FilePath +defaultGoldenBasePath = "goldens" + +goldenTestPath :: GoldenKey -> GoldenTest -> FilePath +goldenTestPath base gt = + goldenPath defaultGoldenBasePath $ base <> goldenTestKey gt + +goldenTestVal :: GoldenTest -> GoldenValue -> Text +goldenTestVal t v = case t of + UPLCPreEval -> goldenValueUplcPreEval v + UPLCPostEval -> goldenValueUplcPostEval v + Bench -> goldenValueBench v + +goldenTestSpec :: GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> Spec +goldenTestSpec base vals gt = do + it (goldenKeyString $ goldenTestKey gt) $ + pureGoldenTextFile (goldenTestPath base gt) $ + combineGoldens $ fmap (goldenTestVal gt) <$> vals + where + -- Group multiple goldens values in the same file + combineGoldens :: [(GoldenKey, Text)] -> Text + combineGoldens xs = + T.intercalate "\n" $ + (\(GoldenKey k, v) -> k <> " " <> v) <$> xs {- | Like `evalScript` but doesn't throw `EvalError`, and returns `Benchmark`. diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs new file mode 100644 index 000000000..5f7e39017 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -0,0 +1,80 @@ +module Plutarch.Test.Run (runPlutarchSpec) where + +import Control.Monad (forM_, void) +import Data.Set (Set) +import qualified Data.Set as Set +import qualified Data.Text as T +import Plutarch.Test.Golden (GoldenKey, defaultGoldenBasePath, goldenTestPath, mkGoldenKeyFromSpecPath) +import System.Directory (listDirectory) +import System.Exit (ExitCode (ExitFailure), exitWith) +import System.FilePath (()) +import Test.Syd ( + Spec, + SpecTree (..), + Timed (timedValue), + shouldExitFail, + sydTestResult, + ) +import Test.Syd.OptParse (getSettings) + +-- | Like `sydTest`, but ensures that there are no unused goldens left behind. +runPlutarchSpec :: Spec -> IO () +runPlutarchSpec spec = do + usedGoldens <- goldenPathsUsedBy <$> sydTest' spec + unusedGoldens usedGoldens >>= \case + [] -> pure () + unused -> do + putStrLn "ERROR: Unused golden files found lying around! Namely:" + forM_ unused $ \fp -> + putStrLn $ "- " <> fp + exitWith (ExitFailure 1) + +-- | Given a list of "used" goldens, return any unused golden files on disk. +unusedGoldens :: [FilePath] -> IO [FilePath] +unusedGoldens usedGoldens' = do + let usedGoldens = foldMap knownGoldens usedGoldens' + allGoldens <- Set.fromList . fmap (defaultGoldenBasePath ) <$> listDirectory defaultGoldenBasePath + pure $ Set.toList $ allGoldens `Set.difference` usedGoldens + where + knownGoldens :: FilePath -> Set FilePath + knownGoldens fp = + Set.fromList + [ fp + , -- Inject goldens for other flag values to be comprehensive in our + -- search. + replace "dev=true" "dev=false" fp + , replace "dev=false" "dev=true" fp + ] + replace a b = T.unpack . T.replace a b . T.pack + +goldenPathsUsedBy :: [SpecTree a] -> [FilePath] +goldenPathsUsedBy trees = do + flip foldMap (queryGoldens trees) $ \k -> + flip fmap [minBound .. maxBound] $ \t -> + goldenTestPath k t + +-- | Retrieve all golden keys used by the given test tree. +queryGoldens :: [SpecTree a] -> [GoldenKey] +queryGoldens = + fmap mkGoldenKeyFromSpecPath . concatMap (go []) + where + go ancestors = \case + DescribeNode "golden" _children -> + ancestors : [] + DescribeNode k children -> + concatMap (go $ k : ancestors) children + SubForestNode trees -> + concatMap (go ancestors) trees + SpecifyNode _ _ -> + mempty + PendingNode _ _ -> + mempty + +-- | Like `sydTest` but returns the test tree. +sydTest' :: Spec -> IO [SpecTree ()] +sydTest' spec = do + config <- getSettings + resultForest <- timedValue <$> sydTestResult config spec + if shouldExitFail config resultForest + then exitWith $ ExitFailure 1 + else pure $ void <$> resultForest diff --git a/plutarch-test/plutarch-base/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/FFISpec.hs rename to plutarch-test/conditional/Plutarch/FFISpec.hs diff --git a/plutarch-test/plutarch-base/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/FieldSpec.hs rename to plutarch-test/conditional/Plutarch/FieldSpec.hs diff --git a/plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs b/plutarch-test/conditional/Plutarch/MonadicSpec.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/MonadicSpec.hs rename to plutarch-test/conditional/Plutarch/MonadicSpec.hs diff --git a/plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs similarity index 100% rename from plutarch-test/plutarch-base/Plutarch/TryFromSpec.hs rename to plutarch-test/conditional/Plutarch/TryFromSpec.hs diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden index c9963d505..332672742 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -1,2 +1,2 @@ -do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":392} -do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":388} \ No newline at end of file +do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":390} +do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":386} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden index f975ba797..fced1596f 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -1,2 +1,2 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at plutarch-base/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at plutarch-base/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.bench.golden b/plutarch-test/goldens/scripts.auth_policy.bench.golden deleted file mode 100644 index 85921866a..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.hash.golden b/plutarch-test/goldens/scripts.auth_policy.hash.golden deleted file mode 100644 index a64f01b91..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.hash.golden +++ /dev/null @@ -1 +0,0 @@ -581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden deleted file mode 100644 index b66a171ce..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.uplc.golden b/plutarch-test/goldens/scripts.auth_policy.uplc.golden deleted file mode 100644 index d6b3b2803..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.bench.golden b/plutarch-test/goldens/scripts.auth_stake_validator.bench.golden deleted file mode 100644 index 85921866a..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.hash.golden b/plutarch-test/goldens/scripts.auth_stake_validator.hash.golden deleted file mode 100644 index a64f01b91..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.hash.golden +++ /dev/null @@ -1 +0,0 @@ -581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden deleted file mode 100644 index b66a171ce..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden b/plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden deleted file mode 100644 index d6b3b2803..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.bench.golden b/plutarch-test/goldens/scripts.auth_validator.bench.golden deleted file mode 100644 index fcc1ac79d..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":155} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.hash.golden b/plutarch-test/goldens/scripts.auth_validator.hash.golden deleted file mode 100644 index cc553ffba..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.hash.golden +++ /dev/null @@ -1 +0,0 @@ -581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden deleted file mode 100644 index 22be3c42a..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.uplc.golden b/plutarch-test/goldens/scripts.auth_validator.uplc.golden deleted file mode 100644 index 22be3c42a..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.bench.golden b/plutarch-test/goldens/scripts.bench.golden new file mode 100644 index 000000000..f3e924bf2 --- /dev/null +++ b/plutarch-test/goldens/scripts.bench.golden @@ -0,0 +1,6 @@ +auth_validator.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":155} +auth_validator.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} +auth_policy.0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} +auth_policy.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} +auth_stake_validator.0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} +auth_stake_validator.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.uplc.eval.golden b/plutarch-test/goldens/scripts.uplc.eval.golden new file mode 100644 index 000000000..c3daaad0a --- /dev/null +++ b/plutarch-test/goldens/scripts.uplc.eval.golden @@ -0,0 +1,6 @@ +auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) +auth_validator.hash (program 1.0.0 "581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047") +auth_policy.0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) +auth_policy.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") +auth_stake_validator.0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) +auth_stake_validator.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.uplc.golden b/plutarch-test/goldens/scripts.uplc.golden new file mode 100644 index 000000000..b08743053 --- /dev/null +++ b/plutarch-test/goldens/scripts.uplc.golden @@ -0,0 +1,6 @@ +auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) +auth_validator.hash (program 1.0.0 "581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047") +auth_policy.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +auth_policy.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") +auth_stake_validator.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +auth_stake_validator.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden deleted file mode 100644 index 153644d85..000000000 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.bench.golden +++ /dev/null @@ -1,35 +0,0 @@ -erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} -erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":108} -erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} -erroneous.PDataSum constr 2 {"exBudgetCPU":437969,"exBudgetMemory":166,"scriptSizeBytes":111} -erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":193} -working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} -working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":6636946,"exBudgetMemory":11068,"scriptSizeBytes":101} -working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":6636946,"exBudgetMemory":11068,"scriptSizeBytes":101} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":6726265,"exBudgetMemory":11368,"scriptSizeBytes":108} -working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} -working.PDataSum constr 0 {"exBudgetCPU":6651183,"exBudgetMemory":12542,"scriptSizeBytes":193} -working.PDataSum constr 1 {"exBudgetCPU":7654739,"exBudgetMemory":14508,"scriptSizeBytes":193} -recovering a record partially vs completely.partially {"exBudgetCPU":6008308,"exBudgetMemory":10372,"scriptSizeBytes":99} -recovering a record partially vs completely.completely {"exBudgetCPU":6726265,"exBudgetMemory":11368,"scriptSizeBytes":107} -removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} -removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} -removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} -removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} -removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} -removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":6784676,"exBudgetMemory":12036,"scriptSizeBytes":107} -removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":107} -removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":5874814,"exBudgetMemory":10877,"scriptSizeBytes":97} -checking PValue and PMap for validity.PMap.valid0 {"exBudgetCPU":13804861,"exBudgetMemory":25916,"scriptSizeBytes":169} -checking PValue and PMap for validity.PMap.invalid1 {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":169} -checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} -checking PValue and PMap for validity.PValue.valid0 {"exBudgetCPU":7607387,"exBudgetMemory":19388,"scriptSizeBytes":137} -checking PValue and PMap for validity.PValue.invalid1 {"exBudgetCPU":2310477,"exBudgetMemory":521,"scriptSizeBytes":153} -example.concatenate two lists, legal {"exBudgetCPU":55650750,"exBudgetMemory":105851,"scriptSizeBytes":713} -example.concatenate two lists, illegal (list too short) {"exBudgetCPU":48177778,"exBudgetMemory":84825,"scriptSizeBytes":707} -example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":55412566,"exBudgetMemory":105051,"scriptSizeBytes":713} -example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35832714,"exBudgetMemory":63544,"scriptSizeBytes":734} -example2.recovering a record succeeds {"exBudgetCPU":9103919,"exBudgetMemory":16062,"scriptSizeBytes":287} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden deleted file mode 100644 index 841f3a87a..000000000 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.eval.golden +++ /dev/null @@ -1,35 +0,0 @@ -erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) -erroneous.[String] /= [Integer] (program 1.0.0 error) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 error) -erroneous.Map Int String /= Map Int Int (program 1.0.0 error) -erroneous.PDataSum constr 2 (program 1.0.0 error) -erroneous.PDataSum wrong record type (program 1.0.0 error) -working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) -working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) -working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) -working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) -working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) -recovering a record partially vs completely.partially (program 1.0.0 #9f034362617aff) -recovering a record partially vs completely.completely (program 1.0.0 #9f034362617aff) -removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) -removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) -removing the data wrapper.working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) -removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) -removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) -removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 #9f9f182affff) -removing the data wrapper.recovering a nested record.fails (program 1.0.0 error) -removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 True) -checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) -checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 error) -checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) -checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) -checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 error) -example.concatenate two lists, legal (program 1.0.0 ()) -example.concatenate two lists, illegal (list too short) (program 1.0.0 error) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 error) -example2.recovering a record succeeds (program 1.0.0 #d8799f0443666f6fff) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden deleted file mode 100644 index 743aa7cee..000000000 --- a/plutarch-test/goldens/verification_untrusted_data.dev=false.uplc.golden +++ /dev/null @@ -1,37 +0,0 @@ -erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) -erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (bData i9) (i10 (iData 42) i11))) (i9 (i7 i5) i1)) (i8 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (i8 (i9 i5)) i1) (i5 (i7 (i6 (i8 i4))) [ ])) (force (force (force chooseList) (i5 (i5 (i7 i3))) (delay ()) (delay error)))) (unBData (i5 (i4 (i6 i2))))) (unIData (i4 (i5 i1))))) (delay error))) (unConstrData i5))) (force mkCons)) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) -erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i12 (i13 i5)) i1) (i7 (i11 (i10 (i12 i4))) i8)) (force (i8 (i9 (i9 (i11 i3))) (delay ()) (delay error)))) (unBData (i9 (i8 (i10 i2))))) (unIData (i8 (i9 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i13 (i14 i5)) i1) (i8 (i12 (i11 (i13 i4))) i9)) (force (i9 (i10 (i10 (i12 i3))) (delay ()) (delay error)))) (unBData (i10 (i9 (i11 i2))))) (unBData (i9 (i10 i1))))) (delay error))) (unConstrData i10))))) (unConstrData i9))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) #d87b9f0543666f6fff)) -working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) -working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 7) (i9 (iData 42) i10))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i8)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 7) (i9 (iData 42) i10))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i8)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (bData i9) (i10 (iData 42) i11))) (i9 (i7 i5) i1)) (i8 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unIData (i4 (i3 i2)))) (unBData (i3 i1))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i12 (i13 i5)) i1) (i7 (i11 (i10 (i12 i4))) i8)) (force (i8 (i9 (i9 (i11 i3))) (delay ()) (delay error)))) (unBData (i9 (i8 (i10 i2))))) (unIData (i8 (i9 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i13 (i14 i5)) i1) (i8 (i12 (i11 (i13 i4))) i9)) (force (i9 (i10 (i10 (i12 i3))) (delay ()) (delay error)))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay error))) (unConstrData i10))))) (unConstrData i9))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) #d8799f0543666f6fff)) -working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i12 (i13 i5)) i1) (i7 (i11 (i10 (i12 i4))) i8)) (force (i8 (i9 (i9 (i11 i3))) (delay ()) (delay error)))) (unBData (i9 (i8 (i10 i2))))) (unIData (i8 (i9 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i13 (i14 i5)) i1) (i8 (i12 (i11 (i13 i4))) i9)) (force (i9 (i10 (i10 (i12 i3))) (delay ()) (delay error)))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay error))) (unConstrData i10))))) (unConstrData i9))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) #d87a9f0543666f6fff)) -recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (iData 3) (i8 (bData i9) i10))) (i7 (i6 i4) i1)) (i6 (i5 (i4 i3)) i8)) (force (force (force chooseList) (i3 (i3 i2)) (delay ()) (delay error)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) -recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 3) (i9 (bData i10) i11))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay error)))) (unBData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) -removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) -removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) -removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (listData (i11 (iData 42) i12)) i12)) (i10 (i9 i6) i11)) (force (i6 (i7 i5) (delay ()) (delay error)))) (i8 (i7 i3) i9)) (force (i4 (i5 i2) (delay ()) (delay error)))) (unIData (i5 i1))) (unListData (i4 i1))) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5)))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (listData (i11 (iData 42) i12)) i12)) (i10 (i9 i6) i11)) (force (i6 (i7 i5) (delay ()) (delay error)))) (i8 (i7 i3) i9)) (force (i4 (i5 i2) (delay ()) (delay error)))) (unBData (i5 i1))) (unListData (i4 i1))) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5)))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (i10 (i9 i6) i11)) (force (i6 (i7 i5) (delay ()) (delay error)))) (i8 (i7 i3) i9)) (force (i4 (i5 i2) (delay ()) (delay error)))) (unIData (i5 i1))) (unListData (i4 i1))) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5))))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) -checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 - , #a149736f6d65546f6b656e01 ) ])) -checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 - , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) i10))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 8) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i8 (iData 4) (i8 (bData i9) i10))) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i12 (i10 (i11 i5)) i1) (i11 (i9 (i8 (i10 i4))) i13)) (force (i6 (i7 (i7 (i9 i3))) (delay ()) (delay error)))) (unBData (i7 (i6 (i8 i2))))) (unIData (i6 (i7 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i13 (i11 (i12 i5)) i1) (i12 (i10 (i9 (i11 i4))) i14)) (force (i7 (i8 (i8 (i10 i3))) (delay ()) (delay error)))) (unBData (i8 (i7 (i9 i2))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i8 i1 (delay i14) (delay (i12 (i3 (i10 i1)) (i2 (i9 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i7 (i8 i1)))))) (delay error))) (unConstrData (constrData 0 (i8 (iData 4) (i8 (bData i9) i10)))))))) (unConstrData (constrData 0 (i7 (iData 4) (i7 (bData i8) i9)))))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) (force mkCons)) #666f6f) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden deleted file mode 100644 index 2200df41a..000000000 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.bench.golden +++ /dev/null @@ -1,35 +0,0 @@ -erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} -erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":139} -erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} -erroneous.PDataSum constr 2 {"exBudgetCPU":587969,"exBudgetMemory":198,"scriptSizeBytes":215} -erroneous.PDataSum wrong record type {"exBudgetCPU":1025838,"exBudgetMemory":264,"scriptSizeBytes":307} -working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} -working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":6636946,"exBudgetMemory":11068,"scriptSizeBytes":133} -working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":6636946,"exBudgetMemory":11068,"scriptSizeBytes":133} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":6726265,"exBudgetMemory":11368,"scriptSizeBytes":139} -working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} -working.PDataSum constr 0 {"exBudgetCPU":6859594,"exBudgetMemory":13242,"scriptSizeBytes":307} -working.PDataSum constr 1 {"exBudgetCPU":7863150,"exBudgetMemory":15208,"scriptSizeBytes":307} -recovering a record partially vs completely.partially {"exBudgetCPU":6008308,"exBudgetMemory":10372,"scriptSizeBytes":131} -recovering a record partially vs completely.completely {"exBudgetCPU":6726265,"exBudgetMemory":11368,"scriptSizeBytes":139} -removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} -removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} -removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} -removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} -removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} -removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":6993087,"exBudgetMemory":12736,"scriptSizeBytes":149} -removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":149} -removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":6083225,"exBudgetMemory":11577,"scriptSizeBytes":139} -checking PValue and PMap for validity.PMap.valid0 {"exBudgetCPU":13804861,"exBudgetMemory":25916,"scriptSizeBytes":169} -checking PValue and PMap for validity.PMap.invalid1 {"exBudgetCPU":2880288,"exBudgetMemory":678,"scriptSizeBytes":169} -checking PValue and PMap for validity.PMap.invalid2 {"exBudgetCPU":12645264,"exBudgetMemory":21418,"scriptSizeBytes":190} -checking PValue and PMap for validity.PValue.valid0 {"exBudgetCPU":7607387,"exBudgetMemory":19388,"scriptSizeBytes":137} -checking PValue and PMap for validity.PValue.invalid1 {"exBudgetCPU":2310477,"exBudgetMemory":521,"scriptSizeBytes":153} -example.concatenate two lists, legal {"exBudgetCPU":56427118,"exBudgetMemory":107515,"scriptSizeBytes":1115} -example.concatenate two lists, illegal (list too short) {"exBudgetCPU":48627778,"exBudgetMemory":84921,"scriptSizeBytes":1108} -example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":55862566,"exBudgetMemory":105147,"scriptSizeBytes":1115} -example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35982714,"exBudgetMemory":63576,"scriptSizeBytes":1136} -example2.recovering a record succeeds {"exBudgetCPU":9312330,"exBudgetMemory":16762,"scriptSizeBytes":399} \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden deleted file mode 100644 index 841f3a87a..000000000 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.eval.golden +++ /dev/null @@ -1,35 +0,0 @@ -erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) -erroneous.[String] /= [Integer] (program 1.0.0 error) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 error) -erroneous.Map Int String /= Map Int Int (program 1.0.0 error) -erroneous.PDataSum constr 2 (program 1.0.0 error) -erroneous.PDataSum wrong record type (program 1.0.0 error) -working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) -working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) -working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) -working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) -working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) -recovering a record partially vs completely.partially (program 1.0.0 #9f034362617aff) -recovering a record partially vs completely.completely (program 1.0.0 #9f034362617aff) -removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) -removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) -removing the data wrapper.working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) -removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) -removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) -removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 #9f9f182affff) -removing the data wrapper.recovering a nested record.fails (program 1.0.0 error) -removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 True) -checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 [(#01, #d87980), (#02, #d87980), (#182a, #d87980)]) -checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 error) -checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 error) -checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 [(#41c0, #a149736f6d65546f6b656e01)]) -checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 error) -example.concatenate two lists, legal (program 1.0.0 ()) -example.concatenate two lists, illegal (list too short) (program 1.0.0 error) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 error) -example2.recovering a record succeeds (program 1.0.0 #d8799f0443666f6fff) \ No newline at end of file diff --git a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden b/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden deleted file mode 100644 index 8c9dee94e..000000000 --- a/plutarch-test/goldens/verification_untrusted_data.dev=true.uplc.golden +++ /dev/null @@ -1,37 +0,0 @@ -erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) -erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (bData i9) (i10 (iData 42) i11))) (i9 (i7 i5) i1)) (i8 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7) ((\i0 -> force (force ifThenElse (equalsInteger 0 (force (force fstPair) i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (i8 (i9 i5)) i1) (i5 (i7 (i6 (i8 i4))) [ ])) (force (force (force chooseList) (i5 (i5 (i7 i3))) (delay ()) (delay (force (i8 "list is longer than zero" (delay error))))))) (unBData (i5 (i4 (i6 i2))))) (unIData (i4 (i5 i1))))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData i6))) (force mkCons)) (force tailList)) (force headList)) (force (force sndPair))) (force trace)) #d87a9f0543666f6fff)) -erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i12) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i13 (i14 i5)) i1) (i7 (i12 (i11 (i13 i4))) i8)) (force (i8 (i10 (i10 (i12 i3))) (delay ()) (delay (force (i13 i9 (delay error))))))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i14 (i15 i5)) i1) (i8 (i13 (i12 (i14 i4))) i9)) (force (i9 (i11 (i11 (i13 i3))) (delay ()) (delay (force (i14 i10 (delay error))))))) (unBData (i11 (i10 (i12 i2))))) (unBData (i10 (i11 i1))))) (delay (force (i12 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData i12))))) (unConstrData i11))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force (force sndPair))) (force trace)) #d87b9f0543666f6fff)) -working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) -working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 7) (i9 (iData 42) i10))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i8)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 7) (i9 (iData 42) i10))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i8)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (bData i9) (i10 (iData 42) i11))) (i9 (i7 i5) i1)) (i8 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i4 (i3 i2)))) (unBData (i3 i1))) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i12) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i13 (i14 i5)) i1) (i7 (i12 (i11 (i13 i4))) i8)) (force (i8 (i10 (i10 (i12 i3))) (delay ()) (delay (force (i13 i9 (delay error))))))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i14 (i15 i5)) i1) (i8 (i13 (i12 (i14 i4))) i9)) (force (i9 (i11 (i11 (i13 i3))) (delay ()) (delay (force (i14 i10 (delay error))))))) (unBData (i11 (i10 (i12 i2))))) (unIData (i10 (i11 i1))))) (delay (force (i12 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData i12))))) (unConstrData i11))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force (force sndPair))) (force trace)) #d8799f0543666f6fff)) -working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i12) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i8 (i13 (i14 i5)) i1) (i7 (i12 (i11 (i13 i4))) i8)) (force (i8 (i10 (i10 (i12 i3))) (delay ()) (delay (force (i13 i9 (delay error))))))) (unBData (i10 (i9 (i11 i2))))) (unIData (i9 (i10 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i9 (i14 (i15 i5)) i1) (i8 (i13 (i12 (i14 i4))) i9)) (force (i9 (i11 (i11 (i13 i3))) (delay ()) (delay (force (i14 i10 (delay error))))))) (unBData (i11 (i10 (i12 i2))))) (unIData (i10 (i11 i1))))) (delay (force (i12 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData i12))))) (unConstrData i11))) (force ifThenElse)) (force (force fstPair))) (force mkCons)) [ ]) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force (force sndPair))) (force trace)) #d87a9f0543666f6fff)) -recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i8 (iData 3) (i8 (bData i9) i10))) (i7 (i6 i4) i1)) (i6 (i5 (i4 i3)) i8)) (force (force (force chooseList) (i3 (i3 i2)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unIData (i3 i1))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) -recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i9 (iData 3) (i9 (bData i10) i11))) (i8 (i7 i5) i1)) (i7 (i6 (i5 i4)) i9)) (force (force (force chooseList) (i4 (i4 i3)) (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (unBData (i4 (i3 i2)))) (unIData (i3 i1))) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) -removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) -removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) -removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i13 (listData (i13 (iData 42) i14)) i14)) (i12 (i11 i6) i13)) (force (i6 (i7 i5) (delay ()) (delay (force (i8 i9 (delay error))))))) (i10 (i9 i3) i11)) (force (i4 (i5 i2) (delay ()) (delay (force (i6 i7 (delay error))))))) (unIData (i7 i1))) (unListData (i6 i1))) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force tailList)) (force trace)) "list is longer than zero") (force headList)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i13 (listData (i13 (iData 42) i14)) i14)) (i12 (i11 i6) i13)) (force (i6 (i7 i5) (delay ()) (delay (force (i8 i9 (delay error))))))) (i10 (i9 i3) i11)) (force (i4 (i5 i2) (delay ()) (delay (force (i6 i7 (delay error))))))) (unBData (i7 i1))) (unListData (i6 i1))) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force tailList)) (force trace)) "list is longer than zero") (force headList)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (i12 (i11 i6) i13)) (force (i6 (i7 i5) (delay ()) (delay (force (i8 i9 (delay error))))))) (i10 (i9 i3) i11)) (force (i4 (i5 i2) (delay ()) (delay (force (i6 i7 (delay error))))))) (unIData (i7 i1))) (unListData (i6 i1))) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7))))) (force (force chooseList))) (force tailList)) (force trace)) "list is longer than zero") (force headList)) (force mkCons)) [ ])) -checking PValue and PMap for validity.PMap.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 42) i7) i8))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 42) i6) i7))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PMap.invalid2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (mkPairData (iData 1) i7) (i6 (mkPairData (iData 2) i7) (i6 (mkPairData (iData 3) i7) (i6 (mkPairData (iData 2) i7) i8)))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 i1 (delay ()) (delay ((\i0 -> force (i4 i1 (delay ()) (delay (force (force ifThenElse (lessThanInteger (unIData (i5 (i6 i2))) (unIData (i5 (i6 i1)))) (delay (i3 (i7 i2))) (delay error)))))) (i6 i1))))) (i5 (mkPairData (iData 1) i6) (i5 (mkPairData (iData 2) i6) (i5 (mkPairData (iData 3) i6) (i5 (mkPairData (iData 2) i6) i7)))))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) #d87980) [ ])) -checking PValue and PMap for validity.PValue.valid0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 - , #a149736f6d65546f6b656e01 ) ])) -checking PValue and PMap for validity.PValue.invalid1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (i1 (\i0 -> i2 (\i0 -> force (i10 (lessThanInteger 0 (unIData (i11 i1))) (delay True) (delay error))) (unMapData (i10 i1))) i10)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i8 i1)) (delay (i2 (i9 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i6 i2 i1 i3)) (delay False)) (force headList)) (force tailList)) (force ifThenElse)) (force (force sndPair))) [ ( #41c0 - , #a249736f6d65546f6b656e014e736f6d654f74686572546f6b656e00 ) ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:418:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:368:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:359:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:418:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:368:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:359:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:418:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:368:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:359:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData ((\i0 -> i17 (i13 i1)) (i16 i2)) ((\i0 -> i17 (i13 i1)) (i16 (i12 i1)))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:418:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:368:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at plutarch-base/Plutarch/TryFromSpec.hs:359:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i10 (iData 4) (i10 (bData i11) i12))) ((\i0 -> force (i2 (equalsInteger 0 (i3 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i14 (i11 (i12 i5)) i1) (i13 (i10 (i9 (i11 i4))) i15)) (force (i7 (i8 (i8 (i10 i3))) (delay ()) (delay (force (i11 i6 (delay error))))))) (unBData (i8 (i7 (i9 i2))))) (unIData (i7 (i8 i1))))) (delay ((\i0 -> force (i3 (equalsInteger 1 (i4 i1)) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i15 (i12 (i13 i5)) i1) (i14 (i11 (i10 (i12 i4))) i16)) (force (i8 (i9 (i9 (i11 i3))) (delay ()) (delay (force (i12 i7 (delay error))))))) (unBData (i9 (i8 (i10 i2))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 i1 (delay i16) (delay (i14 (i3 (i11 i1)) (i2 (i10 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i8 (i9 i1)))))) (delay (force (i10 "reached end of sum while still not having found the constructor" (delay error)))))) (unConstrData (constrData 0 (i10 (iData 4) (i10 (bData i11) i12)))))))) (unConstrData (constrData 0 (i9 (iData 4) (i9 (bData i10) i11)))))) (force ifThenElse)) (force (force fstPair))) "list is longer than zero") (force (force chooseList))) (force tailList)) (force headList)) (force (force sndPair))) (force trace)) (force mkCons)) #666f6f) [ ])) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 4c519272b..693f87259 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -45,32 +45,20 @@ import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude import Plutarch.Test -import Test.Syd (Spec, describe, it, pureGoldenTextFile) +import Test.Syd (Spec, describe) spec :: Spec spec = do - describe "scripts" $ do - describe "auth_validator" $ do - pgoldenSpec $ "0" @| authValidatorTerm - prefix <- getGoldenFilePrefix - it "hash" $ do - pureGoldenTextFile - (goldenFilePath "goldens" prefix "hash") - validatorHashEncoded - describe "auth_policy" $ do - pgoldenSpec $ "0" @| authPolicyTerm - prefix <- getGoldenFilePrefix - it "hash" $ - pureGoldenTextFile - (goldenFilePath "goldens" prefix "hash") - policySymEncoded - describe "auth_stake_validator" $ do - pgoldenSpec $ "0" @| authStakeValidatorTerm - prefix <- getGoldenFilePrefix - it "hash" $ - pureGoldenTextFile - (goldenFilePath "goldens" prefix "hash") - stakeValidatorHashEncoded + describe "scripts" . pgoldenSpec $ do + "auth_validator" @\ do + "0" @| authValidatorTerm + "hash" @| pconstant validatorHashEncoded + "auth_policy" @\ do + "0" @| authPolicyTerm + "hash" @| pconstant policySymEncoded + "auth_stake_validator" @\ do + "0" @| authStakeValidatorTerm + "hash" @| pconstant stakeValidatorHashEncoded encodeSerialise :: Serialise a => a -> Text encodeSerialise = TE.decodeUtf8 . Base16.encode . Write.toStrictByteString . encode diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 25df8ac76..a5f207455 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -76,6 +76,8 @@ common deps , aeson >=2.0 , base , bytestring + , containers + , directory , filepath , generics-sop , mtl @@ -101,6 +103,7 @@ library Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax + Plutarch.Test.Run if flag(development) cpp-options: -DDevelopment @@ -108,7 +111,7 @@ library executable plutarch-test import: c, deps main-is: Main.hs - hs-source-dirs: plutarch-base plutarch-extra common ./. + hs-source-dirs: plutarch-base plutarch-extra common conditional ./. build-depends: , base16-bytestring , cborg @@ -128,7 +131,6 @@ executable plutarch-test other-modules: Plutarch.FieldSpec Plutarch.MonadicSpec - Plutarch.RecSpec Plutarch.TryFromSpec other-modules: @@ -148,6 +150,7 @@ executable plutarch-test Plutarch.PLamSpec Plutarch.PlutusTypeSpec Plutarch.RationalSpec + Plutarch.RecSpec Plutarch.RecursionSpec Plutarch.ScriptsSpec Plutarch.ShowSpec @@ -156,6 +159,7 @@ executable plutarch-test Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax + Plutarch.Test.Run Plutarch.TraceSpec Plutarch.UnitSpec Plutarch.UPLCSpec From 4e654d397664528ea82b6affded1d0c2ec26000f Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 19 Mar 2022 14:19:38 +0100 Subject: [PATCH 226/584] fix: apply all requested fixes and cleanup - apply requested fixes - add haddock comments - regenerate goldens --- Plutarch/List.hs | 17 ++++- Plutarch/Prelude.hs | 1 + plutarch-extra/Plutarch/ListUtils.hs | 2 + .../extra.listutils.goldens.bench.golden | 2 +- .../extra.listutils.goldens.uplc.golden | 2 +- plutarch-test/goldens/list.fun.bench.golden | 18 ----- plutarch-test/goldens/list.fun.uplc.golden | 18 ----- .../goldens/list.goldens.bench.golden | 20 ------ .../list.goldens.dev=false.bench.golden | 25 +++++++ ...> list.goldens.dev=false.uplc.eval.golden} | 17 +++-- ...den => list.goldens.dev=false.uplc.golden} | 25 ++++--- .../list.goldens.dev=true.bench.golden | 25 +++++++ .../list.goldens.dev=true.uplc.eval.golden | 25 +++++++ .../goldens/list.goldens.dev=true.uplc.golden | 25 +++++++ .../list.pconcat.identity.bench.golden | 1 - .../list.pconcat.identity.uplc.eval.golden | 1 - .../goldens/list.pconcat.identity.uplc.golden | 1 - .../goldens/list.pfilter.bench.golden | 2 - .../goldens/list.pfilter.uplc.eval.golden | 2 - .../goldens/list.pfilter.uplc.golden | 2 - .../goldens/list.pfoldl.bench.golden | 4 -- .../goldens/list.pfoldl.uplc.eval.golden | 4 -- plutarch-test/goldens/list.pfoldl.uplc.golden | 4 -- plutarch-test/goldens/list.phead.bench.golden | 1 - .../goldens/list.phead.uplc.eval.golden | 1 - plutarch-test/goldens/list.phead.uplc.golden | 1 - plutarch-test/goldens/list.pmap.bench.golden | 1 - .../goldens/list.pmap.uplc.eval.golden | 1 - plutarch-test/goldens/list.pmap.uplc.golden | 1 - .../goldens/list.pmatch.uplc.eval.golden | 1 - plutarch-test/goldens/list.pmatch.uplc.golden | 1 - plutarch-test/goldens/list.pnull.bench.golden | 2 - .../goldens/list.pnull.uplc.eval.golden | 2 - plutarch-test/goldens/list.pnull.uplc.golden | 2 - .../goldens/list.property.elemAt.bench.golden | 3 - .../list.property.elemAt.uplc.eval.golden | 3 - .../goldens/list.property.elemAt.uplc.golden | 3 - .../goldens/list.property.find.bench.golden | 2 - .../list.property.find.uplc.eval.golden | 2 - .../goldens/list.property.find.uplc.golden | 2 - .../list.property.reverse.bench.golden | 2 - .../list.property.reverse.uplc.eval.golden | 2 - .../goldens/list.property.reverse.uplc.golden | 2 - plutarch-test/goldens/list.ptail.bench.golden | 1 - .../goldens/list.ptail.uplc.eval.golden | 1 - plutarch-test/goldens/list.ptail.uplc.golden | 1 - .../goldens/list.pzipWith.bench.golden | 1 - .../goldens/list.pzipWith.uplc.eval.golden | 1 - .../goldens/list.pzipWith.uplc.golden | 1 - .../plutarch-base/Plutarch/ListSpec.hs | 68 +++++++++++++++---- .../{ListUtilSpec.hs => ListUtilsSpec.hs} | 4 +- plutarch-test/plutarch-test.cabal | 2 +- 52 files changed, 201 insertions(+), 157 deletions(-) delete mode 100644 plutarch-test/goldens/list.fun.bench.golden delete mode 100644 plutarch-test/goldens/list.fun.uplc.golden delete mode 100644 plutarch-test/goldens/list.goldens.bench.golden create mode 100644 plutarch-test/goldens/list.goldens.dev=false.bench.golden rename plutarch-test/goldens/{list.goldens.uplc.eval.golden => list.goldens.dev=false.uplc.eval.golden} (56%) rename plutarch-test/goldens/{list.goldens.uplc.golden => list.goldens.dev=false.uplc.golden} (53%) create mode 100644 plutarch-test/goldens/list.goldens.dev=true.bench.golden create mode 100644 plutarch-test/goldens/list.goldens.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.goldens.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/list.pconcat.identity.bench.golden delete mode 100644 plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pconcat.identity.uplc.golden delete mode 100644 plutarch-test/goldens/list.pfilter.bench.golden delete mode 100644 plutarch-test/goldens/list.pfilter.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pfilter.uplc.golden delete mode 100644 plutarch-test/goldens/list.pfoldl.bench.golden delete mode 100644 plutarch-test/goldens/list.pfoldl.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pfoldl.uplc.golden delete mode 100644 plutarch-test/goldens/list.phead.bench.golden delete mode 100644 plutarch-test/goldens/list.phead.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.phead.uplc.golden delete mode 100644 plutarch-test/goldens/list.pmap.bench.golden delete mode 100644 plutarch-test/goldens/list.pmap.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pmap.uplc.golden delete mode 100644 plutarch-test/goldens/list.pmatch.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pmatch.uplc.golden delete mode 100644 plutarch-test/goldens/list.pnull.bench.golden delete mode 100644 plutarch-test/goldens/list.pnull.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pnull.uplc.golden delete mode 100644 plutarch-test/goldens/list.property.elemAt.bench.golden delete mode 100644 plutarch-test/goldens/list.property.elemAt.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.property.elemAt.uplc.golden delete mode 100644 plutarch-test/goldens/list.property.find.bench.golden delete mode 100644 plutarch-test/goldens/list.property.find.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.property.find.uplc.golden delete mode 100644 plutarch-test/goldens/list.property.reverse.bench.golden delete mode 100644 plutarch-test/goldens/list.property.reverse.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.property.reverse.uplc.golden delete mode 100644 plutarch-test/goldens/list.ptail.bench.golden delete mode 100644 plutarch-test/goldens/list.ptail.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.ptail.uplc.golden delete mode 100644 plutarch-test/goldens/list.pzipWith.bench.golden delete mode 100644 plutarch-test/goldens/list.pzipWith.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pzipWith.uplc.golden rename plutarch-test/plutarch-extra/Plutarch/{ListUtilSpec.hs => ListUtilsSpec.hs} (88%) diff --git a/Plutarch/List.hs b/Plutarch/List.hs index 7d27cc9ab..2e7ca20c6 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -16,6 +16,7 @@ module Plutarch.List ( pdrop, pfind, pelemAt, + (#!!), -- * Construction psingleton, @@ -412,7 +413,15 @@ plistEquals = (pelimList (\_ _ -> pconstant False) (pconstant True) ylist) xlist -pelemAt :: (PIsListLike l a) => Term s (PInteger :--> l a :--> a) +-- | / O(n) /. Like Haskell level `(!!)` but on the plutarch level +(#!!) :: (PIsListLike l a) => Term s (l a) -> Term s PInteger -> Term s a +l #!! i = pelemAt # i # l + +{- | / O(n) /. Like Haskell level `(!!)` but on the Plutarch level, not infix and + with arguments reversed, errors if the specified index is greater than or equal + to the lists length +-} +pelemAt :: PIsListLike l a => Term s (PInteger :--> l a :--> a) pelemAt = phoistAcyclic $ plam $ \n xs -> pif @@ -420,7 +429,8 @@ pelemAt = phoistAcyclic $ (ptraceError "pelemAt: negative index") (pelemAt' # n # xs) -pelemAt' :: (PIsListLike l a) => Term s (PInteger :--> l a :--> a) +-- | / O(n) /. like `pelemAt` but doesn't fail on negative indexes +pelemAt' :: PIsListLike l a => Term s (PInteger :--> l a :--> a) pelemAt' = phoistAcyclic $ pfix #$ plam $ \self n xs -> pif @@ -428,7 +438,8 @@ pelemAt' = phoistAcyclic $ (phead # xs) (self # (n - 1) #$ ptail # xs) -pfind :: (PIsListLike l a) => Term s ((a :--> PBool) :--> l a :--> PMaybe a) +-- | / O(n) /. like haskell level `find` but on plutarch level +pfind :: PIsListLike l a => Term s ((a :--> PBool) :--> l a :--> PMaybe a) pfind = phoistAcyclic $ pfix #$ plam $ \self f xs -> pelimList diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 8893b6257..0b9125a19 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -82,6 +82,7 @@ module Plutarch.Prelude ( pfoldl, pall, pany, + (#!!), -- * Scott encoded list type PList (..), diff --git a/plutarch-extra/Plutarch/ListUtils.hs b/plutarch-extra/Plutarch/ListUtils.hs index b0d10eacb..24dd40e05 100644 --- a/plutarch-extra/Plutarch/ListUtils.hs +++ b/plutarch-extra/Plutarch/ListUtils.hs @@ -2,11 +2,13 @@ module Plutarch.ListUtils (preverse, pcheckSorted) where import Plutarch.Prelude +-- | / O(n) /. reverses a list preverse :: (PIsListLike l a) => Term s (l a :--> l a) preverse = phoistAcyclic $ pfoldl # plam (\ys y -> pcons # y # ys) # pnil +-- | / O(n) /.checks whether a list is sorted pcheckSorted :: (PIsListLike l a, POrd a) => Term s (l a :--> PBool) pcheckSorted = pfix #$ plam $ \self xs -> diff --git a/plutarch-test/goldens/extra.listutils.goldens.bench.golden b/plutarch-test/goldens/extra.listutils.goldens.bench.golden index b4d4dfe2c..3f32ffa2d 100644 --- a/plutarch-test/goldens/extra.listutils.goldens.bench.golden +++ b/plutarch-test/goldens/extra.listutils.goldens.bench.golden @@ -1,4 +1,4 @@ reverse.reverse_[1..5] {"exBudgetCPU":7592215,"exBudgetMemory":25600,"scriptSizeBytes":87} isSorted.[1..10] {"exBudgetCPU":18915730,"exBudgetMemory":59218,"scriptSizeBytes":115} -isSorted.reverse_[1..10] {"exBudgetCPU":4106553,"exBudgetMemory":13403,"scriptSizeBytes":128} +isSorted.reverse_[1..10] {"exBudgetCPU":4047007,"exBudgetMemory":13203,"scriptSizeBytes":126} isSorted.reverse_[] {"exBudgetCPU":803971,"exBudgetMemory":2800,"scriptSizeBytes":56} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.listutils.goldens.uplc.golden b/plutarch-test/goldens/extra.listutils.goldens.uplc.golden index 555d6dd46..8aab48a48 100644 --- a/plutarch-test/goldens/extra.listutils.goldens.uplc.golden +++ b/plutarch-test/goldens/extra.listutils.goldens.uplc.golden @@ -1,4 +1,4 @@ reverse.reverse_[1..5] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> i3 i1 i2) (\i0 -> \i0 -> force i1) (i1 1 (i1 2 (i1 3 (i1 4 (i1 5 (\i0 -> \i0 -> force i1))))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) isSorted.[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (lessThanEqualsInteger i4 i2) (delay (i6 i3)))) (delay True)) (delay True)) (i1 1 (i1 2 (i1 3 (i1 4 (i1 5 (i1 6 (i1 7 (i1 8 (i1 9 (i1 10 (\i0 -> \i0 -> force i1)))))))))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -isSorted.reverse_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i2 i1 (delay False) (delay True))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (lessThanEqualsInteger i4 i2) (delay (i6 i3)))) (delay True)) (delay True)) (i2 10 (i2 9 (i2 8 (i2 7 (i2 6 (i2 5 (i2 4 (i2 3 (i2 2 (i2 1 (\i0 -> \i0 -> force i1))))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +isSorted.reverse_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 i1 False True) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (lessThanEqualsInteger i4 i2) (delay (i6 i3)))) (delay True)) (delay True)) (i2 10 (i2 9 (i2 8 (i2 7 (i2 6 (i2 5 (i2 4 (i2 3 (i2 2 (i2 1 (\i0 -> \i0 -> force i1))))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) isSorted.reverse_[] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i3 i4) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> force i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.fun.bench.golden b/plutarch-test/goldens/list.fun.bench.golden deleted file mode 100644 index 30f3399de..000000000 --- a/plutarch-test/goldens/list.fun.bench.golden +++ /dev/null @@ -1,18 +0,0 @@ -pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} -pconcat.identity {"exBudgetCPU":2054437,"exBudgetMemory":7000,"scriptSizeBytes":64} -plength {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -pelem {"exBudgetCPU":21833687,"exBudgetMemory":56502,"scriptSizeBytes":97} -pall {"exBudgetCPU":16886804,"exBudgetMemory":42193,"scriptSizeBytes":100} -plistEquals.true {"exBudgetCPU":46644574,"exBudgetMemory":122904,"scriptSizeBytes":126} -plistEquals.false {"exBudgetCPU":25469562,"exBudgetMemory":64918,"scriptSizeBytes":128} -plistEquals.empty {"exBudgetCPU":16381797,"exBudgetMemory":40024,"scriptSizeBytes":125} -pmap.eg {"exBudgetCPU":29309216,"exBudgetMemory":77312,"scriptSizeBytes":99} -pmap.identity {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":54} -pfilter.1 {"exBudgetCPU":35949366,"exBudgetMemory":87322,"scriptSizeBytes":115} -pfilter.2 {"exBudgetCPU":30925386,"exBudgetMemory":83312,"scriptSizeBytes":110} -pzipWith {"exBudgetCPU":46106600,"exBudgetMemory":119104,"scriptSizeBytes":120} -pfoldl.primed.nonempty {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -pfoldl.primed.empty {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} -pfoldl.primed.nonempty {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -pfoldl.primed.empty {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} \ No newline at end of file diff --git a/plutarch-test/goldens/list.fun.uplc.golden b/plutarch-test/goldens/list.fun.uplc.golden deleted file mode 100644 index 0f2818f47..000000000 --- a/plutarch-test/goldens/list.fun.uplc.golden +++ /dev/null @@ -1,18 +0,0 @@ -pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) -pnull.nonempty (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) -pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 i2 (i4 i1)) (delay i3)) i2) ((\i0 -> i2 i1 (\i0 -> \i0 -> force i1)) 0) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -plength (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (addInteger i4 1) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pelem (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i2 i5) (delay True) (delay (i4 i1)))) (delay False))) 5 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pall (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i5 i2) (delay (i4 i1)))) (delay True))) (\i0 -> False) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -plistEquals.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) -plistEquals.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [1,2,3,4,5,6,7,8,9,10]) (i1 [1,2,3])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -plistEquals.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [1,2,3,4,5,6,7,8,9,10]) (i1 [])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -pmap.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1))) -pfilter.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -pfilter.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -pzipWith (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i11 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) -pfoldl.primed.nonempty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.primed.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.primed.nonempty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.primed.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.bench.golden b/plutarch-test/goldens/list.goldens.bench.golden deleted file mode 100644 index d448bc420..000000000 --- a/plutarch-test/goldens/list.goldens.bench.golden +++ /dev/null @@ -1,20 +0,0 @@ -pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} -phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} -ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} -pnull.nonempty {"exBudgetCPU":16261571,"exBudgetMemory":40093,"scriptSizeBytes":85} -pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} -pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} -pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} -pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} -pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} -pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} -pfoldl.nonempty0 {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.nonempty1 {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.empty0 {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} -pfoldl.empty1 {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} -elemAt.elemAt_3_[1..10] {"exBudgetCPU":8885733,"exBudgetMemory":25516,"scriptSizeBytes":138} -elemAt.elemAt_0_[1..10] {"exBudgetCPU":4039782,"exBudgetMemory":12604,"scriptSizeBytes":138} -elemAt.elemAt_9_[1..10] {"exBudgetCPU":18577635,"exBudgetMemory":51340,"scriptSizeBytes":138} -find.find_(==3)_[1..4] {"exBudgetCPU":5088068,"exBudgetMemory":15806,"scriptSizeBytes":89} -find.find_(==5)_[1..4] {"exBudgetCPU":7190955,"exBudgetMemory":22408,"scriptSizeBytes":89} \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.dev=false.bench.golden b/plutarch-test/goldens/list.goldens.dev=false.bench.golden new file mode 100644 index 000000000..553b1cb10 --- /dev/null +++ b/plutarch-test/goldens/list.goldens.dev=false.bench.golden @@ -0,0 +1,25 @@ +pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} +phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} +ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} +pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} +pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} +pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} +pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} +pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} +pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} +pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} +pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} +pfoldl.nonempty {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.nonempty-primed {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.empty {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +pfoldl.empty-primed {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +elemAt.elemAt_3_[1..10] {"exBudgetCPU":22527179,"exBudgetMemory":56708,"scriptSizeBytes":127} +elemAt.elemAt_0_[1..10] {"exBudgetCPU":17681228,"exBudgetMemory":43796,"scriptSizeBytes":127} +elemAt.elemAt_9_[1..10] {"exBudgetCPU":32219081,"exBudgetMemory":82532,"scriptSizeBytes":127} +find.find_(==3)_[1..4] {"exBudgetCPU":11027650,"exBudgetMemory":29622,"scriptSizeBytes":100} +find.find_(==5)_[1..4] {"exBudgetCPU":13130537,"exBudgetMemory":36224,"scriptSizeBytes":100} +x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} +x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} +uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} +uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} +uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.uplc.eval.golden b/plutarch-test/goldens/list.goldens.dev=false.uplc.eval.golden similarity index 56% rename from plutarch-test/goldens/list.goldens.uplc.eval.golden rename to plutarch-test/goldens/list.goldens.dev=false.uplc.eval.golden index 3ca4a85d6..24db9cb06 100644 --- a/plutarch-test/goldens/list.goldens.uplc.eval.golden +++ b/plutarch-test/goldens/list.goldens.dev=false.uplc.eval.golden @@ -1,20 +1,25 @@ pmatch (program 1.0.0 error) phead (program 1.0.0 True) ptail (program 1.0.0 True) -pnull.nonempty (program 1.0.0 True) pnull.empty (program 1.0.0 True) +pnull.nonempty (program 1.0.0 True) pconcat.identity (program 1.0.0 True) pmap.eg (program 1.0.0 True) pmap.identity (program 1.0.0 True) pfilter.evens (program 1.0.0 True) pfilter.gt5 (program 1.0.0 True) pzipWith.double (program 1.0.0 True) -pfoldl.nonempty0 (program 1.0.0 True) -pfoldl.nonempty1 (program 1.0.0 True) -pfoldl.empty0 (program 1.0.0 True) -pfoldl.empty1 (program 1.0.0 True) +pfoldl.nonempty (program 1.0.0 True) +pfoldl.nonempty-primed (program 1.0.0 True) +pfoldl.empty (program 1.0.0 True) +pfoldl.empty-primed (program 1.0.0 True) elemAt.elemAt_3_[1..10] (program 1.0.0 4) elemAt.elemAt_0_[1..10] (program 1.0.0 1) elemAt.elemAt_9_[1..10] (program 1.0.0 10) find.find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) -find.find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) \ No newline at end of file +find.find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) +x1+x2.builtin (program 1.0.0 3) +x1+x2.pmatch (program 1.0.0 3) +uncons.ChooseList (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail-and-null (program 1.0.0 [2,3,4,5]) \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.uplc.golden b/plutarch-test/goldens/list.goldens.dev=false.uplc.golden similarity index 53% rename from plutarch-test/goldens/list.goldens.uplc.golden rename to plutarch-test/goldens/list.goldens.dev=false.uplc.golden index c251d7ee7..d5c69ce5e 100644 --- a/plutarch-test/goldens/list.goldens.uplc.golden +++ b/plutarch-test/goldens/list.goldens.dev=false.uplc.golden @@ -1,20 +1,25 @@ pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) phead (program 1.0.0 (equalsInteger 1 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) ptail (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [2,3,4,5,6,7,8,9,10]) ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (i1 [1,2,3,4,5,6,7,8,9,10]))) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pnull.nonempty (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) +pnull.nonempty (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i4 i2 i1 (delay False)) (i1 (i3 (i4 i10) (\i0 -> \i0 -> force i1)) (i3 (\i0 -> \i0 -> force i1) (i4 i10))) (delay (i1 (i3 (\i0 -> \i0 -> force i1) (i4 i10)) (i4 i10))))) (i4 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))))) (force ifThenElse)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i10 i2 (i4 i1)) (delay i3)) i2)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i3 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i9 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 [1,2,3,4,5,6,7,8,9,10])) (i1 [2,4,6,8,10,12,14,16,18,20])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) pmap.identity (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> force i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) pfilter.evens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [2,4,6,8,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) pfilter.gt5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [6,7,8,9,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) pzipWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i2 i1) (i2 i1)) (i2 [2,4,6,8,10,12,14,16,18,20])) [1,2,3,4,5,6,7,8,9,10]) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pfoldl.nonempty0 (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.nonempty1 (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.empty0 (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.empty1 (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -elemAt.elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -elemAt.elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -elemAt.elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -find.find_(==3)_[1..4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 1 (i1 2 (i1 3 (i1 4 (\i0 -> \i0 -> force i1)))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -find.find_(==5)_[1..4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 1 (i1 2 (i1 3 (i1 4 (\i0 -> \i0 -> force i1)))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file +pfoldl.nonempty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.nonempty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==3)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==5)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +x1+x2.builtin (program 1.0.0 ((\i0 -> (\i0 -> addInteger (i1 (force tailList i2)) (i1 i2)) (force headList)) [1,2,3,4,5])) +x1+x2.pmatch (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i1 i3 (delay error) (delay ((\i0 -> force (i2 i1 (delay error) (delay (addInteger (i3 i4) (i3 i1))))) (force tailList i3))))) (force (force chooseList))) (force headList)) [1,2,3,4,5])) +uncons.ChooseList (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay error) (delay (force tailList i1)))) [1,2,3,4,5])) +uncons.head-and-tail (program 1.0.0 ((\i0 -> (\i0 -> force tailList i2) (force headList i1)) [1,2,3,4,5])) +uncons.head-and-tail-and-null (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse i1 (delay error) (delay ((\i0 -> force tailList i3) (force headList i2))))) (force nullList i1)) [1,2,3,4,5])) \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.dev=true.bench.golden b/plutarch-test/goldens/list.goldens.dev=true.bench.golden new file mode 100644 index 000000000..64e96914d --- /dev/null +++ b/plutarch-test/goldens/list.goldens.dev=true.bench.golden @@ -0,0 +1,25 @@ +pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} +phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} +ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} +pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} +pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} +pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} +pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} +pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} +pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} +pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} +pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} +pfoldl.nonempty {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.nonempty-primed {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.empty {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +pfoldl.empty-primed {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +elemAt.elemAt_3_[1..10] {"exBudgetCPU":22527179,"exBudgetMemory":56708,"scriptSizeBytes":157} +elemAt.elemAt_0_[1..10] {"exBudgetCPU":17681228,"exBudgetMemory":43796,"scriptSizeBytes":157} +elemAt.elemAt_9_[1..10] {"exBudgetCPU":32219081,"exBudgetMemory":82532,"scriptSizeBytes":157} +find.find_(==3)_[1..4] {"exBudgetCPU":11027650,"exBudgetMemory":29622,"scriptSizeBytes":100} +find.find_(==5)_[1..4] {"exBudgetCPU":13130537,"exBudgetMemory":36224,"scriptSizeBytes":100} +x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} +x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} +uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} +uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} +uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.dev=true.uplc.eval.golden b/plutarch-test/goldens/list.goldens.dev=true.uplc.eval.golden new file mode 100644 index 000000000..24db9cb06 --- /dev/null +++ b/plutarch-test/goldens/list.goldens.dev=true.uplc.eval.golden @@ -0,0 +1,25 @@ +pmatch (program 1.0.0 error) +phead (program 1.0.0 True) +ptail (program 1.0.0 True) +pnull.empty (program 1.0.0 True) +pnull.nonempty (program 1.0.0 True) +pconcat.identity (program 1.0.0 True) +pmap.eg (program 1.0.0 True) +pmap.identity (program 1.0.0 True) +pfilter.evens (program 1.0.0 True) +pfilter.gt5 (program 1.0.0 True) +pzipWith.double (program 1.0.0 True) +pfoldl.nonempty (program 1.0.0 True) +pfoldl.nonempty-primed (program 1.0.0 True) +pfoldl.empty (program 1.0.0 True) +pfoldl.empty-primed (program 1.0.0 True) +elemAt.elemAt_3_[1..10] (program 1.0.0 4) +elemAt.elemAt_0_[1..10] (program 1.0.0 1) +elemAt.elemAt_9_[1..10] (program 1.0.0 10) +find.find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) +find.find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) +x1+x2.builtin (program 1.0.0 3) +x1+x2.pmatch (program 1.0.0 3) +uncons.ChooseList (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail-and-null (program 1.0.0 [2,3,4,5]) \ No newline at end of file diff --git a/plutarch-test/goldens/list.goldens.dev=true.uplc.golden b/plutarch-test/goldens/list.goldens.dev=true.uplc.golden new file mode 100644 index 000000000..7027f46c2 --- /dev/null +++ b/plutarch-test/goldens/list.goldens.dev=true.uplc.golden @@ -0,0 +1,25 @@ +pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) +phead (program 1.0.0 (equalsInteger 1 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +ptail (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [2,3,4,5,6,7,8,9,10]) ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (i1 [1,2,3,4,5,6,7,8,9,10]))) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) +pnull.nonempty (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i4 i2 i1 (delay False)) (i1 (i3 (i4 i10) (\i0 -> \i0 -> force i1)) (i3 (\i0 -> \i0 -> force i1) (i4 i10))) (delay (i1 (i3 (\i0 -> \i0 -> force i1) (i4 i10)) (i4 i10))))) (i4 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))))) (force ifThenElse)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i10 i2 (i4 i1)) (delay i3)) i2)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) +pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i3 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i9 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 [1,2,3,4,5,6,7,8,9,10])) (i1 [2,4,6,8,10,12,14,16,18,20])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pmap.identity (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> force i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfilter.evens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [2,4,6,8,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfilter.gt5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [6,7,8,9,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pzipWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i2 i1) (i2 i1)) (i2 [2,4,6,8,10,12,14,16,18,20])) [1,2,3,4,5,6,7,8,9,10]) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfoldl.nonempty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.nonempty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==3)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==5)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +x1+x2.builtin (program 1.0.0 ((\i0 -> (\i0 -> addInteger (i1 (force tailList i2)) (i1 i2)) (force headList)) [1,2,3,4,5])) +x1+x2.pmatch (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i1 i3 (delay error) (delay ((\i0 -> force (i2 i1 (delay error) (delay (addInteger (i3 i4) (i3 i1))))) (force tailList i3))))) (force (force chooseList))) (force headList)) [1,2,3,4,5])) +uncons.ChooseList (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay error) (delay (force tailList i1)))) [1,2,3,4,5])) +uncons.head-and-tail (program 1.0.0 ((\i0 -> (\i0 -> force tailList i2) (force headList i1)) [1,2,3,4,5])) +uncons.head-and-tail-and-null (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse i1 (delay error) (delay ((\i0 -> force tailList i3) (force headList i2))))) (force nullList i1)) [1,2,3,4,5])) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.bench.golden b/plutarch-test/goldens/list.pconcat.identity.bench.golden deleted file mode 100644 index 520fbab6c..000000000 --- a/plutarch-test/goldens/list.pconcat.identity.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":2054437,"exBudgetMemory":7000,"scriptSizeBytes":64} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden b/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden deleted file mode 100644 index a6fe1ca52..000000000 --- a/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 0 (\i0 -> \i0 -> force i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.uplc.golden b/plutarch-test/goldens/list.pconcat.identity.uplc.golden deleted file mode 100644 index c2c095d0d..000000000 --- a/plutarch-test/goldens/list.pconcat.identity.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 i2 (i4 i1)) (delay i3)) i2) ((\i0 -> i2 i1 (\i0 -> \i0 -> force i1)) 0) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.bench.golden b/plutarch-test/goldens/list.pfilter.bench.golden deleted file mode 100644 index fa1a61ba1..000000000 --- a/plutarch-test/goldens/list.pfilter.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -p1 {"exBudgetCPU":35949366,"exBudgetMemory":87322,"scriptSizeBytes":115} -p2 {"exBudgetCPU":30925386,"exBudgetMemory":83312,"scriptSizeBytes":110} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.uplc.eval.golden b/plutarch-test/goldens/list.pfilter.uplc.eval.golden deleted file mode 100644 index 6ae3f0591..000000000 --- a/plutarch-test/goldens/list.pfilter.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -p1 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) -p2 (program 1.0.0 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.uplc.golden b/plutarch-test/goldens/list.pfilter.uplc.golden deleted file mode 100644 index 091b0f066..000000000 --- a/plutarch-test/goldens/list.pfilter.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -p1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -p2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.bench.golden b/plutarch-test/goldens/list.pfoldl.bench.golden deleted file mode 100644 index 5f2f40417..000000000 --- a/plutarch-test/goldens/list.pfoldl.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -p1 {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -p1' {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -p2 {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} -p2' {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.uplc.eval.golden b/plutarch-test/goldens/list.pfoldl.uplc.eval.golden deleted file mode 100644 index 934031787..000000000 --- a/plutarch-test/goldens/list.pfoldl.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -p1 (program 1.0.0 -55) -p1' (program 1.0.0 -55) -p2 (program 1.0.0 0) -p2' (program 1.0.0 0) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.uplc.golden b/plutarch-test/goldens/list.pfoldl.uplc.golden deleted file mode 100644 index 20449fe5f..000000000 --- a/plutarch-test/goldens/list.pfoldl.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -p1 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -p1' (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -p2 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -p2' (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.bench.golden b/plutarch-test/goldens/list.phead.bench.golden deleted file mode 100644 index df2056587..000000000 --- a/plutarch-test/goldens/list.phead.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.uplc.eval.golden b/plutarch-test/goldens/list.phead.uplc.eval.golden deleted file mode 100644 index bfe2c27c9..000000000 --- a/plutarch-test/goldens/list.phead.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.uplc.golden b/plutarch-test/goldens/list.phead.uplc.golden deleted file mode 100644 index 5e1f40f29..000000000 --- a/plutarch-test/goldens/list.phead.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.bench.golden b/plutarch-test/goldens/list.pmap.bench.golden deleted file mode 100644 index 978a33629..000000000 --- a/plutarch-test/goldens/list.pmap.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29309216,"exBudgetMemory":77312,"scriptSizeBytes":99} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.uplc.eval.golden b/plutarch-test/goldens/list.pmap.uplc.eval.golden deleted file mode 100644 index f5958794f..000000000 --- a/plutarch-test/goldens/list.pmap.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.uplc.golden b/plutarch-test/goldens/list.pmap.uplc.golden deleted file mode 100644 index ad1169d66..000000000 --- a/plutarch-test/goldens/list.pmap.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmatch.uplc.eval.golden b/plutarch-test/goldens/list.pmatch.uplc.eval.golden deleted file mode 100644 index 046ef4db8..000000000 --- a/plutarch-test/goldens/list.pmatch.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmatch.uplc.golden b/plutarch-test/goldens/list.pmatch.uplc.golden deleted file mode 100644 index 7c74576bf..000000000 --- a/plutarch-test/goldens/list.pmatch.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.bench.golden b/plutarch-test/goldens/list.pnull.bench.golden deleted file mode 100644 index b1909ab24..000000000 --- a/plutarch-test/goldens/list.pnull.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -p0 {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -p1 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.uplc.eval.golden b/plutarch-test/goldens/list.pnull.uplc.eval.golden deleted file mode 100644 index 13f0e5ad0..000000000 --- a/plutarch-test/goldens/list.pnull.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -p0 (program 1.0.0 True) -p1 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.uplc.golden b/plutarch-test/goldens/list.pnull.uplc.golden deleted file mode 100644 index a685f05af..000000000 --- a/plutarch-test/goldens/list.pnull.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -p0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) -p1 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.elemAt.bench.golden b/plutarch-test/goldens/list.property.elemAt.bench.golden deleted file mode 100644 index e0f185c98..000000000 --- a/plutarch-test/goldens/list.property.elemAt.bench.golden +++ /dev/null @@ -1,3 +0,0 @@ -elemAt_3_[1..10] {"exBudgetCPU":8885733,"exBudgetMemory":25516,"scriptSizeBytes":138} -elemAt_0_[1..10] {"exBudgetCPU":4039782,"exBudgetMemory":12604,"scriptSizeBytes":138} -elemAt_9_[1..10] {"exBudgetCPU":18577635,"exBudgetMemory":51340,"scriptSizeBytes":138} \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.elemAt.uplc.eval.golden b/plutarch-test/goldens/list.property.elemAt.uplc.eval.golden deleted file mode 100644 index a32910aaa..000000000 --- a/plutarch-test/goldens/list.property.elemAt.uplc.eval.golden +++ /dev/null @@ -1,3 +0,0 @@ -elemAt_3_[1..10] (program 1.0.0 4) -elemAt_0_[1..10] (program 1.0.0 1) -elemAt_9_[1..10] (program 1.0.0 10) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.elemAt.uplc.golden b/plutarch-test/goldens/list.property.elemAt.uplc.golden deleted file mode 100644 index bb9ef3be2..000000000 --- a/plutarch-test/goldens/list.property.elemAt.uplc.golden +++ /dev/null @@ -1,3 +0,0 @@ -elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 1 (i2 2 (i2 3 (i2 4 (i2 5 (i2 6 (i2 7 (i2 8 (i2 9 (i2 10 (\i0 -> \i0 -> force i1)))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.find.bench.golden b/plutarch-test/goldens/list.property.find.bench.golden deleted file mode 100644 index 2e8c316ce..000000000 --- a/plutarch-test/goldens/list.property.find.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -find_(==3)_[1..4] {"exBudgetCPU":5088068,"exBudgetMemory":15806,"scriptSizeBytes":89} -find_(==5)_[1..4] {"exBudgetCPU":7190955,"exBudgetMemory":22408,"scriptSizeBytes":89} \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.find.uplc.eval.golden b/plutarch-test/goldens/list.property.find.uplc.eval.golden deleted file mode 100644 index 21aa624f7..000000000 --- a/plutarch-test/goldens/list.property.find.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) -find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.find.uplc.golden b/plutarch-test/goldens/list.property.find.uplc.golden deleted file mode 100644 index a6509aada..000000000 --- a/plutarch-test/goldens/list.property.find.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -find_(==3)_[1..4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 1 (i1 2 (i1 3 (i1 4 (\i0 -> \i0 -> force i1)))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -find_(==5)_[1..4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 1 (i1 2 (i1 3 (i1 4 (\i0 -> \i0 -> force i1)))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.reverse.bench.golden b/plutarch-test/goldens/list.property.reverse.bench.golden deleted file mode 100644 index 0c17e9093..000000000 --- a/plutarch-test/goldens/list.property.reverse.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -reverse_[1..5] {"exBudgetCPU":7681534,"exBudgetMemory":25900,"scriptSizeBytes":90} -reverse_[] {"exBudgetCPU":893290,"exBudgetMemory":3100,"scriptSizeBytes":59} \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.reverse.uplc.eval.golden b/plutarch-test/goldens/list.property.reverse.uplc.eval.golden deleted file mode 100644 index 02077b9d6..000000000 --- a/plutarch-test/goldens/list.property.reverse.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -reverse_[1..5] (program 1.0.0 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 1 (\i0 -> \i0 -> force i1))))))) -reverse_[] (program 1.0.0 (\i0 -> \i0 -> force i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/list.property.reverse.uplc.golden b/plutarch-test/goldens/list.property.reverse.uplc.golden deleted file mode 100644 index ae1160ee8..000000000 --- a/plutarch-test/goldens/list.property.reverse.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -reverse_[1..5] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> i4 i1 i2) (\i0 -> \i0 -> force i1) i1) (i1 1 (i1 2 (i1 3 (i1 4 (i1 5 (\i0 -> \i0 -> force i1))))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -reverse_[] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i3 i4) (\i0 -> \i0 -> force i1) i1) (\i0 -> \i0 -> force i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.bench.golden b/plutarch-test/goldens/list.ptail.bench.golden deleted file mode 100644 index df2056587..000000000 --- a/plutarch-test/goldens/list.ptail.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.uplc.eval.golden b/plutarch-test/goldens/list.ptail.uplc.eval.golden deleted file mode 100644 index 1dbbd6e3c..000000000 --- a/plutarch-test/goldens/list.ptail.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.uplc.golden b/plutarch-test/goldens/list.ptail.uplc.golden deleted file mode 100644 index 0d8e97d35..000000000 --- a/plutarch-test/goldens/list.ptail.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.bench.golden b/plutarch-test/goldens/list.pzipWith.bench.golden deleted file mode 100644 index 7d51287d0..000000000 --- a/plutarch-test/goldens/list.pzipWith.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":46106600,"exBudgetMemory":119104,"scriptSizeBytes":120} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.uplc.eval.golden b/plutarch-test/goldens/list.pzipWith.uplc.eval.golden deleted file mode 100644 index f5958794f..000000000 --- a/plutarch-test/goldens/list.pzipWith.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.uplc.golden b/plutarch-test/goldens/list.pzipWith.uplc.golden deleted file mode 100644 index d44aef59c..000000000 --- a/plutarch-test/goldens/list.pzipWith.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i11 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index a71631212..1411c6cc6 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -12,7 +12,7 @@ import Hedgehog (Property) import Data.List (find) import Plutarch.Test.Property.Gen (genList, integerGen) -import Plutarch.Test.Property.Util (haskPlutEquiv, marshal, viaBothPartial, viaPEq) +import Plutarch.Test.Property.Util (haskPlutEquiv, viaBothPartial, viaPEq) import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range @@ -25,18 +25,20 @@ spec = do describe "list" $ do describe "properties" $ do describe "find" $ do - it "baseAgreement" $ findTest + it "plutarch level find mirrors haskell level find" findTest describe "elemAt" $ do - it "base agreement" elemAtTest - describe "goldens" . pgoldenSpec $ do + it "plutarch level elemAt mirrors haskell level elemAt" elemAtTest + describe "goldens" . plutarchDevFlagDescribe . pgoldenSpec $ do let xs10 :: Term _ (PList PInteger) xs10 = integerList [1 .. 10] - "pmatch" @| (pmatch (integerList [1, 3, 1]) $ \_ -> perror) @-> pfails + numList :: Term _ (PBuiltinList PInteger) + numList = pconstant [1 .. 5] + "pmatch" @| pmatch (integerList [1, 3, 1]) (const perror) @-> pfails "phead" @| 1 #== (phead # xs10) @-> passert "ptail" @| integerList [2 .. 10] #== ptail # xs10 @-> passert "pnull" @\ do - "nonempty" @| (pnot #$ pnull # xs10) @-> passert "empty" @| (pnull # integerList []) @-> passert + "nonempty" @| (pnot #$ pnull # xs10) @-> passert "pconcat" @\ do "identity" @| (pconcat # xs10 # pnil #== pconcat # pnil # xs10) #&& (pconcat # pnil # xs10 #== xs10) @-> passert "pmap" @\ do @@ -48,17 +50,53 @@ spec = do "pzipWith" @\ do "double" @| pzipWith' (+) # xs10 # xs10 #== integerList (fmap (* 2) [1 .. 10]) @-> passert "pfoldl" @\ do - "nonempty0" @| pfoldl # plam (-) # 0 # xs10 #== pconstant (foldl (-) 0 [1 .. 10]) @-> passert - "nonempty1" @| pfoldl' (-) # 0 # xs10 #== pconstant (foldl (-) 0 [1 .. 10]) @-> passert - "empty0" @| pfoldl # plam (-) # 0 # integerList [] #== pconstant 0 @-> passert - "empty1" @| pfoldl' (-) # 0 # integerList [] #== pconstant 0 @-> passert + "nonempty" @| pfoldl # plam (-) # 0 # xs10 #== pconstant (foldl (-) 0 [1 .. 10]) @-> passert + "nonempty-primed" @| pfoldl' (-) # 0 # xs10 #== pconstant (foldl (-) 0 [1 .. 10]) @-> passert + "empty" @| pfoldl # plam (-) # 0 # integerList [] #== pconstant 0 @-> passert + "empty-primed" @| pfoldl' (-) # 0 # integerList [] #== pconstant 0 @-> passert "elemAt" @\ do - "elemAt_3_[1..10]" @| pelemAt # 3 # marshal [1 .. 10 :: Integer] - "elemAt_0_[1..10]" @| pelemAt # 0 # marshal [1 .. 10 :: Integer] - "elemAt_9_[1..10]" @| pelemAt # 9 # marshal [1 .. 10 :: Integer] + "elemAt_3_[1..10]" @| pelemAt # 3 # integerList [1 .. 10] + "elemAt_0_[1..10]" @| pelemAt # 0 # integerList [1 .. 10] + "elemAt_9_[1..10]" @| pelemAt # 9 # integerList [1 .. 10] "find" @\ do - "find_(==3)_[1..4]" @| pfind # plam (#== 3) #$ marshal [1 .. 4 :: Integer] - "find_(==5)_[1..4]" @| pfind # plam (#== 5) #$ marshal [1 .. 4 :: Integer] + "find_(==3)_[1..4]" @| pfind # plam (#== 3) #$ integerList [1 .. 4] + "find_(==5)_[1..4]" @| pfind # plam (#== 5) #$ integerList [1 .. 4] + -- Two ways of matching on a list + "x1+x2" @\ do + -- Via HeadList and TailList only. + "builtin" @| (phead #$ ptail # numList) + (phead # numList) + -- Via ChooseList (twice invoked) + "pmatch" + @| pmatch numList + $ \case + PNil -> perror + PCons x xs -> + pmatch xs $ \case + PNil -> perror + PCons y _ -> + x + y + -- Various ways of uncons'ing a list + "uncons" @\ do + -- ChooseList builtin, like uncons but fails on null lists + "ChooseList" + @| pmatch numList + $ \case + PNil -> perror + PCons _x xs -> + xs + -- Retrieving head and tail of a list + "head-and-tail" + @| plet (phead # numList) + $ \_x -> + ptail # numList + -- Retrieve head and tail using builtins, but fail on null lists. + "head-and-tail-and-null" + @| plet (pnull # numList) + $ \isEmpty -> + pmatch isEmpty $ \case + PTrue -> perror + PFalse -> plet (phead # numList) $ \_x -> + ptail # numList findTest :: Property findTest = diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs similarity index 88% rename from plutarch-test/plutarch-extra/Plutarch/ListUtilSpec.hs rename to plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs index ce7b30a61..e393911e1 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -1,4 +1,4 @@ -module Plutarch.ListUtilSpec (spec) where +module Plutarch.ListUtilsSpec (spec) where import Test.Syd import Test.Syd.Hedgehog () @@ -18,7 +18,7 @@ spec = do describe "extra.listutils" $ do describe "properties" $ do describe "reverse" $ do - it "base agreement" reverseTest + it "plutarch level reversing behaves like haskell level reversing" reverseTest describe "goldens" . pgoldenSpec $ do "reverse" @\ do "reverse_[1..5]" @| preverse # marshal [1 .. 5 :: Integer] diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 5ec4ca62c..c6bffb5fc 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -144,7 +144,7 @@ executable plutarch-test Plutarch.IntegerSpec Plutarch.LiftSpec Plutarch.ListSpec - Plutarch.ListUtilSpec + Plutarch.ListUtilsSpec Plutarch.MaybeSpec Plutarch.PairSpec Plutarch.PIsDataSpec From 5ebd9d7f72ae320c8aa1d9700bd879ea0a2af46b Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 19 Mar 2022 18:19:14 +0100 Subject: [PATCH 227/584] fix: remove describe golden in tests and regenerated goldens --- ...tutils.goldens.bench.golden => extra.listutils.bench.golden} | 0 ...oldens.uplc.eval.golden => extra.listutils.uplc.eval.golden} | 0 ...istutils.goldens.uplc.golden => extra.listutils.uplc.golden} | 0 ...ldens.dev=false.bench.golden => list.dev=false.bench.golden} | 0 ...v=false.uplc.eval.golden => list.dev=false.uplc.eval.golden} | 0 ...goldens.dev=false.uplc.golden => list.dev=false.uplc.golden} | 0 ...goldens.dev=true.bench.golden => list.dev=true.bench.golden} | 0 ...dev=true.uplc.eval.golden => list.dev=true.uplc.eval.golden} | 0 ...t.goldens.dev=true.uplc.golden => list.dev=true.uplc.golden} | 0 plutarch-test/plutarch-base/Plutarch/ListSpec.hs | 2 +- plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs | 2 +- 11 files changed, 2 insertions(+), 2 deletions(-) rename plutarch-test/goldens/{extra.listutils.goldens.bench.golden => extra.listutils.bench.golden} (100%) rename plutarch-test/goldens/{extra.listutils.goldens.uplc.eval.golden => extra.listutils.uplc.eval.golden} (100%) rename plutarch-test/goldens/{extra.listutils.goldens.uplc.golden => extra.listutils.uplc.golden} (100%) rename plutarch-test/goldens/{list.goldens.dev=false.bench.golden => list.dev=false.bench.golden} (100%) rename plutarch-test/goldens/{list.goldens.dev=false.uplc.eval.golden => list.dev=false.uplc.eval.golden} (100%) rename plutarch-test/goldens/{list.goldens.dev=false.uplc.golden => list.dev=false.uplc.golden} (100%) rename plutarch-test/goldens/{list.goldens.dev=true.bench.golden => list.dev=true.bench.golden} (100%) rename plutarch-test/goldens/{list.goldens.dev=true.uplc.eval.golden => list.dev=true.uplc.eval.golden} (100%) rename plutarch-test/goldens/{list.goldens.dev=true.uplc.golden => list.dev=true.uplc.golden} (100%) diff --git a/plutarch-test/goldens/extra.listutils.goldens.bench.golden b/plutarch-test/goldens/extra.listutils.bench.golden similarity index 100% rename from plutarch-test/goldens/extra.listutils.goldens.bench.golden rename to plutarch-test/goldens/extra.listutils.bench.golden diff --git a/plutarch-test/goldens/extra.listutils.goldens.uplc.eval.golden b/plutarch-test/goldens/extra.listutils.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/extra.listutils.goldens.uplc.eval.golden rename to plutarch-test/goldens/extra.listutils.uplc.eval.golden diff --git a/plutarch-test/goldens/extra.listutils.goldens.uplc.golden b/plutarch-test/goldens/extra.listutils.uplc.golden similarity index 100% rename from plutarch-test/goldens/extra.listutils.goldens.uplc.golden rename to plutarch-test/goldens/extra.listutils.uplc.golden diff --git a/plutarch-test/goldens/list.goldens.dev=false.bench.golden b/plutarch-test/goldens/list.dev=false.bench.golden similarity index 100% rename from plutarch-test/goldens/list.goldens.dev=false.bench.golden rename to plutarch-test/goldens/list.dev=false.bench.golden diff --git a/plutarch-test/goldens/list.goldens.dev=false.uplc.eval.golden b/plutarch-test/goldens/list.dev=false.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/list.goldens.dev=false.uplc.eval.golden rename to plutarch-test/goldens/list.dev=false.uplc.eval.golden diff --git a/plutarch-test/goldens/list.goldens.dev=false.uplc.golden b/plutarch-test/goldens/list.dev=false.uplc.golden similarity index 100% rename from plutarch-test/goldens/list.goldens.dev=false.uplc.golden rename to plutarch-test/goldens/list.dev=false.uplc.golden diff --git a/plutarch-test/goldens/list.goldens.dev=true.bench.golden b/plutarch-test/goldens/list.dev=true.bench.golden similarity index 100% rename from plutarch-test/goldens/list.goldens.dev=true.bench.golden rename to plutarch-test/goldens/list.dev=true.bench.golden diff --git a/plutarch-test/goldens/list.goldens.dev=true.uplc.eval.golden b/plutarch-test/goldens/list.dev=true.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/list.goldens.dev=true.uplc.eval.golden rename to plutarch-test/goldens/list.dev=true.uplc.eval.golden diff --git a/plutarch-test/goldens/list.goldens.dev=true.uplc.golden b/plutarch-test/goldens/list.dev=true.uplc.golden similarity index 100% rename from plutarch-test/goldens/list.goldens.dev=true.uplc.golden rename to plutarch-test/goldens/list.dev=true.uplc.golden diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index 1411c6cc6..7f3a2eb3f 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -28,7 +28,7 @@ spec = do it "plutarch level find mirrors haskell level find" findTest describe "elemAt" $ do it "plutarch level elemAt mirrors haskell level elemAt" elemAtTest - describe "goldens" . plutarchDevFlagDescribe . pgoldenSpec $ do + plutarchDevFlagDescribe . pgoldenSpec $ do let xs10 :: Term _ (PList PInteger) xs10 = integerList [1 .. 10] numList :: Term _ (PBuiltinList PInteger) diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs index e393911e1..bfaeec653 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -19,7 +19,7 @@ spec = do describe "properties" $ do describe "reverse" $ do it "plutarch level reversing behaves like haskell level reversing" reverseTest - describe "goldens" . pgoldenSpec $ do + pgoldenSpec $ do "reverse" @\ do "reverse_[1..5]" @| preverse # marshal [1 .. 5 :: Integer] "isSorted" @\ do From f929c0f05ea58835f23899279ad365b902683e05 Mon Sep 17 00:00:00 2001 From: Mango The Fourth <40720523+MangoIV@users.noreply.github.com> Date: Sun, 20 Mar 2022 14:03:57 +0100 Subject: [PATCH 228/584] Update GUIDE.md --- docs/GUIDE.md | 86 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 26 deletions(-) diff --git a/docs/GUIDE.md b/docs/GUIDE.md index 592e4c5c0..dce87eb89 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -48,7 +48,10 @@ - [Alternatives to `OverloadedRecordDot`](#alternatives-to-overloadedrecorddot) - [All about constructing data values](#all-about-constructing-data-values) - [Implementing PIsDataRepr and friends](#implementing-pisdatarepr-and-friends) - - [PTryFrom, PMaybeFrom and PFrom](#ptryfrom-pmaybefrom-and-pfrom) + - [PTryFrom](#the-class-ptryfrom) + - [Laws](#laws) + - [PTryFromExcess](#ptryfromexcess) + - [Recovering only partially](#recovering-only-partially) - [Working with Types](#working-with-types) - [PInteger](#pinteger) - [PBool](#pbool) @@ -1372,43 +1375,67 @@ newtype PFoo (s :: S) = PMkFoo (Term s (PDataRecord '["foo" ':= PByteString])) ``` Just an extra `PDataFields` derivation compared to the sum type usage! (oh and also the ominous `UndecidableInstances`) -### PTryFrom, PMaybeFrom and PFrom +### The class PTryFrom ```haskell --- PTryFrom - class PTryFrom (a :: PType) (b :: PType) where type PTryFromExcess a b :: PType - ptryFrom :: Term s a -> TermCont s (Term s b, Term s (PTryFromExcess a b)) + ptryFrom :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r +``` - -- | this function is only used for `PFrom` and is not exported, - -- it makes use of PTryFrom being a class that always recovers data - ptryFromInverse :: Term s b -> Term s a - ptryFromInverse = punsafeCoerce +`PTryFrom` is a typeclass to prove equality between a type that in some way can't be trusted about its representation and another type that we want the untrusted type to be represented as. +`PTryFrom` proves the structure of the untrusted type and recovers it as the trusted, type which hence also carries more information. --- PFrom +A good example is getting a `PData` from a redeemer and wanting to prove that it is of a certain kind, e.g. a `PAsData (PBuiltinList (PAsData PInteger))`. We could do this with: -class PFrom a b where - pfrom :: Term s a -> TermCont s (Term s b) +```haskell +recoverListFromPData opq = unTermCont $ fst <$> ptryFromData @(PAsData (PBuiltinList (PAsData PInteger)) opq +``` --- PMaybeFrom +As you can see, it uses the utility function `ptryFromData @b`, which does the same as `ptryFrom @PData @b`. -class PMaybeFrom (a :: PType) (b :: PType) where - type PMaybeFromExcess a b :: PType - pmaybeFrom :: Term s a -> TermCont s (Term s (PMaybe b), Term s (PMaybe (PMaybeFromExcess a b))) -``` +#### Laws -`PTryFrom` is a typeclass to prove equality between a type that in some way can't be trusted about its representation and another type that we want the untrusted type to be represented as. -`PTryFrom` proves the structure of the untrusted type and recovers it as the trusted, type which hence also carries more information. +- the operation `ptryFrom` mustn't change the representation of the underlying data +- the operation `ptryFrom` must always prove the integrity of the whole target type + - example: + `ptryFrom @PData @(PAsData (PBuiltinList PData))` ssucceeds iff the underlying representation is a `BuiltinList` containing any `PData` +- all conversions are fallible, this happens if the representation doesn't match the expected type. +- the operation `ptryFrom @a @b` proves equality between the less expressive `PType` `a` and the more expressive `PType` `b`, hence the first + element of the resulting Tuple must always be wrapped in `PAsData` if the origin type was `PData` (see law 1) +- the result type `b` must always be safer than the origin type `a`, i.e. it must carry more information -A good example is getting a `PData` from a redeemer and wanting to prove that it is of a certain kind, e.g. a `PAsData (PBuiltinList (PAsData PInteger))`. We could do this with: +#### `PTryFromExcess` + +An important note is, that `PTryFrom` carries a type `PTryFromExcess` which safes data that arose as "excess" during the act of verifying. For `PData (PAsData PSomething)` instances this most times +carries a `PSomething`, i.e. the type that has been proven equality for but without `PAsData` wrapper. In cases where this type is not useful, the excess type is just an empty `HRec`. + +In case of the recovered type being a record or anything that contains a record, the excess type is more interesting: +It contains an `HRec`, that has all the fields that have been recoverd and all *their* excess stored. If you recover a `PAsData (PDataRecord xs)` from `PData`, there is another field under the accessor `"unwrapped"` that contains the unwrapped record, which representation wise is just a `PBuiltinList +PData`, of course. + +Generally, when recovering a `PDataRecord`, the procedure is as follows ```haskell -recoverListFromPData = unTermCont $ fst <$> ptryFrom @PData @(PAsData (PBuiltinList (PAsData PInteger)) +untrustedRecord :: Term s PData +untrustedRecord = + let rec :: Term s (PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) + rec = pdata $ pdcons # (pdata $ pdcons # pdata (pconstant 42) # pdnil) # pdnil + in pforgetData rec + +-- obviously, `untrustedRecord` would be what we get from our untrusted party + +theField :: Term s PInteger +theField = unTermCont $ do + (_, exc) <- tcont (ptryFromData @(PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) untrustedRecord) + pure $ exc._0._1 ``` -An important note is, that `PTryFrom` carries a type `PExcess` which safes data that arose as "excess" during the act of verifying. For `PData (PAsData PSomething)` instances this most times -carries a `PSomething`, i.e. the type that has been proven equality for but without `PAsData` wrapper. In cases where this type is not useful, the `PExcess` type is just `PUnit`. +Because the record excess stores the field already in its unwrapped form, you don't have to `pfromData` it again. + +If you don't use `OverloadedRecordDot`, there is an equivalent function `getExcessField` that does the same and works with type applications. + +#### Recovering only partially In case we don't want to verify the whole structure but rather part of it (this can be a reasonable decision to lower the fees), we can just leave the part of the data that is not to be verified a `PData` which serves as the base case: @@ -1417,10 +1444,17 @@ verified a `PData` which serves as the base case: recoverListPartially = ptryFrom @PData @(PAsData (PBuiltinList PData)) ``` -As `ptryFrom` always *recovers* information and *never changes the representation* of the type to be verified, the reverse operation is always successful by `punsafeCoerce`. -This is why there is an instance for `PFrom` that always allows conversion to the "less lawful" type. +This is especially important with something like `PDataSum` which simply cannot store the excess types over the barrier of `pmatch` because obviously, +you don't know the type of the excess before actually matching on it. The solution would be to recover an equivalent `PDataSum` whose constructors +contain `PData` and after having matched on those, recover the underlying record or whatever field you're interested in. If you're not interested +in the excess, you could of course also just recover the whole Sum without issue, in this case it won't be more expensive. -There is also `PMaybeFrom` which allows conversion similary to `PTryFrom` but doesn't `perror` on failure but rather returns `PNothing` +Please be aware, that nuances can already make a performance difference, e.g. +- recovering `ptryFromData @(PAsData (PBuiltinList PData))` is cheaper than `ptryFromData @(PAsData (PBuiltinList (PAsData PDAta)))` because the latter + maps over no-ops, whereas the former just asserts that the `PData` indeed contains a `PBuiltinList`. +- If you only, say, need the head of a list, first recovering a `PAsData (PBuiltinList PData)` (don't forget to use the excess instead of using + `pfromData`), *then* using head and after that recovering the field in there will be cheaper than recovering the whole list with the target type and + using head on that. ## Working with Types From 7f6f40d178c23d0acd0e580201ad1024fbb0ba0d Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sun, 20 Mar 2022 14:54:23 +0100 Subject: [PATCH 229/584] fix: more cleanups and add missing instance - added an instances for - removed the instance for because it's completely useless --- Plutarch/TryFrom.hs | 35 +++++++------------ .../conditional/Plutarch/TryFromSpec.hs | 10 ++++++ 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 0e3fcde8d..92021155a 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -25,8 +25,8 @@ import Plutarch.Integer (PInteger) import Plutarch.Unit (PUnit (PUnit)) import Plutarch.Internal.Other ( + DerivePNewtype, PInner, - POpaque, PType, S, Term, @@ -376,28 +376,7 @@ instance instance {-# OVERLAPPING #-} SumValidation n '[] where validateSum _ = ptraceError "reached end of sum while still not having found the constructor" ------------------------ POpaque ans other utility instances ----------------------------- - -{- | - for none of the opaque instances it can be verified - that the actual structure is what it says to be - because that data is lost when the PAsData wrapper - is removed, this can only be safely used if you obtained - your POpaque safely --} -instance - ( PTryFrom PData (PAsData a) - , PIsData a - ) => - PTryFrom POpaque a - where - type PTryFromExcess POpaque a = Flip Term (PAsData a) - ptryFrom opq = runTermCont $ do - let prop :: Term _ a - prop = punsafeCoerce opq - ver' <- fst <$> TermCont (ptryFromData @(PAsData a) $ pforgetData $ pdata prop) - ver <- tcont $ plet ver' - pure $ (punsafeCoerce opq, ver) +----------------------- other utility functions ----------------------------------------- {- | if there is an instance to recover something that is unwrapped from something that is unwrapped, then there is also the possibility to recover the whole thing but wrapped @@ -440,6 +419,16 @@ instance reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) pure $ (pdata $ punsafeFrom reprsum, HNil) +----------------------- DerivePNewtype insatace ----------------------------------------- + +instance + ( PTryFrom a b + ) => + PTryFrom a (DerivePNewtype c b) + where + type PTryFromExcess a (DerivePNewtype c b) = PTryFromExcess a b + ptryFrom opq = runTermCont $ (\(inn, exc) -> (punsafeFrom inn, exc)) <$> tcont (ptryFrom @a @b opq) + ----------------------- HasField instance ----------------------------------------------- instance (ElemOf name ptyp rec, Reduce (ptyp s) ~ out) => HasField name (HRecP rec s) out where diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 7b9a2e291..ca392b12a 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -169,6 +169,9 @@ spec = do @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) (punsafeCoerce $ pconstant $ Constr 1 [PlutusTx.I 5, B "foo"]) @-> psucceeds + "recover PWrapInt" + @| pconstant 42 #== (unTermCont $ snd <$> tcont (ptryFromData @(PAsData PWrapInt) (pforgetData $ pdata $ pconstant @PInteger 42))) + @-> passert "recovering a record partially vs completely" @\ do "partially" @| checkDeep @@ -551,3 +554,10 @@ theField :: Term s PInteger theField = unTermCont $ do (_, exc) <- tcont (ptryFrom @_ @(PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) untrustedRecord) pure $ exc._0._1 + +------------------- Sample usage DerivePNewType ------------------------------------ + +newtype PWrapInt (s :: S) = PMkWrapInt (Term s PInteger) + deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PWrapInt PInteger) + +deriving via DerivePNewtype (PAsData PWrapInt) (PAsData PInteger) instance PTryFrom PData (PAsData PWrapInt) From 59aef6e4d4b163f0efad1c57efda62bd88497a5b Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 21 Mar 2022 13:46:41 +0530 Subject: [PATCH 230/584] Explicit LTE impl --- Plutarch/Api/V1/Maybe.hs | 26 +++++++++++++------ Plutarch/DataRepr/Internal.hs | 18 ++++++++++--- .../goldens/pisdata.lte.bench.golden | 18 ++++++------- plutarch-test/goldens/pisdata.lte.uplc.golden | 18 ++++++------- 4 files changed, 50 insertions(+), 30 deletions(-) diff --git a/Plutarch/Api/V1/Maybe.hs b/Plutarch/Api/V1/Maybe.hs index d02fabcb7..8c3f70e81 100644 --- a/Plutarch/Api/V1/Maybe.hs +++ b/Plutarch/Api/V1/Maybe.hs @@ -54,7 +54,21 @@ deriving via -- Have to manually write this instance because the constructor id ordering is screwed for 'Maybe'.... instance (PIsData a, POrd a) => POrd (PMaybeData a) where - x #< y = unTermCont $ do + x #< y = _pmaybeLT False (#<) # x # y + x #<= y = _pmaybeLT True (#<=) # x # y + +_pmaybeLT :: + PIsData a => + Bool -> + ( forall s rec. + (rec ~ (IndexList 0 (PIsDataReprRepr (PMaybeData a)))) => + Term s (PDataRecord rec) -> + Term s (PDataRecord rec) -> + Term s PBool + ) -> + Term s (PMaybeData a :--> PMaybeData a :--> PBool) +_pmaybeLT whenBothNothing ltF = phoistAcyclic $ + plam $ \x y -> unTermCont $ do a <- tcont . plet $ pasConstr #$ pforgetData $ pdata x b <- tcont . plet $ pasConstr #$ pforgetData $ pdata y @@ -74,12 +88,8 @@ instance (PIsData a, POrd a) => POrd (PMaybeData a) where -} ( pif (cid1 #== 0) - (lt0 (punsafeCoerce $ psndBuiltin # a) (punsafeCoerce $ psndBuiltin # b)) - -- Both are 'Nothing'. '#<' is False. - $ pconstant False + (ltF (punsafeCoerce $ psndBuiltin # a) (punsafeCoerce $ psndBuiltin # b)) + -- Both are 'Nothing'. Let caller choose answer. + $ pconstant whenBothNothing ) $ pconstant True - where - lt0 = (#<) @(PDataRecord (IndexList 0 (PIsDataReprRepr (PMaybeData a)))) - - x #<= y = x #== y #|| x #< y diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 6b9116d81..5ab63eebe 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -70,7 +70,7 @@ import Plutarch ( (#$), type (:-->), ) -import Plutarch.Bool (PBool, PEq, POrd, pif, (#<), (#<=), (#==), (#||)) +import Plutarch.Bool (PBool, PEq, POrd, pif, (#<), (#<=), (#==)) import Plutarch.Builtin ( PAsData, PBuiltinList, @@ -155,7 +155,14 @@ instance (POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord b <- tcont . plet $ pfromData y pure $ pif (a #< b) (pconstant True) $ pif (a #== b) (xs #< ys) $ pconstant False - l1 #<= l2 = pdToBuiltin l1 #== pdToBuiltin l2 #|| l1 #< l2 + l1 #<= l2 = unTermCont $ do + PDCons x xs <- tcont $ pmatch l1 + PDCons y ys <- tcont $ pmatch l2 + + a <- tcont . plet $ pfromData x + b <- tcont . plet $ pfromData y + + pure $ pif (a #< b) (pconstant True) $ pif (a #== b) (xs #<= ys) $ pconstant False {- | Cons a field to a data record. @@ -223,7 +230,7 @@ instance PEq (PDataSum defs) where instance MkLtReprHandler defs => POrd (PDataSum defs) where x #< y = pmatchLT x y mkLtReprHandler - x #<= y = x #== y #|| x #< y + x #<= y = pmatchLT x y mkLteReprHandler pasDataSum :: PIsDataRepr a => Term s a -> Term s (PDataSum (PIsDataReprRepr a)) pasDataSum = punsafeCoerce @@ -461,14 +468,17 @@ pmatchLT d1 d2 handlers = unTermCont $ do class MkLtReprHandler defs where type FirstDef defs :: [PLabeledType] mkLtReprHandler :: LTReprHandlers defs s + mkLteReprHandler :: LTReprHandlers defs s instance POrd (PDataRecord def) => MkLtReprHandler '[def] where type FirstDef '[def] = def mkLtReprHandler = LTRHCons (#<) LTRHNil + mkLteReprHandler = LTRHCons (#<=) LTRHNil instance (POrd (PDataRecord def), MkLtReprHandler (def' ': defs)) => MkLtReprHandler (def ': def' ': defs) where type FirstDef (def ': def' ': defs) = def mkLtReprHandler = LTRHCons (#<) mkLtReprHandler + mkLteReprHandler = LTRHCons (#<=) mkLteReprHandler {- | Use this for implementing the necessary instances for getting the `Data` representation. You must implement 'PIsDataRepr' to use this. @@ -491,7 +501,7 @@ instance PIsDataRepr a => PEq (PIsDataReprInstances a) where -- | This uses lexicographic ordering. Actually uses PDataSum '(#<)' implementation. instance (PIsDataRepr a, MkLtReprHandler (PIsDataReprRepr a)) => POrd (PIsDataReprInstances a) where x #< y = pto x #< pto y - x #<= y = x #== y #|| x #< y + x #<= y = pto x #<= pto y newtype DerivePConstantViaData (h :: Type) (p :: PType) = DerivePConstantViaData h diff --git a/plutarch-test/goldens/pisdata.lte.bench.golden b/plutarch-test/goldens/pisdata.lte.bench.golden index 88186b0d6..dee5f1af7 100644 --- a/plutarch-test/goldens/pisdata.lte.bench.golden +++ b/plutarch-test/goldens/pisdata.lte.bench.golden @@ -1,18 +1,18 @@ -PCredential.derived.true.eq {"exBudgetCPU":1341702,"exBudgetMemory":3802,"scriptSizeBytes":104} -PCredential.derived.true.less {"exBudgetCPU":3163945,"exBudgetMemory":7432,"scriptSizeBytes":115} -PCredential.derived.false {"exBudgetCPU":3659090,"exBudgetMemory":8634,"scriptSizeBytes":115} +PCredential.derived.true.eq {"exBudgetCPU":4542028,"exBudgetMemory":9225,"scriptSizeBytes":91} +PCredential.derived.true.less {"exBudgetCPU":2298711,"exBudgetMemory":5330,"scriptSizeBytes":96} +PCredential.derived.false {"exBudgetCPU":2793856,"exBudgetMemory":6532,"scriptSizeBytes":96} PCredential.pmatch.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} PCredential.pmatch.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PTriplet.derived.true.eq {"exBudgetCPU":1501248,"exBudgetMemory":4002,"scriptSizeBytes":161} -PTriplet.derived.true.less {"exBudgetCPU":6987474,"exBudgetMemory":14156,"scriptSizeBytes":173} -PTriplet.derived.false {"exBudgetCPU":7482619,"exBudgetMemory":15358,"scriptSizeBytes":173} +PTriplet.derived.true.eq {"exBudgetCPU":8308352,"exBudgetMemory":15949,"scriptSizeBytes":147} +PTriplet.derived.true.less {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} +PTriplet.derived.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} PTriplet.pmatch.true.eq {"exBudgetCPU":9022904,"exBudgetMemory":18349,"scriptSizeBytes":155} PTriplet.pmatch.true.less {"exBudgetCPU":6736792,"exBudgetMemory":14454,"scriptSizeBytes":161} PTriplet.pmatch.false {"exBudgetCPU":7410575,"exBudgetMemory":16256,"scriptSizeBytes":161} -PTriplet.pmatch-pdatarecord.true.eq {"exBudgetCPU":2937162,"exBudgetMemory":5994,"scriptSizeBytes":169} -PTriplet.pmatch-pdatarecord.true.less {"exBudgetCPU":8423388,"exBudgetMemory":16148,"scriptSizeBytes":181} -PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":8918533,"exBudgetMemory":17350,"scriptSizeBytes":181} \ No newline at end of file +PTriplet.pmatch-pdatarecord.true.eq {"exBudgetCPU":8308352,"exBudgetMemory":15949,"scriptSizeBytes":147} +PTriplet.pmatch-pdatarecord.true.less {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} +PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.uplc.golden b/plutarch-test/goldens/pisdata.lte.uplc.golden index a8bb83acd..f7e767976 100644 --- a/plutarch-test/goldens/pisdata.lte.uplc.golden +++ b/plutarch-test/goldens/pisdata.lte.uplc.golden @@ -1,18 +1,18 @@ -PCredential.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i5 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i5))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) -PCredential.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i6 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i6))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d87a9f4141ff) #d8799f40ff)) -PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i6 i5) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i6))))) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff) #d87a9f4141ff)) +PCredential.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData #d87a9f4141ff)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData #d8799f40ff)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))))) (i5 i2)) (i5 i1)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) PCredential.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))))) (i5 i2)) (i5 i1)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) PCredential.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) -PTriplet.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i6 i6) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6))))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010305ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData i7 i4) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010203ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010305ff)) +PTriplet.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 i12)) (i8 i1)) (i8 i10)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) PTriplet.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -PTriplet.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData (listData (i4 i6)) (listData (i4 i6))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6))))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData (listData (i5 i7)) (listData (i5 i4))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010305ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> i2 i1 (delay True)) (equalsData (listData (i5 i7)) (listData (i5 i4))) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i6 i5)) (i5 i7))))) (force ifThenElse)) (force tailList)) (force headList)) #d8799f010203ff) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010305ff)) \ No newline at end of file +PTriplet.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file From eaef77e6b4ca384ef8511cd6aa3455744829459a Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 21 Mar 2022 16:05:42 +0530 Subject: [PATCH 231/584] Hoist `POrd` derivation at the `PDataSum` level --- Plutarch/DataRepr/Internal.hs | 10 +++++++--- plutarch-test/goldens/pisdata.lt.bench.golden | 8 ++++---- plutarch-test/goldens/pisdata.lt.uplc.golden | 8 ++++---- plutarch-test/goldens/pisdata.lte.bench.golden | 8 ++++---- plutarch-test/goldens/pisdata.lte.uplc.golden | 8 ++++---- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 5ab63eebe..efa0a3787 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -229,8 +229,12 @@ instance PEq (PDataSum defs) where x #== y = pdata x #== pdata y instance MkLtReprHandler defs => POrd (PDataSum defs) where - x #< y = pmatchLT x y mkLtReprHandler - x #<= y = pmatchLT x y mkLteReprHandler + x' #< y' = f # x' # y' + where + f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLtReprHandler + x' #<= y' = f # x' # y' + where + f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLteReprHandler pasDataSum :: PIsDataRepr a => Term s a -> Term s (PDataSum (PIsDataReprRepr a)) pasDataSum = punsafeCoerce @@ -403,7 +407,7 @@ data LTReprHandlers (defs :: [[PLabeledType]]) (s :: S) where LTReprHandlers defs s -> LTReprHandlers (def : defs) s --- | Optimized dual pmatch specialized for lexicographic '#<' (and potentially) '#<=' implementation. +-- | Optimized dual pmatch specialized for lexicographic '#<' and '#<=' implementations. pmatchLT :: Term s (PDataSum defs) -> Term s (PDataSum defs) -> LTReprHandlers defs s -> Term s PBool pmatchLT d1 d2 (LTRHCons handler LTRHNil) = handler (punDataSum # d1) (punDataSum # d2) pmatchLT d1 d2 handlers = unTermCont $ do diff --git a/plutarch-test/goldens/pisdata.lt.bench.golden b/plutarch-test/goldens/pisdata.lt.bench.golden index f150b4791..9f795981e 100644 --- a/plutarch-test/goldens/pisdata.lt.bench.golden +++ b/plutarch-test/goldens/pisdata.lt.bench.golden @@ -1,11 +1,11 @@ -PCredential.derived.true {"exBudgetCPU":2298711,"exBudgetMemory":5330,"scriptSizeBytes":96} -PCredential.derived.false {"exBudgetCPU":2793856,"exBudgetMemory":6532,"scriptSizeBytes":96} +PCredential.derived.true {"exBudgetCPU":2477349,"exBudgetMemory":5930,"scriptSizeBytes":101} +PCredential.derived.false {"exBudgetCPU":2972494,"exBudgetMemory":7132,"scriptSizeBytes":101} PCredential.pmatch.true {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch-pdatarecord.true {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PTriplet.derived.true {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} -PTriplet.derived.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} +PTriplet.derived.true {"exBudgetCPU":6200878,"exBudgetMemory":12654,"scriptSizeBytes":158} +PTriplet.derived.false {"exBudgetCPU":6696023,"exBudgetMemory":13856,"scriptSizeBytes":158} PTriplet.pmatch.true {"exBudgetCPU":6736792,"exBudgetMemory":14454,"scriptSizeBytes":161} PTriplet.pmatch.false {"exBudgetCPU":7410575,"exBudgetMemory":16256,"scriptSizeBytes":161} PTriplet.pmatch-pdatarecord.true {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} diff --git a/plutarch-test/goldens/pisdata.lt.uplc.golden b/plutarch-test/goldens/pisdata.lt.uplc.golden index 4ecf94f62..5ffb8edf5 100644 --- a/plutarch-test/goldens/pisdata.lt.uplc.golden +++ b/plutarch-test/goldens/pisdata.lt.uplc.golden @@ -1,11 +1,11 @@ -PCredential.derived.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData #d87a9f4141ff)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) -PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData #d8799f40ff)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.derived.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i10 i2)) (unBData (i10 i1))) (i10 i4)) (i9 i4))) (delay False)))))) (i9 i2)) (i8 i2)) (unConstrData i2)) (unConstrData i2)) #d8799f40ff #d87a9f4141ff) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i10 i2)) (unBData (i10 i1))) (i10 i4)) (i9 i4))) (delay False)))))) (i9 i2)) (i8 i2)) (unConstrData i2)) (unConstrData i2)) #d87a9f4141ff #d8799f40ff) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch-pdatarecord.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) -PTriplet.derived.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.derived.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 (lessThanInteger i2 i1) (delay True) (delay (force (i11 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i15 i2)) (unIData (i15 i1))) (i13 i4)) (i12 i4))) (delay False)))))) (unIData (i12 i2))) (unIData (i11 i2))) (i9 i4)) (i8 i4))) (delay False)))))) (unIData (i8 i2))) (unIData (i7 i2))) (i7 i2)) (i6 i2)) #d8799f010203ff #d8799f010305ff) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 (lessThanInteger i2 i1) (delay True) (delay (force (i11 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i15 i2)) (unIData (i15 i1))) (i13 i4)) (i12 i4))) (delay False)))))) (unIData (i12 i2))) (unIData (i11 i2))) (i9 i4)) (i8 i4))) (delay False)))))) (unIData (i8 i2))) (unIData (i7 i2))) (i7 i2)) (i6 i2)) #d8799f010305ff #d8799f010203ff) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.pmatch.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.pmatch-pdatarecord.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) diff --git a/plutarch-test/goldens/pisdata.lte.bench.golden b/plutarch-test/goldens/pisdata.lte.bench.golden index dee5f1af7..37ac92a56 100644 --- a/plutarch-test/goldens/pisdata.lte.bench.golden +++ b/plutarch-test/goldens/pisdata.lte.bench.golden @@ -1,6 +1,6 @@ PCredential.derived.true.eq {"exBudgetCPU":4542028,"exBudgetMemory":9225,"scriptSizeBytes":91} -PCredential.derived.true.less {"exBudgetCPU":2298711,"exBudgetMemory":5330,"scriptSizeBytes":96} -PCredential.derived.false {"exBudgetCPU":2793856,"exBudgetMemory":6532,"scriptSizeBytes":96} +PCredential.derived.true.less {"exBudgetCPU":2477349,"exBudgetMemory":5930,"scriptSizeBytes":101} +PCredential.derived.false {"exBudgetCPU":2972494,"exBudgetMemory":7132,"scriptSizeBytes":101} PCredential.pmatch.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} PCredential.pmatch.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} @@ -8,8 +8,8 @@ PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9 PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} PTriplet.derived.true.eq {"exBudgetCPU":8308352,"exBudgetMemory":15949,"scriptSizeBytes":147} -PTriplet.derived.true.less {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} -PTriplet.derived.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} +PTriplet.derived.true.less {"exBudgetCPU":6200878,"exBudgetMemory":12654,"scriptSizeBytes":158} +PTriplet.derived.false {"exBudgetCPU":6696023,"exBudgetMemory":13856,"scriptSizeBytes":158} PTriplet.pmatch.true.eq {"exBudgetCPU":9022904,"exBudgetMemory":18349,"scriptSizeBytes":155} PTriplet.pmatch.true.less {"exBudgetCPU":6736792,"exBudgetMemory":14454,"scriptSizeBytes":161} PTriplet.pmatch.false {"exBudgetCPU":7410575,"exBudgetMemory":16256,"scriptSizeBytes":161} diff --git a/plutarch-test/goldens/pisdata.lte.uplc.golden b/plutarch-test/goldens/pisdata.lte.uplc.golden index f7e767976..1d16c7c9b 100644 --- a/plutarch-test/goldens/pisdata.lte.uplc.golden +++ b/plutarch-test/goldens/pisdata.lte.uplc.golden @@ -1,6 +1,6 @@ PCredential.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) -PCredential.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData #d87a9f4141ff)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) -PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData #d8799f40ff)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i10 i2)) (unBData (i10 i1))) (i10 i4)) (i9 i4))) (delay False)))))) (i9 i2)) (i8 i2)) (unConstrData i2)) (unConstrData i2)) #d8799f40ff #d87a9f4141ff) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i10 i2)) (unBData (i10 i1))) (i10 i4)) (i9 i4))) (delay False)))))) (i9 i2)) (i8 i2)) (unConstrData i2)) (unConstrData i2)) #d87a9f4141ff #d8799f40ff) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))))) (i5 i2)) (i5 i1)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) PCredential.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) @@ -8,8 +8,8 @@ PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> ( PCredential.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) PTriplet.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) -PTriplet.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 (lessThanInteger i2 i1) (delay True) (delay (force (i11 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i15 i2)) (unIData (i15 i1))) (i13 i4)) (i12 i4))) (delay False)))))) (unIData (i12 i2))) (unIData (i11 i2))) (i9 i4)) (i8 i4))) (delay False)))))) (unIData (i8 i2))) (unIData (i7 i2))) (i7 i2)) (i6 i2)) #d8799f010203ff #d8799f010305ff) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 (lessThanInteger i2 i1) (delay True) (delay (force (i11 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i15 i2)) (unIData (i15 i1))) (i13 i4)) (i12 i4))) (delay False)))))) (unIData (i12 i2))) (unIData (i11 i2))) (i9 i4)) (i8 i4))) (delay False)))))) (unIData (i8 i2))) (unIData (i7 i2))) (i7 i2)) (i6 i2)) #d8799f010305ff #d8799f010203ff) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 i12)) (i8 i1)) (i8 i10)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) PTriplet.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) From 67a0b022b45b876e58405053eb4fea2930adb346 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 21 Mar 2022 16:48:11 +0530 Subject: [PATCH 232/584] Migrate `PPrelude` information --- docs/README.md | 1 + docs/Usage.md | 1 + docs/Usage/Prelude mixin.md | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 docs/Usage/Prelude mixin.md diff --git a/docs/README.md b/docs/README.md index b08ec35fb..afe8c3cf5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -53,6 +53,7 @@ The [Usage section](./Usage.md) fills in the gaps left by the previous. It illus - [Conditionals](./Usage/Conditionals.md) - [Recursion](./Usage/Recursion.md) +- [Using the Plutarch Prelude](./Usage/Prelude%20mixin.md) - [Do syntax with `TermCont`](./Usage/Do%20syntax%20with%20TermCont.md) - [Do syntax with `QualifiedDo` and `Plutarch.Monadic`](./Usage/Do%20syntax%20with%20QualifiedDo.md) - [Deriving typeclasses for `newtype`s](./Usage/Deriving%20for%20newtypes.md) diff --git a/docs/Usage.md b/docs/Usage.md index 231806d28..26383377a 100644 --- a/docs/Usage.md +++ b/docs/Usage.md @@ -4,6 +4,7 @@ This section describes various core Plutarch usage concepts. - [Conditionals](./Usage/Conditionals.md) - [Recursion](./Usage/Recursion.md) +- [Using the Plutarch Prelude](./Usage/Prelude%20mixin.md) - [Do syntax with `TermCont`](./Usage/Do%20syntax%20with%20TermCont.md) - [Do syntax with `QualifiedDo` and `Plutarch.Monadic`](./Usage/Do%20syntax%20with%20QualifiedDo.md) - [Deriving typeclasses for `newtype`s](./Usage/Deriving%20for%20newtypes.md) diff --git a/docs/Usage/Prelude mixin.md b/docs/Usage/Prelude mixin.md new file mode 100644 index 000000000..abcca065d --- /dev/null +++ b/docs/Usage/Prelude mixin.md @@ -0,0 +1,12 @@ +# Using the Plutarch Prelude + +Plutarch exports a Prelude (`Plutarch.Prelude`) that contains the most commonly used Plutarch functions, types and constructors. + +The Plutarch Prelude `Plutarch.Prelude` has no overlap with `base` Prelude, which is the reason why you can use both of them together +without trouble. If you want to avoid importing `Plutarch.Prelude` in each of your modules, add the following to your `*.cabal` file: + +```haskell +mixins: + base hiding (Prelude) + , plutarch-preludes (PPrelude as Prelude) +``` From a627c49329ff4f4386a017b565377053688a0b12 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Mar 2022 15:35:38 +0000 Subject: [PATCH 233/584] Fix CHANGELOG --- CHANGELOG.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5680031b2..fb66d56d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ # Unreleased +- Added `PEq` superclass constraint to `POrd` + + Included by [#326](https://github.com/Plutonomicon/plutarch/pull/326) + - Added module `Plutarch.Show` with the `PShow` type class, as well as functions `pshow` and `ptraceShowId`. Started by [#352](https://github.com/Plutonomicon/plutarch/pull/352) @@ -57,7 +61,7 @@ - Added APIs for constructing, compiling, serialising & hashing Plutarch scripts. Type synonyms for Plutarch-typed scripts `PValidator`,`PMintingPolicy` & `PStakeValidator`. - + `mkValidator`, `mkStakeValidator` & `mkMintingPolicy` functions, for creating Plutus API compatible scripts. `validatorHash`, `mintingPolicySymbol` & `stakeValidatorHash` to obtain script hashes. @@ -94,15 +98,15 @@ Module: `Plutarch.TryFrom` Added by: [#326](https://github.com/Plutonomicon/plutarch/pull/326) -- `plutarch-extra`: Add a new directory scaffold "`plutarch-extra`" which will be home to everything too specific to not be in the +- `plutarch-extra`: Add a new directory scaffold "`plutarch-extra`" which will be home to everything too specific to not be in the main Plutarch repo. Also refactored the test library. Directory: `plutarch-extra` Added by: [#329](https://github.com/Plutonomicon/plutarch/pull/329) -- `plutarch-extra` export merged Prelude - +- `plutarch-extra` export merged Prelude + Module: `Plutarch.PPrelude` Added by: [#356](https://github.com/Plutonomicon/plutarch/pull/356) From 46d5eed86e28266ddffbcd9601c1d4d36364cbbe Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Mar 2022 15:54:52 +0000 Subject: [PATCH 234/584] Fix `PIsData` instance for `PDataRecord` --- Plutarch/DataRepr/Internal.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index bb011be88..40bb49c5d 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -75,7 +75,6 @@ import Plutarch.Builtin ( PData, PIsData, pasConstr, - pasList, pconstrBuiltin, pdata, pforgetData, @@ -90,9 +89,8 @@ import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) -import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) +import Plutarch.Unsafe (punsafeCoerce) import qualified Plutus.V1.Ledger.Api as Ledger -import qualified PlutusCore as PLC {- | A "record" of `exists a. PAsData a`. The underlying representation is `PBuiltinList PData`. @@ -169,8 +167,8 @@ type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (name ':= a) = a instance {-# OVERLAPPABLE #-} PIsData (PDataRecord xs) where - pfromData x = punsafeCoerce $ pasList # pforgetData x - pdata x = punsafeBuiltin PLC.ListData # x + pfromData x = punsafeCoerce $ (pfromData (punsafeCoerce x) :: Term _ (PBuiltinList PData)) + pdata x = punsafeCoerce $ pdata (punsafeCoerce x :: Term _ (PBuiltinList PData)) {- | A sum of 'PDataRecord's. The underlying representation is the `PDataConstr` constructor, where the integer is the index of the variant and the list is the record. From 3de34da180164cc58ef766604b267a880b1b5c7c Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Mar 2022 16:58:25 +0000 Subject: [PATCH 235/584] Add more powerful `pforgetData'` --- Plutarch/Builtin.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index a04f897f7..49c1d7641 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -27,7 +27,7 @@ module Plutarch.Builtin ( type PBuiltinMap, ) where -import Data.Coerce (Coercible) +import Data.Coerce (Coercible, coerce) import Plutarch ( DerivePNewtype, PInner, @@ -226,8 +226,14 @@ instance PConstant (PAsDataLifted a) where instance PUnsafeLiftDecl (PAsData a) where type PLifted (PAsData a) = PAsDataLifted a -pforgetData :: Term s (PAsData a) -> Term s PData -pforgetData = punsafeCoerce +newtype Helper (a :: PType) (s :: S) = Helper (a s) + +pforgetData :: forall s a. Term s (PAsData a) -> Term s PData +pforgetData x = coerce $ pforgetData' (coerce x :: Term s (Helper (PAsData a))) + +-- | Like 'pforgetData', except it works for complex types. +pforgetData' :: forall (p :: PType -> PType) a s. Term s (p (PAsData a)) -> Term s (p PData) +pforgetData' = punsafeCoerce class PIsData a where pfromData :: Term s (PAsData a) -> Term s a From 4936a2ade3d794e568471d40ff75cf82b8e13292 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Mar 2022 19:26:54 +0000 Subject: [PATCH 236/584] Add `prememberData` and use `pforgetData'` in `PIsData` instances --- Plutarch/Builtin.hs | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 49c1d7641..196e66bd4 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -28,6 +28,7 @@ module Plutarch.Builtin ( ) where import Data.Coerce (Coercible, coerce) +import Data.Proxy (Proxy (Proxy)) import Plutarch ( DerivePNewtype, PInner, @@ -226,14 +227,18 @@ instance PConstant (PAsDataLifted a) where instance PUnsafeLiftDecl (PAsData a) where type PLifted (PAsData a) = PAsDataLifted a -newtype Helper (a :: PType) (s :: S) = Helper (a s) +newtype Helper1 (a :: PType) (s :: S) = Helper1 (a s) pforgetData :: forall s a. Term s (PAsData a) -> Term s PData -pforgetData x = coerce $ pforgetData' (coerce x :: Term s (Helper (PAsData a))) +pforgetData x = coerce $ pforgetData' Proxy (coerce x :: Term s (Helper1 (PAsData a))) -- | Like 'pforgetData', except it works for complex types. -pforgetData' :: forall (p :: PType -> PType) a s. Term s (p (PAsData a)) -> Term s (p PData) -pforgetData' = punsafeCoerce +pforgetData' :: forall a (p :: PType -> PType) s. Proxy p -> Term s (p (PAsData a)) -> Term s (p PData) +pforgetData' Proxy = punsafeCoerce + +-- | Like 'pforgetData', except it works for complex types. +prememberData :: forall (p :: PType -> PType) s. Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) +prememberData Proxy = punsafeCoerce class PIsData a where pfromData :: Term s (PAsData a) -> Term s a @@ -247,9 +252,11 @@ instance PIsData a => PIsData (PBuiltinList (PAsData a)) where pfromData x = punsafeCoerce $ pasList # pforgetData x pdata x = punsafeBuiltin PLC.ListData # x +newtype Helper2 f a s = Helper2 (PAsData (f a) s) + instance PIsData (PBuiltinList PData) where - pfromData x = punsafeCoerce $ pasList # pforgetData x - pdata x = punsafeBuiltin PLC.ListData # x + pfromData = pforgetData' @PData (Proxy @PBuiltinList) . pfromData . coerce (prememberData (Proxy @(Helper2 PBuiltinList))) + pdata = coerce (pforgetData' @PData (Proxy @(Helper2 PBuiltinList))) . pdata . (prememberData (Proxy @PBuiltinList)) instance PIsData (PBuiltinMap k v) where pfromData x = punsafeCoerce $ pasMap # pforgetData x @@ -301,9 +308,31 @@ instance PIsData (PBuiltinPair (PAsData a) (PAsData b)) where f = phoistAcyclic $ plam $ \pair -> pconstrBuiltin # 0 #$ pcons # (pfstBuiltin # pair) #$ pcons # (psndBuiltin # pair) # pnil +newtype Helper3 f b a s = Helper3 (PAsData (f a b) s) + +newtype Helper4 f b a s = Helper4 (f a b s) + instance PIsData (PBuiltinPair PData PData) where - pfromData x = punsafeCoerce $ pfromData @(PBuiltinPair (PAsData _) (PAsData _)) $ punsafeCoerce x - pdata x = punsafeCoerce $ pdata @(PBuiltinPair (PAsData _) (PAsData _)) $ punsafeCoerce x + pfromData = f . pfromData . g + where + g :: Term s (PAsData (PBuiltinPair PData PData)) -> Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData))) + g = + (coerce (prememberData (Proxy @(Helper3 PBuiltinPair (PAsData PData)))) :: Term s (PAsData (PBuiltinPair PData (PAsData PData))) -> Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData)))) + . coerce (prememberData (Proxy @(Helper2 (PBuiltinPair PData)))) + + f :: Term s (PBuiltinPair (PAsData PData) (PAsData PData)) -> Term s (PBuiltinPair PData PData) + f = + coerce (pforgetData' (Proxy @(Helper4 PBuiltinPair PData))) + . (pforgetData' @PData (Proxy @(PBuiltinPair (PAsData PData)))) + pdata = f . pdata . g + where + g :: Term s (PBuiltinPair PData PData) -> Term s (PBuiltinPair (PAsData PData) (PAsData PData)) + g = coerce (prememberData (Proxy @(Helper4 PBuiltinPair (PAsData PData)))) . prememberData (Proxy @(PBuiltinPair PData)) + + f :: Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData))) -> Term s (PAsData (PBuiltinPair PData PData)) + f = + (coerce (pforgetData' @PData (Proxy @(Helper3 PBuiltinPair PData))) :: Term s (PAsData (PBuiltinPair (PAsData PData) PData)) -> Term s (PAsData (PBuiltinPair PData PData))) + . coerce (pforgetData' @PData (Proxy @(Helper2 (PBuiltinPair (PAsData PData))))) instance PIsData PUnit where pfromData _ = pconstant () From ff62f8131433ce701aa99caa6c7b7a06d6c7b7a5 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Mar 2022 19:36:26 +0000 Subject: [PATCH 237/584] Move `Reducible` into its own module --- Plutarch/Internal.hs | 3 +++ Plutarch/Reducible.hs | 10 ++++++++++ Plutarch/TryFrom.hs | 11 ++--------- plutarch.cabal | 1 + 4 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 Plutarch/Reducible.hs diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 1b4d4c1a3..fbd35db55 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -44,6 +44,7 @@ import qualified Flat.Run as F import GHC.Stack (HasCallStack) import GHC.Word (Word64) import Plutarch.Evaluate (evalScript) +import Plutarch.Reducible (Reducible (Reduce)) import Plutus.V1.Ledger.Scripts (Script (Script)) import PlutusCore (Some (Some), ValueOf (ValueOf)) import qualified PlutusCore as PLC @@ -139,6 +140,8 @@ type role Term phantom representational -} newtype Term (s :: S) (a :: PType) = Term {asRawTerm :: Word64 -> TermResult} +instance Reducible (Term s a) where type Reduce (Term s a) = Term s a + {- | *Closed* terms with no free variables. -} diff --git a/Plutarch/Reducible.hs b/Plutarch/Reducible.hs new file mode 100644 index 000000000..399f72a31 --- /dev/null +++ b/Plutarch/Reducible.hs @@ -0,0 +1,10 @@ +-- FIXME: This should be its own package as it's not related to Plutarch at all. +module Plutarch.Reducible (Reducible (Reduce)) where + +import Data.Coerce (Coercible) +import Data.Kind (Type) + +class (Coercible (Reduce x) x) => Reducible (x :: Type) where + type Reduce x :: Type + +instance Reducible () where type Reduce () = () diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 92021155a..396c1dad1 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -9,9 +9,7 @@ module Plutarch.TryFrom ( ptryFromData, ) where -import Data.Coerce (Coercible) import Data.Function ((&)) -import Data.Kind (Type) import Data.Proxy (Proxy (Proxy)) import GHC.Records (HasField (getField)) @@ -79,6 +77,8 @@ import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) import Plutarch.DataRepr.Internal (PIsDataRepr (PIsDataReprRepr), PIsDataReprInstances) +import Plutarch.Reducible (Reducible (Reduce)) + ----------------------- The class PTryFrom ---------------------------------------------- {- | @@ -120,15 +120,8 @@ ptryFromData = ptryFrom @PData @b ----------------------- Reducible and Flip ---------------------------------------------- -class (Coercible (Reduce x) x) => Reducible (x :: Type) where - type Reduce x :: Type - -instance Reducible () where type Reduce () = () - instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecP as s -instance Reducible (Term s a) where type Reduce (Term s a) = Term s a - instance Reducible (f x y) => Reducible (Flip f y x) where type Reduce (Flip f y x) = Reduce (f x y) diff --git a/plutarch.cabal b/plutarch.cabal index 34a95a8d6..eb888f62d 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -121,6 +121,7 @@ library Plutarch.Rational Plutarch.Rec Plutarch.Rec.TH + Plutarch.Reducible Plutarch.Show Plutarch.String Plutarch.TermCont From d76d4533e84fb362dec39afd632f9085d02af0d7 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Mar 2022 21:31:39 +0000 Subject: [PATCH 238/584] Fix styling in `Plutarch.TryFrom` --- Plutarch/TryFrom.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 396c1dad1..928af6702 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -9,7 +9,6 @@ module Plutarch.TryFrom ( ptryFromData, ) where -import Data.Function ((&)) import Data.Proxy (Proxy (Proxy)) import GHC.Records (HasField (getField)) @@ -277,10 +276,8 @@ instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] ptryFrom opq = runTermCont $ do _ :: Term _ PUnit <- - pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") - & pforce - & plet - & tcont + tcont . plet . pforce $ + pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") pure (pdnil, HNil) instance From ed87723156b3e3317d6a9c9b8a224ac888535e2a Mon Sep 17 00:00:00 2001 From: Las Safin Date: Thu, 17 Mar 2022 14:55:17 +0000 Subject: [PATCH 239/584] Plutarch.TryFrom: Fix a bunch of issues --- Plutarch/Reducible.hs | 4 ++ Plutarch/TryFrom.hs | 153 ++++++++++++++++++++---------------------- 2 files changed, 75 insertions(+), 82 deletions(-) diff --git a/Plutarch/Reducible.hs b/Plutarch/Reducible.hs index 399f72a31..603f02e98 100644 --- a/Plutarch/Reducible.hs +++ b/Plutarch/Reducible.hs @@ -2,9 +2,13 @@ module Plutarch.Reducible (Reducible (Reduce)) where import Data.Coerce (Coercible) +import Data.Functor.Const (Const (Const)) import Data.Kind (Type) class (Coercible (Reduce x) x) => Reducible (x :: Type) where type Reduce x :: Type instance Reducible () where type Reduce () = () + +instance Reducible x => Reducible (Const x y) where + type Reduce (Const x y) = Reduce x diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 928af6702..287a6a439 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -5,7 +5,6 @@ module Plutarch.TryFrom ( PTryFrom (..), HRecP (..), - Flip (..), ptryFromData, ) where @@ -24,6 +23,7 @@ import Plutarch.Unit (PUnit (PUnit)) import Plutarch.Internal.Other ( DerivePNewtype, PInner, + POpaque, PType, S, Term, @@ -32,6 +32,7 @@ import Plutarch.Internal.Other ( pforce, plam, plet, + popaque, (#), type (:-->), ) @@ -42,7 +43,6 @@ import Plutarch.DataRepr.Internal ( PDataRecord, PDataSum, PLabeledType ((:=)), - pdcons, pdnil, ) @@ -78,6 +78,8 @@ import Plutarch.DataRepr.Internal (PIsDataRepr (PIsDataReprRepr), PIsDataReprIns import Plutarch.Reducible (Reducible (Reduce)) +import Data.Functor.Const (Const) + ----------------------- The class PTryFrom ---------------------------------------------- {- | @@ -124,7 +126,7 @@ instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecP as s instance Reducible (f x y) => Reducible (Flip f y x) where type Reduce (Flip f y x) = Reduce (f x y) -newtype Flip f a b = MkFlip {unFlip :: f b a} +newtype Flip f a b = Flip (f b a) ----------------------- HRecP and friends ----------------------------------------------- @@ -174,24 +176,18 @@ instance ----------------------- PData instances ------------------------------------------------- --- | recover a PInteger instance PTryFrom PData (PAsData PInteger) where type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) pure $ (punsafeCoerce opq, ver) --- | recover a PByteString instance PTryFrom PData (PAsData PByteString) where type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) pure $ (punsafeCoerce opq, ver) -{- | - recover a `PBuiltinMap`, the excess type contains the unwrapped map - as well as a list containing the excess of all contained tuples --} instance ( PTryFrom PData (PAsData a) , PTryFrom PData (PAsData b) @@ -211,9 +207,11 @@ instance {- | This verifies a list to be indeed a list but doesn't recover the inner data - use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData PData)))` - as it is significantly faster + use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData a)))` + as this is O(1) instead of O(n) -} + +-- TODO: add the excess inner type list instance PTryFrom PData (PAsData (PBuiltinList PData)) where type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) ptryFrom opq = runTermCont $ do @@ -266,12 +264,14 @@ instance ----------------------- PDataRecord instances ------------------------------------------- -type FromRecordFields :: [PLabeledType] -> [(Symbol, PType)] -type family FromRecordFields xs where - FromRecordFields '[] = '[] - FromRecordFields ((label ':= ptyp) ': xs) = '(label, Flip Term ptyp) ': (FromRecordFields xs) +-- We could have a more advanced instance but it's not needed really. + +newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) --- | Try to transform a `PBuiltinList PData` to a `PDataRecord` +instance Reducible (PTryFromExcess PData (PAsData a) s) => Reducible (ExcessForField a s) where + type Reduce (ExcessForField a s) = (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) + +-- FIXME: Should we always succede? If we always succede, performance would increase a lot. instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] ptryFrom opq = runTermCont $ do @@ -280,91 +280,80 @@ instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") pure (pdnil, HNil) +type family UnHRecP (x :: PType) :: [(Symbol, PType)] where + UnHRecP (HRecP as) = as + instance - ( PTryFrom (PBuiltinList PData) (PDataRecord xs) - , PTryFrom PData (PAsData a) - , PTryFromExcess (PBuiltinList PData) (PDataRecord xs) ~ HRecP (FromRecordFields xs) - ) => - PTryFrom (PBuiltinList PData) (PDataRecord ((label ':= a) ': xs)) - where - type - PTryFromExcess (PBuiltinList PData) (PDataRecord ((label ':= a) ': xs)) = - HRecP ('(label, PTryFromExcess PData (PAsData a)) ': FromRecordFields xs) - ptryFrom lst = runTermCont $ do - (verhead, exchead) <- tcont $ ptryFromData @(PAsData a) $ phead # lst - (vertail, exctail) <- tcont $ ptryFrom @(PBuiltinList PData) @(PDataRecord xs) $ ptail # lst - rec <- tcont $ plet $ pdcons @label # verhead # vertail - pure (rec, HCons exchead exctail) - -{- | recover a record from `PData`, the unwrapped record can be found in a field - called "unwrapped" --} -instance - ( PTryFromExcess (PBuiltinList PData) (PDataRecord xs) ~ HRecP y - , PTryFrom (PBuiltinList PData) (PDataRecord xs) + ( PTryFrom PData (PAsData pty) + , PTryFrom (PBuiltinList PData) (PDataRecord as) + , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase ) => - PTryFrom PData (PAsData (PDataRecord xs)) + PTryFrom (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) where type - PTryFromExcess PData (PAsData (PDataRecord xs)) = - HRecP '[ '("unwrapped", (Flip Term (PDataRecord xs)))] `HConcat` PTryFromExcess (PBuiltinList PData) (PDataRecord xs) + PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) = + HRecP + ( '(name, ExcessForField pty) + ': UnHRecP (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) + ) ptryFrom opq = runTermCont $ do - lst <- snd <$> tcont (ptryFromData @(PAsData (PBuiltinList PData)) opq) - (rec, exc) <- tcont $ (ptryFrom @(PBuiltinList PData) @(PDataRecord xs) lst) - pure (punsafeCoerce opq, HCons rec exc) + h <- tcont $ plet $ phead # opq + hv <- tcont $ ptryFrom @PData @(PAsData pty) h + t <- tcont $ plet $ ptail # opq + tv <- tcont $ ptryFrom @(PBuiltinList PData) @(PDataRecord as) t + pure (punsafeCoerce opq, HCons hv (snd tv)) -type family rec1 `HConcat` rec2 where - HRecP '[] `HConcat` HRecP l1 = HRecP l1 - HRecP (e ': l0) `HConcat` HRecP l1 = HRecP l0 `HConcat` HRecP (e ': l1) +newtype Helper a b s = Helper (a s, b s) ------------------------ PDataSum Instances ---------------------------------------------- +instance (Reducible (a s), Reducible (b s)) => Reducible (Helper a b s) where + type Reduce (Helper a b s) = (Reduce (a s), Reduce (b s)) -{- | recover a PDataSum, this is really slow as it requires the whole record to be recovered - if possible try to first recover a `PDataSum` containing only `PAsData PData`and then recover - the field itself after matching on the constructor --} instance - forall ys. - ( SumValidation 0 ys + ( PTryFrom (PBuiltinList PData) (PDataRecord as) + , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase ) => - PTryFrom PData (PAsData (PDataSum ys)) + PTryFrom PData (PAsData (PDataRecord as)) where - type PTryFromExcess PData (PAsData (PDataSum ys)) = HRecP '[] + type + PTryFromExcess PData (PAsData (PDataRecord as)) = + Helper (Flip Term (PDataRecord as)) (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) + ptryFrom opq = runTermCont $ do + l <- snd <$> (tcont $ ptryFromData @(PAsData (PBuiltinList PData)) opq) + r <- tcont $ ptryFrom @_ @(PDataRecord as) l + pure (punsafeCoerce opq, r) + +instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where + type PTryFromExcess PData (PAsData (PDataSum ys)) = Const () ptryFrom opq = runTermCont $ do - _ <- tcont $ plet $ validateSum @0 @ys opq - pure (punsafeCoerce opq, HNil) + x <- tcont $ plet $ pasConstr # opq + constr <- tcont $ plet $ pfstBuiltin # x + fields <- tcont $ plet $ psndBuiltin # x + _ <- tcont $ plet $ validateSum @0 @ys constr fields + pure (punsafeCoerce opq, ()) class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where - validateSum :: Term s PData -> Term s (PBuiltinList PData) + validateSum :: Term s PInteger -> Term s (PBuiltinList PData) -> Term s POpaque instance {-# OVERLAPPABLE #-} forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). - ( PTryFrom PData (PAsData (PDataRecord x)) + ( PTryFrom (PBuiltinList PData) (PDataRecord x) , SumValidation (n + 1) xs , KnownNat n - , PTryFrom (PBuiltinList PData) (PDataRecord x) ) => SumValidation n (x ': xs) where - validateSum s = unTermCont $ - do - let n :: Integer - n = natVal (Proxy @n) - elem <- tcont $ plet $ pasConstr # s - let snd' :: Term _ (PBuiltinList PData) - snd' = - pif - (fromInteger n #== (pfstBuiltin # elem)) - ( unTermCont $ do - y <- fst <$> tcont (ptryFrom @(PBuiltinList PData) @(PDataRecord x) (psndBuiltin # elem)) - pure $ punsafeCoerce (y :: Term _ (PDataRecord x)) - ) - (validateSum @(n + 1) @xs $ punsafeCoerce s) - tcont $ plet snd' + validateSum constr fields = + pif + (fromInteger (natVal $ Proxy @n) #== constr) + ( unTermCont $ do + _ <- tcont $ ptryFrom @_ @(PDataRecord x) fields + pure $ popaque $ pcon PUnit + ) + (validateSum @(n + 1) @xs constr fields) instance {-# OVERLAPPING #-} SumValidation n '[] where - validateSum _ = ptraceError "reached end of sum while still not having found the constructor" + validateSum _ _ = ptraceError "reached end of sum while still not having found the constructor" ----------------------- other utility functions ----------------------------------------- @@ -383,15 +372,13 @@ instance ver' <- snd <$> TermCont (ptryFrom @a @b (pfromData opq)) pure $ (punsafeCoerce opq, ver') --- | serves as the base case for some conversions instance PTryFrom PData PData where - type PTryFromExcess PData PData = HRecP '[] - ptryFrom opq = runTermCont $ pure $ (opq, HNil) + type PTryFromExcess PData PData = Const () + ptryFrom opq = runTermCont $ pure $ (opq, ()) --- | serves as the base case for some conversions instance PTryFrom PData (PAsData PData) where - type PTryFromExcess PData (PAsData PData) = Flip Term PData - ptryFrom opq = runTermCont $ pure (pdata opq, opq) + type PTryFromExcess PData (PAsData PData) = Const () + ptryFrom opq = runTermCont $ pure (pdata opq, ()) ----------------------- PIsDataReprInstances instance ----------------------------------- @@ -421,5 +408,7 @@ instance ----------------------- HasField instance ----------------------------------------------- +{- instance (ElemOf name ptyp rec, Reduce (ptyp s) ~ out) => HasField name (HRecP rec s) out where getField = getExcessField @name +-} From c37b7f35484845741c852ca328b53ec520fd21b6 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Mar 2022 22:36:46 +0000 Subject: [PATCH 240/584] `Plutarch.TryFrom`: Switch around type parameters to help type applications --- Plutarch/TryFrom.hs | 134 +++++++++++++++++++++----------------------- 1 file changed, 64 insertions(+), 70 deletions(-) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 287a6a439..28f2621cf 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -5,7 +5,7 @@ module Plutarch.TryFrom ( PTryFrom (..), HRecP (..), - ptryFromData, + ptryFrom, ) where import Data.Proxy (Proxy (Proxy)) @@ -105,19 +105,9 @@ import Data.Functor.Const (Const) - the result type `b` must always be safe than the origin type `a`, i.e. it must carry more information -} -class PTryFrom (a :: PType) (b :: PType) where - type PTryFromExcess a b :: PType - ptryFrom :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r - --- | Utility function that saves a type application, `ptryFromData @b === ptryFrom @PData @b` -ptryFromData :: - forall b s r. - ( PTryFrom PData b - ) => - Term s PData -> - ((Term s b, Reduce (PTryFromExcess PData b s)) -> Term s r) -> - Term s r -ptryFromData = ptryFrom @PData @b +class PTryFrom (b :: PType) (a :: PType) where + type PTryFromExcess b a :: PType + ptryFrom :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess b a s)) -> Term s r) -> Term s r ----------------------- Reducible and Flip ---------------------------------------------- @@ -176,31 +166,31 @@ instance ----------------------- PData instances ------------------------------------------------- -instance PTryFrom PData (PAsData PInteger) where - type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger +instance PTryFrom (PAsData PInteger) PData where + type PTryFromExcess (PAsData PInteger) PData = Flip Term PInteger ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) pure $ (punsafeCoerce opq, ver) -instance PTryFrom PData (PAsData PByteString) where - type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString +instance PTryFrom (PAsData PByteString) PData where + type PTryFromExcess (PAsData PByteString) PData = Flip Term PByteString ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) pure $ (punsafeCoerce opq, ver) instance - ( PTryFrom PData (PAsData a) - , PTryFrom PData (PAsData b) + ( PTryFrom (PAsData a) PData + , PTryFrom (PAsData b) PData ) => - PTryFrom PData (PAsData (PBuiltinMap a b)) + PTryFrom (PAsData (PBuiltinMap a b)) PData where - type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = Flip Term (PBuiltinMap a b) + type PTryFromExcess (PAsData (PBuiltinMap a b)) PData = Flip Term (PBuiltinMap a b) ptryFrom opq = runTermCont $ do verMap <- tcont $ plet (pasMap # opq) let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) verifyPair = plam $ \tup -> unTermCont $ do - (verfst, _) <- tcont $ ptryFromData @(PAsData a) $ pfstBuiltin # tup - (versnd, _) <- tcont $ ptryFromData @(PAsData b) $ psndBuiltin # tup + (verfst, _) <- tcont $ ptryFrom @(PAsData a) $ pfstBuiltin # tup + (versnd, _) <- tcont $ ptryFrom @(PAsData b) $ psndBuiltin # tup pure $ ppairDataBuiltin # verfst # versnd ver <- tcont $ plet $ pmap # verifyPair # verMap pure (punsafeCoerce opq, ver) @@ -212,8 +202,8 @@ instance -} -- TODO: add the excess inner type list -instance PTryFrom PData (PAsData (PBuiltinList PData)) where - type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) +instance PTryFrom (PAsData (PBuiltinList PData)) PData where + type PTryFromExcess (PAsData (PBuiltinList PData)) PData = Flip Term (PBuiltinList PData) ptryFrom opq = runTermCont $ do ver <- tcont $ plet (pasList # opq) pure $ (punsafeCoerce opq, ver) @@ -222,19 +212,19 @@ instance PTryFrom PData (PAsData (PBuiltinList PData)) where Recover a `PBuiltinList (PAsData a)` -} instance - ( PTryFrom PData (PAsData a) + ( PTryFrom (PAsData a) PData , PIsData a ) => - PTryFrom PData (PAsData (PBuiltinList (PAsData a))) + PTryFrom (PAsData (PBuiltinList (PAsData a))) PData where - type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = Flip Term (PBuiltinList (PAsData a)) + type PTryFromExcess (PAsData (PBuiltinList (PAsData a))) PData = Flip Term (PBuiltinList (PAsData a)) ptryFrom opq = runTermCont $ do let lst :: Term _ (PBuiltinList PData) lst = pasList # opq verify :: Term _ (PData :--> PAsData a) verify = plam $ \e -> unTermCont $ do - (wrapped, _) <- tcont $ ptryFromData @(PAsData a) $ e + (wrapped, _) <- tcont $ ptryFrom @(PAsData a) $ e pure wrapped ver <- tcont $ plet $ pmap # verify # lst pure $ (punsafeCoerce opq, ver) @@ -243,22 +233,22 @@ instance Recover a `PAsData (PBuiltinPair a b)` -} instance - ( PTryFrom PData a + ( PTryFrom a PData , a ~ PAsData a' , PIsData a' - , PTryFrom PData b + , PTryFrom b PData , b ~ PAsData b' , PIsData b' ) => - PTryFrom PData (PAsData (PBuiltinPair a b)) + PTryFrom (PAsData (PBuiltinPair a b)) PData where - type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = Flip Term (PBuiltinPair a b) + type PTryFromExcess (PAsData (PBuiltinPair a b)) PData = Flip Term (PBuiltinPair a b) ptryFrom opq = runTermCont $ do tup <- tcont $ plet (pfromData $ punsafeCoerce opq) let fst' :: Term _ a - fst' = unTermCont $ fst <$> tcont (ptryFromData @a $ pforgetData $ pfstBuiltin # tup) + fst' = unTermCont $ fst <$> tcont (ptryFrom @a $ pforgetData $ pfstBuiltin # tup) snd' :: Term _ b - snd' = unTermCont $ fst <$> tcont (ptryFromData @b $ pforgetData $ psndBuiltin # tup) + snd' = unTermCont $ fst <$> tcont (ptryFrom @b $ pforgetData $ psndBuiltin # tup) ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' pure $ (punsafeCoerce opq, ver) @@ -266,14 +256,14 @@ instance -- We could have a more advanced instance but it's not needed really. -newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) +newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess (PAsData a) PData s)) -instance Reducible (PTryFromExcess PData (PAsData a) s) => Reducible (ExcessForField a s) where - type Reduce (ExcessForField a s) = (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) +instance Reducible (PTryFromExcess (PAsData a) PData s) => Reducible (ExcessForField a s) where + type Reduce (ExcessForField a s) = (Term s (PAsData a), Reduce (PTryFromExcess (PAsData a) PData s)) -- FIXME: Should we always succede? If we always succede, performance would increase a lot. -instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where - type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] +instance PTryFrom (PDataRecord '[]) (PBuiltinList PData) where + type PTryFromExcess (PDataRecord '[]) (PBuiltinList PData) = HRecP '[] ptryFrom opq = runTermCont $ do _ :: Term _ PUnit <- tcont . plet . pforce $ @@ -284,23 +274,23 @@ type family UnHRecP (x :: PType) :: [(Symbol, PType)] where UnHRecP (HRecP as) = as instance - ( PTryFrom PData (PAsData pty) - , PTryFrom (PBuiltinList PData) (PDataRecord as) - , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase + ( PTryFrom (PAsData pty) PData + , PTryFrom (PDataRecord as) (PBuiltinList PData) + , PTryFromExcess (PDataRecord as) (PBuiltinList PData) ~ HRecP ase ) => - PTryFrom (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) + PTryFrom (PDataRecord ((name ':= pty) ': as)) (PBuiltinList PData) where type - PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) = + PTryFromExcess (PDataRecord ((name ':= pty) ': as)) (PBuiltinList PData) = HRecP ( '(name, ExcessForField pty) - ': UnHRecP (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) + ': UnHRecP (PTryFromExcess (PDataRecord as) (PBuiltinList PData)) ) ptryFrom opq = runTermCont $ do h <- tcont $ plet $ phead # opq - hv <- tcont $ ptryFrom @PData @(PAsData pty) h + hv <- tcont $ ptryFrom @(PAsData pty) @PData h t <- tcont $ plet $ ptail # opq - tv <- tcont $ ptryFrom @(PBuiltinList PData) @(PDataRecord as) t + tv <- tcont $ ptryFrom @(PDataRecord as) @(PBuiltinList PData) t pure (punsafeCoerce opq, HCons hv (snd tv)) newtype Helper a b s = Helper (a s, b s) @@ -309,21 +299,21 @@ instance (Reducible (a s), Reducible (b s)) => Reducible (Helper a b s) where type Reduce (Helper a b s) = (Reduce (a s), Reduce (b s)) instance - ( PTryFrom (PBuiltinList PData) (PDataRecord as) - , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase + ( PTryFrom (PDataRecord as) (PBuiltinList PData) + , PTryFromExcess (PDataRecord as) (PBuiltinList PData) ~ HRecP ase ) => - PTryFrom PData (PAsData (PDataRecord as)) + PTryFrom (PAsData (PDataRecord as)) PData where type - PTryFromExcess PData (PAsData (PDataRecord as)) = - Helper (Flip Term (PDataRecord as)) (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) + PTryFromExcess (PAsData (PDataRecord as)) PData = + Helper (Flip Term (PDataRecord as)) (PTryFromExcess (PDataRecord as) (PBuiltinList PData)) ptryFrom opq = runTermCont $ do - l <- snd <$> (tcont $ ptryFromData @(PAsData (PBuiltinList PData)) opq) - r <- tcont $ ptryFrom @_ @(PDataRecord as) l + l <- snd <$> (tcont $ ptryFrom @(PAsData (PBuiltinList PData)) opq) + r <- tcont $ ptryFrom @(PDataRecord as) l pure (punsafeCoerce opq, r) -instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where - type PTryFromExcess PData (PAsData (PDataSum ys)) = Const () +instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom (PAsData (PDataSum ys)) PData where + type PTryFromExcess (PAsData (PDataSum ys)) PData = Const () ptryFrom opq = runTermCont $ do x <- tcont $ plet $ pasConstr # opq constr <- tcont $ plet $ pfstBuiltin # x @@ -337,7 +327,7 @@ class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where instance {-# OVERLAPPABLE #-} forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). - ( PTryFrom (PBuiltinList PData) (PDataRecord x) + ( PTryFrom (PDataRecord x) (PBuiltinList PData) , SumValidation (n + 1) xs , KnownNat n ) => @@ -347,7 +337,7 @@ instance pif (fromInteger (natVal $ Proxy @n) #== constr) ( unTermCont $ do - _ <- tcont $ ptryFrom @_ @(PDataRecord x) fields + _ <- tcont $ ptryFrom @(PDataRecord x) fields pure $ popaque $ pcon PUnit ) (validateSum @(n + 1) @xs constr fields) @@ -361,15 +351,15 @@ instance {-# OVERLAPPING #-} SumValidation n '[] where unwrapped, then there is also the possibility to recover the whole thing but wrapped -} instance - ( PTryFrom a b + ( PTryFrom b a , PIsData a , PIsData b ) => - PTryFrom (PAsData a) (PAsData b) + PTryFrom (PAsData b) (PAsData a) where - type PTryFromExcess (PAsData a) (PAsData b) = PTryFromExcess a b + type PTryFromExcess (PAsData b) (PAsData a) = PTryFromExcess b a ptryFrom opq = runTermCont $ do - ver' <- snd <$> TermCont (ptryFrom @a @b (pfromData opq)) + ver' <- snd <$> TermCont (ptryFrom @b @a (pfromData opq)) pure $ (punsafeCoerce opq, ver') instance PTryFrom PData PData where @@ -378,6 +368,10 @@ instance PTryFrom PData PData where instance PTryFrom PData (PAsData PData) where type PTryFromExcess PData (PAsData PData) = Const () + ptryFrom opq = runTermCont $ pure (pfromData opq, ()) + +instance PTryFrom (PAsData PData) PData where + type PTryFromExcess (PAsData PData) PData = Const () ptryFrom opq = runTermCont $ pure (pdata opq, ()) ----------------------- PIsDataReprInstances instance ----------------------------------- @@ -388,9 +382,9 @@ instance , SumValidation 0 (PIsDataReprRepr a) , PInner a b ~ PDataSum (PIsDataReprRepr a) ) => - PTryFrom PData (PAsData (PIsDataReprInstances a)) + PTryFrom (PAsData (PIsDataReprInstances a)) PData where - type PTryFromExcess PData (PAsData (PIsDataReprInstances a)) = HRecP '[] + type PTryFromExcess (PAsData (PIsDataReprInstances a)) PData = HRecP '[] ptryFrom opq = runTermCont $ do let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) @@ -399,12 +393,12 @@ instance ----------------------- DerivePNewtype insatace ----------------------------------------- instance - ( PTryFrom a b + ( PTryFrom b a ) => - PTryFrom a (DerivePNewtype c b) + PTryFrom (DerivePNewtype c b) a where - type PTryFromExcess a (DerivePNewtype c b) = PTryFromExcess a b - ptryFrom opq = runTermCont $ (\(inn, exc) -> (punsafeFrom inn, exc)) <$> tcont (ptryFrom @a @b opq) + type PTryFromExcess (DerivePNewtype c b) a = PTryFromExcess b a + ptryFrom opq = runTermCont $ (\(inn, exc) -> (punsafeFrom inn, exc)) <$> tcont (ptryFrom @b @a opq) ----------------------- HasField instance ----------------------------------------------- From a6801e036710af5615f3e4178da1cb261e6a83fe Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 21 Mar 2022 22:50:04 +0000 Subject: [PATCH 241/584] `Plutarch.TryFrom`: Make `HRecP` use `HRec` --- Plutarch/TryFrom.hs | 56 ++++++++------------------------------------- 1 file changed, 10 insertions(+), 46 deletions(-) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 28f2621cf..261df645a 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -5,12 +5,10 @@ module Plutarch.TryFrom ( PTryFrom (..), HRecP (..), - ptryFrom, ) where import Data.Proxy (Proxy (Proxy)) -import GHC.Records (HasField (getField)) import GHC.TypeLits (KnownNat, Nat, Symbol, natVal, type (+)) import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) @@ -39,6 +37,8 @@ import Plutarch.Internal.Other ( import Plutarch.Trace (ptraceError) +import Plutarch.DataRepr.Internal.HList (HRec (HCons, HNil), Labeled (Labeled)) + import Plutarch.DataRepr.Internal ( PDataRecord, PDataSum, @@ -80,6 +80,8 @@ import Plutarch.Reducible (Reducible (Reduce)) import Data.Functor.Const (Const) +import Data.Kind (Type) + ----------------------- The class PTryFrom ---------------------------------------------- {- | @@ -111,8 +113,6 @@ class PTryFrom (b :: PType) (a :: PType) where ----------------------- Reducible and Flip ---------------------------------------------- -instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecP as s - instance Reducible (f x y) => Reducible (Flip f y x) where type Reduce (Flip f y x) = Reduce (f x y) @@ -120,49 +120,13 @@ newtype Flip f a b = Flip (f b a) ----------------------- HRecP and friends ----------------------------------------------- --- | Like @HRec@ but parametrised over a list of `PType`s, not `Type`s. -data HRecP (as :: [(Symbol, PType)]) (s :: S) where - HNil :: HRecP '[] s - HCons :: forall name a as s. Reduce (a s) -> HRecP as s -> HRecP ('(name, a) ': as) s +type family HRecPApply (as :: [(Symbol, PType)]) (s :: S) :: [Type] where + HRecPApply ('(name, ty) ': rest) s = Labeled name (Reduce (ty s)) ': HRecPApply rest s + HRecPApply '[] s = '[] -{- | allows accessing excess fields in an HRec, as of ghc921 you can - also use `OverloadedRecordDot` with this. --} -getExcessField :: - forall name a as s. - ( ElemOf name a as - ) => - HRecP as s -> - Reduce (a s) -getExcessField xs = indexHRec xs $ elemOf @name @a @as - --- | Index HRec using Elem -indexHRec :: forall s as. HRecP as s -> (forall a name. Elem name a as -> Reduce (a s)) -indexHRec (HCons x _) Here = x -indexHRec (HCons _ xs) (There i) = indexHRec xs i -indexHRec HNil impossible = case impossible of {} - -data Elem (sym :: Symbol) (a :: PType) (as :: [(Symbol, PType)]) where - Here :: Elem sym a ('(sym, a) ': as) - There :: Elem a sym as -> Elem a sym ('(sym', b) ': as) - -class - ElemOf (name :: Symbol) (a :: PType) (as :: [(Symbol, PType)]) - | as name -> a - where - elemOf :: Elem name a as +newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (HRec (HRecPApply as s)) -instance {-# OVERLAPPING #-} ElemOf name a ('(name, a) ': as) where - elemOf = Here - -instance - {-# OVERLAPPABLE #-} - ( ElemOf name a as - ) => - ElemOf name a ('(name', b) ': as) - where - elemOf :: Elem name a ('(name', b) ': as) - elemOf = There (elemOf @name @a @as) +instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRec (HRecPApply as s) ----------------------- PData instances ------------------------------------------------- @@ -291,7 +255,7 @@ instance hv <- tcont $ ptryFrom @(PAsData pty) @PData h t <- tcont $ plet $ ptail # opq tv <- tcont $ ptryFrom @(PDataRecord as) @(PBuiltinList PData) t - pure (punsafeCoerce opq, HCons hv (snd tv)) + pure (punsafeCoerce opq, HCons (Labeled hv) (snd tv)) newtype Helper a b s = Helper (a s, b s) From f8cd207f3f19f39b19b23027ef30b001859e76ed Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 22 Mar 2022 12:17:39 +0530 Subject: [PATCH 242/584] Documentation on `PEq` and `POrd` derivation --- docs/Typeclasses/PEq and POrd.md | 44 +++++++++++++++++++ .../PIsDataRepr and PDataFields.md | 5 +++ docs/Usage/Deriving with generics.md | 1 + 3 files changed, 50 insertions(+) diff --git a/docs/Typeclasses/PEq and POrd.md b/docs/Typeclasses/PEq and POrd.md index 4e9718266..f0322c945 100644 --- a/docs/Typeclasses/PEq and POrd.md +++ b/docs/Typeclasses/PEq and POrd.md @@ -32,3 +32,47 @@ pif (1 #< 7) "indeed" "what" ``` evaluates to `"indeed"` - of type `Term s PString`. + +For scott encoded types, you can easily derive `PEq` via generic deriving: + +```hs +import qualified GHC.Generics as GHC +import Generics.SOP + +import Plutarch.Prelude + +data PMaybe a s + = PNothing + | PJust (Term s a) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PlutusType, PEq) +``` + +For data encoded types, you can derive `PEq` and `POrd` via `PIsDataReprInstances`: + +```hs +import qualified GHC.Generics as GHC +import Generics.SOP + +import Plutarch.Prelude +import Plutarch.DataRepr + +newtype PTriplet a s + = PTriplet + ( Term + s + ( PDataRecord + '[ "x" ':= a + , "y" ':= a + , "z" ':= a + ] + ) + ) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData, PEq, POrd) + via (PIsDataReprInstances (PTriplet a)) +``` + +> Aside: `PEq` derivation for data encoded types uses "Data equality". It simply ensures the structure (as represented through [data encoding](../Concepts/Data%20and%20Scott%20encoding.md#data-encoding)) of both values are _exactly_ the same. It does not take into account any custom `PEq` instances for the individual fields within. diff --git a/docs/Typeclasses/PIsDataRepr and PDataFields.md b/docs/Typeclasses/PIsDataRepr and PDataFields.md index a62a04a87..1fbc2f093 100644 --- a/docs/Typeclasses/PIsDataRepr and PDataFields.md +++ b/docs/Typeclasses/PIsDataRepr and PDataFields.md @@ -254,6 +254,11 @@ Thus, you can use `PBuiltinList (PAsData PInteger)` as a field type, but not `PB And you'd simply derive `PIsDataRepr` using generics. However, you **must** also derive `PIsData` and `PlutusType` using `PIsDataReprInstances`. For single constructor data types, you should also derive `PDataFields`. +Furthermore, you can also derive the following typeclasses via `PIsDataReprInstances`: + +- [`PEq`](./PEq%20and%20POrd.md) +- [`POrd`](./PEq%20and%20POrd.md) + Combine all that, and you have: ```hs diff --git a/docs/Usage/Deriving with generics.md b/docs/Usage/Deriving with generics.md index bc02ca3d4..49694721b 100644 --- a/docs/Usage/Deriving with generics.md +++ b/docs/Usage/Deriving with generics.md @@ -22,3 +22,4 @@ Currently, generic deriving supports the following typeclasses: - [`PlutusType`](./../Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md#implementing-plutustype-for-your-own-types-scott-encoding) (Scott encoding only) - [`PIsDataRepr`](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) +- [`PEq`](./../Typeclasses/PEq%20and%20POrd.md) From fa4c04c706254530c5bfa478079f555645c1894b Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Mar 2022 11:57:30 +0000 Subject: [PATCH 243/584] Remove `PTryFrom` for `PMap` temporarily --- Plutarch/Api/V1/AssocMap.hs | 33 --------------------------------- Plutarch/Api/V1/Value.hs | 19 ------------------- Plutarch/Builtin.hs | 2 +- 3 files changed, 1 insertion(+), 53 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 1211c5e45..bce481ac8 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -8,10 +8,6 @@ module Plutarch.Api.V1.AssocMap ( import Data.Map (Map, toList) -import Plutarch.TryFrom ( - HRecP (HNil), - PTryFrom (PTryFromExcess, ptryFrom), - ) import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap @@ -85,32 +81,3 @@ pmkPMap :: Map a b -> Term s (PMap (PConstanted a) (PConstanted b)) pmkPMap (toList -> l) = pconstant $ PlutusMap.fromList l - ------------------------ PTryFrom insances ----------------------------------------------- - -instance - ( POrd k - , PIsData k - ) => - PTryFrom (PBuiltinMap k v) (PMap k v) - where - type PTryFromExcess (PBuiltinMap k v) (PMap k v) = HRecP '[] - ptryFrom oMap = runTermCont $ do - _ <- - tcont $ - plet $ - ( pfix #$ plam $ - \self xs -> - pmatch xs $ \case - PNil -> pcon PUnit - PCons x ys -> - pmatch ys $ \case - PNil -> pcon PUnit - PCons y _ -> - pif - ((pfromData (pfstBuiltin # x)) #< (pfromData (pfstBuiltin # y))) - (self # ys) - perror - ) - # oMap - pure ((pcon . PMap) oMap, HNil) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index bd2e1e82b..676aa1db5 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -17,11 +17,6 @@ import Plutarch.Lift ( PUnsafeLiftDecl, ) -import Plutarch.TryFrom ( - HRecP (HNil), - PTryFrom (PTryFromExcess, ptryFrom), - ) - import Plutarch.Prelude newtype PTokenName (s :: S) = PTokenName (Term s PByteString) @@ -52,17 +47,3 @@ deriving via (DerivePConstantViaNewtype Plutus.Value PValue (PMap PCurrencySymbol (PMap PTokenName PInteger))) instance (PConstant Plutus.Value) - ------------------------ PTryFrom instances ---------------------------------------------- - -instance PTryFrom (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue where - type PTryFromExcess (PMap PCurrencySymbol (PMap PTokenName PInteger)) PValue = HRecP '[] - ptryFrom m = runTermCont $ do - let predInner :: Term _ (PBuiltinPair (PAsData PTokenName) (PAsData PInteger) :--> PBool) - predInner = plam $ \tup -> pif (0 #< (pfromData $ psndBuiltin # tup)) (pcon PTrue) perror - predOuter :: Term _ (PBuiltinPair (PAsData PCurrencySymbol) (PAsData (PMap PTokenName PInteger)) :--> PBool) - predOuter = plam $ \tup -> pall # predInner # (pto $ pfromData $ psndBuiltin # tup) - res :: Term _ PBool - res = pall # predOuter # pto m - _ <- tcont $ plet res - pure $ (pcon $ PValue m, HNil) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 196e66bd4..44c00e76c 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -236,7 +236,7 @@ pforgetData x = coerce $ pforgetData' Proxy (coerce x :: Term s (Helper1 (PAsDat pforgetData' :: forall a (p :: PType -> PType) s. Proxy p -> Term s (p (PAsData a)) -> Term s (p PData) pforgetData' Proxy = punsafeCoerce --- | Like 'pforgetData', except it works for complex types. +-- | Inverse of 'pforgetData''. prememberData :: forall (p :: PType -> PType) s. Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) prememberData Proxy = punsafeCoerce From 0f2358631553ad215651243111172df9a2c594e2 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Mar 2022 14:04:54 +0000 Subject: [PATCH 244/584] Remove sortedness invariant from maps temporarily It's not clear whether they are sorted on-chain or not currently. --- Plutarch/Api/V1.hs | 1 - Plutarch/Api/V1/AssocMap.hs | 33 ++++----------------------------- Plutarch/Lift.hs | 13 +++++++++++++ 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 431c345dc..8bf19e4d4 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -67,7 +67,6 @@ module Plutarch.Api.V1 ( -- ** AssocMap AssocMap.PMap, - AssocMap.pmkPMap, -- ** Others Maybe.PMaybeData (PDJust, PDNothing), diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index bce481ac8..63f83505d 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -3,11 +3,8 @@ module Plutarch.Api.V1.AssocMap ( PMap (PMap), - pmkPMap, ) where -import Data.Map (Map, toList) - import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap @@ -32,6 +29,7 @@ instance , Plutus.FromData (PLifted k) , PLift k , PLift v + , Ord (PLifted k) ) => PUnsafeLiftDecl (PMap k v) where @@ -39,15 +37,14 @@ instance instance ( PLifted (PConstanted k) ~ k + , PLifted (PConstanted v) ~ v , Plutus.ToData v , Plutus.FromData v , Plutus.ToData k , Plutus.FromData k - , PConstant k - , PLifted (PConstanted v) ~ v - , Plutus.FromData v - , Plutus.ToData v , PConstant v + , PConstant k + , Ord k ) => PConstant (PlutusMap.Map k v) where @@ -59,25 +56,3 @@ instance x' <- Plutus.fromData x y' <- Plutus.fromData y Just (x', y') - ------------------------ Smart constructor to to create onchain instances ---------------- - -{- | - Smart constructor to enforce PMap invariants on the Haskell level for writing - onchain code --} -pmkPMap :: - forall a b s. - ( PLifted (PConstanted a) ~ a - , PLifted (PConstanted b) ~ b - , PLift (PConstanted a) - , PLift (PConstanted b) - , Plutus.ToData a - , Plutus.ToData b - , Plutus.FromData a - , Plutus.FromData b - , Ord a - ) => - Map a b -> - Term s (PMap (PConstanted a) (PConstanted b)) -pmkPMap (toList -> l) = pconstant $ PlutusMap.fromList l diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 7dcec1f48..f182057f7 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -35,6 +35,11 @@ import PlutusTx (BuiltinData, Data, builtinDataToData, dataToBuiltinData) import PlutusTx.Builtins.Class (FromBuiltin, ToBuiltin, fromBuiltin, toBuiltin) import qualified UntypedPlutusCore as UPLC +{- | +Laws: + - It must be that @PConstantRepr (PLifted p)@ when encoded as a constant + in UPLC (via the 'UntypedPlutusCore.Constant' constructor) is a valid @p@. +-} class (PConstant (PLifted p), PConstanted (PLifted p) ~ p) => PUnsafeLiftDecl (p :: PType) where type PLifted p :: Type @@ -44,6 +49,14 @@ and converted to a Plutarch type. The Plutarch type is determined by `PConstanted h`. Its Plutus Core representation is given by `PConstantRepr h`. This typeclass is closely tied with 'PLift'. + +Laws: + - @pconstantFromRepr . pconstantToRepr ≡ Just@ + - @(pconstantToRepr <$>) . pconstantFromRepr ≡ Just@ + - @plift . pfromData . punsafeCoerce . pconstant . toData ≡ id@ + - @fromData . plift . pforgetData . ptoData . pconstant ≡ Just@ + +These laws must be upheld for the sake of soundness of the type system. -} class (PUnsafeLiftDecl (PConstanted h), PLC.DefaultUni `PLC.Includes` PConstantRepr h) => PConstant (h :: Type) where type PConstantRepr h :: Type From a613ee8f96caf384d6cb408bf0c0492f2c5035ae Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Mar 2022 14:26:10 +0000 Subject: [PATCH 245/584] Implement `Reducible` for `Identity` --- Plutarch/Reducible.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Plutarch/Reducible.hs b/Plutarch/Reducible.hs index 603f02e98..65ba7765c 100644 --- a/Plutarch/Reducible.hs +++ b/Plutarch/Reducible.hs @@ -3,6 +3,7 @@ module Plutarch.Reducible (Reducible (Reduce)) where import Data.Coerce (Coercible) import Data.Functor.Const (Const (Const)) +import Data.Functor.Identity (Identity (Identity)) import Data.Kind (Type) class (Coercible (Reduce x) x) => Reducible (x :: Type) where @@ -10,5 +11,8 @@ class (Coercible (Reduce x) x) => Reducible (x :: Type) where instance Reducible () where type Reduce () = () -instance Reducible x => Reducible (Const x y) where - type Reduce (Const x y) = Reduce x +instance Reducible a => Reducible (Const a b) where + type Reduce (Const a b) = Reduce a + +instance Reducible a => Reducible (Identity a) where + type Reduce (Identity a) = Reduce a From 82d39116a200306e9390e417952bf7b79cc2b81b Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Mar 2022 11:03:51 -0400 Subject: [PATCH 246/584] Export Plutarch.Test.Property - Replace `Util.hs:EquivalenceMethod` with `Equality`/`Totality`, because the former can allow the library user to generate redundant tests. - Replace `haskPlutEquiv` with `prop_haskEquiv`; the latter uses - - The new Equality/Totality types - TypeApplications instead of proxy helpers (thus avoids large exports) - `NP` from sop-core to build arguments. - Move `Marshal` to separate module As well as some upstreaming: - Use a large budget for evaluating property tests by necessity - Upstream `prop_dataRoundTrip` in Extra module, which will contain properties based on `prop_haskEquiv` - `Marshsl`: add default implementation using `PLifted` --- .../common/Plutarch/Test/Property.hs | 8 + .../common/Plutarch/Test/Property/Extra.hs | 77 +++++ .../Plutarch/Test/Property/HaskEquiv.hs | 187 ++++++++++++ .../common/Plutarch/Test/Property/Marshal.hs | 39 +++ .../common/Plutarch/Test/Property/Util.hs | 286 ------------------ .../plutarch-base/Plutarch/ListSpec.hs | 18 +- .../plutarch-extra/Plutarch/ListUtilsSpec.hs | 11 +- plutarch-test/plutarch-test.cabal | 15 +- 8 files changed, 341 insertions(+), 300 deletions(-) create mode 100644 plutarch-test/common/Plutarch/Test/Property.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property/Extra.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property/Marshal.hs delete mode 100644 plutarch-test/common/Plutarch/Test/Property/Util.hs diff --git a/plutarch-test/common/Plutarch/Test/Property.hs b/plutarch-test/common/Plutarch/Test/Property.hs new file mode 100644 index 000000000..5bce715a1 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property.hs @@ -0,0 +1,8 @@ +-- | Helper for writing property tests for Plutarch terms. +module Plutarch.Test.Property ( + module X, +) where + +import Plutarch.Test.Property.Extra as X +import Plutarch.Test.Property.HaskEquiv as X +import Plutarch.Test.Property.Marshal as X diff --git a/plutarch-test/common/Plutarch/Test/Property/Extra.hs b/plutarch-test/common/Plutarch/Test/Property/Extra.hs new file mode 100644 index 000000000..9ca94607f --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property/Extra.hs @@ -0,0 +1,77 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} + +{- | + Extra properties based on `prop_haskEquiv` +-} +module Plutarch.Test.Property.Extra ( + prop_leftInverse, + prop_dataRoundTrip, +) where + +import Hedgehog (Gen, Property) + +import Plutarch (ClosedTerm) +import Plutarch.Prelude + +import Plutarch.Test.Property.HaskEquiv ( + Equality (OnPEq), + HaskEquiv, + LamArgs, + NP (Nil, (:*)), + Totality (TotalFun), + prop_haskEquiv, + ) +import Plutarch.Test.Property.Marshal (Marshal) + +{- | + `l` is a left inverse of `r` + + See https://en.wikipedia.org/wiki/Inverse_function#Left_inverses + + Like `prop_haskEquiv`, you want to call this with @TypeApplications@ + specifying the value of `e` and `t`. For example, + + >>> prop_leftInverse + @'OnPEq + @'TotalFun + mapJoin + mapSplit + $ mapOf (pairOf integer integer) rational +-} +prop_leftInverse :: + forall e t p p' h. + ( LamArgs h ~ '[] + , HaskEquiv e t (h -> h) (p :--> p) '[h] + , Show h + , Marshal h p + ) => + ClosedTerm (p' :--> p) -> + ClosedTerm (p :--> p') -> + Gen h -> + Property +prop_leftInverse l r arg = + prop_haskEquiv @e @t (id @h) (plam $ \x -> l #$ r # x) (arg :* Nil) + +{- | + A Plutarch term that is a `PIsData` can be encoded to and decoded back to the + same value. +-} +prop_dataRoundTrip :: + forall h p. + ( LamArgs h ~ '[] + , Show h + , Marshal h p + , PIsData p + , PEq p + ) => + Gen h -> + Property +prop_dataRoundTrip = + prop_leftInverse + @( 'OnPEq) + @( 'TotalFun) + @p + @(PAsData p) + @h + (plam pfromData) + (plam pdata) diff --git a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs new file mode 100644 index 000000000..e4ded8679 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs @@ -0,0 +1,187 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE UndecidableInstances #-} + +{- | + The property of Plutarch terms corresponding to a Haskell term. + + Assuming Haskell functions are already well-tested, by verifying the property + that a Plutarch term functions equivalently to the corresponding Haskell term + we automatically (more or less) verify the correctness of the Plutarch term. + + This modules provides a `prop_haskEquiv` to that end. +-} +module Plutarch.Test.Property.HaskEquiv ( + -- * The principal property of the module #prop# + prop_haskEquiv, + Equality (..), + Totality (..), + NP ((:*), Nil), -- Re-exports from sop-core for building Gen arguments + + -- * For writing helper functions using `prop_haskEquiv` #types# + LamArgs, + HaskEquiv, + + -- * Underlying equality tests #util# + testDataEq, + testPEq, +) where + +import Control.Exception (SomeException, evaluate, try) +import Control.Monad.IO.Class (liftIO) +import Data.SOP (NP (Nil, (:*))) +import Data.Text (Text) +import Hedgehog (Gen, Property, PropertyT, annotate, annotateShow, assert, forAll, property, (===)) +import Plutus.V1.Ledger.Scripts (Script (Script, unScript)) +import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) +import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) + +import Plutarch (ClosedTerm, compile) +import Plutarch.Evaluate (EvalError, evalScript') +import Plutarch.Prelude +import Plutarch.Test.Property.Marshal (Marshal (marshal)) + +-- | The nature of equality between two Plutarch terms. +data Equality + = OnPEq + | OnPData + | -- | Terms are equal on both `PEq` and `PData` + OnBoth + deriving stock (Eq, Show, Ord) + +-- | Whether a function is total or partial. +data Totality + = TotalFun + | -- | The Plutarch *and* Haskell function is expected to be partial (error's on + -- certain inputs). + PartialFun + deriving stock (Eq, Show, Ord) + +{- | + Class of pairs of Plutarch and Haskell types that are semantically + equivalent, upto the given `Equality` and `Totality`. +-} +class LamArgs h ~ args => HaskEquiv (e :: Equality) (t :: Totality) h p args | h -> p where + -- | Test that `h` and `p` are equal when applied on the given `args`. + haskEquiv :: h -> ClosedTerm p -> NP Gen args -> PropertyT IO () + +-- | Argument types for a Haskell function (empty if a term value) +type family LamArgs f :: [Type] where + LamArgs (a -> b) = a ': LamArgs b + LamArgs _ = '[] + +-- For lambda terms generate the first argument and delegate. +instance + (Show ha, Marshal ha pa, HaskEquiv e t hb pb hbArgs, LamArgs hb ~ hbArgs) => + HaskEquiv e t (ha -> hb) (pa :--> pb) (ha ': hbArgs) + where + haskEquiv hf pf (a :* as) = do + x <- forAll a + haskEquiv @e @t (hf x) (pf # marshal x) as + +instance (PIsData p, Marshal h p, LamArgs h ~ '[]) => HaskEquiv 'OnPData 'TotalFun h p '[] where + haskEquiv h p Nil = testDataEq' h p + +instance (PEq p, Marshal h p, LamArgs h ~ '[]) => HaskEquiv 'OnPEq 'TotalFun h p '[] where + haskEquiv h p Nil = testPEq (marshal h) p + +instance + ( PEq p + , PIsData p + , Marshal h p + , HaskEquiv 'OnPEq 'TotalFun h p '[] + , HaskEquiv 'OnPData 'TotalFun h p '[] + ) => + HaskEquiv 'OnBoth 'TotalFun h p '[] + where + haskEquiv h p Nil = do + haskEquiv @( 'OnPEq) @( 'TotalFun) h p Nil + haskEquiv @( 'OnPData) @( 'TotalFun) h p Nil + +instance + (PIsData p, Marshal h p, HaskEquiv eq 'TotalFun h p '[]) => + HaskEquiv eq 'PartialFun h p '[] + where + haskEquiv h p Nil = testPartial (\h' p' -> haskEquiv @eq @( 'TotalFun) h' p' Nil) h p + +{- | + The given Plutarch term is equivalent to the given Haskell type upto the given + `Equality` and `Totality`. + + Generator arguments must be non-empty if the term is a lambda. This function + must always be called using `TypeApplications` specifying the first two + type variables. + + Example: + + >>> prop_haskEquiv + @'OnPEq + @'TotalFun + (reverse :: [Integer] -> [Integer]) + preverse + (genList integerGen :* Nil) +-} +prop_haskEquiv :: + forall (e :: Equality) (t :: Totality) h p. + HaskEquiv e t h p (LamArgs h) => + h -> + ClosedTerm p -> + NP Gen (LamArgs h) -> + Property +prop_haskEquiv h p = do + property . haskEquiv @e @t h p + +testDataEq' :: (PIsData a, Marshal h a) => h -> ClosedTerm a -> PropertyT IO () +testDataEq' x y = + testDataEq (marshal x) y + +testDataEq :: (PIsData a) => ClosedTerm a -> ClosedTerm a -> PropertyT IO () +testDataEq x y = pshouldBe (pdata x) (pdata y) + +testPartial :: (h -> ClosedTerm p -> PropertyT IO ()) -> h -> ClosedTerm p -> PropertyT IO () +testPartial baseTest h p = + liftIO (try $ evaluate h) >>= \case + Left (_ :: SomeException) -> + case run p of + (Left _, _, _) -> assert True + (Right _, _, _) -> do + annotate "plutarch didn't fail but haskell did" + assert False + Right _ -> baseTest h p + +testPEq :: PEq a => ClosedTerm a -> ClosedTerm a -> PropertyT IO () +testPEq x y = + -- Evaluate the terms once so we can annotate them individually. + -- Then, evaluate `x #== y`. + case (run x, run y) of + ((Right (Script x'), _, _), (Right (Script y'), _, _)) -> do + annotateShow x' + annotateShow y' + pshouldBe (pcon PTrue) (x #== y) + _ -> assert False + +-- | Like `Plutarch.Test.pshouldBe` but in Hedgehog property monad. +pshouldBe :: ClosedTerm a -> ClosedTerm a -> PropertyT IO () +pshouldBe x y = + -- testing equality of Scott encoded types + -- this way is generally prone to false errors + -- hence this function not being directly exposed + case (run x, run y) of + ((Right script1, _, trace1), (Right script2, _, trace2)) -> do + annotateShow trace1 + annotateShow trace2 + annotateShow $ unScript script1 + annotateShow $ unScript script2 + trace1 === trace2 + script1 === script2 + _ -> assert False + +run :: ClosedTerm h -> (Either EvalError Script, ExBudget, [Text]) +run t = evalScriptHugeBudget $ compile t + +{- | A more suitable version of `evalScript` geared towards property tests that + can use lots of resources +-} +evalScriptHugeBudget :: Script -> (Either EvalError Script, ExBudget, [Text]) +evalScriptHugeBudget = + evalScript' $ + ExBudget (ExCPU 10_000_000_000_000) (ExMemory 10_000_000_000) diff --git a/plutarch-test/common/Plutarch/Test/Property/Marshal.hs b/plutarch-test/common/Plutarch/Test/Property/Marshal.hs new file mode 100644 index 000000000..045dea127 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property/Marshal.hs @@ -0,0 +1,39 @@ +{-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.Test.Property.Marshal ( + Marshal (marshal), +) where + +import Plutarch (ClosedTerm) +import Plutarch.Lift (PLifted) +import Plutarch.Prelude + +-- | Class of Haskell types that can be marshalled to a Plutarch term. +class Marshal h (p :: PType) | h -> p where + marshal :: h -> ClosedTerm p + default marshal :: (PLifted p ~ h, PLift p) => h -> ClosedTerm p + marshal x = pconstant x + +instance Marshal h p => Marshal [h] (PList p) where + marshal xs = foldr (\h t -> pcons # marshal h # t) pnil xs + +instance Marshal ha pa => Marshal (Maybe ha) (PMaybe pa) where + marshal (Just x) = pcon $ PJust $ marshal x + marshal Nothing = pcon PNothing + +instance (Marshal ha pa, Marshal hb pb) => Marshal (ha, hb) (PPair pa pb) where + marshal (a, b) = pcon $ PPair (marshal a) (marshal b) + +instance Marshal Integer PInteger where + marshal n = fromInteger n + +instance Marshal Rational PRational where + marshal r = fromRational r + +instance Marshal Bool PBool where + marshal True = pcon PTrue + marshal False = pcon PFalse + +instance Marshal () PUnit where + marshal () = pcon PUnit diff --git a/plutarch-test/common/Plutarch/Test/Property/Util.hs b/plutarch-test/common/Plutarch/Test/Property/Util.hs deleted file mode 100644 index d36dfb16a..000000000 --- a/plutarch-test/common/Plutarch/Test/Property/Util.hs +++ /dev/null @@ -1,286 +0,0 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE TypeFamilies #-} -{-# LANGUAGE UndecidableInstances #-} - -module Plutarch.Test.Property.Util ( - Marshal (marshal), - NotLambda, - haskPlutEquiv, - leftInverse, - viaData, - viaPEq, - viaBoth, - viaPEqPartial, - viaDataPartial, - viaBothPartial, - testDataEq, - testPEq, - run, -) where - -import Plutarch.Prelude - -import Plutarch (ClosedTerm, compile) - -import Plutarch.Evaluate (EvalError, evalScript) - -import Control.Exception (SomeException, evaluate, try) -import Control.Monad.IO.Class (liftIO) -import Data.Proxy (Proxy (Proxy)) -import Data.Text (Text) - -import Plutus.V1.Ledger.Scripts (Script (..)) -import PlutusCore.Evaluation.Machine.ExBudget (ExBudget) - -import Hedgehog (Gen, Property, PropertyT, annotate, annotateShow, assert, forAll, property, (===)) - -class Marshal h (p :: PType) | h -> p where - marshal :: h -> ClosedTerm p - -data EquivalenceMethod - = -- test equivalence by converting to data with pdata - -- and then comparing the Script output in haskell - ViaPData - | -- test equivalence inside plutarch with - -- #== using the type's PEq instance - ViaPEq - | -- Partial modifies an EquivalenceMethod - -- to allow testing partial functions - -- if the haskell fails but the plutarch succeds - -- or vice versa the test will fail - -- but if both fail or both succed and agree - -- up to the modified EquivalenceMethod - -- the test will pass - Partial EquivalenceMethod - | -- And runs the same test with two - -- equivalence methods and fails - -- if either test fails - And EquivalenceMethod EquivalenceMethod - --- The 'ed classes use tupples like (a,(b,c,())) which are more convenient to abstract over --- the un'ed classes use regular tuples like (a,b,c) which are more convenient to use - -class GensForArgs' h ~ args => HaskellPlutarchEquivalence' (e :: EquivalenceMethod) h (p :: PType) args | h -> p where - runTest' :: Proxy e -> h -> ClosedTerm p -> args -> PropertyT IO () - -class GensForArgs h ~ args => HaskellPlutarchEquivalence (e :: EquivalenceMethod) h (p :: PType) args | h -> p where - runTest :: Proxy e -> h -> ClosedTerm p -> AsTuple (GensForArgs' h) -> PropertyT IO () - -{- - - e is the EquivalenceMethod indicating which sort of equivalence to use - - ha is the haskell level type while pa is analogous PType - - - when h is a function args contains the generators for it's arguments - - the first few instances start args as () - - then the last instance in this block add generators to the left with tuples - - when ha is - - pa , (pb :--> pa) , (pc :--> pb :--> pa) , (pd :--> pc :--> pb :--> pa) - - args is - - () , (Gen hb,()) , (Gen hc,(Gen hb,())) , (Gen hd,(Gen hc,(Gen hb,()))) ... - -} - -instance (PIsData p, Marshal h p, NotLambda h) => HaskellPlutarchEquivalence' 'ViaPData h p () where - runTest' Proxy ht pt () = testDataEq (marshal ht) pt - -instance (PEq p, Marshal h p, NotLambda h) => HaskellPlutarchEquivalence' 'ViaPEq h p () where - runTest' Proxy ht pt () = testPEq (marshal ht) pt - -instance - HaskellPlutarchEquivalence' e h p () => - HaskellPlutarchEquivalence' ( 'Partial e) h p () - where - runTest' Proxy ht pt () = testPartial baseTest ht pt - where - baseTest :: h -> ClosedTerm p -> PropertyT IO () - baseTest h p = runTest' (Proxy :: Proxy e) h p () - -instance - ( HaskellPlutarchEquivalence' l h p () - , HaskellPlutarchEquivalence' r h p () - ) => - HaskellPlutarchEquivalence' ( 'And l r) h p () - where - runTest' Proxy h p () = do - runTest' (Proxy :: Proxy l) h p () - runTest' (Proxy :: Proxy r) h p () - -instance - ( Show ha - , Marshal ha pa - , HaskellPlutarchEquivalence' e hb pb args - ) => - HaskellPlutarchEquivalence' e (ha -> hb) (pa :--> pb) (Gen ha, args) - where - runTest' e hf pf (g, args) = do - x <- forAll g - runTest' e (hf x) (pf # marshal x) args - -{- - - the next instance moves from the 'ed to the un'ed class - - to provide less cluttered options for args - - when ha is - - pa , (bp :--> pa) , (pc :--> pb :--> pa) , (pd :--> pc :--> pb :--> pa) ... - - args is now - - () , Gen hb , (Gen hc,Gen hb) , (Gen hd,Gen hc,Gen hb) ... - - if we encounter higher arity functions - - it would be easy enough to add - - instances for clean tuples for them too - -} - -instance - ( HaskellPlutarchEquivalence' e h p args' - , AsTuple args' ~ args - , IsTuple args' - ) => - HaskellPlutarchEquivalence e h p args - where - runTest e hf pf args = runTest' e hf pf $ fromTuple args - -{- - - the functions haskPlutEquiv and the proxies viaData viaBoth etc - - are exposed in the module (runtest and the HaskellPlutarchEquivalence class are not) - - and are the intended way to indicate which sort - - of test to use and to run haskell agreement tests in general --} - -haskPlutEquiv :: - HaskellPlutarchEquivalence e h p args => - Proxy (e :: EquivalenceMethod) -> - h -> - ClosedTerm p -> - args -> - Property -haskPlutEquiv proxy h p args = property $ runTest proxy h p args - -leftInverse :: - forall h e p p'. - HaskellPlutarchEquivalence e (h -> h) (p :--> p) (Gen h) => - Proxy (e :: EquivalenceMethod) -> - ClosedTerm (p' :--> p) -> - ClosedTerm (p :--> p') -> - Gen h -> - Property -leftInverse proxy l r = - haskPlutEquiv proxy (id :: h -> h) (plam $ \x -> l #$ r # x) - -viaData :: Proxy 'ViaPData -viaData = Proxy - -viaPEq :: Proxy 'ViaPEq -viaPEq = Proxy - -viaBoth :: Proxy ( 'And 'ViaPEq 'ViaPData) -viaBoth = Proxy - -viaPEqPartial :: Proxy ( 'Partial 'ViaPEq) -viaPEqPartial = Proxy - -viaDataPartial :: Proxy ( 'Partial 'ViaPData) -viaDataPartial = Proxy - -viaBothPartial :: Proxy ( 'Partial ( 'And 'ViaPEq 'ViaPData)) -viaBothPartial = Proxy - -testDataEq :: PIsData a => ClosedTerm a -> ClosedTerm a -> PropertyT IO () -testDataEq x y = testOutputEq (pdata x) (pdata y) - -testPartial :: (h -> ClosedTerm p -> PropertyT IO ()) -> h -> ClosedTerm p -> PropertyT IO () -testPartial baseTest h p = - liftIO (try $ evaluate h) >>= \case - Left (_ :: SomeException) -> - case run p of - (Left _, _, _) -> assert True - (Right _, _, _) -> do - annotate "plutarch didn't fail but haskell did" - assert False - Right _ -> baseTest h p - -testPEq :: PEq a => ClosedTerm a -> ClosedTerm a -> PropertyT IO () -testPEq x y = - case (run x, run y) of - ((Right (Script x'), _, _), (Right (Script y'), _, _)) -> do - annotateShow x' - annotateShow y' - testOutputEq (pcon PTrue) (x #== y) - _ -> assert False - --- testing equality of Scott encoded types --- this way is generally prone to false errors --- hence this function not being directly exposed -testOutputEq :: ClosedTerm ha -> ClosedTerm ha -> PropertyT IO () -testOutputEq x y = - case (run x, run y) of - ((Right lb, _, la), (Right rb, _, ra)) -> do - annotateShow la - annotateShow ra - annotateShow $ unScript lb - annotateShow $ unScript rb - la === ra - lb === rb - _ -> assert False - -run :: ClosedTerm h -> (Either EvalError Script, ExBudget, [Text]) -run t = evalScript $ compile t - -instance Marshal h p => Marshal [h] (PList p) where - marshal xs = foldr (\h t -> pcons # marshal h # t) pnil xs - -instance Marshal ha pa => Marshal (Maybe ha) (PMaybe pa) where - marshal (Just x) = pcon $ PJust $ marshal x - marshal Nothing = pcon PNothing - -instance (Marshal ha pa, Marshal hb pb) => Marshal (ha, hb) (PPair pa pb) where - marshal (a, b) = pcon $ PPair (marshal a) (marshal b) - -instance Marshal Integer PInteger where - marshal n = fromInteger n - -instance Marshal Rational PRational where - marshal r = fromRational r - -instance Marshal Bool PBool where - marshal True = pcon PTrue - marshal False = pcon PFalse - -instance Marshal () PUnit where - marshal () = pcon PUnit - --- GensForArgs f is the tuple of generators for the arguments of F --- i.e. GensForArgs (a -> b -> c) ~ (Gen a,Gen b) -type family GensForArgs f :: Type where - GensForArgs f = AsTuple (GensForArgs' f) - --- GensForArgs is the same as GenArgsFor except it uses tuples like (Gen a,(Gen b,())) -type family GensForArgs' f :: Type where - GensForArgs' (a -> b) = (Gen a, GensForArgs' b) - GensForArgs' h = () - -class IsTuple t where - type AsTuple t - fromTuple :: AsTuple t -> t - -instance IsTuple (a, ()) where - type AsTuple (a, ()) = a - fromTuple a = (a, ()) - -instance IsTuple (a, (b, ())) where - type AsTuple (a, (b, ())) = (a, b) - fromTuple (a, b) = (a, fromTuple b) - -instance IsTuple (a, (b, (c, ()))) where - type AsTuple (a, (b, (c, ()))) = (a, b, c) - fromTuple (a, b, c) = (a, fromTuple (b, c)) - -instance IsTuple (a, (b, (c, (d, ())))) where - type AsTuple (a, (b, (c, (d, ())))) = (a, b, c, d) - fromTuple (a, b, c, d) = (a, fromTuple (b, c, d)) - -instance IsTuple (a, (b, (c, (d, (e, ()))))) where - type AsTuple (a, (b, (c, (d, (e, ()))))) = (a, b, c, d, e) - fromTuple (a, b, c, d, e) = (a, fromTuple (b, c, d, e)) - -instance IsTuple (a, (b, (c, (d, (e, (f, ())))))) where - type AsTuple (a, (b, (c, (d, (e, (f, ())))))) = (a, b, c, d, e, f) - fromTuple (a, b, c, d, e, f) = (a, fromTuple (b, c, d, e, f)) - -type NotLambda a = GensForArgs' a ~ () diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index 7f3a2eb3f..281720fea 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -11,8 +11,8 @@ import Hedgehog (Property) import Data.List (find) +import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genList, integerGen) -import Plutarch.Test.Property.Util (haskPlutEquiv, viaBothPartial, viaPEq) import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range @@ -100,22 +100,26 @@ spec = do findTest :: Property findTest = - haskPlutEquiv - viaPEq + prop_haskEquiv + @( 'OnPEq) + @( 'TotalFun) (find @[] @Integer even) (pfind # peven) - (genList integerGen) + (genList integerGen :* Nil) where peven :: Term s (PInteger :--> PBool) peven = plam $ \n -> pmod # n # 2 #== 0 elemAtTest :: Property elemAtTest = - haskPlutEquiv - viaBothPartial + prop_haskEquiv + @( 'OnBoth) + @( 'PartialFun) elemAt pelemAt - (Gen.integral $ Range.linear (-10) 100, Gen.list (Range.linear 0 100) integerGen) + $ Gen.integral (Range.linear (-10) 100) + :* Gen.list (Range.linear 0 100) integerGen + :* Nil elemAt :: Integer -> [Integer] -> Integer elemAt n xs = xs !! fromInteger n diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs index bfaeec653..e880688e6 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -8,8 +8,8 @@ import Plutarch.Test import Hedgehog (Property) +import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genList, integerGen) -import Plutarch.Test.Property.Util (haskPlutEquiv, marshal, viaPEq) import Plutarch.ListUtils (pcheckSorted, preverse) @@ -28,9 +28,10 @@ spec = do "reverse_[]" @| preverse # marshal ([] :: [Integer]) reverseTest :: Property -reverseTest = - haskPlutEquiv - viaPEq +reverseTest = do + prop_haskEquiv + @( 'OnPEq) + @( 'TotalFun) (reverse :: [Integer] -> [Integer]) preverse - (genList integerGen) + (genList integerGen :* Nil) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index c6bffb5fc..15c54c536 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -89,6 +89,7 @@ common deps , plutus-ledger-api , plutus-tx , serialise + , sop-core , sydtest , sydtest-discover , sydtest-hedgehog @@ -101,11 +102,18 @@ common deps library import: c, deps hs-source-dirs: common - exposed-modules: Plutarch.Test + exposed-modules: + Plutarch.Test + Plutarch.Test.Property + Plutarch.Test.Property.Gen + other-modules: Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax + Plutarch.Test.Property.Extra + Plutarch.Test.Property.HaskEquiv + Plutarch.Test.Property.Marshal Plutarch.Test.Run if flag(development) @@ -160,8 +168,11 @@ executable plutarch-test Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax + Plutarch.Test.Property + Plutarch.Test.Property.Extra Plutarch.Test.Property.Gen - Plutarch.Test.Property.Util + Plutarch.Test.Property.HaskEquiv + Plutarch.Test.Property.Marshal Plutarch.Test.Run Plutarch.TraceSpec Plutarch.UnitSpec From a9ed11e233624b2906131a0a53a6addb3baf3f6d Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Mar 2022 15:03:56 +0000 Subject: [PATCH 247/584] Implement `PlutusType` for `PData` --- Plutarch/Builtin.hs | 14 +++++++------- Plutarch/Prelude.hs | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 44c00e76c..34b659669 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -6,7 +6,7 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Builtin ( - PData (..), + PData, pfstBuiltin, psndBuiltin, pasConstr, @@ -172,12 +172,12 @@ instance PListLike PBuiltinList where instance (PLift a, PEq a) => PEq (PBuiltinList a) where (#==) xs ys = plistEquals # xs # ys -data PData s - = PDataConstr (Term s (PBuiltinPair PInteger (PBuiltinList PData))) - | PDataMap (Term s (PBuiltinList (PBuiltinPair PData PData))) - | PDataList (Term s (PBuiltinList PData)) - | PDataInteger (Term s PInteger) - | PDataByteString (Term s PByteString) +newtype PData (s :: S) = PData (Term s PData) + +instance PlutusType PData where + type PInner PData _ = PData + pcon' (PData t) = t + pmatch' t f = f (PData t) instance PUnsafeLiftDecl PData where type PLifted PData = Data deriving via (DerivePConstantDirect Data PData) instance (PConstant Data) diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 0b9125a19..dfa1de106 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -97,7 +97,7 @@ module Plutarch.Prelude ( PPair (..), -- * Builtin types and utilities - PData (..), + PData, pfstBuiltin, psndBuiltin, PBuiltinPair, From 0f3bebc727600dfaf5b0f7b3e5fb83fe93c49951 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Mar 2022 11:18:29 -0400 Subject: [PATCH 248/584] Remove unused generators, and un-export Gen.hs --- .../common/Plutarch/Test/Property/Gen.hs | 48 ++++--------------- .../Plutarch/Test/Property/HaskEquiv.hs | 2 +- .../plutarch-base/Plutarch/ListSpec.hs | 6 +-- .../plutarch-extra/Plutarch/ListUtilsSpec.hs | 4 +- plutarch-test/plutarch-test.cabal | 2 +- 5 files changed, 15 insertions(+), 47 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test/Property/Gen.hs b/plutarch-test/common/Plutarch/Test/Property/Gen.hs index 1b30b464a..88c34dd06 100644 --- a/plutarch-test/common/Plutarch/Test/Property/Gen.hs +++ b/plutarch-test/common/Plutarch/Test/Property/Gen.hs @@ -1,54 +1,22 @@ +-- | Generator helpers module Plutarch.Test.Property.Gen ( - rationalGen, - integerGen, + genRational, + genInteger, genList, - genNonEmpty, - genMaybe, - genPair, - genPair', - genPosInt, - genPosRat, - genPerm, ) where -import Control.Monad (MonadPlus, join, liftM2, mfilter) -import Data.List (sortOn) +import Control.Monad (MonadPlus, liftM2, mfilter) import Data.Ratio ((%)) import Hedgehog (MonadGen) - import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range -integerGen :: MonadGen g => g Integer -integerGen = Gen.integral (Range.linear (-1_000_000_000) 1_000_000_000) +genInteger :: MonadGen g => g Integer +genInteger = Gen.integral (Range.linear (-1_000_000_000) 1_000_000_000) -rationalGen :: (MonadPlus g, MonadGen g) => g Rational -rationalGen = liftM2 (%) integerGen (mfilter (/= 0) integerGen) +genRational :: (MonadPlus g, MonadGen g) => g Rational +genRational = liftM2 (%) genInteger (mfilter (/= 0) genInteger) genList :: MonadGen g => g a -> g [a] genList = Gen.list (Range.linear 0 100) - -genNonEmpty :: MonadGen g => g a -> g [a] -genNonEmpty = Gen.list (Range.linear 1 100) - -genMaybe :: MonadGen g => g a -> g (Maybe a) -genMaybe g = Gen.choice [pure Nothing, Just <$> g] - -genPair :: MonadGen g => g a -> g b -> g (a, b) -genPair = liftM2 (,) - -genPair' :: MonadGen g => g a -> g (a, a) -genPair' = join genPair - -genPosInt :: MonadGen g => g Integer -genPosInt = Gen.integral (Range.linear 1 1_000_000_000) - -genPosRat :: MonadGen g => g Rational -genPosRat = liftM2 (%) genPosInt genPosInt - -genPerm :: MonadGen g => [a] -> g [a] -genPerm xs = do - vs <- Gen.list (Range.singleton $ length xs) integerGen - let xs' = map snd $ sortOn fst $ zip vs xs - return xs' diff --git a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs index e4ded8679..848d17c79 100644 --- a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs +++ b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs @@ -118,7 +118,7 @@ instance @'TotalFun (reverse :: [Integer] -> [Integer]) preverse - (genList integerGen :* Nil) + (genList genInteger :* Nil) -} prop_haskEquiv :: forall (e :: Equality) (t :: Totality) h p. diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index 281720fea..df5cd60fc 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -12,7 +12,7 @@ import Hedgehog (Property) import Data.List (find) import Plutarch.Test.Property -import Plutarch.Test.Property.Gen (genList, integerGen) +import Plutarch.Test.Property.Gen (genInteger, genList) import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range @@ -105,7 +105,7 @@ findTest = @( 'TotalFun) (find @[] @Integer even) (pfind # peven) - (genList integerGen :* Nil) + (genList genInteger :* Nil) where peven :: Term s (PInteger :--> PBool) peven = plam $ \n -> pmod # n # 2 #== 0 @@ -118,7 +118,7 @@ elemAtTest = elemAt pelemAt $ Gen.integral (Range.linear (-10) 100) - :* Gen.list (Range.linear 0 100) integerGen + :* Gen.list (Range.linear 0 100) genInteger :* Nil elemAt :: Integer -> [Integer] -> Integer diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs index e880688e6..cb8ddcca6 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -9,7 +9,7 @@ import Plutarch.Test import Hedgehog (Property) import Plutarch.Test.Property -import Plutarch.Test.Property.Gen (genList, integerGen) +import Plutarch.Test.Property.Gen (genInteger, genList) import Plutarch.ListUtils (pcheckSorted, preverse) @@ -34,4 +34,4 @@ reverseTest = do @( 'TotalFun) (reverse :: [Integer] -> [Integer]) preverse - (genList integerGen :* Nil) + (genList genInteger :* Nil) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 15c54c536..25b787d2f 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -105,13 +105,13 @@ library exposed-modules: Plutarch.Test Plutarch.Test.Property - Plutarch.Test.Property.Gen other-modules: Plutarch.Test.Benchmark Plutarch.Test.Golden Plutarch.Test.ListSyntax Plutarch.Test.Property.Extra + Plutarch.Test.Property.Gen Plutarch.Test.Property.HaskEquiv Plutarch.Test.Property.Marshal Plutarch.Test.Run From 38c02575887c23f11bbda790b6f6f31fbca25b09 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 22 Mar 2022 11:26:37 -0400 Subject: [PATCH 249/584] Left inverse functions are always total --- plutarch-test/common/Plutarch/Test/Property/Extra.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test/Property/Extra.hs b/plutarch-test/common/Plutarch/Test/Property/Extra.hs index 9ca94607f..c0b9fe93c 100644 --- a/plutarch-test/common/Plutarch/Test/Property/Extra.hs +++ b/plutarch-test/common/Plutarch/Test/Property/Extra.hs @@ -29,19 +29,18 @@ import Plutarch.Test.Property.Marshal (Marshal) See https://en.wikipedia.org/wiki/Inverse_function#Left_inverses Like `prop_haskEquiv`, you want to call this with @TypeApplications@ - specifying the value of `e` and `t`. For example, + specifying the value of `e`. For example, >>> prop_leftInverse @'OnPEq - @'TotalFun mapJoin mapSplit $ mapOf (pairOf integer integer) rational -} prop_leftInverse :: - forall e t p p' h. + forall e p p' h. ( LamArgs h ~ '[] - , HaskEquiv e t (h -> h) (p :--> p) '[h] + , HaskEquiv e 'TotalFun (h -> h) (p :--> p) '[h] , Show h , Marshal h p ) => @@ -50,7 +49,7 @@ prop_leftInverse :: Gen h -> Property prop_leftInverse l r arg = - prop_haskEquiv @e @t (id @h) (plam $ \x -> l #$ r # x) (arg :* Nil) + prop_haskEquiv @e @( 'TotalFun) (id @h) (plam $ \x -> l #$ r # x) (arg :* Nil) {- | A Plutarch term that is a `PIsData` can be encoded to and decoded back to the @@ -69,7 +68,6 @@ prop_dataRoundTrip :: prop_dataRoundTrip = prop_leftInverse @( 'OnPEq) - @( 'TotalFun) @p @(PAsData p) @h From 91a090e59b005b62d9962f76735c84786a8fbacc Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Mar 2022 21:13:33 +0000 Subject: [PATCH 250/584] Add role to `PAsDataLifted` --- Plutarch/Builtin.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 34b659669..6d9f86243 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -172,7 +172,7 @@ instance PListLike PBuiltinList where instance (PLift a, PEq a) => PEq (PBuiltinList a) where (#==) xs ys = plistEquals # xs # ys -newtype PData (s :: S) = PData (Term s PData) +data PData (s :: S) = PData (Term s PData) instance PlutusType PData where type PInner PData _ = PData @@ -217,6 +217,7 @@ pdataLiteral = pconstant type role PAsData representational phantom data PAsData (a :: PType) (s :: S) +type role PAsDataLifted representational data PAsDataLifted (a :: PType) instance PConstant (PAsDataLifted a) where From a1bdaba0f20e02e9bd77869dc287220485a94474 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Mar 2022 21:14:08 +0000 Subject: [PATCH 251/584] Use `Const ()` instead of `HRecP '[]` in instance for `PTryFrom` for `PIsDataReprInstances` --- Plutarch/TryFrom.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 261df645a..860c328aa 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -348,11 +348,11 @@ instance ) => PTryFrom (PAsData (PIsDataReprInstances a)) PData where - type PTryFromExcess (PAsData (PIsDataReprInstances a)) PData = HRecP '[] + type PTryFromExcess (PAsData (PIsDataReprInstances a)) PData = Const () ptryFrom opq = runTermCont $ do let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) - pure $ (pdata $ punsafeFrom reprsum, HNil) + pure $ (pdata $ punsafeFrom reprsum, ()) ----------------------- DerivePNewtype insatace ----------------------------------------- From 065c8d06f844c00520d19d87606821e2955fee20 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Mar 2022 21:28:19 +0000 Subject: [PATCH 252/584] Revert "`Plutarch.TryFrom`: Switch around type parameters to help type applications" It messed with deriving. This reverts commit c37b7f35484845741c852ca328b53ec520fd21b6. --- Plutarch/TryFrom.hs | 141 +++++++++++++++++++++----------------------- 1 file changed, 67 insertions(+), 74 deletions(-) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 860c328aa..1a893ed80 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -5,6 +5,7 @@ module Plutarch.TryFrom ( PTryFrom (..), HRecP (..), + ptryFrom, ) where import Data.Proxy (Proxy (Proxy)) @@ -101,15 +102,18 @@ import Data.Kind (Type) representation is a `BuiltinList` containing any `PData` - all conversions are fallible, this happens if the representation doesn't match the expected type. - - the operation `ptryFrom @a @b` proves equality between the less expressive `PType` `a` and + - the operation `ptryFrom @b @a` proves equality between the less expressive `PType` `a` and the more expressive `PType` `b`, hence the first element of the resulting Tuple must always be wrapped in `PAsData` if the origin type was `PData` (see law 1) - the result type `b` must always be safe than the origin type `a`, i.e. it must carry more information -} -class PTryFrom (b :: PType) (a :: PType) where - type PTryFromExcess b a :: PType - ptryFrom :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess b a s)) -> Term s r) -> Term s r +class PTryFrom (a :: PType) (b :: PType) where + type PTryFromExcess a b :: PType + ptryFrom' :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r + +ptryFrom :: forall b a s r. PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r +ptryFrom = ptryFrom' ----------------------- Reducible and Flip ---------------------------------------------- @@ -130,26 +134,26 @@ instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRec (HRecPAppl ----------------------- PData instances ------------------------------------------------- -instance PTryFrom (PAsData PInteger) PData where - type PTryFromExcess (PAsData PInteger) PData = Flip Term PInteger - ptryFrom opq = runTermCont $ do +instance PTryFrom PData (PAsData PInteger) where + type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger + ptryFrom' opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) pure $ (punsafeCoerce opq, ver) -instance PTryFrom (PAsData PByteString) PData where - type PTryFromExcess (PAsData PByteString) PData = Flip Term PByteString - ptryFrom opq = runTermCont $ do +instance PTryFrom PData (PAsData PByteString) where + type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString + ptryFrom' opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) pure $ (punsafeCoerce opq, ver) instance - ( PTryFrom (PAsData a) PData - , PTryFrom (PAsData b) PData + ( PTryFrom PData (PAsData a) + , PTryFrom PData (PAsData b) ) => - PTryFrom (PAsData (PBuiltinMap a b)) PData + PTryFrom PData (PAsData (PBuiltinMap a b)) where - type PTryFromExcess (PAsData (PBuiltinMap a b)) PData = Flip Term (PBuiltinMap a b) - ptryFrom opq = runTermCont $ do + type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = Flip Term (PBuiltinMap a b) + ptryFrom' opq = runTermCont $ do verMap <- tcont $ plet (pasMap # opq) let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) verifyPair = plam $ \tup -> unTermCont $ do @@ -166,9 +170,9 @@ instance -} -- TODO: add the excess inner type list -instance PTryFrom (PAsData (PBuiltinList PData)) PData where - type PTryFromExcess (PAsData (PBuiltinList PData)) PData = Flip Term (PBuiltinList PData) - ptryFrom opq = runTermCont $ do +instance PTryFrom PData (PAsData (PBuiltinList PData)) where + type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) + ptryFrom' opq = runTermCont $ do ver <- tcont $ plet (pasList # opq) pure $ (punsafeCoerce opq, ver) @@ -176,13 +180,13 @@ instance PTryFrom (PAsData (PBuiltinList PData)) PData where Recover a `PBuiltinList (PAsData a)` -} instance - ( PTryFrom (PAsData a) PData + ( PTryFrom PData (PAsData a) , PIsData a ) => - PTryFrom (PAsData (PBuiltinList (PAsData a))) PData + PTryFrom PData (PAsData (PBuiltinList (PAsData a))) where - type PTryFromExcess (PAsData (PBuiltinList (PAsData a))) PData = Flip Term (PBuiltinList (PAsData a)) - ptryFrom opq = runTermCont $ do + type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = Flip Term (PBuiltinList (PAsData a)) + ptryFrom' opq = runTermCont $ do let lst :: Term _ (PBuiltinList PData) lst = pasList # opq verify :: Term _ (PData :--> PAsData a) @@ -197,17 +201,17 @@ instance Recover a `PAsData (PBuiltinPair a b)` -} instance - ( PTryFrom a PData + ( PTryFrom PData a , a ~ PAsData a' , PIsData a' - , PTryFrom b PData + , PTryFrom PData b , b ~ PAsData b' , PIsData b' ) => - PTryFrom (PAsData (PBuiltinPair a b)) PData + PTryFrom PData (PAsData (PBuiltinPair a b)) where - type PTryFromExcess (PAsData (PBuiltinPair a b)) PData = Flip Term (PBuiltinPair a b) - ptryFrom opq = runTermCont $ do + type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = Flip Term (PBuiltinPair a b) + ptryFrom' opq = runTermCont $ do tup <- tcont $ plet (pfromData $ punsafeCoerce opq) let fst' :: Term _ a fst' = unTermCont $ fst <$> tcont (ptryFrom @a $ pforgetData $ pfstBuiltin # tup) @@ -220,15 +224,15 @@ instance -- We could have a more advanced instance but it's not needed really. -newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess (PAsData a) PData s)) +newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) -instance Reducible (PTryFromExcess (PAsData a) PData s) => Reducible (ExcessForField a s) where - type Reduce (ExcessForField a s) = (Term s (PAsData a), Reduce (PTryFromExcess (PAsData a) PData s)) +instance Reducible (PTryFromExcess PData (PAsData a) s) => Reducible (ExcessForField a s) where + type Reduce (ExcessForField a s) = (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) -- FIXME: Should we always succede? If we always succede, performance would increase a lot. -instance PTryFrom (PDataRecord '[]) (PBuiltinList PData) where - type PTryFromExcess (PDataRecord '[]) (PBuiltinList PData) = HRecP '[] - ptryFrom opq = runTermCont $ do +instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where + type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] + ptryFrom' opq = runTermCont $ do _ :: Term _ PUnit <- tcont . plet . pforce $ pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") @@ -238,19 +242,19 @@ type family UnHRecP (x :: PType) :: [(Symbol, PType)] where UnHRecP (HRecP as) = as instance - ( PTryFrom (PAsData pty) PData - , PTryFrom (PDataRecord as) (PBuiltinList PData) - , PTryFromExcess (PDataRecord as) (PBuiltinList PData) ~ HRecP ase + ( PTryFrom PData (PAsData pty) + , PTryFrom (PBuiltinList PData) (PDataRecord as) + , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase ) => - PTryFrom (PDataRecord ((name ':= pty) ': as)) (PBuiltinList PData) + PTryFrom (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) where type - PTryFromExcess (PDataRecord ((name ':= pty) ': as)) (PBuiltinList PData) = + PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) = HRecP ( '(name, ExcessForField pty) - ': UnHRecP (PTryFromExcess (PDataRecord as) (PBuiltinList PData)) + ': UnHRecP (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) ) - ptryFrom opq = runTermCont $ do + ptryFrom' opq = runTermCont $ do h <- tcont $ plet $ phead # opq hv <- tcont $ ptryFrom @(PAsData pty) @PData h t <- tcont $ plet $ ptail # opq @@ -263,22 +267,22 @@ instance (Reducible (a s), Reducible (b s)) => Reducible (Helper a b s) where type Reduce (Helper a b s) = (Reduce (a s), Reduce (b s)) instance - ( PTryFrom (PDataRecord as) (PBuiltinList PData) - , PTryFromExcess (PDataRecord as) (PBuiltinList PData) ~ HRecP ase + ( PTryFrom (PBuiltinList PData) (PDataRecord as) + , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase ) => - PTryFrom (PAsData (PDataRecord as)) PData + PTryFrom PData (PAsData (PDataRecord as)) where type - PTryFromExcess (PAsData (PDataRecord as)) PData = - Helper (Flip Term (PDataRecord as)) (PTryFromExcess (PDataRecord as) (PBuiltinList PData)) - ptryFrom opq = runTermCont $ do + PTryFromExcess PData (PAsData (PDataRecord as)) = + Helper (Flip Term (PDataRecord as)) (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) + ptryFrom' opq = runTermCont $ do l <- snd <$> (tcont $ ptryFrom @(PAsData (PBuiltinList PData)) opq) r <- tcont $ ptryFrom @(PDataRecord as) l pure (punsafeCoerce opq, r) -instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom (PAsData (PDataSum ys)) PData where - type PTryFromExcess (PAsData (PDataSum ys)) PData = Const () - ptryFrom opq = runTermCont $ do +instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where + type PTryFromExcess PData (PAsData (PDataSum ys)) = Const () + ptryFrom' opq = runTermCont $ do x <- tcont $ plet $ pasConstr # opq constr <- tcont $ plet $ pfstBuiltin # x fields <- tcont $ plet $ psndBuiltin # x @@ -291,7 +295,7 @@ class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where instance {-# OVERLAPPABLE #-} forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). - ( PTryFrom (PDataRecord x) (PBuiltinList PData) + ( PTryFrom (PBuiltinList PData) (PDataRecord x) , SumValidation (n + 1) xs , KnownNat n ) => @@ -315,28 +319,24 @@ instance {-# OVERLAPPING #-} SumValidation n '[] where unwrapped, then there is also the possibility to recover the whole thing but wrapped -} instance - ( PTryFrom b a + ( PTryFrom a b , PIsData a , PIsData b ) => - PTryFrom (PAsData b) (PAsData a) + PTryFrom (PAsData a) (PAsData b) where - type PTryFromExcess (PAsData b) (PAsData a) = PTryFromExcess b a - ptryFrom opq = runTermCont $ do + type PTryFromExcess (PAsData a) (PAsData b) = PTryFromExcess a b + ptryFrom' opq = runTermCont $ do ver' <- snd <$> TermCont (ptryFrom @b @a (pfromData opq)) pure $ (punsafeCoerce opq, ver') instance PTryFrom PData PData where type PTryFromExcess PData PData = Const () - ptryFrom opq = runTermCont $ pure $ (opq, ()) + ptryFrom' opq = runTermCont $ pure $ (opq, ()) instance PTryFrom PData (PAsData PData) where type PTryFromExcess PData (PAsData PData) = Const () - ptryFrom opq = runTermCont $ pure (pfromData opq, ()) - -instance PTryFrom (PAsData PData) PData where - type PTryFromExcess (PAsData PData) PData = Const () - ptryFrom opq = runTermCont $ pure (pdata opq, ()) + ptryFrom' opq = runTermCont $ pure (pdata opq, ()) ----------------------- PIsDataReprInstances instance ----------------------------------- @@ -346,10 +346,10 @@ instance , SumValidation 0 (PIsDataReprRepr a) , PInner a b ~ PDataSum (PIsDataReprRepr a) ) => - PTryFrom (PAsData (PIsDataReprInstances a)) PData + PTryFrom PData (PAsData (PIsDataReprInstances a)) where - type PTryFromExcess (PAsData (PIsDataReprInstances a)) PData = Const () - ptryFrom opq = runTermCont $ do + type PTryFromExcess PData (PAsData (PIsDataReprInstances a)) = Const () + ptryFrom' opq = runTermCont $ do let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) pure $ (pdata $ punsafeFrom reprsum, ()) @@ -357,16 +357,9 @@ instance ----------------------- DerivePNewtype insatace ----------------------------------------- instance - ( PTryFrom b a + ( PTryFrom a b ) => - PTryFrom (DerivePNewtype c b) a + PTryFrom a (DerivePNewtype c b) where - type PTryFromExcess (DerivePNewtype c b) a = PTryFromExcess b a - ptryFrom opq = runTermCont $ (\(inn, exc) -> (punsafeFrom inn, exc)) <$> tcont (ptryFrom @b @a opq) - ------------------------ HasField instance ----------------------------------------------- - -{- -instance (ElemOf name ptyp rec, Reduce (ptyp s) ~ out) => HasField name (HRecP rec s) out where - getField = getExcessField @name --} + type PTryFromExcess a (DerivePNewtype c b) = PTryFromExcess a b + ptryFrom' opq = runTermCont $ (\(inn, exc) -> (punsafeFrom inn, exc)) <$> tcont (ptryFrom @b @a opq) From f938d012c6009491570373a1baaf54b52b8348d3 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Mar 2022 23:04:44 +0000 Subject: [PATCH 253/584] Add `HRecGeneric` --- Plutarch/DataRepr/Internal/HList.hs | 15 +++++++++++++++ Plutarch/TryFrom.hs | 12 +++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Plutarch/DataRepr/Internal/HList.hs b/Plutarch/DataRepr/Internal/HList.hs index c7d3c9f19..d32dd1647 100644 --- a/Plutarch/DataRepr/Internal/HList.hs +++ b/Plutarch/DataRepr/Internal/HList.hs @@ -5,10 +5,12 @@ module Plutarch.DataRepr.Internal.HList ( -- * HRec and Label types HRec (HNil, HCons), + HRecGeneric (HRecGeneric), Labeled (Labeled, unLabeled), -- * Field indexing functions hrecField, + hrecField', -- * Type families type IndexList, @@ -135,3 +137,16 @@ instance HasField name (HRec as) (Term s c) where getField = hrecField @name + +-- Generic HRec + +newtype HRecGeneric as = HRecGeneric (HRec as) + +instance + forall name a as. + ( (IndexLabel name as ~ a) + , ElemOf name a as + ) => + HasField name (HRecGeneric as) a + where + getField (HRecGeneric x) = hrecField' @name x diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 1a893ed80..a9af6cb2e 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -38,7 +38,7 @@ import Plutarch.Internal.Other ( import Plutarch.Trace (ptraceError) -import Plutarch.DataRepr.Internal.HList (HRec (HCons, HNil), Labeled (Labeled)) +import Plutarch.DataRepr.Internal.HList (HRec (HCons, HNil), HRecGeneric (HRecGeneric), Labeled (Labeled)) import Plutarch.DataRepr.Internal ( PDataRecord, @@ -83,6 +83,8 @@ import Data.Functor.Const (Const) import Data.Kind (Type) +import Data.Coerce (coerce) + ----------------------- The class PTryFrom ---------------------------------------------- {- | @@ -128,9 +130,9 @@ type family HRecPApply (as :: [(Symbol, PType)]) (s :: S) :: [Type] where HRecPApply ('(name, ty) ': rest) s = Labeled name (Reduce (ty s)) ': HRecPApply rest s HRecPApply '[] s = '[] -newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (HRec (HRecPApply as s)) +newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (HRecGeneric (HRecPApply as s)) -instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRec (HRecPApply as s) +instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecGeneric (HRecPApply as s) ----------------------- PData instances ------------------------------------------------- @@ -236,7 +238,7 @@ instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where _ :: Term _ PUnit <- tcont . plet . pforce $ pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") - pure (pdnil, HNil) + pure (pdnil, HRecGeneric HNil) type family UnHRecP (x :: PType) :: [(Symbol, PType)] where UnHRecP (HRecP as) = as @@ -259,7 +261,7 @@ instance hv <- tcont $ ptryFrom @(PAsData pty) @PData h t <- tcont $ plet $ ptail # opq tv <- tcont $ ptryFrom @(PDataRecord as) @(PBuiltinList PData) t - pure (punsafeCoerce opq, HCons (Labeled hv) (snd tv)) + pure (punsafeCoerce opq, HRecGeneric (HCons (Labeled hv) (coerce $ snd tv))) newtype Helper a b s = Helper (a s, b s) From 13e8adcfeeda55d7eb66b5111369f2c5c829e4c7 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 22 Mar 2022 23:11:48 +0000 Subject: [PATCH 254/584] Fix tests --- .../conditional/Plutarch/TryFromSpec.hs | 103 ++++-------------- .../api.example2.Map examples.bench.golden | 3 - ...api.example2.Map examples.uplc.eval.golden | 3 - .../api.example2.Map examples.uplc.golden | 3 - .../plutarch-base/Plutarch/ApiSpec.hs | 7 -- 5 files changed, 23 insertions(+), 96 deletions(-) delete mode 100644 plutarch-test/goldens/api.example2.Map examples.bench.golden delete mode 100644 plutarch-test/goldens/api.example2.Map examples.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example2.Map examples.uplc.golden diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index ca392b12a..ca7a1df0d 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -22,16 +22,10 @@ import Plutus.V1.Ledger.Api ( TxOut (TxOut, txOutAddress, txOutDatumHash, txOutValue), ) -import Plutus.V1.Ledger.Value (Value) -import qualified Plutus.V1.Ledger.Value as Value - import PlutusTx ( Data (B, Constr, I), ) -import PlutusTx.AssocMap (Map) -import qualified PlutusTx.AssocMap as PlutusMap - -- Plutarch imports import Plutarch.Prelude @@ -54,21 +48,17 @@ import Plutarch.Unsafe ( import Plutarch.Api.V1 ( PAddress, - PCurrencySymbol, PDatum, PDatumHash, - PMap, PMaybeData (PDJust), PScriptContext, PScriptPurpose (PSpending), - PTokenName, PTuple, PTxInInfo, PTxInfo, PTxOut, PTxOutRef, PValidator, - PValue, ) import Plutarch.Builtin ( @@ -78,16 +68,21 @@ import Plutarch.Builtin ( ) import Plutarch.TryFrom ( - Flip, - PTryFrom (PTryFromExcess, ptryFrom), - ptryFromData, + PTryFrom, + PTryFromExcess, + ptryFrom, + ptryFrom', ) +import Plutarch.Reducible (Reduce, Reducible) + import Plutarch.ApiSpec (info, purpose) import qualified Plutarch.ApiSpec as Api import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) +import GHC.Records (getField) + spec :: Spec spec = do describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do @@ -170,7 +165,7 @@ spec = do (punsafeCoerce $ pconstant $ Constr 1 [PlutusTx.I 5, B "foo"]) @-> psucceeds "recover PWrapInt" - @| pconstant 42 #== (unTermCont $ snd <$> tcont (ptryFromData @(PAsData PWrapInt) (pforgetData $ pdata $ pconstant @PInteger 42))) + @| pconstant 42 #== (unTermCont $ snd <$> tcont (ptryFrom @(PAsData PWrapInt) (pforgetData $ pdata $ pconstant @PInteger 42))) @-> passert "recovering a record partially vs completely" @\ do "partially" @@ -236,45 +231,6 @@ spec = do @-> pfails "sample usage contains the right value" @| pconstant 42 #== theField @-> passert - "checking PValue and PMap for validity" @\ do - "PMap" @\ do - let ms0 :: Term _ (PBuiltinMap PInteger PUnit) - ms0 = - pcons - # (ppairDataBuiltin # (pdata $ pconstant 1) # (pdata $ pcon PUnit)) #$ pcons - # (ppairDataBuiltin # (pdata $ pconstant 2) # (pdata $ pcon PUnit)) #$ pcons - # (ppairDataBuiltin # (pdata $ pconstant 42) # (pdata $ pcon PUnit)) - # pnil - mf1 :: Term _ (PBuiltinMap PInteger PUnit) - mf1 = - pcons - # (ppairDataBuiltin # (pdata $ pconstant 1) # (pdata $ pcon PUnit)) #$ pcons - # (ppairDataBuiltin # (pdata $ pconstant 1) # (pdata $ pcon PUnit)) #$ pcons - # (ppairDataBuiltin # (pdata $ pconstant 42) # (pdata $ pcon PUnit)) - # pnil - mf2 :: Term _ (PBuiltinMap PInteger PUnit) - mf2 = - pcons - # (ppairDataBuiltin # (pdata $ pconstant 1) # (pdata $ pcon PUnit)) #$ pcons - # (ppairDataBuiltin # (pdata $ pconstant 2) # (pdata $ pcon PUnit)) #$ pcons - # (ppairDataBuiltin # (pdata $ pconstant 3) # (pdata $ pcon PUnit)) #$ pcons - # (ppairDataBuiltin # (pdata $ pconstant 2) # (pdata $ pcon PUnit)) - # pnil - "valid0" - @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) ms0)) @-> psucceeds - "invalid1" - @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) mf1)) @-> pfails - "invalid2" - @| (unTermCont $ fst <$> TermCont (ptryFrom @_ @(PMap PInteger PUnit) mf2)) @-> pfails - "PValue" @\ do - let legalValue0 :: Value - legalValue0 = Value.singleton "c0" "someToken" 1 - illegalValue1 :: Map Value.CurrencySymbol (Map Value.TokenName Integer) - illegalValue1 = PlutusMap.fromList [("c0", PlutusMap.fromList [("someToken", 1), ("someOtherToken", 0)])] - "valid0" - @| (unTermCont $ fst <$> TermCont (ptryFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ punsafeCoerce $ pconstant $ legalValue0)) @-> psucceeds - "invalid1" - @| (unTermCont $ fst <$> TermCont (ptryFrom @(PMap PCurrencySymbol (PMap PTokenName PInteger)) @PValue $ pconstant $ illegalValue1)) @-> pfails "example" @\ do let validContext0 = ctx validOutputs0 validList1 invalidContext1 = ctx invalidOutputs1 validList1 @@ -308,7 +264,7 @@ checkDeep :: ) => ClosedTerm (PAsData actual) -> ClosedTerm (PAsData target) -checkDeep t = unTermCont $ fst <$> TermCont (ptryFromData @(PAsData target) $ pforgetData t) +checkDeep t = unTermCont $ fst <$> TermCont (ptryFrom @(PAsData target) $ pforgetData t) checkDeepUnwrap :: forall (target :: PType) (actual :: PType) (s :: S). @@ -318,7 +274,7 @@ checkDeepUnwrap :: ) => Term s (PAsData actual) -> Term s (PAsData target) -checkDeepUnwrap t = unTermCont $ fst <$> TermCont (ptryFromData @(PAsData target) @s $ pforgetData t) +checkDeepUnwrap t = unTermCont $ fst <$> TermCont (ptryFrom @(PAsData target) $ pforgetData t) sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1 .. 100] @@ -342,17 +298,22 @@ newtype PNatural (s :: S) = PMkNatural (Term s PInteger) pmkNatural :: Term s (PInteger :--> PNatural) pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) +newtype Flip f b a = Flip (f a b) + +instance Reducible (f a b) => Reducible (Flip f b a) where + type Reduce (Flip f b a) = Reduce (f a b) + instance PTryFrom PData (PAsData PNatural) where type PTryFromExcess PData (PAsData PNatural) = Flip Term PNatural - ptryFrom opq = runTermCont $ do - (ter, exc) <- TermCont $ ptryFromData @(PAsData PInteger) opq + ptryFrom' opq = runTermCont $ do + (ter, exc) <- TermCont $ ptryFrom @(PAsData PInteger) opq ver <- tcont $ plet $ pmkNatural #$ exc pure $ (punsafeCoerce ter, ver) validator :: Term s PValidator validator = phoistAcyclic $ plam $ \dat red ctx -> unTermCont $ do - trustedRedeemer <- (\(snd -> red) -> red) <$> (TermCont $ ptryFromData @(PAsData (PBuiltinList (PAsData PNatural))) red) + trustedRedeemer <- (\(snd -> red) -> red) <$> (TermCont $ ptryFrom @(PAsData (PBuiltinList (PAsData PNatural))) red) let trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) trustedDatum = pfromData $ punsafeCoerce dat -- make the Datum and Redeemer trusted @@ -428,24 +389,6 @@ pfindOwnInput = phoistAcyclic $ (pfield @"id" # target) #== (pfield @"id" #$ pfield @"outRef" # pfromData actual) pure $ pfind # pred # txInInfos -{- | - can be safely removed after - https://github.com/Plutonomicon/plutarch/pull/274 - has been merged --} -pfind :: (PIsListLike l a) => Term s ((a :--> PBool) :--> l a :--> PMaybe a) -pfind = phoistAcyclic $ - pfix #$ plam $ \self f xs -> - pelimList - ( \y ys -> - pif - (f # y) - (pcon $ PJust y) - (self # f # ys) - ) - (pcon PNothing) - xs - ------------------- Mocking a ScriptContext ---------------------------------------- ctx :: [TxOut] -> [(DatumHash, Datum)] -> Term s PScriptContext @@ -502,12 +445,12 @@ toDatadList = pdata . (foldr go pnil) mapTestSucceeds :: ClosedTerm (PAsData (PBuiltinMap PByteString PInteger)) mapTestSucceeds = unTermCont $ do - (val, _) <- TermCont $ ptryFromData $ pforgetData sampleMap + (val, _) <- TermCont $ ptryFrom $ pforgetData sampleMap pure val mapTestFails :: ClosedTerm (PAsData (PBuiltinMap PInteger PInteger)) mapTestFails = unTermCont $ do - (val, _) <- TermCont $ ptryFromData $ pforgetData sampleMap + (val, _) <- TermCont $ ptryFrom $ pforgetData sampleMap pure val sampleMap :: Term _ (PAsData (PBuiltinMap PByteString PInteger)) @@ -552,8 +495,8 @@ untrustedRecord = theField :: Term s PInteger theField = unTermCont $ do - (_, exc) <- tcont (ptryFrom @_ @(PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) untrustedRecord) - pure $ exc._0._1 + (_, exc) <- tcont (ptryFrom @(PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) untrustedRecord) + pure $ snd . getField @"_1" . snd . snd . getField @"_0" . snd $ exc ------------------- Sample usage DerivePNewType ------------------------------------ diff --git a/plutarch-test/goldens/api.example2.Map examples.bench.golden b/plutarch-test/goldens/api.example2.Map examples.bench.golden deleted file mode 100644 index f8fffa304..000000000 --- a/plutarch-test/goldens/api.example2.Map examples.bench.golden +++ /dev/null @@ -1,3 +0,0 @@ -sorted0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":29} -sorted1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":19} -unsorted2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":29} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example2.Map examples.uplc.eval.golden b/plutarch-test/goldens/api.example2.Map examples.uplc.eval.golden deleted file mode 100644 index 5d84225a2..000000000 --- a/plutarch-test/goldens/api.example2.Map examples.uplc.eval.golden +++ /dev/null @@ -1,3 +0,0 @@ -sorted0 (program 1.0.0 [(#03, #182a), (#04, #182a)]) -sorted1 (program 1.0.0 [(#03, #182a)]) -unsorted2 (program 1.0.0 [(#01, #182a), (#02, #182a)]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example2.Map examples.uplc.golden b/plutarch-test/goldens/api.example2.Map examples.uplc.golden deleted file mode 100644 index 5d84225a2..000000000 --- a/plutarch-test/goldens/api.example2.Map examples.uplc.golden +++ /dev/null @@ -1,3 +0,0 @@ -sorted0 (program 1.0.0 [(#03, #182a), (#04, #182a)]) -sorted1 (program 1.0.0 [(#03, #182a)]) -unsorted2 (program 1.0.0 [(#01, #182a), (#02, #182a)]) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 0dc6da04d..6ad37fd5b 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -4,7 +4,6 @@ import Test.Syd import Test.Tasty.HUnit import Control.Monad.Trans.Cont (cont, runCont) -import qualified Data.Map as Map import Plutus.V1.Ledger.Api import qualified Plutus.V1.Ledger.Interval as Interval import qualified Plutus.V1.Ledger.Value as Value @@ -19,7 +18,6 @@ import Plutarch.Api.V1 ( PTxInInfo, PTxInfo, PValue, - pmkPMap, ) import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude @@ -63,11 +61,6 @@ spec = do "fails" @| checkSignatoryTermCont # pconstant "41" # ctx @-> pfails describe "getFields" . pgoldenSpec $ do "0" @| getFields - describe "example2" $ do - describe "Map examples" . pgoldenSpec $ do - "sorted0" @| pmkPMap @Integer @Integer (Map.fromList [(3, 42), (4, 42)]) @-> psucceeds - "sorted1" @| pmkPMap @Integer @Integer (Map.fromList [(3, 42), (3, 42)]) @-> psucceeds - "unsorted2" @| pmkPMap @Integer @Integer (Map.fromList [(2, 42), (1, 42)]) @-> psucceeds -------------------------------------------------------------------------------- From 36eff8c068c637c55505f24817356393f18e6ce3 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 23 Mar 2022 10:44:22 +0000 Subject: [PATCH 255/584] Generalize `Reducible` to any kind --- Plutarch/Reducible.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Plutarch/Reducible.hs b/Plutarch/Reducible.hs index 65ba7765c..70f28dd7c 100644 --- a/Plutarch/Reducible.hs +++ b/Plutarch/Reducible.hs @@ -4,10 +4,9 @@ module Plutarch.Reducible (Reducible (Reduce)) where import Data.Coerce (Coercible) import Data.Functor.Const (Const (Const)) import Data.Functor.Identity (Identity (Identity)) -import Data.Kind (Type) -class (Coercible (Reduce x) x) => Reducible (x :: Type) where - type Reduce x :: Type +class (Coercible (Reduce x) x) => Reducible (x :: k) where + type Reduce x :: k instance Reducible () where type Reduce () = () From 44663ce4569b8c2023590f1d56241f402a3a1a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 16 Mar 2022 16:05:34 -0400 Subject: [PATCH 256/584] FFI documentation in the guide --- docs/README.md | 1 + docs/Usage/FFI.md | 29 ++ plutarch-test/conditional/Plutarch/FFISpec.hs | 302 +++++++++--------- 3 files changed, 182 insertions(+), 150 deletions(-) create mode 100644 docs/Usage/FFI.md diff --git a/docs/README.md b/docs/README.md index afe8c3cf5..dc82ac11a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -62,6 +62,7 @@ The [Usage section](./Usage.md) fills in the gaps left by the previous. It illus - [Tracing](./Usage/Tracing.md) - [Raising errors](./Usage/Raising%20errors.md) - [Unsafe functions](./Usage/Unsafe%20functions.md) +- [Interoperability with PlutusTx](./Usage/FFI.md) ## Concepts diff --git a/docs/Usage/FFI.md b/docs/Usage/FFI.md new file mode 100644 index 000000000..61ec1c54c --- /dev/null +++ b/docs/Usage/FFI.md @@ -0,0 +1,29 @@ +# Interoperability with PlutusTx + +If you already have a codebase built using PlutusTx, you can choose to +re-write only its critical parts in Plutarch and to call them from +PlutusTx. The function to use is `Plutarch.FFI.foreignExport`: + +```haskell +doubleInPlutarch :: Term s (PInteger -> PInteger) +doubleInPlutarch = plam (2 *) + +doubleExported :: PlutusTx.CompiledCode (Integer -> Integer) +doubleExported = foreignExport doubleInPlutarch + +doubleUseInPlutusTx :: PlutusTx.CompiledCode Integer +doubleUseInPlutusTx = doubleExported `PlutusTx.applyCode` PlutusTx.liftCode 21 +``` + +Alternatively, you may go in the opposite direction and call an existing PlutusTx function from Plutarch using `Plutarch.FFI.foreignImport`: + +```haskell +doubleInPlutusTx :: CompiledCode (Integer -> Integer) +doubleInPlutusTx = $$(PlutusTx.compile [||(2 *) :: Integer -> Integer||]) + +doubleImported :: Term s (PInteger :--> PInteger) +doubleImported = foreignImport doubleInPlutusTx + +doubleUseInPlutarch :: Term s PInteger +doubleUseInPlutarch = doubleImported # 21 +``` diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index c2d05b8e1..1a48f0807 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -89,14 +89,17 @@ printEvaluatedTerm s = fmap printScript . fstOf3 . evalScript $ compile s fstOf3 :: (a, _, _) -> a fstOf3 (x, _, _) = x -double :: CompiledCode (Integer -> Integer) -double = $$(PlutusTx.compile [||(2 *) :: Integer -> Integer||]) +doubleInPlutusTx :: CompiledCode (Integer -> Integer) +doubleInPlutusTx = $$(PlutusTx.compile [||(2 *) :: Integer -> Integer||]) + +doubleInPlutarch :: Term s (PInteger :--> PInteger) +doubleInPlutarch = plam (2 Prelude.*) doubleImported :: Term s (PInteger :--> PInteger) -doubleImported = foreignImport double +doubleImported = foreignImport doubleInPlutusTx -doubleExported :: CompiledCode (Integer -> Integer) -doubleExported = foreignExport (plam $ \(x :: Term _ PInteger) -> 2 Prelude.* x) +doubleExported :: PlutusTx.CompiledCode (Integer -> Integer) +doubleExported = foreignExport doubleInPlutarch data SampleRecord = SampleRecord { sampleBool :: BuiltinBool @@ -223,156 +226,155 @@ signatories = ["ab01fe235c", "123014", "abcdef"] -} spec :: Spec spec = do - describe "Test.PlutarchFFI" $ do - describe "Simple types" $ do - it "integer literal" $ - printCode $$(PlutusTx.compile [||42 :: Integer||]) @?= "(program 1.0.0 42)" - it "PlutusTx integer function" $ - printCode double @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" - it "Plutarch integer function" $ - printTerm (plam $ \(x :: Term _ PInteger) -> 2 Prelude.* x) @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" - it "Imported PlutusTx integer function" $ - printTerm doubleImported @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" - it "Exported Plutarch integer function" $ - printCode doubleExported @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" - it "Imported and applied PlutusTx integer function" $ - printTerm (plam $ \n -> doubleImported #$ doubleImported # n) - @?= "(program 1.0.0 (\\i0 -> (\\i0 -> multiplyInteger 2 i1) (multiplyInteger 2 i1)))" - it "Exported and applied Plutarch integer function" $ - printCode (doubleExported `applyCode` $$(PlutusTx.compile [||21 :: Integer||])) - @?= "(program 1.0.0 ((\\i0 -> multiplyInteger 2 i1) 21))" - it "Bool->Integer in Plutarch" $ - printShrunkTerm (plam $ \x -> pif x (1 :: Term _ PInteger) 0) - @?= "(program 1.0.0 (\\i0 -> force (force ifThenElse i1 (delay 1) (delay 0))))" - it "Bool->Integer in PlutusTx" $ - printShrunkCode $$(PlutusTx.compile [||\x -> if x then 1 :: Integer else 0||]) - @?= "(program 1.0.0 (\\i0 -> force i1 1 0))" - it "newtype in PlutusTx" $ - printShrunkCode $$(PlutusTx.compile [||PubKeyHash||]) @?= "(program 1.0.0 (\\i0 -> i1))" - it "export unit to PlutusTx" $ - printShrunkCode (foreignExport (pconstant ()) :: CompiledCode BuiltinUnit) @?= "(program 1.0.0 ())" - it "import unit from PlutusTx" $ - printShrunkTerm (foreignImport $$(PlutusTx.compile [||toBuiltin ()||]) :: ClosedTerm PUnit) @?= "(program 1.0.0 ())" - describe "Opaque" $ do - it "Export an integer and ignore it" $ - printCode ($$(PlutusTx.compile [||const (7 :: Integer)||]) `applyCode` opaqueExport (4 :: ClosedTerm PInteger)) - @?= "(program 1.0.0 ((\\i0 -> 7) 4))" - it "Import an integer and ignore it" $ - printTerm (plam (\_ -> 4 :: ClosedTerm PInteger) # opaqueImport (PlutusTx.liftCode (7 :: Integer))) - @?= "(program 1.0.0 ((\\i0 -> 4) 7))" - describe "Records" $ do - it "PlutusTx record value" $ - printShrunkCode $$(PlutusTx.compile [||SampleRecord (toBuiltin False) 6 "Hello"||]) @?= sampleScottEncoding - it "Plutarch record value" $ - printTerm (pdelay $ Rec.rcon $ PSampleRecord (pcon PFalse) 6 "Hello") @?= sampleScottEncoding - it "PlutusTx record function" $ - printShrunkCode $$(PlutusTx.compile [||sampleInt||]) @?= sampleScottField - it "Plutarch record function" $ - printTerm (plam $ \r -> pforce r # Rec.field psampleInt) @?= sampleScottField - it "Apply PlutusTx record function in Plutarch" $ - printShrunkTerm (importedField #$ pdelay $ pcon $ Rec.PRecord $ PSampleRecord (pcon PFalse) 6 "Hello") @?= "(program 1.0.0 6)" - it "Apply Plutarch record function in PlutusTx" $ - printShrunkCode (exportedField `applyCode` $$(PlutusTx.compile [||SampleRecord (toBuiltin False) 6 "Hello"||])) - @?= "(program 1.0.0 6)" - it "import a pair" $ - printEvaluatedTerm - ( foreignImport (PlutusTx.liftCode ("foo" :: BuiltinString, 4 :: Integer)) :: - Term _ (PDelayed (PPair PString PInteger)) - ) - @?= Right "(program 1.0.0 (delay (\\i0 -> i1 \"foo\" 4)))" - it "import a pair" $ - printEvaluatedTerm - ( foreignImport (PlutusTx.liftCode ("foo" :: Value.TokenName, 4 :: Integer)) :: - Term _ (PDelayed (PPair PTokenName PInteger)) - ) - @?= Right "(program 1.0.0 (delay (\\i0 -> i1 #666f6f 4)))" - describe "Maybe" $ do - it "a PlutusTx Just Integer" $ - printShrunkCode (PlutusTx.liftCode (Just 4 :: Maybe Integer)) @?= justFour - it "a converted Plutarch PJust PInteger" $ - printShrunkTerm (pmaybeToTx # (pcon (PJust 4) :: Term _ (PMaybe PInteger))) @?= justFour - it "a Plutarch PTxJust PInteger" $ - printTerm (pcon (PTxJust 4) :: Term _ (PTxMaybe PInteger)) @?= justFour - it "a converted Plutarch PTxJust PInteger" $ - printShrunkTerm (pmaybeFromTx # (pcon $ PTxJust 4) :: Term _ (PMaybe PInteger)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> i2 4))" - it "a PlutusTx Nothing" $ - printShrunkCode (PlutusTx.liftCode (Nothing :: Maybe Integer)) @?= nothing - it "a converted Plutarch PNothing" $ - printShrunkTerm (pmaybeToTx # (pcon PNothing :: Term _ (PMaybe PInteger))) @?= nothing - it "a Plutarch PTxNothing" $ - printTerm (pcon PTxNothing :: Term _ (PTxMaybe PInteger)) @?= nothing - it "a converted Plutarch PTxNothing" $ - printShrunkTerm (pmaybeFromTx # (pcon PTxNothing) :: Term _ (PMaybe PInteger)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> force i1))" - it "import a Just Integer" $ - printEvaluatedTerm (foreignImport (PlutusTx.liftCode (Just 4 :: Maybe Integer)) :: Term _ (PTxMaybe PInteger)) @?= Right justFour - it "export a PTxJust PInteger" $ + describe "Simple types" $ do + it "integer literal" $ + printCode $$(PlutusTx.compile [||42 :: Integer||]) @?= "(program 1.0.0 42)" + it "PlutusTx integer function" $ + printCode doubleInPlutusTx @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Plutarch integer function" $ + printTerm (plam $ \(x :: Term _ PInteger) -> 2 Prelude.* x) @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Imported PlutusTx integer function" $ + printTerm doubleImported @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Exported Plutarch integer function" $ + printCode doubleExported @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Imported and applied PlutusTx integer function" $ + printTerm (plam $ \n -> doubleImported #$ doubleImported # n) + @?= "(program 1.0.0 (\\i0 -> (\\i0 -> multiplyInteger 2 i1) (multiplyInteger 2 i1)))" + it "Exported and applied Plutarch integer function" $ + printCode (doubleExported `applyCode` PlutusTx.liftCode (21 :: Integer)) + @?= "(program 1.0.0 ((\\i0 -> multiplyInteger 2 i1) 21))" + it "Bool->Integer in Plutarch" $ + printShrunkTerm (plam $ \x -> pif x (1 :: Term _ PInteger) 0) + @?= "(program 1.0.0 (\\i0 -> force (force ifThenElse i1 (delay 1) (delay 0))))" + it "Bool->Integer in PlutusTx" $ + printShrunkCode $$(PlutusTx.compile [||\x -> if x then 1 :: Integer else 0||]) + @?= "(program 1.0.0 (\\i0 -> force i1 1 0))" + it "newtype in PlutusTx" $ + printShrunkCode $$(PlutusTx.compile [||PubKeyHash||]) @?= "(program 1.0.0 (\\i0 -> i1))" + it "export unit to PlutusTx" $ + printShrunkCode (foreignExport (pconstant ()) :: CompiledCode BuiltinUnit) @?= "(program 1.0.0 ())" + it "import unit from PlutusTx" $ + printShrunkTerm (foreignImport $$(PlutusTx.compile [||toBuiltin ()||]) :: ClosedTerm PUnit) @?= "(program 1.0.0 ())" + describe "Opaque" $ do + it "Export an integer and ignore it" $ + printCode ($$(PlutusTx.compile [||const (7 :: Integer)||]) `applyCode` opaqueExport (4 :: ClosedTerm PInteger)) + @?= "(program 1.0.0 ((\\i0 -> 7) 4))" + it "Import an integer and ignore it" $ + printTerm (plam (\_ -> 4 :: ClosedTerm PInteger) # opaqueImport (PlutusTx.liftCode (7 :: Integer))) + @?= "(program 1.0.0 ((\\i0 -> 4) 7))" + describe "Records" $ do + it "PlutusTx record value" $ + printShrunkCode $$(PlutusTx.compile [||SampleRecord (toBuiltin False) 6 "Hello"||]) @?= sampleScottEncoding + it "Plutarch record value" $ + printTerm (pdelay $ Rec.rcon $ PSampleRecord (pcon PFalse) 6 "Hello") @?= sampleScottEncoding + it "PlutusTx record function" $ + printShrunkCode $$(PlutusTx.compile [||sampleInt||]) @?= sampleScottField + it "Plutarch record function" $ + printTerm (plam $ \r -> pforce r # Rec.field psampleInt) @?= sampleScottField + it "Apply PlutusTx record function in Plutarch" $ + printShrunkTerm (importedField #$ pdelay $ pcon $ Rec.PRecord $ PSampleRecord (pcon PFalse) 6 "Hello") @?= "(program 1.0.0 6)" + it "Apply Plutarch record function in PlutusTx" $ + printShrunkCode (exportedField `applyCode` $$(PlutusTx.compile [||SampleRecord (toBuiltin False) 6 "Hello"||])) + @?= "(program 1.0.0 6)" + it "import a pair" $ + printEvaluatedTerm + ( foreignImport (PlutusTx.liftCode ("foo" :: BuiltinString, 4 :: Integer)) :: + Term _ (PDelayed (PPair PString PInteger)) + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> i1 \"foo\" 4)))" + it "import a pair" $ + printEvaluatedTerm + ( foreignImport (PlutusTx.liftCode ("foo" :: Value.TokenName, 4 :: Integer)) :: + Term _ (PDelayed (PPair PTokenName PInteger)) + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> i1 #666f6f 4)))" + describe "Maybe" $ do + it "a PlutusTx Just Integer" $ + printShrunkCode (PlutusTx.liftCode (Just 4 :: Maybe Integer)) @?= justFour + it "a converted Plutarch PJust PInteger" $ + printShrunkTerm (pmaybeToTx # (pcon (PJust 4) :: Term _ (PMaybe PInteger))) @?= justFour + it "a Plutarch PTxJust PInteger" $ + printTerm (pcon (PTxJust 4) :: Term _ (PTxMaybe PInteger)) @?= justFour + it "a converted Plutarch PTxJust PInteger" $ + printShrunkTerm (pmaybeFromTx # (pcon $ PTxJust 4) :: Term _ (PMaybe PInteger)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> i2 4))" + it "a PlutusTx Nothing" $ + printShrunkCode (PlutusTx.liftCode (Nothing :: Maybe Integer)) @?= nothing + it "a converted Plutarch PNothing" $ + printShrunkTerm (pmaybeToTx # (pcon PNothing :: Term _ (PMaybe PInteger))) @?= nothing + it "a Plutarch PTxNothing" $ + printTerm (pcon PTxNothing :: Term _ (PTxMaybe PInteger)) @?= nothing + it "a converted Plutarch PTxNothing" $ + printShrunkTerm (pmaybeFromTx # (pcon PTxNothing) :: Term _ (PMaybe PInteger)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> force i1))" + it "import a Just Integer" $ + printEvaluatedTerm (foreignImport (PlutusTx.liftCode (Just 4 :: Maybe Integer)) :: Term _ (PTxMaybe PInteger)) @?= Right justFour + it "export a PTxJust PInteger" $ + printEvaluatedCode + ( (foreignExport (pcon (PTxJust 4) :: Term _ (PTxMaybe PInteger))) :: + CompiledCode (Maybe Integer) + ) + @?= Right justFour + describe "Lists" $ do + it "a PlutusTx list of integers" $ + printShrunkCode (PlutusTx.liftCode [1 :: Integer .. 3]) @?= oneTwoThree + it "import a list of integers" $ + printEvaluatedTerm (foreignImport (PlutusTx.liftCode [1 :: Integer .. 3]) :: Term _ (PTxList PInteger)) @?= Right oneTwoThree + it "import and map over a Value" $ + printEvaluatedTerm (pmap # pfst # (foreignImport (PlutusTx.liftCode val) :: Term _ PSValue)) + @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1 #c0 (delay (\\i0 -> \\i0 -> i1 # (delay (\\i0 -> \\i0 -> i2)))))))" + it "import and fold over a Value" $ + printEvaluatedTerm + (sumValueAmounts # (foreignImport (PlutusTx.liftCode val) :: Term _ PSValue)) + @?= Right "(program 1.0.0 3)" + it "export a list of integers" $ + printEvaluatedCode + ( foreignExport (pconvertLists #$ pconstant @(PBuiltinList PInteger) [1 .. 3] :: Term _ (PTxList PInteger)) :: + CompiledCode [Integer] + ) + @?= Right oneTwoThree + it "export a fold and apply it to a Value" $ + printEvaluatedCode + ((foreignExport sumValueAmounts :: CompiledCode (Value -> Integer)) `PlutusTx.applyCode` PlutusTx.liftCode val) + @?= Right "(program 1.0.0 3)" + + describe "Data" $ do + describe "Export and use a PData :--> PData function" $ do + it "evaluate a field" $ printEvaluatedCode - ( (foreignExport (pcon (PTxJust 4) :: Term _ (PTxMaybe PInteger))) :: - CompiledCode (Maybe Integer) + ( $$(PlutusTx.compile [||\gti ctx -> maybe "undecoded" (getTxId . txInfoId) (PlutusTx.fromBuiltinData (gti ctx))||]) + `applyCode` exportedTxInfo + `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) ) - @?= Right justFour - describe "Lists" $ do - it "a PlutusTx list of integers" $ - printShrunkCode (PlutusTx.liftCode [1 :: Integer .. 3]) @?= oneTwoThree - it "import a list of integers" $ - printEvaluatedTerm (foreignImport (PlutusTx.liftCode [1 :: Integer .. 3]) :: Term _ (PTxList PInteger)) @?= Right oneTwoThree - it "import and map over a Value" $ - printEvaluatedTerm (pmap # pfst # (foreignImport (PlutusTx.liftCode val) :: Term _ PSValue)) - @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1 #c0 (delay (\\i0 -> \\i0 -> i1 # (delay (\\i0 -> \\i0 -> i2)))))))" - it "import and fold over a Value" $ - printEvaluatedTerm - (sumValueAmounts # (foreignImport (PlutusTx.liftCode val) :: Term _ PSValue)) - @?= Right "(program 1.0.0 3)" - it "export a list of integers" $ + @?= Right "(program 1.0.0 #b0)" + it "evaluate a function to True" $ printEvaluatedCode - ( foreignExport (pconvertLists #$ pconstant @(PBuiltinList PInteger) [1 .. 3] :: Term _ (PTxList PInteger)) :: - CompiledCode [Integer] + ( $$(PlutusTx.compile [||\gti ctx pkh -> any (`Contexts.txSignedBy` pkh) (PlutusTx.fromBuiltinData (gti ctx))||]) + `applyCode` exportedTxInfo + `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) + `applyCode` PlutusTx.liftCode (head signatories) ) - @?= Right oneTwoThree - it "export a fold and apply it to a Value" $ + @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i2)))" + it "evaluate a function to False" $ printEvaluatedCode - ((foreignExport sumValueAmounts :: CompiledCode (Value -> Integer)) `PlutusTx.applyCode` PlutusTx.liftCode val) - @?= Right "(program 1.0.0 3)" - - describe "Data" $ do - describe "Export and use a PData :--> PData function" $ do - it "evaluate a field" $ - printEvaluatedCode - ( $$(PlutusTx.compile [||\gti ctx -> maybe "undecoded" (getTxId . txInfoId) (PlutusTx.fromBuiltinData (gti ctx))||]) - `applyCode` exportedTxInfo - `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) - ) - @?= Right "(program 1.0.0 #b0)" - it "evaluate a function to True" $ - printEvaluatedCode - ( $$(PlutusTx.compile [||\gti ctx pkh -> any (`Contexts.txSignedBy` pkh) (PlutusTx.fromBuiltinData (gti ctx))||]) - `applyCode` exportedTxInfo - `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) - `applyCode` PlutusTx.liftCode (head signatories) - ) - @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i2)))" - it "evaluate a function to False" $ - printEvaluatedCode - ( $$(PlutusTx.compile [||\gti ctx pkh -> any (`Contexts.txSignedBy` pkh) (PlutusTx.fromBuiltinData (gti ctx))||]) - `applyCode` exportedTxInfo - `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) - `applyCode` PlutusTx.liftCode "0123" - ) - @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1)))" - - describe "Import and use a BuiltinData -> x function" $ do - it "evaluate a Data -> Data -> Bool function to True" $ - printEvaluatedTerm (importedTxSignedBy # pconstantData info # pconstantData (head signatories)) - @?= Right "(program 1.0.0 True)" - it "evaluate a Data -> Data -> Bool function to False" $ - printEvaluatedTerm (importedTxSignedBy # pconstantData info # pconstantData "0123") - @?= Right "(program 1.0.0 False)" - it "evaluate a Data -> PubKeyHash -> Bool function to True" $ - printEvaluatedTerm (importedTxSignedBy' # pconstantData info # pconstant (head signatories)) - @?= Right "(program 1.0.0 True)" - it "evaluate a Data -> PubKeyHash -> Bool function to False" $ - printEvaluatedTerm (importedTxSignedBy' # pconstantData info # pconstant "0123") - @?= Right "(program 1.0.0 False)" + ( $$(PlutusTx.compile [||\gti ctx pkh -> any (`Contexts.txSignedBy` pkh) (PlutusTx.fromBuiltinData (gti ctx))||]) + `applyCode` exportedTxInfo + `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) + `applyCode` PlutusTx.liftCode "0123" + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1)))" + + describe "Import and use a BuiltinData -> x function" $ do + it "evaluate a Data -> Data -> Bool function to True" $ + printEvaluatedTerm (importedTxSignedBy # pconstantData info # pconstantData (head signatories)) + @?= Right "(program 1.0.0 True)" + it "evaluate a Data -> Data -> Bool function to False" $ + printEvaluatedTerm (importedTxSignedBy # pconstantData info # pconstantData "0123") + @?= Right "(program 1.0.0 False)" + it "evaluate a Data -> PubKeyHash -> Bool function to True" $ + printEvaluatedTerm (importedTxSignedBy' # pconstantData info # pconstant (head signatories)) + @?= Right "(program 1.0.0 True)" + it "evaluate a Data -> PubKeyHash -> Bool function to False" $ + printEvaluatedTerm (importedTxSignedBy' # pconstantData info # pconstant "0123") + @?= Right "(program 1.0.0 False)" where sampleScottEncoding = "(program 1.0.0 (delay (\\i0 -> i1 False 6 \"Hello\")))" sampleScottField = "(program 1.0.0 (\\i0 -> force i1 (\\i0 -> \\i0 -> \\i0 -> i2)))" From 57ae7c0aab95ce21131a1e8cede142457fe15d9f Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 24 Mar 2022 20:16:12 +0530 Subject: [PATCH 257/584] Generics SOPify --- Plutarch/DataRepr/Internal.hs | 167 ++++++++++++++++------------------ 1 file changed, 77 insertions(+), 90 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index efa0a3787..ccfcbfb7c 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -22,12 +22,14 @@ module Plutarch.DataRepr.Internal ( DerivePConstantViaData (..), pasDataSum, pdToBuiltin, - LTReprHandlers (..), + DualReprHandler (..), ) where -import Data.Kind (Type) +import Data.Functor.Const (Const (Const)) +import Data.Kind (Constraint, Type) import Data.List (groupBy, maximumBy, sortOn) import Data.Proxy (Proxy (Proxy)) +import Data.SOP.NP (cana_NP) import GHC.TypeLits ( ErrorMessage (ShowType, Text, (:<>:)), KnownNat, @@ -228,13 +230,13 @@ instance PIsData (PDataSum defs) where instance PEq (PDataSum defs) where x #== y = pdata x #== pdata y -instance MkLtReprHandler defs => POrd (PDataSum defs) where +instance All POrdDef defs => POrd (PDataSum defs) where x' #< y' = f # x' # y' where - f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLtReprHandler + f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLTHandler x' #<= y' = f # x' # y' where - f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLteReprHandler + f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLTEHandler pasDataSum :: PIsDataRepr a => Term s a -> Term s (PDataSum (PIsDataReprRepr a)) pasDataSum = punsafeCoerce @@ -282,45 +284,16 @@ pmatchDataSum d handlers = plet (psndBuiltin # d') $ \args -> let handlers' = applyHandlers args handlers in runTermCont (findCommon handlers') $ \common -> - go + reprHandlersGo common 0 handlers' constr where - hashHandlers :: [Term s out] -> TermCont s [(Dig, Term s out)] - hashHandlers [] = pure [] - hashHandlers (handler : rest) = do - hash <- hashOpenTerm handler - hashes <- hashHandlers rest - pure $ (hash, handler) : hashes - - findCommon :: [Term s out] -> TermCont s (Dig, Term s out) - findCommon handlers = do - l <- hashHandlers handlers - pure $ head . maximumBy (\x y -> length x `compare` length y) . groupBy (\x y -> fst x == fst y) . sortOn fst $ l - applyHandlers :: Term s (PBuiltinList PData) -> DataReprHandlers out defs s -> [Term s out] applyHandlers _ DRHNil = [] applyHandlers args (DRHCons handler rest) = handler (punsafeCoerce args) : applyHandlers args rest - go :: - (Dig, Term s out) -> - Integer -> - [Term s out] -> - Term s PInteger -> - Term s out - go common _ [] _ = snd common - go common idx (handler : rest) constr = - runTermCont (hashOpenTerm handler) $ \hhash -> - if hhash == fst common - then go common (idx + 1) rest constr - else - pif - (fromInteger idx #== constr) - handler - $ go common (idx + 1) rest constr - -- TODO: This 'PMatch' constraint needs to be changed to 'PlutusType (breaking change). class (PMatch a, PIsData a) => PIsDataRepr (a :: PType) where type PIsDataReprRepr a :: [[PLabeledType]] @@ -400,16 +373,11 @@ instance mkSOP :: NP (Term s) r -> SOP (Term s) (PCode s a) mkSOP = SOP . mkSum @_ @n @pcode -data LTReprHandlers (defs :: [[PLabeledType]]) (s :: S) where - LTRHNil :: LTReprHandlers '[] s - LTRHCons :: - (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s PBool) -> - LTReprHandlers defs s -> - LTReprHandlers (def : defs) s +newtype DualReprHandler s out def = LTRepr (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s out) -- | Optimized dual pmatch specialized for lexicographic '#<' and '#<=' implementations. -pmatchLT :: Term s (PDataSum defs) -> Term s (PDataSum defs) -> LTReprHandlers defs s -> Term s PBool -pmatchLT d1 d2 (LTRHCons handler LTRHNil) = handler (punDataSum # d1) (punDataSum # d2) +pmatchLT :: Term s (PDataSum defs) -> Term s (PDataSum defs) -> NP (DualReprHandler s PBool) defs -> Term s PBool +pmatchLT d1 d2 (LTRepr handler :* Nil) = handler (punDataSum # d1) (punDataSum # d2) pmatchLT d1 d2 handlers = unTermCont $ do a <- tcont . plet $ pasConstr #$ pforgetData $ pdata d1 b <- tcont . plet $ pasConstr #$ pforgetData $ pdata d2 @@ -430,59 +398,78 @@ pmatchLT d1 d2 handlers = unTermCont $ do flds2 <- tcont . plet $ psndBuiltin # b let handlers' = applyHandlers flds1 flds2 handlers common <- findCommon handlers' - pure $ go common 0 (applyHandlers flds1 flds2 handlers) cid1 + pure $ reprHandlersGo common 0 (applyHandlers flds1 flds2 handlers) cid1 ) -- Left arg's constructor id is greater, no need to continue. $ pconstant False where - hashHandlers :: [Term s PBool] -> TermCont s [(Dig, Term s PBool)] - hashHandlers [] = pure [] - hashHandlers (handler : rest) = do - hash <- hashOpenTerm handler - hashes <- hashHandlers rest - pure $ (hash, handler) : hashes - - findCommon :: [Term s PBool] -> TermCont s (Dig, Term s PBool) - findCommon handlers = do - l <- hashHandlers handlers - pure $ head . maximumBy (\x y -> length x `compare` length y) . groupBy (\x y -> fst x == fst y) . sortOn fst $ l - - applyHandlers :: Term s (PBuiltinList PData) -> Term s (PBuiltinList PData) -> LTReprHandlers defs s -> [Term s PBool] - applyHandlers _ _ LTRHNil = [] - applyHandlers args1 args2 (LTRHCons handler rest) = + applyHandlers :: + Term s (PBuiltinList PData) -> + Term s (PBuiltinList PData) -> + NP (DualReprHandler s PBool) defs -> + [Term s PBool] + applyHandlers _ _ Nil = [] + applyHandlers args1 args2 (LTRepr handler :* rest) = handler (punsafeCoerce args1) (punsafeCoerce args2) : applyHandlers args1 args2 rest - go :: - (Dig, Term s out) -> - Integer -> - [Term s out] -> - Term s PInteger -> - Term s out - go common _ [] _ = snd common - go common idx (handler : rest) c = runTermCont (hashOpenTerm handler) $ \hhash -> - if hhash == fst common - then go common (idx + 1) rest c - else - pif - (fromInteger idx #== c) - handler - $ go common (idx + 1) rest c - -class MkLtReprHandler defs where - type FirstDef defs :: [PLabeledType] - mkLtReprHandler :: LTReprHandlers defs s - mkLteReprHandler :: LTReprHandlers defs s - -instance POrd (PDataRecord def) => MkLtReprHandler '[def] where - type FirstDef '[def] = def - mkLtReprHandler = LTRHCons (#<) LTRHNil - mkLteReprHandler = LTRHCons (#<=) LTRHNil - -instance (POrd (PDataRecord def), MkLtReprHandler (def' ': defs)) => MkLtReprHandler (def ': def' ': defs) where - type FirstDef (def ': def' ': defs) = def - mkLtReprHandler = LTRHCons (#<) mkLtReprHandler - mkLteReprHandler = LTRHCons (#<=) mkLteReprHandler +reprHandlersGo :: + (Dig, Term s out) -> + Integer -> + [Term s out] -> + Term s PInteger -> + Term s out +reprHandlersGo common _ [] _ = snd common +reprHandlersGo common idx (handler : rest) c = + runTermCont (hashOpenTerm handler) $ \hhash -> + if hhash == fst common + then reprHandlersGo common (idx + 1) rest c + else + pif + (fromInteger idx #== c) + handler + $ reprHandlersGo common (idx + 1) rest c + +hashHandlers :: [Term s out] -> TermCont s [(Dig, Term s out)] +hashHandlers [] = pure [] +hashHandlers (handler : rest) = do + hash <- hashOpenTerm handler + hashes <- hashHandlers rest + pure $ (hash, handler) : hashes + +findCommon :: [Term s out] -> TermCont s (Dig, Term s out) +findCommon handlers = do + l <- hashHandlers handlers + pure $ head . maximumBy (\x y -> length x `compare` length y) . groupBy (\x y -> fst x == fst y) . sortOn fst $ l + +type POrdDef :: [PLabeledType] -> Constraint +class POrd (PDataRecord l) => POrdDef l where + ltDef :: Term s (PDataRecord l) -> Term s (PDataRecord l) -> Term s PBool + ltDef = (#<) + lteDef :: Term s (PDataRecord l) -> Term s (PDataRecord l) -> Term s PBool + lteDef = (#<=) + +instance POrd (PDataRecord def) => POrdDef def + +mkLTHandler :: forall def s. All POrdDef def => NP (DualReprHandler s PBool) def +mkLTHandler = cana_NP (Proxy @POrdDef) rer $ Const () + where + rer :: + forall (y :: [PLabeledType]) (ys :: [[PLabeledType]]). + POrdDef y => + Const () (y : ys) -> + (DualReprHandler s PBool y, Const () ys) + rer _ = (LTRepr ltDef, Const ()) + +mkLTEHandler :: forall def s. All POrdDef def => NP (DualReprHandler s PBool) def +mkLTEHandler = cana_NP (Proxy @POrdDef) rer $ Const () + where + rer :: + forall (y :: [PLabeledType]) (ys :: [[PLabeledType]]). + POrdDef y => + Const () (y : ys) -> + (DualReprHandler s PBool y, Const () ys) + rer _ = (LTRepr lteDef, Const ()) {- | Use this for implementing the necessary instances for getting the `Data` representation. You must implement 'PIsDataRepr' to use this. @@ -503,7 +490,7 @@ instance PIsDataRepr a => PEq (PIsDataReprInstances a) where x #== y = pdata x #== pdata y -- | This uses lexicographic ordering. Actually uses PDataSum '(#<)' implementation. -instance (PIsDataRepr a, MkLtReprHandler (PIsDataReprRepr a)) => POrd (PIsDataReprInstances a) where +instance (PIsDataRepr a, All POrdDef (PIsDataReprRepr a)) => POrd (PIsDataReprInstances a) where x #< y = pto x #< pto y x #<= y = pto x #<= pto y From 67a528b22c6158f20d2d798ffdcc80b5b7b2e1d4 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 24 Mar 2022 20:44:04 +0530 Subject: [PATCH 258/584] Remove duplicate `PIsData` instance --- Plutarch/Builtin.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 032475dba..0f4f9ff47 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -255,10 +255,6 @@ instance PIsData PData where pfromData = punsafeCoerce pdata = punsafeCoerce -instance PIsData (PBuiltinList PData) where - pfromData x = punsafeCoerce $ pasList # pforgetData x - pdata x = punsafeBuiltin PLC.ListData # x - instance PIsData a => PIsData (PBuiltinList (PAsData a)) where pfromData x = punsafeCoerce $ pasList # pforgetData x pdata x = punsafeBuiltin PLC.ListData # x From 4ab2fdb23a2d2013ece8cddb4bf14d2c82cf1301 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 24 Mar 2022 20:45:35 +0530 Subject: [PATCH 259/584] Remove `POrdDef` (thanks @srid) --- Plutarch/DataRepr/Internal.hs | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 7b0df76f9..f210f746d 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -26,7 +26,7 @@ module Plutarch.DataRepr.Internal ( ) where import Data.Functor.Const (Const (Const)) -import Data.Kind (Constraint, Type) +import Data.Kind (Type) import Data.List (groupBy, maximumBy, sortOn) import Data.Proxy (Proxy (Proxy)) import Data.SOP.NP (cana_NP) @@ -43,6 +43,7 @@ import Generics.SOP ( All, All2, Code, + Compose, Generic, K (K), NP (Nil, (:*)), @@ -234,7 +235,7 @@ instance PIsData (PDataSum defs) where instance PEq (PDataSum defs) where x #== y = pdata x #== pdata y -instance All POrdDef defs => POrd (PDataSum defs) where +instance All (Compose POrd PDataRecord) defs => POrd (PDataSum defs) where x' #< y' = f # x' # y' where f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLTHandler @@ -446,34 +447,25 @@ findCommon handlers = do l <- hashHandlers handlers pure $ head . maximumBy (\x y -> length x `compare` length y) . groupBy (\x y -> fst x == fst y) . sortOn fst $ l -type POrdDef :: [PLabeledType] -> Constraint -class POrd (PDataRecord l) => POrdDef l where - ltDef :: Term s (PDataRecord l) -> Term s (PDataRecord l) -> Term s PBool - ltDef = (#<) - lteDef :: Term s (PDataRecord l) -> Term s (PDataRecord l) -> Term s PBool - lteDef = (#<=) - -instance POrd (PDataRecord def) => POrdDef def - -mkLTHandler :: forall def s. All POrdDef def => NP (DualReprHandler s PBool) def -mkLTHandler = cana_NP (Proxy @POrdDef) rer $ Const () +mkLTHandler :: forall def s. All (Compose POrd PDataRecord) def => NP (DualReprHandler s PBool) def +mkLTHandler = cana_NP (Proxy @(Compose POrd PDataRecord)) rer $ Const () where rer :: forall (y :: [PLabeledType]) (ys :: [[PLabeledType]]). - POrdDef y => + Compose POrd PDataRecord y => Const () (y : ys) -> (DualReprHandler s PBool y, Const () ys) - rer _ = (LTRepr ltDef, Const ()) + rer _ = (LTRepr (#<), Const ()) -mkLTEHandler :: forall def s. All POrdDef def => NP (DualReprHandler s PBool) def -mkLTEHandler = cana_NP (Proxy @POrdDef) rer $ Const () +mkLTEHandler :: forall def s. All (Compose POrd PDataRecord) def => NP (DualReprHandler s PBool) def +mkLTEHandler = cana_NP (Proxy @(Compose POrd PDataRecord)) rer $ Const () where rer :: forall (y :: [PLabeledType]) (ys :: [[PLabeledType]]). - POrdDef y => + Compose POrd PDataRecord y => Const () (y : ys) -> (DualReprHandler s PBool y, Const () ys) - rer _ = (LTRepr lteDef, Const ()) + rer _ = (LTRepr (#<=), Const ()) {- | Use this for implementing the necessary instances for getting the `Data` representation. You must implement 'PIsDataRepr' to use this. @@ -494,7 +486,7 @@ instance PIsDataRepr a => PEq (PIsDataReprInstances a) where x #== y = pdata x #== pdata y -- | This uses lexicographic ordering. Actually uses PDataSum '(#<)' implementation. -instance (PIsDataRepr a, All POrdDef (PIsDataReprRepr a)) => POrd (PIsDataReprInstances a) where +instance (PIsDataRepr a, All (Compose POrd PDataRecord) (PIsDataReprRepr a)) => POrd (PIsDataReprInstances a) where x #< y = pto x #< pto y x #<= y = pto x #<= pto y From ba788293dc3730a17a3910b19d71785ebb40a497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 24 Mar 2022 15:31:15 -0400 Subject: [PATCH 260/584] Added a full explanation of types in FFI --- docs/Usage/FFI.md | 68 ++++++++++++++++++- plutarch-test/conditional/Plutarch/FFISpec.hs | 12 +++- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/docs/Usage/FFI.md b/docs/Usage/FFI.md index 61ec1c54c..4e6e113c4 100644 --- a/docs/Usage/FFI.md +++ b/docs/Usage/FFI.md @@ -5,7 +5,7 @@ re-write only its critical parts in Plutarch and to call them from PlutusTx. The function to use is `Plutarch.FFI.foreignExport`: ```haskell -doubleInPlutarch :: Term s (PInteger -> PInteger) +doubleInPlutarch :: Term s (PInteger :--> PInteger) doubleInPlutarch = plam (2 *) doubleExported :: PlutusTx.CompiledCode (Integer -> Integer) @@ -15,7 +15,8 @@ doubleUseInPlutusTx :: PlutusTx.CompiledCode Integer doubleUseInPlutusTx = doubleExported `PlutusTx.applyCode` PlutusTx.liftCode 21 ``` -Alternatively, you may go in the opposite direction and call an existing PlutusTx function from Plutarch using `Plutarch.FFI.foreignImport`: +Alternatively, you may go in the opposite direction and call an existing +PlutusTx function from Plutarch using `Plutarch.FFI.foreignImport`: ```haskell doubleInPlutusTx :: CompiledCode (Integer -> Integer) @@ -27,3 +28,66 @@ doubleImported = foreignImport doubleInPlutusTx doubleUseInPlutarch :: Term s PInteger doubleUseInPlutarch = doubleImported # 21 ``` + +Note how Plutarch type `PInteger :--> PInteger` corresponds to Haskell +function type `Integer -> Integer`. If the types didn't corespond, the +`foreignExport` and `foreignImport` applications wouldn't compile. The +following table shows the correspondence between the two universes of types: + +| Plutarch | Haskell | +| -------------- | ------------------- | +| `pa :--> pb` | `a -> b` | +| `PTxList pa` | `[a]` | +| `PTxMaybe pa` | `Maybe a` | +| `PInteger` | `Integer` | +| `PBool` | `BuiltinBool` | +| `PString` | `BuiltinString` | +| `PByteString` | `BuiltinByteString` | +| `PBuiltinData` | `Data` | +| `PUnit` | `BuiltinUnit` | +| `PDelayed pa` | `Delayed a` | + +## User-defined types + +When it comes to user-defined types, you have a choice of passing their values +encoded as `Data` or directly. In the latter case, you'll have to declare your +type twice with two kinds: as a Haskell `Type` and as a Plutarch +`PType`. Futhermore, both types must be instances of `SOP.Generic`, as in this +example: + +```haskell +data SampleRecord = SampleRecord + { sampleBool :: BuiltinBool + , sampleInt :: Integer + , sampleString :: BuiltinString + } + deriving stock (Generic) + deriving anyclass (SOP.Generic) + +data PSampleRecord (s :: S) = PSampleRecord + { psampleBool :: Term s PBool + , psampleInt :: Term s PInteger + , psampleString :: Term s PString + } + deriving stock (Generic) + deriving anyclass (SOP.Generic, PlutusType) +``` + +With these two declarations in place, the preceding table can gain another +row: + +| Plutarch | Haskell | +| ----------------------- | -------------------- | +| `PDelayed PSampleRecord` | `SampleRecord` | + +The reason for `PDelayed` above is a slight difference in Scott encodings of +data types between Plutarch and PlutusTx. It means you'll need to apply +`pdelay` to a `PSampleRecord` value before passing it through FFI to Haskell, +and `pforce` after passing it in the opposite direction. + +This technique can be used for most data types, but it doesn't cover recursive +types (such as lists) nor data types with nullary constructors (such as +`Maybe`). To interface with these two common Haskell types, use `PTxMaybe` and +`PTxList` types from `Plutarch.FFI`. The module also exports the means to +convert between these special purpose types and the regular Plutarch `PMaybe` +and `PList`. diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index 1a48f0807..b3b19c7d4 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -116,6 +116,14 @@ data PSampleRecord f = PSampleRecord } $(deriveAll ''PSampleRecord) +data PSampleRecord' (s :: S) = PSampleRecord' + { psampleBool' :: Term s PBool + , psampleInt' :: Term s PInteger + , psampleString' :: Term s PString + } + deriving stock (Generic) + deriving anyclass (SOP.Generic, PlutusType) + importedField :: Term _ (PDelayed (Rec.PRecord PSampleRecord) :--> PInteger) importedField = foreignImport ($$(PlutusTx.compile [||sampleInt||]) :: CompiledCode (SampleRecord -> Integer)) @@ -265,8 +273,10 @@ spec = do describe "Records" $ do it "PlutusTx record value" $ printShrunkCode $$(PlutusTx.compile [||SampleRecord (toBuiltin False) 6 "Hello"||]) @?= sampleScottEncoding - it "Plutarch record value" $ + it "Plutarch HKD record value" $ printTerm (pdelay $ Rec.rcon $ PSampleRecord (pcon PFalse) 6 "Hello") @?= sampleScottEncoding + it "Plutarch SOP record value" $ + printTerm (pdelay $ pcon $ PSampleRecord' (pcon PFalse) 6 "Hello") @?= sampleScottEncoding it "PlutusTx record function" $ printShrunkCode $$(PlutusTx.compile [||sampleInt||]) @?= sampleScottField it "Plutarch record function" $ From f92e23eb1943a933cb6be083b37ec9e83c92571f Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 24 Mar 2022 16:08:42 -0400 Subject: [PATCH 261/584] Add 'nix run .#docs' --- .gitattributes | 1 + flake.lock | 347 ++++++++++++++++++++++++++++++++++++++++++++++--- flake.nix | 13 ++ 3 files changed, 346 insertions(+), 15 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..af4fe8b58 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +flake.lock linguist-generated=true diff --git a/flake.lock b/flake.lock index 8079a093c..7296461e0 100644 --- a/flake.lock +++ b/flake.lock @@ -199,6 +199,66 @@ "type": "github" } }, + "ema": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1648150821, + "narHash": "sha256-AGwZRHD2Gcn2kuT3FQCaQOoBhH1D+Blk0WXuEXWyr2c=", + "owner": "srid", + "repo": "ema", + "rev": "624bcd5103e847fbbb9c59e39dab507424dd8299", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "multisite", + "repo": "ema", + "type": "github" + } + }, + "emanote": { + "inputs": { + "ema": "ema", + "flake-compat": [ + "emanote", + "ema", + "flake-compat" + ], + "flake-utils": [ + "emanote", + "ema", + "flake-utils" + ], + "heist": "heist", + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ], + "pathtree": "pathtree", + "tailwind-haskell": "tailwind-haskell", + "unionmount": "unionmount" + }, + "locked": { + "lastModified": 1648152050, + "narHash": "sha256-Gily4oO2hmrrYui/WZBr45r3+huSmyvUAhkFEMtcrDM=", + "owner": "srid", + "repo": "emanote", + "rev": "1b70424d750ff83cc3104573d7dc7e99300150d5", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "rel-link-and-anchors", + "repo": "emanote", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -231,6 +291,54 @@ } }, "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_5": { "flake": false, "locked": { "lastModified": 1606424373, @@ -247,7 +355,7 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_6": { "flake": false, "locked": { "lastModified": 1606424373, @@ -278,6 +386,66 @@ "type": "github" } }, + "flake-utils_2": { + "locked": { + "lastModified": 1619345332, + "narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "locked": { + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "locked": { + "lastModified": 1631561581, + "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flat": { "flake": false, "locked": { @@ -417,7 +585,7 @@ "cabal-34": "cabal-34", "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_5", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", "hpc-coveralls": "hpc-coveralls", @@ -464,9 +632,26 @@ "type": "github" } }, + "heist": { + "flake": false, + "locked": { + "lastModified": 1624205223, + "narHash": "sha256-+bcrEKjB/kDRAqOunCD/cKBBVOJUTmY9RoCQ++I42oM=", + "owner": "srid", + "repo": "heist", + "rev": "a8be6f93656f87199e03b9dfb9979dc061614108", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "emanote", + "repo": "heist", + "type": "github" + } + }, "hercules-ci-agent": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_6", "nix-darwin": "nix-darwin", "nixos-20_09": "nixos-20_09", "nixos-unstable": "nixos-unstable", @@ -489,9 +674,9 @@ }, "hercules-ci-effects": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_5", "hercules-ci-agent": "hercules-ci-agent", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_4", "nixpkgs-nixops": "nixpkgs-nixops" }, "locked": { @@ -575,7 +760,7 @@ }, "nix-darwin": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1622060422, @@ -641,16 +826,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1602411953, - "narHash": "sha256-gbupmxRpoQZqL5NBQCJN2GI5G7XDEHHHYKhVwEj5+Ps=", - "owner": "LnL7", + "lastModified": 1647350163, + "narHash": "sha256-OcMI+PFEHTONthXuEQNddt16Ml7qGvanL3x8QOl2Aao=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "f780534ea2d0c12e62607ff254b6b45f46653f7a", + "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", + "type": "github" } }, "nixpkgs-2003": { @@ -734,6 +921,34 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1645655918, + "narHash": "sha256-ZfbEFRW7o237+A1P7eTKhXje435FCAoe0blj2n20Was=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "77a7a4197740213879b9a1d2e1788c6c8ade4274", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1602411953, + "narHash": "sha256-gbupmxRpoQZqL5NBQCJN2GI5G7XDEHHHYKhVwEj5+Ps=", + "owner": "LnL7", + "repo": "nixpkgs", + "rev": "f780534ea2d0c12e62607ff254b6b45f46653f7a", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1633463774, "narHash": "sha256-y3GjapcRzd42NgebQ4sx5GFJ53dYqNdF3UQu7/t6mUg=", @@ -749,7 +964,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_5": { "flake": false, "locked": { "lastModified": 1628785280, @@ -783,6 +998,30 @@ "type": "github" } }, + "pathtree": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1647644631, + "narHash": "sha256-aRuyBXjUrva7RNSWIIbB+HefowF8wZepCkkaCDm8Qn4=", + "owner": "srid", + "repo": "pathtree", + "rev": "8619aada5b0cd76dff37a2e90b47eecbb3fb7d23", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "pathtree", + "type": "github" + } + }, "plutus": { "inputs": { "cardano-repo-tool": "cardano-repo-tool", @@ -791,7 +1030,7 @@ "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", "iohk-nix": "iohk-nix_2", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_5", "pre-commit-hooks-nix": "pre-commit-hooks-nix_2", "sphinxcontrib-haddock": "sphinxcontrib-haddock", "stackage-nix": "stackage-nix" @@ -811,6 +1050,25 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1646153636, + "narHash": "sha256-AlWHMzK+xJ1mG267FdT8dCq/HvLCA6jwmx2ZUy5O8tY=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "b6bc0b21e1617e2b07d8205e7fae7224036dfa4b", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "pre-commit-hooks-nix": { "flake": false, "locked": { @@ -868,7 +1126,8 @@ "cardano-crypto": "cardano-crypto", "cardano-prelude": "cardano-prelude", "cryptonite": "cryptonite", - "flake-compat": "flake-compat", + "emanote": "emanote", + "flake-compat": "flake-compat_4", "flake-compat-ci": "flake-compat-ci", "flat": "flat", "foundation": "foundation", @@ -989,6 +1248,39 @@ "type": "github" } }, + "tailwind-haskell": { + "inputs": { + "flake-compat": [ + "emanote", + "ema", + "flake-compat" + ], + "flake-utils": [ + "emanote", + "ema", + "flake-utils" + ], + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1647792199, + "narHash": "sha256-QndGcDf2ySiA+1CSo05lSE9qBCcV18hBCgw8qH9PfEo=", + "owner": "srid", + "repo": "tailwind-haskell", + "rev": "9deb377835f9035a658c694dd82cb772afeb2d36", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "master", + "repo": "tailwind-haskell", + "type": "github" + } + }, "th-extras": { "flake": false, "locked": { @@ -1006,6 +1298,31 @@ "type": "github" } }, + "unionmount": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1647795307, + "narHash": "sha256-olb4o0+l8XXtdQ8NKLtwjI5A9/4CPMgRdBVtZVvsLlY=", + "owner": "srid", + "repo": "unionmount", + "rev": "ccd5049de67bfd7f042deda00a41659ec4e36f3c", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "master", + "repo": "unionmount", + "type": "github" + } + }, "validity": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index d89fdbdc7..dced7d01d 100644 --- a/flake.nix +++ b/flake.nix @@ -57,6 +57,9 @@ inputs.autodocodec.url = "github:srid/autodocodec/ghc921"; inputs.autodocodec.flake = false; + inputs.emanote.url = "github:srid/emanote/rel-link-and-anchors"; + # inputs.emanote.inputs.ema.inputs.nixpkgs.follows = "nixpkgs"; + outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, flake-compat, flake-compat-ci, hercules-ci-effects, ... }: let extraSources = [ @@ -666,6 +669,16 @@ test-ghc9-dev = plutarchTestApp system "ghc9-dev" self.projectMatrix.ghc9.dev; test-ghc810-nodev = plutarchTestApp system "ghc810-nodev" self.projectMatrix.ghc810.nodev; test-ghc810-dev = plutarchTestApp system "ghc810-dev" self.projectMatrix.ghc810.dev; + docs = rec { + type = "app"; + # '' is required for escaping ${} in nix + script = (nixpkgsFor system).writers.writeBash "emanoteLiveReload.sh" '' + set -xe + export PORT="''${EMANOTE_PORT:-7072}" + ${inputs.emanote.defaultPackage.${system}}/bin/emanote --layers ./docs run --port "$PORT" + ''; + program = builtins.toString script; + }; } ); devShell = perSystem (system: self.flake.${system}.devShell); From 723bd23f0297e9399c0fd12af4ad6dd6f0b5104b Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 24 Mar 2022 16:37:51 -0400 Subject: [PATCH 262/584] Add 'nix build .#website' --- flake.lock | 6 +++--- flake.nix | 42 ++++++++++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index 7296461e0..0a6ebf631 100644 --- a/flake.lock +++ b/flake.lock @@ -245,11 +245,11 @@ "unionmount": "unionmount" }, "locked": { - "lastModified": 1648152050, - "narHash": "sha256-Gily4oO2hmrrYui/WZBr45r3+huSmyvUAhkFEMtcrDM=", + "lastModified": 1648153867, + "narHash": "sha256-em+49tMCjGskzSxBIfSJYxKaA032xU/6SggwyRJdPUE=", "owner": "srid", "repo": "emanote", - "rev": "1b70424d750ff83cc3104573d7dc7e99300150d5", + "rev": "6044d819594f1aca593a0fdacbd6168782804336", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index dced7d01d..b897f48c1 100644 --- a/flake.nix +++ b/flake.nix @@ -585,6 +585,35 @@ ''; }; }; + plutarchWebsite = system: + let + pkgs = nixpkgsFor system; + configFile = (pkgs.formats.yaml { }).generate "emanote-configFile" { + template.baseUrl = "/plutarch/"; + }; + configDir = pkgs.runCommand "emanote-configDir" { } '' + mkdir -p $out + cp ${configFile} $out/index.yaml + ''; + in + pkgs.runCommand "plutarch-docs-html" { } + '' + mkdir $out + ${inputs.emanote.defaultPackage.${system}}/bin/emanote \ + --layers "${self}/docs;${configDir}" \ + gen $out + ''; + plutarchWebsiteApp = system: + rec { + type = "app"; + # '' is required for escaping ${} in nix + script = (nixpkgsFor system).writers.writeBash "emanoteLiveReload.sh" '' + set -xe + export PORT="''${EMANOTE_PORT:-7072}" + ${inputs.emanote.defaultPackage.${system}}/bin/emanote --layers ./docs run --port "$PORT" + ''; + program = builtins.toString script; + }; # Checks the shell script using ShellCheck checkedShellScript = system: name: text: @@ -636,6 +665,7 @@ packages = perSystem (system: self.flake.${system}.packages // { haddock = haddock system; + website = plutarchWebsite system; }); checks = perSystem (system: @@ -669,16 +699,8 @@ test-ghc9-dev = plutarchTestApp system "ghc9-dev" self.projectMatrix.ghc9.dev; test-ghc810-nodev = plutarchTestApp system "ghc810-nodev" self.projectMatrix.ghc810.nodev; test-ghc810-dev = plutarchTestApp system "ghc810-dev" self.projectMatrix.ghc810.dev; - docs = rec { - type = "app"; - # '' is required for escaping ${} in nix - script = (nixpkgsFor system).writers.writeBash "emanoteLiveReload.sh" '' - set -xe - export PORT="''${EMANOTE_PORT:-7072}" - ${inputs.emanote.defaultPackage.${system}}/bin/emanote --layers ./docs run --port "$PORT" - ''; - program = builtins.toString script; - }; + + docs = plutarchWebsiteApp system; } ); devShell = perSystem (system: self.flake.${system}.devShell); From 2ff45004190fbc665a9a37d381517d8aabc951a1 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 24 Mar 2022 16:38:01 -0400 Subject: [PATCH 263/584] Add emanote config --- docs/index.md | 3 +++ docs/index.yaml | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 docs/index.md create mode 100644 docs/index.yaml diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000..0a5874bd8 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,3 @@ +# Plutarch + +See [[README]] diff --git a/docs/index.yaml b/docs/index.yaml new file mode 100644 index 000000000..07bd629c2 --- /dev/null +++ b/docs/index.yaml @@ -0,0 +1,13 @@ +template: + urlStrategy: direct + +page: + siteTitle: Plutarch + headHtml: | + + +pandoc: + rewriteClass: + # For use in notes with Prism.JS disabled (specifically code-block using + # pages like Mermaid) + code-block: border-2 p-1 overflow-auto my-1 bg-gray-50 \ No newline at end of file From a8a61dce1ac00647f4b926b406afe3eb39457e5f Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 24 Mar 2022 17:06:45 -0400 Subject: [PATCH 264/584] Advance emanote for broken link fix --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 0a6ebf631..c37dda2e9 100644 --- a/flake.lock +++ b/flake.lock @@ -245,11 +245,11 @@ "unionmount": "unionmount" }, "locked": { - "lastModified": 1648153867, - "narHash": "sha256-em+49tMCjGskzSxBIfSJYxKaA032xU/6SggwyRJdPUE=", + "lastModified": 1648155826, + "narHash": "sha256-GzgtVRMZxMInUSyDPd/wD7P47BBU5OqBvbhvH6QqbKs=", "owner": "srid", "repo": "emanote", - "rev": "6044d819594f1aca593a0fdacbd6168782804336", + "rev": "59480123fdf2f70c9ed0d898b8b120661546a83c", "type": "github" }, "original": { From 2c228c552df3b1c1ed76799b7acffcbd812ab9aa Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 24 Mar 2022 17:37:47 -0400 Subject: [PATCH 265/584] ./docs: Fix broken links --- docs/DEVGUIDE.md | 4 ++-- docs/Typeclasses/PIsDataRepr and PDataFields.md | 2 +- docs/examples/BASIC.md | 2 +- docs/examples/VALIDATOR.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/DEVGUIDE.md b/docs/DEVGUIDE.md index 9d56685f4..458b44917 100644 --- a/docs/DEVGUIDE.md +++ b/docs/DEVGUIDE.md @@ -58,7 +58,7 @@ Parts of the [Pluto guide](https://github.com/Plutonomicon/pluto/blob/main/GUIDE ## Plutus Core constants (UNSAFE) -> **NOTE**: The following information is almost never necessary with the existence of `pconstant`. Refer to [constant building](./GUIDE.md#constants) and [`PConstant`/`PLift`](./GUIDE.md#pconstant--plift) section of the Plutarch user guide. +> **NOTE**: The following information is almost never necessary with the existence of `pconstant`. Refer to [constant building](Introduction/Plutarch%20Terms/Plutarch%20Constants.md) and [`PConstant`/`PLift`](./Typeclasses/PConstant%20and%20PLift.md) section of the Plutarch user guide. Often, you will need to build a Plutus core constant. You can do this using `Some` and `ValueOf`. Here's how `pcon PTrue` creates a Plutarch term that actually evaluates to a Plutus core constant representing a boolean: @@ -238,7 +238,7 @@ mockCtx = Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf data (Constr 0 [List [Constr 0 [Constr 0 [Constr 0 [B ""],I 1],Constr 0 [Constr 0 [Constr 0 [B "\SOH#"],Constr 1 []],Map [],Constr 1 []]]],List [],Map [],Map [],List [],List [],Constr 0 [Constr 0 [Constr 1 [I 1],Constr 1 []],Constr 0 [Constr 1 [I 2],Constr 1 []]],List [],List [],Constr 0 [B ""]]))))) ``` -> Aside: You can find the definition of `evalWithArgsT` above - [Compiling and Running](./GUIDE.md#compiling-and-running). +> Aside: You can find the definition of `evalWithArgsT` above - [Compiling and Running](./README.md#compiling-and-running). But we're not done yet! We want `txInfoInputs`. You may have noticed where exactly it is located on the above output. See that `List …`? Inside the outermost `Constr`'s fields? That's our `txInfoInputs`! diff --git a/docs/Typeclasses/PIsDataRepr and PDataFields.md b/docs/Typeclasses/PIsDataRepr and PDataFields.md index a62a04a87..a4ee8cd6b 100644 --- a/docs/Typeclasses/PIsDataRepr and PDataFields.md +++ b/docs/Typeclasses/PIsDataRepr and PDataFields.md @@ -105,7 +105,7 @@ mockCtx = Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf string "It's minting!")))) ``` -> Aside: You can find the definition of `evalWithArgsT` at [Compiling and Running](../GUIDE.md#compiling-and-running). +> Aside: You can find the definition of `evalWithArgsT` at [Compiling and Running](../README.md#compiling-and-running). ## All about extracting fields diff --git a/docs/examples/BASIC.md b/docs/examples/BASIC.md index 7d23854ac..e4a229210 100644 --- a/docs/examples/BASIC.md +++ b/docs/examples/BASIC.md @@ -2,7 +2,7 @@ Basic examples demonstrating Plutarch usage. > Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! -> Aside: Be sure to check out [Compiling and Running](./../GUIDE.md#compiling-and-running) first! +> Aside: Be sure to check out [Compiling and Running](./../README.md#compiling-and-running) first! # Fibonacci number at given index diff --git a/docs/examples/VALIDATOR.md b/docs/examples/VALIDATOR.md index 31c856902..60fbd56ac 100644 --- a/docs/examples/VALIDATOR.md +++ b/docs/examples/VALIDATOR.md @@ -7,7 +7,7 @@ Examples of validators and minting policies written in Plutarch. - [Validator that checks whether a value is present within signatories](#validator-that-checks-whether-a-value-is-present-within-signatories) - [Using custom datum/redeemer in your Validator](#using-custom-datumredeemer-in-your-validator) -> Aside: Be sure to check out [Compiling and Running](./../GUIDE.md#compiling-and-running) first! +> Aside: Be sure to check out [Compiling and Running](./../README.md#compiling-and-running) first! # Validator that always succeeds From ddcf4a90566242d2c15da4f7bcdcdadcae957861 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 24 Mar 2022 17:40:36 -0400 Subject: [PATCH 266/584] Add instructions --- docs/DEVGUIDE.md | 15 +++++++++++++++ flake.nix | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/DEVGUIDE.md b/docs/DEVGUIDE.md index 458b44917..84ea65f6c 100644 --- a/docs/DEVGUIDE.md +++ b/docs/DEVGUIDE.md @@ -17,6 +17,7 @@ Looking to contribute to Plutarch? Looking for functionalities that are not curr - [Lower Level Examples](#lower-level-examples) - [Extracting `txInfoInputs` from `ScriptContext` manually (UNTYPED)](#extracting-txinfoinputs-from-scriptcontext-manually-untyped) - [Useful Links](#useful-links) +- [How to build docs](#how-to-build-docs) @@ -289,3 +290,17 @@ There's just one element in `txInfoInputs` in this example, and there it is. Of - [Plutus builtin functions and types](https://playground.plutus.iohkdev.io/doc/haddock//plutus-tx/html/PlutusTx-Builtins-Internal.html) - [Plutus Core builtin function identifiers, aka `DefaultFun`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultFun) - [Plutus Core types, aka `DefaultUni`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultUni) + +# How to build docs + +To run the docs locally, + +```sh-session +nix run .#docs +``` + +To build the static HTML site, + +```sh-session +nix build .#website +``` diff --git a/flake.nix b/flake.nix index b897f48c1..9fc347f2d 100644 --- a/flake.nix +++ b/flake.nix @@ -589,7 +589,7 @@ let pkgs = nixpkgsFor system; configFile = (pkgs.formats.yaml { }).generate "emanote-configFile" { - template.baseUrl = "/plutarch/"; + template.baseUrl = "/"; # Use this when pushing to github.io: "/plutarch/"; }; configDir = pkgs.runCommand "emanote-configDir" { } '' mkdir -p $out From 59d8fe87e0e006f2b261310e7809c8203d694bf3 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 24 Mar 2022 17:42:13 -0400 Subject: [PATCH 267/584] Remove unused --- docs/index.yaml | 6 ------ flake.nix | 1 - 2 files changed, 7 deletions(-) diff --git a/docs/index.yaml b/docs/index.yaml index 07bd629c2..0e33fc480 100644 --- a/docs/index.yaml +++ b/docs/index.yaml @@ -5,9 +5,3 @@ page: siteTitle: Plutarch headHtml: | - -pandoc: - rewriteClass: - # For use in notes with Prism.JS disabled (specifically code-block using - # pages like Mermaid) - code-block: border-2 p-1 overflow-auto my-1 bg-gray-50 \ No newline at end of file diff --git a/flake.nix b/flake.nix index 9fc347f2d..5f39b6ed9 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,6 @@ inputs.autodocodec.flake = false; inputs.emanote.url = "github:srid/emanote/rel-link-and-anchors"; - # inputs.emanote.inputs.ema.inputs.nixpkgs.follows = "nixpkgs"; outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, flake-compat, flake-compat-ci, hercules-ci-effects, ... }: let From cd6345dc27dda734963e2e2bc1ce4adcfd754aa8 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 24 Mar 2022 20:27:47 -0400 Subject: [PATCH 268/584] nix: Upstream PR merged, switch to master --- docs/index.md | 2 +- docs/index.yaml | 8 +++++++- flake.lock | 8 ++++---- flake.nix | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/index.md b/docs/index.md index 0a5874bd8..5a320541b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,3 +1,3 @@ -# Plutarch +# Plutarch Guide See [[README]] diff --git a/docs/index.yaml b/docs/index.yaml index 0e33fc480..cf26888a5 100644 --- a/docs/index.yaml +++ b/docs/index.yaml @@ -1,7 +1,13 @@ +# Emanote settings +# +# For list of possible settings and their defaults, see: +# https://github.com/srid/emanote/blob/master/default/index.yaml + template: + # Change this to 'pretty' to use URLs without .html suffix. urlStrategy: direct page: - siteTitle: Plutarch + siteTitle: Plutarch Guide headHtml: | diff --git a/flake.lock b/flake.lock index c37dda2e9..1517621cc 100644 --- a/flake.lock +++ b/flake.lock @@ -245,16 +245,16 @@ "unionmount": "unionmount" }, "locked": { - "lastModified": 1648155826, - "narHash": "sha256-GzgtVRMZxMInUSyDPd/wD7P47BBU5OqBvbhvH6QqbKs=", + "lastModified": 1648167902, + "narHash": "sha256-wtGOpbO8kW7TFeTEWOvc3zPzVNFzKaYLfQaoIjwv/KI=", "owner": "srid", "repo": "emanote", - "rev": "59480123fdf2f70c9ed0d898b8b120661546a83c", + "rev": "7e488a5057ac863ed8fea8665829ac74a36d3c03", "type": "github" }, "original": { "owner": "srid", - "ref": "rel-link-and-anchors", + "ref": "master", "repo": "emanote", "type": "github" } diff --git a/flake.nix b/flake.nix index 5f39b6ed9..4d83390b5 100644 --- a/flake.nix +++ b/flake.nix @@ -57,7 +57,7 @@ inputs.autodocodec.url = "github:srid/autodocodec/ghc921"; inputs.autodocodec.flake = false; - inputs.emanote.url = "github:srid/emanote/rel-link-and-anchors"; + inputs.emanote.url = "github:srid/emanote/master"; outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, flake-compat, flake-compat-ci, hercules-ci-effects, ... }: let From ad76e6a4d6efb6c8439e97135d24c780f8b475bc Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 25 Mar 2022 10:40:20 -0400 Subject: [PATCH 269/584] Fix incorrect link; change to Introduction.md#references --- docs/Introduction/Plutarch Types.md | 2 +- flake.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Introduction/Plutarch Types.md b/docs/Introduction/Plutarch Types.md index 1656b54a6..f454581c1 100644 --- a/docs/Introduction/Plutarch Types.md +++ b/docs/Introduction/Plutarch Types.md @@ -2,7 +2,7 @@ When this guide uses the term "Plutarch Type" we explicitly talk about a type of _kind_ `PType`. We will refer to _" types of kind `PType` "_ simply as `PType`s. We explicitly qualify when referring to the _kind_ `PType`. -> Note to beginners: Plutarch uses a language extension called `DataKinds`. This means that there are kinds beyond `Type` (aka `*`). We refer the read to \[[3](./../Concepts.md#references)] for an extended beginner-level introduction to these concepts if desired. +> Note to beginners: Plutarch uses a language extension called `DataKinds`. This means that there are kinds beyond `Type` (aka `*`). We refer the read to \[[3](./../Introduction.md#references)] for an extended beginner-level introduction to these concepts if desired. `PType` is defined as `type PType = S -> Type`; that is, it is a _kind synonym_ for `S -> Type` (where `S` and `Type` are themselves kinds). This synonym is important to keep in mind because when querying the kind of something like `PBool` in, say, GHCi, we will _not_ see `PType` as the kind. Instead, we get diff --git a/flake.lock b/flake.lock index 1517621cc..b265a2a1e 100644 --- a/flake.lock +++ b/flake.lock @@ -245,11 +245,11 @@ "unionmount": "unionmount" }, "locked": { - "lastModified": 1648167902, - "narHash": "sha256-wtGOpbO8kW7TFeTEWOvc3zPzVNFzKaYLfQaoIjwv/KI=", + "lastModified": 1648217348, + "narHash": "sha256-aIi7o8V+9NBYBe6eig1KrA/iKrZavd7rfiqm09lAVFs=", "owner": "srid", "repo": "emanote", - "rev": "7e488a5057ac863ed8fea8665829ac74a36d3c03", + "rev": "2863f214c20a024d13cae0976016974759d92633", "type": "github" }, "original": { From 2db1c8afe8331fabeb8ce74e5d163076f40e1a52 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 25 Mar 2022 12:26:27 -0400 Subject: [PATCH 270/584] Update emanote (for better code styling) --- docs/index.yaml | 1 + flake.lock | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/index.yaml b/docs/index.yaml index cf26888a5..964c3f6f5 100644 --- a/docs/index.yaml +++ b/docs/index.yaml @@ -6,6 +6,7 @@ template: # Change this to 'pretty' to use URLs without .html suffix. urlStrategy: direct + theme: green page: siteTitle: Plutarch Guide diff --git a/flake.lock b/flake.lock index b265a2a1e..54b8b6d0e 100644 --- a/flake.lock +++ b/flake.lock @@ -245,11 +245,11 @@ "unionmount": "unionmount" }, "locked": { - "lastModified": 1648217348, - "narHash": "sha256-aIi7o8V+9NBYBe6eig1KrA/iKrZavd7rfiqm09lAVFs=", + "lastModified": 1648225238, + "narHash": "sha256-aDQNIpiAAnM5j8oFdvxQzpBCv7JyW4uZgWKLwdZBRCQ=", "owner": "srid", "repo": "emanote", - "rev": "2863f214c20a024d13cae0976016974759d92633", + "rev": "cce3558d2d142a95ea39099e7b3b2e930b2f3a61", "type": "github" }, "original": { From 82c803bb49d8de6f650c7d70e9738907cc3c2b5a Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 25 Mar 2022 13:33:23 -0400 Subject: [PATCH 271/584] Escape PR numbers until ... ... https://github.com/srid/emanote/issues/167 is resolved. --- docs/Troubleshooting.md | 6 +++--- docs/Typeclasses/PConstant and PLift.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md index 1a055555c..bff2cb1c0 100644 --- a/docs/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -44,7 +44,7 @@ f = phoistAcyclic $ plam $ \n -> The issue here is that the AST is infinitely large. Plutarch will try to traverse this AST and will in the process not terminate, as there is no end to it. In these cases, consider using `pfix`. -Relevant issue: [#19](https://github.com/Plutonomicon/plutarch/issues/19) +Relevant issue: [\#19](https://github.com/Plutonomicon/plutarch/issues/19) # Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `hrecField`, or `pletFields`) @@ -68,7 +68,7 @@ Orphan instances! Specifically, in order for those type family applications to f This happens often with Plutarch ledger API types. If you didn't import `Plutarch.Api.V1.Contexts` (or some other module that imports it), and you're using `pconstant` on a `ScriptContext` - you'll get an error like this. The `PConstant` instance for `ScriptContext` hasn't been imported - so GHC has no idea what `PConstanted ScriptContext` is! -Relevant issue: [#252](https://github.com/Plutonomicon/plutarch/issues/252) +Relevant issue: [\#252](https://github.com/Plutonomicon/plutarch/issues/252) # Type match errors when using `pfield`/`hrecField` (or `OverloadedRecordDot` to access field) @@ -76,4 +76,4 @@ You might get nonsensical "Couldn't match type" errors when extracting fields. T You can fix this by providing an explicit type annotation on _the result_ of `pfield` or `hrecField` (or `OverloadedRecordDot` for field access). Otherwise, you can also explicitly use `pfromData` on the result. -Relevant issue: [#275](https://github.com/Plutonomicon/plutarch/issues/275) +Relevant issue: [\#275](https://github.com/Plutonomicon/plutarch/issues/275) diff --git a/docs/Typeclasses/PConstant and PLift.md b/docs/Typeclasses/PConstant and PLift.md index 53fe44494..9b3b99d2e 100644 --- a/docs/Typeclasses/PConstant and PLift.md +++ b/docs/Typeclasses/PConstant and PLift.md @@ -214,4 +214,4 @@ deriving via PConstant (Maybe h) ``` -Relevant issue: [#286](https://github.com/Plutonomicon/plutarch/issues/286) +Relevant issue: [\#286](https://github.com/Plutonomicon/plutarch/issues/286) From eab204950898fcd0ce3f2b431ac172249417c1ae Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> Date: Mon, 28 Mar 2022 14:58:12 -0400 Subject: [PATCH 272/584] Test in CI that HLS can process Haskell files --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 4d83390b5..9aad5651e 100644 --- a/flake.nix +++ b/flake.nix @@ -677,6 +677,7 @@ test-ghc810-dev = flakeApp2Derivation system "test-ghc810-dev"; "ghc810-plutarch:lib:plutarch" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch:lib:plutarch"; "ghc810-plutarch:lib:plutarch-test" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch-test:lib:plutarch-test"; + hls = checkedShellScript system "hls" "${self.project.${system}.pkgs.haskell-language-server}/bin/haskell-language-server"; }); # Because `nix flake check` does not work with haskell.nix (due to IFD), # we provide this attribute for running the checks locally, using: From 716437211ae261f187eec750ff01fe9a72cde4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Boros?= Date: Thu, 31 Mar 2022 01:40:39 +0300 Subject: [PATCH 273/584] update hercules-ci-effects flake --- flake.lock | 187 +++++------------------------------------------------ 1 file changed, 16 insertions(+), 171 deletions(-) diff --git a/flake.lock b/flake.lock index 54b8b6d0e..2f24881b2 100644 --- a/flake.lock +++ b/flake.lock @@ -277,11 +277,11 @@ }, "flake-compat-ci": { "locked": { - "lastModified": 1641672839, - "narHash": "sha256-Bdwv+DKeEMlRNPDpZxSz0sSrqQBvdKO5fZ8LmvrgCOU=", + "lastModified": 1646664117, + "narHash": "sha256-AX2VewPcS9eRsoirVHfnk07MHAOH6CTDiD10XtRaZbk=", "owner": "hercules-ci", "repo": "flake-compat-ci", - "rev": "e832114bc18376c0f3fa13c19bf5ff253cc6570a", + "rev": "e588637b2eec4261ed0d36335c83a117f2744dea", "type": "github" }, "original": { @@ -338,39 +338,6 @@ "type": "github" } }, - "flake-compat_5": { - "flake": false, - "locked": { - "lastModified": 1606424373, - "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", - "type": "github" - }, - "original": { - "owner": "edolstra", - "ref": "master", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_6": { - "flake": false, - "locked": { - "lastModified": 1606424373, - "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "locked": { "lastModified": 1644229661, @@ -649,42 +616,16 @@ "type": "github" } }, - "hercules-ci-agent": { - "inputs": { - "flake-compat": "flake-compat_6", - "nix-darwin": "nix-darwin", - "nixos-20_09": "nixos-20_09", - "nixos-unstable": "nixos-unstable", - "pre-commit-hooks-nix": "pre-commit-hooks-nix" - }, - "locked": { - "lastModified": 1642766877, - "narHash": "sha256-EXvI+1cKZHWfAaRV1PrSrQe0knc4rg5vMF4qz6/5bkI=", - "owner": "hercules-ci", - "repo": "hercules-ci-agent", - "rev": "0aa916f487be7da03bc2a6dec2ac7149b05499c5", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "ref": "master", - "repo": "hercules-ci-agent", - "type": "github" - } - }, "hercules-ci-effects": { "inputs": { - "flake-compat": "flake-compat_5", - "hercules-ci-agent": "hercules-ci-agent", - "nixpkgs": "nixpkgs_4", - "nixpkgs-nixops": "nixpkgs-nixops" + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1641914281, - "narHash": "sha256-3qJ6tDPkrsFqm4E74JROZlQbnKKLNTHV7QOD1LdcVqs=", + "lastModified": 1647711660, + "narHash": "sha256-ZoV/oAH8g4NYeTzC7OCZnlM7l0hNBs0nUHf4l1+lmDc=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "2e165352d92782e7ae149f4f1a9b3174f718a3af", + "rev": "d17e41cfb454d07f5d8d3b667bf45b079d868541", "type": "github" }, "original": { @@ -758,24 +699,6 @@ "type": "github" } }, - "nix-darwin": { - "inputs": { - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1622060422, - "narHash": "sha256-hPVlvrAyf6zL7tTx0lpK+tMxEfZeMiIZ/A2xaJ41WOY=", - "owner": "LnL7", - "repo": "nix-darwin", - "rev": "007d700e644ac588ad6668e6439950a5b6e2ff64", - "type": "github" - }, - "original": { - "owner": "LnL7", - "repo": "nix-darwin", - "type": "github" - } - }, "nix-tools": { "flake": false, "locked": { @@ -792,38 +715,6 @@ "type": "github" } }, - "nixos-20_09": { - "locked": { - "lastModified": 1623585158, - "narHash": "sha256-AjK7M1/six8IBPOI28nm7yC2k8mZIR2F9QrOwFYHAS0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "115dbbe82eb4ec8aabf959068286468a68e0b244", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-20.09", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixos-unstable": { - "locked": { - "lastModified": 1630248577, - "narHash": "sha256-9d/yq96TTrnF7qjA6wPYk+rYjWAXwfUmwk3qewezSeg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1647350163, @@ -888,22 +779,6 @@ "type": "github" } }, - "nixpkgs-nixops": { - "locked": { - "lastModified": 1630248577, - "narHash": "sha256-9d/yq96TTrnF7qjA6wPYk+rYjWAXwfUmwk3qewezSeg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512", - "type": "github" - } - }, "nixpkgs-unstable": { "locked": { "lastModified": 1644486793, @@ -936,35 +811,21 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1602411953, - "narHash": "sha256-gbupmxRpoQZqL5NBQCJN2GI5G7XDEHHHYKhVwEj5+Ps=", - "owner": "LnL7", - "repo": "nixpkgs", - "rev": "f780534ea2d0c12e62607ff254b6b45f46653f7a", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1633463774, - "narHash": "sha256-y3GjapcRzd42NgebQ4sx5GFJ53dYqNdF3UQu7/t6mUg=", - "owner": "hercules-ci", + "lastModified": 1647297614, + "narHash": "sha256-ulGq3W5XsrBMU/u5k9d4oPy65pQTkunR4HKKtTq0RwY=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "c70f908fd1f129aede2744d4385fae57d2e252b1", + "rev": "73ad5f9e147c0d2a2061f1d4bd91e05078dc0b58", "type": "github" }, "original": { - "owner": "hercules-ci", - "ref": "init-nixops-hercules-ci", + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "flake": false, "locked": { "lastModified": 1628785280, @@ -1030,8 +891,8 @@ "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", "iohk-nix": "iohk-nix_2", - "nixpkgs": "nixpkgs_5", - "pre-commit-hooks-nix": "pre-commit-hooks-nix_2", + "nixpkgs": "nixpkgs_4", + "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sphinxcontrib-haddock": "sphinxcontrib-haddock", "stackage-nix": "stackage-nix" }, @@ -1070,22 +931,6 @@ } }, "pre-commit-hooks-nix": { - "flake": false, - "locked": { - "lastModified": 1622650193, - "narHash": "sha256-qSzUpJDv04ajS9FXoCq6NjVF3qOt9IiGIiGh0P8amyw=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "0398f0649e0a741660ac5e8216760bae5cc78579", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "pre-commit-hooks-nix_2": { "flake": false, "locked": { "lastModified": 1624971177, From 9859c1b9fa133e24a6fa852cd51277e4e76ef56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Boros?= Date: Thu, 31 Mar 2022 16:26:22 +0300 Subject: [PATCH 274/584] update ci setup to hercules 0.9 format --- ci.nix | 3 --- flake.lock | 33 --------------------------------- flake.nix | 14 ++------------ 3 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 ci.nix diff --git a/ci.nix b/ci.nix deleted file mode 100644 index 1f71eca89..000000000 --- a/ci.nix +++ /dev/null @@ -1,3 +0,0 @@ -if builtins?getFlake -then (builtins.getFlake (toString ./.)).ciNix -else (import ./flake-compat.nix).defaultNix.ciNix diff --git a/flake.lock b/flake.lock index 2f24881b2..e6b63f73b 100644 --- a/flake.lock +++ b/flake.lock @@ -275,21 +275,6 @@ "type": "github" } }, - "flake-compat-ci": { - "locked": { - "lastModified": 1646664117, - "narHash": "sha256-AX2VewPcS9eRsoirVHfnk07MHAOH6CTDiD10XtRaZbk=", - "owner": "hercules-ci", - "repo": "flake-compat-ci", - "rev": "e588637b2eec4261ed0d36335c83a117f2744dea", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-compat-ci", - "type": "github" - } - }, "flake-compat_2": { "flake": false, "locked": { @@ -322,22 +307,6 @@ "type": "github" } }, - "flake-compat_4": { - "flake": false, - "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "locked": { "lastModified": 1644229661, @@ -972,8 +941,6 @@ "cardano-prelude": "cardano-prelude", "cryptonite": "cryptonite", "emanote": "emanote", - "flake-compat": "flake-compat_4", - "flake-compat-ci": "flake-compat-ci", "flat": "flat", "foundation": "foundation", "haskell-language-server": "haskell-language-server", diff --git a/flake.nix b/flake.nix index 9aad5651e..3316e9ebe 100644 --- a/flake.nix +++ b/flake.nix @@ -3,12 +3,7 @@ inputs.haskell-nix.url = "github:L-as/haskell.nix?ref=master"; inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; - inputs.flake-compat-ci.url = "github:hercules-ci/flake-compat-ci"; inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; - inputs.flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; inputs.iohk-nix.url = "github:input-output-hk/iohk-nix"; inputs.iohk-nix.flake = false; @@ -59,7 +54,7 @@ inputs.emanote.url = "github:srid/emanote/master"; - outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, flake-compat, flake-compat-ci, hercules-ci-effects, ... }: + outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, hercules-ci-effects, ... }: let extraSources = [ { @@ -738,11 +733,6 @@ } ); }; - - ciNix = args@{ src }: flake-compat-ci.lib.recurseIntoFlakeWith { - flake = self; - systems = [ "x86_64-linux" ]; - effectsArgs = args; - }; + herculesCI.ciSystems = [ "x86_64-linux" ]; }; } From 9eae1083ad18352d23f1eaa70e170c71f9953219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Boros?= Date: Fri, 1 Apr 2022 11:16:56 +0300 Subject: [PATCH 275/584] update ci setup to Hercules 0.9 format --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 3316e9ebe..dccb77e2c 100644 --- a/flake.nix +++ b/flake.nix @@ -700,13 +700,13 @@ ); devShell = perSystem (system: self.flake.${system}.devShell); - effects = { src }: + effects = { ref }: let pkgs = nixpkgs.legacyPackages.x86_64-linux; hci-effects = hercules-ci-effects.lib.withPkgs pkgs; in { - gh-pages = hci-effects.runIf (src.ref == "refs/heads/master") ( + gh-pages = hci-effects.runIf (ref == "refs/heads/master") ( hci-effects.mkEffect { src = self; buildInputs = with pkgs; [ openssh git ]; From 12672ff6a9c767b2c4663b81319d894b534bb2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 1 Apr 2022 18:38:15 -0400 Subject: [PATCH 276/584] Export ClosedTerm, POpaque, and popaque from Prelude --- Plutarch/Api/V1.hs | 2 +- Plutarch/Prelude.hs | 5 +++++ plutarch-test/common/Plutarch/Test/Golden.hs | 2 +- plutarch-test/common/Plutarch/Test/Property/Extra.hs | 1 - plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs | 2 +- plutarch-test/common/Plutarch/Test/Property/Marshal.hs | 1 - plutarch-test/conditional/Plutarch/TryFromSpec.hs | 2 -- plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 1 - plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs | 2 +- plutarch-test/plutarch-base/Plutarch/RationalSpec.hs | 1 - plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs | 1 - plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs | 1 - 12 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 8bf19e4d4..a9c49e30b 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -96,7 +96,7 @@ import Data.Coerce (coerce) import qualified Plutus.V1.Ledger.Api as Plutus import qualified Plutus.V1.Ledger.Scripts as Plutus -import Plutarch (ClosedTerm, POpaque, compile) +import Plutarch (compile) import Plutarch.Api.Internal.Scripts (hashScriptWithPrefix) import Plutarch.Api.V1.Contexts (PScriptContext) import Plutarch.Prelude diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index dfa1de106..759519708 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -3,6 +3,7 @@ module Plutarch.Prelude ( (:-->), PDelayed, Term, + ClosedTerm, plam, plam', papp, @@ -96,6 +97,10 @@ module Plutarch.Prelude ( -- * Scott encoded pair type and utilities PPair (..), + -- * Opaque type + POpaque (POpaque), + popaque, + -- * Builtin types and utilities PData, pfstBuiltin, diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 2c10c8e94..b1f8631f7 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -45,7 +45,7 @@ import Test.Syd ( pureGoldenTextFile, ) -import Plutarch (ClosedTerm, compile, printScript) +import Plutarch (compile, printScript) import Plutarch.Evaluate (evalScript) import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Prelude diff --git a/plutarch-test/common/Plutarch/Test/Property/Extra.hs b/plutarch-test/common/Plutarch/Test/Property/Extra.hs index c0b9fe93c..3a0d8377f 100644 --- a/plutarch-test/common/Plutarch/Test/Property/Extra.hs +++ b/plutarch-test/common/Plutarch/Test/Property/Extra.hs @@ -10,7 +10,6 @@ module Plutarch.Test.Property.Extra ( import Hedgehog (Gen, Property) -import Plutarch (ClosedTerm) import Plutarch.Prelude import Plutarch.Test.Property.HaskEquiv ( diff --git a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs index 848d17c79..ee68c636f 100644 --- a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs +++ b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs @@ -35,7 +35,7 @@ import Plutus.V1.Ledger.Scripts (Script (Script, unScript)) import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) -import Plutarch (ClosedTerm, compile) +import Plutarch (compile) import Plutarch.Evaluate (EvalError, evalScript') import Plutarch.Prelude import Plutarch.Test.Property.Marshal (Marshal (marshal)) diff --git a/plutarch-test/common/Plutarch/Test/Property/Marshal.hs b/plutarch-test/common/Plutarch/Test/Property/Marshal.hs index 045dea127..f18238c75 100644 --- a/plutarch-test/common/Plutarch/Test/Property/Marshal.hs +++ b/plutarch-test/common/Plutarch/Test/Property/Marshal.hs @@ -5,7 +5,6 @@ module Plutarch.Test.Property.Marshal ( Marshal (marshal), ) where -import Plutarch (ClosedTerm) import Plutarch.Lift (PLifted) import Plutarch.Prelude diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index ca7a1df0d..799d56fdc 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -40,8 +40,6 @@ import Plutarch.Test ( (@|), ) -import Plutarch (ClosedTerm, popaque) - import Plutarch.Unsafe ( punsafeCoerce, ) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 6ad37fd5b..c31b9612e 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -8,7 +8,6 @@ import Plutus.V1.Ledger.Api import qualified Plutus.V1.Ledger.Interval as Interval import qualified Plutus.V1.Ledger.Value as Value -import Plutarch (popaque) import Plutarch.Api.V1 ( PCredential, PCurrencySymbol, diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index d000de95e..aaf5e6261 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -4,7 +4,7 @@ module Plutarch.PlutusTypeSpec (spec) where import Test.Syd -import Plutarch (ClosedTerm, pcon', pmatch') +import Plutarch (pcon', pmatch') import Plutarch.Api.V1 ( PAddress (PAddress), PCredential (PPubKeyCredential, PScriptCredential), diff --git a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs index 94af1bb6e..c6b00205b 100644 --- a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs @@ -2,7 +2,6 @@ module Plutarch.RationalSpec (spec) where import Test.Syd -import Plutarch.Internal (ClosedTerm) import Plutarch.Prelude import Plutarch.Rational (pproperFraction, ptruncate) import Plutarch.Test diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 693f87259..6f559c2d8 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -28,7 +28,6 @@ import Codec.Serialise (Serialise, encode) import Data.ByteString (ByteString) import qualified Data.ByteString.Base16 as Base16 import qualified Data.Text.Encoding as TE -import Plutarch (ClosedTerm, POpaque, popaque) import Plutarch.Api.V1 ( PScriptContext, mintingPolicySymbol, diff --git a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs index d783f9e24..4e7bf8eb7 100644 --- a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs @@ -3,7 +3,6 @@ module Plutarch.UPLCSpec (spec) where import qualified PlutusCore as PLC import Test.Syd -import Plutarch (POpaque) import Plutarch.Internal (punsafeConstantInternal) import Plutarch.Prelude import Plutarch.Test From 69fe972777e37abcc4fcec008dce2a1a3f092eec Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sat, 2 Apr 2022 10:19:31 +0000 Subject: [PATCH 277/584] Try to fix CI --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index dccb77e2c..3d639e9a9 100644 --- a/flake.nix +++ b/flake.nix @@ -700,7 +700,7 @@ ); devShell = perSystem (system: self.flake.${system}.devShell); - effects = { ref }: + effects = { ref, ... }: let pkgs = nixpkgs.legacyPackages.x86_64-linux; hci-effects = hercules-ci-effects.lib.withPkgs pkgs; From 25f2954986c7d8826ae6d8eeefc20b294c4c6c87 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:32:12 +0530 Subject: [PATCH 278/584] Remove `hrecField` export --- Plutarch/DataRepr.hs | 1 - Plutarch/Prelude.hs | 3 ++- docs/README.md | 4 ++-- docs/Tricks/Don't duplicate work.md | 2 +- ...aIndexed, Haskell ADTs, and PIsDataRepr.md | 2 +- docs/Troubleshooting.md | 14 ++++++------- .../PIsDataRepr and PDataFields.md | 8 ++++---- .../conditional/Plutarch/FieldSpec.hs | 6 +++--- .../conditional/Plutarch/TryFromSpec.hs | 4 +--- .../plutarch-base/Plutarch/ApiSpec.hs | 10 ++++------ .../plutarch-base/Plutarch/POrdSpec.hs | 20 +++++++++---------- 11 files changed, 35 insertions(+), 39 deletions(-) diff --git a/Plutarch/DataRepr.hs b/Plutarch/DataRepr.hs index 181952638..fa5ebc7b8 100644 --- a/Plutarch/DataRepr.hs +++ b/Plutarch/DataRepr.hs @@ -20,7 +20,6 @@ module Plutarch.DataRepr ( F.PDataFields (ptoFields, type PFields), F.pletFields, F.pfield, - F.hrecField, F.HRec, ) where diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index dfa1de106..a0d3bc4cc 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -113,8 +113,8 @@ module Plutarch.Prelude ( pdcons, pdnil, pfield, + getField, pletFields, - hrecField, -- * Tracing ptrace, @@ -166,3 +166,4 @@ import Plutarch.String import Plutarch.TermCont import Plutarch.Trace import Plutarch.Unit +import GHC.Records (getField) diff --git a/docs/README.md b/docs/README.md index dc82ac11a..b3ab4ce53 100644 --- a/docs/README.md +++ b/docs/README.md @@ -147,11 +147,11 @@ Due to the highly abstracted nature of Plutarch and its utilization of advanced - [No instance for `PUnsafeLiftDecl a`](./Troubleshooting.md#no-instance-for-punsafeliftdecl-a) - [Couldn't match representation of type: ... arising from the 'deriving' clause](./Troubleshooting.md#couldnt-match-representation-of-type--arising-from-the-deriving-clause) - [Infinite loop / Infinite AST](./Troubleshooting.md#infinite-loop--infinite-ast) -- [Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `hrecField`, or `pletFields`)](./Troubleshooting.md#couldnt-match-type-plutarchdatareprinternalpunlabel--arising-from-a-use-of-pfield-or-hrecfield-or-pletfields) +- [Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `getField`, or `pletFields`)](./Troubleshooting.md#couldnt-match-type-plutarchdatareprinternalpunlabel--arising-from-a-use-of-pfield-or-getField-or-pletfields) - [Expected a type, but "fieldName" has kind `GHC.Types.Symbol`](./Troubleshooting.md#expected-a-type-but-fieldname-has-kind-ghctypessymbol) - [Lifting `PAsData`](./Troubleshooting.md#lifting-pasdata) - [Couldn't match type `PLifted (PConstanted Foo)` with `Foo`](./Troubleshooting.md#couldnt-match-type-plifted-pconstanted-foo-with-foo) -- [Type match errors when using `pfield`/`hrecField` (or `OverloadedRecordDot` to access field)](./Troubleshooting.md#type-match-errors-when-using-pfieldhrecfield-or-overloadedrecorddot-to-access-field) +- [Type match errors when using `pfield`/`getField` (or `OverloadedRecordDot` to access field)](./Troubleshooting.md#type-match-errors-when-using-pfieldgetField-or-overloadedrecorddot-to-access-field) # Useful Links diff --git a/docs/Tricks/Don't duplicate work.md b/docs/Tricks/Don't duplicate work.md index 6b7fb61e1..8294c4cdd 100644 --- a/docs/Tricks/Don't duplicate work.md +++ b/docs/Tricks/Don't duplicate work.md @@ -118,7 +118,7 @@ In general, `plet`ing something back-to-back several times will be optimized to You should also `plet` local bindings! In particular, if you applied a function (Plutarch level or Haskell level) to obtain a value, then bound that value to a variable e.g. with `let` or `where`, then avoid using it multiple times. The binding will simply get inlined as the function application - and it'll keep getting re-evaluated. You should `plet` it first! -This also applies to field accesses using `OverloadedRecordDot`. When you do `ctx.purpose`, it really gets translated to `hrecField @"purpose" ctx`, which is a function call! If you use the field multiple times, `plet` it first. +This also applies to field accesses using `OverloadedRecordDot`. When you do `ctx.purpose`, it really gets translated to `getField @"purpose" ctx`, which is a function call! If you use the field multiple times, `plet` it first. Another slightly obscure case can be observed in scott encoded types. When you build a scott encoded type using `pcon` - the Plutarch terms you use as fields are simply inlined within the scott encoded type. As such, `pcon $ PPair ` ends up like: diff --git a/docs/Tricks/makeIsDataIndexed, Haskell ADTs, and PIsDataRepr.md b/docs/Tricks/makeIsDataIndexed, Haskell ADTs, and PIsDataRepr.md index 27f7b4dc7..badaa4608 100644 --- a/docs/Tricks/makeIsDataIndexed, Haskell ADTs, and PIsDataRepr.md +++ b/docs/Tricks/makeIsDataIndexed, Haskell ADTs, and PIsDataRepr.md @@ -44,7 +44,7 @@ newtype PTxInfo (s :: S) , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) , "validRange" ':= PPOSIXTimeRange , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) - , "data" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) + , "datums" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) , "id" ':= PTxId ] ) diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md index bff2cb1c0..27084fb61 100644 --- a/docs/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -6,11 +6,11 @@ - [No instance for `PUnsafeLiftDecl a`](#no-instance-for-punsafeliftdecl-a) - [Couldn't match representation of type: ... arising from the 'deriving' clause](#couldnt-match-representation-of-type--arising-from-the-deriving-clause) - [Infinite loop / Infinite AST](#infinite-loop--infinite-ast) -- [Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `hrecField`, or `pletFields`)](#couldnt-match-type-plutarchdatareprinternalpunlabel--arising-from-a-use-of-pfield-or-hrecfield-or-pletfields) +- [Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `getField`, or `pletFields`)](#couldnt-match-type-plutarchdatareprinternalpunlabel--arising-from-a-use-of-pfield-or-getfield-or-pletfields) - [Expected a type, but "fieldName" has kind `GHC.Types.Symbol`](#expected-a-type-but-fieldname-has-kind-ghctypessymbol) - [Lifting `PAsData`](#lifting-pasdata) - [Couldn't match type `PLifted (PConstanted Foo)` with `Foo`](#couldnt-match-type-plifted-pconstanted-foo-with-foo) -- [Type match errors when using `pfield`/`hrecField` (or `OverloadedRecordDot` to access field)](#type-match-errors-when-using-pfieldhrecfield-or-overloadedrecorddot-to-access-field) +- [Type match errors when using `pfield`/`getField` (or `OverloadedRecordDot` to access field)](#type-match-errors-when-using-pfieldgetfield-or-overloadedrecorddot-to-access-field) @@ -46,13 +46,13 @@ The issue here is that the AST is infinitely large. Plutarch will try to travers Relevant issue: [\#19](https://github.com/Plutonomicon/plutarch/issues/19) -# Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `hrecField`, or `pletFields`) +# Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `getField`, or `pletFields`) -You might get some weird errors when using `pfield`/`hrecField`/`pletFields` like the above. Don't be scared! It just means that the type application you used is incorrect. Specifically, the type application names a non-existent field. Re-check the field name string you used in the type application for typos! +You might get some weird errors when using `pfield`/`getField`/`pletFields` like the above. Don't be scared! It just means that the type application you used is incorrect. Specifically, the type application names a non-existent field. Re-check the field name string you used in the type application for typos! # Expected a type, but "fieldName" has kind `GHC.Types.Symbol` -This just means the argument of a type application wasn't correctly promoted. Most likely arising from a usage of `pletFields`. In the case of `pfield` and `hrecField`, the argument of type application should have kind `Symbol`. A simple string literal representing the field name should work in this case. In the case of `pletFields`, the argument of type application should have kind `[Symbol]` - a type level list of types with kind `Symbol`. When you use a singleton list here, like `["foo"]` - it's actually parsed as a _regular_ list (like `[a]`). A regular list, of course, has kind `Type`. +This just means the argument of a type application wasn't correctly promoted. Most likely arising from a usage of `pletFields`. In the case of `pfield` and `getField`, the argument of type application should have kind `Symbol`. A simple string literal representing the field name should work in this case. In the case of `pletFields`, the argument of type application should have kind `[Symbol]` - a type level list of types with kind `Symbol`. When you use a singleton list here, like `["foo"]` - it's actually parsed as a _regular_ list (like `[a]`). A regular list, of course, has kind `Type`. All you need to do, is put a `'` (quote) infront of the list, like so- `@'["foo"]`. This will promote the `[a]` to the type level. @@ -70,10 +70,10 @@ This happens often with Plutarch ledger API types. If you didn't import `Plutarc Relevant issue: [\#252](https://github.com/Plutonomicon/plutarch/issues/252) -# Type match errors when using `pfield`/`hrecField` (or `OverloadedRecordDot` to access field) +# Type match errors when using `pfield`/`getField` (or `OverloadedRecordDot` to access field) You might get nonsensical "Couldn't match type" errors when extracting fields. This has to do with GHC incorrectly inferring the return type. Field extraction is meant to be polymorphic in its return type in the sense that it might either return a `Term s (PAsData p)` term, or simply a `Term s p` (automatic `pfromData`). Unfortunately, sometimes this polymorphism makes it harder for GHC to infer the types. -You can fix this by providing an explicit type annotation on _the result_ of `pfield` or `hrecField` (or `OverloadedRecordDot` for field access). Otherwise, you can also explicitly use `pfromData` on the result. +You can fix this by providing an explicit type annotation on _the result_ of `pfield` or `getField` (or `OverloadedRecordDot` for field access). Otherwise, you can also explicitly use `pfromData` on the result. Relevant issue: [\#275](https://github.com/Plutonomicon/plutarch/issues/275) diff --git a/docs/Typeclasses/PIsDataRepr and PDataFields.md b/docs/Typeclasses/PIsDataRepr and PDataFields.md index 979a39290..fed138662 100644 --- a/docs/Typeclasses/PIsDataRepr and PDataFields.md +++ b/docs/Typeclasses/PIsDataRepr and PDataFields.md @@ -115,7 +115,7 @@ Once a type has a `PDataFields` instance, field extraction can be done with thes - `pletFields` - `pfield` -- `hrecField` (when not using `OverloadedRecordDot` or [record dot preprocessor](https://hackage.haskell.org/package/record-dot-preprocessor)) +- `getField` (when not using `OverloadedRecordDot` or [record dot preprocessor](https://hackage.haskell.org/package/record-dot-preprocessor)) Each has its own purpose. However, `pletFields` is arguably the most general purpose and most efficient. Whenever you need to extract several fields from the same variable, you should use `pletFields`: @@ -157,15 +157,15 @@ You can then access the fields on this `HRec` using `OverloadedRecordDot`. Next up is `pfield`. You should _only ever_ use this if you just want one field from a variable and no more. Its usage is simply `pfield @"fieldName" # variable`. You can, however, also use `pletFields` in this case (e.g. `pletFields @'["fieldName"] variable`). `pletFields` with a singular field has the same efficiency as `pfield`! -Finally, `hrecField` is merely there to supplement the lack of record dot syntax. See: [Alternative to `OverloadedRecordDot`](#alternatives-to-overloadedrecorddot). +Finally, `getField` is merely there to supplement the lack of record dot syntax. See: [Alternative to `OverloadedRecordDot`](#alternatives-to-overloadedrecorddot). -> Note: An important thing to realize is that `pfield` and `hrecField` (or overloaded record dot on `HRec`) are _return type polymorphic_. They can return both `PAsData Foo` or `Foo` terms, depending on the surrounding context. This is very useful in the case of `pmatch`, as `pmatch` doesn't work on `PAsData` terms. So you can simply write `pmatch $ pfield ...` and `pfield` will correctly choose to _unwrap_ the `PAsData` term. +> Note: An important thing to realize is that `pfield` and `getField` (or overloaded record dot on `HRec`) are _return type polymorphic_. They can return both `PAsData Foo` or `Foo` terms, depending on the surrounding context. This is very useful in the case of `pmatch`, as `pmatch` doesn't work on `PAsData` terms. So you can simply write `pmatch $ pfield ...` and `pfield` will correctly choose to _unwrap_ the `PAsData` term. ### Alternatives to `OverloadedRecordDot` If `OverloadedRecordDot` is not available, you can also try using the [record dot preprocessor plugin](https://hackage.haskell.org/package/record-dot-preprocessor). -If you don't want to use either, you can simply use `hrecField`. In fact, `ctx.purpose` above just translates to `hrecField @"purpose" ctx`. Nothing magical there! +If you don't want to use either, you can simply use `getField`. In fact, `ctx.purpose` above just translates to `getField @"purpose" ctx`. Nothing magical there! ## All about constructing data values diff --git a/plutarch-test/conditional/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs index f6cef6642..83d0335fe 100644 --- a/plutarch-test/conditional/Plutarch/FieldSpec.hs +++ b/plutarch-test/conditional/Plutarch/FieldSpec.hs @@ -65,12 +65,12 @@ spec = do @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing in pmatch addr $ \(PAddress addrFields) -> pletFields @'["credential", "stakingCredential"] addrFields $ \y -> - ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y + ppairDataBuiltin # getField @"credential" y # getField @"stakingCredential" y "pfield" @\ do "newtype" @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing in pletFields @'["credential", "stakingCredential"] addr $ \y -> - ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y + ppairDataBuiltin # getField @"credential" y # getField @"stakingCredential" y "pfield-pletFields" @\ do "pfield" @\ do "single" @@ -80,7 +80,7 @@ spec = do "single" @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing in pletFields @'["credential"] addr $ \y -> - pfromData $ hrecField @"credential" y + pfromData $ getField @"credential" y -------------------------------------------------------------------------------- diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index ca7a1df0d..beb02425d 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -81,8 +81,6 @@ import qualified Plutarch.ApiSpec as Api import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) -import GHC.Records (getField) - spec :: Spec spec = do describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do @@ -333,7 +331,7 @@ validator = phoistAcyclic $ pure $ pfield @"_0" # dhash data' :: Term _ (PBuiltinList (PAsData (PTuple PDatumHash PDatum))) - data' = pfield @"data" # txInfo + data' = pfield @"datums" # txInfo outputs :: Term _ (PBuiltinList (PAsData PTxOut)) outputs = pfield @"outputs" # txInfo diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 6ad37fd5b..76b1fa437 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -23,8 +23,6 @@ import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude import Plutarch.Test --- import PlutusTx.AssocMap as PlutusMap - spec :: Spec spec = do describe "api" $ do @@ -167,11 +165,11 @@ getSym = checkSignatoryCont :: forall s. Term s (PPubKeyHash :--> PScriptContext :--> PUnit) checkSignatoryCont = plam $ \ph ctx' -> pletFields @["txInfo", "purpose"] ctx' $ \ctx -> (`runCont` id) $ do - purpose <- cont (pmatch $ hrecField @"purpose" ctx) + purpose <- cont (pmatch $ getField @"purpose" ctx) pure $ case purpose of PSpending _ -> let signatories :: Term s (PBuiltinList (PAsData PPubKeyHash)) - signatories = pfield @"signatories" # hrecField @"txInfo" ctx + signatories = pfield @"signatories" # getField @"txInfo" ctx in pif (pelem # pdata ph # signatories) -- Success! @@ -185,9 +183,9 @@ checkSignatoryCont = plam $ \ph ctx' -> checkSignatoryTermCont :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) checkSignatoryTermCont = plam $ \ph ctx' -> unTermCont $ do ctx <- tcont $ pletFields @["txInfo", "purpose"] ctx' - tcont (pmatch $ hrecField @"purpose" ctx) >>= \case + tcont (pmatch $ getField @"purpose" ctx) >>= \case PSpending _ -> do - let signatories = pfield @"signatories" # hrecField @"txInfo" ctx + let signatories = pfield @"signatories" # getField @"txInfo" ctx pure $ pif (pelem # pdata ph # pfromData signatories) diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index c730b484f..b484581d2 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -207,15 +207,15 @@ ltTrip trip1 trip2 = unTermCont $ do a <- tcont $ pletFields @'["x", "y", "z"] trip1 b <- tcont $ pletFields @'["x", "y", "z"] trip2 - x <- tcont . plet . pfromData $ hrecField @"x" a - x' <- tcont . plet . pfromData $ hrecField @"x" b + x <- tcont . plet . pfromData $ getField @"x" a + x' <- tcont . plet . pfromData $ getField @"x" b pure $ x #< x' #|| ( x #== x' #&& ( unTermCont $ do - y <- tcont . plet . pfromData $ hrecField @"y" a - y' <- tcont . plet . pfromData $ hrecField @"y" b - pure $ y #< y' #|| (y #== y' #&& pfromData (hrecField @"z" a) #< pfromData (hrecField @"z" b)) + y <- tcont . plet . pfromData $ getField @"y" a + y' <- tcont . plet . pfromData $ getField @"y" b + pure $ y #< y' #|| (y #== y' #&& pfromData (getField @"z" a) #< pfromData (getField @"z" b)) ) ) @@ -224,15 +224,15 @@ lteTrip trip1 trip2 = unTermCont $ do a <- tcont $ pletFields @'["x", "y", "z"] trip1 b <- tcont $ pletFields @'["x", "y", "z"] trip2 - x <- tcont . plet . pfromData $ hrecField @"x" a - x' <- tcont . plet . pfromData $ hrecField @"x" b + x <- tcont . plet . pfromData $ getField @"x" a + x' <- tcont . plet . pfromData $ getField @"x" b pure $ x #< x' #|| ( x #== x' #&& ( unTermCont $ do - y <- tcont . plet . pfromData $ hrecField @"y" a - y' <- tcont . plet . pfromData $ hrecField @"y" b - pure $ y #< y' #|| (y #== y' #&& pfromData (hrecField @"z" a) #<= pfromData (hrecField @"z" b)) + y <- tcont . plet . pfromData $ getField @"y" a + y' <- tcont . plet . pfromData $ getField @"y" b + pure $ y #< y' #|| (y #== y' #&& pfromData (getField @"z" a) #<= pfromData (getField @"z" b)) ) ) From 7fe587182856a54ad1c6b4fd52bd5620e35d9600 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:32:26 +0530 Subject: [PATCH 279/584] Add back `PValue` and `PMap` constructor exports --- Plutarch/Api/V1.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 8bf19e4d4..b519565cd 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -25,7 +25,7 @@ module Plutarch.Api.V1 ( type PStakeValidator, -- ** Value - Value.PValue, + Value.PValue (PValue), Value.PCurrencySymbol (PCurrencySymbol), Value.PTokenName (PTokenName), @@ -66,7 +66,7 @@ module Plutarch.Api.V1 ( Tx.PTxInInfo (PTxInInfo), -- ** AssocMap - AssocMap.PMap, + AssocMap.PMap (PMap), -- ** Others Maybe.PMaybeData (PDJust, PDNothing), From e396a9ac8723b039f15b18737beb72c959b7acfc Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:32:38 +0530 Subject: [PATCH 280/584] Rename `PTxInfo` `data` field to `datums` --- Plutarch/Api/V1/Contexts.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 8be0264eb..881bdbf2b 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -47,7 +47,7 @@ newtype PTxInfo (s :: S) , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) , "validRange" ':= PPOSIXTimeRange , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) - , "data" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) + , "datums" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) , "id" ':= PTxId ] ) From a4ade88bd5936d9456ca01c482c57837fc324b80 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:32:55 +0530 Subject: [PATCH 281/584] Add `PPOSIXTime` constructor export and `Num` instance --- Plutarch/Api/V1/Time.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/Time.hs b/Plutarch/Api/V1/Time.hs index 44f022666..3ac32f069 100644 --- a/Plutarch/Api/V1/Time.hs +++ b/Plutarch/Api/V1/Time.hs @@ -2,7 +2,7 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V1.Time ( - PPOSIXTime, + PPOSIXTime (PPOSIXTime), PPOSIXTimeRange, ) where @@ -20,6 +20,8 @@ newtype PPOSIXTime (s :: S) = PPOSIXTime (Term s PInteger) deriving (PlutusType, PIsData, PEq, POrd, PIntegral) via (DerivePNewtype PPOSIXTime PInteger) +deriving via (Term s (DerivePNewtype PPOSIXTime PInteger)) instance Num (Term s PPOSIXTime) + instance PUnsafeLiftDecl PPOSIXTime where type PLifted PPOSIXTime = Plutus.POSIXTime deriving via (DerivePConstantViaNewtype Plutus.POSIXTime PPOSIXTime PInteger) From 898f7b0a532eb4a8a4b3d6b5b4d5c89305ad2fbc Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:34:22 +0530 Subject: [PATCH 282/584] Change `PIsDataRepr` superclass to `PlutusType` Previously: `PMatch` --- Plutarch/DataRepr/Internal.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index f210f746d..447ccc712 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -56,7 +56,6 @@ import Generics.SOP ( import Plutarch ( Dig, PInner, - PMatch, PType, PlutusType, S, @@ -299,8 +298,7 @@ pmatchDataSum d handlers = applyHandlers _ DRHNil = [] applyHandlers args (DRHCons handler rest) = handler (punsafeCoerce args) : applyHandlers args rest --- TODO: This 'PMatch' constraint needs to be changed to 'PlutusType (breaking change). -class (PMatch a, PIsData a) => PIsDataRepr (a :: PType) where +class (PlutusType a, PIsData a) => PIsDataRepr (a :: PType) where type PIsDataReprRepr a :: [[PLabeledType]] type PIsDataReprRepr a = PDataRecordFields2 (PCode 'SI a) From 6b32762320a5cd78e03f6276df8e9a650352a3f5 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 4 Apr 2022 14:25:51 +0530 Subject: [PATCH 283/584] Fix formatting --- Plutarch/Prelude.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index a0d3bc4cc..959061bbf 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -148,6 +148,7 @@ module Plutarch.Prelude ( import Prelude () import Data.Kind (Type) +import GHC.Records (getField) import Plutarch import Plutarch.Bool import Plutarch.Builtin @@ -166,4 +167,3 @@ import Plutarch.String import Plutarch.TermCont import Plutarch.Trace import Plutarch.Unit -import GHC.Records (getField) From 68f25b635886511a5c751395eb8b13f067919158 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 4 Apr 2022 15:18:11 +0530 Subject: [PATCH 284/584] Update Run section --- docs/Run.md | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/docs/Run.md b/docs/Run.md index e78231b83..8701b9dc5 100644 --- a/docs/Run.md +++ b/docs/Run.md @@ -82,29 +82,34 @@ You can compile a Plutarch term using `compile` (from `Plutarch` module), making I often use these helper functions to test Plutarch quickly: ```haskell -import Data.Text (Text) -import Plutarch.Evaluate (evaluateScript) -import Plutarch (ClosedTerm, compile) -import Plutus.V1.Ledger.Api (ExBudget) -import Plutus.V1.Ledger.Scripts (Script (unScript), ScriptError, applyArguments) -import UntypedPlutusCore (DeBruijn, DefaultFun, DefaultUni, Program) -import PlutusTx (Data) - -eval :: ClosedTerm a -> Either ScriptError (ExBudget, [Text], Program DeBruijn DefaultUni DefaultFun ()) -eval x = fmap (\(a, b, s) -> (a, b, unScript s)) . evaluateScript $ compile x - -evalWithArgs :: ClosedTerm a -> [Data] -> Either ScriptError (ExBudget, [Text], Program DeBruijn DefaultUni DefaultFun ()) -evalWithArgs x args = fmap (\(a, b, s) -> (a, b, unScript s)) . evaluateScript . flip applyArguments args $ compile x +import Data.Text (Text) +import Plutarch (ClosedTerm, compile) +import Plutarch.Evaluate (evalScript, EvalError) +import Plutus.V1.Ledger.Api (Data, ExBudget) +import Plutus.V1.Ledger.Scripts (Script (unScript), applyArguments) +import UntypedPlutusCore (DeBruijn, DefaultFun, DefaultUni, Program) + +evalT :: ClosedTerm a -> (Either EvalError (Program DeBruijn DefaultUni DefaultFun ()), ExBudget, [Text]) +evalT x = evalWithArgsT x [] + +evalWithArgsT :: ClosedTerm a -> [Data] -> (Either EvalError (Program DeBruijn DefaultUni DefaultFun ()), ExBudget, [Text]) +evalWithArgsT x args = (\(res, budg, trcs) -> (fmap unScript res, budg, trcs)) + . evalScript + . flip applyArguments args + $ compile x ``` -The fields in the result triple correspond to execution budget (how much memory and CPU units were used), trace log, and script result - respectively. Often you're only interested in the script result, in that case you can use: +The fields in the result triple correspond to script result, execution budget (how much memory and CPU units were used), and trace log - respectively. Often you're only interested in the script result, in that case you can use: ```haskell -evalT :: ClosedTerm a -> Either ScriptError (Program DeBruijn DefaultUni DefaultFun ()) -evalT x = fmap (\(_, _, s) -> unScript s) . evaluateScript $ compile x - -evalWithArgsT :: ClosedTerm a -> [Data] -> Either ScriptError (Program DeBruijn DefaultUni DefaultFun ()) -evalWithArgsT x args = fmap (\(_, _, s) -> unScript s) . evaluateScript . flip applyArguments args $ compile x +evalT :: ClosedTerm a -> Either EvalError (Program DeBruijn DefaultUni DefaultFun ()) +evalT x = evalWithArgsT x [] + +evalWithArgsT :: ClosedTerm a -> [Data] -> Either EvalError (Program DeBruijn DefaultUni DefaultFun ()) +evalWithArgsT x args = (\(res, _, _) -> fmap unScript res) + . evalScript + . flip applyArguments args + $ compile x ``` > Note: You can pretty much ignore the UPLC types involved here. All it really means is that the result is a "UPLC program". When it's printed, it's pretty legible - especially for debugging purposes. Although not necessary to use Plutarch, you may find the [Plutonomicon UPLC guide](https://github.com/Plutonomicon/plutonomicon/blob/main/uplc.md) useful. From 0ba3bc683748db7075d893da30bdd93c587d2d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 4 Apr 2022 09:09:52 -0400 Subject: [PATCH 285/584] Removed the redundant import from 8.10-only test --- plutarch-test/conditional/Plutarch/FFISpec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index b3b19c7d4..cd726254d 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -5,7 +5,7 @@ module Plutarch.FFISpec (spec) where import GHC.Generics (Generic) import Generics.SOP qualified as SOP -import Plutarch (ClosedTerm, compile, printScript, printTerm) +import Plutarch (compile, printScript, printTerm) import Plutarch.Api.V1 (PCurrencySymbol, PPubKeyHash, PScriptContext, PTokenName, PTxInfo) import Plutarch.Evaluate (EvalError, evalScript) import Plutarch.FFI ( From 5eff514ebc36fe193faa46699eac7b3f2dd55c6d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 31 Mar 2022 17:26:45 -0400 Subject: [PATCH 286/584] Extend `nonReinstallablePkgs` outside of HLS, so we can use hspec. --- flake.nix | 95 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/flake.nix b/flake.nix index 3d639e9a9..cc869b435 100644 --- a/flake.nix +++ b/flake.nix @@ -154,54 +154,56 @@ ghcVersion = "ghc921"; + # https://github.com/input-output-hk/haskell.nix/issues/1177 + nonReinstallablePkgs = [ + "rts" + "ghc-heap" + "ghc-prim" + "integer-gmp" + "integer-simple" + "base" + "deepseq" + "array" + "ghc-boot-th" + "pretty" + "template-haskell" + # ghcjs custom packages + "ghcjs-prim" + "ghcjs-th" + "ghc-bignum" + "exceptions" + "stm" + "ghc-boot" + "ghc" + "Cabal" + "Win32" + "array" + "binary" + "bytestring" + "containers" + "directory" + "filepath" + "ghc-boot" + "ghc-compact" + "ghc-prim" + # "ghci" "haskeline" + "hpc" + "mtl" + "parsec" + "process" + "text" + "time" + "transformers" + "unix" + "xhtml" + "terminfo" + ]; + tools.fourmolu = { }; tools.haskell-language-server = { - modules = [{ - # https://github.com/input-output-hk/haskell.nix/issues/1177 - nonReinstallablePkgs = [ - "rts" - "ghc-heap" - "ghc-prim" - "integer-gmp" - "integer-simple" - "base" - "deepseq" - "array" - "ghc-boot-th" - "pretty" - "template-haskell" - # ghcjs custom packages - "ghcjs-prim" - "ghcjs-th" - "ghc-bignum" - "exceptions" - "stm" - "ghc-boot" - "ghc" - "Cabal" - "Win32" - "array" - "binary" - "bytestring" - "containers" - "directory" - "filepath" - "ghc-boot" - "ghc-compact" - "ghc-prim" - # "ghci" "haskeline" - "hpc" - "mtl" - "parsec" - "process" - "text" - "time" - "transformers" - "unix" - "xhtml" - "terminfo" - ]; - }]; + modules = [ + { inherit nonReinstallablePkgs; } + ]; compiler-nix-name = ghcVersion; # For some reason it doesn't use the latest version automatically. index-state = @@ -222,6 +224,7 @@ }; haskellModule = system: { + inherit nonReinstallablePkgs; # Needed only so we can use hspec; https://github.com/Plutonomicon/plutarch/issues/409 packages = { basement.src = "${inputs.foundation}/basement"; basement.components.library.postUnpack = "\n"; From 65f65bc0f0d7ce4d80fb0a3c791835963529022c Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 31 Mar 2022 17:27:05 -0400 Subject: [PATCH 287/584] Add TrailSpecM, for providing access to test hierarchy in golden tests --- plutarch-test/common/Plutarch/Test.hs | 1 + .../common/Plutarch/Test/TrailSpecMonad.hs | 65 +++++++++++++++++++ plutarch-test/plutarch-test.cabal | 5 ++ 3 files changed, 71 insertions(+) create mode 100644 plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index 67e9a9099..c7792d2c1 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -59,6 +59,7 @@ import Plutarch.Test.Golden ( (@\), (@|), ) +import Plutarch.Test.TrailSpecMonad () import qualified Plutus.V1.Ledger.Scripts as Scripts {- | diff --git a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs new file mode 100644 index 000000000..6f3642032 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs @@ -0,0 +1,65 @@ +module Plutarch.Test.TrailSpecMonad ( + -- * Types + TrailSpecM, + TrailSpec, + TrailSpecWith, + + -- * Functions + runTrailSpec, + ancestorTrail, + + -- * Variants of hspec functions that work in `TrailSpecM` monad + describe, + it, +) where + +import Control.Monad.Reader +import GHC.Stack (HasCallStack) +import Test.Hspec.Core.Spec (Arg, Example, SpecM) +import qualified Test.Hspec.Core.Spec +import Test.Hspec.Hedgehog (hedgehog, (===)) + +type TrailSpec = TrailSpecWith () + +type TrailSpecWith a = TrailSpecM (SpecM a) () + +{- | Like `SpecM`, but also leaves a trail from root node, allowing retrieval of + ancestor path from anywhere in the test hierarchy. See `ancestorTrail`. + + When using this to define your test hierarchy, you ought to use `describe` to + group sub-trees. Use `lift` to drop-down into the underlying `SpecM` monad. + + m ~ SpecM a +-} +newtype TrailSpecM m r = TrailSpecM (ReaderT [String] m r) + deriving newtype (Functor, Applicative, Monad, MonadTrans) + +-- | Go from `TrailSpecM` monad to `SpecM` monad +runTrailSpec :: TrailSpecM (SpecM a) r -> SpecM a r +runTrailSpec (TrailSpecM m) = runReaderT m [] + +-- | Return the ancestor groups, from immediate parent to the root. +ancestorTrail :: TrailSpecM (SpecM a) [String] +ancestorTrail = TrailSpecM ask + +-- | Like `Test.Hspec.Core.Spec.describe` but for `TrailSpecM`. +describe :: HasCallStack => String -> TrailSpecWith a -> TrailSpecWith a +describe s (TrailSpecM m) = + TrailSpecM . withReaderT (s :) $ do + env <- ask + lift $ Test.Hspec.Core.Spec.describe s $ runReaderT m env + +-- | Like `Test.Hspec.Core.Spec.it` but lifted to `TrailSpecM`. +it :: (HasCallStack, Example a) => String -> a -> TrailSpecWith (Arg a) +it s t = lift $ Test.Hspec.Core.Spec.it s t + +_test_trailSpec :: TrailSpec +_test_trailSpec = do + as0 <- ancestorTrail + it "ancestorTrail at root" . hedgehog $ do + as0 === [] + describe "child" $ do + describe "grandchild" $ do + as <- ancestorTrail + it "ancestorTrail" . hedgehog $ do + as === ["grandchild", "child"] diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 2194c4f98..7bf104fbe 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -82,6 +82,9 @@ common deps , filepath , generics-sop , hedgehog + , hspec + , hspec-core + , hspec-hedgehog , mtl , plutarch , plutarch-extra @@ -116,6 +119,7 @@ library Plutarch.Test.Property.HaskEquiv Plutarch.Test.Property.Marshal Plutarch.Test.Run + Plutarch.Test.TrailSpecMonad if flag(development) cpp-options: -DDevelopment @@ -179,6 +183,7 @@ executable plutarch-test Plutarch.Test.Property.HaskEquiv Plutarch.Test.Property.Marshal Plutarch.Test.Run + Plutarch.Test.TrailSpecMonad Plutarch.TraceSpec Plutarch.UnitSpec Plutarch.UPLCSpec From 77f6e9177e3e68834ea9b0a4dd9eeb10376349f1 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 1 Apr 2022 14:42:03 -0400 Subject: [PATCH 288/584] Start moving from sydtest to hspec+hedgehog Still to do, - unused goldens - hedgehog runner - ... The Plutarch.Test API remains more or less the same, except pgoldenSpec now runs in TrailSpec monad. This may be simplified further. --- flake.lock | 74 +------------------ flake.nix | 50 ------------- plutarch-test/Main.hs | 32 ++++---- plutarch-test/common/Plutarch/Test.hs | 30 ++++---- plutarch-test/common/Plutarch/Test/Golden.hs | 43 ++++++----- plutarch-test/common/Plutarch/Test/Run.hs | 27 +++---- plutarch-test/conditional/Plutarch/FFISpec.hs | 6 +- .../conditional/Plutarch/FieldSpec.hs | 3 +- .../conditional/Plutarch/MonadicSpec.hs | 4 +- .../conditional/Plutarch/TryFromSpec.hs | 15 +--- ...api.example.signatory.dev=true.uplc.golden | 4 +- plutarch-test/plutarch-base/BaseSpec.hs | 51 ++++++++++++- .../plutarch-base/Plutarch/ApiSpec.hs | 3 +- .../plutarch-base/Plutarch/BoolSpec.hs | 4 +- .../plutarch-base/Plutarch/ByteStringSpec.hs | 4 +- .../plutarch-base/Plutarch/EitherSpec.hs | 4 +- .../plutarch-base/Plutarch/IntegerSpec.hs | 4 +- .../plutarch-base/Plutarch/LiftSpec.hs | 4 +- .../plutarch-base/Plutarch/ListSpec.hs | 29 ++++---- .../plutarch-base/Plutarch/MaybeSpec.hs | 4 +- .../plutarch-base/Plutarch/PIsDataSpec.hs | 23 +++--- .../plutarch-base/Plutarch/PLamSpec.hs | 3 +- .../plutarch-base/Plutarch/POrdSpec.hs | 23 +++--- .../plutarch-base/Plutarch/PairSpec.hs | 4 +- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 7 +- .../plutarch-base/Plutarch/RationalSpec.hs | 5 +- .../plutarch-base/Plutarch/RecSpec.hs | 4 +- .../plutarch-base/Plutarch/RecursionSpec.hs | 4 +- .../plutarch-base/Plutarch/ScriptsSpec.hs | 3 +- .../plutarch-base/Plutarch/ShowSpec.hs | 3 +- .../plutarch-base/Plutarch/StringSpec.hs | 4 +- .../plutarch-base/Plutarch/TraceSpec.hs | 4 +- .../plutarch-base/Plutarch/UPLCSpec.hs | 3 +- .../plutarch-base/Plutarch/UnitSpec.hs | 4 +- plutarch-test/plutarch-extra/ExtraSpec.hs | 9 ++- .../plutarch-extra/Plutarch/ListUtilsSpec.hs | 20 ++--- plutarch-test/plutarch-test.cabal | 4 +- 37 files changed, 206 insertions(+), 316 deletions(-) diff --git a/flake.lock b/flake.lock index e6b63f73b..44abb0e1d 100644 --- a/flake.lock +++ b/flake.lock @@ -32,23 +32,6 @@ "type": "github" } }, - "autodocodec": { - "flake": false, - "locked": { - "lastModified": 1644358110, - "narHash": "sha256-X1TNZlmO2qDFk3OL4Z1v/gzvd3ouoACAiMweutsYek4=", - "owner": "srid", - "repo": "autodocodec", - "rev": "42b42a7407f33c6c74fa4e8c84906aebfed28daf", - "type": "github" - }, - "original": { - "owner": "srid", - "ref": "ghc921", - "repo": "autodocodec", - "type": "github" - } - }, "cabal-32": { "flake": false, "locked": { @@ -935,7 +918,6 @@ "root": { "inputs": { "Shrinker": "Shrinker", - "autodocodec": "autodocodec", "cardano-base": "cardano-base", "cardano-crypto": "cardano-crypto", "cardano-prelude": "cardano-prelude", @@ -954,28 +936,8 @@ ], "plutus": "plutus", "protolude": "protolude", - "safe-coloured-text": "safe-coloured-text", "sized-functors": "sized-functors", - "sydtest": "sydtest", - "th-extras": "th-extras", - "validity": "validity" - } - }, - "safe-coloured-text": { - "flake": false, - "locked": { - "lastModified": 1644357337, - "narHash": "sha256-sXSKw8m6O9K/H2BBiYqO5e4sJIo+9UP+UvEukRn28d8=", - "owner": "srid", - "repo": "safe-coloured-text", - "rev": "034f3612525568b422e0c62b52417d77b7cf31c2", - "type": "github" - }, - "original": { - "owner": "srid", - "ref": "ghc921", - "repo": "safe-coloured-text", - "type": "github" + "th-extras": "th-extras" } }, "sized-functors": { @@ -1043,23 +1005,6 @@ "type": "github" } }, - "sydtest": { - "flake": false, - "locked": { - "lastModified": 1645114028, - "narHash": "sha256-P6ZwwfFeN8fpi3fziz9yERTn7BfxdE/j/OofUu+4GdA=", - "owner": "srid", - "repo": "sydtest", - "rev": "9c6c7678f7aabe22e075aab810a6a2e304591d24", - "type": "github" - }, - "original": { - "owner": "srid", - "ref": "ghc921", - "repo": "sydtest", - "type": "github" - } - }, "tailwind-haskell": { "inputs": { "flake-compat": [ @@ -1134,23 +1079,6 @@ "repo": "unionmount", "type": "github" } - }, - "validity": { - "flake": false, - "locked": { - "lastModified": 1644358698, - "narHash": "sha256-dpMIu08qXMzy8Kilk/2VWpuwIsfqFtpg/3mkwt5pdjA=", - "owner": "srid", - "repo": "validity", - "rev": "f7982549b95d0ab727950dc876ca06b1862135ba", - "type": "github" - }, - "original": { - "owner": "srid", - "ref": "ghc921", - "repo": "validity", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index cc869b435..2ee8b61eb 100644 --- a/flake.nix +++ b/flake.nix @@ -42,16 +42,6 @@ inputs.haskell-language-server.url = "github:haskell/haskell-language-server"; inputs.haskell-language-server.flake = false; - # These use the PRs from https://github.com/NorfairKing/sydtest/issues/35 - inputs.sydtest.url = "github:srid/sydtest/ghc921"; - inputs.sydtest.flake = false; - inputs.validity.url = "github:srid/validity/ghc921"; - inputs.validity.flake = false; - inputs.safe-coloured-text.url = "github:srid/safe-coloured-text/ghc921"; - inputs.safe-coloured-text.flake = false; - inputs.autodocodec.url = "github:srid/autodocodec/ghc921"; - inputs.autodocodec.flake = false; - inputs.emanote.url = "github:srid/emanote/master"; outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, hercules-ci-effects, ... }: @@ -115,30 +105,6 @@ "word-array" ]; } - { - src = inputs.sydtest; - subdirs = [ - "sydtest" - "sydtest-discover" - "sydtest-aeson" - "sydtest-hedgehog" - ]; - } - { - src = inputs.validity; - subdirs = [ - "validity" - "validity-aeson" - ]; - } - { - src = inputs.autodocodec; - subdirs = [ - "autodocodec" - "autodocodec-schema" - "autodocodec-yaml" - ]; - } ]; supportedSystems = with nixpkgs.lib.systems.supported; tier1 ++ tier2 ++ tier3; @@ -476,11 +442,6 @@ modules = [ (haskellModule system) { - # Workaround missing support for build-tools: - # https://github.com/input-output-hk/haskell.nix/issues/231 - packages.plutarch-test.components.exes.plutarch-test.build-tools = [ - pkgSet.hsPkgs.sydtest-discover - ]; packages.plutarch-test.flags.development = flagDevelopment; packages.plutarch.flags.development = flagDevelopment; } @@ -497,7 +458,6 @@ pkgs'.hlint pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt - pkgSet.hsPkgs.sydtest-discover.components.exes.sydtest-discover ]; inherit tools; @@ -505,16 +465,6 @@ additional = ps: [ ps.plutus-ledger-api - # sydtest dependencies - ps.sydtest - ps.sydtest-discover - ps.sydtest-hedgehog - ps.sydtest-aeson - ps.validity - ps.validity-aeson - ps.autodocodec - ps.autodocodec-schema - ps.autodocodec-yaml #ps.shrinker #ps.shrinker-testing ]; diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index d2973aee0..9e31cc32c 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -8,36 +8,36 @@ import qualified ExtraSpec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) import qualified Plutarch.FieldSpec as FieldSpec import qualified Plutarch.MonadicSpec as MonadicSpec -import Plutarch.Test.Run (runPlutarchSpec) -import Test.Syd (Spec, describe) #else import qualified Plutarch.FFISpec as FFISpec -import Test.Syd (Spec, describe, sydTest) #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) +import qualified Hedgehog.Main as Hedgehog +import qualified Plutarch.ListSpec as ListSpec +import qualified Plutarch.ListUtilsSpec as ListUtilsSpec +import Plutarch.Test (TrailSpec) +import Plutarch.Test.Run (runPlutarchSpec) main :: IO () main = do setLocaleEncoding utf8 - --- We use 'runPlutarchSpec' to test for unused goldens, but do so only in GHC --- 9. Because, under GHC 8 certain modules are disabled (see the CPP below) --- which leads to legitimately unused goldens detected leading to false --- positive in test failure. -#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) runPlutarchSpec spec -#else - sydTest spec -#endif + -- TODO: Can these properties actually run with hspec (using hspec-hedgehog)? + Hedgehog.defaultMain props -spec :: Spec +props :: [IO Bool] +props = + [ ListSpec.props + , ListUtilsSpec.props + ] +spec :: TrailSpec spec = do BaseSpec.spec ExtraSpec.spec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) - describe "field" FieldSpec.spec - describe "monadic" MonadicSpec.spec + FieldSpec.spec + MonadicSpec.spec #else - describe "FFI" FFISpec.spec + FFISpec.spec #endif diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index c7792d2c1..fd59a18f8 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -26,21 +26,19 @@ module Plutarch.Test ( pgoldenSpec, PlutarchGoldens, + -- * Spec monad for tests using golden testing + TrailSpec, + describe, + it, + runTrailSpec, + Spec, + -- * Benchmark type for use in `(@:->)` Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), ScriptSizeBytes, ) where -import Data.Kind (Type) import Data.Text (Text) -import Test.Syd ( - Expectation, - TestDefM, - describe, - expectationFailure, - shouldBe, - shouldSatisfyNamed, - ) import Plutarch (ClosedTerm, PCon (pcon), compile, printScript) import Plutarch.Bool (PBool (PFalse, PTrue)) @@ -59,8 +57,10 @@ import Plutarch.Test.Golden ( (@\), (@|), ) -import Plutarch.Test.TrailSpecMonad () +import Plutarch.Test.TrailSpecMonad (TrailSpec, describe, it, runTrailSpec) import qualified Plutus.V1.Ledger.Scripts as Scripts +import Test.Hspec (Expectation, Spec, expectationFailure, shouldBe, shouldSatisfy) +import Test.Tasty.HUnit (assertFailure) {- | Like `shouldBe` but but for Plutarch terms @@ -73,7 +73,7 @@ pshouldBe x y = do where eval :: Scripts.Script -> IO Scripts.Script eval s = case evalScript s of - (Left e, _, _) -> expectationFailure $ "Script evaluation failed: " <> show e + (Left e, _, _) -> assertFailure $ "Script evaluation failed: " <> show e (Right x', _, _) -> pure x' {- | @@ -120,11 +120,11 @@ pfails p = do -} psatisfyWithinBenchmark :: Benchmark -> Benchmark -> Expectation psatisfyWithinBenchmark bench maxBudget = do - shouldSatisfyNamed bench ("cpu<=" <> show (exBudgetCPU maxBudget)) $ \_ -> + shouldSatisfy bench $ \_ -> exBudgetCPU bench <= exBudgetCPU maxBudget - shouldSatisfyNamed bench ("mem<=" <> show (exBudgetMemory maxBudget)) $ \_ -> + shouldSatisfy bench $ \_ -> exBudgetMemory bench <= exBudgetMemory maxBudget - shouldSatisfyNamed bench ("size<=" <> show (scriptSizeBytes maxBudget)) $ \_ -> + shouldSatisfy bench $ \_ -> scriptSizeBytes bench <= scriptSizeBytes maxBudget {- | Asserts that the term evaluates successfully with the given trace sequence @@ -153,7 +153,7 @@ ptraces p develTraces = Typically meant to be used in conjunction with `ptraces`. -} -plutarchDevFlagDescribe :: forall (outers :: [Type]) inner. TestDefM outers inner () -> TestDefM outers inner () +plutarchDevFlagDescribe :: TrailSpec -> TrailSpec -- CPP support isn't great in fourmolu. {- ORMOLU_DISABLE -} diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index b1f8631f7..0358c17da 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -26,24 +26,16 @@ module Plutarch.Test.Golden ( import Control.Monad (forM_, unless) import qualified Data.Aeson.Text as Aeson import Data.List.NonEmpty (nonEmpty) -import qualified Data.List.NonEmpty as NE import Data.Maybe (mapMaybe) import Data.Semigroup (sconcat) import Data.String (IsString) import Data.Text (Text) import qualified Data.Text as T +import qualified Data.Text.IO as TIO import qualified Data.Text.Lazy as TL import GHC.Stack (HasCallStack) import System.FilePath (()) -import Test.Syd ( - Expectation, - Spec, - TestDefM, - describe, - getTestDescriptionPath, - it, - pureGoldenTextFile, - ) +import Test.Hspec.Golden import Plutarch (compile, printScript) import Plutarch.Evaluate (evalScript) @@ -51,8 +43,11 @@ import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Prelude import Plutarch.Test.Benchmark (Benchmark, mkBenchmark, scriptSize) import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) +import Plutarch.Test.TrailSpecMonad (TrailSpec, TrailSpecM, ancestorTrail, describe, it) import Plutus.V1.Ledger.Scripts (Script) import qualified Plutus.V1.Ledger.Scripts as Scripts +import Test.Hspec (Expectation) +import Test.Hspec.Core.Spec (SpecM) data GoldenValue = GoldenValue { goldenValueUplcPreEval :: Text @@ -135,19 +130,16 @@ goldenKeyString (GoldenKey s) = T.unpack s instance Semigroup GoldenKey where GoldenKey s1 <> GoldenKey s2 = GoldenKey $ s1 <> "." <> s2 -currentGoldenKey :: HasCallStack => forall (outers :: [Type]) inner. TestDefM outers inner GoldenKey +currentGoldenKey :: HasCallStack => TrailSpecM (SpecM ()) GoldenKey currentGoldenKey = do - mkGoldenKeyFromSpecPath <$> getTestDescriptionPath + mkGoldenKeyFromSpecPath . reverse . fmap T.pack <$> ancestorTrail mkGoldenKeyFromSpecPath :: HasCallStack => [Text] -> GoldenKey mkGoldenKeyFromSpecPath path = case nonEmpty path of Nothing -> error "cannot use currentGoldenKey from top-level spec" - Just anc -> - case nonEmpty (NE.drop 1 . NE.reverse $ anc) of - Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" - Just path -> - sconcat $ fmap GoldenKey path + Just path -> + sconcat $ fmap GoldenKey path goldenPath :: FilePath -> GoldenKey -> FilePath goldenPath baseDir (GoldenKey k) = @@ -183,7 +175,7 @@ infixr 0 @| Hierarchy is represented by intercalating with a dot; for instance, the key for 'qux' will be "bar.qux". -} -pgoldenSpec :: HasCallStack => PlutarchGoldens -> Spec +pgoldenSpec :: HasCallStack => PlutarchGoldens -> TrailSpec pgoldenSpec map = do base <- currentGoldenKey let bs = runListSyntax map @@ -225,11 +217,18 @@ goldenTestVal t v = case t of UPLCPostEval -> goldenValueUplcPostEval v Bench -> goldenValueBench v -goldenTestSpec :: GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> Spec +goldenTestSpec :: GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> TrailSpec goldenTestSpec base vals gt = do - it (goldenKeyString $ goldenTestKey gt) $ - pureGoldenTextFile (goldenTestPath base gt) $ - combineGoldens $ fmap (goldenTestVal gt) <$> vals + it (goldenKeyString $ goldenTestKey gt) $ do + Golden + { output = combineGoldens $ fmap (goldenTestVal gt) <$> vals + , goldenFile = goldenTestPath base gt + , actualFile = Nothing + , encodePretty = show + , writeToFile = TIO.writeFile + , readFromFile = TIO.readFile + , failFirstTime = False + } where -- Group multiple goldens values in the same file combineGoldens :: [(GoldenKey, Text)] -> Text diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index 5f7e39017..efc789130 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -1,25 +1,16 @@ module Plutarch.Test.Run (runPlutarchSpec) where -import Control.Monad (forM_, void) -import Data.Set (Set) -import qualified Data.Set as Set -import qualified Data.Text as T -import Plutarch.Test.Golden (GoldenKey, defaultGoldenBasePath, goldenTestPath, mkGoldenKeyFromSpecPath) -import System.Directory (listDirectory) -import System.Exit (ExitCode (ExitFailure), exitWith) -import System.FilePath (()) -import Test.Syd ( - Spec, - SpecTree (..), - Timed (timedValue), - shouldExitFail, - sydTestResult, - ) -import Test.Syd.OptParse (getSettings) +import Plutarch.Test.TrailSpecMonad (TrailSpec, runTrailSpec) +import Test.Hspec (hspec) -- | Like `sydTest`, but ensures that there are no unused goldens left behind. -runPlutarchSpec :: Spec -> IO () +runPlutarchSpec :: TrailSpec -> IO () runPlutarchSpec spec = do + -- TODO: unsused goldens + -- TODO: use hedgehog runner via hspec-hedgehog + hspec $ runTrailSpec spec + +{- usedGoldens <- goldenPathsUsedBy <$> sydTest' spec unusedGoldens usedGoldens >>= \case [] -> pure () @@ -78,3 +69,5 @@ sydTest' spec = do if shouldExitFail config resultForest then exitWith $ ExitFailure 1 else pure $ void <$> resultForest + + -} diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index cd726254d..ee78f3ba0 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -62,7 +62,7 @@ import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinUnit) import PlutusTx.Prelude import Shrink (shrinkScript, shrinkScriptSp, withoutTactics) -import Test.Syd +import Plutarch.Test import Test.Tasty.HUnit ((@?=)) -- import Test.Tasty.Plutus.Internal.Context (ContextBuilder (cbSignatories), TransactionConfig(..), compileSpending) @@ -232,8 +232,8 @@ signatories = ["ab01fe235c", "123014", "abcdef"] @since 0.1 -} -spec :: Spec -spec = do +spec :: TrailSpec +spec = describe "FFI" $ do describe "Simple types" $ do it "integer literal" $ printCode $$(PlutusTx.compile [||42 :: Integer||]) @?= "(program 1.0.0 42)" diff --git a/plutarch-test/conditional/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs index f6cef6642..888067618 100644 --- a/plutarch-test/conditional/Plutarch/FieldSpec.hs +++ b/plutarch-test/conditional/Plutarch/FieldSpec.hs @@ -6,7 +6,6 @@ import Plutus.V1.Ledger.Address (Address (Address)) import Plutus.V1.Ledger.Credential (Credential (PubKeyCredential)) import qualified PlutusCore as PLC import qualified PlutusTx -import Test.Syd import Test.Tasty.HUnit import Plutarch.Api.V1 (PAddress (PAddress)) @@ -16,7 +15,7 @@ import Plutarch.SpecTypes (PTriplet) import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) -spec :: Spec +spec :: TrailSpec spec = do describe "field" $ do -- example: Trips diff --git a/plutarch-test/conditional/Plutarch/MonadicSpec.hs b/plutarch-test/conditional/Plutarch/MonadicSpec.hs index 6aa57af0b..6e7e7d7a6 100644 --- a/plutarch-test/conditional/Plutarch/MonadicSpec.hs +++ b/plutarch-test/conditional/Plutarch/MonadicSpec.hs @@ -3,8 +3,6 @@ module Plutarch.MonadicSpec (spec) where -import Test.Syd - import Plutarch.Api.V1 ( PAddress (PAddress), PCredential, @@ -20,7 +18,7 @@ import Plutarch.Prelude import Plutarch.Test import Plutus.V1.Ledger.Api -spec :: Spec +spec :: TrailSpec spec = do describe "monadic" $ do {- TODO: Uncomment this after flakiness is fixed diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 799d56fdc..ba0eb403b 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -8,8 +8,6 @@ import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -import Test.Syd - -- Plutus and PlutusTx imports import Plutus.V1.Ledger.Api ( Address (Address), @@ -29,16 +27,7 @@ import PlutusTx ( -- Plutarch imports import Plutarch.Prelude -import Plutarch.Test ( - passert, - pfails, - pgoldenSpec, - plutarchDevFlagDescribe, - psucceeds, - (@->), - (@\), - (@|), - ) +import Plutarch.Test import Plutarch.Unsafe ( punsafeCoerce, @@ -81,7 +70,7 @@ import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) import GHC.Records (getField) -spec :: Spec +spec :: TrailSpec spec = do describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do "erroneous" @\ do diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden index fced1596f..4797e4dfc 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -1,2 +1,2 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:78:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:78:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/BaseSpec.hs b/plutarch-test/plutarch-base/BaseSpec.hs index 8bdf3b700..5b14d4b76 100644 --- a/plutarch-test/plutarch-base/BaseSpec.hs +++ b/plutarch-test/plutarch-base/BaseSpec.hs @@ -1,3 +1,50 @@ -{-# OPTIONS_GHC -F -pgmF sydtest-discover -optF --no-main #-} +module BaseSpec (spec) where -module Plutarch.BaseSpec (spec) where +import qualified Plutarch.ApiSpec as ApiSpec +import qualified Plutarch.BoolSpec as BoolSpec +import qualified Plutarch.ByteStringSpec as ByteStringSpec +import qualified Plutarch.EitherSpec as EitherSpec +import qualified Plutarch.IntegerSpec as IntegerSpec +import qualified Plutarch.LiftSpec as LiftSpec +import qualified Plutarch.ListSpec as ListSpec +import qualified Plutarch.MaybeSpec as MaybeSpec +import qualified Plutarch.PIsDataSpec as PIsDataSpec +import qualified Plutarch.PLamSpec as PLamSpec +import qualified Plutarch.POrdSpec as POrdSpec +import qualified Plutarch.PairSpec as PairSpec +import qualified Plutarch.PlutusTypeSpec as PlutusTypeSpec +import qualified Plutarch.RationalSpec as RationalSpec +import qualified Plutarch.RecSpec as RecSpec +import qualified Plutarch.RecursionSpec as RecursionSpec +import qualified Plutarch.ScriptsSpec as ScriptsSpec +import qualified Plutarch.ShowSpec as ShowSpec +import qualified Plutarch.StringSpec as StringSpec +import Plutarch.Test (TrailSpec) +import qualified Plutarch.TraceSpec as TraceSpec +import qualified Plutarch.UPLCSpec as UPLCSpec +import qualified Plutarch.UnitSpec as UnitSpec + +spec :: TrailSpec +spec = do + ApiSpec.spec + BoolSpec.spec + ByteStringSpec.spec + EitherSpec.spec + IntegerSpec.spec + LiftSpec.spec + ListSpec.spec + MaybeSpec.spec + PairSpec.spec + PIsDataSpec.spec + PLamSpec.spec + PlutusTypeSpec.spec + POrdSpec.spec + RationalSpec.spec + RecursionSpec.spec + ScriptsSpec.spec + ShowSpec.spec + RecSpec.spec + StringSpec.spec + TraceSpec.spec + UnitSpec.spec + UPLCSpec.spec diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index c31b9612e..9378c6f28 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -1,6 +1,5 @@ module Plutarch.ApiSpec (spec, ctx, info, purpose, validator, datum) where -import Test.Syd import Test.Tasty.HUnit import Control.Monad.Trans.Cont (cont, runCont) @@ -24,7 +23,7 @@ import Plutarch.Test -- import PlutusTx.AssocMap as PlutusMap -spec :: Spec +spec :: TrailSpec spec = do describe "api" $ do describe "ctx" $ do diff --git a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs index 4f9606741..0ea97032a 100644 --- a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs @@ -1,12 +1,10 @@ module Plutarch.BoolSpec (spec) where -import Test.Syd - import Plutarch.Bool (pand, por) import Plutarch.Prelude import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "bool" . pgoldenSpec $ do "pnot" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs index 8b0f6e2bd..ff66f9afe 100644 --- a/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs @@ -1,12 +1,10 @@ module Plutarch.ByteStringSpec (spec) where -import Test.Syd - import qualified Data.ByteString as BS import Plutarch.Prelude import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "bytestring" . pgoldenSpec $ do "empty" @| mempty #== phexByteStr "" @-> passert diff --git a/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs index 3c895e279..91d682213 100644 --- a/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs @@ -1,11 +1,9 @@ module Plutarch.EitherSpec (spec) where -import Test.Syd - import Plutarch.Prelude import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "either" . pgoldenSpec $ do "eq" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs index 6b78a6813..685b274b5 100644 --- a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs @@ -1,12 +1,10 @@ module Plutarch.IntegerSpec (spec) where -import Test.Syd - import Plutarch import Plutarch.Prelude import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "int" $ do describe "examples" $ do diff --git a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs index 8d7721daa..68dd086c1 100644 --- a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs @@ -4,13 +4,13 @@ import Data.Text (Text) import Plutarch.Api.V1 () import Plutus.V1.Ledger.Api (PubKeyHash (PubKeyHash), ScriptPurpose (Minting), TxOutRef (TxOutRef)) import qualified PlutusTx -import Test.Syd import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.Test +import Test.Hspec (Expectation, shouldBe) -spec :: Spec +spec :: TrailSpec spec = do describe "lift" $ do describe "plift" $ do diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index df5cd60fc..da8180a5d 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -1,33 +1,30 @@ -module Plutarch.ListSpec (spec, integerList) where +{-# LANGUAGE TemplateHaskell #-} -import Test.Syd -import Test.Syd.Hedgehog () +module Plutarch.ListSpec (spec, props, integerList) where import Plutarch.List (pconvertLists, pfoldl') import Plutarch.Prelude import Plutarch.Test -import Hedgehog (Property) - import Data.List (find) import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genInteger, genList) +import Hedgehog (Property, checkParallel) import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range +import Test.Hspec.Hedgehog (discover) integerList :: [Integer] -> Term s (PList PInteger) integerList xs = pconvertLists #$ pconstant @(PBuiltinList PInteger) xs -spec :: Spec +props :: IO Bool +props = checkParallel $$(discover) + +spec :: TrailSpec spec = do describe "list" $ do - describe "properties" $ do - describe "find" $ do - it "plutarch level find mirrors haskell level find" findTest - describe "elemAt" $ do - it "plutarch level elemAt mirrors haskell level elemAt" elemAtTest plutarchDevFlagDescribe . pgoldenSpec $ do let xs10 :: Term _ (PList PInteger) xs10 = integerList [1 .. 10] @@ -98,8 +95,9 @@ spec = do PFalse -> plet (phead # numList) $ \_x -> ptail # numList -findTest :: Property -findTest = +-- plutarch level find mirrors haskell level find +prop_pfindEquiv :: Property +prop_pfindEquiv = prop_haskEquiv @( 'OnPEq) @( 'TotalFun) @@ -110,8 +108,9 @@ findTest = peven :: Term s (PInteger :--> PBool) peven = plam $ \n -> pmod # n # 2 #== 0 -elemAtTest :: Property -elemAtTest = +-- plutarch level elemAt mirrors haskell level elemAt +prop_pelemAtEquiv :: Property +prop_pelemAtEquiv = prop_haskEquiv @( 'OnBoth) @( 'PartialFun) diff --git a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs index 5f51a1b0d..832059fa8 100644 --- a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs @@ -1,14 +1,12 @@ module Plutarch.MaybeSpec (spec) where -import Test.Syd - import Plutarch import Plutarch.Bool (PEq ((#==))) import Plutarch.Integer (PInteger) import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "maybe" . pgoldenSpec $ do "eq" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index b150ec0ba..c5ba6689b 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -17,9 +17,10 @@ import Plutus.V1.Ledger.Api ( TxOutRef (TxOutRef), ) import qualified PlutusTx -import Test.Syd + import Test.Tasty.QuickCheck (Arbitrary, property) +import Control.Monad.Trans (lift) import Plutarch.Api.V1 import Plutarch.Api.V1.Tuple (pbuiltinPairFromTuple, ptupleFromBuiltin) import Plutarch.Builtin (pforgetData, ppairDataBuiltin) @@ -28,8 +29,9 @@ import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.SpecTypes (PTriplet (PTriplet)) import Plutarch.Test +import Test.Hspec (shouldBe, specify) -spec :: Spec +spec :: TrailSpec spec = do describe "pisdata" $ do propertySet @PBool "PBool" @@ -157,15 +159,18 @@ propertySet :: , Arbitrary (PLifted p) ) => String -> - Spec + TrailSpec propertySet typeName = do describe typeName $ do - specify ("x ~ " <> typeName <> ": pfromData (pdata x) ≡ x") $ - property $ ptoFromEqual @p - specify ("x ~ " <> typeName <> ": pfromData (PlutusTx.toData x) ≡ x") $ - property $ pfromDataCompat @p - specify ("x ~ " <> typeName <> ": PlutusTx.fromData (pdata x) ≡ Just x") $ - property $ pdataCompat @p + lift $ + specify ("x ~ " <> typeName <> ": pfromData (pdata x) ≡ x") $ + property $ ptoFromEqual @p + lift $ + specify ("x ~ " <> typeName <> ": pfromData (PlutusTx.toData x) ≡ x") $ + property $ pfromDataCompat @p + lift $ + specify ("x ~ " <> typeName <> ": PlutusTx.fromData (pdata x) ≡ Just x") $ + property $ pdataCompat @p ptoFromEqual :: forall p. diff --git a/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs index aab58cb43..158447c65 100644 --- a/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs @@ -2,13 +2,12 @@ module Plutarch.PLamSpec (spec) where import Data.ByteString (ByteString) import qualified PlutusCore as PLC -import Test.Syd import Plutarch.Prelude import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin) -spec :: Spec +spec :: TrailSpec spec = do describe "plam" . pgoldenSpec $ do "id" @| plam (\x -> x) diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index c730b484f..855c87506 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -16,7 +16,7 @@ import qualified PlutusTx as PlutusTx import qualified PlutusTx.Builtins as PlutusTx import Test.QuickCheck.Instances () -import Test.Syd + import Test.Tasty.QuickCheck (Arbitrary, arbitrary, oneof, property) import Plutarch.Api.V1 (PAddress, PCredential (PPubKeyCredential, PScriptCredential), PMaybeData) @@ -27,10 +27,12 @@ import Plutarch.Lift ( ) import Plutarch.Prelude +import Control.Monad.Trans (lift) import Plutarch.SpecTypes (PTriplet (PTriplet), Triplet (Triplet)) import Plutarch.Test +import Test.Hspec (shouldBe, specify) -spec :: Spec +spec :: TrailSpec spec = do describe "pisdata" $ do describe "ord.property" $ do @@ -109,16 +111,19 @@ propertySet :: , Arbitrary (PLifted p) ) => String -> - Spec + TrailSpec propertySet typeName' = do describe typeName' $ do let typeName = '(' : typeName' ++ ")" - specify ("(#<) @" <> typeName <> " ≡ (<) @" <> typeName) $ - property $ pltIso @p - specify ("(#<=) @" <> typeName <> " ≡ (<=) @" <> typeName) $ - property $ plteIso @p - specify ("(#==) @" <> typeName <> " ≡ (==) @" <> typeName) $ - property $ peqIso @p + lift $ + specify ("(#<) @" <> typeName <> " ≡ (<) @" <> typeName) $ + property $ pltIso @p + lift $ + specify ("(#<=) @" <> typeName <> " ≡ (<=) @" <> typeName) $ + property $ plteIso @p + lift $ + specify ("(#==) @" <> typeName <> " ≡ (==) @" <> typeName) $ + property $ peqIso @p pltIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Ord h, POrd p) => h -> h -> IO () pltIso a b = plift (pconstant @p a #< pconstant b) `shouldBe` (a < b) diff --git a/plutarch-test/plutarch-base/Plutarch/PairSpec.hs b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs index 65f5613f2..879ef6561 100644 --- a/plutarch-test/plutarch-base/Plutarch/PairSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs @@ -1,11 +1,9 @@ module Plutarch.PairSpec (spec) where -import Test.Syd - import Plutarch.Prelude import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "pair" . pgoldenSpec $ do "eq" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index aaf5e6261..26d92260b 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -2,8 +2,6 @@ module Plutarch.PlutusTypeSpec (spec) where -import Test.Syd - import Plutarch (pcon', pmatch') import Plutarch.Api.V1 ( PAddress (PAddress), @@ -20,8 +18,9 @@ import Plutus.V1.Ledger.Credential ( Credential (PubKeyCredential, ScriptCredential), StakingCredential (StakingPtr), ) +import Test.Hspec (Expectation) -spec :: Spec +spec :: TrailSpec spec = do describe "plutustype" $ do describe "example" . pgoldenSpec $ do @@ -54,7 +53,7 @@ spec = do We ideally want the typed and raw versions to have as little deviation as possible. -} -deconstrSpec :: Spec +deconstrSpec :: TrailSpec deconstrSpec = do describe "deconstr" . pgoldenSpec $ do "matching" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs index c6b00205b..c3b11d3a0 100644 --- a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs @@ -1,12 +1,11 @@ module Plutarch.RationalSpec (spec) where -import Test.Syd - import Plutarch.Prelude import Plutarch.Rational (pproperFraction, ptruncate) import Plutarch.Test +import Test.Hspec (Expectation) -spec :: Spec +spec :: TrailSpec spec = do let rat :: Term s PRational -> Term s PRational rat = id diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index df5d317b6..9678da2e1 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -3,7 +3,7 @@ module Plutarch.RecSpec (spec) where import qualified Rank2.TH -import Test.Syd + import Prelude hiding (even, odd) import Plutarch (pcon', pmatch') @@ -205,7 +205,7 @@ flatOuterData = pdata (punsafeFrom sampleFlatOuter) shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) shallowOuterData = pdata (punsafeFrom sampleShallowOuter) -spec :: Spec +spec :: TrailSpec spec = do -- Plutarch.Rec.verifySoleConstructor uses tracing, so we must create two sets -- of golden. diff --git a/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs index 1fce9a299..183d6926a 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs @@ -6,12 +6,10 @@ import Plutarch import Plutarch.Bool (pif, (#==)) import Plutarch.Integer (PInteger) -import Test.Syd (Spec, describe) - import Plutarch.Lift (pconstant) import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "recursion" $ do describe "example" . pgoldenSpec $ do diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 6f559c2d8..89eab9a3e 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -44,9 +44,8 @@ import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude import Plutarch.Test -import Test.Syd (Spec, describe) -spec :: Spec +spec :: TrailSpec spec = do describe "scripts" . pgoldenSpec $ do "auth_validator" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs index 3a86e93a3..472e53c9b 100644 --- a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs @@ -3,13 +3,12 @@ module Plutarch.ShowSpec (spec) where import Control.Monad (forM_) import Data.String (IsString (fromString)) import qualified Data.Text as T -import Test.Syd import Plutarch.ListSpec (integerList) import Plutarch.Prelude import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "show" . pgoldenSpec $ do let str x = pconstant @PString x diff --git a/plutarch-test/plutarch-base/Plutarch/StringSpec.hs b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs index 05794d82a..d87d40855 100644 --- a/plutarch-test/plutarch-base/Plutarch/StringSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs @@ -1,11 +1,9 @@ module Plutarch.StringSpec (spec) where -import Test.Syd - import Plutarch.Prelude import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "str" $ do pgoldenSpec $ do diff --git a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs index 7963e613a..2b6995797 100644 --- a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs @@ -1,11 +1,9 @@ module Plutarch.TraceSpec (spec) where -import Test.Syd - import Plutarch.Prelude import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do "ptrace" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs index 4e7bf8eb7..29aafedea 100644 --- a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs @@ -1,14 +1,13 @@ module Plutarch.UPLCSpec (spec) where import qualified PlutusCore as PLC -import Test.Syd import Plutarch.Internal (punsafeConstantInternal) import Plutarch.Prelude import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin) -spec :: Spec +spec :: TrailSpec spec = do -- Tests for the behaviour of UPLC itself. describe "uplc-behaviour" . pgoldenSpec $ do diff --git a/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs index 99b6fc8f3..eac932dfa 100644 --- a/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs @@ -1,12 +1,10 @@ module Plutarch.UnitSpec (spec) where -import Test.Syd - import Plutarch import Plutarch.Prelude import Plutarch.Test -spec :: Spec +spec :: TrailSpec spec = do describe "unit" . pgoldenSpec $ do "pcon" @| pcon PUnit diff --git a/plutarch-test/plutarch-extra/ExtraSpec.hs b/plutarch-test/plutarch-extra/ExtraSpec.hs index 4c69623b5..1bb88b917 100644 --- a/plutarch-test/plutarch-extra/ExtraSpec.hs +++ b/plutarch-test/plutarch-extra/ExtraSpec.hs @@ -1 +1,8 @@ -{-# OPTIONS_GHC -F -pgmF sydtest-discover -optF --no-main #-} +module ExtraSpec (spec) where + +import qualified Plutarch.ListUtilsSpec as ListUtilsSpec +import Plutarch.Test (TrailSpec) + +spec :: TrailSpec +spec = do + ListUtilsSpec.spec diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs index cb8ddcca6..14134c050 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -1,24 +1,20 @@ -module Plutarch.ListUtilsSpec (spec) where +{-# LANGUAGE TemplateHaskell #-} -import Test.Syd -import Test.Syd.Hedgehog () +module Plutarch.ListUtilsSpec (spec, props) where import Plutarch.Prelude import Plutarch.Test -import Hedgehog (Property) +import Hedgehog (Property, checkParallel, discover) import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genInteger, genList) import Plutarch.ListUtils (pcheckSorted, preverse) -spec :: Spec +spec :: TrailSpec spec = do describe "extra.listutils" $ do - describe "properties" $ do - describe "reverse" $ do - it "plutarch level reversing behaves like haskell level reversing" reverseTest pgoldenSpec $ do "reverse" @\ do "reverse_[1..5]" @| preverse # marshal [1 .. 5 :: Integer] @@ -27,8 +23,12 @@ spec = do "reverse_[1..10]" @| (pnot #$ pcheckSorted #$ marshal $ reverse [1 .. 10 :: Integer]) @-> passert "reverse_[]" @| preverse # marshal ([] :: [Integer]) -reverseTest :: Property -reverseTest = do +props :: IO Bool +props = checkParallel $$(discover) + +-- plutarch level reversing behaves like haskell level reversing +prop_preverseEquiv :: Property +prop_preverseEquiv = do prop_haskEquiv @( 'OnPEq) @( 'TotalFun) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 7bf104fbe..3f7068a9e 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -84,6 +84,7 @@ common deps , hedgehog , hspec , hspec-core + , hspec-golden , hspec-hedgehog , mtl , plutarch @@ -94,9 +95,6 @@ common deps , quickcheck-instances , serialise , sop-core - , sydtest - , sydtest-discover - , sydtest-hedgehog , tasty , tasty-hunit , tasty-quickcheck From 3354f2cabafc9b38944c215885d327aea2ddc8dd Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 09:38:56 -0400 Subject: [PATCH 289/584] Use hspec-hedgehog to run property tests in hspec --- plutarch-test/Main.hs | 10 ------- .../plutarch-base/Plutarch/ListSpec.hs | 26 +++++++++---------- .../plutarch-extra/Plutarch/ListUtilsSpec.hs | 20 +++++++------- 3 files changed, 22 insertions(+), 34 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 9e31cc32c..4d35d76d7 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -13,9 +13,6 @@ import qualified Plutarch.FFISpec as FFISpec #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) -import qualified Hedgehog.Main as Hedgehog -import qualified Plutarch.ListSpec as ListSpec -import qualified Plutarch.ListUtilsSpec as ListUtilsSpec import Plutarch.Test (TrailSpec) import Plutarch.Test.Run (runPlutarchSpec) @@ -23,14 +20,7 @@ main :: IO () main = do setLocaleEncoding utf8 runPlutarchSpec spec - -- TODO: Can these properties actually run with hspec (using hspec-hedgehog)? - Hedgehog.defaultMain props -props :: [IO Bool] -props = - [ ListSpec.props - , ListUtilsSpec.props - ] spec :: TrailSpec spec = do BaseSpec.spec diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index da8180a5d..f213df624 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -1,30 +1,30 @@ -{-# LANGUAGE TemplateHaskell #-} +module Plutarch.ListSpec (spec, integerList) where -module Plutarch.ListSpec (spec, props, integerList) where +import Data.List (find) import Plutarch.List (pconvertLists, pfoldl') import Plutarch.Prelude -import Plutarch.Test - -import Data.List (find) -import Plutarch.Test.Property -import Plutarch.Test.Property.Gen (genInteger, genList) - -import Hedgehog (Property, checkParallel) +import Hedgehog (Property) import qualified Hedgehog.Gen as Gen +import Hedgehog.Internal.Property (Property (propertyTest)) import qualified Hedgehog.Range as Range -import Test.Hspec.Hedgehog (discover) +import Plutarch.Test +import Plutarch.Test.Property +import Plutarch.Test.Property.Gen (genInteger, genList) +import Test.Hspec.Hedgehog (hedgehog) integerList :: [Integer] -> Term s (PList PInteger) integerList xs = pconvertLists #$ pconstant @(PBuiltinList PInteger) xs -props :: IO Bool -props = checkParallel $$(discover) - spec :: TrailSpec spec = do describe "list" $ do + describe "properties" $ do + describe "find" $ do + it "plutarch level find mirrors haskell level find" . hedgehog . propertyTest $ prop_pfindEquiv + describe "elemAt" $ do + it "plutarch level elemAt mirrors haskell level elemAt" . hedgehog . propertyTest $ prop_pelemAtEquiv plutarchDevFlagDescribe . pgoldenSpec $ do let xs10 :: Term _ (PList PInteger) xs10 = integerList [1 .. 10] diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs index 14134c050..08ad41199 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -1,20 +1,21 @@ -{-# LANGUAGE TemplateHaskell #-} - -module Plutarch.ListUtilsSpec (spec, props) where +module Plutarch.ListUtilsSpec (spec) where +import Plutarch.ListUtils (pcheckSorted, preverse) import Plutarch.Prelude -import Plutarch.Test - -import Hedgehog (Property, checkParallel, discover) +import Hedgehog (Property) +import Hedgehog.Internal.Property (propertyTest) +import Plutarch.Test import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genInteger, genList) - -import Plutarch.ListUtils (pcheckSorted, preverse) +import Test.Hspec.Hedgehog (hedgehog) spec :: TrailSpec spec = do describe "extra.listutils" $ do + describe "properties" $ do + describe "reverse" $ do + it "plutarch level reversing behaves like haskell level reversing" . hedgehog . propertyTest $ prop_preverseEquiv pgoldenSpec $ do "reverse" @\ do "reverse_[1..5]" @| preverse # marshal [1 .. 5 :: Integer] @@ -23,9 +24,6 @@ spec = do "reverse_[1..10]" @| (pnot #$ pcheckSorted #$ marshal $ reverse [1 .. 10 :: Integer]) @-> passert "reverse_[]" @| preverse # marshal ([] :: [Integer]) -props :: IO Bool -props = checkParallel $$(discover) - -- plutarch level reversing behaves like haskell level reversing prop_preverseEquiv :: Property prop_preverseEquiv = do From 539948ad3674d0dae05132bb01fdc435a58992e8 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 10:37:49 -0400 Subject: [PATCH 290/584] Note that TrailSpecM exists temporarily --- plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs index 6f3642032..b81a29eff 100644 --- a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs +++ b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs @@ -1,3 +1,6 @@ +{- | This module exists only until https://github.com/hspec/hspec/pull/648 is + merged & released upstream. +-} module Plutarch.Test.TrailSpecMonad ( -- * Types TrailSpecM, From dd61169cf9a03b5477830a5f54b1aba79cab0e52 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 09:09:41 -0400 Subject: [PATCH 291/584] Update emanote --- flake.lock | 178 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 104 insertions(+), 74 deletions(-) diff --git a/flake.lock b/flake.lock index e6b63f73b..e35b4c233 100644 --- a/flake.lock +++ b/flake.lock @@ -203,15 +203,15 @@ "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks" + "lint-utils": "lint-utils", + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1648150821, - "narHash": "sha256-AGwZRHD2Gcn2kuT3FQCaQOoBhH1D+Blk0WXuEXWyr2c=", + "lastModified": 1648411303, + "narHash": "sha256-OhAbDxl+AaTQDvPUEVYn9xnW7iP++bZ3dCJEOLM29fk=", "owner": "srid", "repo": "ema", - "rev": "624bcd5103e847fbbb9c59e39dab507424dd8299", + "rev": "976590c6cb7836cc4caeeaf2ca65d84a6c2502e3", "type": "github" }, "original": { @@ -235,6 +235,7 @@ "flake-utils" ], "heist": "heist", + "lint-utils": "lint-utils_2", "nixpkgs": [ "emanote", "ema", @@ -245,11 +246,11 @@ "unionmount": "unionmount" }, "locked": { - "lastModified": 1648225238, - "narHash": "sha256-aDQNIpiAAnM5j8oFdvxQzpBCv7JyW4uZgWKLwdZBRCQ=", + "lastModified": 1649015242, + "narHash": "sha256-CUB+JJawmI+4PeuCYwME/rZFebg9HTbbWAS66fRLHig=", "owner": "srid", "repo": "emanote", - "rev": "cce3558d2d142a95ea39099e7b3b2e930b2f3a61", + "rev": "34a2040d5b77e425f22183232dcbd6735f9b49a5", "type": "github" }, "original": { @@ -262,11 +263,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "lastModified": 1648199409, + "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", "owner": "edolstra", "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", "type": "github" }, "original": { @@ -308,6 +309,21 @@ } }, "flake-utils": { + "locked": { + "lastModified": 1648297722, + "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -322,13 +338,13 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_3": { "locked": { - "lastModified": 1619345332, - "narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=", + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", "owner": "numtide", "repo": "flake-utils", - "rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", "type": "github" }, "original": { @@ -337,7 +353,7 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_4": { "locked": { "lastModified": 1642700792, "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", @@ -352,7 +368,7 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_5": { "locked": { "lastModified": 1631561581, "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", @@ -367,7 +383,7 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_6": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -521,7 +537,7 @@ "cabal-34": "cabal-34", "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", "hpc-coveralls": "hpc-coveralls", @@ -571,23 +587,23 @@ "heist": { "flake": false, "locked": { - "lastModified": 1624205223, - "narHash": "sha256-+bcrEKjB/kDRAqOunCD/cKBBVOJUTmY9RoCQ++I42oM=", + "lastModified": 1649013405, + "narHash": "sha256-4NK8ZLHm4iHWU+LCu3M0jnALCnQCa7lEu72NIOQ1YI8=", "owner": "srid", "repo": "heist", - "rev": "a8be6f93656f87199e03b9dfb9979dc061614108", + "rev": "a4b3d6d5573a4ba9c410b382fa3771e8ae53fcfa", "type": "github" }, "original": { "owner": "srid", - "ref": "emanote", + "ref": "emanote-release", "repo": "heist", "type": "github" } }, "hercules-ci-effects": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1647711660, @@ -668,6 +684,53 @@ "type": "github" } }, + "lint-utils": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1648405819, + "narHash": "sha256-Rv9QsHg5a3OurGxbC0Y2aERAZ0sFXYQyaxGYXdDPiZ4=", + "ref": "parameterized", + "rev": "9ba45de1fc3dbbe65c39d7d0107b99a8046a8081", + "revCount": 21, + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + }, + "original": { + "ref": "parameterized", + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + } + }, + "lint-utils_2": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "emanote", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1648667273, + "narHash": "sha256-eQUb40xDyv0Ye3oMzGz6tcHPF9y9Xhq1QksV9h7uEDk=", + "ref": "spec-type", + "rev": "4648a98d91f754ae0f7a3d035a1aaa871eb1b4fc", + "revCount": 34, + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + }, + "original": { + "ref": "spec-type", + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + } + }, "nix-tools": { "flake": false, "locked": { @@ -686,17 +749,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1647350163, - "narHash": "sha256-OcMI+PFEHTONthXuEQNddt16Ml7qGvanL3x8QOl2Aao=", + "lastModified": 1648219316, + "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", + "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", + "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", "type": "github" } }, @@ -765,20 +828,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1645655918, - "narHash": "sha256-ZfbEFRW7o237+A1P7eTKhXje435FCAoe0blj2n20Was=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "77a7a4197740213879b9a1d2e1788c6c8ade4274", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1647297614, "narHash": "sha256-ulGq3W5XsrBMU/u5k9d4oPy65pQTkunR4HKKtTq0RwY=", @@ -794,7 +843,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "flake": false, "locked": { "lastModified": 1628785280, @@ -831,7 +880,7 @@ "pathtree": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "nixpkgs": [ "emanote", "ema", @@ -839,11 +888,11 @@ ] }, "locked": { - "lastModified": 1647644631, - "narHash": "sha256-aRuyBXjUrva7RNSWIIbB+HefowF8wZepCkkaCDm8Qn4=", + "lastModified": 1649011952, + "narHash": "sha256-RuNIoPXx0xy5TZ81JH33V8EqXWX5erv8gepM0Aaeat8=", "owner": "srid", "repo": "pathtree", - "rev": "8619aada5b0cd76dff37a2e90b47eecbb3fb7d23", + "rev": "d60f22b356f79663aca3f5fde9f23bb4a1412963", "type": "github" }, "original": { @@ -860,7 +909,7 @@ "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", "iohk-nix": "iohk-nix_2", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_3", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sphinxcontrib-haddock": "sphinxcontrib-haddock", "stackage-nix": "stackage-nix" @@ -880,25 +929,6 @@ "type": "github" } }, - "pre-commit-hooks": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1646153636, - "narHash": "sha256-AlWHMzK+xJ1mG267FdT8dCq/HvLCA6jwmx2ZUy5O8tY=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "b6bc0b21e1617e2b07d8205e7fae7224036dfa4b", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "pre-commit-hooks-nix": { "flake": false, "locked": { @@ -1079,11 +1109,11 @@ ] }, "locked": { - "lastModified": 1647792199, - "narHash": "sha256-QndGcDf2ySiA+1CSo05lSE9qBCcV18hBCgw8qH9PfEo=", + "lastModified": 1649012698, + "narHash": "sha256-Kosm6SyTjbyD869o+qM4Zg7IUKdqRXq4FN/HCpXcflk=", "owner": "srid", "repo": "tailwind-haskell", - "rev": "9deb377835f9035a658c694dd82cb772afeb2d36", + "rev": "f17cea75ad6a27976e9445eba9f77fa8d323885c", "type": "github" }, "original": { @@ -1113,7 +1143,7 @@ "unionmount": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": [ "emanote", "ema", @@ -1121,11 +1151,11 @@ ] }, "locked": { - "lastModified": 1647795307, - "narHash": "sha256-olb4o0+l8XXtdQ8NKLtwjI5A9/4CPMgRdBVtZVvsLlY=", + "lastModified": 1649012450, + "narHash": "sha256-m0qlPd3jxjyDEkd7cQKLX0GT9a00qnvygec9GCBZ1hc=", "owner": "srid", "repo": "unionmount", - "rev": "ccd5049de67bfd7f042deda00a41659ec4e36f3c", + "rev": "27584567d9182c12018f988db899593a896f86ff", "type": "github" }, "original": { From 9170c945dc78eb13c60a7ccea25826ef5151cc09 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 09:09:59 -0400 Subject: [PATCH 292/584] Add a nix app to run the docs from outside of Git repo --- docs/DEVGUIDE.md | 8 +++++++- flake.nix | 13 ++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/DEVGUIDE.md b/docs/DEVGUIDE.md index 84ea65f6c..7af2f0d60 100644 --- a/docs/DEVGUIDE.md +++ b/docs/DEVGUIDE.md @@ -293,7 +293,7 @@ There's just one element in `txInfoInputs` in this example, and there it is. Of # How to build docs -To run the docs locally, +To run the docs locally from the Git working copy (useful when editing them), ```sh-session nix run .#docs @@ -304,3 +304,9 @@ To build the static HTML site, ```sh-session nix build .#website ``` + +To run the docs directly without cloning the Git repo, + +```sh-session +nix run github:Plutonomicon/plutarch#website +``` diff --git a/flake.nix b/flake.nix index 3d639e9a9..ada4b5826 100644 --- a/flake.nix +++ b/flake.nix @@ -579,7 +579,7 @@ ''; }; }; - plutarchWebsite = system: + plutarchWebsiteStatic = system: let pkgs = nixpkgsFor system; configFile = (pkgs.formats.yaml { }).generate "emanote-configFile" { @@ -597,14 +597,14 @@ --layers "${self}/docs;${configDir}" \ gen $out ''; - plutarchWebsiteApp = system: + plutarchWebsiteLive = system: path: rec { type = "app"; # '' is required for escaping ${} in nix script = (nixpkgsFor system).writers.writeBash "emanoteLiveReload.sh" '' set -xe export PORT="''${EMANOTE_PORT:-7072}" - ${inputs.emanote.defaultPackage.${system}}/bin/emanote --layers ./docs run --port "$PORT" + ${inputs.emanote.defaultPackage.${system}}/bin/emanote --layers ${path} run --port "$PORT" ''; program = builtins.toString script; }; @@ -659,7 +659,7 @@ packages = perSystem (system: self.flake.${system}.packages // { haddock = haddock system; - website = plutarchWebsite system; + website = plutarchWebsiteStatic system; }); checks = perSystem (system: @@ -695,7 +695,10 @@ test-ghc810-nodev = plutarchTestApp system "ghc810-nodev" self.projectMatrix.ghc810.nodev; test-ghc810-dev = plutarchTestApp system "ghc810-dev" self.projectMatrix.ghc810.dev; - docs = plutarchWebsiteApp system; + # `nix run .#docs` should be run from the Git repo. + docs = plutarchWebsiteLive system "./docs"; + # `nix run github:Plutonomicon/plutarch#website` can be run from anywhere + website = plutarchWebsiteLive system "${self}/docs"; } ); devShell = perSystem (system: self.flake.${system}.devShell); From 4042601a387a4a5449e28feddffbedd3957a4567 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 12:09:29 -0400 Subject: [PATCH 293/584] Port unused goldens check to hspec --- plutarch-test/Main.hs | 4 +- plutarch-test/common/Plutarch/Test/Run.hs | 49 ++++++++++------------- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 4d35d76d7..b762dada4 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -13,13 +13,13 @@ import qualified Plutarch.FFISpec as FFISpec #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Plutarch.Test (TrailSpec) +import Plutarch.Test (TrailSpec, runTrailSpec) import Plutarch.Test.Run (runPlutarchSpec) main :: IO () main = do setLocaleEncoding utf8 - runPlutarchSpec spec + runPlutarchSpec . runTrailSpec $ spec spec :: TrailSpec spec = do diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index efc789130..3cf583a5f 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -1,17 +1,23 @@ module Plutarch.Test.Run (runPlutarchSpec) where -import Plutarch.Test.TrailSpecMonad (TrailSpec, runTrailSpec) -import Test.Hspec (hspec) +import Control.Monad (forM_) +import Data.Set (Set) +import qualified Data.Set as Set +import qualified Data.Text as T +import Plutarch.Test.Golden (GoldenKey, defaultGoldenBasePath, goldenTestPath, mkGoldenKeyFromSpecPath) +import System.Directory (listDirectory) +import System.Exit (ExitCode (ExitFailure), exitWith) +import System.FilePath (()) +import Test.Hspec (Spec, hspec) +import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup), runSpecM) -- | Like `sydTest`, but ensures that there are no unused goldens left behind. -runPlutarchSpec :: TrailSpec -> IO () +runPlutarchSpec :: Spec -> IO () runPlutarchSpec spec = do - -- TODO: unsused goldens - -- TODO: use hedgehog runner via hspec-hedgehog - hspec $ runTrailSpec spec - -{- - usedGoldens <- goldenPathsUsedBy <$> sydTest' spec + hspec spec + -- A second traversal here (`runSpecM`) can be obviated after + -- https://github.com/hspec/hspec/issues/649 + usedGoldens <- goldenPathsUsedBy <$> runSpecM spec unusedGoldens usedGoldens >>= \case [] -> pure () unused -> do @@ -47,27 +53,14 @@ goldenPathsUsedBy trees = do -- | Retrieve all golden keys used by the given test tree. queryGoldens :: [SpecTree a] -> [GoldenKey] queryGoldens = - fmap mkGoldenKeyFromSpecPath . concatMap (go []) + fmap (mkGoldenKeyFromSpecPath . reverse) . concatMap (go []) where go ancestors = \case - DescribeNode "golden" _children -> + Node "golden" _children -> ancestors : [] - DescribeNode k children -> - concatMap (go $ k : ancestors) children - SubForestNode trees -> + Node k children -> + concatMap (go $ T.pack k : ancestors) children + NodeWithCleanup _ _ trees -> concatMap (go ancestors) trees - SpecifyNode _ _ -> - mempty - PendingNode _ _ -> + Leaf _ -> mempty - --- | Like `sydTest` but returns the test tree. -sydTest' :: Spec -> IO [SpecTree ()] -sydTest' spec = do - config <- getSettings - resultForest <- timedValue <$> sydTestResult config spec - if shouldExitFail config resultForest - then exitWith $ ExitFailure 1 - else pure $ void <$> resultForest - - -} From 3057c56943ae8ada47d5f3d9ccb8e3c87ada7a7e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 12:24:31 -0400 Subject: [PATCH 294/584] Avoid TrailSpec in top-level spec values --- plutarch-test/Main.hs | 6 +++--- plutarch-test/common/Plutarch/Test/Run.hs | 2 +- plutarch-test/conditional/Plutarch/FFISpec.hs | 2 +- plutarch-test/conditional/Plutarch/FieldSpec.hs | 4 ++-- plutarch-test/conditional/Plutarch/MonadicSpec.hs | 4 ++-- plutarch-test/conditional/Plutarch/TryFromSpec.hs | 4 ++-- plutarch-test/plutarch-base/BaseSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/BoolSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/EitherSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/LiftSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/ListSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/PLamSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/POrdSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/PairSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/RationalSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/RecSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/ShowSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/StringSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/TraceSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs | 4 ++-- plutarch-test/plutarch-base/Plutarch/UnitSpec.hs | 4 ++-- plutarch-test/plutarch-extra/ExtraSpec.hs | 4 ++-- plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs | 4 ++-- 31 files changed, 61 insertions(+), 61 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index b762dada4..12f895488 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -13,15 +13,15 @@ import qualified Plutarch.FFISpec as FFISpec #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Plutarch.Test (TrailSpec, runTrailSpec) +import Plutarch.Test (Spec) import Plutarch.Test.Run (runPlutarchSpec) main :: IO () main = do setLocaleEncoding utf8 - runPlutarchSpec . runTrailSpec $ spec + runPlutarchSpec spec -spec :: TrailSpec +spec :: Spec spec = do BaseSpec.spec ExtraSpec.spec diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index 3cf583a5f..b78a35063 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -11,7 +11,7 @@ import System.FilePath (()) import Test.Hspec (Spec, hspec) import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup), runSpecM) --- | Like `sydTest`, but ensures that there are no unused goldens left behind. +-- | Like `hspec`, but ensures that there are no unused goldens left behind. runPlutarchSpec :: Spec -> IO () runPlutarchSpec spec = do hspec spec diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index ee78f3ba0..0c35c7256 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -232,7 +232,7 @@ signatories = ["ab01fe235c", "123014", "abcdef"] @since 0.1 -} -spec :: TrailSpec +spec :: Spec spec = describe "FFI" $ do describe "Simple types" $ do it "integer literal" $ diff --git a/plutarch-test/conditional/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs index 888067618..106f4c205 100644 --- a/plutarch-test/conditional/Plutarch/FieldSpec.hs +++ b/plutarch-test/conditional/Plutarch/FieldSpec.hs @@ -15,8 +15,8 @@ import Plutarch.SpecTypes (PTriplet) import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "field" $ do -- example: Trips describe "trips" . pgoldenSpec $ do diff --git a/plutarch-test/conditional/Plutarch/MonadicSpec.hs b/plutarch-test/conditional/Plutarch/MonadicSpec.hs index 6e7e7d7a6..d2192120d 100644 --- a/plutarch-test/conditional/Plutarch/MonadicSpec.hs +++ b/plutarch-test/conditional/Plutarch/MonadicSpec.hs @@ -18,8 +18,8 @@ import Plutarch.Prelude import Plutarch.Test import Plutus.V1.Ledger.Api -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "monadic" $ do {- TODO: Uncomment this after flakiness is fixed See https://github.com/Plutonomicon/plutarch/issues/290 diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index ba0eb403b..ff5e41d07 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -70,8 +70,8 @@ import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) import GHC.Records (getField) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do "erroneous" @\ do "(String, Integer) /= (String, String)" diff --git a/plutarch-test/plutarch-base/BaseSpec.hs b/plutarch-test/plutarch-base/BaseSpec.hs index 5b14d4b76..2769eb0b0 100644 --- a/plutarch-test/plutarch-base/BaseSpec.hs +++ b/plutarch-test/plutarch-base/BaseSpec.hs @@ -19,12 +19,12 @@ import qualified Plutarch.RecursionSpec as RecursionSpec import qualified Plutarch.ScriptsSpec as ScriptsSpec import qualified Plutarch.ShowSpec as ShowSpec import qualified Plutarch.StringSpec as StringSpec -import Plutarch.Test (TrailSpec) +import Plutarch.Test import qualified Plutarch.TraceSpec as TraceSpec import qualified Plutarch.UPLCSpec as UPLCSpec import qualified Plutarch.UnitSpec as UnitSpec -spec :: TrailSpec +spec :: Spec spec = do ApiSpec.spec BoolSpec.spec diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 9378c6f28..ca027503c 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -23,8 +23,8 @@ import Plutarch.Test -- import PlutusTx.AssocMap as PlutusMap -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "api" $ do describe "ctx" $ do pgoldenSpec $ do diff --git a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs index 0ea97032a..fdf37a941 100644 --- a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs @@ -4,8 +4,8 @@ import Plutarch.Bool (pand, por) import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "bool" . pgoldenSpec $ do "pnot" @\ do "lam" @| pnot diff --git a/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs index ff66f9afe..b59789a5c 100644 --- a/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs @@ -4,8 +4,8 @@ import qualified Data.ByteString as BS import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "bytestring" . pgoldenSpec $ do "empty" @| mempty #== phexByteStr "" @-> passert "phexByteStr" diff --git a/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs index 91d682213..b8f516cbe 100644 --- a/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs @@ -3,8 +3,8 @@ module Plutarch.EitherSpec (spec) where import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "either" . pgoldenSpec $ do "eq" @\ do "true" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs index 685b274b5..d4d192920 100644 --- a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs @@ -4,8 +4,8 @@ import Plutarch import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "int" $ do describe "examples" $ do pgoldenSpec $ do diff --git a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs index 68dd086c1..8c49dc1e9 100644 --- a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs @@ -10,8 +10,8 @@ import Plutarch.Prelude import Plutarch.Test import Test.Hspec (Expectation, shouldBe) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "lift" $ do describe "plift" $ do it "bool" $ do diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index f213df624..b92717eb6 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -17,8 +17,8 @@ import Test.Hspec.Hedgehog (hedgehog) integerList :: [Integer] -> Term s (PList PInteger) integerList xs = pconvertLists #$ pconstant @(PBuiltinList PInteger) xs -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "list" $ do describe "properties" $ do describe "find" $ do diff --git a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs index 832059fa8..d90052308 100644 --- a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs @@ -6,8 +6,8 @@ import Plutarch.Integer (PInteger) import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "maybe" . pgoldenSpec $ do "eq" @\ do "true" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index c5ba6689b..988b8069d 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -31,8 +31,8 @@ import Plutarch.SpecTypes (PTriplet (PTriplet)) import Plutarch.Test import Test.Hspec (shouldBe, specify) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "pisdata" $ do propertySet @PBool "PBool" propertySet @PInteger "PInteger" diff --git a/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs index 158447c65..949ba31df 100644 --- a/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs @@ -7,8 +7,8 @@ import Plutarch.Prelude import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "plam" . pgoldenSpec $ do "id" @| plam (\x -> x) "flip.const" @| plam (\_ y -> y) diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index 855c87506..2e98309cf 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -32,8 +32,8 @@ import Plutarch.SpecTypes (PTriplet (PTriplet), Triplet (Triplet)) import Plutarch.Test import Test.Hspec (shouldBe, specify) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "pisdata" $ do describe "ord.property" $ do propertySet @PBool "PBool" diff --git a/plutarch-test/plutarch-base/Plutarch/PairSpec.hs b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs index 879ef6561..055cddce1 100644 --- a/plutarch-test/plutarch-base/Plutarch/PairSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs @@ -3,8 +3,8 @@ module Plutarch.PairSpec (spec) where import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "pair" . pgoldenSpec $ do "eq" @\ do "true" diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index 26d92260b..703ea5638 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -20,8 +20,8 @@ import Plutus.V1.Ledger.Credential ( ) import Test.Hspec (Expectation) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "plutustype" $ do describe "example" . pgoldenSpec $ do "A-as-0" @| pcon A @== pconstant @PInteger 0 diff --git a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs index c3b11d3a0..0f6260bdd 100644 --- a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs @@ -5,8 +5,8 @@ import Plutarch.Rational (pproperFraction, ptruncate) import Plutarch.Test import Test.Hspec (Expectation) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do let rat :: Term s PRational -> Term s PRational rat = id assertRat :: ClosedTerm PRational -> ClosedTerm PRational -> Expectation diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index 9678da2e1..6c80b68e1 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -205,8 +205,8 @@ flatOuterData = pdata (punsafeFrom sampleFlatOuter) shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) shallowOuterData = pdata (punsafeFrom sampleShallowOuter) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do -- Plutarch.Rec.verifySoleConstructor uses tracing, so we must create two sets -- of golden. describe "rec" . plutarchDevFlagDescribe . pgoldenSpec $ do diff --git a/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs index 183d6926a..e61d3552a 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs @@ -9,8 +9,8 @@ import Plutarch.Integer (PInteger) import Plutarch.Lift (pconstant) import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "recursion" $ do describe "example" . pgoldenSpec $ do "iterateN" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 89eab9a3e..0f8438e14 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -45,8 +45,8 @@ import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "scripts" . pgoldenSpec $ do "auth_validator" @\ do "0" @| authValidatorTerm diff --git a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs index 472e53c9b..7da3bbf15 100644 --- a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs @@ -8,8 +8,8 @@ import Plutarch.ListSpec (integerList) import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "show" . pgoldenSpec $ do let str x = pconstant @PString x "unit" @| pshow (pcon PUnit) @== str "()" diff --git a/plutarch-test/plutarch-base/Plutarch/StringSpec.hs b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs index d87d40855..b34217783 100644 --- a/plutarch-test/plutarch-base/Plutarch/StringSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs @@ -3,8 +3,8 @@ module Plutarch.StringSpec (spec) where import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "str" $ do pgoldenSpec $ do "eq" @| "foo" #== pconstant @PString "foo" @-> passert diff --git a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs index 2b6995797..005cca8ed 100644 --- a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs @@ -3,8 +3,8 @@ module Plutarch.TraceSpec (spec) where import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do "ptrace" @\ do "one" @| ptrace "foo" (pcon PUnit) @-> \p -> diff --git a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs index 29aafedea..df6f247c7 100644 --- a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs @@ -7,8 +7,8 @@ import Plutarch.Prelude import Plutarch.Test import Plutarch.Unsafe (punsafeBuiltin) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do -- Tests for the behaviour of UPLC itself. describe "uplc-behaviour" . pgoldenSpec $ do "2:[1]" diff --git a/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs index eac932dfa..5ea7448c8 100644 --- a/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs @@ -4,8 +4,8 @@ import Plutarch import Plutarch.Prelude import Plutarch.Test -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "unit" . pgoldenSpec $ do "pcon" @| pcon PUnit "pmatch" @| pmatch (pcon PUnit) (\case PUnit -> pcon PTrue) @-> passert diff --git a/plutarch-test/plutarch-extra/ExtraSpec.hs b/plutarch-test/plutarch-extra/ExtraSpec.hs index 1bb88b917..8414899aa 100644 --- a/plutarch-test/plutarch-extra/ExtraSpec.hs +++ b/plutarch-test/plutarch-extra/ExtraSpec.hs @@ -1,8 +1,8 @@ module ExtraSpec (spec) where import qualified Plutarch.ListUtilsSpec as ListUtilsSpec -import Plutarch.Test (TrailSpec) +import Plutarch.Test -spec :: TrailSpec +spec :: Spec spec = do ListUtilsSpec.spec diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs index 08ad41199..ac6c9e499 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -10,8 +10,8 @@ import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genInteger, genList) import Test.Hspec.Hedgehog (hedgehog) -spec :: TrailSpec -spec = do +spec :: Spec +spec = runTrailSpec $ do describe "extra.listutils" $ do describe "properties" $ do describe "reverse" $ do From 04a7a65f60b40f06b18d209341c7e9019993afe3 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 12:32:45 -0400 Subject: [PATCH 295/584] Do unused golden check in ghc9 only; and fix ghc8 imports --- plutarch-test/Main.hs | 12 +++++++++++- plutarch-test/conditional/Plutarch/FFISpec.hs | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 12f895488..bdde66453 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -8,18 +8,28 @@ import qualified ExtraSpec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) import qualified Plutarch.FieldSpec as FieldSpec import qualified Plutarch.MonadicSpec as MonadicSpec +import Plutarch.Test.Run (runPlutarchSpec) #else import qualified Plutarch.FFISpec as FFISpec +import Test.Hspec (hspec) #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) import Plutarch.Test (Spec) -import Plutarch.Test.Run (runPlutarchSpec) main :: IO () main = do setLocaleEncoding utf8 + +-- We use 'runPlutarchSpec' to test for unused goldens, but do so only in GHC +-- 9. Because, under GHC 8 certain modules are disabled (see the CPP below) +-- which leads to legitimately unused goldens detected leading to false +-- positive in test failure. +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) runPlutarchSpec spec +#else + hspec spec +#endif spec :: Spec spec = do diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index 0c35c7256..9cac3a01f 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -62,7 +62,8 @@ import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinUnit) import PlutusTx.Prelude import Shrink (shrinkScript, shrinkScriptSp, withoutTactics) -import Plutarch.Test +import Plutarch.Test hiding (describe, it) +import Test.Hspec import Test.Tasty.HUnit ((@?=)) -- import Test.Tasty.Plutus.Internal.Context (ContextBuilder (cbSignatories), TransactionConfig(..), compileSpending) From e3e9e7cebd7ecb7704eab60d062ae1ba4cfa79f9 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 12:40:17 -0400 Subject: [PATCH 296/584] Test TrailSpecMonad --- plutarch-test/Main.hs | 2 ++ plutarch-test/common/Plutarch/Test.hs | 7 ++++--- plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs | 9 ++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index bdde66453..0c7c99cac 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -16,6 +16,7 @@ import Test.Hspec (hspec) import GHC.IO.Encoding (setLocaleEncoding, utf8) import Plutarch.Test (Spec) +import qualified Plutarch.Test.TrailSpecMonad as TrailSpecMonad main :: IO () main = do @@ -33,6 +34,7 @@ main = do spec :: Spec spec = do + TrailSpecMonad.spec BaseSpec.spec ExtraSpec.spec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index fd59a18f8..9cf1b699e 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -3,7 +3,7 @@ -- | Common functions for testing Plutarch code module Plutarch.Test ( - -- | Plutarch specific `Expectation` operators + -- * Plutarch specific `Expectation` operators passert, passertNot, pfails, @@ -11,7 +11,8 @@ module Plutarch.Test ( ptraces, pshouldBe, (#@?=), - -- | Budget expectation + + -- * Budget expectation psatisfyWithinBenchmark, -- * For Development flag tests @@ -26,7 +27,7 @@ module Plutarch.Test ( pgoldenSpec, PlutarchGoldens, - -- * Spec monad for tests using golden testing + -- * Spec monad for tests using golden testing. Use `runTrailSpec` on the spec tree that uses `pgoldenSpec`. TrailSpec, describe, it, diff --git a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs index b81a29eff..3f38a1749 100644 --- a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs +++ b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs @@ -14,11 +14,14 @@ module Plutarch.Test.TrailSpecMonad ( -- * Variants of hspec functions that work in `TrailSpecM` monad describe, it, + + -- * Test + spec, ) where import Control.Monad.Reader import GHC.Stack (HasCallStack) -import Test.Hspec.Core.Spec (Arg, Example, SpecM) +import Test.Hspec.Core.Spec (Arg, Example, Spec, SpecM) import qualified Test.Hspec.Core.Spec import Test.Hspec.Hedgehog (hedgehog, (===)) @@ -56,8 +59,8 @@ describe s (TrailSpecM m) = it :: (HasCallStack, Example a) => String -> a -> TrailSpecWith (Arg a) it s t = lift $ Test.Hspec.Core.Spec.it s t -_test_trailSpec :: TrailSpec -_test_trailSpec = do +spec :: Spec +spec = runTrailSpec $ do as0 <- ancestorTrail it "ancestorTrail at root" . hedgehog $ do as0 === [] From 967dd2131b778a288e13f13396d92946af0d9f92 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 13:00:33 -0400 Subject: [PATCH 297/584] Use hspec-discover to avoid boilerplate --- flake.nix | 6 +++ plutarch-test/Main.hs | 9 ++-- plutarch-test/common/Plutarch/Test/Run.hs | 3 +- plutarch-test/plutarch-base/BaseSpec.hs | 52 +---------------------- plutarch-test/plutarch-extra/ExtraSpec.hs | 10 +---- plutarch-test/plutarch-test.cabal | 1 + 6 files changed, 19 insertions(+), 62 deletions(-) diff --git a/flake.nix b/flake.nix index 2ee8b61eb..de7acfbd4 100644 --- a/flake.nix +++ b/flake.nix @@ -442,6 +442,11 @@ modules = [ (haskellModule system) { + # Workaround missing support for build-tools: + # https://github.com/input-output-hk/haskell.nix/issues/231 + packages.plutarch-test.components.exes.plutarch-test.build-tools = [ + pkgSet.hsPkgs.hspec-discover + ]; packages.plutarch-test.flags.development = flagDevelopment; packages.plutarch.flags.development = flagDevelopment; } @@ -458,6 +463,7 @@ pkgs'.hlint pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt + pkgSet.hsPkgs.hspec-discover.components.exes.hspec-discover ]; inherit tools; diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 0c7c99cac..2391823ee 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -17,6 +17,7 @@ import Test.Hspec (hspec) import GHC.IO.Encoding (setLocaleEncoding, utf8) import Plutarch.Test (Spec) import qualified Plutarch.Test.TrailSpecMonad as TrailSpecMonad +import Test.Hspec (describe) main :: IO () main = do @@ -38,8 +39,10 @@ spec = do BaseSpec.spec ExtraSpec.spec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) - FieldSpec.spec - MonadicSpec.spec + describe "GHC-9-only" $ do + FieldSpec.spec + MonadicSpec.spec #else - FFISpec.spec + describe "GHC-8-only" $ do + FFISpec.spec #endif diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index b78a35063..bbf181cd7 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -53,7 +53,8 @@ goldenPathsUsedBy trees = do -- | Retrieve all golden keys used by the given test tree. queryGoldens :: [SpecTree a] -> [GoldenKey] queryGoldens = - fmap (mkGoldenKeyFromSpecPath . reverse) . concatMap (go []) + -- `drop 1`, to drop the hspec-discover generated root node. + fmap (mkGoldenKeyFromSpecPath . drop 1 . reverse) . concatMap (go []) where go ancestors = \case Node "golden" _children -> diff --git a/plutarch-test/plutarch-base/BaseSpec.hs b/plutarch-test/plutarch-base/BaseSpec.hs index 2769eb0b0..108855af1 100644 --- a/plutarch-test/plutarch-base/BaseSpec.hs +++ b/plutarch-test/plutarch-base/BaseSpec.hs @@ -1,50 +1,2 @@ -module BaseSpec (spec) where - -import qualified Plutarch.ApiSpec as ApiSpec -import qualified Plutarch.BoolSpec as BoolSpec -import qualified Plutarch.ByteStringSpec as ByteStringSpec -import qualified Plutarch.EitherSpec as EitherSpec -import qualified Plutarch.IntegerSpec as IntegerSpec -import qualified Plutarch.LiftSpec as LiftSpec -import qualified Plutarch.ListSpec as ListSpec -import qualified Plutarch.MaybeSpec as MaybeSpec -import qualified Plutarch.PIsDataSpec as PIsDataSpec -import qualified Plutarch.PLamSpec as PLamSpec -import qualified Plutarch.POrdSpec as POrdSpec -import qualified Plutarch.PairSpec as PairSpec -import qualified Plutarch.PlutusTypeSpec as PlutusTypeSpec -import qualified Plutarch.RationalSpec as RationalSpec -import qualified Plutarch.RecSpec as RecSpec -import qualified Plutarch.RecursionSpec as RecursionSpec -import qualified Plutarch.ScriptsSpec as ScriptsSpec -import qualified Plutarch.ShowSpec as ShowSpec -import qualified Plutarch.StringSpec as StringSpec -import Plutarch.Test -import qualified Plutarch.TraceSpec as TraceSpec -import qualified Plutarch.UPLCSpec as UPLCSpec -import qualified Plutarch.UnitSpec as UnitSpec - -spec :: Spec -spec = do - ApiSpec.spec - BoolSpec.spec - ByteStringSpec.spec - EitherSpec.spec - IntegerSpec.spec - LiftSpec.spec - ListSpec.spec - MaybeSpec.spec - PairSpec.spec - PIsDataSpec.spec - PLamSpec.spec - PlutusTypeSpec.spec - POrdSpec.spec - RationalSpec.spec - RecursionSpec.spec - ScriptsSpec.spec - ShowSpec.spec - RecSpec.spec - StringSpec.spec - TraceSpec.spec - UnitSpec.spec - UPLCSpec.spec +{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=BaseSpec #-} +{-# OPTIONS_GHC -Wno-missing-export-lists #-} diff --git a/plutarch-test/plutarch-extra/ExtraSpec.hs b/plutarch-test/plutarch-extra/ExtraSpec.hs index 8414899aa..25d177796 100644 --- a/plutarch-test/plutarch-extra/ExtraSpec.hs +++ b/plutarch-test/plutarch-extra/ExtraSpec.hs @@ -1,8 +1,2 @@ -module ExtraSpec (spec) where - -import qualified Plutarch.ListUtilsSpec as ListUtilsSpec -import Plutarch.Test - -spec :: Spec -spec = do - ListUtilsSpec.spec +{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=ExtraSpec #-} +{-# OPTIONS_GHC -Wno-missing-export-lists #-} diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 3f7068a9e..3ad6b93ea 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -84,6 +84,7 @@ common deps , hedgehog , hspec , hspec-core + , hspec-discover , hspec-golden , hspec-hedgehog , mtl From 712bb7cd2020affd516eff3d81fa2842c65f3a2b Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 13:10:29 -0400 Subject: [PATCH 298/584] Refactor unused goldens check function use --- plutarch-test/Main.hs | 17 +++++++---------- plutarch-test/common/Plutarch/Test/Run.hs | 18 ++++++++++++------ plutarch-test/plutarch-test.cabal | 2 +- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 2391823ee..38da77f87 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -8,29 +8,26 @@ import qualified ExtraSpec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) import qualified Plutarch.FieldSpec as FieldSpec import qualified Plutarch.MonadicSpec as MonadicSpec -import Plutarch.Test.Run (runPlutarchSpec) +import Plutarch.Test.Run (noUnusedGoldens) #else import qualified Plutarch.FFISpec as FFISpec -import Test.Hspec (hspec) #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) import Plutarch.Test (Spec) import qualified Plutarch.Test.TrailSpecMonad as TrailSpecMonad -import Test.Hspec (describe) +import Test.Hspec (describe, hspec) main :: IO () main = do setLocaleEncoding utf8 + hspec spec --- We use 'runPlutarchSpec' to test for unused goldens, but do so only in GHC --- 9. Because, under GHC 8 certain modules are disabled (see the CPP below) --- which leads to legitimately unused goldens detected leading to false --- positive in test failure. +-- We test for unused goldens, but do so only in GHC 9. Because, under GHC 8 +-- certain modules are disabled (see the CPP below) which leads to legitimately +-- unused goldens detected leading to false positive in test failure. #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) - runPlutarchSpec spec -#else - hspec spec + noUnusedGoldens spec #endif spec :: Spec diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index bbf181cd7..8b0179f2d 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -1,4 +1,4 @@ -module Plutarch.Test.Run (runPlutarchSpec) where +module Plutarch.Test.Run (noUnusedGoldens) where import Control.Monad (forM_) import Data.Set (Set) @@ -8,13 +8,19 @@ import Plutarch.Test.Golden (GoldenKey, defaultGoldenBasePath, goldenTestPath, m import System.Directory (listDirectory) import System.Exit (ExitCode (ExitFailure), exitWith) import System.FilePath (()) -import Test.Hspec (Spec, hspec) +import Test.Hspec (Spec) import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup), runSpecM) --- | Like `hspec`, but ensures that there are no unused goldens left behind. -runPlutarchSpec :: Spec -> IO () -runPlutarchSpec spec = do - hspec spec +{- | Ensures that there are no unused goldens left behind. + + Use this on any `SpecTree` that interally uses `pgoldenSpec` to define the + golden tests. These golden file paths are accumulated, and compared to the + actual files existing on disk. If any golden file exists on disk, but is not + tracked by the `SpecTree` this function will fail, reporting the list of + untracked golden files. +-} +noUnusedGoldens :: Spec -> IO () +noUnusedGoldens spec = do -- A second traversal here (`runSpecM`) can be obviated after -- https://github.com/hspec/hspec/issues/649 usedGoldens <- goldenPathsUsedBy <$> runSpecM spec diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 3ad6b93ea..96959a7df 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -108,6 +108,7 @@ library exposed-modules: Plutarch.Test Plutarch.Test.Property + Plutarch.Test.Run other-modules: Plutarch.Test.Benchmark @@ -117,7 +118,6 @@ library Plutarch.Test.Property.Gen Plutarch.Test.Property.HaskEquiv Plutarch.Test.Property.Marshal - Plutarch.Test.Run Plutarch.Test.TrailSpecMonad if flag(development) From 3b4b1de6dd4babbb524b12473d03d1d931b59c8b Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 13:22:57 -0400 Subject: [PATCH 299/584] Factor out TrailSpecMonad from propertySet functions --- .../plutarch-base/Plutarch/PIsDataSpec.hs | 27 +++++++++-------- .../plutarch-base/Plutarch/POrdSpec.hs | 29 +++++++++---------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index 988b8069d..9926d65a9 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -30,13 +30,15 @@ import Plutarch.Prelude import Plutarch.SpecTypes (PTriplet (PTriplet)) import Plutarch.Test import Test.Hspec (shouldBe, specify) +import qualified Test.Hspec as H spec :: Spec spec = runTrailSpec $ do describe "pisdata" $ do - propertySet @PBool "PBool" - propertySet @PInteger "PInteger" - propertySet @PUnit "PUnit" + lift $ do + propertySet @PBool "PBool" + propertySet @PInteger "PInteger" + propertySet @PUnit "PUnit" describe "equality" . pgoldenSpec $ do "PData" @\ do "1" @@ -159,18 +161,15 @@ propertySet :: , Arbitrary (PLifted p) ) => String -> - TrailSpec + Spec propertySet typeName = do - describe typeName $ do - lift $ - specify ("x ~ " <> typeName <> ": pfromData (pdata x) ≡ x") $ - property $ ptoFromEqual @p - lift $ - specify ("x ~ " <> typeName <> ": pfromData (PlutusTx.toData x) ≡ x") $ - property $ pfromDataCompat @p - lift $ - specify ("x ~ " <> typeName <> ": PlutusTx.fromData (pdata x) ≡ Just x") $ - property $ pdataCompat @p + H.describe typeName $ do + specify ("x ~ " <> typeName <> ": pfromData (pdata x) ≡ x") $ + property $ ptoFromEqual @p + specify ("x ~ " <> typeName <> ": pfromData (PlutusTx.toData x) ≡ x") $ + property $ pfromDataCompat @p + specify ("x ~ " <> typeName <> ": PlutusTx.fromData (pdata x) ≡ Just x") $ + property $ pdataCompat @p ptoFromEqual :: forall p. diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index 2e98309cf..847f9ad11 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -31,15 +31,17 @@ import Control.Monad.Trans (lift) import Plutarch.SpecTypes (PTriplet (PTriplet), Triplet (Triplet)) import Plutarch.Test import Test.Hspec (shouldBe, specify) +import qualified Test.Hspec as H spec :: Spec spec = runTrailSpec $ do describe "pisdata" $ do describe "ord.property" $ do - propertySet @PBool "PBool" - propertySet @(PMaybeData PInteger) "PMaybeData PInteger" - propertySet @(PTriplet PInteger) "PMaybeData PInteger" - propertySet @PAddress' "PAddress" + lift $ do + propertySet @PBool "PBool" + propertySet @(PMaybeData PInteger) "PMaybeData PInteger" + propertySet @(PTriplet PInteger) "PMaybeData PInteger" + propertySet @PAddress' "PAddress" describe "lt" . pgoldenSpec $ do "PCredential" @\ do let c1 = PubKeyCredential "" @@ -111,19 +113,16 @@ propertySet :: , Arbitrary (PLifted p) ) => String -> - TrailSpec + Spec propertySet typeName' = do - describe typeName' $ do + H.describe typeName' $ do let typeName = '(' : typeName' ++ ")" - lift $ - specify ("(#<) @" <> typeName <> " ≡ (<) @" <> typeName) $ - property $ pltIso @p - lift $ - specify ("(#<=) @" <> typeName <> " ≡ (<=) @" <> typeName) $ - property $ plteIso @p - lift $ - specify ("(#==) @" <> typeName <> " ≡ (==) @" <> typeName) $ - property $ peqIso @p + specify ("(#<) @" <> typeName <> " ≡ (<) @" <> typeName) $ + property $ pltIso @p + specify ("(#<=) @" <> typeName <> " ≡ (<=) @" <> typeName) $ + property $ plteIso @p + specify ("(#==) @" <> typeName <> " ≡ (==) @" <> typeName) $ + property $ peqIso @p pltIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Ord h, POrd p) => h -> h -> IO () pltIso a b = plift (pconstant @p a #< pconstant b) `shouldBe` (a < b) From 80a78ec4414c449cf0d5f9d486922075bebd35a4 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 13:23:34 -0400 Subject: [PATCH 300/584] Remove TrailSpecMonad tests Not needed --- plutarch-test/Main.hs | 2 -- .../common/Plutarch/Test/TrailSpecMonad.hs | 17 +---------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 38da77f87..274c640e4 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -15,7 +15,6 @@ import qualified Plutarch.FFISpec as FFISpec import GHC.IO.Encoding (setLocaleEncoding, utf8) import Plutarch.Test (Spec) -import qualified Plutarch.Test.TrailSpecMonad as TrailSpecMonad import Test.Hspec (describe, hspec) main :: IO () @@ -32,7 +31,6 @@ main = do spec :: Spec spec = do - TrailSpecMonad.spec BaseSpec.spec ExtraSpec.spec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) diff --git a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs index 3f38a1749..a8b82b34f 100644 --- a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs +++ b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs @@ -14,16 +14,12 @@ module Plutarch.Test.TrailSpecMonad ( -- * Variants of hspec functions that work in `TrailSpecM` monad describe, it, - - -- * Test - spec, ) where import Control.Monad.Reader import GHC.Stack (HasCallStack) -import Test.Hspec.Core.Spec (Arg, Example, Spec, SpecM) +import Test.Hspec.Core.Spec (Arg, Example, SpecM) import qualified Test.Hspec.Core.Spec -import Test.Hspec.Hedgehog (hedgehog, (===)) type TrailSpec = TrailSpecWith () @@ -58,14 +54,3 @@ describe s (TrailSpecM m) = -- | Like `Test.Hspec.Core.Spec.it` but lifted to `TrailSpecM`. it :: (HasCallStack, Example a) => String -> a -> TrailSpecWith (Arg a) it s t = lift $ Test.Hspec.Core.Spec.it s t - -spec :: Spec -spec = runTrailSpec $ do - as0 <- ancestorTrail - it "ancestorTrail at root" . hedgehog $ do - as0 === [] - describe "child" $ do - describe "grandchild" $ do - as <- ancestorTrail - it "ancestorTrail" . hedgehog $ do - as === ["grandchild", "child"] From 73aee182e959a4dfff0c3b49fe3fcf0e51133dc9 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 14:13:53 -0400 Subject: [PATCH 301/584] Use TrailSpec import explicitly, and minimize Plutarch.Test imports TrailSpec is going away, so will these explicit uses of `TS.*`. --- plutarch-test/Main.hs | 3 +-- plutarch-test/common/Plutarch/Test.hs | 17 +++++------------ .../common/Plutarch/Test/TrailSpecMonad.hs | 3 +++ plutarch-test/conditional/Plutarch/FFISpec.hs | 1 - .../conditional/Plutarch/FieldSpec.hs | 18 ++++++++++-------- .../conditional/Plutarch/MonadicSpec.hs | 12 +++++++----- .../conditional/Plutarch/TryFromSpec.hs | 6 ++++-- ....api.example.signatory.dev=true.uplc.golden | 4 ++-- .../plutarch-base/Plutarch/ApiSpec.hs | 14 ++++++++------ .../plutarch-base/Plutarch/BoolSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/ByteStringSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/EitherSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/IntegerSpec.hs | 8 +++++--- .../plutarch-base/Plutarch/LiftSpec.hs | 16 +++++++++------- .../plutarch-base/Plutarch/ListSpec.hs | 9 ++++++--- .../plutarch-base/Plutarch/MaybeSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/PIsDataSpec.hs | 13 +++++++------ .../plutarch-base/Plutarch/PLamSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/POrdSpec.hs | 15 ++++++++------- .../plutarch-base/Plutarch/PairSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 18 ++++++++++-------- .../plutarch-base/Plutarch/RationalSpec.hs | 7 ++++--- .../plutarch-base/Plutarch/RecSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/RecursionSpec.hs | 8 +++++--- .../plutarch-base/Plutarch/ScriptsSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/ShowSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/StringSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/TraceSpec.hs | 6 ++++-- .../plutarch-base/Plutarch/UPLCSpec.hs | 8 +++++--- .../plutarch-base/Plutarch/UnitSpec.hs | 6 ++++-- .../plutarch-extra/Plutarch/ListUtilsSpec.hs | 9 ++++++--- plutarch-test/plutarch-test.cabal | 4 ++-- 32 files changed, 155 insertions(+), 110 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 274c640e4..206697b7c 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -14,8 +14,7 @@ import qualified Plutarch.FFISpec as FFISpec #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Plutarch.Test (Spec) -import Test.Hspec (describe, hspec) +import Test.Hspec (Spec, describe, hspec) main :: IO () main = do diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index 9cf1b699e..cb83c1eaf 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -27,13 +27,6 @@ module Plutarch.Test ( pgoldenSpec, PlutarchGoldens, - -- * Spec monad for tests using golden testing. Use `runTrailSpec` on the spec tree that uses `pgoldenSpec`. - TrailSpec, - describe, - it, - runTrailSpec, - Spec, - -- * Benchmark type for use in `(@:->)` Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), ScriptSizeBytes, @@ -58,9 +51,9 @@ import Plutarch.Test.Golden ( (@\), (@|), ) -import Plutarch.Test.TrailSpecMonad (TrailSpec, describe, it, runTrailSpec) +import qualified Plutarch.Test.TrailSpecMonad as TS import qualified Plutus.V1.Ledger.Scripts as Scripts -import Test.Hspec (Expectation, Spec, expectationFailure, shouldBe, shouldSatisfy) +import Test.Hspec (Expectation, expectationFailure, shouldBe, shouldSatisfy) import Test.Tasty.HUnit (assertFailure) {- | @@ -154,15 +147,15 @@ ptraces p develTraces = Typically meant to be used in conjunction with `ptraces`. -} -plutarchDevFlagDescribe :: TrailSpec -> TrailSpec +plutarchDevFlagDescribe :: TS.TrailSpec -> TS.TrailSpec -- CPP support isn't great in fourmolu. {- ORMOLU_DISABLE -} plutarchDevFlagDescribe m = #ifdef Development - describe "dev=true" m + TS.describe "dev=true" m #else - describe "dev=false" m + TS.describe "dev=false" m #endif {- ORMOLU_ENABLE -} diff --git a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs index a8b82b34f..cc237bc07 100644 --- a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs +++ b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs @@ -1,5 +1,8 @@ {- | This module exists only until https://github.com/hspec/hspec/pull/648 is merged & released upstream. + + It is to be used when defining test trees that use `pgoldenSpec`. Once the + above PR is merged, `pgoldenSpec` will work in the `Spec` monad. -} module Plutarch.Test.TrailSpecMonad ( -- * Types diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index 9cac3a01f..6b7673db6 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -62,7 +62,6 @@ import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinUnit) import PlutusTx.Prelude import Shrink (shrinkScript, shrinkScriptSp, withoutTactics) -import Plutarch.Test hiding (describe, it) import Test.Hspec import Test.Tasty.HUnit ((@?=)) diff --git a/plutarch-test/conditional/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs index 106f4c205..2d907faba 100644 --- a/plutarch-test/conditional/Plutarch/FieldSpec.hs +++ b/plutarch-test/conditional/Plutarch/FieldSpec.hs @@ -13,13 +13,15 @@ import Plutarch.Builtin (ppairDataBuiltin) import Plutarch.Prelude import Plutarch.SpecTypes (PTriplet) import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "field" $ do +spec = TS.runTrailSpec $ do + TS.describe "field" $ do -- example: Trips - describe "trips" . pgoldenSpec $ do + TS.describe "trips" . pgoldenSpec $ do -- compilation "lam" @\ do "tripSum" @| tripSum @@ -34,17 +36,17 @@ spec = runTrailSpec $ do plift p @?= 10 "tripYZ=tripZY" @| tripZY @== tripYZ -- rangeFields - describe "rangeFields" . pgoldenSpec $ do + TS.describe "rangeFields" . pgoldenSpec $ do -- compilation "lam" @| rangeFields "app" @| rangeFields # someFields @-> \p -> plift p @?= 11 -- dropFields - describe "dropFields" . pgoldenSpec $ do + TS.describe "dropFields" . pgoldenSpec $ do -- compilation "lam" @| dropFields "app" @| dropFields # someFields @-> \p -> plift p @?= 17 -- pletFields - describe "pletFields" . pgoldenSpec $ do + TS.describe "pletFields" . pgoldenSpec $ do -- compilation "letSomeFields" @\ do "lam" @| letSomeFields @@ -53,10 +55,10 @@ spec = runTrailSpec $ do "nFields" @\ do "lam" @| nFields "app" @| nFields # someFields @-> \p -> plift p @?= 1 - describe "other" . pgoldenSpec $ do + TS.describe "other" . pgoldenSpec $ do "by" @| by @-> \p -> plift p @?= 10 "dotPlus" @| dotPlus @-> \p -> plift p @?= 19010 - describe "data" . pgoldenSpec $ do + TS.describe "data" . pgoldenSpec $ do "pmatch-pfield" @\ do -- These two should ideally have the exact same efficiency. "pmatch" @\ do diff --git a/plutarch-test/conditional/Plutarch/MonadicSpec.hs b/plutarch-test/conditional/Plutarch/MonadicSpec.hs index d2192120d..2225c8a38 100644 --- a/plutarch-test/conditional/Plutarch/MonadicSpec.hs +++ b/plutarch-test/conditional/Plutarch/MonadicSpec.hs @@ -16,11 +16,13 @@ import qualified Plutarch.ApiSpec as ApiSpec import qualified Plutarch.Monadic as P import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS import Plutus.V1.Ledger.Api +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "monadic" $ do +spec = TS.runTrailSpec $ do + TS.describe "monadic" $ do {- TODO: Uncomment this after flakiness is fixed See https://github.com/Plutonomicon/plutarch/issues/290 -} @@ -61,15 +63,15 @@ spec = runTrailSpec $ do PSCons _ xs'' <- TermCont $ pmatch xs' pure xs'' -} - describe "api.example" $ do + TS.describe "api.example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. - describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do + TS.describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" "do" @\ do "succeeds" @| checkSignatory # pconstant aSig # ApiSpec.ctx @-> psucceeds "fails" @| checkSignatory # pconstant "41" # ApiSpec.ctx @-> pfails - describe "getFields" . pgoldenSpec $ do + TS.describe "getFields" . pgoldenSpec $ do "0" @| getFields checkSignatory :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index ff5e41d07..9d9bfae2e 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -28,6 +28,7 @@ import PlutusTx ( import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe ( punsafeCoerce, @@ -69,10 +70,11 @@ import qualified Plutarch.ApiSpec as Api import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) import GHC.Records (getField) +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do "erroneous" @\ do "(String, Integer) /= (String, String)" @| checkDeep diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden index 4797e4dfc..fced1596f 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -1,2 +1,2 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:78:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:78:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index ca027503c..aa61af6d3 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -20,13 +20,15 @@ import Plutarch.Api.V1 ( import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec -- import PlutusTx.AssocMap as PlutusMap spec :: Spec -spec = runTrailSpec $ do - describe "api" $ do - describe "ctx" $ do +spec = TS.runTrailSpec $ do + TS.describe "api" $ do + TS.describe "ctx" $ do pgoldenSpec $ do "term" @| ctx "get" @\ do @@ -45,11 +47,11 @@ spec = runTrailSpec $ do $ \case PMinting c -> popaque c _ -> perror - describe "example" $ do + TS.describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. -- See Plutarch.MonadicSpec for GHC9 only syntax. - describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do + TS.describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" "cont" @\ do "succeeds" @| checkSignatoryCont # pconstant aSig # ctx @-> psucceeds @@ -57,7 +59,7 @@ spec = runTrailSpec $ do "termcont" @\ do "succeeds" @| checkSignatoryTermCont # pconstant aSig # ctx @-> psucceeds "fails" @| checkSignatoryTermCont # pconstant "41" # ctx @-> pfails - describe "getFields" . pgoldenSpec $ do + TS.describe "getFields" . pgoldenSpec $ do "0" @| getFields -------------------------------------------------------------------------------- diff --git a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs index fdf37a941..5e314860f 100644 --- a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs @@ -3,10 +3,12 @@ module Plutarch.BoolSpec (spec) where import Plutarch.Bool (pand, por) import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "bool" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "bool" . pgoldenSpec $ do "pnot" @\ do "lam" @| pnot "app" @| pnot # (pcon PTrue) @-> passertNot diff --git a/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs index b59789a5c..7e1794ae9 100644 --- a/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs @@ -3,10 +3,12 @@ module Plutarch.ByteStringSpec (spec) where import qualified Data.ByteString as BS import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "bytestring" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "bytestring" . pgoldenSpec $ do "empty" @| mempty #== phexByteStr "" @-> passert "phexByteStr" @| ( let a :: [String] = ["42", "ab", "df", "c9"] diff --git a/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs index b8f516cbe..e41f78048 100644 --- a/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs @@ -2,10 +2,12 @@ module Plutarch.EitherSpec (spec) where import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "either" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "either" . pgoldenSpec $ do "eq" @\ do "true" @\ do "left" @| pcon @(PEither PInteger PInteger) (PLeft 42) #== pcon (PLeft 42) @-> passert diff --git a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs index d4d192920..71590e5f8 100644 --- a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs @@ -3,11 +3,13 @@ module Plutarch.IntegerSpec (spec) where import Plutarch import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "int" $ do - describe "examples" $ do +spec = TS.runTrailSpec $ do + TS.describe "int" $ do + TS.describe "examples" $ do pgoldenSpec $ do "add1" @| add1 "add1Hoisted" @| add1Hoisted diff --git a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs index 8c49dc1e9..0838b879e 100644 --- a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs @@ -5,15 +5,17 @@ import Plutarch.Api.V1 () import Plutus.V1.Ledger.Api (PubKeyHash (PubKeyHash), ScriptPurpose (Minting), TxOutRef (TxOutRef)) import qualified PlutusTx +import Control.Monad.Reader (lift) import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.Test -import Test.Hspec (Expectation, shouldBe) +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec (Expectation, Spec, describe, it, shouldBe) spec :: Spec -spec = runTrailSpec $ do - describe "lift" $ do - describe "plift" $ do +spec = TS.runTrailSpec $ do + TS.describe "lift" $ do + lift . describe "plift" $ do it "bool" $ do plift (pcon PTrue) `shouldBe` True plift (pcon PFalse) `shouldBe` False @@ -33,18 +35,18 @@ spec = runTrailSpec $ do let d :: PlutusTx.Data d = PlutusTx.toData @(Either Bool Bool) $ Right False plift (pconstant d) `shouldBe` d - describe "pconstant" $ do + lift . describe "pconstant" $ do it "string" $ do pconstant @PString "abc" `pshouldBe` pconstant @PString "abc" pconstant @PString "foo" `pshouldBe` ("foo" :: Term _ PString) - describe "pconstantData" $ do + TS.describe "pconstantData" $ do pgoldenSpec $ do "bool" @| pconstantData False "int" @| pconstantData (42 :: Integer) "pkh" @| pconstantData (PubKeyHash "04") "minting" @| pconstantData (Minting "") "txoutref" @| pconstantData (TxOutRef "41" 12) - it "works" $ testPConstantDataSan False + TS.it "works" $ testPConstantDataSan False testPConstantDataSan :: forall p. (PIsData p, PLift p, PlutusTx.ToData (PLifted p)) => PLifted p -> Expectation testPConstantDataSan x = diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index b92717eb6..aebe90a25 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -5,6 +5,7 @@ import Data.List (find) import Plutarch.List (pconvertLists, pfoldl') import Plutarch.Prelude +import Control.Monad.Reader (lift) import Hedgehog (Property) import qualified Hedgehog.Gen as Gen import Hedgehog.Internal.Property (Property (propertyTest)) @@ -12,15 +13,17 @@ import qualified Hedgehog.Range as Range import Plutarch.Test import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genInteger, genList) +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec (Spec, describe, it) import Test.Hspec.Hedgehog (hedgehog) integerList :: [Integer] -> Term s (PList PInteger) integerList xs = pconvertLists #$ pconstant @(PBuiltinList PInteger) xs spec :: Spec -spec = runTrailSpec $ do - describe "list" $ do - describe "properties" $ do +spec = TS.runTrailSpec $ do + TS.describe "list" $ do + lift . describe "properties" $ do describe "find" $ do it "plutarch level find mirrors haskell level find" . hedgehog . propertyTest $ prop_pfindEquiv describe "elemAt" $ do diff --git a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs index d90052308..b5a871594 100644 --- a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs @@ -5,10 +5,12 @@ import Plutarch.Bool (PEq ((#==))) import Plutarch.Integer (PInteger) import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "maybe" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "maybe" . pgoldenSpec $ do "eq" @\ do "true" @\ do "nothing" @| pcon @(PMaybe PInteger) PNothing #== pcon PNothing @-> passert diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index 9926d65a9..dd02dbdd0 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -29,17 +29,18 @@ import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.SpecTypes (PTriplet (PTriplet)) import Plutarch.Test -import Test.Hspec (shouldBe, specify) +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec (Spec, shouldBe, specify) import qualified Test.Hspec as H spec :: Spec -spec = runTrailSpec $ do - describe "pisdata" $ do +spec = TS.runTrailSpec $ do + TS.describe "pisdata" $ do lift $ do propertySet @PBool "PBool" propertySet @PInteger "PInteger" propertySet @PUnit "PUnit" - describe "equality" . pgoldenSpec $ do + TS.describe "equality" . pgoldenSpec $ do "PData" @\ do "1" @| (let dat = pconstant @PData (PlutusTx.List [PlutusTx.Constr 1 [PlutusTx.I 0]]) in dat #== dat) @@ -55,7 +56,7 @@ spec = runTrailSpec $ do "1" @| (pnot #$ pdata (phexByteStr "12") #== pdata (phexByteStr "ab")) @-> passert - describe "ppair" . pgoldenSpec $ do + TS.describe "ppair" . pgoldenSpec $ do -- pfromData (pdata (I 1, B 0x41)) ≡ (I 1, I A) "simple" @| ( ppairDataBuiltin @_ @PInteger @PByteString @@ -77,7 +78,7 @@ spec = runTrailSpec $ do "pbuiltinPairFromTuple" @| pfromData (pbuiltinPairFromTuple scTuple) @== scPair "ptupleFromBuiltin" @| ptupleFromBuiltin (pdata scPair) @== scTuple -- Data construction tests - describe "constr" . pgoldenSpec $ do + TS.describe "constr" . pgoldenSpec $ do -- Sum of products construction "sop" @\ do "4wheeler" diff --git a/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs index 949ba31df..af081bdac 100644 --- a/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs @@ -5,11 +5,13 @@ import qualified PlutusCore as PLC import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe (punsafeBuiltin) +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "plam" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "plam" . pgoldenSpec $ do "id" @| plam (\x -> x) "flip.const" @| plam (\_ y -> y) "plet" @| plam (\x _ -> plet x $ \_ -> perror) diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index 847f9ad11..0e6ab3583 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -30,19 +30,20 @@ import Plutarch.Prelude import Control.Monad.Trans (lift) import Plutarch.SpecTypes (PTriplet (PTriplet), Triplet (Triplet)) import Plutarch.Test -import Test.Hspec (shouldBe, specify) +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec (Spec, describe, shouldBe, specify) import qualified Test.Hspec as H spec :: Spec -spec = runTrailSpec $ do - describe "pisdata" $ do - describe "ord.property" $ do - lift $ do +spec = TS.runTrailSpec $ do + TS.describe "pisdata" $ do + lift $ + describe "ord.property" $ do propertySet @PBool "PBool" propertySet @(PMaybeData PInteger) "PMaybeData PInteger" propertySet @(PTriplet PInteger) "PMaybeData PInteger" propertySet @PAddress' "PAddress" - describe "lt" . pgoldenSpec $ do + TS.describe "lt" . pgoldenSpec $ do "PCredential" @\ do let c1 = PubKeyCredential "" c2 = ScriptCredential "41" @@ -55,7 +56,7 @@ spec = runTrailSpec $ do "derived" @\ ltWith (#<) c1 c2 "pmatch" @\ ltWith ltTrip c1 c2 "pmatch-pdatarecord" @\ ltWith ltTrip' c1 c2 - describe "lte" . pgoldenSpec $ do + TS.describe "lte" . pgoldenSpec $ do "PCredential" @\ do let c1 = PubKeyCredential "" c2 = ScriptCredential "41" diff --git a/plutarch-test/plutarch-base/Plutarch/PairSpec.hs b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs index 055cddce1..2bceb974b 100644 --- a/plutarch-test/plutarch-base/Plutarch/PairSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs @@ -2,10 +2,12 @@ module Plutarch.PairSpec (spec) where import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "pair" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "pair" . pgoldenSpec $ do "eq" @\ do "true" @| pcon @(PPair PInteger PString) (PPair 42 "Hello") diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index 703ea5638..d3f99b44a 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -18,12 +18,14 @@ import Plutus.V1.Ledger.Credential ( Credential (PubKeyCredential, ScriptCredential), StakingCredential (StakingPtr), ) -import Test.Hspec (Expectation) + +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec (Expectation, Spec) spec :: Spec -spec = runTrailSpec $ do - describe "plutustype" $ do - describe "example" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "plutustype" $ do + TS.describe "example" . pgoldenSpec $ do "A-as-0" @| pcon A @== pconstant @PInteger 0 "B-as-1" @| pcon B @== pconstant @PInteger 1 "swap" @\ do @@ -43,9 +45,9 @@ spec = runTrailSpec $ do b = "Universe" :: Term s PString in pmatch (pcon (PPair a b) :: Term s (PPair PInteger PString)) $ \(PPair _ y) -> y ) - describe "instances-sanity" $ do + TS.describe "instances-sanity" $ do plutarchDevFlagDescribe $ do - it "PBuiltinList" $ do + TS.it "PBuiltinList" $ do pmatchTargetEval $ pconstant [1 :: Integer, 2, 3, 4] deconstrSpec @@ -53,9 +55,9 @@ spec = runTrailSpec $ do We ideally want the typed and raw versions to have as little deviation as possible. -} -deconstrSpec :: TrailSpec +deconstrSpec :: TS.TrailSpec deconstrSpec = do - describe "deconstr" . pgoldenSpec $ do + TS.describe "deconstr" . pgoldenSpec $ do "matching" @\ do "typed" @\ do "newtype" diff --git a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs index 0f6260bdd..b14293bc6 100644 --- a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs @@ -3,15 +3,16 @@ module Plutarch.RationalSpec (spec) where import Plutarch.Prelude import Plutarch.Rational (pproperFraction, ptruncate) import Plutarch.Test -import Test.Hspec (Expectation) +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec (Expectation, Spec) spec :: Spec -spec = runTrailSpec $ do +spec = TS.runTrailSpec $ do let rat :: Term s PRational -> Term s PRational rat = id assertRat :: ClosedTerm PRational -> ClosedTerm PRational -> Expectation assertRat x p = passert $ p #== x - describe "rational" . pgoldenSpec $ do + TS.describe "rational" . pgoldenSpec $ do "literal" @| rat 0.5 "ops" @\ do "+" @| rat (1 / 2 + 1 / 2) @-> assertRat 1 diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index 6c80b68e1..c91b5cec2 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -26,7 +26,9 @@ import Plutarch.Rec ( ) import Plutarch.Rec.TH (deriveAll) import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) +import Test.Hspec (Spec) data FlatOuterRecord f = FlatOuterRecord { flatOuterBool :: f PBool @@ -206,10 +208,10 @@ shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) shallowOuterData = pdata (punsafeFrom sampleShallowOuter) spec :: Spec -spec = runTrailSpec $ do +spec = TS.runTrailSpec $ do -- Plutarch.Rec.verifySoleConstructor uses tracing, so we must create two sets -- of golden. - describe "rec" . plutarchDevFlagDescribe . pgoldenSpec $ do + TS.describe "rec" . plutarchDevFlagDescribe . pgoldenSpec $ do "simple" @\ do -- Record construction "constr" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs index e61d3552a..46184b511 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs @@ -8,11 +8,13 @@ import Plutarch.Integer (PInteger) import Plutarch.Lift (pconstant) import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec (Spec) spec :: Spec -spec = runTrailSpec $ do - describe "recursion" $ do - describe "example" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "recursion" $ do + TS.describe "example" . pgoldenSpec $ do "iterateN" @\ do "lam" @| iterateN "app" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 0f8438e14..772f6fdb8 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -44,10 +44,12 @@ import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec (Spec) spec :: Spec -spec = runTrailSpec $ do - describe "scripts" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "scripts" . pgoldenSpec $ do "auth_validator" @\ do "0" @| authValidatorTerm "hash" @| pconstant validatorHashEncoded diff --git a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs index 7da3bbf15..fdde8a94d 100644 --- a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs @@ -7,10 +7,12 @@ import qualified Data.Text as T import Plutarch.ListSpec (integerList) import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "show" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "show" . pgoldenSpec $ do let str x = pconstant @PString x "unit" @| pshow (pcon PUnit) @== str "()" "bool" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/StringSpec.hs b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs index b34217783..e2cf31658 100644 --- a/plutarch-test/plutarch-base/Plutarch/StringSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs @@ -2,10 +2,12 @@ module Plutarch.StringSpec (spec) where import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "str" $ do +spec = TS.runTrailSpec $ do + TS.describe "str" $ do pgoldenSpec $ do "eq" @| "foo" #== pconstant @PString "foo" @-> passert "semigroup" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs index 005cca8ed..75924b335 100644 --- a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs @@ -2,10 +2,12 @@ module Plutarch.TraceSpec (spec) where import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do "ptrace" @\ do "one" @| ptrace "foo" (pcon PUnit) @-> \p -> ptraces p ["foo"] diff --git a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs index df6f247c7..09f49ba75 100644 --- a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs @@ -5,12 +5,14 @@ import qualified PlutusCore as PLC import Plutarch.Internal (punsafeConstantInternal) import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe (punsafeBuiltin) +import Test.Hspec (Spec) spec :: Spec -spec = runTrailSpec $ do +spec = TS.runTrailSpec $ do -- Tests for the behaviour of UPLC itself. - describe "uplc-behaviour" . pgoldenSpec $ do + TS.describe "uplc-behaviour" . pgoldenSpec $ do "2:[1]" @| ( let l :: Term _ (PBuiltinList PInteger) = punsafeConstantInternal . PLC.Some $ @@ -34,7 +36,7 @@ spec = runTrailSpec $ do "fails:MkPair-1-2" @| punsafeBuiltin PLC.MkPairData # (1 :: Term _ PInteger) # (2 :: Term _ PInteger) @-> pfails - describe "uplc-misc" . pgoldenSpec $ do + TS.describe "uplc-misc" . pgoldenSpec $ do "perror" @| perror @-> pfails "perror.arg" @| perror # (1 :: Term s PInteger) @-> pfails "laziness" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs index 5ea7448c8..d29471bc2 100644 --- a/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs @@ -3,10 +3,12 @@ module Plutarch.UnitSpec (spec) where import Plutarch import Plutarch.Prelude import Plutarch.Test +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec spec :: Spec -spec = runTrailSpec $ do - describe "unit" . pgoldenSpec $ do +spec = TS.runTrailSpec $ do + TS.describe "unit" . pgoldenSpec $ do "pcon" @| pcon PUnit "pmatch" @| pmatch (pcon PUnit) (\case PUnit -> pcon PTrue) @-> passert "compare" @\ do diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs index ac6c9e499..b2ef1ce90 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -3,17 +3,20 @@ module Plutarch.ListUtilsSpec (spec) where import Plutarch.ListUtils (pcheckSorted, preverse) import Plutarch.Prelude +import Control.Monad.Reader (lift) import Hedgehog (Property) import Hedgehog.Internal.Property (propertyTest) import Plutarch.Test import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genInteger, genList) +import qualified Plutarch.Test.TrailSpecMonad as TS +import Test.Hspec (Spec, describe, it) import Test.Hspec.Hedgehog (hedgehog) spec :: Spec -spec = runTrailSpec $ do - describe "extra.listutils" $ do - describe "properties" $ do +spec = TS.runTrailSpec $ do + TS.describe "extra.listutils" $ do + lift . describe "properties" $ do describe "reverse" $ do it "plutarch level reversing behaves like haskell level reversing" . hedgehog . propertyTest $ prop_preverseEquiv pgoldenSpec $ do diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 96959a7df..94ba6c329 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -108,7 +108,7 @@ library exposed-modules: Plutarch.Test Plutarch.Test.Property - Plutarch.Test.Run + Plutarch.Test.TrailSpecMonad other-modules: Plutarch.Test.Benchmark @@ -118,7 +118,7 @@ library Plutarch.Test.Property.Gen Plutarch.Test.Property.HaskEquiv Plutarch.Test.Property.Marshal - Plutarch.Test.TrailSpecMonad + Plutarch.Test.Run if flag(development) cpp-options: -DDevelopment From 6abeafe3a57c2035bd3c4a55140e35658580d0b5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> Date: Mon, 4 Apr 2022 15:06:07 -0400 Subject: [PATCH 302/584] Use `hspec` fork (#419) Replaces TrailSpecMonad.hs with hspec/hspec#648 which is slated to be part of hspec-2.10.0. We will use the PR fork until the new hspec is released to Hackage. --- flake.lock | 52 ++++++++++++++++ flake.nix | 32 ++++++++++ plutarch-test/common/Plutarch/Test.hs | 9 ++- plutarch-test/common/Plutarch/Test/Golden.hs | 21 ++++--- plutarch-test/common/Plutarch/Test/Run.hs | 4 +- .../common/Plutarch/Test/TrailSpecMonad.hs | 59 ------------------- .../conditional/Plutarch/FieldSpec.hs | 17 +++--- .../conditional/Plutarch/MonadicSpec.hs | 11 ++-- .../conditional/Plutarch/TryFromSpec.hs | 5 +- ...api.example.signatory.dev=true.uplc.golden | 4 +- .../plutarch-base/Plutarch/ApiSpec.hs | 13 ++-- .../plutarch-base/Plutarch/BoolSpec.hs | 5 +- .../plutarch-base/Plutarch/ByteStringSpec.hs | 5 +- .../plutarch-base/Plutarch/EitherSpec.hs | 5 +- .../plutarch-base/Plutarch/IntegerSpec.hs | 7 +-- .../plutarch-base/Plutarch/LiftSpec.hs | 14 ++--- .../plutarch-base/Plutarch/ListSpec.hs | 8 +-- .../plutarch-base/Plutarch/MaybeSpec.hs | 5 +- .../plutarch-base/Plutarch/PIsDataSpec.hs | 24 ++++---- .../plutarch-base/Plutarch/PLamSpec.hs | 5 +- .../plutarch-base/Plutarch/POrdSpec.hs | 21 +++---- .../plutarch-base/Plutarch/PairSpec.hs | 5 +- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 17 +++--- .../plutarch-base/Plutarch/RationalSpec.hs | 7 +-- .../plutarch-base/Plutarch/RecSpec.hs | 7 +-- .../plutarch-base/Plutarch/RecursionSpec.hs | 9 ++- .../plutarch-base/Plutarch/ScriptsSpec.hs | 7 +-- .../plutarch-base/Plutarch/ShowSpec.hs | 5 +- .../plutarch-base/Plutarch/StringSpec.hs | 5 +- .../plutarch-base/Plutarch/TraceSpec.hs | 5 +- .../plutarch-base/Plutarch/UPLCSpec.hs | 9 ++- .../plutarch-base/Plutarch/UnitSpec.hs | 5 +- .../plutarch-extra/Plutarch/ListUtilsSpec.hs | 8 +-- plutarch-test/plutarch-test.cabal | 2 - 34 files changed, 204 insertions(+), 213 deletions(-) delete mode 100644 plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs diff --git a/flake.lock b/flake.lock index 44abb0e1d..51271afee 100644 --- a/flake.lock +++ b/flake.lock @@ -619,6 +619,55 @@ "type": "github" } }, + "hspec": { + "flake": false, + "locked": { + "lastModified": 1649095108, + "narHash": "sha256-cPmt4hvmdh727VT6UAL8yFArmm4FAWeg3K5Qi3XtU4g=", + "owner": "srid", + "repo": "hspec", + "rev": "44f2a143e10c93df237af428457d0e4b74ae270a", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "askAncestors", + "repo": "hspec", + "type": "github" + } + }, + "hspec-golden": { + "flake": false, + "locked": { + "lastModified": 1648755064, + "narHash": "sha256-5a6BksZx00o2iL0Ei/L1Kkou2BsnsIagN+tTmqYyKfs=", + "owner": "stackbuilders", + "repo": "hspec-golden", + "rev": "4b0ad56b2de0254a7b1e0feda917656f78a5bcda", + "type": "github" + }, + "original": { + "owner": "stackbuilders", + "repo": "hspec-golden", + "type": "github" + } + }, + "hspec-hedgehog": { + "flake": false, + "locked": { + "lastModified": 1602603478, + "narHash": "sha256-XnS3zjQ7eh3iBOWq+Z/YcwrfWI55hV6k8LsZ8qm/qOc=", + "owner": "parsonsmatt", + "repo": "hspec-hedgehog", + "rev": "eb617d854542510f0129acdea4bf52e50b13042e", + "type": "github" + }, + "original": { + "owner": "parsonsmatt", + "repo": "hspec-hedgehog", + "type": "github" + } + }, "iohk-nix": { "flake": false, "locked": { @@ -929,6 +978,9 @@ "haskell-nix": "haskell-nix", "hercules-ci-effects": "hercules-ci-effects", "hs-memory": "hs-memory", + "hspec": "hspec", + "hspec-golden": "hspec-golden", + "hspec-hedgehog": "hspec-hedgehog", "iohk-nix": "iohk-nix", "nixpkgs": [ "haskell-nix", diff --git a/flake.nix b/flake.nix index de7acfbd4..002afe326 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,15 @@ inputs.haskell-language-server.url = "github:haskell/haskell-language-server"; inputs.haskell-language-server.flake = false; + # https://github.com/hspec/hspec/pull/648 + inputs.hspec.url = "github:srid/hspec/askAncestors"; + inputs.hspec.flake = false; + # Overriding hspec (above) necessitates overriding these for some reason. + inputs.hspec-hedgehog.url = "github:parsonsmatt/hspec-hedgehog"; + inputs.hspec-hedgehog.flake = false; + inputs.hspec-golden.url = "github:stackbuilders/hspec-golden"; + inputs.hspec-golden.flake = false; + inputs.emanote.url = "github:srid/emanote/master"; outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, hercules-ci-effects, ... }: @@ -105,6 +114,23 @@ "word-array" ]; } + { + src = inputs.hspec; + subdirs = [ + "." + "hspec-core" + "hspec-contrib" + "hspec-discover" + ]; + } + { + src = inputs.hspec-hedgehog; + subdirs = [ "." ]; + } + { + src = inputs.hspec-golden; + subdirs = [ "." ]; + } ]; supportedSystems = with nixpkgs.lib.systems.supported; tier1 ++ tier2 ++ tier3; @@ -471,6 +497,12 @@ additional = ps: [ ps.plutus-ledger-api + ps.hspec + ps.hspec-core + ps.hspec-contrib + ps.hspec-discover + ps.hspec-hedgehog + ps.hspec-golden #ps.shrinker #ps.shrinker-testing ]; diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index cb83c1eaf..830b81322 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -51,9 +51,8 @@ import Plutarch.Test.Golden ( (@\), (@|), ) -import qualified Plutarch.Test.TrailSpecMonad as TS import qualified Plutus.V1.Ledger.Scripts as Scripts -import Test.Hspec (Expectation, expectationFailure, shouldBe, shouldSatisfy) +import Test.Hspec (Expectation, Spec, describe, expectationFailure, shouldBe, shouldSatisfy) import Test.Tasty.HUnit (assertFailure) {- | @@ -147,15 +146,15 @@ ptraces p develTraces = Typically meant to be used in conjunction with `ptraces`. -} -plutarchDevFlagDescribe :: TS.TrailSpec -> TS.TrailSpec +plutarchDevFlagDescribe :: Spec -> Spec -- CPP support isn't great in fourmolu. {- ORMOLU_DISABLE -} plutarchDevFlagDescribe m = #ifdef Development - TS.describe "dev=true" m + describe "dev=true" m #else - TS.describe "dev=false" m + describe "dev=false" m #endif {- ORMOLU_ENABLE -} diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 0358c17da..7b913d2a7 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -37,17 +37,17 @@ import GHC.Stack (HasCallStack) import System.FilePath (()) import Test.Hspec.Golden +import qualified Data.List.NonEmpty as NE import Plutarch (compile, printScript) import Plutarch.Evaluate (evalScript) import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Prelude import Plutarch.Test.Benchmark (Benchmark, mkBenchmark, scriptSize) import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) -import Plutarch.Test.TrailSpecMonad (TrailSpec, TrailSpecM, ancestorTrail, describe, it) import Plutus.V1.Ledger.Scripts (Script) import qualified Plutus.V1.Ledger.Scripts as Scripts -import Test.Hspec (Expectation) -import Test.Hspec.Core.Spec (SpecM) +import Test.Hspec (Expectation, Spec, describe, it) +import Test.Hspec.Core.Spec (SpecM, getSpecDescriptionPath) data GoldenValue = GoldenValue { goldenValueUplcPreEval :: Text @@ -130,16 +130,19 @@ goldenKeyString (GoldenKey s) = T.unpack s instance Semigroup GoldenKey where GoldenKey s1 <> GoldenKey s2 = GoldenKey $ s1 <> "." <> s2 -currentGoldenKey :: HasCallStack => TrailSpecM (SpecM ()) GoldenKey +currentGoldenKey :: HasCallStack => SpecM () GoldenKey currentGoldenKey = do - mkGoldenKeyFromSpecPath . reverse . fmap T.pack <$> ancestorTrail + mkGoldenKeyFromSpecPath . fmap T.pack <$> getSpecDescriptionPath mkGoldenKeyFromSpecPath :: HasCallStack => [Text] -> GoldenKey mkGoldenKeyFromSpecPath path = case nonEmpty path of Nothing -> error "cannot use currentGoldenKey from top-level spec" - Just path -> - sconcat $ fmap GoldenKey path + Just anc -> + case nonEmpty (NE.drop 1 . NE.reverse $ anc) of + Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" + Just path -> + sconcat $ fmap GoldenKey path goldenPath :: FilePath -> GoldenKey -> FilePath goldenPath baseDir (GoldenKey k) = @@ -175,7 +178,7 @@ infixr 0 @| Hierarchy is represented by intercalating with a dot; for instance, the key for 'qux' will be "bar.qux". -} -pgoldenSpec :: HasCallStack => PlutarchGoldens -> TrailSpec +pgoldenSpec :: HasCallStack => PlutarchGoldens -> Spec pgoldenSpec map = do base <- currentGoldenKey let bs = runListSyntax map @@ -217,7 +220,7 @@ goldenTestVal t v = case t of UPLCPostEval -> goldenValueUplcPostEval v Bench -> goldenValueBench v -goldenTestSpec :: GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> TrailSpec +goldenTestSpec :: GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> Spec goldenTestSpec base vals gt = do it (goldenKeyString $ goldenTestKey gt) $ do Golden diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index 8b0179f2d..546366576 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -23,7 +23,7 @@ noUnusedGoldens :: Spec -> IO () noUnusedGoldens spec = do -- A second traversal here (`runSpecM`) can be obviated after -- https://github.com/hspec/hspec/issues/649 - usedGoldens <- goldenPathsUsedBy <$> runSpecM spec + usedGoldens <- goldenPathsUsedBy . snd <$> runSpecM spec unusedGoldens usedGoldens >>= \case [] -> pure () unused -> do @@ -60,7 +60,7 @@ goldenPathsUsedBy trees = do queryGoldens :: [SpecTree a] -> [GoldenKey] queryGoldens = -- `drop 1`, to drop the hspec-discover generated root node. - fmap (mkGoldenKeyFromSpecPath . drop 1 . reverse) . concatMap (go []) + fmap mkGoldenKeyFromSpecPath . concatMap (go []) where go ancestors = \case Node "golden" _children -> diff --git a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs b/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs deleted file mode 100644 index cc237bc07..000000000 --- a/plutarch-test/common/Plutarch/Test/TrailSpecMonad.hs +++ /dev/null @@ -1,59 +0,0 @@ -{- | This module exists only until https://github.com/hspec/hspec/pull/648 is - merged & released upstream. - - It is to be used when defining test trees that use `pgoldenSpec`. Once the - above PR is merged, `pgoldenSpec` will work in the `Spec` monad. --} -module Plutarch.Test.TrailSpecMonad ( - -- * Types - TrailSpecM, - TrailSpec, - TrailSpecWith, - - -- * Functions - runTrailSpec, - ancestorTrail, - - -- * Variants of hspec functions that work in `TrailSpecM` monad - describe, - it, -) where - -import Control.Monad.Reader -import GHC.Stack (HasCallStack) -import Test.Hspec.Core.Spec (Arg, Example, SpecM) -import qualified Test.Hspec.Core.Spec - -type TrailSpec = TrailSpecWith () - -type TrailSpecWith a = TrailSpecM (SpecM a) () - -{- | Like `SpecM`, but also leaves a trail from root node, allowing retrieval of - ancestor path from anywhere in the test hierarchy. See `ancestorTrail`. - - When using this to define your test hierarchy, you ought to use `describe` to - group sub-trees. Use `lift` to drop-down into the underlying `SpecM` monad. - - m ~ SpecM a --} -newtype TrailSpecM m r = TrailSpecM (ReaderT [String] m r) - deriving newtype (Functor, Applicative, Monad, MonadTrans) - --- | Go from `TrailSpecM` monad to `SpecM` monad -runTrailSpec :: TrailSpecM (SpecM a) r -> SpecM a r -runTrailSpec (TrailSpecM m) = runReaderT m [] - --- | Return the ancestor groups, from immediate parent to the root. -ancestorTrail :: TrailSpecM (SpecM a) [String] -ancestorTrail = TrailSpecM ask - --- | Like `Test.Hspec.Core.Spec.describe` but for `TrailSpecM`. -describe :: HasCallStack => String -> TrailSpecWith a -> TrailSpecWith a -describe s (TrailSpecM m) = - TrailSpecM . withReaderT (s :) $ do - env <- ask - lift $ Test.Hspec.Core.Spec.describe s $ runReaderT m env - --- | Like `Test.Hspec.Core.Spec.it` but lifted to `TrailSpecM`. -it :: (HasCallStack, Example a) => String -> a -> TrailSpecWith (Arg a) -it s t = lift $ Test.Hspec.Core.Spec.it s t diff --git a/plutarch-test/conditional/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs index 2d907faba..fc3ca8b76 100644 --- a/plutarch-test/conditional/Plutarch/FieldSpec.hs +++ b/plutarch-test/conditional/Plutarch/FieldSpec.hs @@ -13,15 +13,14 @@ import Plutarch.Builtin (ppairDataBuiltin) import Plutarch.Prelude import Plutarch.SpecTypes (PTriplet) import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "field" $ do +spec = do + describe "field" $ do -- example: Trips - TS.describe "trips" . pgoldenSpec $ do + describe "trips" . pgoldenSpec $ do -- compilation "lam" @\ do "tripSum" @| tripSum @@ -36,17 +35,17 @@ spec = TS.runTrailSpec $ do plift p @?= 10 "tripYZ=tripZY" @| tripZY @== tripYZ -- rangeFields - TS.describe "rangeFields" . pgoldenSpec $ do + describe "rangeFields" . pgoldenSpec $ do -- compilation "lam" @| rangeFields "app" @| rangeFields # someFields @-> \p -> plift p @?= 11 -- dropFields - TS.describe "dropFields" . pgoldenSpec $ do + describe "dropFields" . pgoldenSpec $ do -- compilation "lam" @| dropFields "app" @| dropFields # someFields @-> \p -> plift p @?= 17 -- pletFields - TS.describe "pletFields" . pgoldenSpec $ do + describe "pletFields" . pgoldenSpec $ do -- compilation "letSomeFields" @\ do "lam" @| letSomeFields @@ -55,10 +54,10 @@ spec = TS.runTrailSpec $ do "nFields" @\ do "lam" @| nFields "app" @| nFields # someFields @-> \p -> plift p @?= 1 - TS.describe "other" . pgoldenSpec $ do + describe "other" . pgoldenSpec $ do "by" @| by @-> \p -> plift p @?= 10 "dotPlus" @| dotPlus @-> \p -> plift p @?= 19010 - TS.describe "data" . pgoldenSpec $ do + describe "data" . pgoldenSpec $ do "pmatch-pfield" @\ do -- These two should ideally have the exact same efficiency. "pmatch" @\ do diff --git a/plutarch-test/conditional/Plutarch/MonadicSpec.hs b/plutarch-test/conditional/Plutarch/MonadicSpec.hs index 2225c8a38..7b772f496 100644 --- a/plutarch-test/conditional/Plutarch/MonadicSpec.hs +++ b/plutarch-test/conditional/Plutarch/MonadicSpec.hs @@ -16,13 +16,12 @@ import qualified Plutarch.ApiSpec as ApiSpec import qualified Plutarch.Monadic as P import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Plutus.V1.Ledger.Api import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "monadic" $ do +spec = do + describe "monadic" $ do {- TODO: Uncomment this after flakiness is fixed See https://github.com/Plutonomicon/plutarch/issues/290 -} @@ -63,15 +62,15 @@ spec = TS.runTrailSpec $ do PSCons _ xs'' <- TermCont $ pmatch xs' pure xs'' -} - TS.describe "api.example" $ do + describe "api.example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. - TS.describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" "do" @\ do "succeeds" @| checkSignatory # pconstant aSig # ApiSpec.ctx @-> psucceeds "fails" @| checkSignatory # pconstant "41" # ApiSpec.ctx @-> pfails - TS.describe "getFields" . pgoldenSpec $ do + describe "getFields" . pgoldenSpec $ do "0" @| getFields checkSignatory :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 9d9bfae2e..a72ffded3 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -28,7 +28,6 @@ import PlutusTx ( import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe ( punsafeCoerce, @@ -73,8 +72,8 @@ import GHC.Records (getField) import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do +spec = do + describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do "erroneous" @\ do "(String, Integer) /= (String, String)" @| checkDeep diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden index fced1596f..03ca95ab4 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -1,2 +1,2 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:80:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:79:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:79:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index aa61af6d3..a4cb802eb 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -20,15 +20,14 @@ import Plutarch.Api.V1 ( import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec -- import PlutusTx.AssocMap as PlutusMap spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "api" $ do - TS.describe "ctx" $ do +spec = do + describe "api" $ do + describe "ctx" $ do pgoldenSpec $ do "term" @| ctx "get" @\ do @@ -47,11 +46,11 @@ spec = TS.runTrailSpec $ do $ \case PMinting c -> popaque c _ -> perror - TS.describe "example" $ do + describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. -- See Plutarch.MonadicSpec for GHC9 only syntax. - TS.describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" "cont" @\ do "succeeds" @| checkSignatoryCont # pconstant aSig # ctx @-> psucceeds @@ -59,7 +58,7 @@ spec = TS.runTrailSpec $ do "termcont" @\ do "succeeds" @| checkSignatoryTermCont # pconstant aSig # ctx @-> psucceeds "fails" @| checkSignatoryTermCont # pconstant "41" # ctx @-> pfails - TS.describe "getFields" . pgoldenSpec $ do + describe "getFields" . pgoldenSpec $ do "0" @| getFields -------------------------------------------------------------------------------- diff --git a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs index 5e314860f..331a3ae0f 100644 --- a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs @@ -3,12 +3,11 @@ module Plutarch.BoolSpec (spec) where import Plutarch.Bool (pand, por) import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "bool" . pgoldenSpec $ do +spec = do + describe "bool" . pgoldenSpec $ do "pnot" @\ do "lam" @| pnot "app" @| pnot # (pcon PTrue) @-> passertNot diff --git a/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs index 7e1794ae9..681ac9ce2 100644 --- a/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs @@ -3,12 +3,11 @@ module Plutarch.ByteStringSpec (spec) where import qualified Data.ByteString as BS import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "bytestring" . pgoldenSpec $ do +spec = do + describe "bytestring" . pgoldenSpec $ do "empty" @| mempty #== phexByteStr "" @-> passert "phexByteStr" @| ( let a :: [String] = ["42", "ab", "df", "c9"] diff --git a/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs index e41f78048..391b30940 100644 --- a/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs @@ -2,12 +2,11 @@ module Plutarch.EitherSpec (spec) where import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "either" . pgoldenSpec $ do +spec = do + describe "either" . pgoldenSpec $ do "eq" @\ do "true" @\ do "left" @| pcon @(PEither PInteger PInteger) (PLeft 42) #== pcon (PLeft 42) @-> passert diff --git a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs index 71590e5f8..1c15b3ef2 100644 --- a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs @@ -3,13 +3,12 @@ module Plutarch.IntegerSpec (spec) where import Plutarch import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "int" $ do - TS.describe "examples" $ do +spec = do + describe "int" $ do + describe "examples" $ do pgoldenSpec $ do "add1" @| add1 "add1Hoisted" @| add1Hoisted diff --git a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs index 0838b879e..68439fbf8 100644 --- a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs @@ -5,17 +5,15 @@ import Plutarch.Api.V1 () import Plutus.V1.Ledger.Api (PubKeyHash (PubKeyHash), ScriptPurpose (Minting), TxOutRef (TxOutRef)) import qualified PlutusTx -import Control.Monad.Reader (lift) import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec (Expectation, Spec, describe, it, shouldBe) spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "lift" $ do - lift . describe "plift" $ do +spec = do + describe "lift" $ do + describe "plift" $ do it "bool" $ do plift (pcon PTrue) `shouldBe` True plift (pcon PFalse) `shouldBe` False @@ -35,18 +33,18 @@ spec = TS.runTrailSpec $ do let d :: PlutusTx.Data d = PlutusTx.toData @(Either Bool Bool) $ Right False plift (pconstant d) `shouldBe` d - lift . describe "pconstant" $ do + describe "pconstant" $ do it "string" $ do pconstant @PString "abc" `pshouldBe` pconstant @PString "abc" pconstant @PString "foo" `pshouldBe` ("foo" :: Term _ PString) - TS.describe "pconstantData" $ do + describe "pconstantData" $ do pgoldenSpec $ do "bool" @| pconstantData False "int" @| pconstantData (42 :: Integer) "pkh" @| pconstantData (PubKeyHash "04") "minting" @| pconstantData (Minting "") "txoutref" @| pconstantData (TxOutRef "41" 12) - TS.it "works" $ testPConstantDataSan False + it "works" $ testPConstantDataSan False testPConstantDataSan :: forall p. (PIsData p, PLift p, PlutusTx.ToData (PLifted p)) => PLifted p -> Expectation testPConstantDataSan x = diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index aebe90a25..36a7ecb26 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -5,7 +5,6 @@ import Data.List (find) import Plutarch.List (pconvertLists, pfoldl') import Plutarch.Prelude -import Control.Monad.Reader (lift) import Hedgehog (Property) import qualified Hedgehog.Gen as Gen import Hedgehog.Internal.Property (Property (propertyTest)) @@ -13,7 +12,6 @@ import qualified Hedgehog.Range as Range import Plutarch.Test import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genInteger, genList) -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec (Spec, describe, it) import Test.Hspec.Hedgehog (hedgehog) @@ -21,9 +19,9 @@ integerList :: [Integer] -> Term s (PList PInteger) integerList xs = pconvertLists #$ pconstant @(PBuiltinList PInteger) xs spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "list" $ do - lift . describe "properties" $ do +spec = do + describe "list" $ do + describe "properties" $ do describe "find" $ do it "plutarch level find mirrors haskell level find" . hedgehog . propertyTest $ prop_pfindEquiv describe "elemAt" $ do diff --git a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs index b5a871594..150bd0a0d 100644 --- a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs @@ -5,12 +5,11 @@ import Plutarch.Bool (PEq ((#==))) import Plutarch.Integer (PInteger) import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "maybe" . pgoldenSpec $ do +spec = do + describe "maybe" . pgoldenSpec $ do "eq" @\ do "true" @\ do "nothing" @| pcon @(PMaybe PInteger) PNothing #== pcon PNothing @-> passert diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index dd02dbdd0..b56054dcc 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -20,7 +20,6 @@ import qualified PlutusTx import Test.Tasty.QuickCheck (Arbitrary, property) -import Control.Monad.Trans (lift) import Plutarch.Api.V1 import Plutarch.Api.V1.Tuple (pbuiltinPairFromTuple, ptupleFromBuiltin) import Plutarch.Builtin (pforgetData, ppairDataBuiltin) @@ -29,18 +28,15 @@ import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.SpecTypes (PTriplet (PTriplet)) import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS -import Test.Hspec (Spec, shouldBe, specify) -import qualified Test.Hspec as H +import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "pisdata" $ do - lift $ do - propertySet @PBool "PBool" - propertySet @PInteger "PInteger" - propertySet @PUnit "PUnit" - TS.describe "equality" . pgoldenSpec $ do +spec = do + describe "pisdata" $ do + propertySet @PBool "PBool" + propertySet @PInteger "PInteger" + propertySet @PUnit "PUnit" + describe "equality" . pgoldenSpec $ do "PData" @\ do "1" @| (let dat = pconstant @PData (PlutusTx.List [PlutusTx.Constr 1 [PlutusTx.I 0]]) in dat #== dat) @@ -56,7 +52,7 @@ spec = TS.runTrailSpec $ do "1" @| (pnot #$ pdata (phexByteStr "12") #== pdata (phexByteStr "ab")) @-> passert - TS.describe "ppair" . pgoldenSpec $ do + describe "ppair" . pgoldenSpec $ do -- pfromData (pdata (I 1, B 0x41)) ≡ (I 1, I A) "simple" @| ( ppairDataBuiltin @_ @PInteger @PByteString @@ -78,7 +74,7 @@ spec = TS.runTrailSpec $ do "pbuiltinPairFromTuple" @| pfromData (pbuiltinPairFromTuple scTuple) @== scPair "ptupleFromBuiltin" @| ptupleFromBuiltin (pdata scPair) @== scTuple -- Data construction tests - TS.describe "constr" . pgoldenSpec $ do + describe "constr" . pgoldenSpec $ do -- Sum of products construction "sop" @\ do "4wheeler" @@ -164,7 +160,7 @@ propertySet :: String -> Spec propertySet typeName = do - H.describe typeName $ do + describe typeName $ do specify ("x ~ " <> typeName <> ": pfromData (pdata x) ≡ x") $ property $ ptoFromEqual @p specify ("x ~ " <> typeName <> ": pfromData (PlutusTx.toData x) ≡ x") $ diff --git a/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs index af081bdac..e11c44655 100644 --- a/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs @@ -5,13 +5,12 @@ import qualified PlutusCore as PLC import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe (punsafeBuiltin) import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "plam" . pgoldenSpec $ do +spec = do + describe "plam" . pgoldenSpec $ do "id" @| plam (\x -> x) "flip.const" @| plam (\_ y -> y) "plet" @| plam (\x _ -> plet x $ \_ -> perror) diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index 0e6ab3583..9680b7dc8 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -27,23 +27,20 @@ import Plutarch.Lift ( ) import Plutarch.Prelude -import Control.Monad.Trans (lift) import Plutarch.SpecTypes (PTriplet (PTriplet), Triplet (Triplet)) import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec (Spec, describe, shouldBe, specify) import qualified Test.Hspec as H spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "pisdata" $ do - lift $ - describe "ord.property" $ do - propertySet @PBool "PBool" - propertySet @(PMaybeData PInteger) "PMaybeData PInteger" - propertySet @(PTriplet PInteger) "PMaybeData PInteger" - propertySet @PAddress' "PAddress" - TS.describe "lt" . pgoldenSpec $ do +spec = do + describe "pisdata" $ do + describe "ord.property" $ do + propertySet @PBool "PBool" + propertySet @(PMaybeData PInteger) "PMaybeData PInteger" + propertySet @(PTriplet PInteger) "PMaybeData PInteger" + propertySet @PAddress' "PAddress" + describe "lt" . pgoldenSpec $ do "PCredential" @\ do let c1 = PubKeyCredential "" c2 = ScriptCredential "41" @@ -56,7 +53,7 @@ spec = TS.runTrailSpec $ do "derived" @\ ltWith (#<) c1 c2 "pmatch" @\ ltWith ltTrip c1 c2 "pmatch-pdatarecord" @\ ltWith ltTrip' c1 c2 - TS.describe "lte" . pgoldenSpec $ do + describe "lte" . pgoldenSpec $ do "PCredential" @\ do let c1 = PubKeyCredential "" c2 = ScriptCredential "41" diff --git a/plutarch-test/plutarch-base/Plutarch/PairSpec.hs b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs index 2bceb974b..45f1e6c0e 100644 --- a/plutarch-test/plutarch-base/Plutarch/PairSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs @@ -2,12 +2,11 @@ module Plutarch.PairSpec (spec) where import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "pair" . pgoldenSpec $ do +spec = do + describe "pair" . pgoldenSpec $ do "eq" @\ do "true" @| pcon @(PPair PInteger PString) (PPair 42 "Hello") diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index d3f99b44a..84c9e4146 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -19,13 +19,12 @@ import Plutus.V1.Ledger.Credential ( StakingCredential (StakingPtr), ) -import qualified Plutarch.Test.TrailSpecMonad as TS -import Test.Hspec (Expectation, Spec) +import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "plutustype" $ do - TS.describe "example" . pgoldenSpec $ do +spec = do + describe "plutustype" $ do + describe "example" . pgoldenSpec $ do "A-as-0" @| pcon A @== pconstant @PInteger 0 "B-as-1" @| pcon B @== pconstant @PInteger 1 "swap" @\ do @@ -45,9 +44,9 @@ spec = TS.runTrailSpec $ do b = "Universe" :: Term s PString in pmatch (pcon (PPair a b) :: Term s (PPair PInteger PString)) $ \(PPair _ y) -> y ) - TS.describe "instances-sanity" $ do + describe "instances-sanity" $ do plutarchDevFlagDescribe $ do - TS.it "PBuiltinList" $ do + it "PBuiltinList" $ do pmatchTargetEval $ pconstant [1 :: Integer, 2, 3, 4] deconstrSpec @@ -55,9 +54,9 @@ spec = TS.runTrailSpec $ do We ideally want the typed and raw versions to have as little deviation as possible. -} -deconstrSpec :: TS.TrailSpec +deconstrSpec :: Spec deconstrSpec = do - TS.describe "deconstr" . pgoldenSpec $ do + describe "deconstr" . pgoldenSpec $ do "matching" @\ do "typed" @\ do "newtype" diff --git a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs index b14293bc6..7635751d7 100644 --- a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs @@ -3,16 +3,15 @@ module Plutarch.RationalSpec (spec) where import Plutarch.Prelude import Plutarch.Rational (pproperFraction, ptruncate) import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS -import Test.Hspec (Expectation, Spec) +import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do +spec = do let rat :: Term s PRational -> Term s PRational rat = id assertRat :: ClosedTerm PRational -> ClosedTerm PRational -> Expectation assertRat x p = passert $ p #== x - TS.describe "rational" . pgoldenSpec $ do + describe "rational" . pgoldenSpec $ do "literal" @| rat 0.5 "ops" @\ do "+" @| rat (1 / 2 + 1 / 2) @-> assertRat 1 diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index c91b5cec2..2380aa772 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -26,9 +26,8 @@ import Plutarch.Rec ( ) import Plutarch.Rec.TH (deriveAll) import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) -import Test.Hspec (Spec) +import Test.Hspec data FlatOuterRecord f = FlatOuterRecord { flatOuterBool :: f PBool @@ -208,10 +207,10 @@ shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) shallowOuterData = pdata (punsafeFrom sampleShallowOuter) spec :: Spec -spec = TS.runTrailSpec $ do +spec = do -- Plutarch.Rec.verifySoleConstructor uses tracing, so we must create two sets -- of golden. - TS.describe "rec" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "rec" . plutarchDevFlagDescribe . pgoldenSpec $ do "simple" @\ do -- Record construction "constr" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs index 46184b511..889c4c0f5 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs @@ -8,13 +8,12 @@ import Plutarch.Integer (PInteger) import Plutarch.Lift (pconstant) import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS -import Test.Hspec (Spec) +import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "recursion" $ do - TS.describe "example" . pgoldenSpec $ do +spec = do + describe "recursion" $ do + describe "example" . pgoldenSpec $ do "iterateN" @\ do "lam" @| iterateN "app" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 772f6fdb8..80ba3d202 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -44,12 +44,11 @@ import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS -import Test.Hspec (Spec) +import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "scripts" . pgoldenSpec $ do +spec = do + describe "scripts" . pgoldenSpec $ do "auth_validator" @\ do "0" @| authValidatorTerm "hash" @| pconstant validatorHashEncoded diff --git a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs index fdde8a94d..816862fb6 100644 --- a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs @@ -7,12 +7,11 @@ import qualified Data.Text as T import Plutarch.ListSpec (integerList) import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "show" . pgoldenSpec $ do +spec = do + describe "show" . pgoldenSpec $ do let str x = pconstant @PString x "unit" @| pshow (pcon PUnit) @== str "()" "bool" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/StringSpec.hs b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs index e2cf31658..ae0c67886 100644 --- a/plutarch-test/plutarch-base/Plutarch/StringSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs @@ -2,12 +2,11 @@ module Plutarch.StringSpec (spec) where import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "str" $ do +spec = do + describe "str" $ do pgoldenSpec $ do "eq" @| "foo" #== pconstant @PString "foo" @-> passert "semigroup" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs index 75924b335..4bb5c5577 100644 --- a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs @@ -2,12 +2,11 @@ module Plutarch.TraceSpec (spec) where import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do +spec = do + describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do "ptrace" @\ do "one" @| ptrace "foo" (pcon PUnit) @-> \p -> ptraces p ["foo"] diff --git a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs index 09f49ba75..38ac616ad 100644 --- a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs @@ -5,14 +5,13 @@ import qualified PlutusCore as PLC import Plutarch.Internal (punsafeConstantInternal) import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Plutarch.Unsafe (punsafeBuiltin) -import Test.Hspec (Spec) +import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do +spec = do -- Tests for the behaviour of UPLC itself. - TS.describe "uplc-behaviour" . pgoldenSpec $ do + describe "uplc-behaviour" . pgoldenSpec $ do "2:[1]" @| ( let l :: Term _ (PBuiltinList PInteger) = punsafeConstantInternal . PLC.Some $ @@ -36,7 +35,7 @@ spec = TS.runTrailSpec $ do "fails:MkPair-1-2" @| punsafeBuiltin PLC.MkPairData # (1 :: Term _ PInteger) # (2 :: Term _ PInteger) @-> pfails - TS.describe "uplc-misc" . pgoldenSpec $ do + describe "uplc-misc" . pgoldenSpec $ do "perror" @| perror @-> pfails "perror.arg" @| perror # (1 :: Term s PInteger) @-> pfails "laziness" @\ do diff --git a/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs index d29471bc2..534b8168a 100644 --- a/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs @@ -3,12 +3,11 @@ module Plutarch.UnitSpec (spec) where import Plutarch import Plutarch.Prelude import Plutarch.Test -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "unit" . pgoldenSpec $ do +spec = do + describe "unit" . pgoldenSpec $ do "pcon" @| pcon PUnit "pmatch" @| pmatch (pcon PUnit) (\case PUnit -> pcon PTrue) @-> passert "compare" @\ do diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs index b2ef1ce90..2e5440097 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -3,20 +3,18 @@ module Plutarch.ListUtilsSpec (spec) where import Plutarch.ListUtils (pcheckSorted, preverse) import Plutarch.Prelude -import Control.Monad.Reader (lift) import Hedgehog (Property) import Hedgehog.Internal.Property (propertyTest) import Plutarch.Test import Plutarch.Test.Property import Plutarch.Test.Property.Gen (genInteger, genList) -import qualified Plutarch.Test.TrailSpecMonad as TS import Test.Hspec (Spec, describe, it) import Test.Hspec.Hedgehog (hedgehog) spec :: Spec -spec = TS.runTrailSpec $ do - TS.describe "extra.listutils" $ do - lift . describe "properties" $ do +spec = do + describe "extra.listutils" $ do + describe "properties" $ do describe "reverse" $ do it "plutarch level reversing behaves like haskell level reversing" . hedgehog . propertyTest $ prop_preverseEquiv pgoldenSpec $ do diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 94ba6c329..095a5c693 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -108,7 +108,6 @@ library exposed-modules: Plutarch.Test Plutarch.Test.Property - Plutarch.Test.TrailSpecMonad other-modules: Plutarch.Test.Benchmark @@ -182,7 +181,6 @@ executable plutarch-test Plutarch.Test.Property.HaskEquiv Plutarch.Test.Property.Marshal Plutarch.Test.Run - Plutarch.Test.TrailSpecMonad Plutarch.TraceSpec Plutarch.UnitSpec Plutarch.UPLCSpec From e374308999b0edd6a03d637e336fe30d729b49a9 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 4 Apr 2022 15:10:05 -0400 Subject: [PATCH 303/584] Cleanup --- plutarch-test/plutarch-base/Plutarch/POrdSpec.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index 9680b7dc8..78b9783e6 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -30,7 +30,6 @@ import Plutarch.Prelude import Plutarch.SpecTypes (PTriplet (PTriplet), Triplet (Triplet)) import Plutarch.Test import Test.Hspec (Spec, describe, shouldBe, specify) -import qualified Test.Hspec as H spec :: Spec spec = do @@ -113,7 +112,7 @@ propertySet :: String -> Spec propertySet typeName' = do - H.describe typeName' $ do + describe typeName' $ do let typeName = '(' : typeName' ++ ")" specify ("(#<) @" <> typeName <> " ≡ (<) @" <> typeName) $ property $ pltIso @p From ea6850e5aad69c5e3f262c29e24527643d04128d Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 5 Apr 2022 20:38:23 +0530 Subject: [PATCH 304/584] Less lenient kind signature for `HRec` --- Plutarch/DataRepr/Internal/Field.hs | 5 ++-- Plutarch/DataRepr/Internal/HList.hs | 35 +++++++++++------------ Plutarch/DataRepr/Internal/HList/Utils.hs | 7 +++-- Plutarch/Internal/TypeFamily.hs | 5 +++- Plutarch/TryFrom.hs | 5 ++-- 5 files changed, 31 insertions(+), 26 deletions(-) diff --git a/Plutarch/DataRepr/Internal/Field.hs b/Plutarch/DataRepr/Internal/Field.hs index ce20854e2..71a1eb523 100644 --- a/Plutarch/DataRepr/Internal/Field.hs +++ b/Plutarch/DataRepr/Internal/Field.hs @@ -153,11 +153,12 @@ type family CutSkip (bs :: [ToBind]) :: [ToBind] where Get the 'Term' representations to be bound based on the result of 'Bindings'. -} -type family BoundTerms (ps :: [PLabeledType]) (bs :: [ToBind]) (s :: S) :: [Type] where +type BoundTerms :: [PLabeledType] -> [ToBind] -> S -> [(Symbol, Type)] +type family BoundTerms ps bs s where BoundTerms '[] _ _ = '[] BoundTerms _ '[] _ = '[] BoundTerms (_ ': ps) ( 'Skip ': bs) s = BoundTerms ps bs s - BoundTerms ((name ':= p) ': ps) ( 'Bind ': bs) s = (Labeled name (Term s (PAsData p))) ': (BoundTerms ps bs s) + BoundTerms ((name ':= p) ': ps) ( 'Bind ': bs) s = '(name, Term s (PAsData p)) ': BoundTerms ps bs s class BindFields (ps :: [PLabeledType]) (bs :: [ToBind]) where -- | diff --git a/Plutarch/DataRepr/Internal/HList.hs b/Plutarch/DataRepr/Internal/HList.hs index d32dd1647..87ef844c8 100644 --- a/Plutarch/DataRepr/Internal/HList.hs +++ b/Plutarch/DataRepr/Internal/HList.hs @@ -23,11 +23,10 @@ module Plutarch.DataRepr.Internal.HList ( ElemOf (..), ) where -import Data.Kind (Type) +import Data.Kind (Constraint, Type) import GHC.Records (HasField, getField) import GHC.TypeLits (Symbol) -import Plutarch (Term) -import Plutarch.Builtin +import Plutarch.Builtin (PAsData) import Plutarch.DataRepr.Internal.FromData (PFromDataable, pmaybeFromAsData) import Plutarch.DataRepr.Internal.HList.Utils ( Drop, @@ -37,19 +36,22 @@ import Plutarch.DataRepr.Internal.HList.Utils ( Labeled (Labeled, unLabeled), SingleItem, ) +import Plutarch.Internal (Term) +import Plutarch.Internal.TypeFamily (Snd) -------------------------------------------------------------------------------- ---------- HList and HRec types -data HRec (as :: [Type]) where +type HRec :: [(Symbol, Type)] -> Type +data HRec as where HNil :: HRec '[] - HCons :: (Labeled name a) -> HRec as -> HRec ((Labeled name a) ': as) + HCons :: Labeled name a -> HRec as -> HRec ('(name, a) ': as) ---------- Field indexing functions -- | Index HRec using Elem -indexHRec :: HRec as -> (forall a. Elem a as -> a) -indexHRec (HCons x _) Here = x +indexHRec :: HRec as -> (forall a. Elem a as -> Snd a) +indexHRec (HCons x _) Here = unLabeled x indexHRec (HCons _ xs) (There i) = indexHRec xs i indexHRec HNil impossible = case impossible of {} @@ -67,7 +69,7 @@ hrecField' :: ) => HRec as -> a -hrecField' xs = unLabeled $ indexHRec xs $ elemOf @name @a @as +hrecField' xs = indexHRec xs $ elemOf @name @a @as ---------- Internal utils @@ -77,11 +79,8 @@ hrecField' xs = unLabeled $ indexHRec xs $ elemOf @name @a @as This class could instead be a more direct version of 'indexHList', but perhaps the `Elem` encoding will be useful. -} -class - (IndexLabel name as ~ a) => - ElemOf (name :: Symbol) (a :: Type) (as :: [Type]) - | as name -> a - where +type ElemOf :: Symbol -> Type -> [(Symbol, Type)] -> Constraint +class IndexLabel name as ~ a => ElemOf name a as | as name -> a where -- | Construct the `Elem` corresponding to a Nat index. -- -- Example: @@ -91,10 +90,10 @@ class -- -- >>> natElem @_ @3 -- There (There (There Here)) - elemOf :: Elem (Labeled name a) as + elemOf :: Elem '(name, a) as -instance {-# OVERLAPPING #-} ElemOf name a ((Labeled name a) ': as) where - elemOf :: Elem (Labeled name a) ((Labeled name a) ': as) +instance {-# OVERLAPPING #-} ElemOf name a ('(name, a) ': as) where + elemOf :: Elem '(name, a) ('(name, a) ': as) elemOf = Here instance @@ -104,7 +103,7 @@ instance ) => ElemOf name a (b ': as) where - elemOf :: Elem (Labeled name a) (b ': as) + elemOf :: Elem '(name, a) (b ': as) elemOf = There (elemOf @name @a @as) {- | @@ -144,7 +143,7 @@ newtype HRecGeneric as = HRecGeneric (HRec as) instance forall name a as. - ( (IndexLabel name as ~ a) + ( IndexLabel name as ~ a , ElemOf name a as ) => HasField name (HRecGeneric as) a diff --git a/Plutarch/DataRepr/Internal/HList/Utils.hs b/Plutarch/DataRepr/Internal/HList/Utils.hs index 230dfe5fa..61a54ae9f 100644 --- a/Plutarch/DataRepr/Internal/HList/Utils.hs +++ b/Plutarch/DataRepr/Internal/HList/Utils.hs @@ -33,9 +33,10 @@ type family IndexList (n :: Nat) (l :: [k]) :: k where IndexList 0 (x ': _) = x IndexList n (x : xs) = IndexList (n - 1) xs --- | Indexing list of labeled types by label -type family IndexLabel (name :: Symbol) (as :: [Type]) :: Type where - IndexLabel name ((Labeled name a) ': _) = a +-- | Indexing list of labeled pairs by label +type IndexLabel :: Symbol -> [(Symbol, Type)] -> Type +type family IndexLabel name as where + IndexLabel name ('(name, a) ': _) = a IndexLabel name (_ ': as) = IndexLabel name as -- | Return the single item from a singleton list diff --git a/Plutarch/Internal/TypeFamily.hs b/Plutarch/Internal/TypeFamily.hs index 335da1367..a020b48fa 100644 --- a/Plutarch/Internal/TypeFamily.hs +++ b/Plutarch/Internal/TypeFamily.hs @@ -1,4 +1,4 @@ -module Plutarch.Internal.TypeFamily (ToPType, ToPType2, UnTerm) where +module Plutarch.Internal.TypeFamily (ToPType, ToPType2, UnTerm, Snd) where import Data.Kind (Type) import Plutarch.Internal (PType, Term) @@ -17,3 +17,6 @@ type family ToPType2 as where type UnTerm :: Type -> PType type family UnTerm x where UnTerm (Term s a) = a + +type family Snd ab where + Snd '(a, b) = b diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index a9af6cb2e..1ef802ded 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -126,8 +126,9 @@ newtype Flip f a b = Flip (f b a) ----------------------- HRecP and friends ----------------------------------------------- -type family HRecPApply (as :: [(Symbol, PType)]) (s :: S) :: [Type] where - HRecPApply ('(name, ty) ': rest) s = Labeled name (Reduce (ty s)) ': HRecPApply rest s +type HRecPApply :: [(Symbol, PType)] -> S -> [(Symbol, Type)] +type family HRecPApply as s where + HRecPApply ('(name, ty) ': rest) s = '(name, Reduce (ty s)) ': HRecPApply rest s HRecPApply '[] s = '[] newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (HRecGeneric (HRecPApply as s)) From f5943b815397b099e732be45ea1ef79e768564e7 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Apr 2022 12:58:19 +0530 Subject: [PATCH 305/584] WIP `PlutusType (PDataRecord l)` --- Plutarch/DataRepr/Internal.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 447ccc712..8bd4fe289 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -21,7 +21,6 @@ module Plutarch.DataRepr.Internal ( pdropDataRecord, DerivePConstantViaData (..), pasDataSum, - pdToBuiltin, DualReprHandler (..), ) where @@ -108,6 +107,12 @@ data PDataRecord (as :: [PLabeledType]) (s :: S) where PDataRecord ((name ':= x) ': xs) s PDNil :: PDataRecord '[] s +instance {-# OVERLAPPABLE #-} PlutusType (PDataRecord l) where + type PInner (PDataRecord l) _ = PBuiltinList PData + pcon' (PDCons x xs) = pcons # pforgetData x # pto xs + pcon' PDNil = pnil + pmatch' _ _ = undefined -- FIXME + instance PlutusType (PDataRecord ((name ':= x) ': xs)) where type PInner (PDataRecord ((name ':= x) ': xs)) _ = PBuiltinList PData pcon' (PDCons x xs) = pto result @@ -128,7 +133,7 @@ instance PlutusType (PDataRecord '[]) where -- | This uses data equality. 'PEq' instances of elements don't make any difference. instance PEq (PDataRecord xs) where - x #== y = pdToBuiltin x #== pdToBuiltin y + x #== y = pto x #== pto y -- Lexicographic ordering based 'Ord' instances for 'PDataRecord'. @@ -184,10 +189,6 @@ pdcons = punsafeCoerce $ pcons @PBuiltinList @PData pdnil :: Term s (PDataRecord '[]) pdnil = punsafeCoerce $ pnil @PBuiltinList @PData --- | Convert a 'PDataRecord' into a builtin list of data values, losing type information in the process. -pdToBuiltin :: Term s (PDataRecord xs) -> Term s (PBuiltinList PData) -pdToBuiltin = punsafeCoerce - data PLabeledType = Symbol := PType {- Get the product types of a data record sum constructor From ddb44676f0d72c7863bdbcc6df8ccd905ad73db7 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Apr 2022 14:07:55 +0530 Subject: [PATCH 306/584] Merge staging --- .gitattributes | 1 + .gitignore | 1 - CHANGELOG.md | 54 +- CODEOWNERS | 15 - Plutarch/Api/V1.hs | 8 +- Plutarch/Api/V1/Address.hs | 6 +- Plutarch/Api/V1/AssocMap.hs | 8 +- Plutarch/Api/V1/Contexts.hs | 6 +- Plutarch/Api/V1/Crypto.hs | 26 +- Plutarch/Api/V1/DCert.hs | 2 +- Plutarch/Api/V1/Interval.hs | 8 +- Plutarch/Api/V1/Maybe.hs | 77 +- Plutarch/Api/V1/Scripts.hs | 15 +- Plutarch/Api/V1/Tx.hs | 8 +- Plutarch/Api/V1/Value.hs | 7 +- Plutarch/Bool.hs | 74 +- Plutarch/Builtin.hs | 89 +- Plutarch/DataRepr/Internal.hs | 280 ++- Plutarch/DataRepr/Internal/Generic.hs | 36 - Plutarch/DataRepr/Internal/HList.hs | 15 + Plutarch/Either.hs | 6 +- Plutarch/Evaluate.hs | 81 +- Plutarch/FFI.hs | 284 +++ Plutarch/Internal.hs | 44 +- Plutarch/Internal/Generic.hs | 72 + Plutarch/Internal/PlutusType.hs | 75 +- Plutarch/Lift.hs | 74 +- Plutarch/List.hs | 108 +- Plutarch/Maybe.hs | 25 +- Plutarch/Pair.hs | 10 +- Plutarch/Prelude.hs | 13 +- Plutarch/Rational.hs | 11 +- Plutarch/Rec.hs | 10 +- Plutarch/Reducible.hs | 17 + Plutarch/Show.hs | 213 ++ Plutarch/Trace.hs | 22 +- Plutarch/TryFrom.hs | 367 +++ Plutarch/Unit.hs | 5 + README.md | 9 +- ci.nix | 3 - docs/Concepts.md | 11 + docs/Concepts/Data and Scott encoding.md | 77 + docs/Concepts/Haskell Synonym.md | 9 + docs/Concepts/Hoisting.md | 68 + docs/Concepts/What is the S.md | 10 + docs/DEVGUIDE.md | 93 +- docs/GUIDE.md | 2114 ----------------- docs/Introduction.md | 101 + docs/Introduction/Delay and Force.md | 38 + docs/Introduction/Pattern matching.md | 44 + docs/Introduction/Plutarch Terms.md | 21 + .../Plutarch Terms/Plutarch Constants.md | 132 + .../Plutarch Terms/Plutarch Lambdas.md | 70 + docs/Introduction/Plutarch Types.md | 31 + docs/Introduction/Untyped Plutus Core.md | 11 + docs/README.md | 158 ++ docs/Run.md | 110 + docs/Tricks.md | 15 + .../Difference between pcon and pconstant.md | 19 + docs/Tricks/Don't duplicate work.md | 131 + docs/Tricks/Optimizing unhoistable lambdas.md | 21 + docs/Tricks/Plutarch functions strict.md | 5 + docs/Tricks/Prefer Plutarch functions.md | 5 + ...r matching on pmatch result immediately.md | 29 + .../Prefer statically building constants.md | 26 + .../Tricks/Representation of Plutarch type.md | 19 + ...lity of evaluation in Haskell functions.md | 12 + docs/Tricks/Using Haskell level functions.md | 63 + ...aIndexed, Haskell ADTs, and PIsDataRepr.md | 83 + docs/Troubleshooting.md | 79 + docs/Typeclasses.md | 20 + docs/Typeclasses/PConstant and PLift.md | 217 ++ docs/Typeclasses/PEq and POrd.md | 78 + docs/Typeclasses/PIntegral.md | 16 + docs/Typeclasses/PIsData.md | 23 + .../PIsDataRepr and PDataFields.md | 333 +++ docs/Typeclasses/PListLike.md | 61 + docs/Typeclasses/PTryFrom.md | 81 + .../PlutusType, PCon, and PMatch.md | 93 + docs/Types.md | 19 + docs/Types/PAsData.md | 35 + docs/Types/PBool.md | 12 + docs/Types/PBuiltinList.md | 39 + docs/Types/PBuiltinPair.md | 11 + docs/Types/PByteString.md | 19 + docs/Types/PData.md | 9 + docs/Types/PDataSum and PDataRecord.md | 48 + docs/Types/PInteger.md | 17 + docs/Types/PList.md | 25 + docs/Types/PRecord.md | 82 + docs/Types/PString.md | 17 + docs/Types/PTuple.md | 17 + docs/Types/PUnit.md | 5 + docs/Usage.md | 15 + .../Avoid work duplication using plet.md | 10 + docs/Usage/Conditionals.md | 15 + docs/Usage/Deriving for newtypes.md | 48 + docs/Usage/Deriving with generics.md | 25 + docs/Usage/Do syntax with QualifiedDo.md | 26 + docs/Usage/Do syntax with TermCont.md | 58 + docs/Usage/FFI.md | 93 + docs/Usage/Prelude mixin.md | 12 + docs/Usage/Raising errors.md | 8 + docs/Usage/Recursion.md | 30 + docs/Usage/Tracing.md | 5 + docs/Usage/Unsafe functions.md | 9 + docs/examples/BASIC.md | 31 + docs/examples/VALIDATOR.md | 124 + docs/index.md | 3 + docs/index.yaml | 14 + examples/Examples/ConstrData.hs | 134 -- examples/Examples/LetRec.hs | 410 ---- examples/Examples/Lift.hs | 37 - examples/Main.hs | 212 -- examples/Utils.hs | 195 -- flake.lock | 610 +++-- flake.nix | 627 ++--- plutarch-benchmark/README.md | 39 - plutarch-benchmark/bench/Main.hs | 427 ---- plutarch-benchmark/benchmark-diff/Main.hs | 23 - plutarch-benchmark/src/Plutarch/Benchmark.hs | 243 -- plutarch-extra/Plutarch/Extra.hs | 1 + plutarch-extra/Plutarch/ListUtils.hs | 23 + .../plutarch-extra.cabal | 62 +- plutarch-extra/preludes/PPrelude.hs | 7 + plutarch-test/Main.hs | 42 + plutarch-test/README.md | 18 +- plutarch-test/common/Plutarch/Test.hs | 167 ++ .../common/Plutarch/Test/Benchmark.hs | 41 + plutarch-test/common/Plutarch/Test/Golden.hs | 261 ++ .../common/Plutarch/Test/ListSyntax.hs | 30 + .../common/Plutarch/Test/Property.hs | 8 + .../common/Plutarch/Test/Property/Extra.hs | 74 + .../common/Plutarch/Test/Property/Gen.hs | 22 + .../Plutarch/Test/Property/HaskEquiv.hs | 187 ++ .../common/Plutarch/Test/Property/Marshal.hs | 38 + plutarch-test/common/Plutarch/Test/Run.hs | 73 + plutarch-test/conditional/Plutarch/FFISpec.hs | 394 +++ .../Plutarch/FieldSpec.hs | 173 +- .../conditional/Plutarch/MonadicSpec.hs | 92 + .../conditional/Plutarch/TryFromSpec.hs | 494 ++++ plutarch-test/goldens/api.ctx.bench.golden | 7 + .../api.ctx.get.credentials.bench.golden | 1 - .../api.ctx.get.credentials.uplc.eval.golden | 1 - .../api.ctx.get.credentials.uplc.golden | 1 - .../goldens/api.ctx.get.mint.bench.golden | 1 - .../goldens/api.ctx.get.mint.uplc.eval.golden | 1 - .../goldens/api.ctx.get.mint.uplc.golden | 1 - .../goldens/api.ctx.get.sym.bench.golden | 1 - .../goldens/api.ctx.get.sym.uplc.eval.golden | 1 - .../goldens/api.ctx.get.sym.uplc.golden | 1 - .../goldens/api.ctx.get.txInfo.bench.golden | 1 - .../api.ctx.get.txInfo.uplc.eval.golden | 1 - .../goldens/api.ctx.get.txInfo.uplc.golden | 1 - .../goldens/api.ctx.uplc.eval.golden | 8 +- plutarch-test/goldens/api.ctx.uplc.golden | 8 +- ...i.example.signatory.dev=false.bench.golden | 4 + ...mple.signatory.dev=false.cont.bench.golden | 1 - ....signatory.dev=false.cont.uplc.eval.golden | 1 - ...ample.signatory.dev=false.cont.uplc.golden | 1 - ....signatory.dev=false.termcont.bench.golden | 1 - ...natory.dev=false.termcont.uplc.eval.golden | 1 - ...e.signatory.dev=false.termcont.uplc.golden | 1 - ...ample.signatory.dev=false.uplc.eval.golden | 4 + ...pi.example.signatory.dev=false.uplc.golden | 4 + ...pi.example.signatory.dev=true.bench.golden | 4 + ...ample.signatory.dev=true.cont.bench.golden | 1 - ...e.signatory.dev=true.cont.uplc.eval.golden | 1 - ...xample.signatory.dev=true.cont.uplc.golden | 1 - ...e.signatory.dev=true.termcont.bench.golden | 1 - ...gnatory.dev=true.termcont.uplc.eval.golden | 1 - ...le.signatory.dev=true.termcont.uplc.golden | 1 - ...xample.signatory.dev=true.uplc.eval.golden | 4 + ...api.example.signatory.dev=true.uplc.golden | 4 + plutarch-test/goldens/bool.bench.golden | 21 + plutarch-test/goldens/bool.pand.bench.golden | 4 - .../goldens/bool.pand.laziness.bench.golden | 2 - .../bool.pand.laziness.uplc.eval.golden | 2 - .../goldens/bool.pand.laziness.uplc.golden | 2 - .../goldens/bool.pand.uplc.eval.golden | 4 - plutarch-test/goldens/bool.pand.uplc.golden | 4 - plutarch-test/goldens/bool.pnot.bench.golden | 2 - .../goldens/bool.pnot.uplc.eval.golden | 2 - plutarch-test/goldens/bool.pnot.uplc.golden | 2 - plutarch-test/goldens/bool.por.bench.golden | 4 - .../goldens/bool.por.laziness.bench.golden | 2 - .../bool.por.laziness.uplc.eval.golden | 2 - .../goldens/bool.por.laziness.uplc.golden | 2 - .../goldens/bool.por.uplc.eval.golden | 4 - plutarch-test/goldens/bool.por.uplc.golden | 4 - plutarch-test/goldens/bool.uplc.eval.golden | 21 + plutarch-test/goldens/bool.uplc.golden | 21 + plutarch-test/goldens/bytestring.bench.golden | 10 + .../goldens/bytestring.eq.bench.golden | 1 - .../goldens/bytestring.eq.uplc.eval.golden | 1 - .../goldens/bytestring.eq.uplc.golden | 1 - .../bytestring.phexByteStr.bench.golden | 1 - .../bytestring.pindexByteStr.bench.golden | 1 - .../bytestring.pindexByteStr.uplc.eval.golden | 1 - .../bytestring.pindexByteStr.uplc.golden | 1 - .../bytestring.plengthByteStr.bench.golden | 1 - ...string.plengthByteStr.pconsBS.bench.golden | 1 - ...ng.plengthByteStr.pconsBS.uplc.eval.golden | 1 - ...estring.plengthByteStr.pconsBS.uplc.golden | 1 - ...bytestring.plengthByteStr.uplc.eval.golden | 1 - .../bytestring.plengthByteStr.uplc.golden | 1 - .../bytestring.psliceByteStr.bench.golden | 1 - .../bytestring.psliceByteStr.uplc.eval.golden | 1 - .../bytestring.psliceByteStr.uplc.golden | 1 - .../goldens/bytestring.semigroup.bench.golden | 1 - .../bytestring.semigroup.uplc.eval.golden | 1 - .../goldens/bytestring.semigroup.uplc.golden | 1 - .../goldens/bytestring.uplc.eval.golden | 10 + plutarch-test/goldens/bytestring.uplc.golden | 10 + plutarch-test/goldens/either.bench.golden | 5 + plutarch-test/goldens/either.uplc.eval.golden | 5 + plutarch-test/goldens/either.uplc.golden | 5 + .../goldens/extra.listutils.bench.golden | 4 + .../goldens/extra.listutils.uplc.eval.golden | 4 + .../goldens/extra.listutils.uplc.golden | 4 + plutarch-test/goldens/field.data.bench.golden | 4 + .../goldens/field.data.uplc.eval.golden | 4 + plutarch-test/goldens/field.data.uplc.golden | 4 + .../goldens/field.dropFields.bench.golden | 2 + .../field.dropFields.dropFields.bench.golden | 1 - ...eld.dropFields.dropFields.uplc.eval.golden | 1 - .../field.dropFields.dropFields.uplc.golden | 1 - .../goldens/field.dropFields.uplc.eval.golden | 2 + .../goldens/field.dropFields.uplc.golden | 11 + .../goldens/field.other.bench.golden | 2 + .../goldens/field.other.uplc.eval.golden | 2 + plutarch-test/goldens/field.other.uplc.golden | 2 + .../goldens/field.pletFields.bench.golden | 5 + ...ield.pletFields.letSomeFields.bench.golden | 1 - ....pletFields.letSomeFields.uplc.eval.golden | 1 - ...field.pletFields.letSomeFields.uplc.golden | 1 - .../field.pletFields.nFields.bench.golden | 1 - .../field.pletFields.nFields.uplc.eval.golden | 1 - .../field.pletFields.nFields.uplc.golden | 1 - .../goldens/field.pletFields.uplc.eval.golden | 5 + .../goldens/field.pletFields.uplc.golden | 23 + .../goldens/field.rangeFields.bench.golden | 2 + ...field.rangeFields.rangeFields.bench.golden | 1 - ...d.rangeFields.rangeFields.uplc.eval.golden | 1 - .../field.rangeFields.rangeFields.uplc.golden | 1 - .../field.rangeFields.uplc.eval.golden | 2 + .../goldens/field.rangeFields.uplc.golden | 11 + .../goldens/field.trips.bench.golden | 7 + .../goldens/field.trips.getY.bench.golden | 1 - .../goldens/field.trips.getY.uplc.eval.golden | 1 - .../goldens/field.trips.getY.uplc.golden | 1 - .../goldens/field.trips.tripSum.bench.golden | 1 - .../field.trips.tripSum.uplc.eval.golden | 1 - .../goldens/field.trips.tripSum.uplc.golden | 1 - .../goldens/field.trips.tripYZ.bench.golden | 1 - .../field.trips.tripYZ.uplc.eval.golden | 1 - .../goldens/field.trips.tripYZ.uplc.golden | 1 - .../goldens/field.trips.uplc.eval.golden | 7 + plutarch-test/goldens/field.trips.uplc.golden | 7 + .../goldens/int.examples.bench.golden | 3 +- .../goldens/int.examples.uplc.eval.golden | 3 +- .../goldens/int.examples.uplc.golden | 3 +- .../goldens/lift.pconstantData.bench.golden | 5 + .../lift.pconstantData.uplc.eval.golden | 5 + .../goldens/lift.pconstantData.uplc.golden | 5 + .../goldens/list.dev=false.bench.golden | 25 + .../goldens/list.dev=false.uplc.eval.golden | 25 + .../goldens/list.dev=false.uplc.golden | 25 + .../goldens/list.dev=true.bench.golden | 25 + .../goldens/list.dev=true.uplc.eval.golden | 25 + .../goldens/list.dev=true.uplc.golden | 25 + .../list.pconcat.identity.bench.golden | 1 - .../list.pconcat.identity.uplc.eval.golden | 1 - .../goldens/list.pconcat.identity.uplc.golden | 1 - .../goldens/list.pfilter.bench.golden | 2 - .../goldens/list.pfilter.uplc.eval.golden | 2 - .../goldens/list.pfilter.uplc.golden | 2 - .../goldens/list.pfoldl.bench.golden | 4 - .../goldens/list.pfoldl.uplc.eval.golden | 4 - plutarch-test/goldens/list.pfoldl.uplc.golden | 4 - plutarch-test/goldens/list.phead.bench.golden | 1 - .../goldens/list.phead.uplc.eval.golden | 1 - plutarch-test/goldens/list.phead.uplc.golden | 1 - plutarch-test/goldens/list.pmap.bench.golden | 1 - .../goldens/list.pmap.uplc.eval.golden | 1 - plutarch-test/goldens/list.pmap.uplc.golden | 1 - .../goldens/list.pmatch.uplc.eval.golden | 1 - plutarch-test/goldens/list.pmatch.uplc.golden | 1 - plutarch-test/goldens/list.pnull.bench.golden | 2 - .../goldens/list.pnull.uplc.eval.golden | 2 - plutarch-test/goldens/list.pnull.uplc.golden | 2 - plutarch-test/goldens/list.ptail.bench.golden | 1 - .../goldens/list.ptail.uplc.eval.golden | 1 - plutarch-test/goldens/list.ptail.uplc.golden | 1 - .../goldens/list.pzipWith.bench.golden | 1 - .../goldens/list.pzipWith.uplc.eval.golden | 1 - .../goldens/list.pzipWith.uplc.golden | 1 - plutarch-test/goldens/maybe.bench.golden | 4 + plutarch-test/goldens/maybe.uplc.eval.golden | 4 + plutarch-test/goldens/maybe.uplc.golden | 4 + ...i.example.signatory.dev=false.bench.golden | 2 + ...e.signatory.dev=false.haskell.bench.golden | 1 - ...gnatory.dev=false.haskell.uplc.eval.golden | 1 - ...le.signatory.dev=false.haskell.uplc.golden | 1 - ...ample.signatory.dev=false.uplc.eval.golden | 2 + ...pi.example.signatory.dev=false.uplc.golden | 2 + ...pi.example.signatory.dev=true.bench.golden | 2 + ...le.signatory.dev=true.haskell.bench.golden | 1 - ...ignatory.dev=true.haskell.uplc.eval.golden | 1 - ...ple.signatory.dev=true.haskell.uplc.golden | 1 - ...xample.signatory.dev=true.uplc.eval.golden | 2 + ...api.example.signatory.dev=true.uplc.golden | 2 + plutarch-test/goldens/pair.bench.golden | 4 + plutarch-test/goldens/pair.uplc.eval.golden | 4 + plutarch-test/goldens/pair.uplc.golden | 4 + .../goldens/pisdata.constr.bench.golden | 8 + .../goldens/pisdata.constr.uplc.eval.golden | 8 + .../goldens/pisdata.constr.uplc.golden | 8 + .../goldens/pisdata.equality.bench.golden | 4 + .../goldens/pisdata.equality.uplc.eval.golden | 4 + .../goldens/pisdata.equality.uplc.golden | 4 + plutarch-test/goldens/pisdata.lt.bench.golden | 12 + .../goldens/pisdata.lt.uplc.eval.golden | 12 + plutarch-test/goldens/pisdata.lt.uplc.golden | 12 + .../goldens/pisdata.lte.bench.golden | 18 + .../goldens/pisdata.lte.uplc.eval.golden | 18 + plutarch-test/goldens/pisdata.lte.uplc.golden | 18 + .../goldens/pisdata.ppair.bench.golden | 5 + .../goldens/pisdata.ppair.uplc.eval.golden | 5 + .../goldens/pisdata.ppair.uplc.golden | 5 + plutarch-test/goldens/plam.bench.golden | 28 + .../goldens/plam.flip.const.uplc.eval.golden | 1 - .../goldens/plam.flip.const.uplc.golden | 1 - .../goldens/plam.id.uplc.eval.golden | 1 - plutarch-test/goldens/plam.id.uplc.golden | 1 - .../goldens/plam.plet.uplc.eval.golden | 1 - plutarch-test/goldens/plam.plet.uplc.golden | 1 - plutarch-test/goldens/plam.uplc.eval.golden | 28 + plutarch-test/goldens/plam.uplc.golden | 28 + .../goldens/plutustype.deconstr.bench.golden | 26 + .../plutustype.deconstr.uplc.eval.golden | 27 + .../goldens/plutustype.deconstr.uplc.golden | 26 + .../goldens/plutustype.example.bench.golden | 6 + .../plutustype.example.uplc.eval.golden | 6 + .../goldens/plutustype.example.uplc.golden | 6 + plutarch-test/goldens/rational.bench.golden | 21 + .../goldens/rational.compare.bench.golden | 1 - .../goldens/rational.compare.uplc.eval.golden | 1 - .../goldens/rational.compare.uplc.golden | 1 - .../goldens/rational.literal.uplc.eval.golden | 1 - .../goldens/rational.literal.uplc.golden | 1 - .../goldens/rational.ops.bench.golden | 3 - .../goldens/rational.ops.uplc.eval.golden | 3 - .../goldens/rational.ops.uplc.golden | 3 - .../goldens/rational.uplc.eval.golden | 21 + plutarch-test/goldens/rational.uplc.golden | 21 + .../goldens/rec.dev=false.bench.golden | 45 + .../goldens/rec.dev=false.uplc.eval.golden | 59 + .../goldens/rec.dev=false.uplc.golden | 45 + .../goldens/rec.dev=true.bench.golden | 45 + .../goldens/rec.dev=true.uplc.eval.golden | 59 + .../goldens/rec.dev=true.uplc.golden | 45 + .../goldens/recursion.example.bench.golden | 3 + .../recursion.example.iterateN.bench.golden | 1 - ...ecursion.example.iterateN.uplc.eval.golden | 1 - .../recursion.example.iterateN.uplc.golden | 1 - .../recursion.example.uplc.eval.golden | 3 + .../goldens/recursion.example.uplc.golden | 3 + .../scripts.auth stake validator.uplc.golden | 1 - .../goldens/scripts.auth_policy.hash.golden | 1 - .../scripts.auth_policy.uplc.eval.golden | 1 - .../goldens/scripts.auth_policy.uplc.golden | 1 - .../scripts.auth_stake_validator.hash.golden | 1 - ...ipts.auth_stake_validator.uplc.eval.golden | 1 - .../scripts.auth_stake_validator.uplc.golden | 1 - .../scripts.auth_validator.hash.golden | 1 - .../scripts.auth_validator.uplc.eval.golden | 1 - .../scripts.auth_validator.uplc.golden | 1 - plutarch-test/goldens/scripts.bench.golden | 6 + .../goldens/scripts.uplc.eval.golden | 6 + plutarch-test/goldens/scripts.uplc.golden | 6 + plutarch-test/goldens/show.bench.golden | 36 + plutarch-test/goldens/show.uplc.eval.golden | 36 + plutarch-test/goldens/show.uplc.golden | 36 + plutarch-test/goldens/str.bench.golden | 5 + plutarch-test/goldens/str.eq.bench.golden | 1 - plutarch-test/goldens/str.eq.uplc.eval.golden | 1 - plutarch-test/goldens/str.eq.uplc.golden | 1 - .../goldens/str.semigroup.bench.golden | 1 - .../goldens/str.semigroup.uplc.eval.golden | 1 - .../goldens/str.semigroup.uplc.golden | 1 - plutarch-test/goldens/str.uplc.eval.golden | 5 + plutarch-test/goldens/str.uplc.golden | 5 + .../goldens/trace.dev=false.bench.golden | 10 + .../trace.dev=false.ptrace.bench.golden | 2 - .../trace.dev=false.ptrace.uplc.eval.golden | 2 - .../trace.dev=false.ptrace.uplc.golden | 2 - ...trace.dev=false.ptraceIfFalse.bench.golden | 2 - ...e.dev=false.ptraceIfFalse.uplc.eval.golden | 2 - .../trace.dev=false.ptraceIfFalse.uplc.golden | 2 - .../trace.dev=false.ptraceIfTrue.bench.golden | 2 - ...ce.dev=false.ptraceIfTrue.uplc.eval.golden | 2 - .../trace.dev=false.ptraceIfTrue.uplc.golden | 2 - .../goldens/trace.dev=false.uplc.eval.golden | 10 + .../goldens/trace.dev=false.uplc.golden | 10 + .../goldens/trace.dev=true.bench.golden | 10 + .../trace.dev=true.ptrace.bench.golden | 2 - .../trace.dev=true.ptrace.uplc.eval.golden | 2 - .../goldens/trace.dev=true.ptrace.uplc.golden | 2 - .../trace.dev=true.ptraceIfFalse.bench.golden | 2 - ...ce.dev=true.ptraceIfFalse.uplc.eval.golden | 2 - .../trace.dev=true.ptraceIfFalse.uplc.golden | 2 - .../trace.dev=true.ptraceIfTrue.bench.golden | 2 - ...ace.dev=true.ptraceIfTrue.uplc.eval.golden | 2 - .../trace.dev=true.ptraceIfTrue.uplc.golden | 2 - .../goldens/trace.dev=true.uplc.eval.golden | 10 + .../goldens/trace.dev=true.uplc.golden | 10 + plutarch-test/goldens/unit.bench.golden | 5 + .../goldens/unit.compare.bench.golden | 3 - .../goldens/unit.compare.uplc.eval.golden | 3 - .../goldens/unit.compare.uplc.golden | 3 - plutarch-test/goldens/unit.pcon.bench.golden | 1 - .../goldens/unit.pcon.uplc.eval.golden | 1 - plutarch-test/goldens/unit.pcon.uplc.golden | 1 - .../goldens/unit.pmatch.bench.golden | 1 - .../goldens/unit.pmatch.uplc.eval.golden | 1 - plutarch-test/goldens/unit.pmatch.uplc.golden | 1 - plutarch-test/goldens/unit.uplc.eval.golden | 5 + plutarch-test/goldens/unit.uplc.golden | 5 + .../goldens/uplc-behaviour.bench.golden | 4 + .../goldens/uplc-behaviour.uplc.eval.golden | 4 + .../goldens/uplc-behaviour.uplc.golden | 4 + plutarch-test/goldens/uplc-misc.bench.golden | 6 + .../goldens/uplc-misc.uplc.eval.golden | 6 + plutarch-test/goldens/uplc-misc.uplc.golden | 6 + plutarch-test/plutarch-base/BaseSpec.hs | 2 + .../Plutarch/ApiSpec.hs | 70 +- .../plutarch-base/Plutarch/BoolSpec.hs | 42 + .../plutarch-base/Plutarch/ByteStringSpec.hs | 42 + .../plutarch-base/Plutarch/EitherSpec.hs | 17 + .../Plutarch/IntegerSpec.hs | 24 +- .../plutarch-base/Plutarch/LiftSpec.hs | 51 + .../plutarch-base/Plutarch/ListSpec.hs | 125 + .../plutarch-base/Plutarch/MaybeSpec.hs | 19 + .../plutarch-base/Plutarch/PIsDataSpec.hs | 221 ++ .../plutarch-base/Plutarch/PLamSpec.hs | 71 + .../plutarch-base/Plutarch/POrdSpec.hs | 255 ++ .../plutarch-base/Plutarch/PairSpec.hs | 27 + .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 267 +++ .../plutarch-base/Plutarch/RationalSpec.hs | 46 + .../plutarch-base/Plutarch/RecSpec.hs | 306 +++ .../Plutarch/RecursionSpec.hs | 23 +- .../Plutarch/ScriptsSpec.hs | 71 +- .../plutarch-base/Plutarch/ShowSpec.hs | 79 + .../plutarch-base/Plutarch/SpecTypes.hs | 69 + .../plutarch-base/Plutarch/StringSpec.hs | 19 + .../plutarch-base/Plutarch/TraceSpec.hs | 38 + .../plutarch-base/Plutarch/UPLCSpec.hs | 48 + .../plutarch-base/Plutarch/UnitSpec.hs | 16 + plutarch-test/plutarch-extra/ExtraSpec.hs | 2 + .../plutarch-extra/Plutarch/ListUtilsSpec.hs | 36 + plutarch-test/plutarch-test.cabal | 79 +- plutarch-test/src/Main.hs | 8 - plutarch-test/src/Plutarch/BoolSpec.hs | 62 - plutarch-test/src/Plutarch/ByteStringSpec.hs | 54 - plutarch-test/src/Plutarch/ListSpec.hs | 63 - plutarch-test/src/Plutarch/MonadicSpec.hs | 55 - plutarch-test/src/Plutarch/PIsDataSpec.hs | 102 - plutarch-test/src/Plutarch/PLamSpec.hs | 14 - plutarch-test/src/Plutarch/PlutusTypeSpec.hs | 74 - plutarch-test/src/Plutarch/RationalSpec.hs | 62 - plutarch-test/src/Plutarch/StringSpec.hs | 23 - plutarch-test/src/Plutarch/Test.hs | 199 -- plutarch-test/src/Plutarch/TraceSpec.hs | 48 - plutarch-test/src/Plutarch/UnitSpec.hs | 28 - plutarch.cabal | 45 +- 476 files changed, 11254 insertions(+), 6065 deletions(-) create mode 100644 .gitattributes delete mode 100644 CODEOWNERS delete mode 100644 Plutarch/DataRepr/Internal/Generic.hs create mode 100644 Plutarch/FFI.hs create mode 100644 Plutarch/Internal/Generic.hs create mode 100644 Plutarch/Reducible.hs create mode 100644 Plutarch/Show.hs create mode 100644 Plutarch/TryFrom.hs delete mode 100644 ci.nix create mode 100644 docs/Concepts.md create mode 100644 docs/Concepts/Data and Scott encoding.md create mode 100644 docs/Concepts/Haskell Synonym.md create mode 100644 docs/Concepts/Hoisting.md create mode 100644 docs/Concepts/What is the S.md delete mode 100644 docs/GUIDE.md create mode 100644 docs/Introduction.md create mode 100644 docs/Introduction/Delay and Force.md create mode 100644 docs/Introduction/Pattern matching.md create mode 100644 docs/Introduction/Plutarch Terms.md create mode 100644 docs/Introduction/Plutarch Terms/Plutarch Constants.md create mode 100644 docs/Introduction/Plutarch Terms/Plutarch Lambdas.md create mode 100644 docs/Introduction/Plutarch Types.md create mode 100644 docs/Introduction/Untyped Plutus Core.md create mode 100644 docs/README.md create mode 100644 docs/Run.md create mode 100644 docs/Tricks.md create mode 100644 docs/Tricks/Difference between pcon and pconstant.md create mode 100644 docs/Tricks/Don't duplicate work.md create mode 100644 docs/Tricks/Optimizing unhoistable lambdas.md create mode 100644 docs/Tricks/Plutarch functions strict.md create mode 100644 docs/Tricks/Prefer Plutarch functions.md create mode 100644 docs/Tricks/Prefer matching on pmatch result immediately.md create mode 100644 docs/Tricks/Prefer statically building constants.md create mode 100644 docs/Tricks/Representation of Plutarch type.md create mode 100644 docs/Tricks/Responsibility of evaluation in Haskell functions.md create mode 100644 docs/Tricks/Using Haskell level functions.md create mode 100644 docs/Tricks/makeIsDataIndexed, Haskell ADTs, and PIsDataRepr.md create mode 100644 docs/Troubleshooting.md create mode 100644 docs/Typeclasses.md create mode 100644 docs/Typeclasses/PConstant and PLift.md create mode 100644 docs/Typeclasses/PEq and POrd.md create mode 100644 docs/Typeclasses/PIntegral.md create mode 100644 docs/Typeclasses/PIsData.md create mode 100644 docs/Typeclasses/PIsDataRepr and PDataFields.md create mode 100644 docs/Typeclasses/PListLike.md create mode 100644 docs/Typeclasses/PTryFrom.md create mode 100644 docs/Typeclasses/PlutusType, PCon, and PMatch.md create mode 100644 docs/Types.md create mode 100644 docs/Types/PAsData.md create mode 100644 docs/Types/PBool.md create mode 100644 docs/Types/PBuiltinList.md create mode 100644 docs/Types/PBuiltinPair.md create mode 100644 docs/Types/PByteString.md create mode 100644 docs/Types/PData.md create mode 100644 docs/Types/PDataSum and PDataRecord.md create mode 100644 docs/Types/PInteger.md create mode 100644 docs/Types/PList.md create mode 100644 docs/Types/PRecord.md create mode 100644 docs/Types/PString.md create mode 100644 docs/Types/PTuple.md create mode 100644 docs/Types/PUnit.md create mode 100644 docs/Usage.md create mode 100644 docs/Usage/Avoid work duplication using plet.md create mode 100644 docs/Usage/Conditionals.md create mode 100644 docs/Usage/Deriving for newtypes.md create mode 100644 docs/Usage/Deriving with generics.md create mode 100644 docs/Usage/Do syntax with QualifiedDo.md create mode 100644 docs/Usage/Do syntax with TermCont.md create mode 100644 docs/Usage/FFI.md create mode 100644 docs/Usage/Prelude mixin.md create mode 100644 docs/Usage/Raising errors.md create mode 100644 docs/Usage/Recursion.md create mode 100644 docs/Usage/Tracing.md create mode 100644 docs/Usage/Unsafe functions.md create mode 100644 docs/examples/BASIC.md create mode 100644 docs/examples/VALIDATOR.md create mode 100644 docs/index.md create mode 100644 docs/index.yaml delete mode 100644 examples/Examples/ConstrData.hs delete mode 100644 examples/Examples/LetRec.hs delete mode 100644 examples/Examples/Lift.hs delete mode 100644 examples/Main.hs delete mode 100644 examples/Utils.hs delete mode 100644 plutarch-benchmark/README.md delete mode 100644 plutarch-benchmark/bench/Main.hs delete mode 100644 plutarch-benchmark/benchmark-diff/Main.hs delete mode 100644 plutarch-benchmark/src/Plutarch/Benchmark.hs create mode 100644 plutarch-extra/Plutarch/Extra.hs create mode 100644 plutarch-extra/Plutarch/ListUtils.hs rename plutarch-benchmark/plutarch-benchmark.cabal => plutarch-extra/plutarch-extra.cabal (61%) create mode 100644 plutarch-extra/preludes/PPrelude.hs create mode 100644 plutarch-test/Main.hs create mode 100644 plutarch-test/common/Plutarch/Test.hs create mode 100644 plutarch-test/common/Plutarch/Test/Benchmark.hs create mode 100644 plutarch-test/common/Plutarch/Test/Golden.hs create mode 100644 plutarch-test/common/Plutarch/Test/ListSyntax.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property/Extra.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property/Gen.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs create mode 100644 plutarch-test/common/Plutarch/Test/Property/Marshal.hs create mode 100644 plutarch-test/common/Plutarch/Test/Run.hs create mode 100644 plutarch-test/conditional/Plutarch/FFISpec.hs rename plutarch-test/{src => conditional}/Plutarch/FieldSpec.hs (56%) create mode 100644 plutarch-test/conditional/Plutarch/MonadicSpec.hs create mode 100644 plutarch-test/conditional/Plutarch/TryFromSpec.hs create mode 100644 plutarch-test/goldens/api.ctx.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.credentials.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.credentials.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.credentials.uplc.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.mint.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.mint.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.mint.uplc.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.sym.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.sym.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.sym.uplc.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.txInfo.bench.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.txInfo.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.ctx.get.txInfo.uplc.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.cont.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.termcont.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.cont.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/bool.bench.golden delete mode 100644 plutarch-test/goldens/bool.pand.bench.golden delete mode 100644 plutarch-test/goldens/bool.pand.laziness.bench.golden delete mode 100644 plutarch-test/goldens/bool.pand.laziness.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.pand.laziness.uplc.golden delete mode 100644 plutarch-test/goldens/bool.pand.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.pand.uplc.golden delete mode 100644 plutarch-test/goldens/bool.pnot.bench.golden delete mode 100644 plutarch-test/goldens/bool.pnot.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.pnot.uplc.golden delete mode 100644 plutarch-test/goldens/bool.por.bench.golden delete mode 100644 plutarch-test/goldens/bool.por.laziness.bench.golden delete mode 100644 plutarch-test/goldens/bool.por.laziness.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.por.laziness.uplc.golden delete mode 100644 plutarch-test/goldens/bool.por.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bool.por.uplc.golden create mode 100644 plutarch-test/goldens/bool.uplc.eval.golden create mode 100644 plutarch-test/goldens/bool.uplc.golden create mode 100644 plutarch-test/goldens/bytestring.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.eq.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.eq.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.eq.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.phexByteStr.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.pindexByteStr.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.pindexByteStr.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.pindexByteStr.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.plengthByteStr.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.psliceByteStr.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.psliceByteStr.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.psliceByteStr.uplc.golden delete mode 100644 plutarch-test/goldens/bytestring.semigroup.bench.golden delete mode 100644 plutarch-test/goldens/bytestring.semigroup.uplc.eval.golden delete mode 100644 plutarch-test/goldens/bytestring.semigroup.uplc.golden create mode 100644 plutarch-test/goldens/bytestring.uplc.eval.golden create mode 100644 plutarch-test/goldens/bytestring.uplc.golden create mode 100644 plutarch-test/goldens/either.bench.golden create mode 100644 plutarch-test/goldens/either.uplc.eval.golden create mode 100644 plutarch-test/goldens/either.uplc.golden create mode 100644 plutarch-test/goldens/extra.listutils.bench.golden create mode 100644 plutarch-test/goldens/extra.listutils.uplc.eval.golden create mode 100644 plutarch-test/goldens/extra.listutils.uplc.golden create mode 100644 plutarch-test/goldens/field.data.bench.golden create mode 100644 plutarch-test/goldens/field.data.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.data.uplc.golden create mode 100644 plutarch-test/goldens/field.dropFields.bench.golden delete mode 100644 plutarch-test/goldens/field.dropFields.dropFields.bench.golden delete mode 100644 plutarch-test/goldens/field.dropFields.dropFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.dropFields.dropFields.uplc.golden create mode 100644 plutarch-test/goldens/field.dropFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.dropFields.uplc.golden create mode 100644 plutarch-test/goldens/field.other.bench.golden create mode 100644 plutarch-test/goldens/field.other.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.other.uplc.golden create mode 100644 plutarch-test/goldens/field.pletFields.bench.golden delete mode 100644 plutarch-test/goldens/field.pletFields.letSomeFields.bench.golden delete mode 100644 plutarch-test/goldens/field.pletFields.letSomeFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.pletFields.letSomeFields.uplc.golden delete mode 100644 plutarch-test/goldens/field.pletFields.nFields.bench.golden delete mode 100644 plutarch-test/goldens/field.pletFields.nFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.pletFields.nFields.uplc.golden create mode 100644 plutarch-test/goldens/field.pletFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.pletFields.uplc.golden create mode 100644 plutarch-test/goldens/field.rangeFields.bench.golden delete mode 100644 plutarch-test/goldens/field.rangeFields.rangeFields.bench.golden delete mode 100644 plutarch-test/goldens/field.rangeFields.rangeFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.rangeFields.rangeFields.uplc.golden create mode 100644 plutarch-test/goldens/field.rangeFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.rangeFields.uplc.golden create mode 100644 plutarch-test/goldens/field.trips.bench.golden delete mode 100644 plutarch-test/goldens/field.trips.getY.bench.golden delete mode 100644 plutarch-test/goldens/field.trips.getY.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.trips.getY.uplc.golden delete mode 100644 plutarch-test/goldens/field.trips.tripSum.bench.golden delete mode 100644 plutarch-test/goldens/field.trips.tripSum.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.trips.tripSum.uplc.golden delete mode 100644 plutarch-test/goldens/field.trips.tripYZ.bench.golden delete mode 100644 plutarch-test/goldens/field.trips.tripYZ.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.trips.tripYZ.uplc.golden create mode 100644 plutarch-test/goldens/field.trips.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.trips.uplc.golden create mode 100644 plutarch-test/goldens/lift.pconstantData.bench.golden create mode 100644 plutarch-test/goldens/lift.pconstantData.uplc.eval.golden create mode 100644 plutarch-test/goldens/lift.pconstantData.uplc.golden create mode 100644 plutarch-test/goldens/list.dev=false.bench.golden create mode 100644 plutarch-test/goldens/list.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/list.dev=true.bench.golden create mode 100644 plutarch-test/goldens/list.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/list.pconcat.identity.bench.golden delete mode 100644 plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pconcat.identity.uplc.golden delete mode 100644 plutarch-test/goldens/list.pfilter.bench.golden delete mode 100644 plutarch-test/goldens/list.pfilter.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pfilter.uplc.golden delete mode 100644 plutarch-test/goldens/list.pfoldl.bench.golden delete mode 100644 plutarch-test/goldens/list.pfoldl.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pfoldl.uplc.golden delete mode 100644 plutarch-test/goldens/list.phead.bench.golden delete mode 100644 plutarch-test/goldens/list.phead.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.phead.uplc.golden delete mode 100644 plutarch-test/goldens/list.pmap.bench.golden delete mode 100644 plutarch-test/goldens/list.pmap.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pmap.uplc.golden delete mode 100644 plutarch-test/goldens/list.pmatch.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pmatch.uplc.golden delete mode 100644 plutarch-test/goldens/list.pnull.bench.golden delete mode 100644 plutarch-test/goldens/list.pnull.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pnull.uplc.golden delete mode 100644 plutarch-test/goldens/list.ptail.bench.golden delete mode 100644 plutarch-test/goldens/list.ptail.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.ptail.uplc.golden delete mode 100644 plutarch-test/goldens/list.pzipWith.bench.golden delete mode 100644 plutarch-test/goldens/list.pzipWith.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.pzipWith.uplc.golden create mode 100644 plutarch-test/goldens/maybe.bench.golden create mode 100644 plutarch-test/goldens/maybe.uplc.eval.golden create mode 100644 plutarch-test/goldens/maybe.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.eval.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.eval.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/pair.bench.golden create mode 100644 plutarch-test/goldens/pair.uplc.eval.golden create mode 100644 plutarch-test/goldens/pair.uplc.golden create mode 100644 plutarch-test/goldens/pisdata.constr.bench.golden create mode 100644 plutarch-test/goldens/pisdata.constr.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.constr.uplc.golden create mode 100644 plutarch-test/goldens/pisdata.equality.bench.golden create mode 100644 plutarch-test/goldens/pisdata.equality.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.equality.uplc.golden create mode 100644 plutarch-test/goldens/pisdata.lt.bench.golden create mode 100644 plutarch-test/goldens/pisdata.lt.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.lt.uplc.golden create mode 100644 plutarch-test/goldens/pisdata.lte.bench.golden create mode 100644 plutarch-test/goldens/pisdata.lte.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.lte.uplc.golden create mode 100644 plutarch-test/goldens/pisdata.ppair.bench.golden create mode 100644 plutarch-test/goldens/pisdata.ppair.uplc.eval.golden create mode 100644 plutarch-test/goldens/pisdata.ppair.uplc.golden create mode 100644 plutarch-test/goldens/plam.bench.golden delete mode 100644 plutarch-test/goldens/plam.flip.const.uplc.eval.golden delete mode 100644 plutarch-test/goldens/plam.flip.const.uplc.golden delete mode 100644 plutarch-test/goldens/plam.id.uplc.eval.golden delete mode 100644 plutarch-test/goldens/plam.id.uplc.golden delete mode 100644 plutarch-test/goldens/plam.plet.uplc.eval.golden delete mode 100644 plutarch-test/goldens/plam.plet.uplc.golden create mode 100644 plutarch-test/goldens/plam.uplc.eval.golden create mode 100644 plutarch-test/goldens/plam.uplc.golden create mode 100644 plutarch-test/goldens/plutustype.deconstr.bench.golden create mode 100644 plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden create mode 100644 plutarch-test/goldens/plutustype.deconstr.uplc.golden create mode 100644 plutarch-test/goldens/plutustype.example.bench.golden create mode 100644 plutarch-test/goldens/plutustype.example.uplc.eval.golden create mode 100644 plutarch-test/goldens/plutustype.example.uplc.golden create mode 100644 plutarch-test/goldens/rational.bench.golden delete mode 100644 plutarch-test/goldens/rational.compare.bench.golden delete mode 100644 plutarch-test/goldens/rational.compare.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rational.compare.uplc.golden delete mode 100644 plutarch-test/goldens/rational.literal.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rational.literal.uplc.golden delete mode 100644 plutarch-test/goldens/rational.ops.bench.golden delete mode 100644 plutarch-test/goldens/rational.ops.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rational.ops.uplc.golden create mode 100644 plutarch-test/goldens/rational.uplc.eval.golden create mode 100644 plutarch-test/goldens/rational.uplc.golden create mode 100644 plutarch-test/goldens/rec.dev=false.bench.golden create mode 100644 plutarch-test/goldens/rec.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/rec.dev=true.bench.golden create mode 100644 plutarch-test/goldens/rec.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/recursion.example.bench.golden delete mode 100644 plutarch-test/goldens/recursion.example.iterateN.bench.golden delete mode 100644 plutarch-test/goldens/recursion.example.iterateN.uplc.eval.golden delete mode 100644 plutarch-test/goldens/recursion.example.iterateN.uplc.golden create mode 100644 plutarch-test/goldens/recursion.example.uplc.eval.golden create mode 100644 plutarch-test/goldens/recursion.example.uplc.golden delete mode 100644 plutarch-test/goldens/scripts.auth stake validator.uplc.golden delete mode 100644 plutarch-test/goldens/scripts.auth_policy.hash.golden delete mode 100644 plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden delete mode 100644 plutarch-test/goldens/scripts.auth_policy.uplc.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.hash.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden delete mode 100644 plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.hash.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden delete mode 100644 plutarch-test/goldens/scripts.auth_validator.uplc.golden create mode 100644 plutarch-test/goldens/scripts.bench.golden create mode 100644 plutarch-test/goldens/scripts.uplc.eval.golden create mode 100644 plutarch-test/goldens/scripts.uplc.golden create mode 100644 plutarch-test/goldens/show.bench.golden create mode 100644 plutarch-test/goldens/show.uplc.eval.golden create mode 100644 plutarch-test/goldens/show.uplc.golden create mode 100644 plutarch-test/goldens/str.bench.golden delete mode 100644 plutarch-test/goldens/str.eq.bench.golden delete mode 100644 plutarch-test/goldens/str.eq.uplc.eval.golden delete mode 100644 plutarch-test/goldens/str.eq.uplc.golden delete mode 100644 plutarch-test/goldens/str.semigroup.bench.golden delete mode 100644 plutarch-test/goldens/str.semigroup.uplc.eval.golden delete mode 100644 plutarch-test/goldens/str.semigroup.uplc.golden create mode 100644 plutarch-test/goldens/str.uplc.eval.golden create mode 100644 plutarch-test/goldens/str.uplc.golden create mode 100644 plutarch-test/goldens/trace.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptrace.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptrace.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptrace.uplc.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfFalse.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfTrue.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.golden create mode 100644 plutarch-test/goldens/trace.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/trace.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/trace.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptrace.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptrace.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptrace.uplc.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfFalse.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfTrue.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.golden create mode 100644 plutarch-test/goldens/trace.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/trace.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/unit.bench.golden delete mode 100644 plutarch-test/goldens/unit.compare.bench.golden delete mode 100644 plutarch-test/goldens/unit.compare.uplc.eval.golden delete mode 100644 plutarch-test/goldens/unit.compare.uplc.golden delete mode 100644 plutarch-test/goldens/unit.pcon.bench.golden delete mode 100644 plutarch-test/goldens/unit.pcon.uplc.eval.golden delete mode 100644 plutarch-test/goldens/unit.pcon.uplc.golden delete mode 100644 plutarch-test/goldens/unit.pmatch.bench.golden delete mode 100644 plutarch-test/goldens/unit.pmatch.uplc.eval.golden delete mode 100644 plutarch-test/goldens/unit.pmatch.uplc.golden create mode 100644 plutarch-test/goldens/unit.uplc.eval.golden create mode 100644 plutarch-test/goldens/unit.uplc.golden create mode 100644 plutarch-test/goldens/uplc-behaviour.bench.golden create mode 100644 plutarch-test/goldens/uplc-behaviour.uplc.eval.golden create mode 100644 plutarch-test/goldens/uplc-behaviour.uplc.golden create mode 100644 plutarch-test/goldens/uplc-misc.bench.golden create mode 100644 plutarch-test/goldens/uplc-misc.uplc.eval.golden create mode 100644 plutarch-test/goldens/uplc-misc.uplc.golden create mode 100644 plutarch-test/plutarch-base/BaseSpec.hs rename plutarch-test/{src => plutarch-base}/Plutarch/ApiSpec.hs (74%) create mode 100644 plutarch-test/plutarch-base/Plutarch/BoolSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/EitherSpec.hs rename plutarch-test/{src => plutarch-base}/Plutarch/IntegerSpec.hs (64%) create mode 100644 plutarch-test/plutarch-base/Plutarch/LiftSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/ListSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/PLamSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/POrdSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/PairSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/RationalSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/RecSpec.hs rename plutarch-test/{src => plutarch-base}/Plutarch/RecursionSpec.hs (64%) rename plutarch-test/{src => plutarch-base}/Plutarch/ScriptsSpec.hs (77%) create mode 100644 plutarch-test/plutarch-base/Plutarch/ShowSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/SpecTypes.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/StringSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/TraceSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs create mode 100644 plutarch-test/plutarch-base/Plutarch/UnitSpec.hs create mode 100644 plutarch-test/plutarch-extra/ExtraSpec.hs create mode 100644 plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs delete mode 100644 plutarch-test/src/Main.hs delete mode 100644 plutarch-test/src/Plutarch/BoolSpec.hs delete mode 100644 plutarch-test/src/Plutarch/ByteStringSpec.hs delete mode 100644 plutarch-test/src/Plutarch/ListSpec.hs delete mode 100644 plutarch-test/src/Plutarch/MonadicSpec.hs delete mode 100644 plutarch-test/src/Plutarch/PIsDataSpec.hs delete mode 100644 plutarch-test/src/Plutarch/PLamSpec.hs delete mode 100644 plutarch-test/src/Plutarch/PlutusTypeSpec.hs delete mode 100644 plutarch-test/src/Plutarch/RationalSpec.hs delete mode 100644 plutarch-test/src/Plutarch/StringSpec.hs delete mode 100644 plutarch-test/src/Plutarch/Test.hs delete mode 100644 plutarch-test/src/Plutarch/TraceSpec.hs delete mode 100644 plutarch-test/src/Plutarch/UnitSpec.hs diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..af4fe8b58 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +flake.lock linguist-generated=true diff --git a/.gitignore b/.gitignore index 6bd616d62..36f5659ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /result* /dist-newstyle .direnv -bench.csv \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f1e1e9d0..43a945d6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,29 @@ # Unreleased +- Added `PEq` superclass constraint to `POrd` + + Included by [#326](https://github.com/Plutonomicon/plutarch/pull/326) + +- Added module `Plutarch.Show` with the `PShow` type class, as well as functions `pshow` and `ptraceShowId`. + + Started by [#352](https://github.com/Plutonomicon/plutarch/pull/352) + +- Add `puncons` and `ptryUncons` functions for deconstructing list. + + Started by: [#333](https://github.com/Plutonomicon/plutarch/pull/333) + +- Add generic deriving for `PEq` + + Started by [#335](https://github.com/Plutonomicon/plutarch/pull/335) +- `Plutarch.Prelude` and `Plutarch.List` now export pfind, pelemAt, preverse and pcheckSroted. + + Started by: [#306](https://github.com/Plutonomicon/plutarch/pull/306) + +- Added module `Plutarch.FFI` for interoperability with PlutusTx. + +- Added `DerivePConstantViaBuiltin`, deprecating `DerivePConstantViaNewtype`. + - `TermCont`: Parametrize by result type; add `MonadFail` instance; etc. Also, export from `Plutarch.TermCont`, and then from `Plutarch.Prelude` (TermCont is no longer exported by `Plutarch.Internal`). @@ -41,7 +64,7 @@ - Added APIs for constructing, compiling, serialising & hashing Plutarch scripts. Type synonyms for Plutarch-typed scripts `PValidator`,`PMintingPolicy` & `PStakeValidator`. - + `mkValidator`, `mkStakeValidator` & `mkMintingPolicy` functions, for creating Plutus API compatible scripts. `validatorHash`, `mintingPolicySymbol` & `stakeValidatorHash` to obtain script hashes. @@ -71,6 +94,35 @@ Added by: [#235](https://github.com/Plutonomicon/plutarch/pull/270) +- Add `Plutarch.Test` for testing Plutarch code with goldens for UPLC printing and Plutus benchmarks. + +- Add Conversion types `PTryFrom`, `PMaybeFrom` and `PFrom` + + Module: `Plutarch.TryFrom` + + Added by: [#326](https://github.com/Plutonomicon/plutarch/pull/326) + +- `plutarch-extra`: Add a new directory scaffold "`plutarch-extra`" which will be home to everything too specific to not be in the + main Plutarch repo. Also refactored the test library. + + Directory: `plutarch-extra` + + Added by: [#329](https://github.com/Plutonomicon/plutarch/pull/329) + +- `plutarch-extra` export merged Prelude + + Module: `Plutarch.PPrelude` + + Added by: [#356](https://github.com/Plutonomicon/plutarch/pull/356) + +- Add `PConstant` instance for `Maybe`, with corresponding `PLift` instance for `PMaybeData`. + + Added by: [#371](https://github.com/Plutonomicon/plutarch/pull/371) + +- Add `POrd` and `PEq` derivation for data encoded types via `PIsDataReprInstances`. + + Added by: [#371](https://github.com/Plutonomicon/plutarch/pull/371) + # 1.1.0 - General repository changes. diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index 6c36d831a..000000000 --- a/CODEOWNERS +++ /dev/null @@ -1,15 +0,0 @@ -# CODEOWNERS file -# -# This file is used to describe who owns what in this repository. -# -# For documentation on this file, see https://help.github.com/articles/about-codeowners/ -# Mentioned users will get code review requests. -# -# IMPORTANT NOTE: in order to actually get pinged, commit access is required. -# This also holds true for GitHub teams. - -# This file -/.github/CODEOWNERS @MatthewCroughan - -# Any nix code -*.nix @MatthewCroughan @nixinator @DarthPJB diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index d6328108b..a9c49e30b 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -25,14 +25,12 @@ module Plutarch.Api.V1 ( type PStakeValidator, -- ** Value - Value.PValue (PValue), + Value.PValue, Value.PCurrencySymbol (PCurrencySymbol), Value.PTokenName (PTokenName), -- ** Crypto Crypto.PPubKeyHash (PPubKeyHash), - Crypto.PPubKey (PPubKey), - Crypto.PSignature (PSignature), -- ** DCert DCert.PDCert ( @@ -68,7 +66,7 @@ module Plutarch.Api.V1 ( Tx.PTxInInfo (PTxInInfo), -- ** AssocMap - AssocMap.PMap (PMap), + AssocMap.PMap, -- ** Others Maybe.PMaybeData (PDJust, PDNothing), @@ -98,7 +96,7 @@ import Data.Coerce (coerce) import qualified Plutus.V1.Ledger.Api as Plutus import qualified Plutus.V1.Ledger.Scripts as Plutus -import Plutarch (ClosedTerm, POpaque, compile) +import Plutarch (compile) import Plutarch.Api.Internal.Scripts (hashScriptWithPrefix) import Plutarch.Api.V1.Contexts (PScriptContext) import Plutarch.Prelude diff --git a/Plutarch/Api/V1/Address.hs b/Plutarch/Api/V1/Address.hs index 888270717..40412de7e 100644 --- a/Plutarch/Api/V1/Address.hs +++ b/Plutarch/Api/V1/Address.hs @@ -33,7 +33,7 @@ data PCredential (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq, POrd) via (PIsDataReprInstances PCredential) instance PUnsafeLiftDecl PCredential where type PLifted PCredential = Plutus.Credential @@ -55,7 +55,7 @@ data PStakingCredential (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq, POrd) via PIsDataReprInstances PStakingCredential instance PUnsafeLiftDecl PStakingCredential where type PLifted PStakingCredential = Plutus.StakingCredential @@ -75,7 +75,7 @@ newtype PAddress (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via PIsDataReprInstances PAddress instance PUnsafeLiftDecl PAddress where type PLifted PAddress = Plutus.Address diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index eeb3ff3ee..63f83505d 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -29,6 +29,7 @@ instance , Plutus.FromData (PLifted k) , PLift k , PLift v + , Ord (PLifted k) ) => PUnsafeLiftDecl (PMap k v) where @@ -36,15 +37,14 @@ instance instance ( PLifted (PConstanted k) ~ k + , PLifted (PConstanted v) ~ v , Plutus.ToData v , Plutus.FromData v , Plutus.ToData k , Plutus.FromData k - , PConstant k - , PLifted (PConstanted v) ~ v - , Plutus.FromData v - , Plutus.ToData v , PConstant v + , PConstant k + , Ord k ) => PConstant (PlutusMap.Map k v) where diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 7299b6ae3..8be0264eb 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -56,7 +56,7 @@ newtype PTxInfo (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq) via PIsDataReprInstances PTxInfo instance PUnsafeLiftDecl PTxInfo where type PLifted PTxInfo = Plutus.TxInfo @@ -76,7 +76,7 @@ newtype PScriptContext (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq) via PIsDataReprInstances PScriptContext instance PUnsafeLiftDecl PScriptContext where type PLifted PScriptContext = Plutus.ScriptContext @@ -93,7 +93,7 @@ data PScriptPurpose (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq) via (PIsDataReprInstances PScriptPurpose) instance PUnsafeLiftDecl PScriptPurpose where type PLifted PScriptPurpose = Plutus.ScriptPurpose diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index 920843f99..b80c7e370 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -3,16 +3,12 @@ module Plutarch.Api.V1.Crypto ( PPubKeyHash (PPubKeyHash), - PPubKey (PPubKey), - PSignature (PSignature), ) where import qualified Plutus.V1.Ledger.Api as Plutus -import qualified Plutus.V1.Ledger.Crypto as PlutusCrypto -import qualified PlutusTx.Builtins.Internal as PT import Plutarch.Lift ( - DerivePConstantViaNewtype (DerivePConstantViaNewtype), + DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), PLifted, PUnsafeLiftDecl, ) @@ -23,24 +19,6 @@ newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) instance PUnsafeLiftDecl PPubKeyHash where type PLifted PPubKeyHash = Plutus.PubKeyHash deriving via - (DerivePConstantViaNewtype Plutus.PubKeyHash PPubKeyHash PByteString) + (DerivePConstantViaBuiltin Plutus.PubKeyHash PPubKeyHash PByteString) instance (PConstant Plutus.PubKeyHash) - -newtype PPubKey (s :: S) = PPubKey (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PPubKey PByteString) - -instance PUnsafeLiftDecl PPubKey where type PLifted PPubKey = PlutusCrypto.PubKey -deriving via - (DerivePConstantViaNewtype PlutusCrypto.PubKey PPubKey PByteString) - instance - (PConstant PlutusCrypto.PubKey) - -newtype PSignature (s :: S) = PSignature (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PSignature PByteString) - -instance PUnsafeLiftDecl PSignature where type PLifted PSignature = PlutusCrypto.Signature -deriving via - (DerivePConstantViaNewtype PlutusCrypto.Signature PSignature PByteString) - instance - (PConstant PlutusCrypto.Signature) diff --git a/Plutarch/Api/V1/DCert.hs b/Plutarch/Api/V1/DCert.hs index 42994748c..9375a36a6 100644 --- a/Plutarch/Api/V1/DCert.hs +++ b/Plutarch/Api/V1/DCert.hs @@ -47,7 +47,7 @@ data PDCert (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq, POrd) via (PIsDataReprInstances PDCert) instance PUnsafeLiftDecl PDCert where type PLifted PDCert = Plutus.DCert diff --git a/Plutarch/Api/V1/Interval.hs b/Plutarch/Api/V1/Interval.hs index d4e0b3950..7eba3d261 100644 --- a/Plutarch/Api/V1/Interval.hs +++ b/Plutarch/Api/V1/Interval.hs @@ -30,7 +30,7 @@ newtype PInterval a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via PIsDataReprInstances (PInterval a) newtype PLowerBound a (s :: S) @@ -47,7 +47,7 @@ newtype PLowerBound a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via (PIsDataReprInstances (PLowerBound a)) newtype PUpperBound a (s :: S) @@ -64,7 +64,7 @@ newtype PUpperBound a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via (PIsDataReprInstances (PUpperBound a)) data PExtended a (s :: S) @@ -75,5 +75,5 @@ data PExtended a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq, POrd) via (PIsDataReprInstances (PExtended a)) diff --git a/Plutarch/Api/V1/Maybe.hs b/Plutarch/Api/V1/Maybe.hs index b8494911d..8c3f70e81 100644 --- a/Plutarch/Api/V1/Maybe.hs +++ b/Plutarch/Api/V1/Maybe.hs @@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V1.Maybe ( PMaybeData (PDJust, PDNothing), @@ -6,9 +7,21 @@ module Plutarch.Api.V1.Maybe ( import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) +import qualified PlutusTx -import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) +import Plutarch.Builtin (pasConstr, pforgetData) +import Plutarch.DataRepr.Internal ( + DerivePConstantViaData (DerivePConstantViaData), + PIsDataReprInstances (PIsDataReprInstances), + PIsDataReprRepr, + ) +import Plutarch.DataRepr.Internal.HList.Utils (IndexList) +import Plutarch.Lift ( + PConstant (PConstanted), + PUnsafeLiftDecl (..), + ) import Plutarch.Prelude +import Plutarch.Unsafe (punsafeCoerce) -- | Data encoded Maybe type. Used in various ledger api types. data PMaybeData a (s :: S) @@ -18,5 +31,65 @@ data PMaybeData a (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData) + (PlutusType, PIsData, PEq) via PIsDataReprInstances (PMaybeData a) + +instance + ( PConstanted (PLifted a) ~ a + , PlutusTx.FromData (PLifted a) + , PlutusTx.ToData (PLifted a) + ) => + PUnsafeLiftDecl (PMaybeData a) + where + type PLifted (PMaybeData a) = Maybe (PLifted a) + +deriving via + (DerivePConstantViaData (Maybe a) (PMaybeData (PConstanted a))) + instance + ( PlutusTx.FromData a + , PlutusTx.ToData a + , PLifted (PConstanted a) ~ a + ) => + PConstant (Maybe a) + +-- Have to manually write this instance because the constructor id ordering is screwed for 'Maybe'.... +instance (PIsData a, POrd a) => POrd (PMaybeData a) where + x #< y = _pmaybeLT False (#<) # x # y + x #<= y = _pmaybeLT True (#<=) # x # y + +_pmaybeLT :: + PIsData a => + Bool -> + ( forall s rec. + (rec ~ (IndexList 0 (PIsDataReprRepr (PMaybeData a)))) => + Term s (PDataRecord rec) -> + Term s (PDataRecord rec) -> + Term s PBool + ) -> + Term s (PMaybeData a :--> PMaybeData a :--> PBool) +_pmaybeLT whenBothNothing ltF = phoistAcyclic $ + plam $ \x y -> unTermCont $ do + a <- tcont . plet $ pasConstr #$ pforgetData $ pdata x + b <- tcont . plet $ pasConstr #$ pforgetData $ pdata y + + cid1 <- tcont . plet $ pfstBuiltin # a + cid2 <- tcont . plet $ pfstBuiltin # b + + pure $ + pif + (cid1 #< cid2) + (pconstant False) + $ pif + (cid1 #== cid2) + {- Some hand optimization here: usually, the fields would be 'plet'ed here if using 'POrd' derivation + machinery. However, in this case - there's no need for the fields for the 'Nothing' case. + + Would be nice if this could be done on the auto derivation case.... + -} + ( pif + (cid1 #== 0) + (ltF (punsafeCoerce $ psndBuiltin # a) (punsafeCoerce $ psndBuiltin # b)) + -- Both are 'Nothing'. Let caller choose answer. + $ pconstant whenBothNothing + ) + $ pconstant True diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index 2e02827f6..cda6d5aa7 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -12,10 +12,9 @@ module Plutarch.Api.V1.Scripts ( ) where import qualified Plutus.V1.Ledger.Api as Plutus -import qualified PlutusTx.Builtins.Internal as PT import Plutarch.Lift ( - DerivePConstantViaNewtype (DerivePConstantViaNewtype), + DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), PLifted, PUnsafeLiftDecl, ) @@ -25,26 +24,26 @@ newtype PDatum (s :: S) = PDatum (Term s PData) deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PDatum PData) instance PUnsafeLiftDecl PDatum where type PLifted PDatum = Plutus.Datum -deriving via (DerivePConstantViaNewtype Plutus.Datum PDatum PData) instance (PConstant Plutus.Datum) +deriving via (DerivePConstantViaBuiltin Plutus.Datum PDatum PData) instance (PConstant Plutus.Datum) newtype PRedeemer (s :: S) = PRedeemer (Term s PData) deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PRedeemer PData) instance PUnsafeLiftDecl PRedeemer where type PLifted PRedeemer = Plutus.Redeemer -deriving via (DerivePConstantViaNewtype Plutus.Redeemer PRedeemer PData) instance (PConstant Plutus.Redeemer) +deriving via (DerivePConstantViaBuiltin Plutus.Redeemer PRedeemer PData) instance (PConstant Plutus.Redeemer) newtype PDatumHash (s :: S) = PDatumHash (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PDatumHash PByteString) instance PUnsafeLiftDecl PDatumHash where type PLifted PDatumHash = Plutus.DatumHash -deriving via (DerivePConstantViaNewtype Plutus.DatumHash PDatumHash PByteString) instance (PConstant Plutus.DatumHash) +deriving via (DerivePConstantViaBuiltin Plutus.DatumHash PDatumHash PByteString) instance (PConstant Plutus.DatumHash) newtype PStakeValidatorHash (s :: S) = PStakeValidatorHash (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PStakeValidatorHash PByteString) instance PUnsafeLiftDecl PStakeValidatorHash where type PLifted PStakeValidatorHash = Plutus.StakeValidatorHash deriving via - (DerivePConstantViaNewtype Plutus.StakeValidatorHash PStakeValidatorHash PByteString) + (DerivePConstantViaBuiltin Plutus.StakeValidatorHash PStakeValidatorHash PByteString) instance (PConstant Plutus.StakeValidatorHash) @@ -53,7 +52,7 @@ newtype PRedeemerHash (s :: S) = PRedeemerHash (Term s PByteString) instance PUnsafeLiftDecl PRedeemerHash where type PLifted PRedeemerHash = Plutus.RedeemerHash deriving via - (DerivePConstantViaNewtype Plutus.RedeemerHash PRedeemerHash PByteString) + (DerivePConstantViaBuiltin Plutus.RedeemerHash PRedeemerHash PByteString) instance (PConstant Plutus.RedeemerHash) @@ -62,6 +61,6 @@ newtype PValidatorHash (s :: S) = PValidatorHash (Term s PByteString) instance PUnsafeLiftDecl PValidatorHash where type PLifted PValidatorHash = Plutus.ValidatorHash deriving via - (DerivePConstantViaNewtype Plutus.ValidatorHash PValidatorHash PByteString) + (DerivePConstantViaBuiltin Plutus.ValidatorHash PValidatorHash PByteString) instance (PConstant Plutus.ValidatorHash) diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index dcd9a52fd..dc49ca0d9 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -34,7 +34,7 @@ newtype PTxId (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via PIsDataReprInstances PTxId instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId @@ -54,7 +54,7 @@ newtype PTxOutRef (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq, POrd) via PIsDataReprInstances PTxOutRef instance PUnsafeLiftDecl PTxOutRef where type PLifted PTxOutRef = Plutus.TxOutRef @@ -74,7 +74,7 @@ newtype PTxInInfo (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq) via PIsDataReprInstances PTxInInfo instance PUnsafeLiftDecl PTxInInfo where type PLifted PTxInInfo = Plutus.TxInInfo @@ -95,7 +95,7 @@ newtype PTxOut (s :: S) deriving anyclass (Generic) deriving anyclass (PIsDataRepr) deriving - (PlutusType, PIsData, PDataFields) + (PlutusType, PIsData, PDataFields, PEq) via (PIsDataReprInstances PTxOut) instance PUnsafeLiftDecl PTxOut where type PLifted PTxOut = Plutus.TxOut diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 0b1655448..676aa1db5 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -8,14 +8,15 @@ module Plutarch.Api.V1.Value ( ) where import qualified Plutus.V1.Ledger.Api as Plutus -import qualified PlutusTx.Builtins.Internal as PT import Plutarch.Api.V1.AssocMap (PMap) import Plutarch.Lift ( + DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), PLifted, PUnsafeLiftDecl, ) + import Plutarch.Prelude newtype PTokenName (s :: S) = PTokenName (Term s PByteString) @@ -23,7 +24,7 @@ newtype PTokenName (s :: S) = PTokenName (Term s PByteString) instance PUnsafeLiftDecl PTokenName where type PLifted PTokenName = Plutus.TokenName deriving via - (DerivePConstantViaNewtype Plutus.TokenName PTokenName PByteString) + (DerivePConstantViaBuiltin Plutus.TokenName PTokenName PByteString) instance (PConstant Plutus.TokenName) @@ -32,7 +33,7 @@ newtype PCurrencySymbol (s :: S) = PCurrencySymbol (Term s PByteString) instance PUnsafeLiftDecl PCurrencySymbol where type PLifted PCurrencySymbol = Plutus.CurrencySymbol deriving via - (DerivePConstantViaNewtype Plutus.CurrencySymbol PCurrencySymbol PByteString) + (DerivePConstantViaBuiltin Plutus.CurrencySymbol PCurrencySymbol PByteString) instance (PConstant Plutus.CurrencySymbol) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index e5a493ca9..522d9fa3c 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE QuantifiedConstraints #-} +{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -17,6 +17,20 @@ module Plutarch.Bool ( por', ) where +import Data.List.NonEmpty (nonEmpty) +import Generics.SOP ( + All, + All2, + HCollapse (hcollapse), + K (K), + NP, + Proxy (Proxy), + SOP (SOP), + ccompare_NS, + hcliftA2, + ) +import Plutarch.Internal (plet, punsafeAsClosedTerm) +import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) import Plutarch.Internal.Other ( DerivePNewtype, PDelayed, @@ -31,6 +45,7 @@ import Plutarch.Internal.Other ( pmatch, pto, (#), + (#$), type (:-->), ) import Plutarch.Lift ( @@ -45,6 +60,7 @@ import qualified PlutusCore as PLC -- | Plutus 'BuiltinBool' data PBool (s :: S) = PTrue | PFalse + deriving stock (Show) instance PUnsafeLiftDecl PBool where type PLifted PBool = Bool deriving via (DerivePConstantDirect Bool PBool) instance (PConstant Bool) @@ -57,16 +73,29 @@ instance PlutusType PBool where class PEq t where (#==) :: Term s t -> Term s t -> Term s PBool + default (#==) :: + (PGeneric s t, PlutusType t, All2 PEq (PCode s t)) => + Term s t -> + Term s t -> + Term s PBool + a #== b = gpeq # a # b infix 4 #== -class POrd t where +class PEq t => POrd t where (#<=) :: Term s t -> Term s t -> Term s PBool (#<) :: Term s t -> Term s t -> Term s PBool infix 4 #<= infix 4 #< +instance PEq PBool where + x #== y' = plet y' $ \y -> pif' # x # y #$ pnot # y + +instance POrd PBool where + x #< y = pif' # x # pconstant False # y + x #<= y = pif' # x # y # pconstant True + instance PEq b => PEq (DerivePNewtype a b) where x #== y = pto x #== pto y @@ -88,7 +117,7 @@ pif b case_true case_false = pmatch b $ \case -- | Boolean negation for 'PBool' terms. pnot :: Term s (PBool :--> PBool) -pnot = phoistAcyclic $ plam $ \x -> pif x (pcon PFalse) $ pcon PTrue +pnot = phoistAcyclic $ plam $ \x -> pif' # x # pcon PFalse # pcon PTrue -- | Lazily evaluated boolean and for 'PBool' terms. infixr 3 #&& @@ -112,8 +141,43 @@ pand' = phoistAcyclic $ plam $ \x y -> pif' # x # y # (pcon PFalse) -- | Hoisted, Plutarch level, lazily evaluated boolean or function. por :: Term s (PBool :--> PDelayed PBool :--> PDelayed PBool) -por = phoistAcyclic $ plam $ \x y -> pif' # x # (phoistAcyclic $ pdelay $ pcon PTrue) # y +por = phoistAcyclic $ plam $ \x -> pif' # x # (phoistAcyclic $ pdelay $ pcon PTrue) -- | Hoisted, Plutarch level, strictly evaluated boolean or function. por' :: Term s (PBool :--> PBool :--> PBool) -por' = phoistAcyclic $ plam $ \x y -> pif' # x # (pcon PTrue) # y +por' = phoistAcyclic $ plam $ \x -> pif' # x # (pcon PTrue) + +-- | Like Haskell's `and` but for Plutarch terms +pands :: [Term s PBool] -> Term s PBool +pands ts' = + case nonEmpty ts' of + Nothing -> pcon PTrue + Just ts -> foldl1 (#&&) ts + +-- | Generic version of (#==) +gpeq :: + forall t s. + ( PGeneric s t + , PlutusType t + , All2 PEq (PCode s t) + ) => + Term s (t :--> t :--> PBool) +gpeq = + phoistAcyclic $ + punsafeAsClosedTerm @s $ + plam $ \x y -> + pmatch x $ \x' -> + pmatch y $ \y' -> + gpeq' (gpfrom x') (gpfrom y') + +gpeq' :: All2 PEq xss => SOP (Term s) xss -> SOP (Term s) xss -> Term s PBool +gpeq' (SOP c1) (SOP c2) = + ccompare_NS (Proxy @(All PEq)) (pcon PFalse) eqProd (pcon PFalse) c1 c2 + +eqProd :: All PEq xs => NP (Term s) xs -> NP (Term s) xs -> Term s PBool +eqProd p1 p2 = + pands $ hcollapse $ hcliftA2 (Proxy :: Proxy PEq) eqTerm p1 p2 + where + eqTerm :: forall s a. PEq a => Term s a -> Term s a -> K (Term s PBool) a + eqTerm a b = + K $ a #== b diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 59d07cfe8..0f4f9ff47 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -6,7 +6,7 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Builtin ( - PData (..), + PData, pfstBuiltin, psndBuiltin, pasConstr, @@ -23,10 +23,12 @@ module Plutarch.Builtin ( PAsData, pforgetData, ppairDataBuiltin, + pchooseListBuiltin, type PBuiltinMap, ) where -import Data.Coerce (Coercible) +import Data.Coerce (Coercible, coerce) +import Data.Proxy (Proxy (Proxy)) import Plutarch ( DerivePNewtype, PInner, @@ -63,7 +65,20 @@ import Plutarch.Lift ( pconstantFromRepr, pconstantToRepr, ) -import Plutarch.List (PListLike (..), plistEquals) +import Plutarch.List ( + PListLike ( + PElemConstraint, + pcons, + pelimList, + phead, + pnil, + pnull, + ptail + ), + plistEquals, + pshowList, + ) +import Plutarch.Show (PShow (pshow')) import Plutarch.Unit (PUnit) import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce, punsafeFrom) import qualified PlutusCore as PLC @@ -104,6 +119,9 @@ data PBuiltinList (a :: PType) (s :: S) = PCons (Term s a) (Term s (PBuiltinList a)) | PNil +instance (PShow a, PLift a) => PShow (PBuiltinList a) where + pshow' _ x = pshowList @PBuiltinList @a # x + pheadBuiltin :: Term s (PBuiltinList a :--> a) pheadBuiltin = phoistAcyclic $ pforce $ punsafeBuiltin PLC.HeadList @@ -154,12 +172,18 @@ instance PListLike PBuiltinList where instance (PLift a, PEq a) => PEq (PBuiltinList a) where (#==) xs ys = plistEquals # xs # ys -data PData s - = PDataConstr (Term s (PBuiltinPair PInteger (PBuiltinList PData))) - | PDataMap (Term s (PBuiltinList (PBuiltinPair PData PData))) - | PDataList (Term s (PBuiltinList PData)) - | PDataInteger (Term s PInteger) - | PDataByteString (Term s PByteString) +instance {-# OVERLAPPING #-} PIsData a => PEq (PBuiltinList (PAsData a)) where + xs #== ys = pdata xs #== pdata ys + +instance {-# OVERLAPPING #-} PEq (PBuiltinList PData) where + xs #== ys = pdata xs #== pdata ys + +data PData (s :: S) = PData (Term s PData) + +instance PlutusType PData where + type PInner PData _ = PData + pcon' (PData t) = t + pmatch' t f = f (PData t) instance PUnsafeLiftDecl PData where type PLifted PData = Data deriving via (DerivePConstantDirect Data PData) instance (PConstant Data) @@ -199,6 +223,7 @@ pdataLiteral = pconstant type role PAsData representational phantom data PAsData (a :: PType) (s :: S) +type role PAsDataLifted representational data PAsDataLifted (a :: PType) instance PConstant (PAsDataLifted a) where @@ -209,8 +234,18 @@ instance PConstant (PAsDataLifted a) where instance PUnsafeLiftDecl (PAsData a) where type PLifted (PAsData a) = PAsDataLifted a -pforgetData :: Term s (PAsData a) -> Term s PData -pforgetData = punsafeCoerce +newtype Helper1 (a :: PType) (s :: S) = Helper1 (a s) + +pforgetData :: forall s a. Term s (PAsData a) -> Term s PData +pforgetData x = coerce $ pforgetData' Proxy (coerce x :: Term s (Helper1 (PAsData a))) + +-- | Like 'pforgetData', except it works for complex types. +pforgetData' :: forall a (p :: PType -> PType) s. Proxy p -> Term s (p (PAsData a)) -> Term s (p PData) +pforgetData' Proxy = punsafeCoerce + +-- | Inverse of 'pforgetData''. +prememberData :: forall (p :: PType -> PType) s. Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) +prememberData Proxy = punsafeCoerce class PIsData a where pfromData :: Term s (PAsData a) -> Term s a @@ -224,6 +259,12 @@ instance PIsData a => PIsData (PBuiltinList (PAsData a)) where pfromData x = punsafeCoerce $ pasList # pforgetData x pdata x = punsafeBuiltin PLC.ListData # x +newtype Helper2 f a s = Helper2 (PAsData (f a) s) + +instance PIsData (PBuiltinList PData) where + pfromData = pforgetData' @PData (Proxy @PBuiltinList) . pfromData . coerce (prememberData (Proxy @(Helper2 PBuiltinList))) + pdata = coerce (pforgetData' @PData (Proxy @(Helper2 PBuiltinList))) . pdata . (prememberData (Proxy @PBuiltinList)) + instance PIsData (PBuiltinMap k v) where pfromData x = punsafeCoerce $ pasMap # pforgetData x pdata x = punsafeBuiltin PLC.MapData # x @@ -274,6 +315,32 @@ instance PIsData (PBuiltinPair (PAsData a) (PAsData b)) where f = phoistAcyclic $ plam $ \pair -> pconstrBuiltin # 0 #$ pcons # (pfstBuiltin # pair) #$ pcons # (psndBuiltin # pair) # pnil +newtype Helper3 f b a s = Helper3 (PAsData (f a b) s) + +newtype Helper4 f b a s = Helper4 (f a b s) + +instance PIsData (PBuiltinPair PData PData) where + pfromData = f . pfromData . g + where + g :: Term s (PAsData (PBuiltinPair PData PData)) -> Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData))) + g = + (coerce (prememberData (Proxy @(Helper3 PBuiltinPair (PAsData PData)))) :: Term s (PAsData (PBuiltinPair PData (PAsData PData))) -> Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData)))) + . coerce (prememberData (Proxy @(Helper2 (PBuiltinPair PData)))) + + f :: Term s (PBuiltinPair (PAsData PData) (PAsData PData)) -> Term s (PBuiltinPair PData PData) + f = + coerce (pforgetData' (Proxy @(Helper4 PBuiltinPair PData))) + . (pforgetData' @PData (Proxy @(PBuiltinPair (PAsData PData)))) + pdata = f . pdata . g + where + g :: Term s (PBuiltinPair PData PData) -> Term s (PBuiltinPair (PAsData PData) (PAsData PData)) + g = coerce (prememberData (Proxy @(Helper4 PBuiltinPair (PAsData PData)))) . prememberData (Proxy @(PBuiltinPair PData)) + + f :: Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData))) -> Term s (PAsData (PBuiltinPair PData PData)) + f = + (coerce (pforgetData' @PData (Proxy @(Helper3 PBuiltinPair PData))) :: Term s (PAsData (PBuiltinPair (PAsData PData) PData)) -> Term s (PAsData (PBuiltinPair PData PData))) + . coerce (pforgetData' @PData (Proxy @(Helper2 (PBuiltinPair (PAsData PData))))) + instance PIsData PUnit where pfromData _ = pconstant () pdata _ = punsafeCoerce $ pconstant (Constr 0 []) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 1d4fa9ef6..2a7893cac 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -21,11 +21,15 @@ module Plutarch.DataRepr.Internal ( pdropDataRecord, DerivePConstantViaData (..), pasDataSum, + pdToBuiltin, + DualReprHandler (..), ) where +import Data.Functor.Const (Const (Const)) import Data.Kind (Type) import Data.List (groupBy, maximumBy, sortOn) import Data.Proxy (Proxy (Proxy)) +import Data.SOP.NP (cana_NP) import GHC.TypeLits ( ErrorMessage (ShowType, Text, (:<>:)), KnownNat, @@ -38,26 +42,20 @@ import GHC.TypeLits ( import Generics.SOP ( All, All2, - AllZipN, Code, + Compose, Generic, - I (..), K (K), - LiftedCoercible, NP (Nil, (:*)), - NS (..), - POP, - SList (..), + NS (Z, S), + SList (SNil, SCons), SListI, SOP (SOP), - from, hcmap, hcollapse, - hfromI, hindex, lengthSList, sList, - to, ) import Plutarch ( Dig, @@ -72,13 +70,14 @@ import Plutarch ( phoistAcyclic, plam, plet, + pmatch, pmatch', pto, (#), (#$), type (:-->), ) -import Plutarch.Bool (pif, (#==)) +import Plutarch.Bool (PBool, PEq, POrd, pif, (#<), (#<=), (#==)) import Plutarch.Builtin ( PAsData, PBuiltinList, @@ -93,14 +92,13 @@ import Plutarch.Builtin ( pfstBuiltin, psndBuiltin, ) -import Plutarch.DataRepr.Internal.Generic (MkSum (mkSum)) import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) import Plutarch.Integer (PInteger) import Plutarch.Internal (S (SI)) -import Plutarch.Internal.TypeFamily (ToPType2) +import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) -import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont) +import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont, tcont, unTermCont) import Plutarch.Unsafe (punsafeCoerce) import qualified Plutus.V1.Ledger.Api as Ledger @@ -133,6 +131,46 @@ instance PlutusType (PDataRecord '[]) where pcon' PDNil = pnil pmatch' _ f = f PDNil +-- | This uses data equality. 'PEq' instances of elements don't make any difference. +instance PEq (PDataRecord xs) where + x #== y = pdToBuiltin x #== pdToBuiltin y + +-- Lexicographic ordering based 'Ord' instances for 'PDataRecord'. + +instance POrd (PDataRecord '[]) where + _ #<= _ = pconstant True + _ #< _ = pconstant False + +instance (POrd x, PIsData x) => POrd (PDataRecord '[label ':= x]) where + l1 #< l2 = unTermCont $ do + PDCons x _ <- tcont $ pmatch l1 + PDCons y _ <- tcont $ pmatch l2 + + pure $ pfromData x #< pfromData y + l1 #<= l2 = unTermCont $ do + PDCons x _ <- tcont $ pmatch l1 + PDCons y _ <- tcont $ pmatch l2 + + pure $ pfromData x #<= pfromData y + +instance (POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord ((label ':= x) ': x' ': xs)) where + l1 #< l2 = unTermCont $ do + PDCons x xs <- tcont $ pmatch l1 + PDCons y ys <- tcont $ pmatch l2 + + a <- tcont . plet $ pfromData x + b <- tcont . plet $ pfromData y + + pure $ pif (a #< b) (pconstant True) $ pif (a #== b) (xs #< ys) $ pconstant False + l1 #<= l2 = unTermCont $ do + PDCons x xs <- tcont $ pmatch l1 + PDCons y ys <- tcont $ pmatch l2 + + a <- tcont . plet $ pfromData x + b <- tcont . plet $ pfromData y + + pure $ pif (a #< b) (pconstant True) $ pif (a #== b) (xs #<= ys) $ pconstant False + {- | Cons a field to a data record. You can specify the label to associate with the field using type applications- @@ -151,14 +189,18 @@ pdcons = punsafeCoerce $ pcons @PBuiltinList @PData pdnil :: Term s (PDataRecord '[]) pdnil = punsafeCoerce $ pnil @PBuiltinList @PData +-- | Convert a 'PDataRecord' into a builtin list of data values, losing type information in the process. +pdToBuiltin :: Term s (PDataRecord xs) -> Term s (PBuiltinList PData) +pdToBuiltin = punsafeCoerce + data PLabeledType = Symbol := PType {- Get the product types of a data record sum constructor -} -type PDataRecordFields :: [Type] -> [PLabeledType] +type PDataRecordFields :: [PType] -> [PLabeledType] type family PDataRecordFields as where PDataRecordFields '[] = '[] - PDataRecordFields '[Term s (PDataRecord fs)] = fs + PDataRecordFields '[(PDataRecord fs)] = fs PDataRecordFields '[t] = TypeError ( 'Text "Expected PDataRecord" ':<>: 'Text "but got" ':<>: 'ShowType t) PDataRecordFields ts = TypeError ( 'Text "Expected none or PDataRecord" ':<>: 'Text "but got" ':<>: 'ShowType ts) @@ -166,18 +208,22 @@ type family PDataRecordFields as where NOTE: Unfortunately we can't write a generic FMap due to ghc's arity limitations. -} -type PDataRecordFields2 :: [[Type]] -> [[PLabeledType]] +type PDataRecordFields2 :: [[PType]] -> [[PLabeledType]] type family PDataRecordFields2 as where PDataRecordFields2 '[] = '[] PDataRecordFields2 (a ': as) = PDataRecordFields a ': PDataRecordFields2 as type family PLabelIndex (name :: Symbol) (as :: [PLabeledType]) :: Nat where PLabelIndex name ((name ':= a) ': as) = 0 - PLabelIndex name (_' : as) = (PLabelIndex name as) + 1 + PLabelIndex name (_ ': as) = (PLabelIndex name as) + 1 type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (name ':= a) = a +instance {-# OVERLAPPABLE #-} PIsData (PDataRecord xs) where + pfromData x = punsafeCoerce $ (pfromData (punsafeCoerce x) :: Term _ (PBuiltinList PData)) + pdata x = punsafeCoerce $ pdata (punsafeCoerce x :: Term _ (PBuiltinList PData)) + {- | A sum of 'PDataRecord's. The underlying representation is the `PDataConstr` constructor, where the integer is the index of the variant and the list is the record. @@ -239,6 +285,20 @@ instance PIsData (PDataSum defs) where pdata = punsafeCoerce pfromData = punsafeCoerce +instance PEq (PDataSum defs) where + x #== y = pdata x #== pdata y + +instance All (Compose POrd PDataRecord) defs => POrd (PDataSum defs) where + x' #< y' = f # x' # y' + where + f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLTHandler + x' #<= y' = f # x' # y' + where + f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLTEHandler + +pasDataSum :: PIsDataRepr a => Term s a -> Term s (PDataSum (PIsDataReprRepr a)) +pasDataSum = punsafeCoerce + -- | If there is only a single variant, then we can safely extract it. punDataSum :: Term s (PDataSum '[def] :--> PDataRecord def) punDataSum = phoistAcyclic $ @@ -282,131 +342,188 @@ pmatchDataSum d handlers = plet (psndBuiltin # d') $ \args -> let handlers' = applyHandlers args handlers in runTermCont (findCommon handlers') $ \common -> - go + reprHandlersGo common 0 handlers' constr where - hashHandlers :: [Term s out] -> TermCont s [(Dig, Term s out)] - hashHandlers [] = pure [] - hashHandlers (handler : rest) = do - hash <- hashOpenTerm handler - hashes <- hashHandlers rest - pure $ (hash, handler) : hashes - - findCommon :: [Term s out] -> TermCont s (Dig, Term s out) - findCommon handlers = do - l <- hashHandlers handlers - pure $ head . maximumBy (\x y -> length x `compare` length y) . groupBy (\x y -> fst x == fst y) . sortOn fst $ l - applyHandlers :: Term s (PBuiltinList PData) -> DataReprHandlers out defs s -> [Term s out] applyHandlers _ DRHNil = [] applyHandlers args (DRHCons handler rest) = handler (punsafeCoerce args) : applyHandlers args rest - go :: - (Dig, Term s out) -> - Integer -> - [Term s out] -> - Term s PInteger -> - Term s out - go common _ [] _ = snd common - go common idx (handler : rest) constr = - runTermCont (hashOpenTerm handler) $ \hhash -> - if hhash == fst common - then go common (idx + 1) rest constr - else - pif - (fromInteger idx #== constr) - handler - $ go common (idx + 1) rest constr - -{- | Use this for implementing the necessary instances for getting the `Data` representation. - You must implement 'PIsDataRepr' to use this. --} -newtype PIsDataReprInstances (a :: PType) (s :: S) = PIsDataReprInstances (a s) - -- TODO: This 'PMatch' constraint needs to be changed to 'PlutusType (breaking change). class (PMatch a, PIsData a) => PIsDataRepr (a :: PType) where type PIsDataReprRepr a :: [[PLabeledType]] - type PIsDataReprRepr a = PDataRecordFields2 (Code (a 'SI)) + type PIsDataReprRepr a = PDataRecordFields2 (PCode 'SI a) pconRepr :: a s -> Term s (PDataSum (PIsDataReprRepr a)) default pconRepr :: forall s code pcode. - ( Generic (a s) + ( PGeneric s a , code ~ Code (a s) - , pcode ~ ToPType2 code + , pcode ~ PCode s a , All SListI pcode , All Singleton code , All2 IsBuiltinList pcode - , AllZipN POP (LiftedCoercible I (Term s)) code pcode ) => a s -> Term s (PDataSum (PIsDataReprRepr a)) pconRepr x = punsafeCoerce expected where expected :: Term _ (PAsData (PBuiltinPair PInteger (PBuiltinList PData))) - expected = gpconRepr @a $ from x + expected = gpconRepr @a $ gpfrom x pmatchRepr :: forall s b. Term s (PDataSum (PIsDataReprRepr a)) -> (a s -> Term s b) -> Term s b default pmatchRepr :: - forall s b code. + forall s b code pcode. ( code ~ Code (a s) - , PDataRecordFields2 code ~ PIsDataReprRepr a - , MkDataReprHandler s a 0 code + , pcode ~ PCode s a + , PDataRecordFields2 pcode ~ PIsDataReprRepr a + , MkDataReprHandler s a 0 pcode ) => Term s (PDataSum (PIsDataReprRepr a)) -> (a s -> Term s b) -> Term s b pmatchRepr dat = - pmatchDataSum dat . mkDataReprHandler @s @a @0 @code + pmatchDataSum dat . mkDataReprHandler @s @a @0 @pcode gpconRepr :: forall a s code pcode. ( Generic (a s) , code ~ Code (a s) - , pcode ~ ToPType2 code + , pcode ~ PCode s a , All SListI pcode , All Singleton code , All2 IsBuiltinList pcode - , AllZipN POP (LiftedCoercible I (Term s)) code pcode ) => - SOP I (Code (a s)) -> + SOP (Term s) pcode -> Term s (PAsData (PBuiltinPair PInteger (PBuiltinList PData))) gpconRepr x = pconstrBuiltin # pconstant (toInteger $ hindex sop) # head (hcollapse sop) where sop :: SOP (K (Term s (PBuiltinList PData))) pcode - sop = hcmap (Proxy @IsBuiltinList) (K . dataListFrom) $ hfromI x + sop = hcmap (Proxy @IsBuiltinList) (K . dataListFrom) x -- | Create a `DataReprhandlers` starting from `n`th sum constructor -class MkDataReprHandler (s :: S) (a :: PType) (n :: Nat) (rest :: [[Type]]) where +class MkDataReprHandler (s :: S) (a :: PType) (n :: Nat) (rest :: [[PType]]) where mkDataReprHandler :: forall out. (a s -> Term s out) -> DataReprHandlers out (PDataRecordFields2 rest) s instance MkDataReprHandler s a n '[] where mkDataReprHandler _ = DRHNil instance - ( Generic (a s) + ( PGeneric s a , code ~ Code (a s) - , r ~ IndexList n code - , r ~ '[Term s (PDataRecord fs)] - , MkSum n code + , pcode ~ PCode s a + , r ~ IndexList n pcode + , r ~ '[(PDataRecord fs)] + , MkSum n pcode (Term s) , MkDataReprHandler s a (n + 1) rs ) => MkDataReprHandler s a n (r ': rs) where mkDataReprHandler f = - DRHCons (f . to . mkSOP . mkProduct) $ + DRHCons (f . gpto . mkSOP . mkProduct) $ mkDataReprHandler @s @a @(n + 1) @rs f where - mkProduct :: Term s (PDataRecord fs) -> NP I r - mkProduct x = I x :* Nil - mkSOP :: NP I r -> SOP I (Code (a s)) - mkSOP = SOP . mkSum @n @code + mkProduct :: Term s (PDataRecord fs) -> NP (Term s) r + mkProduct x = x :* Nil + mkSOP :: NP (Term s) r -> SOP (Term s) (PCode s a) + mkSOP = SOP . mkSum @_ @n @pcode + +newtype DualReprHandler s out def = LTRepr (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s out) + +-- | Optimized dual pmatch specialized for lexicographic '#<' and '#<=' implementations. +pmatchLT :: Term s (PDataSum defs) -> Term s (PDataSum defs) -> NP (DualReprHandler s PBool) defs -> Term s PBool +pmatchLT d1 d2 (LTRepr handler :* Nil) = handler (punDataSum # d1) (punDataSum # d2) +pmatchLT d1 d2 handlers = unTermCont $ do + a <- tcont . plet $ pasConstr #$ pforgetData $ pdata d1 + b <- tcont . plet $ pasConstr #$ pforgetData $ pdata d2 + + cid1 <- tcont . plet $ pfstBuiltin # a + cid2 <- tcont . plet $ pfstBuiltin # b + + pure $ + pif + (cid1 #< cid2) + -- Left arg's constructor id is less, no need to continue. + (pconstant True) + $ pif + (cid1 #== cid2) + -- Matching constructors, compare fields now. + ( unTermCont $ do + flds1 <- tcont . plet $ psndBuiltin # a + flds2 <- tcont . plet $ psndBuiltin # b + let handlers' = applyHandlers flds1 flds2 handlers + common <- findCommon handlers' + pure $ reprHandlersGo common 0 (applyHandlers flds1 flds2 handlers) cid1 + ) + -- Left arg's constructor id is greater, no need to continue. + $ pconstant False + where + applyHandlers :: + Term s (PBuiltinList PData) -> + Term s (PBuiltinList PData) -> + NP (DualReprHandler s PBool) defs -> + [Term s PBool] + applyHandlers _ _ Nil = [] + applyHandlers args1 args2 (LTRepr handler :* rest) = + handler (punsafeCoerce args1) (punsafeCoerce args2) : + applyHandlers args1 args2 rest + +reprHandlersGo :: + (Dig, Term s out) -> + Integer -> + [Term s out] -> + Term s PInteger -> + Term s out +reprHandlersGo common _ [] _ = snd common +reprHandlersGo common idx (handler : rest) c = + runTermCont (hashOpenTerm handler) $ \hhash -> + if hhash == fst common + then reprHandlersGo common (idx + 1) rest c + else + pif + (fromInteger idx #== c) + handler + $ reprHandlersGo common (idx + 1) rest c + +hashHandlers :: [Term s out] -> TermCont s [(Dig, Term s out)] +hashHandlers [] = pure [] +hashHandlers (handler : rest) = do + hash <- hashOpenTerm handler + hashes <- hashHandlers rest + pure $ (hash, handler) : hashes + +findCommon :: [Term s out] -> TermCont s (Dig, Term s out) +findCommon handlers = do + l <- hashHandlers handlers + pure $ head . maximumBy (\x y -> length x `compare` length y) . groupBy (\x y -> fst x == fst y) . sortOn fst $ l + +mkLTHandler :: forall def s. All (Compose POrd PDataRecord) def => NP (DualReprHandler s PBool) def +mkLTHandler = cana_NP (Proxy @(Compose POrd PDataRecord)) rer $ Const () + where + rer :: + forall (y :: [PLabeledType]) (ys :: [[PLabeledType]]). + Compose POrd PDataRecord y => + Const () (y : ys) -> + (DualReprHandler s PBool y, Const () ys) + rer _ = (LTRepr (#<), Const ()) + +mkLTEHandler :: forall def s. All (Compose POrd PDataRecord) def => NP (DualReprHandler s PBool) def +mkLTEHandler = cana_NP (Proxy @(Compose POrd PDataRecord)) rer $ Const () + where + rer :: + forall (y :: [PLabeledType]) (ys :: [[PLabeledType]]). + Compose POrd PDataRecord y => + Const () (y : ys) -> + (DualReprHandler s PBool y, Const () ys) + rer _ = (LTRepr (#<=), Const ()) -pasDataSum :: PIsDataRepr a => Term s a -> Term s (PDataSum (PIsDataReprRepr a)) -pasDataSum = punsafeCoerce +{- | Use this for implementing the necessary instances for getting the `Data` representation. + You must implement 'PIsDataRepr' to use this. +-} +newtype PIsDataReprInstances (a :: PType) (s :: S) = PIsDataReprInstances (a s) instance PIsDataRepr a => PIsData (PIsDataReprInstances a) where pdata = punsafeCoerce @@ -417,6 +534,15 @@ instance PIsDataRepr a => PlutusType (PIsDataReprInstances a) where pcon' (PIsDataReprInstances x) = pconRepr x pmatch' x f = pmatchRepr x (f . PIsDataReprInstances) +-- | This uses data equality. 'PEq' instances of elements don't make any difference. +instance PIsDataRepr a => PEq (PIsDataReprInstances a) where + x #== y = pdata x #== pdata y + +-- | This uses lexicographic ordering. Actually uses PDataSum '(#<)' implementation. +instance (PIsDataRepr a, All (Compose POrd PDataRecord) (PIsDataReprRepr a)) => POrd (PIsDataReprInstances a) where + x #< y = pto x #< pto y + x #<= y = pto x #<= pto y + newtype DerivePConstantViaData (h :: Type) (p :: PType) = DerivePConstantViaData h instance (PIsDataRepr p, PLift p, Ledger.FromData h, Ledger.ToData h) => PConstant (DerivePConstantViaData h p) where diff --git a/Plutarch/DataRepr/Internal/Generic.hs b/Plutarch/DataRepr/Internal/Generic.hs deleted file mode 100644 index 2810c8829..000000000 --- a/Plutarch/DataRepr/Internal/Generic.hs +++ /dev/null @@ -1,36 +0,0 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE UndecidableInstances #-} - --- | Common generics-sop utilities for use in Plutarch. -module Plutarch.DataRepr.Internal.Generic ( - MkSum (..), -) where - -import Data.Kind (Type) -import GHC.TypeLits (Nat, type (-)) -import Generics.SOP (I, NP, NS (S, Z)) -import Plutarch.DataRepr.Internal.HList.Utils (IndexList) - -{- | -Infrastructure to create a single sum constructor given its type index and value. - -- `mkSum @0 @(Code a) x` creates the first sum constructor; -- `mkSum @1 @(Code a) x` creates the second sum constructor; -- etc. - -It is type-checked that the `x` here matches the type of nth constructor of `a`. --} -class MkSum (idx :: Nat) (xss :: [[Type]]) where - mkSum :: NP I (IndexList idx xss) -> NS (NP I) xss - -instance {-# OVERLAPPING #-} MkSum 0 (xs ': xss) where - mkSum = Z - -instance - {-# OVERLAPPABLE #-} - ( MkSum (idx - 1) xss - , IndexList idx (xs ': xss) ~ IndexList (idx - 1) xss - ) => - MkSum idx (xs ': xss) - where - mkSum x = S $ mkSum @(idx - 1) @xss x diff --git a/Plutarch/DataRepr/Internal/HList.hs b/Plutarch/DataRepr/Internal/HList.hs index c7d3c9f19..d32dd1647 100644 --- a/Plutarch/DataRepr/Internal/HList.hs +++ b/Plutarch/DataRepr/Internal/HList.hs @@ -5,10 +5,12 @@ module Plutarch.DataRepr.Internal.HList ( -- * HRec and Label types HRec (HNil, HCons), + HRecGeneric (HRecGeneric), Labeled (Labeled, unLabeled), -- * Field indexing functions hrecField, + hrecField', -- * Type families type IndexList, @@ -135,3 +137,16 @@ instance HasField name (HRec as) (Term s c) where getField = hrecField @name + +-- Generic HRec + +newtype HRecGeneric as = HRecGeneric (HRec as) + +instance + forall name a as. + ( (IndexLabel name as ~ a) + , ElemOf name a as + ) => + HasField name (HRecGeneric as) a + where + getField (HRecGeneric x) = hrecField' @name x diff --git a/Plutarch/Either.hs b/Plutarch/Either.hs index b8001c71b..d7cb4ffc8 100644 --- a/Plutarch/Either.hs +++ b/Plutarch/Either.hs @@ -1,11 +1,13 @@ module Plutarch.Either (PEither (..)) where import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +import Generics.SOP (Generic, HasDatatypeInfo, I (I)) import Plutarch (PType, PlutusType, S, Term) +import Plutarch.Bool (PEq) +import Plutarch.Show (PShow) data PEither (a :: PType) (b :: PType) (s :: S) = PLeft (Term s a) | PRight (Term s b) deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) diff --git a/Plutarch/Evaluate.hs b/Plutarch/Evaluate.hs index e9eab2530..16086f962 100644 --- a/Plutarch/Evaluate.hs +++ b/Plutarch/Evaluate.hs @@ -1,74 +1,59 @@ {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} -module Plutarch.Evaluate (evaluateBudgetedScript, evaluateScript) where +module Plutarch.Evaluate (evaluateBudgetedScript, evaluateScript, evalScript, evalScript', EvalError) where -import Control.Monad.Except (runExceptT) import Data.Text (Text) import Plutus.V1.Ledger.Scripts (Script (Script)) import qualified Plutus.V1.Ledger.Scripts as Scripts -import PlutusCore (FreeVariableError, defaultVersion) import qualified PlutusCore as PLC import PlutusCore.Evaluation.Machine.ExBudget ( ExBudget (ExBudget), ExRestrictingBudget (ExRestrictingBudget), minusExBudget, ) -import qualified PlutusCore.Evaluation.Machine.ExMemory as ExMemory +import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) import UntypedPlutusCore ( Program (Program), Term, - termMapNames, - unNameDeBruijn, ) -import UntypedPlutusCore.DeBruijn (deBruijnTerm) -import qualified UntypedPlutusCore.Evaluation.Machine.Cek as UPLC +import qualified UntypedPlutusCore as UPLC +import qualified UntypedPlutusCore.Evaluation.Machine.Cek as Cek --- Stolen from pluto, thanks Morgan - -{- | Evaluate a script, returning the trace log and term result. - - This is same as `Plutus.V1.Ledger.Scripts.evaluateScript`, but returns the - result as well. --} +{-# DEPRECATED evaluateScript "use evalScript" #-} evaluateScript :: Script -> Either Scripts.ScriptError (ExBudget, [Text], Script) -evaluateScript = evaluateBudgetedScript $ ExBudget (ExMemory.ExCPU maxInt) (ExMemory.ExMemory maxInt) +evaluateScript = evaluateBudgetedScript $ ExBudget (ExCPU maxInt) (ExMemory maxInt) where maxInt = fromIntegral (maxBound :: Int) +{-# DEPRECATED evaluateBudgetedScript "use evalScript'" #-} evaluateBudgetedScript :: ExBudget -> Script -> Either Scripts.ScriptError (ExBudget, [Text], Script) -evaluateBudgetedScript totalBudget s = do - p <- case Scripts.mkTermToEvaluate s of - Right p -> pure p - Left e -> Left . Scripts.MalformedScript $ show e - let (logOut, usedBudget, result) = evaluateCekBudgetedTrace totalBudget p - named <- case result of - Right term -> pure term - Left errWithCause@(UPLC.ErrorWithCause err cause) -> - Left $ case err of - UPLC.InternalEvaluationError internalEvalError -> - Scripts.EvaluationException (show errWithCause) (show internalEvalError) - UPLC.UserEvaluationError evalError -> - -- We use `show` here because plutus doesn't expose mkError - Scripts.EvaluationError logOut (show (evalError, cause)) - term' <- runExceptT @FreeVariableError (deBruijnTerm named) - let Right term = term' - let s' = Script $ Program () (defaultVersion ()) $ termMapNames unNameDeBruijn term - pure (usedBudget, logOut, s') +evaluateBudgetedScript budget script = case evalScript' budget script of + (Right res, remaining, logs) -> Right (remaining, logs, res) + (Left _, _, logs) -> Left $ Scripts.EvaluationError logs "evaluation failed" + +type EvalError = (Cek.CekEvaluationException PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun) + +-- | Evaluate a script with a big budget, returning the trace log and term result. +evalScript :: Script -> (Either EvalError Script, ExBudget, [Text]) +evalScript script = evalScript' budget script + where + -- from https://github.com/input-output-hk/cardano-node/blob/master/configuration/cardano/mainnet-alonzo-genesis.json#L17 + budget = ExBudget (ExCPU 10000000000) (ExMemory 10000000) + +-- | Evaluate a script with a specific budget, returning the trace log and term result. +evalScript' :: ExBudget -> Script -> (Either (Cek.CekEvaluationException PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun) Script, ExBudget, [Text]) +evalScript' budget (Script (Program _ _ t)) = case evalTerm budget (UPLC.termMapNames UPLC.fakeNameDeBruijn $ t) of + (res, remaining, logs) -> (Script . Program () (PLC.defaultVersion ()) . UPLC.termMapNames UPLC.unNameDeBruijn <$> res, remaining, logs) -{- | Evaluate a program in the CEK machine against the given budget, with the - usual text dynamic builtins and tracing, additionally returning the trace - output. --} -evaluateCekBudgetedTrace :: - -- | The resource budget which must not be exceeded during evaluation +evalTerm :: ExBudget -> - Program PLC.Name PLC.DefaultUni PLC.DefaultFun () -> - ( [Text] + Term PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun () -> + ( Either + EvalError + (Term PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun ()) , ExBudget - , Either - (UPLC.CekEvaluationException PLC.DefaultUni PLC.DefaultFun) - (Term PLC.Name PLC.DefaultUni PLC.DefaultFun ()) + , [Text] ) -evaluateCekBudgetedTrace budget (Program _ _ t) = - case UPLC.runCek PLC.defaultCekParameters (UPLC.restricting (ExRestrictingBudget budget)) UPLC.logEmitter t of - (errOrRes, UPLC.RestrictingSt (ExRestrictingBudget final), logs) -> (logs, budget `minusExBudget` final, errOrRes) +evalTerm budget t = + case Cek.runCekDeBruijn PLC.defaultCekParameters (Cek.restricting (ExRestrictingBudget budget)) Cek.logEmitter t of + (errOrRes, Cek.RestrictingSt (ExRestrictingBudget final), logs) -> (errOrRes, budget `minusExBudget` final, logs) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs new file mode 100644 index 000000000..3a810edbd --- /dev/null +++ b/Plutarch/FFI.hs @@ -0,0 +1,284 @@ +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.FFI ( + type (>~<), + PTxList (PTxCons, PTxNil), + PTxMaybe (PTxJust, PTxNothing), + foreignExport, + foreignImport, + opaqueExport, + opaqueImport, + plistFromTx, + plistToTx, + pmaybeFromTx, + pmaybeToTx, + unsafeForeignExport, + unsafeForeignImport, +) where + +import Data.ByteString (ByteString) +import Data.Kind (Constraint, Type) +import Data.Text (Text) +import Data.Void (Void) +import GHC.Generics (Generic) +import GHC.TypeLits (TypeError) +import qualified GHC.TypeLits as TypeLits +import qualified Generics.SOP as SOP +import Generics.SOP.GGP (GCode, GDatatypeInfoOf) +import Generics.SOP.Type.Metadata ( + ConstructorInfo (Constructor, Infix, Record), + ConstructorName, + DatatypeInfo (ADT, Newtype), + ) +import Plutarch ( + ClosedTerm, + PDelayed, + POpaque, + PType, + S, + pcon, + pdelay, + pforce, + phoistAcyclic, + plam, + pmatch, + pto, + (#), + (:-->), + ) +import Plutarch.Bool (PBool, PEq, (#==)) +import Plutarch.Builtin (PAsData, PData) +import Plutarch.ByteString (PByteString) +import Plutarch.Integer (PInteger) +import Plutarch.Internal ( + RawTerm (RCompiled), + Term (Term), + TermResult (TermResult), + asClosedRawTerm, + compile', + ) +import Plutarch.Internal.PlutusType (PlutusType (PInner, pcon', pmatch')) +import Plutarch.List (PList, PListLike (PElemConstraint, pcons, pelimList, pnil), pconvertLists, plistEquals) +import Plutarch.Maybe (PMaybe (PJust, PNothing)) +import Plutarch.Show (PShow) +import Plutarch.String (PString) +import Plutarch.Unit (PUnit) +import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) +import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinByteString, BuiltinData, BuiltinUnit) +import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) +import PlutusTx.Prelude (BuiltinString) +import UntypedPlutusCore (fakeNameDeBruijn) +import qualified UntypedPlutusCore as UPLC + +data ForallPhantom :: Type +data PhorallPhantom :: PType + +data Delayed :: Type -> Type +data DelayedList :: Type -> Type + +{- | Plutarch type of lists compatible with the PlutusTx encoding of Haskell + lists and convertible with the regular 'PList' using 'plistToTx' and + 'plistFromTx'. +-} +data PTxList (a :: PType) (s :: S) + = PTxCons (Term s a) (Term s (PTxList a)) + | PTxNil + deriving stock (Generic) + deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo, PShow) + +{- | Plutarch type compatible with the PlutusTx encoding of Haskell 'Maybe' and + convertible with the regular 'PMaybe' using 'pmaybeToTx' and 'pmaybeFromTx'. +-} +data PTxMaybe (a :: PType) (s :: S) + = PTxJust (Term s a) + | PTxNothing + deriving stock (Generic) + deriving anyclass (SOP.Generic, SOP.HasDatatypeInfo, PEq, PShow) + +instance PEq a => PEq (PTxList a) where + (#==) xs ys = plistEquals # xs # ys + +-- | Compile and export a Plutarch term so it can be used by `PlutusTx.applyCode`. +foreignExport :: p >~< t => ClosedTerm p -> CompiledCode t +foreignExport = unsafeForeignExport + +-- | Import compiled UPLC code (such as a spliced `PlutusTx.compile` result) as a Plutarch term. +foreignImport :: p >~< t => CompiledCode t -> ClosedTerm p +foreignImport = unsafeForeignImport + +-- | Export Plutarch term of any type as @CompiledCode Void@. +opaqueExport :: ClosedTerm p -> CompiledCode Void +opaqueExport = unsafeForeignExport + +-- | Import compiled UPLC code of any type as a Plutarch opaque term. +opaqueImport :: CompiledCode t -> ClosedTerm POpaque +opaqueImport = unsafeForeignImport + +-- | Seriously unsafe, may fail at run time or result in unexpected behaviour in your on-chain validator. +unsafeForeignExport :: ClosedTerm p -> CompiledCode t +unsafeForeignExport t = DeserializedCode program Nothing mempty + where + program = + UPLC.Program () (UPLC.Version () 1 0 0) $ + UPLC.termMapNames fakeNameDeBruijn $ + compile' $ + asClosedRawTerm t + +-- | Seriously unsafe, may fail at run time or result in unexpected behaviour in your on-chain validator. +unsafeForeignImport :: CompiledCode t -> ClosedTerm p +unsafeForeignImport c = Term $ const $ TermResult (RCompiled $ UPLC._progTerm $ unScript $ fromCompiledCode c) [] + +-- | Convert a 'PList' to a 'PTxList', perhaps before exporting it with 'foreignExport'. +plistToTx :: Term s (PList a :--> PTxList a) +plistToTx = pconvertLists + +-- | Convert a 'PTxList' to a 'PList', probably after importing it with 'foreignImport'. +plistFromTx :: Term s (PTxList a :--> PList a) +plistFromTx = pconvertLists + +-- | Convert a 'PMaybe' to a 'PTxMaybe', perhaps before exporting it with 'foreignExport'. +pmaybeToTx :: Term s (PMaybe a :--> PTxMaybe a) +pmaybeToTx = + plam $ + flip pmatch $ + pcon . \case + PNothing -> PTxNothing + PJust x -> PTxJust x + +-- | Convert a 'PTxMaybe' to a 'PMaybe', probably after importing it with 'foreignImport'. +pmaybeFromTx :: Term s (PTxMaybe a :--> PMaybe a) +pmaybeFromTx = + plam $ + flip pmatch $ + pcon . \case + PTxNothing -> PNothing + PTxJust x -> PJust x + +instance PlutusType (PTxList a) where + type PInner (PTxList a) r = PDelayed (r :--> (a :--> PTxList a :--> r) :--> r) + pcon' (PTxCons x xs) = pdelay $ plam $ \_nil cons -> cons # x # xs + pcon' PTxNil = phoistAcyclic $ pdelay $ plam $ \nil _cons -> nil + pmatch' elim f = pforce elim # f PTxNil # (plam $ \x xs -> f $ PTxCons x xs) + +instance PListLike PTxList where + type PElemConstraint PTxList _ = () + pelimList cons nil list = pforce (pto list) # nil # plam cons + pcons = phoistAcyclic $ plam $ \x xs -> pcon (PTxCons x xs) + pnil = pcon PTxNil + +instance PlutusType (PTxMaybe a) where + type PInner (PTxMaybe a) r = PDelayed ((a :--> r) :--> r :--> r) + pcon' (PTxJust x) = pdelay $ plam $ \just _nothing -> just # x + pcon' PTxNothing = phoistAcyclic $ pdelay $ plam $ \_just nothing -> nothing + pmatch' elim f = pforce elim # (plam $ f . PTxJust) # f PTxNothing + +-- | Equality of inner types - Plutarch on the left and Haskell on the right. +type p >~< t = PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom + +type family a ~~ b :: Constraint where + ForallPhantom ~~ _ = () + _ ~~ ForallPhantom = () + Delayed a ~~ Delayed b = a ~~ b + a ~~ b = a ~ b + +type family PlutarchInner (p :: PType) (any :: PType) :: Type where + PlutarchInner PBool _ = BuiltinBool + PlutarchInner PInteger _ = Integer + PlutarchInner PString _ = Text + PlutarchInner PByteString _ = ByteString + PlutarchInner PData _ = BuiltinData + PlutarchInner PUnit _ = () + PlutarchInner PhorallPhantom _ = ForallPhantom + PlutarchInner (PAsData a :--> PAsData b) x = PlutarchInner (PData :--> PData) x + PlutarchInner (PAsData a :--> b) x = PlutarchInner (PData :--> b) x + PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x + PlutarchInner (PDelayed a) x = Delayed (PlutarchInner a x) + PlutarchInner (PTxList a) x = DelayedList (PlutarchInner a x) + PlutarchInner p x = PlutarchInner (PInner p x) x + +type family PlutusTxInner (t :: Type) (any :: Type) :: Type where + PlutusTxInner BuiltinBool _ = BuiltinBool + PlutusTxInner Integer _ = Integer + PlutusTxInner BuiltinString _ = Text + PlutusTxInner BuiltinByteString _ = ByteString + PlutusTxInner BuiltinData _ = BuiltinData + PlutusTxInner BuiltinUnit _ = () + PlutusTxInner ForallPhantom _ = ForallPhantom + PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x + PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) + PlutusTxInner [a] x = DelayedList (PlutusTxInner a x) + PlutusTxInner a x = TypeEncoding (GCode a) (GDatatypeInfoOf a) x + +type TypeEncoding :: [[Type]] -> DatatypeInfo -> Type -> Type +type family TypeEncoding a rep x where + TypeEncoding '[ '[b]] ( 'Newtype _ _ _) x = PlutusTxInner b x +-- Matching the behaviour of PlutusTx.Lift.Class.sortedCons + TypeEncoding sop ( 'ADT _ "Bool" _ _) x = Delayed (PlutusTxInner (ScottFn (ScottList sop x) x) x) + TypeEncoding sop ( 'ADT _ _ cons _) x = Delayed (PlutusTxInner (ScottFn (ScottList (Fst (SortedBy '(sop, NamesOf cons))) x) x) x) + +type Fst :: (a, b) -> a +type family Fst x where + Fst '(a, _) = a + +type SortedBy :: ([[Type]], [ConstructorName]) -> ([[Type]], [ConstructorName]) +type family SortedBy xs where + SortedBy '((ts ': tss), (name ': names)) = Insert ts name (SortedBy '(tss, names)) + SortedBy '( '[], '[]) = '( '[], '[]) + +type Insert :: [Type] -> ConstructorName -> ([[Type]], [ConstructorName]) -> ([[Type]], [ConstructorName]) +type family Insert ts name xs where + Insert ts1 name1 '(ts2 ': tss, name2 : names) = Insert' (TypeLits.CmpSymbol name1 name2) ts1 name1 '(ts2 ': tss, name2 : names) + Insert ts name '( '[], '[]) = '( '[ts], '[name]) + +type Insert' :: Ordering -> [Type] -> ConstructorName -> ([[Type]], [ConstructorName]) -> ([[Type]], [ConstructorName]) +type family Insert' o ts name xs where + Insert' 'GT ts1 name1 '(ts2 ': tss, name2 ': names) = Cons ts2 name2 (Insert ts1 name1 '(tss, names)) + Insert' _ ts name '(tss, names) = '(ts ': tss, name ': names) + +type Cons :: a -> b -> ([a], [b]) -> ([a], [b]) +type family Cons ts name xs where + Cons ts name '(tss, names) = '(ts ': tss, name ': names) + +type NamesOf :: [ConstructorInfo] -> [ConstructorName] +type family NamesOf cs where + NamesOf ( 'Constructor name ': cs) = name ': NamesOf cs + NamesOf ( 'Infix name _ _ ': cs) = name ': NamesOf cs + NamesOf ( 'Record name _ ': cs) = name ': NamesOf cs + NamesOf '[] = '[] + +{- | + List of scott-encoded constructors of a Haskell type (represented by 'SOP.Code') + + ScottList (Code (Either a b)) c = '[a -> c, b -> c] +-} +type ScottList :: [[Type]] -> Type -> [Type] +type family ScottList code c where +-- We disallow certain shapes because Scott encoding is not appropriate for them. + ScottList '[] c = TypeError ( 'TypeLits.Text "PlutusType(scott encoding): Data type without constructors not accepted") + ScottList '[ '[]] c = + TypeError + ( 'TypeLits.Text + "PlutusType(scott encoding): Data type with single nullary constructor not accepted" + ) + ScottList '[ '[_]] c = + TypeError + ( 'TypeLits.Text + "PlutusType(scott encoding): Data type with single unary constructor not accepted; use newtype!" + ) + ScottList (xs ': xss) c = ScottFn xs c ': ScottList' xss c + +type ScottList' :: [[Type]] -> Type -> [Type] +type family ScottList' code c where + ScottList' '[] c = '[] + ScottList' (xs ': xss) c = ScottFn xs c ': ScottList' xss c + +{- | + An individual constructor function of a Scott encoding. + + ScottFn '[a, b] c = (a -> b -> c) + ScottFn '[] c = c +-} +type ScottFn :: [Type] -> Type -> Type +type family ScottFn xs b where + ScottFn '[] b = b + ScottFn (x ': xs) b = x -> ScottFn xs b diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 93273b0e9..fbd35db55 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -6,6 +6,7 @@ module Plutarch.Internal ( PDelayed, -- | $term Term (Term, asRawTerm), + asClosedRawTerm, mapTerm, plam', plet, @@ -13,12 +14,14 @@ module Plutarch.Internal ( pdelay, pforce, phoistAcyclic, + punsafeAsClosedTerm, perror, punsafeCoerce, punsafeBuiltin, punsafeConstant, punsafeConstantInternal, compile, + compile', ClosedTerm, Dig, hashTerm, @@ -39,8 +42,9 @@ import qualified Data.Map.Lazy as M import qualified Data.Set as S import qualified Flat.Run as F import GHC.Stack (HasCallStack) -import Numeric.Natural (Natural) -import Plutarch.Evaluate (evaluateScript) +import GHC.Word (Word64) +import Plutarch.Evaluate (evalScript) +import Plutarch.Reducible (Reducible (Reduce)) import Plutus.V1.Ledger.Scripts (Script (Script)) import PlutusCore (Some (Some), ValueOf (ValueOf)) import qualified PlutusCore as PLC @@ -68,13 +72,14 @@ data HoistedTerm = HoistedTerm Dig RawTerm deriving stock (Show) data RawTerm - = RVar Natural - | RLamAbs Natural RawTerm + = RVar Word64 + | RLamAbs Word64 RawTerm | RApply RawTerm [RawTerm] | RForce RawTerm | RDelay RawTerm | RConstant (Some (ValueOf PLC.DefaultUni)) | RBuiltin PLC.DefaultFun + | RCompiled (UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) | RError | RHoisted HoistedTerm deriving stock (Show) @@ -91,6 +96,7 @@ hashRawTerm' (RConstant x) = flip hashUpdate ("5" :: BS.ByteString) . flip hashU hashRawTerm' (RBuiltin x) = flip hashUpdate ("6" :: BS.ByteString) . flip hashUpdate (F.flat x) hashRawTerm' RError = flip hashUpdate ("7" :: BS.ByteString) hashRawTerm' (RHoisted (HoistedTerm hash _)) = flip hashUpdate ("8" :: BS.ByteString) . flip hashUpdate hash +hashRawTerm' (RCompiled code) = flip hashUpdate ("9" :: BS.ByteString) . flip hashUpdate (F.flat code) hashRawTerm :: RawTerm -> Dig hashRawTerm t = hashFinalize . hashRawTerm' t $ hashInit @@ -132,7 +138,9 @@ type role Term phantom representational de-Bruijn index needed to reach its own level given the level it itself is instantiated with. -} -newtype Term (s :: S) (a :: PType) = Term {asRawTerm :: Natural -> TermResult} +newtype Term (s :: S) (a :: PType) = Term {asRawTerm :: Word64 -> TermResult} + +instance Reducible (Term s a) where type Reduce (Term s a) = Term s a {- | *Closed* terms with no free variables. @@ -167,14 +175,14 @@ plam' f = Term $ \i -> t -> mapTerm (RLamAbs 0) t where -- 0 is 1 - getArity :: RawTerm -> Maybe Natural + getArity :: RawTerm -> Maybe Word64 -- We only do this if it's hoisted, since it's only safe if it doesn't -- refer to any of the variables in the wrapping lambda. getArity (RHoisted (HoistedTerm _ (RLamAbs n _))) = Just n getArity (RHoisted (HoistedTerm _ t)) = getArityBuiltin t getArity t = getArityBuiltin t - getArityBuiltin :: RawTerm -> Maybe Natural + getArityBuiltin :: RawTerm -> Maybe Word64 getArityBuiltin (RBuiltin PLC.AddInteger) = Just 1 getArityBuiltin (RBuiltin PLC.SubtractInteger) = Just 1 getArityBuiltin (RBuiltin PLC.MultiplyInteger) = Just 1 @@ -320,14 +328,17 @@ phoistAcyclic :: HasCallStack => ClosedTerm a -> Term s a phoistAcyclic t = case asRawTerm t 0 of -- Built-ins are smaller than variable references t'@(getTerm -> RBuiltin _) -> Term $ \_ -> t' - t' -> case evaluateScript . Script $ UPLC.Program () (PLC.defaultVersion ()) (compile' t') of - Right _ -> + t' -> case evalScript . Script . UPLC.Program () (PLC.defaultVersion ()) $ compile' t' of + (Right _, _, _) -> let hoisted = HoistedTerm (hashRawTerm . getTerm $ t') (getTerm t') in Term $ \_ -> TermResult (RHoisted hoisted) (hoisted : getDeps t') - Left e -> error $ "Hoisted term errs! " <> show e + (Left e, _, _) -> error $ "Hoisted term errs! " <> show e + +punsafeAsClosedTerm :: forall s a. Term s a -> ClosedTerm a +punsafeAsClosedTerm (Term t) = (Term t) -- Couldn't find a definition for this in plutus-core -subst :: Natural -> (Natural -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () +subst :: Word64 -> (Word64 -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () subst idx x (UPLC.Apply () yx yy) = UPLC.Apply () (subst idx x yx) (subst idx x yy) subst idx x (UPLC.LamAbs () name y) = UPLC.LamAbs () name (subst (idx + 1) x y) subst idx x (UPLC.Delay () y) = UPLC.Delay () (subst idx x y) @@ -338,8 +349,8 @@ subst idx _ (UPLC.Var () (DeBruijn (Index idx'))) | idx < idx' = UPLC.Var () (De subst _ _ y = y rawTermToUPLC :: - (HoistedTerm -> Natural -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> - Natural -> + (HoistedTerm -> Word64 -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> + Word64 -> RawTerm -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () rawTermToUPLC _ _ (RVar i) = UPLC.Var () (DeBruijn . Index $ i + 1) -- Why the fuck does it start from 1 and not 0? @@ -363,6 +374,7 @@ rawTermToUPLC m l (RDelay t) = UPLC.Delay () (rawTermToUPLC m l t) rawTermToUPLC m l (RForce t) = UPLC.Force () (rawTermToUPLC m l t) rawTermToUPLC _ _ (RBuiltin f) = UPLC.Builtin () f rawTermToUPLC _ _ (RConstant c) = UPLC.Constant () c +rawTermToUPLC _ _ (RCompiled code) = code rawTermToUPLC _ _ RError = UPLC.Error () -- rawTermToUPLC m l (RHoisted hoisted) = UPLC.Var () . DeBruijn . Index $ l - m hoisted rawTermToUPLC m l (RHoisted hoisted) = m hoisted l -- UPLC.Var () . DeBruijn . Index $ l - m hoisted @@ -373,14 +385,14 @@ compile' t = let t' = getTerm t deps = getDeps t - f :: Natural -> Maybe Natural -> (Bool, Maybe Natural) + f :: Word64 -> Maybe Word64 -> (Bool, Maybe Word64) f n Nothing = (True, Just n) f _ (Just n) = (False, Just n) g :: HoistedTerm -> - (M.Map Dig Natural, [(Natural, RawTerm)], Natural) -> - (M.Map Dig Natural, [(Natural, RawTerm)], Natural) + (M.Map Dig Word64, [(Word64, RawTerm)], Word64) -> + (M.Map Dig Word64, [(Word64, RawTerm)], Word64) g (HoistedTerm hash term) (map, defs, n) = case M.alterF (f n) hash map of (True, map) -> (map, (n, term) : defs, n + 1) (False, map) -> (map, defs, n) diff --git a/Plutarch/Internal/Generic.hs b/Plutarch/Internal/Generic.hs new file mode 100644 index 000000000..15c721f47 --- /dev/null +++ b/Plutarch/Internal/Generic.hs @@ -0,0 +1,72 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE UndecidableInstances #-} + +{- Common generics-sop utilities for use in Plutarch. +-} +module Plutarch.Internal.Generic ( + -- * Plutarch adapters for generics-sop API + PGeneric, + PCode, + gpfrom, + gpto, + + -- * Helpers for when existing generics-sop combinators are insufficient. + MkSum (mkSum), +) where + +import Data.Kind (Constraint, Type) +import GHC.TypeLits (Nat, type (-)) +import Generics.SOP (All, AllZip, Code, Generic (from, to), I, LiftedCoercible, NP, NS (S, Z), SOP, SameShapeAs, Top, hfromI, htoI) +import Generics.SOP.Constraint (AllZipF) +import Plutarch.DataRepr.Internal.HList.Utils (IndexList) +import Plutarch.Internal (PType, S, Term) +import Plutarch.Internal.TypeFamily (ToPType2) + +-- | `Generic` constraint extended to work with Plutarch types. +type PGeneric :: S -> PType -> Constraint +type PGeneric s a = + ( Generic (a s) + , SameShapeAs (Code (a s)) (PCode s a) + , SameShapeAs (PCode s a) (Code (a s)) + , AllZipF (AllZip (LiftedCoercible I (Term s))) (Code (a s)) (PCode s a) + , AllZipF (AllZip (LiftedCoercible (Term s) I)) (PCode s a) (Code (a s)) + , All Top (PCode s a) + ) + +-- | Like `Code` but for Plutarch types +type PCode s a = ToPType2 (Code (a s)) + +{- | Like `from` but for Plutarch terms + + Instead of `I`, this uses `Term s` as the container type. +-} +gpfrom :: PGeneric s a => a s -> SOP (Term s) (PCode s a) +gpfrom = hfromI . from + +-- | Like `to` but for Plutarch terms. Analogous to `gpfrom`. +gpto :: PGeneric s a => SOP (Term s) (PCode s a) -> a s +gpto = to . htoI + +{- | +Infrastructure to create a single sum constructor given its type index and value. + +- `mkSum @0 @(Code a) x` creates the first sum constructor; +- `mkSum @1 @(Code a) x` creates the second sum constructor; +- etc. + +It is type-checked that the `x` here matches the type of nth constructor of `a`. +-} +class MkSum (idx :: Nat) (xss :: [[k]]) (f :: k -> Type) where + mkSum :: NP f (IndexList idx xss) -> NS (NP f) xss + +instance {-# OVERLAPPING #-} MkSum 0 (xs ': xss) f where + mkSum = Z + +instance + {-# OVERLAPPABLE #-} + ( MkSum (idx - 1) xss f + , IndexList idx (xs ': xss) ~ IndexList (idx - 1) xss + ) => + MkSum idx (xs ': xss) f + where + mkSum x = S $ mkSum @_ @(idx - 1) @xss x diff --git a/Plutarch/Internal/PlutusType.hs b/Plutarch/Internal/PlutusType.hs index edfd5936a..4b0d18b46 100644 --- a/Plutarch/Internal/PlutusType.hs +++ b/Plutarch/Internal/PlutusType.hs @@ -9,28 +9,19 @@ module Plutarch.Internal.PlutusType ( ) where import Data.Kind (Type) -import Data.SOP.Constraint (AllZipF) import GHC.TypeLits (ErrorMessage (Text), Nat, TypeError, type (+)) import Generics.SOP ( All, - AllZip, - AllZipN, - Generic (..), - I, - LiftedCoercible, - NP (..), - NS (..), - Prod, + Generic (Code), + NP (Nil, (:*)), + NS (S, Z), SOP (SOP), - SameShapeAs, Top, - hcoerce, - unSOP, ) -import Plutarch.DataRepr.Internal.Generic (MkSum (mkSum)) import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Internal (PType, S, Term, pforce, plam', punsafeCoerce, (:-->)) import qualified Plutarch.Internal as PI +import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) import Plutarch.Internal.PLam ((#)) import Plutarch.Internal.TypeFamily (ToPType, ToPType2) @@ -99,27 +90,24 @@ class (PCon a, PMatch a) => PlutusType (a :: PType) where default pcon' :: forall s b code pcode. ( code ~ Code (a s) - , pcode ~ ToPType2 code - , Generic (a s) + , pcode ~ PCode s a + , PGeneric s a , GPCon pcode b s , PLamL (ScottList' s pcode b) b s , ScottFn' (ScottList s pcode b) b ~ PInner a b , ScottFn (ScottList' s pcode b) b ~ PInner a b - , AllZipF (AllZip (LiftedCoercible I (Term s))) code pcode - , SameShapeAs code pcode - , SameShapeAs pcode code , All Top pcode ) => a s -> Term s (PInner a b) - pcon' x = gpcon @a @b $ from x + pcon' x = gpcon @a @b $ gpfrom x pmatch' :: forall s b. (Term s (PInner a b)) -> (a s -> Term s b) -> Term s b default pmatch' :: forall s b code pcode. ( code ~ Code (a s) - , pcode ~ ToPType2 code - , Generic (a s) + , pcode ~ PCode s a + , PGeneric s a , AppL b (ScottList' s pcode b) , GPMatch a 0 code b s , PInner a b ~ ScottFn (ScottList' s pcode b) b @@ -127,7 +115,7 @@ class (PCon a, PMatch a) => PlutusType (a :: PType) where (Term s (PInner a b)) -> (a s -> Term s b) -> Term s b - pmatch' x f = gpmatch @a x (f . to) + pmatch' x f = gpmatch @a x (f . gpto) instance {-# OVERLAPPABLE #-} PlutusType a => PMatch a where pmatch x f = pmatch' (punsafeCoerce x) f @@ -147,23 +135,18 @@ class PMatch a where gpcon :: forall a c s code pcode. ( PlutusType a - , Generic (a s) + , PGeneric s a , code ~ Code (a s) - , pcode ~ ToPType2 code + , pcode ~ PCode s a , GPCon pcode c s , PLamL (ScottList' s pcode c) c s , ScottFn (ScottList' s pcode c) c ~ ScottFn' (ScottList s pcode c) c - , AllZipN (Prod SOP) (LiftedCoercible I (Term s)) code pcode ) => - SOP I (Code (a s)) -> + SOP (Term s) pcode -> Term s (ScottFn' (ScottList s pcode c) c) -gpcon val = +gpcon (SOP val) = plamL @(ScottList' s pcode c) @c $ \(f :: NP (Term s) (ScottList' s pcode c)) -> - gpcon' @pcode @c @s f $ - unSOP $ pSop val - where - pSop :: AllZipN (Prod SOP) (LiftedCoercible I (Term s)) xss (ToPType2 xss) => SOP I xss -> SOP (Term s) (ToPType2 xss) - pSop = hcoerce + gpcon' @pcode @c @s f val {- | `gpcon'`, given a *partial* scott encoding (as a `PLamL`) and a sum choice, applies @@ -188,14 +171,14 @@ instance (GPCon xs c s, AppL c x) => GPCon (x ': xs) c s where -} gpmatch :: forall a s c code pcode. - ( Generic (a s) + ( PGeneric s a , code ~ Code (a s) - , pcode ~ ToPType2 code + , pcode ~ PCode s a , AppL c (ScottList' s pcode c) , GPMatch a 0 code c s ) => Term s (ScottFn (ScottList' s pcode c) c) -> - (SOP I (Code (a s)) -> Term s c) -> + (SOP (Term s) pcode -> Term s c) -> Term s c gpmatch x f = x `appL` gpmatch' @a @0 @code @c @s f @@ -205,39 +188,25 @@ gpmatch x f = scott encoding function. -} class GPMatch (a :: PType) (n :: Nat) (xss :: [[Type]]) (c :: PType) (s :: S) where - gpmatch' :: (SOP I (Code (a s)) -> Term s c) -> NP (Term s) (ScottList' s (ToPType2 xss) c) + gpmatch' :: (SOP (Term s) (PCode s a) -> Term s c) -> NP (Term s) (ScottList' s (ToPType2 xss) c) instance GPMatch a n '[] c s where gpmatch' _ = Nil instance ( code ~ Code (a s) - , xs ~ IndexList n code + , ToPType xs ~ IndexList n (PCode s a) , GPMatch a (n + 1) xss c s , PLamL (ToPType xs) c s - , MkSum n (Code (a s)) - , AllZipF (LiftedCoercible (Term s) I) (ToPType xs) xs - , SameShapeAs xs (ToPType xs) - , SameShapeAs (ToPType xs) xs + , MkSum n (PCode s a) (Term s) , All Top (ToPType xs) , All Top xs ) => GPMatch a n (xs : xss) c s where gpmatch' f = - plamL @(ToPType xs) @c (f . SOP . mkSum @n @(Code (a s)) . unPsop) + plamL @(ToPType xs) @c (f . SOP . mkSum @_ @n @(PCode s a) @(Term s)) :* gpmatch' @a @(n + 1) @xss @c @s f - where - unPsop :: - ( AllZipF (LiftedCoercible (Term s) I) (ToPType xs) xs - , SameShapeAs xs (ToPType xs) - , SameShapeAs (ToPType xs) xs - , All Top (ToPType xs) - , All Top xs - ) => - NP (Term s) (ToPType xs) -> - NP I xs - unPsop = hcoerce {- | `plamL` is like `plamL'`, but pdelays the 0-arity case. diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index d9ad2380b..f182057f7 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -15,22 +15,31 @@ module Plutarch.Lift ( PLift, DerivePConstantDirect (..), DerivePConstantViaNewtype (..), + DerivePConstantViaBuiltin (..), -- * Internal use PUnsafeLiftDecl (..), ) where +import Control.Lens ((^?)) import Data.Coerce import Data.Kind (Type) import GHC.Stack (HasCallStack) -import Plutarch.Evaluate (evaluateScript) +import Plutarch.Evaluate (EvalError, evalScript) import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInternal) import qualified Plutus.V1.Ledger.Scripts as Scripts import qualified PlutusCore as PLC -import PlutusCore.Constant (readKnownConstant) -import PlutusCore.Evaluation.Machine.Exception (ErrorWithCause, MachineError) +import PlutusCore.Builtin (ReadKnownError, readKnownConstant) +import PlutusCore.Evaluation.Machine.Exception (ErrorWithCause (ErrorWithCause), MachineError, _UnliftingErrorE) +import PlutusTx (BuiltinData, Data, builtinDataToData, dataToBuiltinData) +import PlutusTx.Builtins.Class (FromBuiltin, ToBuiltin, fromBuiltin, toBuiltin) import qualified UntypedPlutusCore as UPLC +{- | +Laws: + - It must be that @PConstantRepr (PLifted p)@ when encoded as a constant + in UPLC (via the 'UntypedPlutusCore.Constant' constructor) is a valid @p@. +-} class (PConstant (PLifted p), PConstanted (PLifted p) ~ p) => PUnsafeLiftDecl (p :: PType) where type PLifted p :: Type @@ -40,6 +49,14 @@ and converted to a Plutarch type. The Plutarch type is determined by `PConstanted h`. Its Plutus Core representation is given by `PConstantRepr h`. This typeclass is closely tied with 'PLift'. + +Laws: + - @pconstantFromRepr . pconstantToRepr ≡ Just@ + - @(pconstantToRepr <$>) . pconstantFromRepr ≡ Just@ + - @plift . pfromData . punsafeCoerce . pconstant . toData ≡ id@ + - @fromData . plift . pforgetData . ptoData . pconstant ≡ Just@ + +These laws must be upheld for the sake of soundness of the type system. -} class (PUnsafeLiftDecl (PConstanted h), PLC.DefaultUni `PLC.Includes` PConstantRepr h) => PConstant (h :: Type) where type PConstantRepr h :: Type @@ -64,30 +81,37 @@ pconstant x = punsafeConstantInternal $ PLC.someValue @(PConstantRepr (PLifted p -- | Error during script evaluation. data LiftError - = LiftError_ScriptError Scripts.ScriptError - | LiftError_EvalException (ErrorWithCause (MachineError PLC.DefaultFun) ()) + = LiftError_EvalError EvalError + | LiftError_ReadKnownError (ErrorWithCause ReadKnownError (MachineError PLC.DefaultFun)) | LiftError_FromRepr - | LiftError_WrongRepr - deriving stock (Eq, Show) + deriving stock (Eq) {- | Convert a Plutarch term to the associated Haskell value. Fail otherwise. This will fully evaluate the arbitrary closed expression, and convert the resulting value. -} plift' :: forall p. PUnsafeLiftDecl p => ClosedTerm p -> Either LiftError (PLifted p) -plift' prog = case evaluateScript (compile prog) of - Right (_, _, Scripts.unScript -> UPLC.Program _ _ term) -> +plift' prog = case evalScript (compile prog) of + (Right (Scripts.unScript -> UPLC.Program _ _ term), _, _) -> case readKnownConstant @_ @(PConstantRepr (PLifted p)) @(MachineError PLC.DefaultFun) Nothing term of Right r -> case pconstantFromRepr r of Just h -> Right h Nothing -> Left LiftError_FromRepr - Left e -> Left $ LiftError_EvalException e - Left e -> Left $ LiftError_ScriptError e + Left e -> Left $ LiftError_ReadKnownError e + (Left e, _, _) -> Left $ LiftError_EvalError e -- | Like `plift'` but throws on failure. plift :: forall p. (HasCallStack, PLift p) => ClosedTerm p -> PLifted p plift prog = case plift' prog of Right x -> x - Left e -> error $ "plift failed: " <> show e + Left LiftError_FromRepr -> error "plift failed: pconstantFromRepr returned 'Nothing'" + Left (LiftError_ReadKnownError (ErrorWithCause e causeMaybe)) -> + let unliftErrMaybe = e ^? _UnliftingErrorE + in error $ + "plift failed: incorrect type: " + <> maybe "absurd evaluation failure" show unliftErrMaybe + <> "\n" + <> maybe "" (\x -> "cause: " <> show x) causeMaybe + Left (LiftError_EvalError e) -> error $ "plift failed: erring term: " <> show e -- TODO: Add haddock newtype DerivePConstantDirect (h :: Type) (p :: PType) = DerivePConstantDirect h @@ -109,3 +133,29 @@ instance (PLift p, PLift p', Coercible h (PLifted p')) => PConstant (DerivePCons type PConstanted (DerivePConstantViaNewtype h p p') = p pconstantToRepr x = pconstantToRepr @(PLifted p') $ coerce x pconstantFromRepr x = coerce $ pconstantFromRepr @(PLifted p') x + +class ToBuiltin' a arep | a -> arep where + toBuiltin' :: a -> arep + +class FromBuiltin' arep a | arep -> a where + fromBuiltin' :: arep -> a + +instance {-# OVERLAPPABLE #-} ToBuiltin a arep => ToBuiltin' a arep where + toBuiltin' = toBuiltin + +instance {-# OVERLAPPABLE #-} FromBuiltin arep a => FromBuiltin' arep a where + fromBuiltin' = fromBuiltin + +instance ToBuiltin' Data BuiltinData where + toBuiltin' = dataToBuiltinData + +instance FromBuiltin' BuiltinData Data where + fromBuiltin' = builtinDataToData + +newtype DerivePConstantViaBuiltin (h :: Type) (p :: PType) (p' :: PType) = DerivePConstantViaBuiltin h + +instance (PLift p, PLift p', Coercible h h', ToBuiltin' (PLifted p') h', FromBuiltin' h' (PLifted p')) => PConstant (DerivePConstantViaBuiltin h p p') where + type PConstantRepr (DerivePConstantViaBuiltin h p p') = PConstantRepr (PLifted p') + type PConstanted (DerivePConstantViaBuiltin h p p') = p + pconstantToRepr x = pconstantToRepr @(PLifted p') $ fromBuiltin' (coerce x :: h') + pconstantFromRepr x = coerce (toBuiltin' <$> pconstantFromRepr @(PLifted p') x :: Maybe h') diff --git a/Plutarch/List.hs b/Plutarch/List.hs index ba09ad1d9..2e7ca20c6 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -4,6 +4,7 @@ module Plutarch.List ( PListLike (..), PIsListLike, pconvertLists, + pshowList, -- * Comparison plistEquals, @@ -13,10 +14,17 @@ module Plutarch.List ( plength, ptryIndex, pdrop, + pfind, + pelemAt, + (#!!), -- * Construction psingleton, + -- * Deconstruction + puncons, + ptryUncons, + -- * Combine pconcat, pzipWith, @@ -63,12 +71,16 @@ import Plutarch ( (#$), type (:-->), ) -import Plutarch.Bool (PBool (PFalse, PTrue), PEq, pif, (#&&), (#==), (#||)) +import Plutarch.Bool (PBool (PFalse, PTrue), PEq, pif, (#&&), (#<), (#==), (#||)) import Plutarch.Integer (PInteger) import Plutarch.Lift (pconstant) +import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Pair (PPair (PPair)) +import Plutarch.String (PString) import Data.Kind +import Plutarch.Show (PShow (pshow'), pshow) +import Plutarch.Trace (ptraceError) data PList (a :: PType) (s :: S) = PSCons (Term s a) (Term s (PList a)) @@ -76,6 +88,27 @@ data PList (a :: PType) (s :: S) deriving stock (GHC.Generic) deriving anyclass (Generic, PlutusType) +instance PShow a => PShow (PList a) where + pshow' _ x = pshowList @PList @a # x + +pshowList :: forall list a s. (PShow a, PIsListLike list a) => Term s (list a :--> PString) +pshowList = + phoistAcyclic $ + plam $ \list -> + "[" <> pshowList' @list @a # list <> "]" + +pshowList' :: forall list a s. (PShow a, PIsListLike list a) => Term s (list a :--> PString) +pshowList' = + phoistAcyclic $ + precList + ( \self x xs -> + pelimList + (\_ _ -> pshow x <> ", " <> self # xs) + (pshow x) + xs + ) + (\_self -> "") + instance PEq a => PEq (PList a) where (#==) xs ys = plistEquals # xs # ys @@ -133,6 +166,24 @@ pconvertLists = phoistAcyclic $ (\x xs -> pcons # x #$ self # xs) pnil +-- | Extract head and tail of the list, throws error if list is empty. +ptryUncons :: + PIsListLike list a => + Term s (list a :--> PPair a (list a)) +ptryUncons = + phoistAcyclic $ + plam $ + pelimList (\x -> pcon . PPair x) perror + +-- | Extract head and tail of the list, if list is not empty. +puncons :: + PIsListLike list a => + Term s (list a :--> PMaybe (PPair a (list a))) +puncons = + phoistAcyclic $ + plam $ + pelimList (\x -> pcon . PJust . pcon . PPair x) (pcon PNothing) + -- | Like 'pelimList', but with a fixpoint recursion hatch. precList :: PIsListLike list a => @@ -166,11 +217,11 @@ pelem = -- | / O(n) /. Count the number of elements in the list plength :: PIsListLike list a => Term s (list a :--> PInteger) -plength = phoistAcyclic $ - plam $ \xs -> - let go :: PIsListLike list a => Term s (list a :--> PInteger :--> PInteger) - go = (pfix #$ plam $ \self ls n -> pelimList (\_ xs -> self # xs # n + 1) n ls) - in go # xs # 0 +plength = + phoistAcyclic $ + let go :: PIsListLike list a => Term s (PInteger :--> list a :--> PInteger) + go = pfix #$ plam $ \self n -> pelimList (\_ xs -> self # (n + 1) # xs) n + in go # 0 -- | Index a BuiltinList, throwing an error if the index is out of bounds. ptryIndex :: (PIsListLike list a) => Natural -> Term s (list a) -> Term s a @@ -197,20 +248,18 @@ pdrop n xs = pdrop' n # xs pfoldl :: PIsListLike list a => Term s ((b :--> a :--> b) :--> b :--> list a :--> b) pfoldl = phoistAcyclic $ plam $ \f -> - pfix #$ plam $ \self z l -> + pfix #$ plam $ \self z -> pelimList (\x xs -> self # (f # z # x) # xs) z - l -- | The same as 'pfoldl', but with Haskell-level reduction function. pfoldl' :: PIsListLike list a => (forall s. Term s b -> Term s a -> Term s b) -> Term s (b :--> list a :--> b) pfoldl' f = phoistAcyclic $ - pfix #$ plam $ \self z l -> + pfix #$ plam $ \self z -> pelimList (\x xs -> self # f z x # xs) z - l -- | / O(n) /. Fold on a list right-associatively. pfoldr :: PIsListLike list a => Term s ((a :--> b :--> b) :--> b :--> list a :--> b) @@ -363,3 +412,42 @@ plistEquals = ) (pelimList (\_ _ -> pconstant False) (pconstant True) ylist) xlist + +-- | / O(n) /. Like Haskell level `(!!)` but on the plutarch level +(#!!) :: (PIsListLike l a) => Term s (l a) -> Term s PInteger -> Term s a +l #!! i = pelemAt # i # l + +{- | / O(n) /. Like Haskell level `(!!)` but on the Plutarch level, not infix and + with arguments reversed, errors if the specified index is greater than or equal + to the lists length +-} +pelemAt :: PIsListLike l a => Term s (PInteger :--> l a :--> a) +pelemAt = phoistAcyclic $ + plam $ \n xs -> + pif + (n #< 0) + (ptraceError "pelemAt: negative index") + (pelemAt' # n # xs) + +-- | / O(n) /. like `pelemAt` but doesn't fail on negative indexes +pelemAt' :: PIsListLike l a => Term s (PInteger :--> l a :--> a) +pelemAt' = phoistAcyclic $ + pfix #$ plam $ \self n xs -> + pif + (n #== 0) + (phead # xs) + (self # (n - 1) #$ ptail # xs) + +-- | / O(n) /. like haskell level `find` but on plutarch level +pfind :: PIsListLike l a => Term s ((a :--> PBool) :--> l a :--> PMaybe a) +pfind = phoistAcyclic $ + pfix #$ plam $ \self f xs -> + pelimList + ( \y ys -> + pif + (f # y) + (pcon $ PJust y) + (self # f # ys) + ) + (pcon PNothing) + xs diff --git a/Plutarch/Maybe.hs b/Plutarch/Maybe.hs index 9c63c5467..de30f94f4 100644 --- a/Plutarch/Maybe.hs +++ b/Plutarch/Maybe.hs @@ -1,17 +1,36 @@ -module Plutarch.Maybe (PMaybe (..)) where +module Plutarch.Maybe ( + PMaybe (PJust, PNothing), + pfromJust, +) where import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +import Generics.SOP (Generic, HasDatatypeInfo, I (I)) import Plutarch ( PType, PlutusType, S, Term, + perror, + phoistAcyclic, + plam, + pmatch, + type (:-->), ) +import Plutarch.Bool (PEq) +import Plutarch.Show (PShow) -- | Plutus Maybe type, with Scott-encoded repr data PMaybe (a :: PType) (s :: S) = PJust (Term s a) | PNothing deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) + +{- | + fallible unwrapping from @PMaybe@ +-} +pfromJust :: Term s (PMaybe a :--> a) +pfromJust = phoistAcyclic $ + plam $ \maybe -> pmatch maybe $ \case + PNothing -> perror + PJust a -> a diff --git a/Plutarch/Pair.hs b/Plutarch/Pair.hs index efaf3d113..6c696b509 100644 --- a/Plutarch/Pair.hs +++ b/Plutarch/Pair.hs @@ -1,15 +1,17 @@ module Plutarch.Pair (PPair (..)) where import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) -import Plutarch (PType, PlutusType, S, Term) +import Generics.SOP (Generic, HasDatatypeInfo, I (I)) +import Plutarch.Bool (PEq) +import Plutarch.Internal.Other (PType, PlutusType, S, Term) +import Plutarch.Show (PShow) {- | Plutus encoding of Pairs. - Note: This is represented differently than 'BuiltinPair' + Note: This is represented differently than 'BuiltinPair'. It is scott-encoded. -} data PPair (a :: PType) (b :: PType) (s :: S) = PPair (Term s a) (Term s b) deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 8fe129866..759519708 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -3,6 +3,7 @@ module Plutarch.Prelude ( (:-->), PDelayed, Term, + ClosedTerm, plam, plam', papp, @@ -64,6 +65,7 @@ module Plutarch.Prelude ( PIsListLike, plistEquals, pelem, + pelemAt, plength, ptryIndex, pdrop, @@ -74,12 +76,14 @@ module Plutarch.Prelude ( pzip, pmap, pfilter, + pfind, precList, pfoldr, pfoldrLazy, pfoldl, pall, pany, + (#!!), -- * Scott encoded list type PList (..), @@ -93,8 +97,12 @@ module Plutarch.Prelude ( -- * Scott encoded pair type and utilities PPair (..), + -- * Opaque type + POpaque (POpaque), + popaque, + -- * Builtin types and utilities - PData (..), + PData, pfstBuiltin, psndBuiltin, PBuiltinPair, @@ -115,9 +123,11 @@ module Plutarch.Prelude ( -- * Tracing ptrace, + ptraceShowId, ptraceIfFalse, ptraceIfTrue, ptraceError, + pshow, -- * Cryptographic hashes and signatures psha2_256, @@ -156,6 +166,7 @@ import Plutarch.List import Plutarch.Maybe import Plutarch.Pair import Plutarch.Rational +import Plutarch.Show import Plutarch.String import Plutarch.TermCont import Plutarch.Trace diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 2d6049d93..88d6cd891 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -38,6 +38,7 @@ import Plutarch.Builtin ( import Plutarch.Integer (PInteger, PIntegral (pdiv, pmod)) import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) import Plutarch.Pair (PPair (..)) +import Plutarch.Show (PShow (pshow'), pshow) import Plutarch.Unsafe (punsafeCoerce) data PRational s @@ -45,6 +46,14 @@ data PRational s deriving stock (GHC.Generic) deriving anyclass (Generic, PlutusType) +instance PShow PRational where + pshow' _ x = + pshowRat # x + where + pshowRat = phoistAcyclic $ + plam $ \n -> pmatch n $ \(PRational x y) -> + pshow x <> "/" <> pshow y + instance PIsData PRational where pfromData x' = phoistAcyclic (plam $ \x -> pListToRat #$ pmap # pasInt #$ pasList # pforgetData x) # x' pdata x' = @@ -243,8 +252,6 @@ pround = phoistAcyclic $ (pif (rem #< pdiv # b # 2) 0 1) ) --- (pdiv # b # 2 + pmod # b # 2 #<= pmod # a # b) 1 0 - ptruncate :: Term s (PRational :--> PInteger) ptruncate = phoistAcyclic $ plam $ \x -> diff --git a/Plutarch/Rec.hs b/Plutarch/Rec.hs index f89d7a6a8..03eb77638 100644 --- a/Plutarch/Rec.hs +++ b/Plutarch/Rec.hs @@ -21,7 +21,7 @@ import Control.Monad.Trans.State.Lazy (State, evalState, get, put) import Data.Functor.Compose (Compose (Compose, getCompose)) import Data.Kind (Type) import Data.Monoid (Dual (Dual, getDual), Endo (Endo, appEndo), Sum (Sum, getSum)) -import Numeric.Natural (Natural) +import GHC.Word (Word64) import Plutarch ( PlutusType (PInner, pcon', pmatch'), pcon, @@ -78,7 +78,7 @@ rmatch p f = p # arg where arg :: Term s (ScottEncoded r t) arg = Term (\i -> TermResult (RLamAbs (fieldCount (initial @r) - 1) $ rawArg i) []) - rawArg :: Natural -> RawTerm + rawArg :: Word64 -> RawTerm rawArg depth = getTerm $ asRawTerm (f $ variables depth) $ depth + fieldCount (initial @r) -- | Wrapped recursive let construct, tying into knot the recursive equations specified in the record fields. @@ -121,14 +121,14 @@ accessors = abstract Rank2.<$> variables 0 {- | A record of terms that each accesses a different variable in scope, outside in following the field order. -} -variables :: forall r s. (Rank2.Distributive r, Rank2.Traversable r) => Natural -> r (Term s) +variables :: forall r s. (Rank2.Distributive r, Rank2.Traversable r) => Word64 -> r (Term s) variables baseDepth = Rank2.cotraverse var id where var :: (r (Term s) -> Term s a) -> Term s a var ref = ref ordered ordered :: r (Term s) ordered = evalState (Rank2.traverse next $ initial @r) 0 - next :: f a -> State Natural (Term s a) + next :: f a -> State Word64 (Term s a) next _ = do i <- get let i' = succ i @@ -230,7 +230,7 @@ verifySoleConstructor f d = initial :: Rank2.Distributive r => r (Compose Maybe (Term s)) initial = Rank2.distribute Nothing -fieldCount :: Rank2.Foldable r => r f -> Natural +fieldCount :: Rank2.Foldable r => r f -> Word64 fieldCount = getSum . Rank2.foldMap (const $ Sum 1) -- | The raw Y-combinator term diff --git a/Plutarch/Reducible.hs b/Plutarch/Reducible.hs new file mode 100644 index 000000000..70f28dd7c --- /dev/null +++ b/Plutarch/Reducible.hs @@ -0,0 +1,17 @@ +-- FIXME: This should be its own package as it's not related to Plutarch at all. +module Plutarch.Reducible (Reducible (Reduce)) where + +import Data.Coerce (Coercible) +import Data.Functor.Const (Const (Const)) +import Data.Functor.Identity (Identity (Identity)) + +class (Coercible (Reduce x) x) => Reducible (x :: k) where + type Reduce x :: k + +instance Reducible () where type Reduce () = () + +instance Reducible a => Reducible (Const a b) where + type Reduce (Const a b) = Reduce a + +instance Reducible a => Reducible (Identity a) where + type Reduce (Identity a) = Reduce a diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs new file mode 100644 index 000000000..9ae075a6d --- /dev/null +++ b/Plutarch/Show.hs @@ -0,0 +1,213 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE DefaultSignatures #-} + +module Plutarch.Show ( + PShow (pshow'), + pshow, +) where + +import Data.Char (intToDigit) +import Data.List.NonEmpty (NonEmpty ((:|))) +import qualified Data.List.NonEmpty as NE +import Data.Semigroup (sconcat) +import Data.String (IsString (fromString)) +import qualified Data.Text as T +import Generics.SOP ( + All, + All2, + ConstructorName, + HasDatatypeInfo, + K (K), + NP, + NS, + Proxy (Proxy), + SOP (SOP), + constructorInfo, + constructorName, + datatypeInfo, + hcmap, + hcollapse, + hindex, + hmap, + ) +import Plutarch.Bool (PBool, PEq ((#==)), POrd ((#<)), pif) +import Plutarch.ByteString (PByteString, pconsBS, pindexBS, plengthBS, psliceBS) +import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) +import Plutarch.Internal (punsafeAsClosedTerm) +import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) +import Plutarch.Internal.Other ( + PlutusType, + Term, + perror, + pfix, + phoistAcyclic, + plam, + plet, + pmatch, + (#), + (#$), + type (:-->), + ) +import Plutarch.Lift (pconstant) +import Plutarch.String (PString, pdecodeUtf8, pencodeUtf8) + +class PShow t where + -- | Return the string representation of a Plutarch value + -- + -- If the wrap argument is True, optionally wrap the output in `(..)` if it + -- represents multiple parameters. + pshow' :: Bool -> Term s t -> Term s PString + default pshow' :: (PGeneric s t, PlutusType t, HasDatatypeInfo (t s), All2 PShow (PCode s t)) => Bool -> Term s t -> Term s PString + pshow' wrap x = gpshow wrap # x + +-- | Return the string representation of a Plutarch value +pshow :: PShow a => Term s a -> Term s PString +pshow = pshow' False + +instance PShow PString where + pshow' _ x = pshowStr # x + where + pshowStr :: Term s (PString :--> PString) + pshowStr = phoistAcyclic $ + plam $ \s -> + "\"" <> (pdecodeUtf8 #$ pshowUtf8Bytes #$ pencodeUtf8 # s) <> "\"" + pshowUtf8Bytes :: Term s (PByteString :--> PByteString) + pshowUtf8Bytes = phoistAcyclic $ + pfix #$ plam $ \self bs -> + pelimBS # bs + # bs + #$ plam + $ \x xs -> + -- Non-ascii byte sequence will not use bytes < 128. + -- So we are safe to rewrite the lower byte values. + -- https://en.wikipedia.org/wiki/UTF-8#Encoding + let doubleQuote = 34 :: Term _ PInteger -- `"` + escapeSlash = 92 :: Term _ PInteger -- `\` + rec = pconsBS # x #$ self # xs + in pif + (x #== doubleQuote) + (pconsBS # escapeSlash # rec) + rec + +instance PShow PBool where + pshow' _ x = pshowBool # x + where + pshowBool = phoistAcyclic $ + plam $ \x -> + -- Delegate to Haskell's Show instance + pmatch x $ pconstant @PString . T.pack . show + +instance PShow PInteger where + pshow' _ x = pshowInt # x + where + pshowInt = phoistAcyclic $ + pfix #$ plam $ \self n -> + let sign = pif (n #< 0) "-" "" + in sign + <> ( plet (pquot # abs n # 10) $ \q -> + plet (prem # abs n # 10) $ \r -> + pif + (q #== 0) + (pshowDigit # r) + ( plet (self # q) $ \prefix -> + prefix <> pshowDigit # r + ) + ) + pshowDigit :: Term s (PInteger :--> PString) + pshowDigit = phoistAcyclic $ + plam $ \digit -> + pcase perror digit $ + flip fmap [0 .. 9] $ \(x :: Integer) -> + (pconstant x, pconstant (T.pack . show $ x)) + +instance PShow PByteString where + pshow' _ x = showByteString # x + where + showByteString = phoistAcyclic $ + plam $ \bs -> + "0x" <> showByteString' # bs + showByteString' = phoistAcyclic $ + pfix #$ plam $ \self bs -> + pelimBS # bs + # (pconstant @PString "") + #$ plam + $ \x xs -> showByte # x <> self # xs + showByte :: Term s (PInteger :--> PString) + showByte = phoistAcyclic $ + plam $ \n -> + plet (pquot # n # 16) $ \a -> + plet (prem # n # 16) $ \b -> + showNibble # a <> showNibble # b + showNibble :: Term s (PInteger :--> PString) + showNibble = phoistAcyclic $ + plam $ \n -> + pcase perror n $ + flip fmap [0 .. 15] $ \(x :: Int) -> + ( pconstant $ toInteger x + , pconstant @PString $ T.pack $ intToDigit x : [] + ) + +-- | Case matching on bytestring, as if a list. +pelimBS :: + Term + s + ( PByteString + :--> a -- If bytestring is empty + :--> (PInteger :--> PByteString :--> a) -- If bytestring is non-empty + :--> a + ) +pelimBS = phoistAcyclic $ + plam $ \bs z f -> + plet (plengthBS # bs) $ \n -> + pif (n #== 0) z $ + plet (pindexBS # bs # 0) $ \x -> + plet (psliceBS # 1 # (n - 1) # bs) $ \xs -> + f # x # xs + +pcase :: PEq a => Term s b -> Term s a -> [(Term s a, Term s b)] -> Term s b +pcase otherwise x = \case + [] -> otherwise + ((x', r) : cs) -> pif (x #== x') r $ pcase otherwise x cs + +-- | Generic version of `pshow` +gpshow :: + forall a s. + (PGeneric s a, HasDatatypeInfo (a s), PlutusType a, All2 PShow (PCode s a)) => + Bool -> + Term s (a :--> PString) +gpshow wrap = + phoistAcyclic $ + punsafeAsClosedTerm @s $ + plam $ \x -> + pmatch x $ \x' -> + productGroup wrap " " $ gpshow' @a (gpfrom x') + +-- | Like `gpshow`, but returns the individual parameters list +gpshow' :: + forall a s. + (PGeneric s a, HasDatatypeInfo (a s), All2 PShow (PCode s a)) => + SOP (Term s) (PCode s a) -> + NonEmpty (Term s PString) +gpshow' (SOP x) = + let cName = constructorNames !! hindex x + in pconstant @PString (T.pack cName) :| showSum x + where + constructorNames :: [ConstructorName] = + hcollapse $ hmap (K . constructorName) $ constructorInfo $ datatypeInfo (Proxy @(a s)) + showSum :: NS (NP (Term s)) (PCode s a) -> [Term s PString] + showSum = + hcollapse . hcmap (Proxy @(All PShow)) showProd + showProd :: All PShow xs => NP (Term s) xs -> K [Term s PString] xs + showProd = + K . hcollapse . hcmap (Proxy @PShow) showTerm + showTerm :: forall b. PShow b => Term s b -> K (Term s PString) b + showTerm = + K . pshow' True + +-- | Group parameters list, preparing for final PShow output +productGroup :: (Monoid a, IsString a) => Bool -> a -> NonEmpty a -> a +productGroup wrap sep = \case + x :| [] -> x + xs -> + let xs' = sconcat $ NE.intersperse sep xs + in if wrap then fromString "(" <> xs' <> fromString ")" else xs' diff --git a/Plutarch/Trace.hs b/Plutarch/Trace.hs index 10cdbea3a..795b7c1b2 100644 --- a/Plutarch/Trace.hs +++ b/Plutarch/Trace.hs @@ -1,6 +1,12 @@ {-# LANGUAGE CPP #-} -module Plutarch.Trace (ptrace, ptraceIfTrue, ptraceIfFalse, ptraceError) where +module Plutarch.Trace ( + ptrace, + ptraceShowId, + ptraceIfTrue, + ptraceIfFalse, + ptraceError, +) where -- CPP support isn't great in fourmolu. {- ORMOLU_DISABLE -} @@ -15,7 +21,11 @@ import Plutarch.Bool (PBool, pif) import Plutarch.Bool (PBool) #endif import Plutarch.String (PString) - +#ifdef Development +import Plutarch.Show (PShow, pshow) +#else +import Plutarch.Show (PShow) +#endif #ifdef Development import Plutarch.Unsafe (punsafeBuiltin) import qualified PlutusCore as PLC @@ -34,6 +44,14 @@ ptrace s a = pforce $ ptrace' # s # pdelay a ptrace _ a = a #endif +-- | Like Haskell's `traceShowId` but for Plutarch +ptraceShowId :: PShow a => Term s a -> Term s a +#ifdef Development +ptraceShowId x = ptrace (pshow x) x +#else +ptraceShowId a = a +#endif + -- | Trace the given message and terminate evaluation with a 'perror'. ptraceError :: Term s PString -> Term s a #ifdef Development diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs new file mode 100644 index 000000000..a9af6cb2e --- /dev/null +++ b/Plutarch/TryFrom.hs @@ -0,0 +1,367 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE FunctionalDependencies #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.TryFrom ( + PTryFrom (..), + HRecP (..), + ptryFrom, +) where + +import Data.Proxy (Proxy (Proxy)) + +import GHC.TypeLits (KnownNat, Nat, Symbol, natVal, type (+)) + +import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) + +import Plutarch.Bool (pif, (#==)) +import Plutarch.ByteString (PByteString) +import Plutarch.Integer (PInteger) +import Plutarch.Unit (PUnit (PUnit)) + +import Plutarch.Internal.Other ( + DerivePNewtype, + PInner, + POpaque, + PType, + S, + Term, + pcon, + pdelay, + pforce, + plam, + plet, + popaque, + (#), + type (:-->), + ) + +import Plutarch.Trace (ptraceError) + +import Plutarch.DataRepr.Internal.HList (HRec (HCons, HNil), HRecGeneric (HRecGeneric), Labeled (Labeled)) + +import Plutarch.DataRepr.Internal ( + PDataRecord, + PDataSum, + PLabeledType ((:=)), + pdnil, + ) + +import Plutarch.List ( + phead, + pmap, + ptail, + ) + +import Plutarch.Builtin ( + PAsData, + PBuiltinList, + PBuiltinMap, + PBuiltinPair, + PData, + PIsData (pfromData), + pasByteStr, + pasConstr, + pasInt, + pasList, + pasMap, + pchooseListBuiltin, + pdata, + pforgetData, + pfstBuiltin, + ppairDataBuiltin, + psndBuiltin, + ) + +import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) + +import Plutarch.DataRepr.Internal (PIsDataRepr (PIsDataReprRepr), PIsDataReprInstances) + +import Plutarch.Reducible (Reducible (Reduce)) + +import Data.Functor.Const (Const) + +import Data.Kind (Type) + +import Data.Coerce (coerce) + +----------------------- The class PTryFrom ---------------------------------------------- + +{- | + This checks the data structure for validity. + If you don't care about parts of the structure + don't verify those parts, just put a `PData` at + the places you don't care about. + Be aware this might get really expensive, so only + use it if you cannot establish trust otherwise + (e.g. via only checking a part of your Data with + PTryFrom) + Laws: + - the operation `ptryFrom` mustn't change the representation of the underlying data + - the operation `ptryFrom` must always prove the integrity of the whole target type + - example: + `ptryFrom PData (PAsData (PBuiltinList PData))` must only succeed if the underlying + representation is a `BuiltinList` containing any `PData` + - all conversions are fallible, this happens if the representation doesn't match + the expected type. + - the operation `ptryFrom @b @a` proves equality between the less expressive `PType` `a` and + the more expressive `PType` `b`, hence the first element of the resulting Tuple + must always be wrapped in `PAsData` if the origin type was `PData` (see law 1) + - the result type `b` must always be safe than the origin type `a`, i.e. it must carry + more information +-} +class PTryFrom (a :: PType) (b :: PType) where + type PTryFromExcess a b :: PType + ptryFrom' :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r + +ptryFrom :: forall b a s r. PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r +ptryFrom = ptryFrom' + +----------------------- Reducible and Flip ---------------------------------------------- + +instance Reducible (f x y) => Reducible (Flip f y x) where + type Reduce (Flip f y x) = Reduce (f x y) + +newtype Flip f a b = Flip (f b a) + +----------------------- HRecP and friends ----------------------------------------------- + +type family HRecPApply (as :: [(Symbol, PType)]) (s :: S) :: [Type] where + HRecPApply ('(name, ty) ': rest) s = Labeled name (Reduce (ty s)) ': HRecPApply rest s + HRecPApply '[] s = '[] + +newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (HRecGeneric (HRecPApply as s)) + +instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecGeneric (HRecPApply as s) + +----------------------- PData instances ------------------------------------------------- + +instance PTryFrom PData (PAsData PInteger) where + type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger + ptryFrom' opq = runTermCont $ do + ver <- tcont $ plet (pasInt # opq) + pure $ (punsafeCoerce opq, ver) + +instance PTryFrom PData (PAsData PByteString) where + type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString + ptryFrom' opq = runTermCont $ do + ver <- tcont $ plet (pasByteStr # opq) + pure $ (punsafeCoerce opq, ver) + +instance + ( PTryFrom PData (PAsData a) + , PTryFrom PData (PAsData b) + ) => + PTryFrom PData (PAsData (PBuiltinMap a b)) + where + type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = Flip Term (PBuiltinMap a b) + ptryFrom' opq = runTermCont $ do + verMap <- tcont $ plet (pasMap # opq) + let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) + verifyPair = plam $ \tup -> unTermCont $ do + (verfst, _) <- tcont $ ptryFrom @(PAsData a) $ pfstBuiltin # tup + (versnd, _) <- tcont $ ptryFrom @(PAsData b) $ psndBuiltin # tup + pure $ ppairDataBuiltin # verfst # versnd + ver <- tcont $ plet $ pmap # verifyPair # verMap + pure (punsafeCoerce opq, ver) + +{- | + This verifies a list to be indeed a list but doesn't recover the inner data + use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData a)))` + as this is O(1) instead of O(n) +-} + +-- TODO: add the excess inner type list +instance PTryFrom PData (PAsData (PBuiltinList PData)) where + type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) + ptryFrom' opq = runTermCont $ do + ver <- tcont $ plet (pasList # opq) + pure $ (punsafeCoerce opq, ver) + +{- | + Recover a `PBuiltinList (PAsData a)` +-} +instance + ( PTryFrom PData (PAsData a) + , PIsData a + ) => + PTryFrom PData (PAsData (PBuiltinList (PAsData a))) + where + type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = Flip Term (PBuiltinList (PAsData a)) + ptryFrom' opq = runTermCont $ do + let lst :: Term _ (PBuiltinList PData) + lst = pasList # opq + verify :: Term _ (PData :--> PAsData a) + verify = plam $ \e -> + unTermCont $ do + (wrapped, _) <- tcont $ ptryFrom @(PAsData a) $ e + pure wrapped + ver <- tcont $ plet $ pmap # verify # lst + pure $ (punsafeCoerce opq, ver) + +{- | + Recover a `PAsData (PBuiltinPair a b)` +-} +instance + ( PTryFrom PData a + , a ~ PAsData a' + , PIsData a' + , PTryFrom PData b + , b ~ PAsData b' + , PIsData b' + ) => + PTryFrom PData (PAsData (PBuiltinPair a b)) + where + type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = Flip Term (PBuiltinPair a b) + ptryFrom' opq = runTermCont $ do + tup <- tcont $ plet (pfromData $ punsafeCoerce opq) + let fst' :: Term _ a + fst' = unTermCont $ fst <$> tcont (ptryFrom @a $ pforgetData $ pfstBuiltin # tup) + snd' :: Term _ b + snd' = unTermCont $ fst <$> tcont (ptryFrom @b $ pforgetData $ psndBuiltin # tup) + ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' + pure $ (punsafeCoerce opq, ver) + +----------------------- PDataRecord instances ------------------------------------------- + +-- We could have a more advanced instance but it's not needed really. + +newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) + +instance Reducible (PTryFromExcess PData (PAsData a) s) => Reducible (ExcessForField a s) where + type Reduce (ExcessForField a s) = (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) + +-- FIXME: Should we always succede? If we always succede, performance would increase a lot. +instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where + type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] + ptryFrom' opq = runTermCont $ do + _ :: Term _ PUnit <- + tcont . plet . pforce $ + pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") + pure (pdnil, HRecGeneric HNil) + +type family UnHRecP (x :: PType) :: [(Symbol, PType)] where + UnHRecP (HRecP as) = as + +instance + ( PTryFrom PData (PAsData pty) + , PTryFrom (PBuiltinList PData) (PDataRecord as) + , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase + ) => + PTryFrom (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) + where + type + PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) = + HRecP + ( '(name, ExcessForField pty) + ': UnHRecP (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) + ) + ptryFrom' opq = runTermCont $ do + h <- tcont $ plet $ phead # opq + hv <- tcont $ ptryFrom @(PAsData pty) @PData h + t <- tcont $ plet $ ptail # opq + tv <- tcont $ ptryFrom @(PDataRecord as) @(PBuiltinList PData) t + pure (punsafeCoerce opq, HRecGeneric (HCons (Labeled hv) (coerce $ snd tv))) + +newtype Helper a b s = Helper (a s, b s) + +instance (Reducible (a s), Reducible (b s)) => Reducible (Helper a b s) where + type Reduce (Helper a b s) = (Reduce (a s), Reduce (b s)) + +instance + ( PTryFrom (PBuiltinList PData) (PDataRecord as) + , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase + ) => + PTryFrom PData (PAsData (PDataRecord as)) + where + type + PTryFromExcess PData (PAsData (PDataRecord as)) = + Helper (Flip Term (PDataRecord as)) (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) + ptryFrom' opq = runTermCont $ do + l <- snd <$> (tcont $ ptryFrom @(PAsData (PBuiltinList PData)) opq) + r <- tcont $ ptryFrom @(PDataRecord as) l + pure (punsafeCoerce opq, r) + +instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where + type PTryFromExcess PData (PAsData (PDataSum ys)) = Const () + ptryFrom' opq = runTermCont $ do + x <- tcont $ plet $ pasConstr # opq + constr <- tcont $ plet $ pfstBuiltin # x + fields <- tcont $ plet $ psndBuiltin # x + _ <- tcont $ plet $ validateSum @0 @ys constr fields + pure (punsafeCoerce opq, ()) + +class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where + validateSum :: Term s PInteger -> Term s (PBuiltinList PData) -> Term s POpaque + +instance + {-# OVERLAPPABLE #-} + forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). + ( PTryFrom (PBuiltinList PData) (PDataRecord x) + , SumValidation (n + 1) xs + , KnownNat n + ) => + SumValidation n (x ': xs) + where + validateSum constr fields = + pif + (fromInteger (natVal $ Proxy @n) #== constr) + ( unTermCont $ do + _ <- tcont $ ptryFrom @(PDataRecord x) fields + pure $ popaque $ pcon PUnit + ) + (validateSum @(n + 1) @xs constr fields) + +instance {-# OVERLAPPING #-} SumValidation n '[] where + validateSum _ _ = ptraceError "reached end of sum while still not having found the constructor" + +----------------------- other utility functions ----------------------------------------- + +{- | if there is an instance to recover something that is unwrapped from something that is + unwrapped, then there is also the possibility to recover the whole thing but wrapped +-} +instance + ( PTryFrom a b + , PIsData a + , PIsData b + ) => + PTryFrom (PAsData a) (PAsData b) + where + type PTryFromExcess (PAsData a) (PAsData b) = PTryFromExcess a b + ptryFrom' opq = runTermCont $ do + ver' <- snd <$> TermCont (ptryFrom @b @a (pfromData opq)) + pure $ (punsafeCoerce opq, ver') + +instance PTryFrom PData PData where + type PTryFromExcess PData PData = Const () + ptryFrom' opq = runTermCont $ pure $ (opq, ()) + +instance PTryFrom PData (PAsData PData) where + type PTryFromExcess PData (PAsData PData) = Const () + ptryFrom' opq = runTermCont $ pure (pdata opq, ()) + +----------------------- PIsDataReprInstances instance ----------------------------------- + +-- | you can instantiate `PTryFrom` for your own datatype as demonstrated in the spec +instance + ( PIsDataRepr a + , SumValidation 0 (PIsDataReprRepr a) + , PInner a b ~ PDataSum (PIsDataReprRepr a) + ) => + PTryFrom PData (PAsData (PIsDataReprInstances a)) + where + type PTryFromExcess PData (PAsData (PIsDataReprInstances a)) = Const () + ptryFrom' opq = runTermCont $ do + let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) + reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) + pure $ (pdata $ punsafeFrom reprsum, ()) + +----------------------- DerivePNewtype insatace ----------------------------------------- + +instance + ( PTryFrom a b + ) => + PTryFrom a (DerivePNewtype c b) + where + type PTryFromExcess a (DerivePNewtype c b) = PTryFromExcess a b + ptryFrom' opq = runTermCont $ (\(inn, exc) -> (punsafeFrom inn, exc)) <$> tcont (ptryFrom @b @a opq) diff --git a/Plutarch/Unit.hs b/Plutarch/Unit.hs index 8b5f2df36..ec9f14f80 100644 --- a/Plutarch/Unit.hs +++ b/Plutarch/Unit.hs @@ -12,8 +12,10 @@ import Plutarch.Lift ( PUnsafeLiftDecl, pconstant, ) +import Plutarch.Show (PShow (pshow')) data PUnit s = PUnit + instance PUnsafeLiftDecl PUnit where type PLifted PUnit = () deriving via (DerivePConstantDirect () PUnit) instance (PConstant ()) @@ -34,3 +36,6 @@ instance Semigroup (Term s PUnit) where instance Monoid (Term s PUnit) where mempty = pcon PUnit + +instance PShow PUnit where + pshow' _ _ = "()" diff --git a/README.md b/README.md index 53c6deabb..6ef33cb65 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ Plutarch is a typed eDSL in Haskell for writing efficient Plutus Core validators # Why Plutarch? Plutarch written validators are often significantly more efficient than Plutus Tx written validators. With Plutarch, you have much more fine gained control of the Plutus Core you generate, without giving up any type information. -To put things into perspective, one validator script from a large production contract was rewritten in Plutarch, changed from Plutus Tx. Here's the comparison between the Plutarch script's execution cost compared to the Plutus Tx script's execution cost. These numbers were gathered by simulating the whole contract flow on a testnet- +To put things into perspective, one validator script from a large production contract was rewritten in Plutarch, changed from Plutus Tx. Here's the comparison between the Plutarch script's execution cost compared to the Plutus Tx script's execution cost. These numbers were gathered by simulating the whole contract flow on a testnet: + | Version | CPU | Memory | Script Size | | ------------------ | ----------- | ------- | ----------- | | PlutusTx (current) | 198,505,651 | 465,358 | 2013 | @@ -31,7 +32,7 @@ This package takes in a flag, `development`, that defaults to false. It's used t | -- | --- | | Tracing functions from `Plutarch.Trace` log given message to the trace log. | Tracing functions from `Plutarch.Trace` do not log. They merely return their argument. | -You can turn on development mode by passing in the `development` flag in your `cabal.project` file- +You can turn on development mode by passing in the `development` flag in your `cabal.project` file: ```hs package plutarch flags: +development @@ -39,10 +40,10 @@ package plutarch # Benchmarks -See the [`plutarch-benchmark`](./plutarch-benchmark) library for how to benchmark plutarch, and benchmarking your own scripts. +See the [`plutarch-test`](./plutarch-test) for testing and golden files containing benchmarks and UPLCs. # Usage -Read the [Plutarch guide](./docs/GUIDE.md) to get started! +Read the [Plutarch guide](./docs/README.md) to get started! # Contributing Contributions are more than welcome! Alongside the [User guide](#usage) above, you may also find the [Developers' guide](./docs/DEVGUIDE.md) useful for understanding the codebase. diff --git a/ci.nix b/ci.nix deleted file mode 100644 index 1f71eca89..000000000 --- a/ci.nix +++ /dev/null @@ -1,3 +0,0 @@ -if builtins?getFlake -then (builtins.getFlake (toString ./.)).ciNix -else (import ./flake-compat.nix).defaultNix.ciNix diff --git a/docs/Concepts.md b/docs/Concepts.md new file mode 100644 index 000000000..56707e063 --- /dev/null +++ b/docs/Concepts.md @@ -0,0 +1,11 @@ +This section describes various concepts applicable in Plutarch. + +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +- [Hoisting, metaprogramming, and fundamentals](./Concepts/Hoisting.md) + - [Hoisting Operators](./Concepts/Hoisting.md#hoisting-operators) +- [What is the `s`?](./Concepts/What%20is%20the%20S.md#what-is-the-s) +- [Data encoding and Scott encoding](./Concepts/Data%20and%20Scott%20encoding.md) + - [Data encoding](./Concepts/Data%20and%20Scott%20encoding.md#data-encoding) + - [Scott encoding](./Concepts/Data%20and%20Scott%20encoding.md#scott-encoding) +- [Haskell synonym of Plutarch types](./Concepts/Haskell%20Synonym.md) diff --git a/docs/Concepts/Data and Scott encoding.md b/docs/Concepts/Data and Scott encoding.md new file mode 100644 index 000000000..9bde875a7 --- /dev/null +++ b/docs/Concepts/Data and Scott encoding.md @@ -0,0 +1,77 @@ +# Data encoding and Scott encoding + +In Plutus Core, there are really two (conflicting) ways to represent non-trivial ADTs: [`Constr`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:Data) data encoding, or Scott encoding. You should use only one of these representations for your non-trivial types. + +> Aside: What's a "trivial" type? The non-data builtin types! `PInteger`, `PByteString`, `PBuiltinList`, `PBuiltinPair`, and `PMap` (actually just a builtin list of builtin pairs). It's important to note that [`Data`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:Data) (`Constr` or otherwise) is also a builtin type. + +## Data encoding + +`Constr` data is essentially a sum-of-products representation. However, it can only contain other `Data` values (not necessarily just `Constr` data, could be `I` data, `B` data etc.) as its fields. Plutus Core famously lacks the ability to represent functions using this encoding, and thus `Constr` encoded values simply cannot contain functions. + +> Note: You can find out more about the deep details of `Data`/`BuiltinData` at [plutonomicon](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). + +With that said, `Data` encoding is _ubiquitous_ on the chain. It's the encoding used by the ledger api types, it's the type of the arguments that can be passed to a script on the chain etc. As a result, your datums and redeemers _must_ use data encoding. + +## Scott encoding + +On the opposite (and conflicting) end, is Scott encoding. [The internet](https://crypto.stanford.edu/~blynn/compiler/scott.html) can explain Scott encoding way better than I can. But I'll be demonstrating Scott encoding with an example anyway. + +Firstly, what good is Scott encoding? Well it doesn't share the limitation of not being able to contain functions! However, you cannot use Scott encoded types within, for example, your datums and redeemers. + +Briefly, Scott encoding is a way to represent data with functions. The Scott encoded representation of `Maybe a` would be: + +```hs +(a -> b) -> b -> b +``` + +`Just 42`, for example, would be represented as this function: + +```hs +\f _ -> f 42 +``` + +Whereas `Nothing` would be represented as this function: + +```hs +\_ n -> n +``` + +We covered construction. What about usage/deconstruction? That's also just as simple. Let's say you have a function, `foo :: Maybe Integer -> Integer`, it takes in a Scott encoded `Maybe Integer`, and adds `42` to its `Just` value. If it's `Nothing`, it just returns `0`. + +```hs +{-# LANGUAGE RankNTypes #-} + +import Prelude (Integer, (+)) + +type Maybe a = forall b. (a -> b) -> b -> b + +just :: a -> Maybe a +just x = \f _ -> f x + +nothing :: Maybe a +nothing = \_ n -> n + +foo :: Maybe Integer -> Integer +foo mb = mb (\x -> x + 42) 0 +``` + +How does that work? Recall that `mb` is really just a function. Here's how the application of `f` would work: + +```hs +foo (just 1) +foo (\f _ -> f 1) +(\f _ -> f 1) (\x -> x + 42) 0 +(\x -> x + 42) 1 +43 +``` + +```hs +foo nothing +foo (\_ n -> n) +(\_ n -> n) (\x -> x + 42) 0 +0 +``` + +Neat! + +This is the same recipe followed in the implementation of `PMaybe`. See its [PlutusType impl](./../Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md)! diff --git a/docs/Concepts/Haskell Synonym.md b/docs/Concepts/Haskell Synonym.md new file mode 100644 index 000000000..4191e2958 --- /dev/null +++ b/docs/Concepts/Haskell Synonym.md @@ -0,0 +1,9 @@ +# Haskell synonym of Plutarch types + +Several sections of the guide use the terminology "Haskell synonym". What does it mean? It's simply the Haskell type that _is supposed to_ correspond to a Plutarch type. There doesn't _necessarily_ have to be some sort of concrete connection (though there can be, using [`PLift`/`PConstant`](./../Typeclasses/PConstant%20and%20PLift.md)) - it's merely a connection you can establish mentally. + +This detail does come into play in concrete use cases though. After compiling your Plutarch code to a `Script`, when you pass Haskell data types as arguments to the `Script` - they obviously need to correspond to the actual arguments of the Plutarch code. For example, if the Plutarch code is a function taking `PByteString`, after compilation to `Script`, you _should_ pass in the Haskell data type that actually shares the same representation as `PByteString` - the "Haskell synonym", so to speak. In this case, that's `ByteString`\*. + +\[\*]: You can't actually pass a `ByteString` into a compiled `Script` through the [`Plutus.V1.Ledger.Scripts`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Scripts.html) API. Notice that you can only pass `Data` arguments using [`applyArguments`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Scripts.html#v:applyArguments). The Haskell synonym to `Data` is `PAsData a` (for any `a`), and `PData`. + +Also see: [Figuring out the representation of a Plutarch type](./../Tricks/Representation%20of%20Plutarch%20type.md). diff --git a/docs/Concepts/Hoisting.md b/docs/Concepts/Hoisting.md new file mode 100644 index 000000000..bb302eaf7 --- /dev/null +++ b/docs/Concepts/Hoisting.md @@ -0,0 +1,68 @@ +# Hoisting, metaprogramming, and fundamentals + +Plutarch has a two-stage compilation process. First GHC compiles our code, then our code generates an _AST_ of our Plutus script, which is then serialized using `compile`. + +The important thing to note, is that when you have a definition like: + +```haskell +x :: Term s PInteger +x = something complex +``` + +Any use of `x` will inline the **full definition** of `x`. `x + x` will duplicate `something complex` in the AST. To avoid this, you should [use `plet` in order to avoid duplicate work](./../Tricks/Don't%20duplicate%20work.md). Do note that this is **strictly evaluated, and hence isn't always the best solution.** + +There is however still a problem: what about top-level functions like `fib`, `sum`, `filter`, and such? We can use `plet` to avoid duplicating the definition, but this is error-prone. To do this perfectly means that each function that generates part of the AST would need to have access to the `plet`'ed definitions, meaning that we'd likely have to put it into a record or typeclass. + +To solve this problem, Plutarch supports _hoisting_. Hoisting only works for _closed terms_, that is, terms that don't reference any free variables (introduced by `plam`). + +Hoisted terms are essentially moved to a top-level `plet`, i.e. it's essentially common sub-expression elimination. Do note that because of this, your hoisted term is **also strictly evaluated**, meaning that you _shouldn't_ hoist non-lazy complex computations (use [`pdelay`](./../Introduction/Delay%20and%20Force.md) to avoid this). + +In general, you should use `phoistAcyclic` on every top level function: + +```hs +foo = phoistAcyclic $ plam $ \x -> +``` + +As long as the Plutarch lambda you're hoisting does not have [free variables](https://wiki.haskell.org/Free_variable) (as Plutarch terms), you will be able to hoist it! + +## Hoisting Operators + +For the sake of convenience, you often would want to use operators - which must be Haskell level functions. This is the case for `+`, `-`, `#==` and many more. + +Choosing convenience over efficiency is difficult, but if you notice that your operator uses complex logic and may end up creating big terms - you can trivially factor out the logic into a Plutarch level function, hoist it, and simply apply that function within the operator. + +Consider "boolean or": + +```hs +(#||) :: Term s PBool -> Term s PBool -> Term s PBool +x #|| y = pif x (pconstant True) $ pif y (pconstant True) $ pconstant False +``` + +You can factor out most of the logic to a Plutarch level function, and apply that in the operator definition: + +```hs +(#||) :: Term s PBool -> Term s PBool -> Term s PBool +x #|| y = pforce $ por # x # pdelay y + +por :: Term s (PBool :--> PDelayed PBool :--> PDelayed PBool) +por = phoistAcyclic $ plam $ \x y -> pif' # x # pdelay (pconstant True) # y +``` + +In general the pattern goes like this: + +```hs +() :: Term s x -> Term s y -> Term s z +x y = f # x # y + +f :: Term s (x :--> y :--> z) +f = phoistAcyclic $ plam $ \x y -> +``` + +(OR, simply inlined) + +```hs +() :: Term s x -> Term s y -> Term s z +x y = (\f -> f # x # y) $ phoistAcyclic $ plam $ \x y -> +``` + +> Note: You don't even need to export the Plutarch level function or anything! You can simply have that complex logic factored out into a _hoisted, internal Plutarch function_ and everything will work just fine! diff --git a/docs/Concepts/What is the S.md b/docs/Concepts/What is the S.md new file mode 100644 index 000000000..9dd759250 --- /dev/null +++ b/docs/Concepts/What is the S.md @@ -0,0 +1,10 @@ +# What is the `s`? + +The `s` essentially represents the context, and is like the `s` of `ST`. + +It's used to distinguish between closed and open terms: + +- Closed term: `type ClosedTerm = forall s. Term s a` +- Arbitrary term: `exists s. Term s a` +- NB: `(exists s. Term s a) -> b` is isomorphic to +- `forall s. Term s a -> b` diff --git a/docs/DEVGUIDE.md b/docs/DEVGUIDE.md index 4eac2f154..7af2f0d60 100644 --- a/docs/DEVGUIDE.md +++ b/docs/DEVGUIDE.md @@ -1,5 +1,7 @@ Looking to contribute to Plutarch? Looking for functionalities that are not currently provided by Plutarch from a safe interface? You've come to the right place! +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch developers! +
Table of Contents @@ -15,44 +17,51 @@ Looking to contribute to Plutarch? Looking for functionalities that are not curr - [Lower Level Examples](#lower-level-examples) - [Extracting `txInfoInputs` from `ScriptContext` manually (UNTYPED)](#extracting-txinfoinputs-from-scriptcontext-manually-untyped) - [Useful Links](#useful-links) -
+- [How to build docs](#how-to-build-docs) -> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch developers! + # Code Style + You should generally follow the [MLabs style guide](https://github.com/mlabs-haskell/styleguide), credit to [@Koz Ross](https://github.com/kozross). **Discouraged Extensions** -* `ImportQualifiedPost` -* `RecordWildCards` + +- `ImportQualifiedPost` +- `RecordWildCards` # Pre-commit checks + Remember to run `./bin/format` to format your code and `cabal test`, alongside `cabal test -f development`, to make sure all the tests pass prior to making a PR! # Updating Changelog + If your PR makes a change to some user facing functionality - please summarize the change(s) and add it to `CHANGELOG.md`. # Targeting branch for PR + More often than not, you'll be making PRs directly to `master`. However, sometimes, there is a release cycle going on and the state of the repository is in flux. There will usually be a `master <- staging` PR open during this time. As long as the `staging` PR is open, you should base most new branches on top of it and merge back into it. Bug fixes, for bugs present in `master`, are exempt from this requirement. # Concepts + Even if certain functionalities are absent from the public facing API - you can always implement them using functions like `punsafeConstant` and `punsafeBuiltin` - these allow you to walk the lines between Plutus core and Plutarch. -A general familiarity with Plutus core is important. You can learn all of that through the following documents- -* [Builtin lists](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-lists.md) -* [Builtin pairs](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-pairs.md) -* [Builtin functions](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-functions.md) -* [Builtin data](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md) +A general familiarity with Plutus core is important. You can learn all of that through the following documents: + +- [Builtin lists](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-lists.md) +- [Builtin pairs](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-pairs.md) +- [Builtin functions](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-functions.md) +- [Builtin data](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md) Parts of the [Pluto guide](https://github.com/Plutonomicon/pluto/blob/main/GUIDE.md) may also prove useful. ## Plutus Core constants (UNSAFE) -> **NOTE**: The following information is almost never necessary with the existence of `pconstant`. Refer to [constant building](./GUIDE.md#constants) and [`PConstant`/`PLift`](./GUIDE.md#pconstant--plift) section of the Plutarch user guide. +> **NOTE**: The following information is almost never necessary with the existence of `pconstant`. Refer to [constant building](Introduction/Plutarch%20Terms/Plutarch%20Constants.md) and [`PConstant`/`PLift`](./Typeclasses/PConstant%20and%20PLift.md) section of the Plutarch user guide. -Often, you will need to build a Plutus core constant. You can do this using `Some` and `ValueOf`. Here's how `pcon PTrue` creates a Plutarch term that actually evaluates to a Plutus core constant representing a boolean- +Often, you will need to build a Plutus core constant. You can do this using `Some` and `ValueOf`. Here's how `pcon PTrue` creates a Plutarch term that actually evaluates to a Plutus core constant representing a boolean: ```haskell import qualified PlutusCore as PLC @@ -61,7 +70,7 @@ pcon' PTrue = punsafeConstant . PLC.Some $ PLC.ValueOf PLC.DefaultUniBool True pcon' PFalse = punsafeConstant . PLC.Some $ PLC.ValueOf PLC.DefaultUniBool False ``` -There's a lot to unpack here - but the general pattern is always the same. First step is to construct the Plutus core constant- +There's a lot to unpack here - but the general pattern is always the same. First step is to construct the Plutus core constant: ```haskell PLC.Some $ PLC.ValueOf PLC.DefaultUniBool True @@ -82,7 +91,7 @@ punsafeConstant . PLC.Some . PLC.ValueOf PLC.DefaultUniString . Txt.pack And that's _essentially_ what the `IsString` implementation of `Term s PString` does. That is how your string literals end up as plutus core built in strings. -One more, how about something complex - `DefaultUniProtoList`. This is a builtin list. But what is the element type? Well, you'll have to specify that yourself! You use `DefaultUniApply` to "apply" a type (from the default universe) over `DefaultUniProtoList`- +One more, how about something complex - `DefaultUniProtoList`. This is a builtin list. But what is the element type? Well, you'll have to specify that yourself! You use `DefaultUniApply` to "apply" a type (from the default universe) over `DefaultUniProtoList`: ```haskell import qualified PlutusCore as PLC @@ -92,13 +101,13 @@ PLC.Some . PLC.ValueOf (PLC.DefaultUniProtoList `PLC.DefaultUniApply` PLC.Defaul That right there converts a `[Integer]` into a Plutus core builtin list of builtin integers. Convenient! -Actually, there's a convenient `pattern` synonym for ``DefaultUniProtoList `DefaultUniApply` a``- `DefaultUniList a`. Using that, you can simplify the above to- +Actually, there's a convenient `pattern` synonym for ``DefaultUniProtoList `DefaultUniApply` a``- `DefaultUniList a`. Using that, you can simplify the above to: ```haskell PLC.Some . PLC.ValueOf (PLC.DefaultUniList PLC.DefaultUniInteger) ``` -Note that you will have to provide the correct type annotations yourself, as `punsafeConstant` just infers to a `Term s a`. That's why it's unsafe! Make sure to provide the correct annotations when using this unsafe function- +Note that you will have to provide the correct type annotations yourself, as `punsafeConstant` just infers to a `Term s a`. That's why it's unsafe! Make sure to provide the correct annotations when using this unsafe function: ```haskell foo :: Bool -> Term s PBool @@ -128,7 +137,7 @@ You can use and apply this Plutarch function just like any other. Now here's where this goes off the rails, some builtin functions require _forces_ to be used. These builtin functions have inherent polymorphic type variables. The number of times you need to force them, depends on the number of type variables they have. -Let's look at an example- `HeadList`. It's type can be thought of as - `forall a. [a] → a`. It has one type variable, so it needs to be forced once- +Let's look at an example- `HeadList`. It's type can be thought of as - `forall a. [a] -> a`. It has one type variable, so it needs to be forced once: ```haskell pheadBuiltin :: Term s (PBuiltinList a :--> a) @@ -137,7 +146,7 @@ pheadBuiltin = pforce $ punsafeBuiltin PLC.HeadList We force a Plutarch term using `pforce`, recall that `punsafeBuiltin` returns a term. You need to type it all yourself of course. `pforce` doesn't mean you need to get rid of the type variable in your Plutarch level type. It'll still work with any `a` - the forcing just has to happen at call site. -You can sort of do this blindly, `HeadList` takes 1 force, so just `pforce` once. `TailList` also takes 1 force. `ChooseList` takes 2 forces (`forall a b. [a] → b → b → b`). Here's how you would implement a Plutarch synonym for it- +You can sort of do this blindly, `HeadList` takes 1 force, so just `pforce` once. `TailList` also takes 1 force. `ChooseList` takes 2 forces (`forall a b. [a] -> b -> b -> b`). Here's how you would implement a Plutarch synonym for it: ```haskell pchooseList :: Term s (PBuiltinList a :--> b -> b -> b) @@ -157,11 +166,14 @@ Plutarch aims to hide these low level details from the user. Ideally, you will b If you want to work with `BuiltinData` directly however, which you may have to do during developing Plutarch, you can find all that you need to know at [Plutonomicon](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). ## `PConstant` and `PLift` + TODO # Lower Level Examples + ## Extracting `txInfoInputs` from `ScriptContext` manually (UNTYPED) -Here's a quick refresher on what `ScriptContext` looks like- + +Here's a quick refresher on what `ScriptContext` looks like: ```haskell data ScriptContext = ScriptContext @@ -170,7 +182,7 @@ data ScriptContext = ScriptContext } ``` -We are interested in `txInfoInputs`, which has type `TxInInfo`. It is the first field within `TxInfo`. If you have read [Working with `BuiltinData`](#working-with-builtindatadatapdata) already - you know that a `ScriptContext` translates to a `Data` value similar to- +We are interested in `txInfoInputs`, which has type `TxInInfo`. It is the first field within `TxInfo`. If you have read [Working with `BuiltinData`](#working-with-builtindatadatapdata) already - you know that a `ScriptContext` translates to a `Data` value similar to: ```haskell Constr 0 [PlutusTx.toData txInfo, PlutusTx.toData txPurpose] @@ -178,13 +190,13 @@ Constr 0 [PlutusTx.toData txInfo, PlutusTx.toData txPurpose] Where `txInfo` and `txPurpose` are values of type `TxInfo` and `ScriptPurpose` respectively. -We are interested in that first field. That's easy, we do the following actions in sequence- +We are interested in that first field. That's easy, we do the following actions in sequence: - `pasConstr` - yields a `PBuiltinPair PInteger (PBuiltinList PData)`. We know the constructor id is `0`. It doesn't matter, there's only one constructor. - `psndBuiltin` - yields `PBuiltinList PData`, the second element of the pair. These are the fields within `ScriptContext`. - `phead` - yields `PData`, the first field. We know this is our `TxInfo`. -Combining that all up would give you- +Combining that all up would give you: ```haskell import Plutarch.Prelude @@ -194,9 +206,15 @@ f :: Term s (PData :--> PData) f = plam $ \x -> phead #$ psndBuiltin #$ pasConstr # x ``` -And if you test it with a mock context value, it does work- +And if you test it with a mock context value, it does work: ```haskell +{-# LANGUAGE OverloadedStrings #-} + +import Plutus.V1.Ledger.Api +import Plutus.V1.Ledger.Interval +import qualified PlutusTx + mockCtx :: ScriptContext mockCtx = ScriptContext @@ -221,20 +239,20 @@ mockCtx = Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf data (Constr 0 [List [Constr 0 [Constr 0 [Constr 0 [B ""],I 1],Constr 0 [Constr 0 [Constr 0 [B "\SOH#"],Constr 1 []],Map [],Constr 1 []]]],List [],Map [],Map [],List [],List [],Constr 0 [Constr 0 [Constr 1 [I 1],Constr 1 []],Constr 0 [Constr 1 [I 2],Constr 1 []]],List [],List [],Constr 0 [B ""]]))))) ``` -> Aside: You can find the definition of `evalWithArgsT` above - [Compiling and Running](./GUIDE.md#compiling-and-running). +> Aside: You can find the definition of `evalWithArgsT` above - [Compiling and Running](./README.md#compiling-and-running). But we're not done yet! We want `txInfoInputs`. You may have noticed where exactly it is located on the above output. See that `List …`? Inside the outermost `Constr`'s fields? That's our `txInfoInputs`! > Aside: Recall that `List` data values are simply wrappers around lists. Also recall that the fields in a `Constr` value must be all of type `Data`. So any of your list fields get translated to `List` data. Just remember not to confuse these with builtin lists (`PBuiltinList`)! Functions like `pheadBuiltin` don't work on `List` data values. -To obtain `txInfoInputs` from here, we do the following actions in sequence- +To obtain `txInfoInputs` from here, we do the following actions in sequence: - `pasConstr` - unpacks the `TxInfo`. There's only one constructor, `TxInfo` - we don't care about that. We need the fields. - `psndBuiltin` - extracts the second member of the pair, the fields of `TxInfo`. - `phead` - extracts the first element of the list. This is our field, `txInfoInputs`. - (optional) `pasList` - takes out the builtin list from the `List` data value. -And that's it! Putting it all together- +And that's it! Putting it all together: ```haskell f :: Term s (PData :--> PBuiltinList PData) @@ -243,14 +261,14 @@ f = plam $ \x -> in pasList #$ phead #$ psndBuiltin #$ pasConstr # txInfo ``` -Trying it on the same `mockCtx` yields- +Trying it on the same `mockCtx` yields: ```haskell > f `evalWithArgsT` [PlutusTx.toData mockCtx] Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf list (data) [Constr 0 [Constr 0 [Constr 0 [B ""],I 1],Constr 0 [Constr 0 [Constr 0 [B "\SOH#"],Constr 1 []],Map [],Constr 1 []]]])))) ``` -Getting some of the boilerplate out of the way, this is what the value looks like- +Getting some of the boilerplate out of the way, this is what the value looks like: ```haskell Some @@ -264,6 +282,7 @@ Some There's just one element in `txInfoInputs` in this example, and there it is. Of course `TxInInfo`, the element type of this list, also gets translated to a `Constr` data with further fields. And that's what you see above. # Useful Links + - [Builtin lists](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-lists.md) - [Builtin pairs](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-pairs.md) - [Builtin functions](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-functions.md) @@ -271,3 +290,23 @@ There's just one element in `txInfoInputs` in this example, and there it is. Of - [Plutus builtin functions and types](https://playground.plutus.iohkdev.io/doc/haddock//plutus-tx/html/PlutusTx-Builtins-Internal.html) - [Plutus Core builtin function identifiers, aka `DefaultFun`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultFun) - [Plutus Core types, aka `DefaultUni`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultUni) + +# How to build docs + +To run the docs locally from the Git working copy (useful when editing them), + +```sh-session +nix run .#docs +``` + +To build the static HTML site, + +```sh-session +nix build .#website +``` + +To run the docs directly without cloning the Git repo, + +```sh-session +nix run github:Plutonomicon/plutarch#website +``` diff --git a/docs/GUIDE.md b/docs/GUIDE.md deleted file mode 100644 index 66d7d40ae..000000000 --- a/docs/GUIDE.md +++ /dev/null @@ -1,2114 +0,0 @@ -> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! - -
- Table of Contents - -- [Overview](#overview) - - [Compiling and Running](#compiling-and-running) - - [Common Extensions and GHC options](#common-extensions-and-ghc-options) - - [Evaluation](#evaluation) - - [Syntax](#syntax) - - [Constants](#constants) - - [Lambdas](#lambdas) - - [Delayed terms and Forcing](#delayed-terms-and-forcing) - - [Usage](#usage) - - [Applying functions](#applying-functions) - - [Conditionals](#conditionals) - - [Recursion](#recursion) - - [Do syntax with `QualifiedDo` and `Plutarch.Monadic`](#do-syntax-with-qualifieddo-and-plutarchmonadic) - - [Translating `do` syntax with `QualifiedDo` to GHC 8](#translating-do-syntax-with-qualifieddo-to-ghc-8) - - [Do syntax with `TermCont`](#do-syntax-with-termcont) - - [Deriving typeclasses for `newtype`s](#deriving-typeclasses-for-newtypes) - - [Deriving typeclasses with generics](#deriving-typeclasses-with-generics) - - [Concepts](#concepts) - - [Hoisting, metaprogramming, and fundamentals](#hoisting-metaprogramming--and-fundamentals) - - [Hoisting Operators](#hoisting-operators) - - [What is the `s`?](#what-is-the-s) - - [eDSL Types in Plutarch](#edsl-types-in-plutarch) - - [`plet` to avoid work duplication](#plet-to-avoid-work-duplication) - - [Tracing](#tracing) - - [Raising errors](#raising-errors) - - [Delay and Force](#delay-and-force) - - [Data encoding and Scott encoding](#data-encoding-and-scott-encoding) - - [Unsafe functions](#unsafe-functions) - - [Typeclasses](#typeclasses) - - [Equality and Order](#equality-and-order) - - [Monoids](#monoids) - - [PIntegral](#pintegral) - - [PIsData](#pisdata) - - [PConstant & PLift](#pconstant--plift) - - [Implementing `PConstant` & `PLift`](#implementing-pconstant--plift) - - [PlutusType, PCon, and PMatch](#plutustype-pcon-and-pmatch) - - [Implementing `PlutusType` for your own types (Scott Encoding)](#implementing-plutustype-for-your-own-types-scott-encoding) - - [Implementing `PlutusType` for your own types (Data Encoding)](#implementing-plutustype-for-your-own-types-data-encoding) - - [PListLike](#plistlike) - - [PIsDataRepr & PDataFields](#pisdatarepr--pdatafields) - - [All about extracting fields](#all-about-extracting-fields) - - [Alternatives to `OverloadedRecordDot`](#alternatives-to-overloadedrecorddot) - - [All about constructing data values](#all-about-constructing-data-values) - - [Implementing PIsDataRepr and friends](#implementing-pisdatarepr-and-friends) - - [Working with Types](#working-with-types) - - [PInteger](#pinteger) - - [PBool](#pbool) - - [PString](#pstring) - - [PByteString](#pbytestring) - - [PUnit](#punit) - - [PBuiltinList](#pbuiltinlist) - - [PList](#plist) - - [PBuiltinPair](#pbuiltinpair) - - [PTuple](#ptuple) - - [PAsData](#pasdata) - - [PDataSum & PDataRecord](#pdatasum--pdatarecord) - - [PRecord](#precord) - - [letrec](#letrec) - - [Record Data](#record-data) - - [PData](#pdata) -- [Examples](#examples) - - [Fibonacci number at given index](#fibonacci-number-at-given-index) - - [Validator that always succeeds](#validator-that-always-succeeds) - - [Validator that always fails](#validator-that-always-fails) - - [Validator that checks whether a value is present within signatories](#validator-that-checks-whether-a-value-is-present-within-signatories) - - [Using custom datum/redeemer in your Validator](#using-custom-datumredeemer-in-your-validator) -- [Thumb rules, Tips, and Tricks](#thumb-rules-tips-and-tricks) - - [Plutarch functions are strict](#plutarch-functions-are-strict) - - [Don't duplicate work](#dont-duplicate-work) - - [Where should arguments be `plet`ed?](#where-should-arguments-be-pleted) - - [Prefer Plutarch level functions](#prefer-plutarch-level-functions) - - [When to use Haskell level functions?](#when-to-use-haskell-level-functions) - - [Hoisting is great - but not a silver bullet](#hoisting-is-great---but-not-a-silver-bullet) - - [The difference between `PlutusType`/`PCon` and `PLift`'s `pconstant`](#the-difference-between-plutustypepcon-and-plifts-pconstant) - - [List iteration is strict](#list-iteration-is-strict) - - [Let Haskell level functions take responsibility of evaluation](#let-haskell-level-functions-take-responsibility-of-evaluation) - - [The isomorphism between `makeIsDataIndexed`, Haskell ADTs, and `PIsDataRepr`](#the-isomorphism-between-makeisdataindexed-haskell-adts-and-pisdatarepr) - - [Prefer statically building constants whenever possible](#prefer-statically-building-constants-whenever-possible) -- [Common Issues](#common-issues) - - [No instance for (PUnsafeLiftDecl a)](#no-instance-for-punsafeliftdecl-a) - - [Couldn't match representation of type: ... arising from the 'deriving' clause](#couldnt-match-representation-of-type--arising-from-the-deriving-clause) - - [Infinite loop / Infinite AST](#infinite-loop--infinite-ast) - - [Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `hrecField`, or `pletFields`)](#couldnt-match-type-plutarchdatareprinternalpunlabel--arising-from-a-use-of-pfield-or-hrecfield-or-pletfields) - - [Expected a type, but "fieldName" has kind `GHC.Types.Symbol`](#expected-a-type-but-fieldname-has-kind-ghctypessymbol) - - [Lifting `PAsData`](#lifting-pasdata) -- [Useful Links](#useful-links) -
- -# Overview - -## Compiling and Running - -### Common Extensions and GHC options - -You generally want to adhere to the same extensions and GHC options the [Plutarch repo](https://github.com/Plutonomicon/plutarch/blob/master/plutarch.cabal) uses. - -### Evaluation - -You can compile a Plutarch term using `compile`(from `Plutarch` module), making sure it has no free variables. `compile` returns a `Script`- you can use this as you would any other Plutus script. The API in `Plutus.V1.Ledger.Scripts` should prove helpful. - -For further insight into what is compiled - you can use `printTerm` or `printScript` (from `Plutarch` module). - -I often use these helper functions to test Plutarch quickly- - -```haskell -import Data.Text (Text) -import Plutarch.Evaluate (evaluateScript) -import Plutarch (ClosedTerm, compile) -import Plutus.V1.Ledger.Api (ExBudget) -import Plutus.V1.Ledger.Scripts (Script (unScript), ScriptError, applyArguments) -import UntypedPlutusCore (DeBruijn, DefaultFun, DefaultUni, Program) -import PlutusTx (Data) - -eval :: ClosedTerm a -> Either ScriptError (ExBudget, [Text], Program DeBruijn DefaultUni DefaultFun ()) -eval x = fmap (\(a, b, s) -> (a, b, unScript s)) . evaluateScript $ compile x - -evalWithArgs :: ClosedTerm a -> [Data] -> Either ScriptError (ExBudget, [Text], Program DeBruijn DefaultUni DefaultFun ()) -evalWithArgs x args = fmap (\(a, b, s) -> (a, b, unScript s)) . evaluateScript . flip applyArguments args $ compile x -``` - -The fields in the result triple correspond to execution budget (how much memory and CPU units were used), trace log, and script result - respectively. Often you're only interested in the script result, in that case you can use- - -```haskell -evalT :: ClosedTerm a -> Either ScriptError (Program DeBruijn DefaultUni DefaultFun ()) -evalT x = fmap (\(_, _, s) -> unScript s) . evaluateScript $ compile x - -evalWithArgsT :: ClosedTerm a -> [Data] -> Either ScriptError (Program DeBruijn DefaultUni DefaultFun ()) -evalWithArgsT x args = fmap (\(_, _, s) -> unScript s) . evaluateScript . flip applyArguments args $ compile x -``` - -> Note: You can pretty much ignore the UPLC types involved here. All it really means is that the result is a "UPLC program". When it's printed, it's pretty legible - especially for debugging purposes. Although not necessary to use Plutarch, you may find the [Plutonomicon UPLC guide](https://github.com/Plutonomicon/plutonomicon/blob/main/uplc.md) useful. - -## Syntax - -A Plutarch script is a `Term`. This can consist of- - -### Constants - -These can be built directly from Haskell synonyms using `pconstant` (requires [`PConstant`/`PLift`](#pconstant--plift) instance). `pconstant` always takes in a regular Haskell value to create its Plutarch synonym. -```hs -import Plutarch.Prelude - --- | A plutarch level boolean. Its value is "True", in this case. -x :: Term s PBool -x = pconstant True -``` -> Aside: Did you know you could also build `PAsData` constant terms directly? If you wanted to build a `Term s (PAsData PBool)` from a Haskell boolean - you should use `pconstantData True`. Although `pdata (pconstant True)` would achieve the same thing - it won't actually be as efficient! See, `pconstantData` builds a constant directly - wheras `pdata` *potentially* dispatches to a builtin function call. Also see: [Prefer statically building constants](#prefer-statically-building-constants-whenever-possible). - -Or from Plutarch terms within other constructors using `pcon` (requires [`PlutusType`/`PCon`](#plutustype-pcon-and-pmatch) instance)- -```haskell -import Plutarch.Prelude - --- | Create a plutarch level optional value from given value. -f :: Term s (a :--> PMaybe a) -f = plam $ \x -> pcon $ PJust x --- Note that 'PMaybe' has a 'PlutusType' instance. -``` -> `PMaybe` declaration: `data PMaybe a s = PJust (Term s a) | PNothing` - -> Aside: Notice that `pcon` actually takes in a Plutarch type to create a Plutarch term. -> -> In particular, `PJust x`, where `x :: Term s a`, has type `PMaybe a s`. -> -> ```hs -> -- Example -> > :t x -> Term s PInteger -> > :t PJust x -> PMaybe PInteger s -> > :t pcon (PJust x) -> Term s (PMaybe PInteger) -> ``` -> -> Thus, within the `f` definition above, `pcon` has type `PMaybe a s -> Term s (PMaybe a)`. Similarly, `pcon PNothing` would yield `forall x. Term s (PMaybe x)`, since `PNothing` has type `PMaybe x s`. -> -> ```hs -> -- Example -> > :t PNothing -> PMaybe a s -> > :t pcon PNothing -> Term s (PMaybe a) -> ``` - -Or by using literals- -```haskell -{-# LANGUAGE OverloadedStrings #-} - -import Plutarch.Prelude - --- | A plutarch level integer. Its value is 1, in this case. -x :: Term s PInteger -x = 1 - --- | A plutarch level string (this is actually 'Text'). Its value is "foobar", in this case. -y :: Term s PString -y = "foobar" -``` - -Or by using other, miscellaneous functions provided by Plutarch- -```haskell -import qualified Data.ByteString as BS -import Plutarch.Prelude - --- | A plutarch level bytestring. Its value is [65], in this case. -x :: Term s PByteString -x = phexByteStr "41" --- ^ 'phexByteStr' interprets a hex string as a bytestring. 0x41 is 65 - of course. -``` - -### Lambdas -You can create Plutarch level lambdas by apply `plam` over a Haskell level lambda/function. - -```haskell -pid :: Term s (a :--> a) -pid = plam $ \x -> x -``` - -The identity function! Notice the type. A Plutarch level lambda uses the funny arrows `:-->` to encode a function type. In the above case, `pid` is a Plutarch level function that takes a type `a`, and returns the same type - `a`. As one would expect, `:-->` is right associative and things curry like a charm (at least, they should). - -Guess what this Plutarch level function does- - -```haskell -f :: Term s (PInteger :--> PString :--> a :--> a) -``` - -That's right! It takes in an integer, a string, and a type `a` and returns the same type `a`. Notice that all of those types are Plutarch level types. - -This is the type of the Haskell level function, `plam`- - -```haskell -plam :: (Term s a -> Term s b) -> Term s (a :--> b) -``` - -(That's actually a lie! But we are going to ignore the _real_ `plam` type for simplicity) - -It just converts a Haskell level function, which operates on purely Plutarch terms, into a Plutarch level function. - -This means that when faced with filling out the gap- - -```haskell -f :: Term s (PInteger :--> PString :--> a :--> a) -f = plam $ \??? -``` - -You know that the argument to `plam` here will just be a Haskell function that takes in - `Term s PInteger`, `Term s PString`, and `Term s a` (in that order), and spits out a `Term s a` back. - -### Delayed terms and Forcing -You can use `pdelay` to create a delayed term and `pforce` to force on it. More details at [Delay and Force](#delay-and-force). - -## Usage - -### Applying functions - -You can apply Plutarch level functions using `#` and `#$` (or `papp`). Notice the associativity and precedence of those operators- - -```haskell -infixl 8 # - -infixr 0 #$ -``` - -`#$` is pretty much just `$` for Plutarch functions. But `#` is left associative and has a high precedence. This essentially means that the following- - -```haskell -f # 1 # 2 - --- f :: Term s (PInteger :--> PInteger :--> PUnit) -``` - -applies `f` to 1 and 2. i.e, it is parsed as - `((f 1) 2)` - -Whereas, the following- - -```haskell -f #$ foo # 1 - --- f :: Term s (PBool :--> PUnit) --- foo :: Term s (PInteger :--> PBool) -``` - -parses as - `f (foo 1)` - -(don't take the parens literally - after all `f` and `foo` are not Haskell level functions) - -> Aside: Remember that function application here is **strict**. The arguments _will be evaluated_ and then passed in. -> -> Rule of thumb: If you see `#` - you can quickly infer that a Plutarch level function is being applied and the arguments will be evaluated. Haskell level functions still have their usual semantics, which is why `pif` doesn't evaluate both branches. (if you want, you can use `pif'` - which is a Plutarch level function and therefore strict) - -### Conditionals - -You can simulate `if/then/else` at the Plutarch level using `pif`- - -```haskell -pif :: Term s PBool -> Term s a -> Term s a -> Term s a -``` - -This has similar semantics to Haskell's `if/then/else`. That is, only the branch for which the predicate holds - is evaluated. - -```haskell -pif (pconstant True) 1 2 -``` - -The above evaluates to `1`, which has type `Term s PInteger` - -Of course, the predicate can be an arbitrary `Term s PBool` producing computation. - -### Recursion - -To emulate recursion in UPLC (Untyped Plutus Core), you need to use the Y combinator. Plutarch provides the Y combinator with the name `pfix`- - -```haskell -pfix :: Term s (((a :--> b) :--> a :--> b) :--> a :--> b) -``` - -It works as you would expect, though the type is scary. Think of it as the Haskell type- - -```haskell -fix :: ((a -> b) -> (a -> b)) -> a -> b -``` - -The first argument is "self", or the function you want to recurse with. - -```haskell -import Plutarch.Prelude - -pfac :: Term s (PInteger :--> PInteger) -pfac = pfix #$ plam f - where - f :: Term s (PInteger :--> PInteger) -> Term s PInteger -> Term s PInteger - f self n = pif (n #== 1) n $ n * (self #$ n - 1) --- (ignore the existence of non positives :D) -``` - -There's a Plutarch level factorial function! Note how `f` takes in a `self` and just recurses on it. All you have to do, is create a Plutarch level function by using `plam` on `f` and `pfix` the result - and that `self` argument will be taken care of for you. - -### Do syntax with `QualifiedDo` and `Plutarch.Monadic` -The `Plutarch.Monadic` module provides convenient do syntax on common usage scenarios. It requires the `QualifiedDo` extension, which is only available in GHC 9. - -```hs --- NOTE: REQUIRES GHC 9! -{-# LANGUAGE QualifiedDo #-} - -import Plutarch.Api.Contexts -import qualified Plutarch.Monadic as P -import Plutarch.Prelude - -f :: Term s (PScriptPurpose :--> PUnit) -f = plam $ \x -> P.do - PSpending _ <- pmatch x - ptrace "matched spending script purpose" - pconstant () -``` -In essence, `P.do { x; y }` simply translates to `x y`; where `x :: a -> Term s b` and `y :: a`. - -Similarly, `P.do { y <- x; z }` translates to `x $ \case { y -> z; _ -> ptraceError }`; where `x :: (a -> Term s b) -> Term s b`, `y :: a`, and `z :: Term s b`. Of course, if `y` is a fully exhaustive pattern match (e.g, singular constructor), the extra `_ -> ptraceError ` case will not be generated at all and you'd simply get `x $ \y -> z`. - -Finally, `P.do { x }` is just `x`. - -These semantics make it *extremely* convenient for usage with [`pmatch`](#plutustype-pcon-and-pmatch), [`plet`](#plet-to-avoid-work-duplication), [`pletFields`](#all-about-extracting-fields), and [`ptrace`](#tracing) etc. -```hs -pmatch :: Term s a -> (a s -> Term s b) -> Term s b - -ptrace :: Term s PString -> Term s a -> Term s a -``` - -Of course, as long as the semantics of the `do` notation allows it, you can make your own utility functions that take in continuations - and they can utilize `do` syntax just the same. - -#### Translating `do` syntax with `QualifiedDo` to GHC 8 -For convenience, most examples in this guide will be utilizing this `do` syntax. However, since `QualifiedDo` is available pre GHC 9 - we'll discuss how to translate those examples to GHC 8. - -There are several ways to do this- -* Use [`TermCont`](#do-syntax-with-termcont). -* Don't use do syntax at all. You can easily translate the `do` syntax to regular continuation chains. - - Here's how you'd translate the above `f` function- - - ```hs - f :: Term s (PScriptPurpose :--> PUnit) - f = plam $ \x -> pmatch x $ \case - PSpending _ -> ptrace "matched spending script purpose" $ pconstant () - _ -> ptraceError "incorrect script purpose" - ``` - Simply put, functions like `pmatch`, `pletFields` take in a continuation. The `do` syntax enables you to bind the argument of the continuation using `<-`, and simply use flat code, rather than nested function calls. -* Use the `Cont` monad. You can utilize this to also use regular `do` syntax by simply applying `cont` over functions such as `pmatch`, `pletFields` and similar utilities that take in a continuation function. There is an example of this [here](https://github.com/Plutonomicon/plutarch/blob/6b7dd254e4aaf366eb716dd3e18788426b3d1e2a/examples/Examples/Api.hs#L175-L189). Notice how `checkSignatory` has been translated to `Cont` monad usage in `checkSignatoryCont`. - - Here's how you'd translate the above `f` function- - ```hs - import Control.Monad.Trans.Cont (cont, runCont) - - import Plutarch.Prelude - import Plutarch.Api.Contexts - - f :: Term s (PScriptPurpose :--> PUnit) - f = plam $ \x -> (`runCont` id) $ do - purpose <- cont $ pmatch x - pure $ case purpose of - PSpending _ -> ptrace "matched spending script purpose" $ pconstant () - _ -> ptraceError "invalid script purpose" - ``` - - Note that you have to translate the pattern matching manually, as `Cont` doesn't have a `MonadFail` instance. -* Use [`RebindableSyntax`](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/rebindable_syntax.html). You can replace the `>>=`, `>>`, and `fail` functions in your scope with the ones from `Plutarch.Monadic` using `RebindableSyntax`. This is arguably a bad practice but the choice is there. This will let you use the `do` syntax word for word. Although you wouldn't be qualifying your `do` keyword (like `P.do`), you'd just be using `do`. - - Here's how you'd translate the above `f` function- - ```hs - {-# LANGUAGE RebindableSyntax #-} - - import Prelude hiding ((>>=), (>>), fail) - - import Plutarch.Prelude - import Plutarch.Monadic ((>>=), (>>), fail) - import Plutarch.Api.Contexts - - f :: Term s (PScriptPurpose :--> PUnit) - f = plam $ \x -> do - PSpending _ <- pmatch x - ptrace "matched spending script purpose" - pconstant () - ``` - -### Do syntax with `TermCont` -You can mostly replicate the `do` syntax from `Plutarch.Monadic` using `TermCont`. In particular, the continuation accepting functions like `plet`, `pletFields`, `pmatch` and so on can utilize regular `do` syntax with `TermCont` as the underlying monad. - -`TermCont @b s a` essentially represents `(a -> Term s b) -> Term s b`. `a` being the input to the continuation, and `Term s b` being the output. Notice the type application - `b` must have been brought into scope through another binding first. - -Here's how you'd write the [above example](#do-syntax-with-qualifieddo-and-plutarchmonadic) with `TermCont` instead. -```hs -import Plutarch.Api.Contexts -import Plutarch.Prelude - -f :: Term s (PScriptPurpose :--> PUnit) -f = plam $ \x -> unTermCont $ do - PSpending _ <- tcont $ pmatch x - pure $ ptrace "matched spending script purpose" $ pconstant () -``` - -The best part is that this doesn't require `QualifiedDo`! So you don't need GHC 9. - -Furthermore, this is very similar to the `Cont` monad - it just operates on Plutarch level terms. This means you can draw parallels to utilities and patterns one would use when utilizing the `Cont` monad. Here's an example- -```hs -import Plutarch.Prelude - --- | Terminate with given value on empty list, otherwise continue with head and tail. -nonEmpty :: Term s r -> PList a s -> TermCont @r s (Term s a, Term s (PList a)) -nonEmpty x0 list = TermCont $ \k -> - case list of - PSCons x xs -> k (x, xs) - PSNil -> x0 - -foo :: Term s (PList PInteger :--> PInteger) -foo = plam $ \l -> unTermCont $ do - (x, xs) <- nonEmpty 0 =<< tcont (pmatch l) - pure $ x + plength # xs -``` -`foo` adds up the first element of the given list with the length of its tail. Unless the list was empty, in which case, it just returns 0. It uses continuations with the `do` syntax to elegantly utilize short circuiting! - -### Deriving typeclasses for `newtype`s -If you're defining a `newtype` to an existing Plutarch type, like so- -```hs -newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) -``` -You ideally want to just have this `newtype` be represetned as a `PByteString` under the hood. Therefore, all the typeclass instances of `PByteString` make sense for `PPubKeyHash` as well. In this case, you can simply derive all those typeclasses for your `PPubKeyHash` type as well! Via `DerivePNewtype`- -```hs -newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PPubKeyHash PByteString) -``` -`DerivePNewtype` takes two type parameters. Both of them are Plutarch types (i.e types with kind `PType`). The first one is the type you're deriving the instances for, while the second one is the *inner* type (whatever `PPubKeyHash` is a newtype to). - -> Note: It's important to note that the contents of a `newtype` *that aims to be a Plutarch type* (i.e can be represented as a Plutarch term), must also be Plutarch terms. The type `PByteString s` simply doesn't exist in the Plutus Core world after compilation. It's all just `Term`s. So, when you say `Term s PPubKeyHash`, you're really just describing a `Term s PByteString` under the hood - since that's what it *is* during runtime. - -> Aside: You can access the inner type using `pto` (assuming it's a `PlutusType` instance). For example, `pto x`, where `x :: Term s PPubKeyHash`, would give you `Term s PByteString`. `pto` converts a [`PlutusType`](#plutustype-pcon-and-pmatch) term to its inner type. This is very useful, for example, when you need to use a function that operates on bytestring terms, but all you have is a `Term s PPubKeyHash`. You *know* it's literally a bytestring under the hood anyway - but how do you obtain that? Using `pto`! - -Currently, `DerivePNewtype` lets you derive the following typeclasses for your Plutarch *types*:- -* `PlutusType` -* `PIsData` -* `PEq` -* `POrd` -* `PIntegral` - -You can also derive the following typeclasses for Plutarch *terms*:- -* `Num` -* `Semigroup` -* `Monoid` - -What does this mean? Well, `Num` would actually be implemented for `Term s a`, where `a` is a Plutarch type. For example, if you wanted to implement `Semigroup` for `Term s PPubKeyHash` (`Term s PByteString` already has a `Semigroup` instance), you can write- -```hs -{-# LANGUAGE StandaloneDeriving #-} - -deriving via (Term s (DerivePNewtype PPubKeyHash PByteString)) instance Semigroup (Term s PPubKeyHash) -``` - -### Deriving typeclasses with generics -Plutarch also provides sophisticated generic deriving support for completely custom types. In particular, you can easily derive `PlutusType` for your own type- -```hs -import qualified GHC.Generics as GHC -import Generics.SOP -import Plutarch.Prelude - -data MyType (a :: PType) (b :: PType) (s :: S) - = One (Term s a) - | Two (Term s b) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) -``` -> Note: This requires the `generics-sop` package. - -This will use a [scott encoding representation](#data-encoding-and-scott-encoding) for `MyType`, which is typically what you want. However, this will forbid you from representing your type as a `Data` value and as a result - you cannot implement `PIsData` for it. (Well, you can if you try hard enough - but you *really really really* shouldn't) - -Currently, generic deriving supports the following typeclasses:- -* [`PlutusType`](#implementing-plutustype-for-your-own-types) (scott encoding only) -* [`PIsDataRepr`](#implementing-pisdatarepr-and-friends) - -## Concepts - -### Hoisting, metaprogramming, and fundamentals - -What is essentially happening here, is that we have a 2-stage compilation process. - -First GHC compiles our code, then our code generates an _AST_ of our Plutus script, - -which is then serialized using `compile`. - -The important thing to note, is that when you have a definition like: - -```haskell -x :: Term s PInteger -x = something complex -``` - -Any use of `x` will inline the **full definition** of `x`. `x + x` will duplicate `something complex` in the AST. To avoid this, you should [use `plet` in order to avoid duplicate work](#plet-to-avoid-work-duplication). Do note that this is **strictly evaluated, and hence isn't always the best solution.** - -There is however still a problem: What about top-level functions, like `fib`, `sum`, `filter`, and such? We can use `plet` to avoid duplicating the definition, but this error-prone, since to do this perfectly each function that generates part of the AST would need to have access to the `plet`'ed definitions, meaning that we'd likely have to put it into a record or typeclass. - -To solve this problem, Plutarch supports _hoisting_. Hoisting only works for _closed terms_, that is, terms that don't reference any free variables (introduced by `plam`). - -Hoisted terms are essentially moved to a top-level `plet`, i.e. it's essentially common subexpression elimination. Do note that because of this, your hoisted term is **also strictly evaluated, meaning that you shouldn't hoist non-lazy complex computations (use e.g.** `pdelay` **to avoid this).** - -#### Hoisting Operators -For the sake of convenience, you often would want to use operators - which must be Haskell level functions. This is the case for `+`, `-`, `#==` and many more. - -Choosing convenience over efficiency is difficult, but if you notice that your operator uses complex logic and may end up creating big terms - you can trivially factor out the logic into a Plutarch level function, hoist it, and simply apply that function within the operator. - -Consider boolean or- -```hs -(#||) :: Term s PBool -> Term s PBool -> Term s PBool -x #|| y = pif x (pconstant True) $ pif y (pconstant True) $ pconstant False -``` -You can factor out most of the logic to a Plutarch level function, and apply that in the operator definition- - -```hs -(#||) :: Term s PBool -> Term s PBool -> Term s PBool -x #|| y = por # x # pdelay y - -por :: Term s (PBool :--> PDelayed PBool :--> PBool) -por = phoistAcyclic $ plam $ \x y -> pif' # x # pconstant True # pforce y -``` - -In general the pattern goes like this- -```hs -() :: Term s x -> Term s y -> Term s z -x y = f # x # y - -f :: Term s (x :--> y :--> z) -f = phoistAcyclic $ plam $ \x y -> -``` -(OR, simply inlined) -```hs -() :: Term s x -> Term s y -> Term s z -x y = (\f -> f # x # y) $ phoistAcyclic $ plam $ \x y -> -``` - -> Note: You don't even need to export the Plutarch level function or anything! You can simply have that complex logic factored out into a *hoisted, internal Plutarch function* and everything will work just fine! - -### What is the `s`? - -The `s` essentially represents the context, and is like the `s` of `ST`. - -It's used to distinguish between closed and open terms: - -- Closed term: `type ClosedTerm = forall s. Term s a` -- Arbitrary term: `exists s. Term s a` -- NB: `(exists s. Term s a) -> b` is isomorphic to -- `forall s. Term s a → b` - -### eDSL Types in Plutarch - -Most types prefixed with `P` are eDSL-level types, meaning that they're meant to be used with `Term`. They are merely used as a tag, and what Haskell value they can hold is not important. Their kind must be `PType`. - -### `plet` to avoid work duplication -Sometimes, when writing Haskell level functions for generating Plutarch terms, you may find yourself needing to re-use the Haskell level function's argument multiple times- -```hs -foo :: Term s PString -> Term s PString -foo x = x <> x -``` -This is *really* bad if `x` is actually represented by a big unevaluated computation yielding `Term s PString`. Whenever you find yourself using a Haskell level function argument multiple times - you may want to *strictly* evaluate it first. `plet` lets you do just that- -```hs -foo :: Term s PString -> Term s PString -foo x' = plet x' $ \x -> x <> x -``` - -Also see: [Don't duplicate work](#dont-duplicate-work). - -### Tracing -You can use the functions `ptrace`, `ptraceError`, `ptraceIfFalse`, `ptraceIfTrue` (from `Plutarch.Trace`) for tracing. These behave similarly to the ones you're used to from [PlutusTx](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Trace.html). - -If you have the `development` flag for `plutarch` turned on - you'll see the trace messages appear in the trace log during script evaluation. When not in development mode - these functions basically do nothing. - -### Raising errors -In Plutus Tx, you'd signal validation failure with the [`error`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Prelude.html#v:error) function. You can do the same in Plutarch using `perror`. -```hs -fails :: Term s (PData :--> PData :--> PData :--> PUnit) -fails = plam $ \_ _ _ -> perror -``` - -### Delay and Force -Use `pdelay` on a term to create a "delayed term". -```hs -let f = plam (\x -> x) in pdelay (f # phexByteStr 0x41) -``` -Compiling and evaluating it yields- -``` -Program () (Version () 1 0 0) (Delay () (Constant () (Some (ValueOf bytestring "A")))) -``` -The function application is "delayed". It will not be evaluated (and therefore computed) until it is *forced*. - -Plutarch level function application is strict. All of your function arguments are evaluated **before** the function is called. - -This is often undesirable, and you want to create a delayed term instead that you want to force *only* when you need to compute it. - -You can force a previously delayed expression using pforce- -```hs -pforce $ let f = plam (\x -> x) in pdelay (f # phexByteStr "41") -``` -It evaluates to- -``` -Program () (Version () 1 0 0) (Constant () (Some (ValueOf bytestring "A"))) -``` - -Delaying the argument to a Plutarch level function, within the function body, is not very useful - since the argument has been evaluated before the function body has been entered! Instead, you'll often notice usage of `pdelay` and `pforce` in Haskell level function arguments to simulate laziness- -```hs -pif' :: Term s (PBool :--> a :--> a :--> a) - --- | Lazy if-then-else. -pif :: Term s PBool -> Term s a -> Term s a -> Term s a -pif cond whenTrue whenFalse = pforce $ pif' # cond # pdelay whenTrue # pdelay whenFalse -``` - -`pif'` is a direct synonym to the `IfThenElse` Plutus Core builtin function. Of course, it evaluates its arguments strictly but you often want an if-then-else that doesn't evaluate both its branches - only the one for which the condition holds. So, `pif`, as a haskell level function can take in both branches (without any concept of evaluating them), delay them and *then* apply it to `pif'`. Finally, a `pforce` will force the yielded branch that was previously delayed. - -Delay and Force will be one of your most useful tools while writing Plutarch. Make sure you get a grip on them! - -### Data encoding and Scott encoding -In Plutus Core, there are really two (conflicting) ways to represent non-trivial ADTs- `Constr` data encoding, or Scott encoding. You can (you should!) only use one of these representations for your non-trivial types. - -> Aside: What's a "trivial" type? The non-data builtin types! `PInteger`, `PByteString`, `PBuiltinList`, `PBuiltinPair`, and `PMap` (actually just a builtin list of builtin pairs). - -`Constr` data is essentially a sum-of-products representation. However, it can only contain other `Data` values (not necessarily just `Constr` data, could be `I` data, `B` data etc.) as its fields. Plutus Core famously lacks the ability to represent functions using this encoding, and thus - `Constr` encoded values simply cannot contain functions. - -> Note: You can find out more about the deep details of `Data`/`BuiltinData` at [plutonomicon](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). - -With that said, `Data` encoding is *ubiquitous* on the chain. It's the encoding used by the ledger api types, it's the type of the arguments that can be passed to a script on the chain etc. As a result, your datum and redeemers *must* use data encoding. - -On the opposite (and conflicting) end, is scott encoding. [The internet](https://crypto.stanford.edu/~blynn/compiler/scott.html) can explain scott encoding way better than I can. But I'll be demonstrating scott encoding with an example anyway. - -Firstly, what good is scott encoding? Well it doesn't share the limitation of not being able to contain functions! However, you cannot use scott encoded types within, for example, your datums and redeemers. - -Briefly, scott encoding is a way to represent data with functions. The scott encoded representation of `Maybe a` would be- -```hs -(a -> b) -> b -> b -``` -`Just 42`, for example, would be represented as this function- -```hs -\f _ -> f 42 -``` -Whereas `Nothing` would be represented as this function- -```hs -\_ n -> n -``` - -We covered construction. What about usage/deconstruction? That's also just as simple. Let's say you have a function, `foo :: Maybe Integer -> Integer`, it takes in a scott encoded `Maybe Integer`, adds `42` to its `Just` value. If it's `Nothing`, it just returns 0. -```hs -{-# LANGUAGE RankNTypes #-} - -type Maybe a = forall b. (a -> b) -> b -> b - -just :: a -> Maybe a -just x = \f _ -> f x - -nothing :: Maybe a -nothing = \_ n -> n - -foo :: Maybe Integer -> Integer -foo mb = mb (\x -> x + 42) 0 -``` -How does that work? Recall that `mb` is really just a function. Here's what the application of `f` would work like- -```hs -foo (just 1) -foo (\f _ -> f 1) -(\f _ -> f 1) (\x -> x + 42) 0 -(\x -> x + 42) 1 -43 -``` -```hs -foo nothing -foo (\_ n -> n) -(\_ n -> n) (\x -> x + 42) 0 -0 -``` -How cool is that? - -This is the same recipe followed in the implementation of `PMaybe`. See its [PlutusType impl](#plutustype-pcon-and-pmatch) below! - -### Unsafe functions -There are internal functions such as `punsafeCoerce`, `punsafeConstant` etc. that give you terms without their specific type. These **should not** be used by Plutarch users. It is the duty of the user of these unsafe functions to get the type right - and it is very easy to get the type wrong. You can easily make the type system believe you're creating a `Term s PInteger`, when in reality, you created a function. - -Things will go very wrong during script evaluation if you do that kind of thing. - -The good thing is that unsafe functions all have explicit indicators through the names, as long as you don't use any `punsafe*` functions - you should be fine! - -## Typeclasses - -### Equality and Order - -Plutarch level equality is provided by the `PEq` typeclass- - -```haskell -class PEq t where - (#==) :: Term s t -> Term s t -> Term s PBool -``` - -`PInteger` implements `PEq` as you would expect. So you could do- - -```haskell -1 #== 2 -``` - -That would yield a `Term s PBool`, which you would probably use with `pif` (or similar) - -There is also a synonym to `Ord`, `POrd`- - -```haskell -class POrd t where - (#<=) :: Term s t -> Term s t -> Term s PBool - (#<) :: Term s t -> Term s t -> Term s PBool -``` - -It works as you would expect- - -```haskell -{-# LANGUAGE OverloadedStrings #-} - -pif (1 #< 7) "indeed" "what" -``` - -evaluates to `"indeed"` - of type `Term s PString`. - -### Monoids - -You can use `<>` on two `Term s a`s to produce one `Term s a`, where `Term s a` is a `Semigroup`. You can use `mempty` to create a `Term s a`, where `Term s a` is a monoid. - -It works the way you would expect, `PByteString` and `PString` terms have `Monoid` instances- - -```haskell -{-# LANGUAGE OverloadedStrings #-} - -"ab" <> "cd" --- evaluates to "abcd" -``` - -Where all those strings are actually `Term s PString`s. - -### PIntegral -This is similar to the `Integral` typeclass. However, it only has the following class methods- -* `pdiv` - similar to `div` -* `pmod` - similar to `mod` -* `pquot` - similar to `quot` -* `prem` - similar to `rem` - -Using these functions, you can do division/modulus etc on Plutarch level values- -```hs -pdiv # 6 # 3 -``` -where `6` and `3` are `Term s PInteger`s yields `2` - also a `Term s PInteger`. - -### PIsData -The `PIsData` typeclass facilitates easy and type safe conversion between Plutarch types and their corresponding `PData` representation - i.e [`BuiltinData`/`Data`](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). It keeps track of the type information through [`PAsData`](#pasdata). -```hs -class PIsData a where - pfromData :: Term s (PAsData a) -> Term s a - pdata :: Term s a -> Term s (PAsData a) -``` - -[`PInteger`](#pinteger) has a `PIsData` instance. The `PData` representation of `PInteger` is, of course, an `I` data. And you can get the `PInteger` back from an `I` data using `UnIData` (i.e `pasInt`). -```hs -instance PIsData PInteger where - pfromData x = pasInt # pforgetData x - pdata x = punsafeBuiltin PLC.IData # x -``` -In essence, `pdata` wraps a `PInteger` into an `I` data value. Wheras `pfromData` simply unwraps the `I` data value to get a `PInteger`. - -> Aside: You might be asking, what's an "`I` data value"? This is referring to the different constructors of `Data`/`BuiltinData`. You can find a full explanation of this at [plutonomicon](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). - -For the simple constructors that merely wrap a builtin type into `Data`, e.g integers, bytestrings, lists, and map, `PIsData` works in much the same way as above. However, what about `Constr` data values? When you have an ADT that doesn't correspond to those simple builtin types directly - but you still need to encode it as `Data` (e.g `PScriptContext`). In this case, you should [implement `PIsDataRepr`](#implementing-pisdatarepr-and-friends) and you'll get the `PIsData` instance for free! - -### PConstant & PLift -These 2 closely tied together typeclasses establish a bridge between a Plutarch level type (that is represented as a builtin type, i.e [`DefaultUni`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultUni)) and its corresponding Haskell synonym. The gory details of these two are not too useful to users, but you can read all about it if you want at [Developers' corner](./DEVGUIDE.md#pconstant-and-plift). - -What's more important, are the abilities that `PConstant`/`PLift` instances have- -```hs -pconstant :: PLift p => PLifted p -> Term s p - -plift :: (PLift p, HasCallStack) => ClosedTerm p -> PLifted p -``` -> Aside: `PLifted p` represents the Haskell synonym to the Plutarch type, `p`. Similarly, there is also `PConstanted h` - which represents the Plutarch synonym corresponding to the Haskell type, `h`. These type families may only be used for Plutarch types implementing `PConstant`/`PLift`. - -`pconstant` lets you build a Plutarch value from its corresponding Haskell synonym. For example, the haskell synonym of [`PBool`](#pbool) is [`Bool`](https://hackage.haskell.org/package/base-4.16.0.0/docs/Data-Bool.html#t:Bool). -```hs -b :: Term s PBool -b = pconstant False -``` -Other than simple builtin types - you can also use `pconstant` to create [`BuiltinData`/`Data`](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md) values! Usually, you'll want to keep the type information though - so here's an example of creating a `PScriptPurpose` from a familiar `ScriptPurpose` constant- -```hs -import Plutus.V1.Ledger.Contexts - -purp :: Term s PScriptPurpose -purp = pconstant $ Minting "" -``` - -On the other end, `plift` lets you obtain the Haskell synonym of a Plutarch value (that is represented as a builtin value, i.e [`DefaultUni`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultUni))- -```hs -import Plutus.V1.Ledger.Contexts - -purp :: Term s PScriptPurpose -purp = pconstant $ Minting "be" - -> plift purp -Minting "be" -``` - -There's also another handy utility, `pconstantData`- -```hs -pconstantData :: (PLift p, ToData (PLifted p)) => PLifted p -> Term s (PAsData p) -``` -> Note: This isn't the actual type of `pconstantData` - it's simplified here for the sake of documentation ;) - -It's simply the `PAsData` building cousin of `pconstant`! - -#### Implementing `PConstant` & `PLift` -If your custom Plutarch type is represented by a builtin type under the hood (i.e not scott encoded - rather [`DefaultUni`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultUni)) - you can easily implement `PLift` for it by using the provided machinery. - -This comes in 3 flavors. -* Plutarch type represented **directly** by a builtin type that **is not** `Data` (`DefaultUniData`) ==> `DerivePConstantDirect` - - Ex: `PInteger` is directly represented as a builtin integer. -* Plutarch type represented **indirectly** by a builtin type that **is not** `Data` (`DefaultUniData`) ==> `DerivePConstantViaNewtype` - - Ex: `PPubKeyHash` is a newtype to a `PByteString`, `PByteString` is *directly* represented as a builtin bytestring. -* Plutarch type represented by `Data` (`DefaultUniData`) ==> `DerivePConstantViaData` - - Ex: `PScriptPurpose` is represented as a `Data` value. It is synonymous to `ScriptPurpose` from the Plutus ledger api. - -Whichever path you need to go down, there is one common part- implementing `PLift`, or rather `PUnsafeLiftDecl`. See, `PLift` is actually just a type synonym to `PUnsafeLiftDecl`. Essentially an empty typeclass with an associated type family that provides insight on the relationship between a Plutarch type and its Haskell synonym. -```hs -instance PUnsafeLiftDecl YourPlutarchType where type PLifted YourPlutarchType = YourHaskellType -``` -You're tasked with assigning the correct Haskell synonym to your Plutarch type, and what an important task it is! Recall that `pconstant`'s argument type will depend on your assignment here. In particular: `pconstant :: YourHaskellType -> YourPlutarchType`. - -Some examples:- -* for `YourPlutarchType` = `PInteger`, `YourHaskellType` = `Integer` - - ```hs - instance PUnsafeLiftDecl PInteger where type PLifted PInteger = Integer - ``` -* for `YourPlutarchType` = `PValidatorHash`, `YourHaskellType` = `ValidatorHash` - - ```hs - instance PUnsafeLiftDecl PValidatorHash where type PLifted PValidatorHash = Plutus.ValidatorHash - ``` -* for `YourPlutarchType` = `PScriptPurpose`, `YourHaskellType` = `ScriptPurpose` - - ```hs - instance PUnsafeLiftDecl PScriptPurpose where type PLifted PScriptPurpose = Plutus.ScriptPurpose - ``` - -Now, let's get to implementing `PConstant` for the Haskell synonym, via the 3 methods. The first of which is `DerivePConstantDirect`- -```hs -deriving via (DerivePConstantDirect Integer PInteger) instance (PConstant Integer) -``` -`DerivePConstantDirect` takes in 2 type parameters- -* The Haskell type itself, for which `PConstant` is being implemented for. -* The **direct** Plutarch synonym to the Haskell type. - -Pretty simple! Let's check out `DerivePConstantViaNewtype` now- -```hs -import qualified Plutus.V1.Ledger.Api as Plutus - -newtype PValidatorHash (s :: S) = PValidatorHash (Term s PByteString) - -... - -deriving via (DerivePConstantViaNewtype Plutus.ValidatorHash PValidatorHash PByteString) instance (PConstant Plutus.ValidatorHash) -``` -`DerivePConstantViaNewtype` also takes in 3 type parameters- -* The Haskell newtype itself, for which `PConstant` is being implemented for. -* The Plutarch synonym to the Haskell type. -* The actual Plutarch type corresponding to the Haskell type contained within the newtype. - - E.g `ValidatorHash` is a newtype to a `ByteString`, which is synonymous to `PByteString`. In the same way, `PValidatorHash` is actually just a newtype to a `PByteString` term. -During runtime, `ValidatorHash` is actually just a `ByteString`, the same applies for `PValidatorHash`. So we give it the `newtype` treatment with `DerivePConstantViaNewtype`! - -Finally, we have `DerivePConstantViaData` for `Data` values- -```hs -import qualified Plutus.V1.Ledger.Api as Plutus - -data PScriptPurpose (s :: S) - = PMinting (Term s (PDataList '[PCurrencySymbol])) - | PSpending (Term s (PDataList '[PTxOutRef])) - | PRewarding (Term s (PDataList '[PStakingCredential])) - | PCertifying (Term s (PDataList '[PDCert])) - -... - -deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) instance (PConstant Plutus.ScriptPurpose) -``` -`DerivePConstantViaData` takes in 2 type parameters- -* The Haskell type itself, for which `PConstant` is being implemented for. -* The Plutarch synonym to the Haskell type. -And that's all you need to know to implement `PConstant` and `PLift`! - -### PlutusType, PCon, and PMatch -`PlutusType` lets you construct and deconstruct Plutus Core constants from from a Plutarch type's constructors (possibly containing other Plutarch terms). It's essentially a combination of `PCon` (for constant construction) and `PMatch` (for constant deconstruction). - -```hs -class (PCon a, PMatch a) => PlutusType (a :: k -> Type) where - type PInner a (b' :: k -> Type) :: k -> Type - pcon' :: forall s. a s -> forall b. Term s (PInner a b) - pmatch' :: forall s c. (forall b. Term s (PInner a b)) -> (a s -> Term s c) -> Term s c -``` -`PInner` is meant to represent the "inner" type of `a` - the Plutarch type representing the Plutus Core constant used to represent `a`. - -Here's the `PlutusType` instance for `PMaybe`- -```hs -data PMaybe a s = PJust (Term s a) | PNothing - -instance PlutusType (PMaybe a) where - type PInner (PMaybe a) b = (a :--> b) :--> PDelayed b :--> b - pcon' :: forall s. PMaybe a s -> forall b. Term s (PInner (PMaybe a) b) - pcon' (PJust x) = plam $ \f (_ :: Term _ _) -> f # x - pcon' PNothing = plam $ \_ g -> pforce g - pmatch' x f = x # (plam $ \inner -> f (PJust inner)) # (pdelay $ f PNothing) -``` -This is a [scott encoded representation of the familiar `Maybe` data type](#data-encoding-and-scott-encoding). As you can see, `PInner` of `PMaybe` is actually a Plutarch level function. And that's exactly why `pcon'` creates a *function*. `pmatch'`, then, simply "matches" on the function - scott encoding fashion. - -You should always use `pcon` and `pmatch` instead of `pcon'` and `pmatch'` - these are provided by the `PCon` and `PMatch` typeclasses- -```hs -class PCon a where - pcon :: a s -> Term s a - -class PMatch a where - pmatch :: Term s a -> (a s -> Term s b) -> Term s b -``` - -All `PlutusType` instances get `PCon` and `PMatch` instances for free! - -For types that cannot easily be both `PCon` and `PMatch` - feel free to implement just one of them! However, in general, **prefer implementing `PlutusType`**! - -#### Implementing `PlutusType` for your own types (Scott Encoding) -If you want to represent your data type with [scott encoding](#data-encoding-and-scott-encoding) (and therefore not let it be `Data` encoded), you should simply derive it generically- -```hs -import qualified GHC.Generics as GHC -import Generics.SOP -import Plutarch.Prelude - -data MyType (a :: PType) (b :: PType) (s :: S) - = One (Term s a) - | Two (Term s b) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) -``` -> Note: This requires the `generics-sop` package. - -If you want to represent your data type as some simple builtin type (e.g integer, bytestrings, string/text, list, or assoc map), you can define your datatype as a `newtype` to the underlying builtin term and derive `PlutusType` using [`DerivePNewtype`](#deriving-typeclasses-for-newtypes). -```hs -import Plutarch.Prelude - -newtype MyInt (s :: S) = MyInt (Term s PInteger) - deriving (PlutusType) via (DerivePNewtype MyInt PInteger) -``` - -If you don't want it to be a newtype, but rather - an ADT, and still have it be represented as some simple builtin type - you can do so by implementing `PlutusType` manually. Here's an example of encoding a Sum type as an Enum via `PInteger`- -```hs -import Plutarch -import Plutarch.Prelude - -data AB (s :: S) = A | B - -instance PlutusType AB where - type PInner AB _ = PInteger - - pcon' A = 0 - pcon' B = 1 - - pmatch' x f = - pif (x #== 0) (f A) (f B) -``` -#### Implementing `PlutusType` for your own types (Data Encoding) -If your type is supposed to be represented using [`Data` encoding](#data-encoding-and-scott-encoding) instead (i.e has a [`PIsDataRepr`](#pisdatarepr--pdatafields) instance), you can derive `PlutusType` via `PIsDataReprInstances` -```hs -import qualified GHC.Generics as GHC -import Generics.SOP -import Plutarch.Prelude -import Plutarch.DataRepr - -data MyType (a :: PType) (b :: PType) (s :: S) - = One (Term s (PDataRecord '[ "_0" ':= a ])) - | Two (Term s (PDataRecord '[ "_0" ':= b ])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData) - via PIsDataReprInstances (MyType a b) -``` - -### PListLike -The `PListLike` typeclass bestows beautiful, and familiar, list utilities to its instances. Plutarch has two list types- [`PBuiltinList`](#pbuiltinlist) and [`PList`](#plist). Both have `PListLike` instances! However, `PBuiltinList` can only contain builtin types. It cannot contain Plutarch functions. The element type of `PBuiltinList` can be constrained using `PLift a => PBuiltinList a`. - -> Note: `PLift` is exported from `Plutarch.Lift`. - -As long as it's a `PLift a => PBuiltinList a` or `PList a` - it has access to all the `PListLike` goodies, out of the box. It helps to look into some of these functions at [`Plutarch.List`](./../Plutarch/List.hs). - -Along the way, you might be confronted by 2 big mean baddies ...err, constraints- -```hs -PIsListLike list a -``` -This just means that the type `list a`, is *indeed* a valid `PListLike` containing valid elements! Of course, all `PList a`s are valid `PListLike`, but we have to think about `PBuiltinList` since it can only contain `PLift a => a` elements! So, in essence a function declared as- -```hs -pfoo :: PIsListLike list a => Term s (list a :--> list a) -``` -when specialized to `PBuiltinList`, can be simplified as- -```hs -pfoo :: PLift a => Term s (PBuiltinList a :--> PBuiltinList a) -``` -That's all it is. Don't be scared of it! - -What about this one- -```hs -PElemConstraint list a -``` -This one ensures that the element type `a` can indeed be contained within the list type - `list`. For `PList`, this constraint means nothing - it's always true. For `PBuiltinList`, it can be simplified as `PLift a`. Easy! - -Here's two of my favorite `PListLike` utilities (not biased)- -```hs --- | Cons an element onto an existing list. -pcons :: PElemConstraint list a => Term s (a :--> list a :--> list a) - --- | The empty list -pnil :: PElemConstraint list a => Term s (list a) -``` -What would life be without cons and nil? - -Let's build a `PBuiltinList` of `PInteger`s with that- -```hs -x :: Term s (PBuiltinList PInteger) -x = pcons # 1 #$ pcons # 2 #$ pcons # 3 # pnil -``` -Wooo! Let's not leave `PList` alone in the corner though- -```hs -x :: Term s (PList PInteger) -x = pcons # 1 #$ pcons # 2 #$ pcons # 3 # pnil -``` -The code is the same, we just changed the type annotation. Cool! - -### PIsDataRepr & PDataFields -`PIsDataRepr` allows for easily constructing *and* deconstructing `Constr` [`BuiltinData`/`Data`](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md) values. It allows fully type safe matching on `Data` values, without embedding type information within the generated script - unlike PlutusTx. `PDataFields`, on top of that, allows for ergonomic field access. - -> Aside: What's a `Constr` data value? Briefly, it's how Plutus Core encodes non-trivial ADTs into `Data`/`BuiltinData`. It's essentially a sum-of-products encoding. But you don't have to care too much about any of this. Essentially, whenever you have a custom non-trivial ADT (that isn't just an integer, bytestring, string/text, list, or assoc map), you should implement `PIsDataRepr` for it. - -For example, `PScriptContext` - which is the Plutarch synonym to [`ScriptContext`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Contexts.html#t:ScriptContext) - has the necessary instances. This lets you easily keep track of its type, match on it, deconstruct it - you name it! -```hs --- NOTE: REQUIRES GHC 9! -{-# LANGUAGE QualifiedDo #-} - -import Plutarch.Prelude -import Plutarch.Api.Contexts -import qualified Plutarch.Monadic as P - -foo :: Term s (PScriptContext :--> PString) -foo = plam $ \ctx -> P.do - purpose <- pmatch . pfromData $ pfield @"purpose" # ctx - case purpose of - PMinting _ -> "It's minting!" - PSpending _ -> "It's spending!" - PRewarding _ -> "It's rewarding!" - PCertifying _ -> "It's certifying!" -``` -> Note: The above snippet uses GHC 9 features (`QualifiedDo`). Be sure to check out [how to translate the do syntax to GHC 8](#translating-do-syntax-with-qualifieddo-to-ghc-8). - -Of course, just like `ScriptContext` - `PScriptContext` is represented as a `Data` value in Plutus Core. Plutarch just lets you keep track of the *exact representation* of it within the type system. - -Here's how `PScriptContext` is defined- -```hs -newtype PScriptContext (s :: S) - = PScriptContext - ( Term - s - ( PDataRecord - '[ "txInfo" ':= PTxInfo - , "purpose" ':= PScriptPurpose - ] - ) - ) -``` -It's a constructor containing a [`PDataRecord`](#pdatasum--pdatarecord) term. It has 2 fields- `txInfo` and `purpose`. - -First, we extract the `purpose` field using `pfield @"purpose"`- -```hs -pfield :: Term s (PScriptContext :--> PAsData PScriptPurpose) -``` -> Note: When extracting several fields from the same variable, you should instead use `pletFields`. See: [Extracting fields](#all-about-extracting-fields) - -Now, we can grab the `PScriptPurpose` from within the `PAsData` using `pfromData`- -```hs -pfromData :: Term s (PAsData PScriptPurpose) -> Term s PScriptPurpose -``` -Finally, we can `pmatch` on it to extract the Haskell ADT (`PScriptPurpose s`) out of the Plutarch term- -```hs -pmatch :: Term s PScriptPurpose -> (PScriptPurpose s -> Term s PString) -> Term s PString -``` -Now that we have `PScriptPurpose s`, we can just `case` match on it! `PScriptPurpose` is defined as- -```hs -data PScriptPurpose (s :: S) - = PMinting (Term s (PDataRecord '["_0" ':= PCurrencySymbol])) - | PSpending (Term s (PDataRecord '["_0" ':= PTxOutRef])) - | PRewarding (Term s (PDataRecord '["_0" ':= PStakingCredential])) - | PCertifying (Term s (PDataRecord '["_0" ':= PDCert])) -``` -It's just a Plutarch sum type. - -We're not really interested in the fields (the `PDataRecord` term), so we just match on the constructor with the familar `case`. Easy! - -Let's pass in a `ScriptContext` as a `Data` value from Haskell to this Plutarch script and see if it works! -```hs -import Plutus.V1.Ledger.Api - -mockCtx :: ScriptContext -mockCtx = - ScriptContext - (TxInfo - mempty - mempty - mempty - mempty - mempty - mempty - (interval (POSIXTime 1) (POSIXTime 2)) - mempty - mempty - "" - ) - (Minting (CurrencySymbol "")) - -> foo `evalWithArgsT` [PlutusTx.toData mockCtx] -Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf string "It's minting!")))) -``` - -#### All about extracting fields -We caught a glimpse of field extraction in the example above, thanks to `pfield`. However, that barely touched the surface. - -Once a type has a `PDataFields` instance, field extraction can be done with these 3 functions- -* `pletFields` -* `pfield` -* `hrecField` (when not using `OverloadedRecordDot` or record dot preprocessor) - -Each has its own purpose. However, `pletFields` is arguably the most general purpose and most efficient. Whenever you need to extract several fields from the same variable, you should use `pletFields`- -```hs --- NOTE: REQUIRES GHC 9! -{-# LANGUAGE QualifiedDo #-} -{-# LANGUAGE OverloadedRecordDot #-} - -import Plutarch.Prelude -import Plutarch.Api.Contexts -import qualified Plutarch.Monadic as P - -foo :: Term s (PScriptContext :--> PUnit) -foo = plam $ \ctx' -> P.do - ctx <- pletFields @["txInfo", "purpose"] ctx' - let - purpose = ctx.purpose - txInfo = ctx.txInfo - -- - pconstant () -``` -> Note: The above snippet uses GHC 9 features (`QualifiedDo` and `OverloadedRecordDot`). Be sure to check out [how to translate the do syntax to GHC 8](#translating-do-syntax-with-qualifieddo-to-ghc-8) and [alternatives to `OverloadedRecordDot`](#alternatives-to-overloadedrecorddot). - -In essence, `pletFields` takes in a type level list of the field names that you want to access and a continuation function that takes in an `HRec`. This `HRec` is essentially a collection of the bound fields. You don't have to worry too much about the details of `HRec`. This particular usage has type- -```hs -pletFields :: Term s PScriptContext - -> (HRec - (BoundTerms - '[ "txInfo" ':= PTxInfo, "purpose" ':= PScriptPurpose] - '[ 'Bind, 'Bind] - s) - -> Term s PUnit) - -> Term s PUnit -``` -> Aside: Of course, we used the convenient `do` syntax provided to us by `Plutarch.Monadic` to write the continuation merely as a `<-` bind. Without do notation, you'd have to write- -> -> ```hs -> pletFields @["txInfo", "purpose"] ctx' $ \ctx -> -> let -> purpose = ctx.purpose -> txInfo = ctx.txInfo -> in pconstant () -> ``` - -You can then access the fields on this `HRec` using `OverloadedRecordDot`. - -Next up is `pfield`. You should *only ever* use this if you just want one field from a variable and no more. It's usage is simply `pfield @"fieldName" # variable`. You can, however, also use `pletFields` in this case (e.g `pletFoelds @'["fieldName"] variable`). `pletFields` with a singular field has the same efficiency as `pfield`! - -Finally, `hrecField` is merely there to supplement the lack of record dot syntax. See: [Alternative to `OverloadedRecordDot`](#alternative-to-overloadedrecorddot). - -##### Alternatives to `OverloadedRecordDot` -If `OverloadedRecordDot` is not available, you can also try using the [record dot preprocessor plugin](https://hackage.haskell.org/package/record-dot-preprocessor). - -If you don't want to use either, you can simply use `hrecField`. In fact, `ctx.purpose` above just translates to `hrecField @"purpose" ctx`. Nothing magical there! - -#### All about constructing data values -We learned about type safe matching (through `PlutusType`) as well as type safe field access (through `PDataFields`) - how about construction? Since `PIsDataRepr` allows you to derive [`PlutusType`](#plutustype-pcon-and-pmatch), and `PlutusType` bestows the ability to not only *deconstruct*, but also **construct** values - you can do that just as easily! - -Let's see how we could build a `PMinting` `PScriptPurpose` given a `PCurrencySymbol`- -```hs -import Plutarch.Prelude -import Plutarch.Api.V1 - -currSym :: Term s PCurrencySymbol -``` -```hs -purpose :: Term s PScriptPurpose -purpose = pcon $ PMinting fields - where - currSymDat :: Term _ (PAsData PCurrencySymbol) - currSymDat = pdata currSym - fields :: Term _ (PDataRecord '[ "_0" ':= PCurrencySymbol ]) - fields = pdcons # currSymDat # pdnil -``` -All the type annotations are here to help! - -This is just like regular `pcon` usage you've [seen above](#plutustype-pcon-and-pmatch). It takes in the Haskell ADT of your Plutarch type and gives back a Plutarch term. - -What's more interesting, is the `fields` binding. Recall that `PMinting` is a constructor with one argument, that argument is a [`PDataRecord`](#pdatasum--pdatarecord) term. In particular, we want: `Term s (PDataRecord '["_0" ':= PCurrencySymbol ])`. It encodes the exact type, position, and name of the field. So, all we have to do is create a `PDataRecord` term! - -Of course, we do that using `pdcons` - which is just the familiar `cons` specialized for `PDataRecord` terms. -```hs -pdcons :: forall label a l s. Term s (PAsData a :--> PDataRecord l :--> PDataRecord ((label ':= a) ': l)) -``` -It takes a `PAsData a` and adds that `a` to the `PDataRecord` heterogenous list. We feed it a `PAsData PCurrencySymbol` and `pdnil` - the empty data record. That should give us- -```hs -pdcons # currSymDat # pdnil :: Term _ (PDataRecord '[ label ':= PCurrencySymbol ]) -``` -Cool! Wait, what's `label`? It's the field name associated with the field, in our case, we want the field name to be `_0` - because that's what the `PMinting` constructor wants. You can either specify the label with a type application or you can just have a type annotation for the binding (which is what we do here). Or you can let GHC try and match up the `label` with the surrounding environment! - -Now that we have `fields`, we can use it with `PMinting` to build a `PScriptPurpose s` and feed it to `pcon` - we're done! - -#### Implementing PIsDataRepr and friends -Implementing these is rather simple with generic deriving + `PIsDataReprInstances`. All you need is a well formed type using `PDataRecord`. For example, suppose you wanted to implement `PIsDataRepr` for the Plutarch version of this Haskell type- -```hs -data Vehicle - = FourWheeler Integer Integer Integer Integer - | TwoWheeler Integer Integer - | ImmovableBox -``` -You'd declare the corresponding Plutarch type as- -```hs -import Plutarch.Prelude - -data PVehicle (s :: S) - = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) - | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) - | PImmovableBox (Term s (PDataRecord '[])) -``` -> Note: The constructor ordering in `PVehicle` matters! If you used [`makeIsDataIndexed`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#v:makeIsDataIndexed) on `Vehicle` to assign an index to each constructor - the Plutarch type's constructors must follow the same indexing order. -> -> In this case, `PFourWheeler` is at the 0th index, `PTwoWheeler` is at the 1st index, and `PImmovableBox` is at the 3rd index. Thus, the corresponding `makeIsDataIndexed` usage should be- -> -> ```hs -> PlutusTx.makeIsDataIndexed ''FourWheeler [('FourWheeler,0),('TwoWheeler,1),('ImmovableBox,2)] -> ``` -> Also see: [Isomorphism between Haskell ADTs and `PIsDataRepr`](#the-isomorphism-between-makeisdataindexed-haskell-adts-and-pisdatarepr) - -And you'd simply derive `PIsDataRepr` using generics. However, you **must** also derive `PIsData` using `PIsDataReprInstances`. Moreover, you should also derive `PlutusType`. For single constructor data types, you should also derive `PDataFields`. - -> Aside: If your type is *not* a sumtype, but rather a newtype with a single constructor - you should also derive `PDataFields`. In the case of sumtypes, the existing `PDataFields` instance for `PDataRecord` will be enough. - -Combine all that, and you have- -```hs -import qualified GHC.Generics as GHC -import Generics.SOP (Generic) - -import Plutarch.Prelude -import Plutarch.DataRepr - -data PVehicle (s :: S) - = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) - | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) - | PImmovableBox (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData) - via PIsDataReprInstances PVehicle -``` -> Note: You cannot implement `PIsDataRepr` for types that are represented using [scott encoding](#data-encoding-and-scott-encoding). Your types must be well formed and should be using `PDataRecord` terms instead. - -That's it! Now you can represent `PVehicle` as a `Data` value, as well as deconstruct and access its fields super ergonomically. Let's try it! -```hs --- NOTE: REQUIRES GHC 9! -{-# LANGUAGE QualifiedDo #-} -{-# LANGUAGE OverloadedRecordDot #-} - -import qualified Plutarch.Monadic as P -import Plutarch.Prelude - -test :: Term s (PVehicle :--> PInteger) -test = plam $ \veh' -> P.do - veh <- pmatch veh' - case veh of - PFourWheeler fwh' -> P.do - fwh <- pletFields @'["_0", "_1", "_2", "_3"] fwh' - pfromData fwh._0 + pfromData fwh._1 + pfromData fwh._2 + pfromData fwh._3 - PTwoWheeler twh' -> P.do - twh <- pletFields @'["_0", "_1"] twh' - pfromData twh._0 + pfromData twh._1 - PImmovableBox _ -> 0 -``` -> Note: The above snippet uses GHC 9 features (`QualifiedDo` and `OverloadedRecordDot`). Be sure to check out [how to translate the do syntax to GHC 8](#translating-do-syntax-with-qualifieddo-to-ghc-8) and [alternatives to `OverloadedRecordDot`](#alternatives-to-overloadedrecorddot). - -What about types with singular constructors? It's quite similar to the sum type case. Here's how it looks- -```hs -{-# LANGUAGE UndecidableInstances #-} - -import qualified GHC.Generics as GHC -import Generics.SOP (Generic) - -import Plutarch.Prelude -import Plutarch.DataRepr - -newtype PFoo (s :: S) = PMkFoo (Term s (PDataRecord '["foo" ':= PByteString])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields) - via PIsDataReprInstances PFoo -``` -Just an extra `PDataFields` derivation compared to the sum type usage! (oh and also the ominous `UndecidableInstances`) - -## Working with Types - -### PInteger -`Term s PInteger` has a convenient `Num` instance that allows you to construct Plutarch level integer terms from regular literals. It also means you have all the typical arithmetic operations available to you- - -```haskell -1 + 2 -``` - -where `1` and `2` are `Term s PInteger`s. - -Alongside `Num`, it also has a `PIntegral` instance, allowing you to division, modulus etc. - -It also has a `PEq` and `POrd` instance, allowing you to do Plutarch level equality and comparison. - -It **does not** have a `PlutusType` instance. - -This is synonymous to Plutus Core [builtin integer](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins.html#t:Integer). - -### PBool - -Plutarch level boolean terms can be constructed using `pconstant True` and `pconstant False`. - -```haskell -pif (pconstant PFalse) 7 42 --- evaluates to 42 -``` -You can combine Plutarch booleans terms using `#&&` and `#||`, which are synonyms to `&&` and `||`. These are haskell level operators and therefore have short circuiting. If you don't need short circuiting, you can use the Plutarch level alternatives- `pand'` and `por'` respectively. - -This is synonymous to Plutus Core [builtin boolean](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins-Internal.html#t:BuiltinBool). - -### PString - -`Term s PString` has a `IsString` instance. This allows you to make Plutarch level string terms from regular string literals, provided you have `OverloadedStrings` turned on. - -```haskell -{-# LANGUAGE OverloadedStrings #-} - -"foo" -``` - -where "foo" is actually `Term s PString`. - -It also has a `PEq` instance. And its terms have `Semigroup` and `Monoid` instances - which work the way you would expect. - -It **does not** have a `PlutusType` instance. - -This is synonymous to Plutus Core [builtin string](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins.html#t:BuiltinString) (actually Text). - -### PByteString - -Plutarch level bytestring terms can be created using `phexByteStr` and `pbyteStr`. `phexByteStr` interprets a hex string literal as a `Term s PByteString` and `pbyteStr` merely converts a `ByteString` into a `Term s PByteString`. - -```haskell -import qualified Data.ByteString as BS - -phexByteStr "41" --- yields a `Term s PByteString`, which represents [65] - -pbyteStr (BS.pack [91]) --- yields a `Term s PByteString`, which represents [91] -``` - -Similar to `PString`, it has a `PEq` instance. As well as `Semigroup` and `Monoid` instances for its terms. - -It **does not** have a `PlutusType` instance. - -This is synonymous to Plutus Core [builtin bytestring](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins.html#t:BuiltinByteString). - -### PUnit - -The Plutarch level unit term can be constructed using `pconstant ()`. - -This is synonymous to Plutus Core [builtin unit](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins-Internal.html#t:BuiltinUnit). - -### PBuiltinList -You'll be using builtin lists quite a lot in Plutarch. `PBuiltinList` has a [`PListLike`](#plistlike) instance, giving you access to all the goodies from there! However, `PBuiltinList` can only contain builtin types. In particular, it cannot contain Plutarch functions. - -You can express the constraint of "only builtin types" using `PLift`, exported from `Plutarch.Builtin`-` -```hs -validBuiltinList :: PLift a => PBuiltinList a -``` -As mentioned before, `PBuiltinList` gets access to all the `PListLike` utilities. Other than that, `PLift a => PBuiltinList a` also has a [`PlutusType`](#plutustype-pcon-and-pmatch) instance. You can construct a `PBuiltinList` using `pcon` (but you should prefer using `pcons` from `PListLike`)- -```hs -> pcon $ PCons (phexByteStr "fe") $ pcon PNil -``` -would yield a `PBuiltinList PByteString` with one element - `0xfe`. Of course, you could have done that with `pcons # phexByteStr "fe" # pnil` instead! - -You can also use `pmatch` to match on a list- -```hs -pmatch (pcon $ PCons (phexByteStr "fe") $ pcon PNil) $ \case - PNil -> "hey hey there's nothing here!" - PCons _ _ -> "oooo fancy!" -``` -But you should prefer `pelimList` from `PListLike` instead- -```hs -pelimList (\_ _ -> "oooo fancy") "hey hey there's nothing here!" $ pcon $ PCons (phexByteStr "fe") $ pcon PNil -``` -The first argument is a function that is invoked for the `PCons` case, with the head and tail of the list as arguments. - -The second argument is the value to return when the list is empty. It's *only evaluated* **if the list is empty**. - -The final argument is, of course, the list itself. - -> Aside: Interested in the lower level details of `PBuiltinList` (i.e Plutus Core builtin lists)? You can find all you need to know about it at [plutonomicon](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-lists.md). - -### PList -Here's the scott encoded cousin of `PBuiltinList`. What does that mean? Well, in practice, it just means that `PList` can contain *any arbitrary* term - not just builtin types. `PList` also has a [`PListLike`](#plistlike) instance - so you won't be missing any of those utilities here! - -`PList` also has a [`PlutusType`](#plutustype-pcon-and-pmatch) instance. You can construct a `PList` using `pcon` (but you should prefer using `pcons` from `PListLike`)- -```hs -> pcon $ PSCons (phexByteStr "fe") $ pcon PSNil -``` -would yield a `PList PByteString` with one element - `0xfe`. Of course, you could have done that with ``pcons # phexByteStr "fe" # pnil`` instead! - -You can also use `pmatch` to match on a list- -```hs -pmatch (pcon $ PSCons (phexByteStr "fe") $ pcon PSNil) $ \case - PSNil -> "hey hey there's nothing here!" - PSCons _ _ -> "oooo fancy!" -``` -But you should prefer `pelimList` from `PListLike` instead- -```hs -pelimList (\_ _ -> "oooo fancy") "hey hey there's nothing here!" $ pcon $ PSCons (phexByteStr "fe") $ pcon PSNil -``` - -### PBuiltinPair -Much like in the case of builtin lists, you'll just be working with builtin functions (or rather, Plutarch synonyms to builtin functions) here. You can find everything about that in [builtin-pairs](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-pairs.md). Feel free to only read the `Plutarch` examples. - -In particular, you can deconstruct `PBuiltinPair` using `pfstBuiltin` and `psndBuiltin`. You can build `PBuiltinPair (PAsData a) (PAsData b)` terms with `ppairDataBuiltin`- -```hs -ppairDataBuiltin :: Term s (PAsData a :--> PAsData b :--> PBuiltinPair (PAsData a) (PAsData b)) -``` - -It's also helpful to note that `PAsData (PBuiltinPair (PAsData a) (PAsData b))` and `PAsData (PTuple a b)` actually have the same representation under the hood. See [`PTuple`](#ptuple) - -### PTuple -These are data encoded pairs. You can build `PTuple`s using `ptuple`- -```hs -ptuple :: Term s (PAsData a :--> PAsData b :--> PTuple a b) -``` -`PTuple` has a [`PDataFields`](#all-about-extracting-fields) instance. As such, you can extract its fields using `pletFields` or `pfield`. - -Since `PAsData (PBuiltinPair (PAsData a) (PAsData b))` and `PAsData (PTuple a b)` have the same representation - you can safely convert between them at no cost- -```hs -ptupleFromBuiltin :: Term s (PAsData (PBuiltinPair (PAsData a) (PAsData b))) -> Term s (PAsData (PTuple a b)) - -pbuiltinPairFromTuple :: Term s (PAsData (PTuple a b)) -> Term s (PAsData (PBuiltinPair (PAsData a) (PAsData b))) -``` - -### PAsData -This is a typed way of representing [`BuiltinData`/`Data`](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). It is highly encouraged you use `PAsData` to keep track of what "species" of `Data` value you actually have. `Data` can be a `Constr` (for sum of products - ADTs), `Map` (for wrapping assoc maps of Data to Data), `List` (for wrapping builtin lists of data), `I` (for wrapping builtin integers), and `B` (for wrapping builtin bytestrings). - -> Aside: You might be asking, what's an "`I` data value"? This is referring to the different constructors of `Data`/`BuiltinData`. You can find a full explanation of this at [plutonomicon](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). - -Consider a function that takes in and returns a `B` data value - aka `ByteString` as a `Data` value. If you use the direct Plutarch synonym to `Data` - `PData`, you'd have- -```hs -foo :: Term s (PData :--> PData) -``` -That's not very informative - you have no way to ensure that you're actually working with `B` data values. You could use `PAsData` instead- -```hs -foo :: Term s (PAsData PByteString :--> PAsData PByteString) -``` -Now, you have assurance that you're working with a `Data` value that actually represents a builtin bytestring! - -`PAsData` also makes deconstructing data simple and type safe. When working with raw `PData`, you might find yourself using `pasConstr`, `pasList` etc. on the type `PData`. If `PData` wasn't actually a `Constr` data value - `pasConstr` would cause an evaluation error at runtime. - -Instead, you should use `pfromData` (from the typeclass `PIsData`) which will use the correct builtin function depending on the type of `PAsData` you have. Some useful instances of it are- -```hs -pfromData :: Term s (PAsData PInteger) -> Term s PInteger - -pfromData :: Term s (PAsData PByteString) -> Term s PByteString - -pfromData :: Term s (PAsData (PBuiltinList (PAsData a))) -> Term s (PBuiltinList (PAsData a)) -``` - -You can also create a `PAsData` value from supported types, using `pdata`. Some of the useful instances of it are- -```hs -pdata :: Term s PInteger -> Term s (PAsData PInteger) - -pdata :: Term s PByteString -> Term s (PAsData PByteString) - -pdata :: Term s (PBuiltinList (PAsData a)) -> Term s (PAsData (PBuiltinList (PAsData a))) -``` - -In general, if `PIsData T => T` is a Plutarch type (that can be converted to and from `Data`), `PAsData T` is its `Data` representation. - -You can also create a `PAsData` from a `PData`, but you lose specific type information along the way- -```hs -pdata :: Term s PData -> Term s (PAsData PData) -``` - -To remove boilerplate uses of `pfromData` a new class has been added that tries to implicitly convert from `PIsData a => Term s (PAsData a)` to `Term s a` when using -`hrecField` (or the overloaded record dot) or `pfield`. This will not break instances where `pfromData` is used explicitly. It is important to note that there are -cases where GHC is not able to figure out the instance to remove the `PAsData`, in those cases the usage remains the same, i.e. just add a `pfromData`. This can also be -avoided by adding a type signature. - -### PDataSum & PDataRecord -Plutarch sum and product types are represented using `PDataSum` and `PDataRecord` respectively. These types are crucial to the [`PIsDataRepr`](#pisdatarepr) machinery. - -Whenever you need to represent a non-trivial ADT using [`Data` encoding](#data-encoding-and-scott-encoding), you'll likely be reaching for these. - -More often than not, you'll be using `PDataRecord`. This is used to denote all the fields of a constructor- -```hs -import Plutarch.Prelude - -newtype Foo (s :: S) = Foo (Term s (PDataRecord '["fooField" ':= PInteger])) -``` -`Foo` is a Plutarch type with a single constructor with a single field, named `fooField`, of type `PInteger`. You can [implement `PIsDataRepr`](#implementing-pisdatarepr-and-friends) for it so that `PAsData Foo` is represented as a `Constr` encoded data value. - -You can build `PDataRecord` terms using `pdcons` and `pdnil`. These are the familiar `cons` and `nil` specialized to `PDataRecord` terms. -```hs -pdcons :: forall label a l s. Term s (PAsData a :--> PDataRecord l :--> PDataRecord ((label ':= a) ': l)) - -pdnil :: Term s (PDataRecord '[]) -``` -To add an `a` to the `PDataRecord` term, you must have a `PAsData a`. The other type variable of interest, is `label`. This is just the name of the field you're adding. You can either use type application to specify the field, or use a type annotation, or let GHC match up the types. - -Here's how you'd build a `PDataRecord` with two integer fields, one is named `foo`, the other is named `bar`- -```hs -test :: -test = pdcons @"foo" @PInteger # 7 #$ pdcons @"bar" @PInteger # 42 # pnil -``` - -`PDataSum` on the other hand, is more "free-standing". In particular, the following type- -```hs -PDataSum - [ '[ "_0" ':= PInteger - , "_1" ':= PByteString - ] - , '[ "myField" ':= PBool - ] - ] -``` -represents a sum type with 2 constructors. The first constructor has 2 fields- `_0`, and `_1`, with types `PInteger` and `PByteString` respectively. The second constructor has one field- `myField`, with type `PBool`. -> Note: It's convention to give names like `_0`, `_1` etc. to fields that don't have a canonically meaningful name. They are merely the "0th field", "1st field" etc. - -### PRecord - -You can define and use product ADTs, including records with named fields in Plutarch similar to Haskell's records. For a -Haskell data type like - -```hs -data Circle = Circle{ - x, y :: Integer, - radius :: Natural - } -``` - -the equivalent in Plutarch would be - -```hs -data Circle f = Circle{ - x, y :: f PInteger, - radius :: f PNatural - } -Plutarch.Rec.TH.deriveAll ''Circle -``` - -Each field type needs to be wrapped into the type parameter `f` of kind `PType -> Type`. This is a slight modification -of a common coding style known as Higher-Kinded Data. - -With this definition, `PRecord Circle` will be an instance of [PlutusType](#plutustype-pcon-and-pmatch), so you can use -the usual `pcon` and `pcon'` to construct its value and `pmatch` and `pmatch'` to de-construct it: - -```hs -circle :: Term s (PRecord Circle) -circle = pcon $ PRecord Circle{ - x = 100, - y = 100, - radius = 50 - } - -distanceFromOrigin :: Term s (PRecord Circle :--> PNatural) -distanceFromOrigin = plam $ flip pmatch $ \(PRecord Circle{x, y})-> sqrt #$ projectAbs #$ x * x + y * y -``` - -You may also find `rcon` and `rmatch` from `Plutarch.Rec` a bit more convenient because they don't require the `PRecord` -wrapper. Alternatively, instead of using `pmatch` or its alternatives you can access individual fields using the `field` -accessor from the same module: - -```hs -containsOrigin :: Term s (PRecord Circle :--> PBool) -containsOrigin = plam $ \c-> distanceFromOrigin # c #< pto c # field radius -``` - -#### letrec - -You can use records to define mutually-recursive functions, or more generally (but less usefully) mutually-recursive values. - -```hs -circleFixedPoint :: Term s (PRecord Circle) -circleFixedPoint = punsafeFrom $ letrec $ \Circle{y, radius}-> Circle{ - x = y, - y = 2 * radius, - radius = 50 - } -``` - -#### Record Data - -You can provide a `PIsData` instance for `PRecord Circle` using the following definition: - -```hs -instance RecordFromData Circle -instance PIsData (PRecord Circle) where - pfromData = readData $ recordFromFieldReaders Circle{ - x = DataReader pfromData, - y = DataReader pfromData, - radius = DataReader pfromData - } - pdata = writeData $ recordDataFromFieldWriters Circle{ - x = DataWriter pdata, - y = DataWriter pdata, - radius = DataWriter pdata - } -``` - -If your record has many fields and you only need to a couple of them from `Data`, it's more efficient to use `pfromData` -only on individual fields. You can focus on a single field using the function `fieldFromData`: - -```hs -radiusFromCircleData :: Term s (PAsData (PRecord Circle) :--> PAsData PNatural) -radiusFromCircleData = fieldFromData radius -``` - -### PData -This is a direct synonym to [`BuiltinData`/`Data`](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). As such, it doesn't keep track of what "species" of `Data` it actually is. Is it an `I` data? Is it a `B` data? Nobody can tell for sure! - -Consider using [`PAsData`](#pasdata) instead for simple cases, i.e cases other than `Constr`. - -Consider using [`PDataSum`/`PDataList`](#PDataSum--pdatalist) instead when dealing with ADTs, i.e `Constr` data values. - -You can find more information about `PData` at [Developers' Corner](./DEVGUIDE.md). - -# Examples -Be sure to check out [Compiling and Running](#compiling-and-running) first! - -## Fibonacci number at given index -```hs -import Plutarch.Prelude - -fib :: Term s (PInteger :--> PInteger) -fib = phoistAcyclic $ - pfix #$ plam $ \self n -> - pif - (n #== 0) - 0 - $ pif - (n #== 1) - 1 - $ self # (n - 1) + self # (n - 2) -``` -from [examples](../examples). - -Execution- -```hs -> evalT $ fib # 2 -Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf integer 2)))) -``` - -## Validator that always succeeds -```hs -import Plutarch.Prelude -import Plutarch.Api.V1.Contexts -import Plutarch.Api.V1.Scripts - -alwaysSucceeds :: Term s (PDatum :--> PRedeemer :--> PScriptContext :--> PUnit) -alwaysSucceeds = plam $ \datm redm ctx -> pconstant () -``` -All the arguments are ignored. So we use the generic `PDatum` and `PRedeemer` types. - -Execution- -```hs -> alwaysSucceeds `evalWithArgsT` [PlutusTx.toData (), PlutusTx.toData (), PlutusTx.toData ()] -Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf unit ())))) -``` - -## Validator that always fails -```hs -import Plutarch.Prelude -import Plutarch.Api.Contexts -import Plutarch.Api.Scripts - -alwaysFails :: Term s (PDatum :--> PRedeemer :--> PScriptContext :--> PUnit) -alwaysFails = plam $ \datm redm ctx -> perror -``` -Similar to the example above. - -Execution- -```hs -> alwaysFails `evalWithArgsT` [PlutusTx.toData (), PlutusTx.toData (), PlutusTx.toData ()] -Left (EvaluationError [] "(CekEvaluationFailure,Nothing)") -``` - -## Validator that checks whether a value is present within signatories -```hs --- NOTE: REQUIRES GHC 9! -{-# LANGUAGE QualifiedDo #-} -{-# LANGUAGE OverloadedRecordDot #-} - -import Plutarch.Prelude -import Plutarch.Api.V1.Contexts -import Plutarch.Api.V1.Crypto -import Plutarch.Api.V1.Scripts -import qualified Plutarch.Monadic as P - -checkSignatory :: Term s (PPubKeyHash :--> PDatum :--> PRedeemer :--> PScriptContext :--> PUnit) -checkSignatory = plam $ \ph _ _ ctx' -> P.do - ctx <- pletFields @["txInfo", "purpose"] ctx' - let - purpose = pfromData ctx.purpose - txInfo = pfromData ctx.txInfo - PSpending _ <- pmatch purpose - let signatories = pfromData $ pfield @"signatories" # txInfo - pif (pelem # pdata ph # signatories) - -- Success! - (pconstant ()) - -- Signature not present. - perror -``` -> Note: The above snippet uses GHC 9 features (`QualifiedDo` and `OverloadedRecordDot`). Be sure to check out [how to translate the do syntax to GHC 8](#translating-do-syntax-with-qualifieddo-to-ghc-8) and [alternatives to `OverloadedRecordDot`](#alternatives-to-overloadedrecorddot). - -We match on the script purpose to see if its actually for *spending* - and we get the signatories field from `txInfo` (the 7th field), check if given pub key hash is present within the signatories and that's it! - -It's important that we pass a `PPubKeyHash` *prior* to treating `checkSignatory` as a validator script. -```hs -hashStr :: String -hashStr = "abce0f123e" - -pubKeyHash :: Term s PPubKeyHash -pubKeyHash = pcon $ PPubKeyHash $ phexByteStr hashStr - -mockCtx :: ScriptContext -mockCtx = - ScriptContext - (TxInfo - mempty - mempty - mempty - mempty - mempty - mempty - (interval (POSIXTime 1) (POSIXTime 2)) - [fromString hashStr, "f013", "ab45"] - mempty - "" - ) - (Spending (TxOutRef "" 1)) - -> evalWithArgsT (checkSignatory # pubKeyHash) [PlutusTx.toData (), PlutusTx.toData (), PlutusTx.toData mockCtx] -Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf unit ())))) -``` - -## Using custom datum/redeemer in your Validator -All you have to do is [implement `PIsDataRepr` and friends](#implementing-pisdatarepr-and-friends) for your custom datum/redeemer and you can use it just like `PScriptContext` in your validators! - -# Thumb rules, Tips, and Tricks - -## Plutarch functions are strict - -All Plutarch functions are strict. When you apply a Plutarch function to an argument using `papp` (or `#`/`#$` - synonyms to `papp`) - the argument will be evaluated before being passed into to the function. If you don't want the argument to be evaluated, you can use `pdelay`. - -## Don't duplicate work - -Consider the simple snippet- - -```haskell -pf :: Term s PInteger -pf = let foo = 1 + 2 in pif (foo #== 3) foo 7 -``` - -If you use `printTerm` on this, you'll notice that the computation bound to `foo` is inlined twice- - -``` -(program 1.0.0 ((\\i0 -> force (i1 (equalsInteger (addInteger 1 2) 3) (delay (addInteger 1 2)) (delay 7))) (force ifThenElse))) -``` - -Notice how the `addInteger` computation is present _twice_. In these cases, you should use `plet` to compute once and re-use the computed value- - -```haskell -pf :: Term s PInteger -pf = plet (1 + 3) $ \foo -> pif (foo #== 3) foo 7 -``` - -Here's another example of this, Haskell level functions- - -```haskell -abs :: Term s PInteger -> Term s PInteger -abs x = pif (x #<= -1) (negate x) x -``` - -`x` is going to be inlined _three_ times there. That's really bad if it's a big computation. This is what you should do instead- - -```haskell -abs :: Term s PInteger -> Term s PInteger -abs x' = plet x' $ \x -> pif (x #<= -1) (negate x) x -``` - -Of course, what you _really_ should do , is prefer Plutarch level functions whenever possible. - -### Where should arguments be `plet`ed? -You don't have to worry about work duplication on arguments in *every single scenario*. In particular, the argument to `plam` is also a Haskell function, isn't it? But you don't need to worry about `plet`ing your arguments there since it becomes a Plutarch level function through `plam` - thus, all the arguments are evaluated before being passed in. - -Where else is `plet` unnecessary? Functions taking in continuations, such as `plet` (duh) and `pletFields`, always pre-evaluate the binding. An exception, however, is `pmatch`. In certain cases, you don't need to `plet` bindings within the `pmatch` case handler. For example, if you use `pmatch` on a `PList`, the `x` and `xs` in the `PSCons x xs` *will always be pre-evaluated*. On the other hand, if you use `pmatch` on a `PBuiltinList`, the `x` and `xs` in the `PCons x xs` *are **not** pre-evaluated*. Be sure to `plet` them if you use them several times! - -In general, `plet`ing something back to back several times will be optimized to a singular `plet` anyway. However, you should know that for data encoded types (types that follow "[implementing `PIsDataRepr` and friends](#implementing-pisdatarepr-and-friends)") and scott encoded types, `pmatch` handlers get pre-evaluated bindings. For `PBuiltinList`, and `PDataRecord` - the bindings are not pre-evaluated. - -You should also `plet` local bindings! In particular, if you applied a function (whether it be Plutarch level or Haskell level) to obtain a value, bound the value to a variable (using `let` or `where`) - don't use it multiple times! The binding will simply get inlined as the function application - and it'll keep getting re-evaluated. You should `plet` it first! - -This also applies to field accesses using `OverloadedRecordDot`. When you do `ctx.purpose`, it really gets translated to `hrecField @"purpose" ctx` - that's a function call! If you use the field multiple times, `plet` it first. - -## Prefer Plutarch level functions - -Plutarch level functions have a lot of advantages - they can be hoisted; they are strict so you can [use their arguments however many times you like without duplicating work](#dont-duplicate-work); they are required for Plutarch level higher order functions etc. Unless you _really_ need laziness, like `pif` does, try to use Plutarch level functions. - -Also see: [Hoisting](#hoisting-metaprogramming--and-fundamentals). - -## When to use Haskell level functions? -Although you should generally [prefer Plutarch level functions](#prefer-plutarch-level-functions), there are times when a Haskell level function is actually much better. However, figuring out *when* that is the case - is a delicate art. - -There is one simple and straightforward usecase though, when you want a function argument to be lazily evaluated. In such a case, you should use a Haskell level functions that `pdelay`s the argument before calling some Plutarch level function. Recall that [Plutarch level functions are strict](#plutarch-functions-are-strict). - -Outside of that straightforward usecase, figuring out when to use Haskell level functions is quite complex. Haskell level functions will always be inlined when generating the Plutus Core. Unless the function is used *only once*, this sort of inlining will increase the script size - which is problematic. - -However, if the function is used *only once*, and making it Plutarch level causes extra `plam`s and `#`s to be introduced - you should just make it Haskell level. For example, consider the `pelimList` implementation- -```hs -pelimList :: PLift a => Term s (a :--> PBuiltinList a :--> r) -> Term s r -> Term s (PBuiltinList a) -> Term s r -pelimList match_cons match_nil ls = pmatch ls $ \case - PCons x xs -> match_cons # x # xs - PNil -> match_nil -``` -It takes in a Plutarch level function, let's see a typical usage- -```hs -pelimList - (plam $ \x xs -> pcons # x # (self # xs)) - pnil - ls -``` -This is rather redundant, the above snippet will exhibit inlining to produce- -```hs -pmatch ls $ \case - PCons x xs -> (plam $ \x xs -> pcons # x # (self # xs)) # x # xs - PNil -> match_nil -``` -Extra `plam`s and `#`s have been introduced. Really, `pelimList` could have taken a Haskell level function instead- -```hs -pelimList :: PLift a => (Term s a -> Term s (PBuiltinList a) :--> Term s r) -> Term s r -> Term s (PBuiltinList a) -> Term s r -pelimList match_cons match_nil ls = pmatch ls $ \case - PCons x xs -> match_cons x xs - PNil -> match_nil -``` -Now, the following usage- -```hs -pelimList - (\x xs -> pcons # x # (self # xs)) - pnil - ls -``` -would turn into- -```hs -pmatch ls $ \case - PCons x xs -> pcons # x # (self # xs) - PNil -> match_nil -``` -It turns out that `pelimList` usages *almost always* use a one-off Haskell level function with a redundant `plam` - so `pelimList` would benefit greatly from just taking a Haskell level function directly. - -However, **not all higher order functions** benefit from taking Haskell level functions. In many HOF usages, you could benefit from passing a commonly used function argument, rather than a one-off function argument. Imagine `map`, you don't always map with one-off functions - often, you `map` with existing, commonly used functions. In these cases, that commonly used function ought to be a Plutarch level function, so it can be hoisted and `map` can simply reference it. - -## Hoisting is great - but not a silver bullet - -Hoisting is only beneficial for sufficiently large terms. Hoisting a builtin function, for example - is not very useful- - -```haskell -import Plutarch -import qualified PlutusCore as PLC - -phoistAcyclic $ punsafeBuiltin PLC.UnListData -``` - -The term will be the same size anyway. However, if you had a larger term due to, say, using `pforce` - - -```haskell -phoistAcyclic $ pforce $ punsafeBuiltin PLC.UnListData -``` - -Here, hoisting may be beneficial. - -You don't need to hoist the top level Plutarch function that you would just pass to `compile`. - -## The difference between `PlutusType`/`PCon` and `PLift`'s `pconstant` -`PlutusType` is especially useful for building up Plutarch terms *dynamically* - i.e, from arbitrary Plutarch terms. This is when your Plutarch type's constructors contain other Plutarch terms. - -Another case `PlutusType` is useful is when you want to give your Plutarch type a custom representation, scott encoding, enum - what have you. From the `PlutusType` haddock example- -```hs -data AB = A | B - -instance PlutusType AB where - type PInner AB _ = PInteger - pcon' A = 0 - pcon' B = 1 - pmatch' x f = pif (x #== 0) (f A) (f B) -``` -You can use the `A` and `B` constructors during building, but still have your type be represented as integers under the hood! You cannot do this with `pconstant`. - -You should prefer `pconstant` (from [`PConstant`/`PLift`](#pconstant--plift)) when you can build something up entirely from Haskell level constants and that *something* has the same representation as the Haskell constant. - -## List iteration is strict -Chained list operations (e.g a filter followed by a map) are not very efficient in Plutus Core. In fact, the iteration is not lazy at all! For example, if you did a `pfilter`, followed by a `pmap`, on a builtin list - the entire `pmap` operation would be computed first, the whole list would be iterated through, and *only then* the `pfilter` would start computing. Ridiculous! - -## Let Haskell level functions take responsibility of evaluation -We've discussed how a Haskell level function that operates on Plutarch level terms needs to [be careful](#dont-duplicate-work) about [work duplication](#plet-to-avoid-work-duplication). Related to this point, it's good practice to design your Haskell level functions so that *it takes responsibility* for evaluation. - -The user of your Haskell level function doesn't know how many times it uses the argument it has been passed! If it uses the argument multiple times without `plet`ing it - there's duplicate work! There's 2 solutions to this- -* The user `plet`s the argument before passing it to the Haskell level function. -* The Haskell level function takes responsibility of its argument and `plet`s it itself. - -The former is problematic since it's based on *assumption*. What if the Haskell level function is a good rule follower, and correctly `plet`s its argument if using it multiple times? Well, then there's a `plet` by the caller *and* the callee. It won't evaluate the computation twice, so that's good! But it does increase the execution units and the script size a bit! - -Instead, try to offload the responsbility of evaluation to the Haskell level function - so that it only `plet`s when it needs to. - -Of course, this is not applicable for recursive Haskell level functions! - -## The isomorphism between `makeIsDataIndexed`, Haskell ADTs, and `PIsDataRepr` -When [implementing `PIsDataRepr`](#implementing-pisdatarepr-and-friends) for a Plutarch type, if the Plutarch type also has a Haskell synonym (e.g `ScriptContext` is the haskell synonym to `PScriptContext`) that uses [`makeIsDataIndexed`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#v:makeIsDataIndexed) - you must make sure the constructor ordering is correct. - -> Aside: What's a "Haskell synonym"? It's simply the Haskell type that *is supposed to* correspond to a Plutarch type. There doesn't *necessarily* have to be some sort of concrete connection (though there can be, using [`PLift`/`PConstant`](#pconstant--plift)) - it's merely a connection you can establish mentally. -> -> This detail does come into play in concrete use cases though. After compiling your Plutarch code to a `Script`, when you pass Haskell data types as arguments to the `Script` - they obviously need to correspond to the actual arguments of the Plutarch code. For example, if the Plutarch code is a function taking `PScriptContext`, after compilation to `Script`, you *should* pass in the Haskell data type that actually shares the same representation as `PScriptContext` - the "Haskell synonym", so to speak. In this case, that's `ScriptContext`. - -In particular, with `makeIsDataIndexed`, you can assign *indices* to your Haskell ADT's constructors. This determines how the ADT will be represented in Plutus Core. It's important to ensure that the corresponding Plutarch type *knows* about these indices so it can decode the ADT correctly - in case you passed it into Plutarch code, through Haskell. - -For example, consider `Maybe`. Plutus assigns these indices to its constructors- -```hs -makeIsDataIndexed ''Maybe [('Just, 0), ('Nothing, 1)] -``` -0 to `Just`, 1 to `Nothing`. So the corresponding Plutarch type, `PMaybeData` is defined as- -```hs -data PMaybeData a (s :: S) - = PDJust (Term s (PDataRecord '["_0" ':= a])) - | PDNothing (Term s (PDataRecord '[])) -``` -It'd be a very subtle mistake to instead define it as- -```hs -data PMaybeData a (s :: S) - = PDNothing (Term s (PDataRecord '[])) - | PDJust (Term s (PDataRecord '["_0" ':= a])) -``` -The constructor ordering is wrong! - -It's not just constructor ordering that matters - field ordering does too! Though this is self explanatory. Notice how `PTxInfo` shares the exact same field ordering as its Haskell synonym - `TxInfo`. -```hs -newtype PTxInfo (s :: S) - = PTxInfo - ( Term - s - ( PDataRecord - '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) - , "outputs" ':= PBuiltinList (PAsData PTxOut) - , "fee" ':= PValue - , "mint" ':= PValue - , "dcert" ':= PBuiltinList (PAsData PDCert) - , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) - , "validRange" ':= PPOSIXTimeRange - , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) - , "data" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) - , "id" ':= PTxId - ] - ) - ) -``` -```hs -data TxInfo = TxInfo - { txInfoInputs :: [TxInInfo] - , txInfoOutputs :: [TxOut] - , txInfoFee :: Value - , txInfoMint :: Value - , txInfoDCert :: [DCert] - , txInfoWdrl :: [(StakingCredential, Integer)] - , txInfoValidRange :: POSIXTimeRange - , txInfoSignatories :: [PubKeyHash] - , txInfoData :: [(DatumHash, Datum)] - , txInfoId :: TxId - } -``` -The *field names* don't matter though. They are merely labels that don't exist in runtime. - -## Prefer statically building constants whenever possible -Whenever you can build a Plutarch constant out of a pure Haskell value - do it! Functions such as `pconstant`, `phexByteStr` operate on regular Haskell synonyms of Plutarch types. Unlike `pcon`, which potentially work on Plutarch terms (ex: `pcon $ PJust x`, `x` is a `Term s a`). A Plutarch term is an entirely "runtime" concept. "Runtime" as in "Plutus Core Runtime". They only get evaluated during runtime! - -On the other hand, whenever you transform a Haskell synonym to its corresponding Plutarch type using `pconstant`, `phexByteStr` etc. - you're *directly* building a Plutus Core constant. This is entirely static! There are no runtime function calls, no runtime building, it's just *there*, inside the compiled script. - -Here's an example, let's say you want to build a `PScriptPurpose` - `PMinting "f1e301"`. Which snippet, do you think, is better? -```hs -import Plutarch.Prelude -import Plutarch.Api.V1.Contexts -import Plutarch.Api.V1.Value - -import Plutus.V1.Ledger.Api - -pconstant (Minting "f1e301") --- (or) -let currSym = pcon $ PCurrencySymbol $ phexByteStr "f1e301" - in pcon $ PMinting $ pdcons # pdata currSym # pdnil -``` -The semantics are both are the same. But the former (`pconstant`) compiles to a constant term directly. Whereas the latter compiles to some code that *builds* the constant during Plutus Core runtime. -> Aside: Remember that Haskell runtime is actually compile-time for Plutarch! Even if you have a dynamically computed variable in the Haskell world, it's still a *constant* in the Plutarch world. So you can use it just as well as an argument to `pconstant`! - -Whenever you need to build a Plutarch term of type `a`, from a Haskell value, use `pconstant`. Whenever you need to build a Plutarch term of type `PAsData a`, use `pconstantData`! - -# Common Issues - -## No instance for (PUnsafeLiftDecl a) -You should add `PLift a` to the context! `PLift` is just a synonym to `PUnsafeLiftDecl`. - -## Couldn't match representation of type: ... arising from the 'deriving' clause -If you're getting these errors when deriving typeclasses using the machinery provided by Plutarch (e.g generic deriving, deriving via `PIsDataReprInstances`, `DerivePConstantViaData` etc.) - it means you're missing a constructor import. - -If you get this while using `DerivingVia`, make sure you have imported the constructor of the type you're *deriving via*. - -If you get this while utilizing generic deriving, make sure you have imported the `I` constructor (or any other related constructor)- -```hs -import Generics.SOP (Generic, I (I)) -``` - -## Infinite loop / Infinite AST - -While maybe not immediately obvious, things like the following are a no-go in Plutarch: - -```haskell -f :: Term s (PInteger :--> PInteger) -f = phoistAcyclic $ plam $ \n -> - pif (n #== 0) - 0 - $ n + f # (n - 1) -``` - -The issue here is that the AST is infinitely large. Plutarch will try to traverse this AST and will in the process not terminate, as there is no end to it. In this case you'd fix it by using `pfix`. - -Relevant issue: [#19](https://github.com/Plutonomicon/plutarch/issues/19) - -## Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `hrecField`, or `pletFields`) -You might get some weird errors when using `pfield`/`hrecField`/`pletFields` like the above. Don't be scared! It just means that the type application you used is incorrect. Specifically, the type application names a non-existent field. Re-check the field name string you used in the type application for typos! - -## Expected a type, but "fieldName" has kind `GHC.Types.Symbol` -This just means the argument of a type application wasn't correctly promoted. Most likely arising from a usage of `pfield`/`hrecField`/`pletFields`. In the case of `pfield` and `hrecField`, the argument of type application should have kind `Symbol`. A simple string literal representing the field name should work in this case. In the case of `pletFields`, the argument of type application should have kind `[Symbol]` - a type level list of types with kind `Symbol`. When you use a singleton list here, like `["foo"]` - it's actually parsed as a *regular* list (like `[a]`). A regular list, of course, has kind `Type`. - -All you need to do, is put a `'` (quote) infront of the list, like so- `@'["foo"]`. This will promote the `[a]` to the type level. - -## Lifting `PAsData` -Don't try to lift a `PAsData` term! It's intentionally blocked and partial. The `PLift` instance for `PAsData` is only there to make some important functionality work correctly. But the instance methods will simply error if used. Instead, you should extract the `Term s a` out of `Term s (PAsData a)` using `pfromData` and `plift` that instead! - -# Useful Links -- [Plutonomicon](https://github.com/Plutonomicon/plutonomicon) diff --git a/docs/Introduction.md b/docs/Introduction.md new file mode 100644 index 000000000..09f8a4540 --- /dev/null +++ b/docs/Introduction.md @@ -0,0 +1,101 @@ +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high-quality documentation for Plutarch users! + +# Overview + +Plutarch is an eDSL in Haskell for writing on-chain scripts for Cardano. With some caveats, Plutarch is a [simply-typed lambda calculus](https://en.wikipedia.org/wiki/Simply_typed_lambda_calculus) (or STLC). Writing a script in Plutarch allows us to leverage the language features provided by Haskell while retaining the ability to compile to compact Untyped Plutus Core (or UPLC, which is an untyped lambda calculus). + +When we talk about "Plutarch scripts," we are referring to values of type `Term (s :: S) (a :: PType)`. `Term` is a `newtype` wrapper around a more complex type, the details of which Plutarch end-users can ignore. A `Term` is a typed lambda term; it can be thought of as representing a computation that, if successfully evaluated, will return a value of type `a`. + +The two type variables of the `Term s a` declaration have particular kinds: + +- `s :: S` is like the `s` of `ST s a`. It represents the computation context in a manner that mimics mutable state while providing a familiar functional interface. Sections 1 through 4 of \[[1](#references)] give an accessible introduction to how this works. `s` is never instantiated with a concrete value; it is merely a type-level way to ensure that computational contexts remain properly encapsulated (i.e., different state threads don't interact). For more in-depth coverage of this and other eDSL design principles used in Plutarch, see \[[2](#references)]. +- `a :: PType` is short-hand for "Plutarch Type". We prefix these types with a capital `P`, such as `PInteger`, `PBool`, and so forth. _Tagging_ a `Term` with a `PType` indicates the type of the `Term`'s return value. Doing this allows us to bridge between the simple type system of Plutarch and the untyped UPLC. + +Note that we _should not_ think of a type of kind `PType` as carrying a value; it is a tag for a computation that may produce a value. For instance, the definition of `PInteger` is simply + +```hs +data PInteger s +``` + +That is, there are no data constructors. _If_ a value of type `Term s PInteger` successfully executes the computation within context `s`, the value _computed_ will be an integer. We will never encounter values such as `y :: PInteger; y = 3`; they simply do not exist. While readers new to Plutarch may need some time to fit this into their mental model, it is a crucial distinction to keep in mind. + +> For brevity, we will say a "value of type `Term s a` will evaluate to (...)". This phrase will carry two implicit notions: one, that `Term s a` represents a computation executed in the context `s`; two, evaluating `Term s a` is not guaranteed to succeed. + +In brief, when writing Plutarch scripts, we have a few tasks: + +- A.) Defining _Plutarch Types_ (or _`PType`s_). We prefix these types with a capital `P`, such as `PInteger`, `PMaybe a`, `PBool`, and so forth. As previously mentioned, these form the "tags" for Plutarch `Term`'s, representing the type of the result of compiling and evaluating a Plutarch Script. +- B.) Working with _Plutarch `Terms`_, which are values of the type `Term (s :: S) (a :: PType)`. These are the Plutarch scripts themselves, from which we build up more complex scripts before compiling and executing them on-chain. +- C.) Writing Haskell-level functions _between Plutarch Terms_ (i.e., with types like `Term s a -> Term s b`). Doing so allows us to leverage Haskell's language features and ecosystem. +- D.) Efficiently Converting the functions from _(C.)_ to _Plutarch-level functions_, which are of the type `Term s (a :--> b)`. We can _directly_ convert the functions from (C.) to Plutarch-level functions at the most naive level using `plam`. Additional Plutarch utilities provide for optimization opportunities. +- E.) Compiling and executing the functions from _(D.)_, targetting UPLC for on-chain usage. + +As a preview, the bridge Plutarch provides between Haskell and UPLC looks something like this: + + ------------------------------------------------------ + | *Haskell World* | + ------------------------------------------------------ + | Values with types like `Bool`, `Integer`, `Maybe a`| + ------------------------------------------------------ + ^ | + (functions like `plift`)--| |--(functions like `pconstant`) + | | + | v (`pcon`) + ------------------------------------------------------- | ------------------------------------------------------- + | *Plutarch Term World* | <----------------------- | *Plutarch Type World* | + ------------------------------------------------------- ------------------------------------------------------- + | STLC terms; constants like `Term s PInteger` and | -----------------------> | Types like `PInteger`, `PMaybe a` | + | lambdas like `Term s (PInteger :--> PBool)` | | | | + ------------------------------------------------------- (`pmatch`) ------------------------------------------------------- + | + | + |--(`compile`) + | + | + v + ------------------------------------------------------- + | *UPLC World* | + ------------------------------------------------------- + | Untyped lambda calculus terms. Values of type `Data`| + | | + ------------------------------------------------------- + +Further, you may notice two general categories of functions in Plutarch: "Haskell-level" functions between terms, and "Plutarch-level" +functions _as_ lambda terms. By convention, we will prefix the Haskell-level functions with `h` and the Plutarch-level lambdas +with `p`, for example + +```hs +-- This example is listed here as a preview; the unfamiliar parts will +-- be detailed below. + +-- A Plutarch-level lambda term +pf :: Term s (a :--> b :--> c) + +-- Rcovering a Haskell level function from a Plutarch level function +hf :: Term s a -> Term s b -> Term s c +hf x y = pf # x # y +``` + +Note that `pf` is truly just a Plutarch `Term` and should not be treated specially. + +The remainder of this document cover the bridge between Haskell and Plutarch at a high level. It will _not_ cover all techniques necessary to write production-ready scripts. Nor will it cover the bridge between Plutarch and UPLC beyond the minimum. Nonetheless, it should provide sufficient background to prepare the reader for further study. + +Sections:- + +- [Untyped Plutus Core (UPLC)](./Introduction/Untyped%20Plutus%20Core.md) +- [Plutarch Types](./Introduction/Plutarch%20Types.md) +- [Plutarch `Term`s](./Introduction/Plutarch%20Terms.md) + - [Plutarch Constant `Term`s](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md) + - [Static building of constant `Term`s with `pconstant`](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md#static-building-of-constant-terms-with-pconstant) + - [Dynamic building of constant `Term`s with `pcon`](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md#dynamic-building-of-constant-terms-with-pcon) + - [Overloaded literals](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md#overloaded-literals) + - [Helper functions](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md#helper-functions) + - [Lambdas; Plutarch-level Function `Term`s.](./Introduction/Plutarch%20Terms/Plutarch%20Lambdas.md#lambdas-plutarch-level-function-terms) + - [Function Application](./Introduction/Plutarch%20Terms/Plutarch%20Lambdas.md#function-application) +- [Pattern matching constant `Term`s with `pmatch`.](./Introduction/Pattern%20matching.md) +- [Strictness and Laziness; Delayed Terms and Forcing](./Introduction/Delay%20and%20Force.md) + +# References + +- \[1][Lazy Functional State Threads, by John Launchbury and Simon L Peyton Jones](https://www.microsoft.com/en-us/research/wp-content/uploads/1994/06/lazy-functional-state-threads.pdf) +- \[2][Unembedding Domain-Specific Languages, by Robert Atkey, Sam Lindley, and Jeremy Yallop](https://bentnib.org/unembedding.pdf) +- \[3][Matt Parson: Basic Type Level Programming in Haskell](https://www.parsonsmatt.org/2017/04/26/basic_type_level_programming_in_haskell.html) diff --git a/docs/Introduction/Delay and Force.md b/docs/Introduction/Delay and Force.md new file mode 100644 index 000000000..3933f0f94 --- /dev/null +++ b/docs/Introduction/Delay and Force.md @@ -0,0 +1,38 @@ +# Strictness and Laziness; Delayed Terms and Forcing + +Plutarch, like UPLC, is strict by default; this is in contrast to Haskell, which is nonstrict. In practice, this means that calling a function in Plutarch evaluates _all_ arguments to the Plutarch lambda `Term` beforehand. + +> Note: the below example does not correspond precisely to the implementation of `pif` or `pif'`; it is for didactic purposes only + +This behavior may be undesirable, for example, when one of two `Term`s are branched upon within an `if` statement. The Plutarch level function `pif'` is naturally strict in its arguments - and therefore evaluate both branches before even entering the function body. + +```hs +pif' :: Term s (PBool :--> b :--> b :--> b) +pif' = plam hif +``` + +A strict `if` is undesirable for the obvious reason: we only follow one branch at runtime, so it doesn't make sense to evaluate both before examining the `PBool` value to which we apply `pif`. + +To avoid this, we use `pdelay` to create a "delayed `Term`." `pdelay` wraps the `PType` tag of a term, overriding the default strict behavior and indicating that the term should _not_ be evaluated immediately. `pdelay` has the following type: + +```hs +pdelay :: Term s a -> Term s (PDelayed a) +``` + +A delayed term evaluates when it is _forced_ using the `pforce` function. Forcing a term strips the `PDelayed` wrapper: + +```hs +pforce :: Term s (PDelayed a) -> Term s a +``` + +Thus, if we wanted a lazy `pif`, we could do the following: + +```hs +-- | Utilizing Haskell level functions with `pdelay` and `pforce` to have lazy wrapper around `pif`. +hif :: Term s PBool -> Term s a -> Term s a -> Term s a +hif cond whenTrue whenFalse = pforce $ pif' # cond # pdelay whenTrue # pdelay whenFalse +``` + +A note of caution: calling `pforce` on the same delayed term twice will execute the computation each time. Users familiar with Haskell's handling of laziness -- where forcing a thunk twice never duplicates computation -- should note that UPLC behaves differently. + +Finally, readers should note that `pdelay` and `pforce` are extremely powerful tools when writing Plutarch scripts and are encouraged to familiarize themselves accordingly. diff --git a/docs/Introduction/Pattern matching.md b/docs/Introduction/Pattern matching.md new file mode 100644 index 000000000..69e7a5664 --- /dev/null +++ b/docs/Introduction/Pattern matching.md @@ -0,0 +1,44 @@ +# Pattern matching constant `Term`s with `pmatch`. + +We've shown how to construct `Term`s out of the data constructors of types with kind `PType` (i.e., `pcon . PJust`). Next, it is natural that we may want to pattern match on `Term` with a known `PType` tag (i.e., of a value with type `Term s (PMaybe a)`) to produce another `Term` (i.e., depending on whether the value matches `PJust _` or `Nothing`.) + +The function that we need is a method of the `PMatch` typeclass. For the time being, we will ignore the details of implementation and only look at the type: + +```hs +pmatch :: forall (a :: PType) (s :: S) (b :: PType). + PMatch a => {- We have two constraints on the type `a`: + it has a `PMatch` instance. -} + Term s a -> -- Given a `Term` tagged with `a`... + (a s -> Term s b) -> -- ...and a function from `a s` to a Term s b`... + Term s b -- ...produce a `Term s b` +``` + +The annotation of the second argument deserves some focus; the second argument has its type displayed as `(a s -> Term s b)`. First, recall that `a` is declared to have kind `PType`, and `PType` is a kind synonym for `S -> Type`. Thus, since `s` has kind `S`, we have that `a s` has the _kind_ `Type`. That is, it is a regular Haskell type. + +What this means, in practice, is that `pmatch` matches on the possible values of the _result_ of evaluating a `Term s a` -- specifically, it matches on _values_ of a _type_ that has _kind `PType`_ -- and branches accordingly. The second argument to `pmatch` is a _continuation_; it determines how the program continues once `pmatch` has done its work. + +We have already introduced a type with kind `PType` suitable for branching: `PMaybe`. Here is an example: + +```hs +{- | This function takes in a Haskell-level `PMaybe` value (specifically, _not_ a `Term`) + and returns a `Term` depending on the Haskell-level pattern match on `PMaybe`s data + constructors. +-} +continuation :: PMaybe a s -> Term s PBool +continuation x = case x of + PJust _ -> pconstant True + PNothing -> pconstant False + +{- | A Haskell-level `isJust` on Plutarch `Term`s. `pmatch` can match on + the possibilities of `PJust _` or `PNothing` being the result of an evaluated + `Term`. +-} +hisJust :: Term s (PMaybe a) -> Term s PBool +hisJust x = pmatch x continuation + +-- | A Plutarch-level `isJust` +pisJust :: Term s (PMaybe a :--> PBool) +pisJust = plam hisJust +``` + +Readers should note that this is not the most ergonomic way to deal with pattern matching (Plutarch provides two versions of `do` syntax), but it _is_ how the more ergonomic methods work under the hood. diff --git a/docs/Introduction/Plutarch Terms.md b/docs/Introduction/Plutarch Terms.md new file mode 100644 index 000000000..d66cc5c17 --- /dev/null +++ b/docs/Introduction/Plutarch Terms.md @@ -0,0 +1,21 @@ +# Plutarch `Term`s + +Plutarch `Term`s are terms in the sense of simply-typed lambda calculus terms. In a lambda calculus, we can construct terms as either "constants" or "lambdas," and terms can either be "open" (having free variables) or "closed" (having no free variables). We compose Plutarch `Term`s to build up increasingly complex computations. Once all free variables are eliminated from a `Term` (making it a `Closed Term`), we can compile it using the eponymous function from the `Plutarch` module: + +```hs +-- | Closed term is a type synonym +type ClosedTerm (a :: PType) = forall (s :: S). Term s a + +-- | Compile operates on closed terms to produce usable UPLC scripts. +compile :: ClosedTerm a -> Script +``` + +`Term`s are constructed from Haskell values and are tagged with `PType`s. + +- [Plutarch Constant `Term`s](./Plutarch%20Terms/Plutarch%20Constants.md) + - [Static building of constant `Term`s with `pconstant`](./Plutarch%20Terms/Plutarch%20Constants.md#static-building-of-constant-terms-with-pconstant) + - [Dynamic building of constant `Term`s with `pcon`](./Plutarch%20Terms/Plutarch%20Constants.md#dynamic-building-of-constant-terms-with-pcon) + - [Overloaded literals](./Plutarch%20Terms/Plutarch%20Constants.md#overloaded-literals) + - [Helper functions](./Plutarch%20Terms/Plutarch%20Constants.md#helper-functions) +- [Lambdas; Plutarch-level Function `Term`s.](./Plutarch%20Terms/Plutarch%20Lambdas.md#lambdas-plutarch-level-function-terms) + - [Function Application](./Plutarch%20Terms/Plutarch%20Lambdas.md#function-application) diff --git a/docs/Introduction/Plutarch Terms/Plutarch Constants.md b/docs/Introduction/Plutarch Terms/Plutarch Constants.md new file mode 100644 index 000000000..322f15443 --- /dev/null +++ b/docs/Introduction/Plutarch Terms/Plutarch Constants.md @@ -0,0 +1,132 @@ +# Plutarch Constant `Term`s + +When evaluated, a constant Plutarch `Term` will always yield the same result. There are several ways of building constant `Term`s: + +- Statically building constant `Term`s from concrete Haskell values when we know the value at compile-time. +- Dynamically building constant `Term`s from Haskell values, i.e. when the constant produced depends on a dynamic value. +- Overloaded literal syntax +- Helper functions + +## Static building of constant `Term`s with `pconstant` + +If we know the desired value of a constant `Term` at compile-time, we can build the `Term` directly from [Haskell synonyms](./../../Concepts/Haskell%20Synonym.md). The function to do so is `pconstant`. + +Constructing constants in this way utilizes the [`PConstant`/`PLift`](./../../Typeclasses/PConstant%20and%20PLift.md) typeclasses. These typeclasses expose the following [associated type familes](https://wiki.haskell.org/GHC/Type_families#An_associated_type_synonym_example): + +```hs +type PLifted :: PType -> Type + +type PConstanted :: Type -> PType +``` + +`pconstant` takes a single argument: a regular Haskell type with a `PConstant`/`PLift` instance, and yields a Plutarch term tagged with the corresponding Plutarch type. + +The relation between the Plutarch type and its Haskell synonym is established by the type families. For any Haskell type `h`, `PConstanted h` is the corresponding Plutarch type. Similarly, for any Plutarch type `p`, `PLifted p` corresponds to the Haskell synonym. + +Lawful instances shall obey the following invariants: + +```hs +PLifted (PConstanted h) ~ h +PConstanted (PLifted p) ~ p +``` + +For example: + +```hs +import Plutarch.Prelude + +-- | A Plutarch level boolean. Its value is "True", in this case. +x :: Term s PBool +x = pconstant True +``` + +The familiar `Bool` has a `PConstant` instance and it corresponds to `PBool` (which has a `PLift` instance). Therefore `PLifted PBool ~ Bool` and `PConstanted Bool ~ PBool`. + +You can also directly create a [`PAsData`](./../../Types/PAsData.md) term using `pconstantData`: + +```hs +import Plutarch.Prelude + +-- | A Plutarch level boolean encoded as `Data`. +x :: Term s (PAsData PBool) +x = pconstantData True +``` + +## Dynamic building of constant `Term`s with `pcon` + +Sometimes the value that we want to treat as a constant `Term` is not known at compile time. To explain how to construct constants when we can only determine the value at runtime, we will examine the `PMaybe` Plutarch type. It can serve the same purpose as the `Maybe` type in Haskell: to represent the situation where computation may not produce a sensible result. + +`PMaybe` has the following definition: + +```hs +data PMaybe (a :: PType) (s :: S) + = PJust (Term s a) + | PNothing +``` + +and the following kind: + +```hs +ghci> :k PMaybe +PMaybe :: PType -> S -> Type +``` + +Let's dissect what this means. + +- `PMaybe` builds a `PType` from a `PType`; given a `PType`, we can tag a computation with the type `PMaybe a` to indicate that its return value should is semantically either `Just a` or `Nothing`. Such a tagging would look like a value with the type `Term s (PMaybe a)`. +- `PJust` and `PNothing` are data constructors. They are _not_ tags. `PJust :: Term s a -> PMaybe (a :: PType) (s :: S)` is a helper to signify the concept of `Just x`. It contains a Plutarch term. + +Now suppose that we want to carry around a constant `Term` in a Plutarch script that can be either `PJust a` or `PNothing`. To do so, we need a function to go from `PJust a` (which we _can_ instantiate as a Haskell value, unlike `PInteger`) to a `Term s (PMaybe a)`. This function is `pcon`: + +```hs +pcon :: a s -> Term s a + +-- For example: + +x :: Term s PInteger +x = pconstant 3 + +justTerm :: Term s (PMaybe PInteger) +justTerm = pcon (PJust x) +``` + +These types deserve some explaination. + +- We are familiar by now with the type of `x`; it is a computation that returns a value that can be interpreted as a Haskell integer if evaluated successfully (in this case, 3). +- The type of `justTerm` represents a computation tagged with the `PMaybe PInteger` type. + +That is, if we ask `justTerm` what it will return when evaluated, it responds, "You should interpret the value I give you as either `Nothing` or `Just Integer`." Of course, we know that the result will always be `Just 3`; but this is the general mechanism to declare a function requiring a `Maybe`. + +The `pcon` function is a method of the [`PCon` typeclass](./../../Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md). + +## Overloaded literals + +`pconstant` and `pcon` are the long-form ways of building constants. Specific constant Haskell literals are overloaded to help construct Plutarch constants. We provide two examples below. + +```hs +{-# LANGUAGE OverloadedStrings #-} + +import Plutarch.Prelude + +-- | A Plutarch level integer. Its value is 1, in this case. +x :: Term s PInteger +x = 1 + +-- | A Plutarch level string (this is actually `Text`). Its value is "foobar", in this case. +y :: Term s PString +y = "foobar" +``` + +## Helper functions + +Finally, Plutarch provides helper functions to build certain types of constants: + +```hs +import qualified Data.ByteString as BS +import Plutarch.Prelude + +-- | A plutarch level bytestring. Its value is [65], in this case. +x :: Term s PByteString +x = phexByteStr "41" +-- ^ 'phexByteStr' interprets a hex string as a bytestring. 0x41 is 65 - of course. +``` diff --git a/docs/Introduction/Plutarch Terms/Plutarch Lambdas.md b/docs/Introduction/Plutarch Terms/Plutarch Lambdas.md new file mode 100644 index 000000000..8abc7803e --- /dev/null +++ b/docs/Introduction/Plutarch Terms/Plutarch Lambdas.md @@ -0,0 +1,70 @@ +# Lambdas; Plutarch-level Function `Term`s. + +Lambdas are the second form of Plutarch `Term`s. Lambda terms are represented at the type level by the infix type constructor `:-->`; a value of type `Term s (a :--> b)` evaluates to a function that takes a value of type `a` and produces a value of type `b`. + +You can create Plutarch lambda `Term`s by applying the `plam` function to a Haskell-level function that works on Plutarch terms. The true type of `plam` itself is unimportant to end-users of Plutarch, but it should be thought of as + +```hs +plam :: (Term s a -> Term s b) -> Term s (a :--> b) +``` + +To create the identity function as a Plutarch lambda, we would thus use: + +```hs +-- | Haskell-level `id` function specialized to the `Term s a` type`` +termId :: Term s a -> Term s a +termId x = x + +-- | Plutarch-level `id` lambda +pid :: Term s (a :--> a) +pid = plam x + +-- | Equivalently: +pid' :: Term s (a :--> a) +pid' = plam $ \x -> x +``` + +Notice the type. A Plutarch lambda `Term` uses the `:-->` infix operator to encode a function type. So in the above case, `pid` is a Plutarch level function that takes a type `a` and returns the same type. As one would expect, `:-->` is right-associative, and things curry like a charm. + +Guess what this Plutarch level function does: + +```hs +f :: Term s (PInteger :--> PString :--> a :--> a) +``` + +It takes in an integer, a string, and a type `a` and returns the same type `a`. Notice that the types are all of kind `PType`. This means that when faced with filling out the gap: + +```hs +f :: Term s (PInteger :--> PString :--> a :--> a) +f = plam $ \??? +``` + +We know that the argument to `plam` here is a Haskell function `g` with type `Term s PInteger -> Term s PString -> Term s a -> Term s a`. + +## Function Application + +Once we construct a Plutarch lambda `Term` using `plam`, it is rather useless unless we apply it to an argument. Plutarch provides two operators to do so + +```hs +{- | + High precedence infixl function application, to be used like + function juxtaposition. e.g.: + + >>> f # x # y + Conceptually: f x y +-} +(#) :: Term s (a :--> b) -> Term s a -> Term s b +infixl 8 # + +{- | + Low precedence infixr function application, to be used like + `$`, in combination with `#`. e.g.: + + >>> f # x #$ g # y # z + Conceptually: f x (g y z) +-} +(#$) :: Term s (a :--> b) -> Term s a -> Term s b +infixr 0 #$ +``` + +The types of each operator match our intuition. Applying a lambda `Term` to a `Term` (tagged with the `PType` of the domain of the lambda) produces a `Term` (tagged with the `PType` of the codomain.). diff --git a/docs/Introduction/Plutarch Types.md b/docs/Introduction/Plutarch Types.md new file mode 100644 index 000000000..f454581c1 --- /dev/null +++ b/docs/Introduction/Plutarch Types.md @@ -0,0 +1,31 @@ +# Plutarch Types + +When this guide uses the term "Plutarch Type" we explicitly talk about a type of _kind_ `PType`. We will refer to _" types of kind `PType` "_ simply as `PType`s. We explicitly qualify when referring to the _kind_ `PType`. + +> Note to beginners: Plutarch uses a language extension called `DataKinds`. This means that there are kinds beyond `Type` (aka `*`). We refer the read to \[[3](./../Introduction.md#references)] for an extended beginner-level introduction to these concepts if desired. + +`PType` is defined as `type PType = S -> Type`; that is, it is a _kind synonym_ for `S -> Type` (where `S` and `Type` are themselves kinds). This synonym is important to keep in mind because when querying the kind of something like `PBool` in, say, GHCi, we will _not_ see `PType` as the kind. Instead, we get + +```hs +ghci> :k PBool +PBool :: S -> Type +``` + +Thus, any time we see the kind `S -> Type`, we should mentally substitute its kind synonym `PType`. We reiterate: types of kind `PType`, should be considered as _tags_ on computation. They do not represent types of values in the same way as standard Haskell types. + +The kind of basic types such as `Integer` in Haskell has the kind: `Type`; the corresponding "basic" kind in Plutarch is simply `PType`. Higher-kinded types in Haskell, such as `Maybe`, will kinds such as `Type -> Type`. In Plutarch, the corresponding kind is: + +```hs +ghci> :k PMaybe +PMaybe :: PType -> S -> Type +``` + +Since the kind arrow `->` is right-associative, we first read this as `PMaybe :: PType -> (S -> Type)`; and since we know that that `PType` and `S -> Type` and synonyms, we read this as `PMaybe :: PType -> PType`, which should agree without intuition. + +The kind `S -> Type` is mysterious at first, but we recall that `PType`s are _tags_ on (unexecuted) computations indicating their result type. The `S` kind represents the computational context; thus, a `PType` expects to receive a _computational context_ represented by a value `s` whose type has kind `S` that it will tag to produce a `Type`. Note that end-users never instantiate the value `s` with a concrete value; it is simply a type-level mechanism to maintain functional purity. + +The above notion is essential to understanding why not all `PType`s have data constructors; the data constructors are irrelevant, except insofar as they enable the implementation to keep track of Haskell-level and UPLC-level representations. `PInteger` is one such case; it is impossible to construct a constant `y` where `y :: PInteger s`. Other `PType`s, such as `PMaybe`, _do_ have data constructors (specifically `PJust` and `PNothing`), but _still_ do not carry data from the viewpoint of UPLC. A value such as `PNothing` merely facilitates convenient term construction and deconstruction. When `pcon` sees `PNothing`, it knows it should build a UPLC constant that is _morally_ equivalent to the concept of `Nothing :: Maybe a`. + +In general, the concrete UPLC representations are connected to Plutarch types through their `PlutusType` implementation. + +Also see: [Figuring out the representation of a Plutarch type](./../Tricks/Representation%20of%20Plutarch%20type.md). diff --git a/docs/Introduction/Untyped Plutus Core.md b/docs/Introduction/Untyped Plutus Core.md new file mode 100644 index 000000000..aae4f0def --- /dev/null +++ b/docs/Introduction/Untyped Plutus Core.md @@ -0,0 +1,11 @@ +# Untyped Plutus Core (UPLC) + +Plutarch compiles to UPLC. Most Plutarch end-users will not need to concern themselves with the details of UPLC, but a brief overview will aid in building a mental model of how Plutarch works. + +Unlike Haskell, UPLC is a low-level and untyped language implementing a basic lambda calculus. Consequently, it supports only a handful of built-in values and functions which may be strung together in lambda applications. The built-in types provided by UPLC include the usual primitive types -- integers, byte strings and strings, booleans, and so forth -- and a special `Data` value that can encode representations of arbitrary sum-of-products Haskell types. + +While the _semantic_ meaning of a Haskell type such as `Maybe Integer` is missing in UPLC, it still can be _represented_ in UPLC through certain [encodings](./../Concepts/Data%20and%20Scott%20encoding.md). The aforementioned `Data` encoding can be used to represent arbitrary types in on-chain components such as Datum and Redeemers. On the other hand Scott Encoding can additionally encode function types but cannot be used in Datums or Redeemers. The key idea is that UPLC doesn't track what differentiates semantically distinct values, regardless of their encoding, and will not prevent a programmer from operating on the underlying representation in non-sensical ways. + +Plutarch's solution is to _tag_ scripts that compile to UPLC (i.e., Plutarch `Term`s) with types. Doing so allows the Plutarch compiler to track and type check operations on semantically distinct UPLC values. These tags are provided by "Plutarch Types", or "types of kind `PType`". + +For the Plutarch compiler to bridge between arbitrary, semantically-rich Haskell types and the untyped values of UPLC, it is necessary to associate various bits of information with `PType`s. On the one hand, each `PType` should have some semantic, type-level richness such as typeclass instances (otherwise, there would be little point in programming in Haskell!). On the other hand, each `PType` needs to have a UPLC representation, either as a built-in primitive value,`Data`, or as a Scott-encoded lambda, in order to compile to UPLC. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..dc82ac11a --- /dev/null +++ b/docs/README.md @@ -0,0 +1,158 @@ +The Plutarch guide is your one-stop shop for getting up to speed on Plutarch! + +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +
+ Table of Contents + +- [Overview](#overview) + - [Compiling and Running](#compiling-and-running) + - [Introduction and Basic Syntax](#introduction-and-basic-syntax) + - [Practical Usage](#practical-usage) + - [Concepts](#concepts) + - [Typeclasses](#typeclasses) + - [Working with Types](#working-with-types) +- [Examples](#examples) +- [Rules of thumb, Tips, and Tricks](#rules-of-thumb-tips-and-tricks) +- [Common Issues and Troubleshooting](#common-issues-and-troubleshooting) +- [Useful Links](#useful-links) + +
+ +> Aside: Not interested in the details? Skip straight to [examples](#examples)! + +# Overview + +## Compiling and Running + +- [Common Extensions and GHC options](./Run.md#common-extensions-and-ghc-options) +- [Evaluation](./Run.md#evaluation) + +## Introduction and Basic Syntax + +The [Introduction section](./Introduction.md) serves as a introduction to Plutarch's basic concepts and core syntactic constructs. It will help build a mental model of Plutarch, but is insufficient to write production-ready code. + +- [Overview](./Introduction.md#overview) +- [Untyped Plutus Core (UPLC)](./Introduction/Untyped%20Plutus%20Core.md) +- [Plutarch Types](./Introduction/Plutarch%20Types.md) +- [Plutarch `Term`s](./Introduction/Plutarch%20Terms.md) + - [Plutarch Constant `Term`s](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md) + - [Static building of constant `Term`s with `pconstant`](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md#static-building-of-constant-terms-with-pconstant) + - [Dynamic building of constant `Term`s with `pcon`](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md#dynamic-building-of-constant-terms-with-pcon) + - [Overloaded literals](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md#overloaded-literals) + - [Helper functions](./Introduction/Plutarch%20Terms/Plutarch%20Constants.md#helper-functions) + - [Lambdas; Plutarch-level Function `Term`s.](./Introduction/Plutarch%20Terms/Plutarch%20Lambdas.md#lambdas-plutarch-level-function-terms) + - [Function Application](./Introduction/Plutarch%20Terms/Plutarch%20Lambdas.md#function-application) +- [Pattern matching constant `Term`s with `pmatch`.](./Introduction/Pattern%20matching.md) +- [Strictness and Laziness; Delayed Terms and Forcing](./Introduction/Delay%20and%20Force.md) +- [References](./Introduction.md#references) + +## Practical Usage + +The [Usage section](./Usage.md) fills in the gaps left by the previous. It illustrates techniques that make Plutarch easier to work with. + +- [Conditionals](./Usage/Conditionals.md) +- [Recursion](./Usage/Recursion.md) +- [Using the Plutarch Prelude](./Usage/Prelude%20mixin.md) +- [Do syntax with `TermCont`](./Usage/Do%20syntax%20with%20TermCont.md) +- [Do syntax with `QualifiedDo` and `Plutarch.Monadic`](./Usage/Do%20syntax%20with%20QualifiedDo.md) +- [Deriving typeclasses for `newtype`s](./Usage/Deriving%20for%20newtypes.md) +- [Deriving typeclasses with generics](./Usage/Deriving%20with%20generics.md) +- [`plet` to avoid work duplication](./Usage/Avoid%20work%20duplication%20using%20plet.md) +- [Tracing](./Usage/Tracing.md) +- [Raising errors](./Usage/Raising%20errors.md) +- [Unsafe functions](./Usage/Unsafe%20functions.md) +- [Interoperability with PlutusTx](./Usage/FFI.md) + +## Concepts + +The [Concepts section](./Concepts.md) details additional concepts. + +- [Hoisting, metaprogramming, and fundamentals](./Concepts/Hoisting.md) + - [Hoisting Operators](./Concepts/Hoisting.md#hoisting-operators) +- [What is the `s`?](./Concepts/What%20is%20the%20S.md#what-is-the-s) +- [Data encoding and Scott encoding](./Concepts/Data%20and%20Scott%20encoding.md) + - [Data encoding](./Concepts/Data%20and%20Scott%20encoding.md#data-encoding) + - [Scott encoding](./Concepts/Data%20and%20Scott%20encoding.md#scott-encoding) +- [Haskell synonym of Plutarch types](./Concepts/Haskell%20Synonym.md) + +## Typeclasses + +The [Typeclasses section](./Typeclasses.md) discusses the primary typeclasses related to Plutarch. + +- [`PEq` & `POrd`](./Typeclasses/PEq%20and%20POrd.md) +- [`PIntegral`](./Typeclasses/PIntegral.md) +- [`PIsData`](./Typeclasses/PIsData.md) +- [`PlutusType`, `PCon`, and `PMatch`](./Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md) + - [Implementing `PlutusType` for your own types (Scott Encoding)](./Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md#implementing-plutustype-for-your-own-types-scott-encoding) + - [Implementing `PlutusType` for your own types (`Data` Encoding)](./Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md#implementing-plutustype-for-your-own-types-data-encoding) + - [Implementing `PlutusType` for your own types (`newtype`)](./Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md#implementing-plutustype-for-your-own-types-newtype) +- [`PConstant` & `PLift`](./Typeclasses/PConstant%20and%20PLift.md) + - [Implementing `PConstant` & `PLift`](./Typeclasses/PConstant%20and%20PLift.md#implementing-pconstant--plift) + - [Implementing `PConstant` & `PLift` for types with type variables (generic types)](./Typeclasses/PConstant%20and%20PLift.md#implementing-pconstant--plift-for-types-with-type-variables-generic-types) +- [`PListLike`](./Typeclasses/PListLike.md) +- [`PIsDataRepr` & `PDataFields`](./Typeclasses/PIsDataRepr%20and%20PDataFields.md) + - [All about extracting fields](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#all-about-extracting-fields) + - [Alternatives to `OverloadedRecordDot`](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#alternatives-to-overloadedrecorddot) + - [All about constructing data values](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#all-about-constructing-data-values) + - [Implementing `PIsDataRepr` and friends](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) + +## Working with Types + +The [Types section](./Types.md) discusses the core types of Plutarch. + +- [`PInteger`](./Types/PInteger.md) +- [`PBool`](./Types/PBool.md) +- [`PString`](./Types/PString.md) +- [`PByteString`](./Types/PByteString.md) +- [`PUnit`](./Types/PUnit.md) +- [`PBuiltinList`](./Types/PBuiltinList.md) +- [`PList`](./Types/PList.md) +- [`PBuiltinPair`](./Types/PBuiltinPair.md) +- [`PTuple`](./Types/PTuple.md) +- [`PAsData`](./Types/PAsData.md) +- [`PDataSum` & `PDataRecord`](./Types/PDataSum%20and%20PDataRecord.md) +- [`PRecord`](./Types/PRecord.md) + - [letrec](./Types/PRecord.md#letrec) + - [Record Data](./Types/PRecord.md#record-data) +- [`PData`](./Types/PData.md) + +# Examples + +- [Basic examples](./examples/BASIC.md) +- [Validator & Minting policies](./examples/VALIDATOR.md) + +Also see: [examples](https://github.com/Plutonomicon/plutarch/tree/master/plutarch-test). + +# Rules of thumb, Tips, and Tricks + +Outside of the fundamental user guide, there are rules of thumb and general guidelines you can follow to improve your Plutarch experience. The [Tricks section](./Tricks.md) discusses ways of writing efficient and high quality Plutarch code, as well as rules that can help auditing Plutarch easier. + +- [Plutarch functions are strict](./Tricks/Plutarch%20functions%20strict.md) +- [Don't duplicate work](./Tricks/Don't%20duplicate%20work.md) + - [Where should arguments be `plet`ed?](./Tricks/Don't%20duplicate%20work.md#where-should-arguments-be-pleted) +- [Prefer Plutarch level functions](./Tricks/Prefer%20Plutarch%20functions.md) +- [When to use Haskell level functions?](./Tricks/Using%20Haskell%20level%20functions.md) +- [The difference between `PlutusType`/`PCon` and `PLift`'s `pconstant`](./Tricks/Difference%20between%20pcon%20and%20pconstant.md) +- [Let Haskell level functions take responsibility of evaluation](./Tricks/Responsibility%20of%20evaluation%20in%20Haskell%20functions.md) +- [The isomorphism between `makeIsDataIndexed`, Haskell ADTs, and `PIsDataRepr`](./Tricks/makeIsDataIndexed,%20Haskell%20ADTs,%20and%20PIsDataRepr.md) +- [Prefer statically building constants whenever possible](./Tricks/Prefer%20statically%20building%20constants.md) +- [Figuring out the representation of a Plutarch type](./Tricks/Representation%20of%20Plutarch%20type.md) +- [Prefer pattern matching on the result of `pmatch` immediately](./Tricks/Prefer%20matching%20on%20pmatch%20result%20immediately.md) + +# Common Issues and Troubleshooting + +Due to the highly abstracted nature of Plutarch and its utilization of advanced type level concepts, you might face unfamiliar errors. Don't worry, the guide is here to help! + +- [No instance for `PUnsafeLiftDecl a`](./Troubleshooting.md#no-instance-for-punsafeliftdecl-a) +- [Couldn't match representation of type: ... arising from the 'deriving' clause](./Troubleshooting.md#couldnt-match-representation-of-type--arising-from-the-deriving-clause) +- [Infinite loop / Infinite AST](./Troubleshooting.md#infinite-loop--infinite-ast) +- [Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `hrecField`, or `pletFields`)](./Troubleshooting.md#couldnt-match-type-plutarchdatareprinternalpunlabel--arising-from-a-use-of-pfield-or-hrecfield-or-pletfields) +- [Expected a type, but "fieldName" has kind `GHC.Types.Symbol`](./Troubleshooting.md#expected-a-type-but-fieldname-has-kind-ghctypessymbol) +- [Lifting `PAsData`](./Troubleshooting.md#lifting-pasdata) +- [Couldn't match type `PLifted (PConstanted Foo)` with `Foo`](./Troubleshooting.md#couldnt-match-type-plifted-pconstanted-foo-with-foo) +- [Type match errors when using `pfield`/`hrecField` (or `OverloadedRecordDot` to access field)](./Troubleshooting.md#type-match-errors-when-using-pfieldhrecfield-or-overloadedrecorddot-to-access-field) + +# Useful Links + +- [Plutonomicon](https://github.com/Plutonomicon/plutonomicon) diff --git a/docs/Run.md b/docs/Run.md new file mode 100644 index 000000000..e78231b83 --- /dev/null +++ b/docs/Run.md @@ -0,0 +1,110 @@ +This document describes how to compile and run Plutarch - whether for on chain deployment or off chain testing. + +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +
+ Table of Contents + +- [Common Extensions and GHC options](#common-extensions-and-ghc-options) +- [Evaluation](#evaluation) + +
+ +# Common Extensions and GHC options + +You generally want to adhere to the same extensions and GHC options the [Plutarch repo](https://github.com/Plutonomicon/plutarch/blob/master/plutarch.cabal) uses. + +
+ List of GHC extensions + +- `NoStarIsType` +- `BangPatterns` +- `BinaryLiterals` +- `ConstrainedClassMethods` +- `ConstraintKinds` +- `DataKinds` +- `DeriveAnyClass` +- `DeriveDataTypeable` +- `DeriveFoldable` +- `DeriveFunctor` +- `DeriveGeneric` +- `DeriveLift` +- `DeriveTraversable` +- `DerivingStrategies` +- `DerivingVia` +- `DoAndIfThenElse` +- `EmptyCase` +- `EmptyDataDecls` +- `EmptyDataDeriving` +- `ExistentialQuantification` +- `ExplicitForAll` +- `FlexibleContexts` +- `FlexibleInstances` +- `ForeignFunctionInterface` +- `GADTSyntax` +- `GeneralisedNewtypeDeriving` +- `HexFloatLiterals` +- `ImplicitPrelude` +- `InstanceSigs` +- `KindSignatures` +- `LambdaCase` +- `MonomorphismRestriction` +- `MultiParamTypeClasses` +- `NamedFieldPuns` +- `NamedWildCards` +- `NumericUnderscores` +- `OverloadedStrings` +- `PartialTypeSignatures` +- `PatternGuards` +- `PolyKinds` +- `PostfixOperators` +- `RankNTypes` +- `RelaxedPolyRec` +- `ScopedTypeVariables` +- `StandaloneDeriving` +- `StandaloneKindSignatures` +- `TraditionalRecordSyntax` +- `TupleSections` +- `TypeApplications` +- `TypeFamilies` +- `TypeOperators` +- `TypeSynonymInstances` +- `ViewPatterns` + +
+ +# Evaluation + +You can compile a Plutarch term using `compile` (from `Plutarch` module), making sure it has no free variables. `compile` returns a `Script`, which you can use as you would any other Plutus script. The API in [`Plutus.V1.Ledger.Scripts`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Scripts.html) should prove helpful. + +> For further insight into what is compiled - you can use `printTerm` or `printScript` (from `Plutarch` module). + +I often use these helper functions to test Plutarch quickly: + +```haskell +import Data.Text (Text) +import Plutarch.Evaluate (evaluateScript) +import Plutarch (ClosedTerm, compile) +import Plutus.V1.Ledger.Api (ExBudget) +import Plutus.V1.Ledger.Scripts (Script (unScript), ScriptError, applyArguments) +import UntypedPlutusCore (DeBruijn, DefaultFun, DefaultUni, Program) +import PlutusTx (Data) + +eval :: ClosedTerm a -> Either ScriptError (ExBudget, [Text], Program DeBruijn DefaultUni DefaultFun ()) +eval x = fmap (\(a, b, s) -> (a, b, unScript s)) . evaluateScript $ compile x + +evalWithArgs :: ClosedTerm a -> [Data] -> Either ScriptError (ExBudget, [Text], Program DeBruijn DefaultUni DefaultFun ()) +evalWithArgs x args = fmap (\(a, b, s) -> (a, b, unScript s)) . evaluateScript . flip applyArguments args $ compile x +``` + +The fields in the result triple correspond to execution budget (how much memory and CPU units were used), trace log, and script result - respectively. Often you're only interested in the script result, in that case you can use: + +```haskell +evalT :: ClosedTerm a -> Either ScriptError (Program DeBruijn DefaultUni DefaultFun ()) +evalT x = fmap (\(_, _, s) -> unScript s) . evaluateScript $ compile x + +evalWithArgsT :: ClosedTerm a -> [Data] -> Either ScriptError (Program DeBruijn DefaultUni DefaultFun ()) +evalWithArgsT x args = fmap (\(_, _, s) -> unScript s) . evaluateScript . flip applyArguments args $ compile x +``` + +> Note: You can pretty much ignore the UPLC types involved here. All it really means is that the result is a "UPLC program". When it's printed, it's pretty legible - especially for debugging purposes. Although not necessary to use Plutarch, you may find the [Plutonomicon UPLC guide](https://github.com/Plutonomicon/plutonomicon/blob/main/uplc.md) useful. diff --git a/docs/Tricks.md b/docs/Tricks.md new file mode 100644 index 000000000..89af470f2 --- /dev/null +++ b/docs/Tricks.md @@ -0,0 +1,15 @@ +This document discusses various rules of thumb and general trivia, aiming to make life as a Plutarch user or auditor easier. + +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +- [Plutarch functions are strict](./Tricks/Plutarch%20functions%20strict.md) +- [Don't duplicate work](./Tricks/Don't%20duplicate%20work.md) + - [Where should arguments be `plet`ed?](./Tricks/Don't%20duplicate%20work.md#where-should-arguments-be-pleted) +- [Prefer Plutarch level functions](./Tricks/Prefer%20Plutarch%20functions.md) +- [When to use Haskell level functions?](./Tricks/Using%20Haskell%20level%20functions.md) +- [The difference between `PlutusType`/`PCon` and `PLift`'s `pconstant`](./Tricks/Difference%20between%20pcon%20and%20pconstant.md) +- [Let Haskell level functions take responsibility of evaluation](./Tricks/Responsibility%20of%20evaluation%20in%20Haskell%20functions.md) +- [The isomorphism between `makeIsDataIndexed`, Haskell ADTs, and `PIsDataRepr`](./Tricks/makeIsDataIndexed,%20Haskell%20ADTs,%20and%20PIsDataRepr.md) +- [Prefer statically building constants whenever possible](./Tricks/Prefer%20statically%20building%20constants.md) +- [Figuring out the representation of a Plutarch type](./Tricks/Representation%20of%20Plutarch%20type.md) +- [Prefer pattern matching on the result of `pmatch` immediately](./Tricks/Prefer%20matching%20on%20pmatch%20result%20immediately.md) diff --git a/docs/Tricks/Difference between pcon and pconstant.md b/docs/Tricks/Difference between pcon and pconstant.md new file mode 100644 index 000000000..5619c9676 --- /dev/null +++ b/docs/Tricks/Difference between pcon and pconstant.md @@ -0,0 +1,19 @@ +# The difference between `PlutusType`/`PCon` and `PLift`'s `pconstant` + +`PlutusType` is especially useful for building up Plutarch terms _dynamically_ - i.e. from arbitrary Plutarch terms. This is when your Plutarch type's constructors contain other Plutarch terms. + +Another case `PlutusType` is useful is when you want to give your Plutarch type a custom representation, Scott encoding, enum - what have you. From the `PlutusType` haddock example: + +```hs +data AB = A | B + +instance PlutusType AB where + type PInner AB _ = PInteger + pcon' A = 0 + pcon' B = 1 + pmatch' x f = pif (x #== 0) (f A) (f B) +``` + +You can use the `A` and `B` constructors during building, but still have your type be represented as integers under the hood! You cannot do this with `pconstant`. + +You should prefer `pconstant`/`pconstantData` (from [`PConstant`/`PLift`](./../Typeclasses/PConstant%20and%20PLift.md)) when you can build something up entirely from Haskell level constants and that _something_ has the same representation as the Haskell constant. diff --git a/docs/Tricks/Don't duplicate work.md b/docs/Tricks/Don't duplicate work.md new file mode 100644 index 000000000..6b7fb61e1 --- /dev/null +++ b/docs/Tricks/Don't duplicate work.md @@ -0,0 +1,131 @@ +# Don't duplicate work + +Haskell bindings are simply "inlined" during Plutarch compilation. + +Consider the simple snippet: + +```hs +pf :: Term s PInteger +pf = + let foo = 1 + 2 -- | A Haskell binding. + in pif + (foo #== 3) -- | A.) ...then inline here... + foo -- | B.) ...and inline here. + 7 +``` + +Using the `printTerm` function (provided by the top level `Plutarch` module), we can view +the computation bound to `foo`. The formatting below is our own; notice that +`foo`, which becomes `(addInteger 1 2)` in UPLC, is inlined twice: + +```hs +> printTerm pf + +(...) + +(force + (force ifThenElse + (equalsInteger + (addInteger 1 2) -- | A.) `foo` appears here... + 3 + ) + (delay (addInteger 1 2)) -- | B.) ...and here + (delay 7) + ) +) +``` + +Performing this computation twice is obviously bad (in this circumstance), since it will increase +the execution budget for the script. + +A technique to circumvent this is to introduce a free variable via a lambda, +replace the inlined expression (in our case, `(addInteger 1 2)`) with that variable, and them +apply the lambda to the _calculated_ expression: + +```hs +> printTerm pf' + +(...) + +((\\i0 -> -- | A'.) Introduce a lambda here,... + force + (force ifThenElse + (equalsInteger i1 3) -- | B'.) ...apply the argument here,... + (delay i1) -- | C'.) ...and apply the argument here, + (delay 7) + ) + ) (addInteger 1 2) -- | D'.) ...then calculate `foo` once and apply the lambda +) +``` + +Plutarch provides the `plet :: Term s a -> (Term s a -> Term s b) -> Term s b` function +to accomplish exactly this. To demonstrate this technique, the implementation of `pf'` that +will lead to the above UPLC is given as: + +```hs +{- +Note: the letter labels on our annotations match the operations in the +previous example. +-} + +pf' :: Term s PInteger +pf' = + plet (1 + 2) $ -- | D.') Calculate the desired value here (strictly),... + \foo -> -- | A.') ...introduce a lambda abstraction,... + pif + (foo #== 3) -- | B.') ...and apply the argument here... + foo -- | C.') ... and here. + 7 +``` + +Another example of this would be: + +```haskell +abs :: Term s PInteger -> Term s PInteger +abs x = pif (x #<= -1) (negate x) x +``` + +Guess what would happen if you used it like: + +```hs +abs (reallyExpensiveFunction # arg) +``` + +It'd turn into: + +```hs +pif ((reallyExpensiveFunction # arg) #<= -1) (negate (reallyExpensiveFunction # arg)) (reallyExpensiveFunction # arg) +``` + +Oh no. `reallyExpensiveFunction` is going to be _applied three times_. That's 3 times the cost! + +Isntead, consider using `plet`: + +```haskell +abs :: Term s PInteger -> Term s PInteger +abs x' = plet x' $ \x -> pif (x #<= -1) (negate x) x +``` + +Of course, what you _really_ should do , is prefer Plutarch level functions whenever possible. Since arguments to Plutarch level functions are pre-evaluated and those bindings are completely ok to use as many times as you want! + +## Where should arguments be `plet`ed? + +You don't have to worry about work duplication on arguments in _every single scenario_. In particular, the argument to `plam` is also a Haskell function, isn't it? But you don't need to worry about `plet`ing your arguments there since it becomes a Plutarch level function through `plam` - thus, all the arguments are evaluated before being passed in. + +Where else is `plet` unnecessary? Functions taking in continuations, such as `plet` (duh) and `pletFields`, always pre-evaluate the binding. An exception, however, is `pmatch`. In certain cases, you don't need to `plet` bindings within the `pmatch` case handler. For example, if you use `pmatch` on a `PList`, the `x` and `xs` in the `PSCons x xs` _will always be pre-evaluated_. On the other hand, if you use `pmatch` on a `PBuiltinList`, the `x` and `xs` in the `PCons x xs` _are **not** pre-evaluated_. Be sure to `plet` them if you use them several times! + +In general, `plet`ing something back-to-back several times will be optimized to a singular `plet` anyway. However, you should know that for data encoded types (types that follow "[implementing `PIsDataRepr` and friends](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends)") and Scott encoded types, `pmatch` handlers get pre-evaluated bindings. For `PBuiltinList`, and `PDataRecord` - the bindings are not pre-evaluated. + +You should also `plet` local bindings! In particular, if you applied a function (Plutarch level or Haskell level) to obtain a value, then bound that value to a variable e.g. with `let` or `where`, then avoid using it multiple times. The binding will simply get inlined as the function application - and it'll keep getting re-evaluated. You should `plet` it first! + +This also applies to field accesses using `OverloadedRecordDot`. When you do `ctx.purpose`, it really gets translated to `hrecField @"purpose" ctx`, which is a function call! If you use the field multiple times, `plet` it first. + +Another slightly obscure case can be observed in scott encoded types. When you build a scott encoded type using `pcon` - the Plutarch terms you use as fields are simply inlined within the scott encoded type. As such, `pcon $ PPair ` ends up like: + +```hs +(\f -> f ) +``` + +This is practically psuedocode. However, it demonstrates that your expressions are not evaluated when _building_ the scott encoded pair. Indeed, they will be evaluated when you `pmatch` on it. As such, if you `pmatch` on this pair multiple times, those expressions will evaluate multiple times! + +If you _must_ `pmatch` on such types several times, `plet` the fields before building the container type! diff --git a/docs/Tricks/Optimizing unhoistable lambdas.md b/docs/Tricks/Optimizing unhoistable lambdas.md new file mode 100644 index 000000000..5b26ffe22 --- /dev/null +++ b/docs/Tricks/Optimizing unhoistable lambdas.md @@ -0,0 +1,21 @@ +# Optimizing unhoistable lambdas + +Often times, you'll be creating utility functions inside your Plutarch level functions that use free variables. In such cases, the function is unhoistable (i.e, you cannot use `phoistAcyclic` on it). However, it is likely that your goal is to use this utility function within your primary Plutarch level function several times. At which point, your unhoisted function will be inlined every time you use it and therefore increase script size. + +```hs +pfoo :: Term s (PInteger :--> PBuiltinList PInteger :--> PInteger) +pfoo = plam $ \x l -> + let innerf = plam $ \y -> x + y + in innerf # 42 + plength # (pmap # innerf # l) +``` + +Here, both uses of `innerf` will inline the lambda and then apply. This is problematic since you probably wanted to have a single lambda that you could simply reference with a variable. + +In these cases, you can simply [use `plet`](./Don't%20duplicate%20work.md) as you would have [in other places](../Usage/Avoid%20work%20duplication%20using%20plet.md) + +```hs +pfoo :: Term s (PInteger :--> PBuiltinList PInteger :--> PInteger) +pfoo = plam $ \x l -> + plet (plam $ \y -> x + y) $ \innerf -> + innerf # 42 + plength # (pmap # innerf # l) +``` diff --git a/docs/Tricks/Plutarch functions strict.md b/docs/Tricks/Plutarch functions strict.md new file mode 100644 index 000000000..3ea39e8e0 --- /dev/null +++ b/docs/Tricks/Plutarch functions strict.md @@ -0,0 +1,5 @@ +# Plutarch functions are strict + +All Plutarch functions are strict. When you apply a Plutarch function to an argument using `papp` (or `#`/`#$` - synonyms to `papp`) - the argument will be evaluated before being passed into to the function. If you don't want the argument to be evaluated, you can use `pdelay`. + +See: [Delay and Force](./../Introduction/Delay%20and%20Force.md). diff --git a/docs/Tricks/Prefer Plutarch functions.md b/docs/Tricks/Prefer Plutarch functions.md new file mode 100644 index 000000000..83bbbfeb0 --- /dev/null +++ b/docs/Tricks/Prefer Plutarch functions.md @@ -0,0 +1,5 @@ +# Prefer Plutarch level functions + +Plutarch level functions have a lot of advantages - they can be hoisted; they are strict so you can [use their arguments however many times you like without duplicating work](./Don't%20duplicate%20work.md) etc. Unless you _really_ need laziness, like `pif` does, try to use Plutarch level functions. + +Also see: [Hoisting](./../Concepts/Hoisting.md). diff --git a/docs/Tricks/Prefer matching on pmatch result immediately.md b/docs/Tricks/Prefer matching on pmatch result immediately.md new file mode 100644 index 000000000..52e7a4806 --- /dev/null +++ b/docs/Tricks/Prefer matching on pmatch result immediately.md @@ -0,0 +1,29 @@ +# Prefer pattern matching on the result of `pmatch` immediately + +You should always try and pattern match on the result of `pmatch` _immediately_. This is because the semantics of `pmatch` will make anything you write _before_ the pattern match be inlined for every single branch: + +```hs +this :: Term s (PScriptPurpose :--> PInteger) +this = plam $ \x -> pmatch x $ \l -> + plet $ 1 + 2 $ \i -> case l of + PMinting _ -> i + 3 + PSpending _ -> i + 4 + PRewarding _ -> i + 5 + PCertifying _ -> i + 6 +``` + +Notice how the above code `plet`s a computation _before_ matching on `l`, the `pmatch` result. This will make the `plet $ 1 + 2 $ \i -> i + ` be inlined in every branch of your pattern match! That is, not only will it compute the `1 + 2` every time, it will _also_ `plet` it, which introduced an extra lambda, only to immediately apply the lambda! + +You _should always_ match on the result immediately, whenever possible: + +```hs +this :: Term s (PScriptPurpose :--> PInteger) +this = plam $ \x -> plet $ 1 + 2 $ \i -> + pmatch x $ \case + PMinting _ -> i + 3 + PSpending _ -> i + 4 + PRewarding _ -> i + 5 + PCertifying _ -> i + 6 +``` + +This applies much the same with `do` syntax (whether with `TermCont` or with `QualifiedDo`). Try to use inline partial pattern matching (e.g `PMinting _ <- pmatch x`), or pattern match on the very next line (e.g `l <- pmatch x; case l of ...`). diff --git a/docs/Tricks/Prefer statically building constants.md b/docs/Tricks/Prefer statically building constants.md new file mode 100644 index 000000000..ad266605c --- /dev/null +++ b/docs/Tricks/Prefer statically building constants.md @@ -0,0 +1,26 @@ +# Prefer statically building constants whenever possible + +Whenever you can build a Plutarch constant out of a pure Haskell value - do it! Functions such as `pconstant`, `phexByteStr` operate on regular [Haskell synonyms](./../Concepts/Haskell%20Synonym.md) of Plutarch types. Unlike `pcon`, which potentially works on Plutarch terms (e.g. `pcon $ PJust x`, `x` is a `Term s a`). A Plutarch term is an entirely "runtime" concept. "Runtime" as in "Plutus Core Runtime". They only get evaluated during runtime! + +On the other hand, whenever you transform a Haskell synonym to its corresponding Plutarch type using `pconstant`, `phexByteStr` etc. - you're _directly_ building a Plutus Core constant. This is entirely static! There are no runtime function calls, no runtime building, it's just _there_, inside the compiled script. + +Here's an example, let's say you want to build a `PScriptPurpose` - `PMinting "f1e301"`. Which snippet, do you think, is better? + +```hs +import Plutarch.Prelude +import Plutarch.Api.V1.Contexts +import Plutarch.Api.V1.Value + +import Plutus.V1.Ledger.Api + +pconstant (Minting "f1e301") +-- (or) +let currSym = pcon $ PCurrencySymbol $ phexByteStr "f1e301" + in pcon $ PMinting $ pdcons # pdata currSym # pdnil +``` + +The semantics are both are the same. But the former (`pconstant`) compiles to a constant term directly. Whereas the latter compiles to some code that _builds_ the constant during Plutus Core runtime. + +> Aside: Remember that Haskell runtime is actually compile-time for Plutarch! Even if you have a dynamically computed variable in the Haskell world, it's still a _constant_ in the Plutarch world. So you can use it just as well as an argument to `pconstant`! + +Whenever you need to build a Plutarch term of type `a`, from a Haskell value, use `pconstant`. Whenever you need to build a Plutarch term of type `PAsData a`, use `pconstantData`! diff --git a/docs/Tricks/Representation of Plutarch type.md b/docs/Tricks/Representation of Plutarch type.md new file mode 100644 index 000000000..91fd7dbb3 --- /dev/null +++ b/docs/Tricks/Representation of Plutarch type.md @@ -0,0 +1,19 @@ +# Figuring out the representation of a Plutarch type + +We've discussed before how [Plutarch types are merely tags](./../Introduction/Plutarch%20Types.md) and don't have a direct connection to their runtime representations. It's important to be able to intuitively figure out the runtime representations from the data type declaration though. This is why most types follow certain conventions. + +The representation can only be one of two categories: builtin and Scott encoded. All _trivial_ builtin types are already defined in Plutarch: `PInteger`, `PByteString`, `PString`, `PBool`, `PUnit`, `PBuiltinList`, and `PBuiltinPair`. + +Now, let's discuss patterns of data declarations and what representation they _should_ hint at: + +- If it's a newtype to a term containing Plutarch type - it should have the same representation as that underlying Plutarch type. + + e.g. `newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString)` is just represented as `PByteString`. This is ensured by deriving all necessary instances (particularly `PlutusType`) using [`DerivePNewtype`](./../Usage/Deriving%20for%20newtypes.md). + +- If it's an ADT that derives `PlutusType` generically (i.e. `derive anyclass (PlutusType)`)- it uses Scott encoding. This is typically the encoding you want for non-trivial data types that don't need to be part of datums or redeemers. + + e.g. `PList` derives `PlutusType` generically and is represented with Scott encoding. + +- If it's an ADT that derives `PIsDataRepr` generically (i.e. `derive anyclass (PIsDataRepr)`), as well as `PlutusType` via `PIsDataReprInstances`, it's data encoded. Particularly, it's a [`Data`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:Data) value - which is part of the builtin types. + + e.g. `PScriptContext` derives `PIsDataRepr` generically and `PlutusType` via `PIsDataReprInstances`. diff --git a/docs/Tricks/Responsibility of evaluation in Haskell functions.md b/docs/Tricks/Responsibility of evaluation in Haskell functions.md new file mode 100644 index 000000000..bd88e58f8 --- /dev/null +++ b/docs/Tricks/Responsibility of evaluation in Haskell functions.md @@ -0,0 +1,12 @@ +# Let Haskell level functions take responsibility of evaluation + +We've discussed how a Haskell level function that operates on Plutarch level terms needs to [be careful](./Don't%20duplicate%20work.md) about [work duplication](../Usage/Avoid%20work%20duplication%20using%20plet.md). Related to this point, it's good practice to design your Haskell level functions so that _it takes responsibility_ for evaluation. + +The user of your Haskell level function doesn't know how many times it uses the argument it has been passed! If it uses the argument multiple times without `plet`ing it - there's duplicate work! There are two solutions here: + +- The user `plet`s the argument before passing it to the Haskell level function. +- The Haskell level function takes responsibility of its argument and `plet`s it itself. + +The former is problematic since it's based on _assumption_. What if the Haskell level function is a good rule follower, and correctly `plet`s its argument if using it multiple times? Well, then there's a redundant `plet` (though back-to-back `plet`s _will_ be optimized away into one). + +Instead, try to offload the responsbility of evaluation to the Haskell level function - so that it only `plet`s when it needs to. diff --git a/docs/Tricks/Using Haskell level functions.md b/docs/Tricks/Using Haskell level functions.md new file mode 100644 index 000000000..21501bd44 --- /dev/null +++ b/docs/Tricks/Using Haskell level functions.md @@ -0,0 +1,63 @@ +# When to use Haskell level functions? + +Although you should generally [prefer Plutarch level functions](./Prefer%20Plutarch%20functions.md), there are times when a Haskell level function is actually much better. However, figuring out _when_ that is the case - is a delicate art. + +There is one simple and straightforward use case though, when you want a function argument to be lazily evaluated. In such a case, you should use a Haskell level function that `pdelay`s the argument before calling some Plutarch level function. Recall that [Plutarch level functions are strict](./Plutarch%20functions%20strict.md). + +Outside of that straightforward use case, figuring out when to use Haskell level functions is quite complex. Haskell level functions will always be inlined when generating the Plutus Core. Unless the function is used _only once_, this sort of inlining will increase the script size - which is problematic. + +However, if the function is used _only once_, and making it Plutarch level causes extra `plam`s and `#`s to be introduced - you should just make it Haskell level. For example, consider the `pelimList` implementation: + +```hs +pelimList :: PLift a => Term s (a :--> PBuiltinList a :--> r) -> Term s r -> Term s (PBuiltinList a) -> Term s r +pelimList match_cons match_nil ls = pmatch ls $ \case + PCons x xs -> match_cons # x # xs + PNil -> match_nil +``` + +It takes in a Plutarch level function, let's see a typical usage: + +```hs +pelimList + (plam $ \x xs -> pcons # x # (self # xs)) + pnil + ls +``` + +This is rather redundant, the above snippet will translate to: + +```hs +pmatch ls $ \case + PCons x xs -> (plam $ \x xs -> pcons # x # (self # xs)) # x # xs + PNil -> match_nil +``` + +Extra `plam`s and `#`s have been introduced. Really, `pelimList` could have taken a Haskell level function instead: + +```hs +pelimList :: PLift a => (Term s a -> Term s (PBuiltinList a) :--> Term s r) -> Term s r -> Term s (PBuiltinList a) -> Term s r +pelimList match_cons match_nil ls = pmatch ls $ \case + PCons x xs -> match_cons x xs + PNil -> match_nil +``` + +Now, the following usage: + +```hs +pelimList + (\x xs -> pcons # x # (self # xs)) + pnil + ls +``` + +would turn into: + +```hs +pmatch ls $ \case + PCons x xs -> pcons # x # (self # xs) + PNil -> match_nil +``` + +It turns out that using `pelimList` _almost always_ involves using a one-off Haskell level function (and therefore a redundant `plam`). As such, `pelimList` benefits greatly from just taking a Haskell level function directly. + +However, **not all higher order functions** benefit from taking Haskell level functions. In many higher order function use cases, you could benefit from passing a commonly used function argument, rather than a one-off function argument. Imagine `map`, you don't always map with one-off functions - often, you `map` with existing, commonly used functions. In these cases, that commonly used function ought to be a Plutarch level function, so it can be hoisted and `map` can simply reference it. diff --git a/docs/Tricks/makeIsDataIndexed, Haskell ADTs, and PIsDataRepr.md b/docs/Tricks/makeIsDataIndexed, Haskell ADTs, and PIsDataRepr.md new file mode 100644 index 000000000..27f7b4dc7 --- /dev/null +++ b/docs/Tricks/makeIsDataIndexed, Haskell ADTs, and PIsDataRepr.md @@ -0,0 +1,83 @@ +# The isomorphism between `makeIsDataIndexed`, Haskell ADTs, and `PIsDataRepr` + +When [implementing `PIsDataRepr`](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) for a Plutarch type, if the Plutarch type also has a [Haskell synonym](./../Concepts/Haskell%20Synonym.md) (e.g. `ScriptContext` is the Haskell synonym to `PScriptContext`) that uses [`makeIsDataIndexed`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#v:makeIsDataIndexed) - you must make sure the constructor ordering is correct. + +In particular, with `makeIsDataIndexed`, you can assign _indices_ to your Haskell ADT's constructors. This determines how the ADT will be represented in Plutus Core. It's important to ensure that the corresponding Plutarch type _knows_ about these indices so it can decode the ADT correctly - in case you passed it into Plutarch code, through Haskell. + +For example, consider `Maybe`. Plutus assigns these indices to its constructors: + +```hs +makeIsDataIndexed ''Maybe [('Just, 0), ('Nothing, 1)] +``` + +0 to `Just`, 1 to `Nothing`. So the corresponding Plutarch type, `PMaybeData` is defined as: + +```hs +data PMaybeData a (s :: S) + = PDJust (Term s (PDataRecord '["_0" ':= a])) + | PDNothing (Term s (PDataRecord '[])) +``` + +It'd be a very subtle mistake to instead define it as: + +```hs +data PMaybeData a (s :: S) + = PDNothing (Term s (PDataRecord '[])) + | PDJust (Term s (PDataRecord '["_0" ':= a])) +``` + +The constructor ordering is wrong! + +It's not just constructor ordering that matters - field ordering does too! Though this is self explanatory. Notice how `PTxInfo` shares the exact same field ordering as its Haskell synonym - `TxInfo`. + +```hs +newtype PTxInfo (s :: S) + = PTxInfo + ( Term + s + ( PDataRecord + '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) + , "outputs" ':= PBuiltinList (PAsData PTxOut) + , "fee" ':= PValue + , "mint" ':= PValue + , "dcert" ':= PBuiltinList (PAsData PDCert) + , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) + , "validRange" ':= PPOSIXTimeRange + , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) + , "data" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) + , "id" ':= PTxId + ] + ) + ) +``` + +```hs +data TxInfo = TxInfo + { txInfoInputs :: [TxInInfo] + , txInfoOutputs :: [TxOut] + , txInfoFee :: Value + , txInfoMint :: Value + , txInfoDCert :: [DCert] + , txInfoWdrl :: [(StakingCredential, Integer)] + , txInfoValidRange :: POSIXTimeRange + , txInfoSignatories :: [PubKeyHash] + , txInfoData :: [(DatumHash, Datum)] + , txInfoId :: TxId + } +``` + +The _field names_ don't matter though. They are merely labels that don't exist at runtime. + +## What about `newtype`s? + +Of course, this does not apply when you're using `newtype` derivation (e.g `derive newtype ...`) to derive `FromData` or `ToData` for your PlutusTx types. In that case, the `Data` representation is simply the same as the inner type. + +```hs +import qualified PlutusTx +import PlutusTx.Prelude + +newtype CurrencySymbol = CurrencySymbol { unCurrencySymbol :: BuiltinByteString } + deriving newtype (PlutusTx.ToData, PlutusTx.FromData, PlutusTx.UnsafeFromData) +``` + +Here, for example, `CurrencySymbol` has the very same `Data` representation as `BuiltinByteString`. No extra information is added. diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md new file mode 100644 index 000000000..bff2cb1c0 --- /dev/null +++ b/docs/Troubleshooting.md @@ -0,0 +1,79 @@ +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +
+ Table of Contents + +- [No instance for `PUnsafeLiftDecl a`](#no-instance-for-punsafeliftdecl-a) +- [Couldn't match representation of type: ... arising from the 'deriving' clause](#couldnt-match-representation-of-type--arising-from-the-deriving-clause) +- [Infinite loop / Infinite AST](#infinite-loop--infinite-ast) +- [Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `hrecField`, or `pletFields`)](#couldnt-match-type-plutarchdatareprinternalpunlabel--arising-from-a-use-of-pfield-or-hrecfield-or-pletfields) +- [Expected a type, but "fieldName" has kind `GHC.Types.Symbol`](#expected-a-type-but-fieldname-has-kind-ghctypessymbol) +- [Lifting `PAsData`](#lifting-pasdata) +- [Couldn't match type `PLifted (PConstanted Foo)` with `Foo`](#couldnt-match-type-plifted-pconstanted-foo-with-foo) +- [Type match errors when using `pfield`/`hrecField` (or `OverloadedRecordDot` to access field)](#type-match-errors-when-using-pfieldhrecfield-or-overloadedrecorddot-to-access-field) + +
+ +# No instance for `PUnsafeLiftDecl a` + +You should add `PLift a` to the context! `PLift` is just a synonym to `PUnsafeLiftDecl`. + +# Couldn't match representation of type: ... arising from the 'deriving' clause + +If you're getting these errors when deriving typeclasses using the machinery provided by Plutarch (e.g. generic deriving, deriving via `PIsDataReprInstances`, `DerivePConstantViaData` etc.) - it means you're missing a constructor import. + +If you get this while using `DerivingVia`, make sure you have imported the constructor of the type you're _deriving via_. + +If you get this while utilizing generic deriving, make sure you have imported the `I` constructor (or any other related constructor): + +```hs +import Generics.SOP (Generic, I (I)) +``` + +# Infinite loop / Infinite AST + +While maybe not immediately obvious, things like the following are a no-go in Plutarch: + +```haskell +f :: Term s (PInteger :--> PInteger) +f = phoistAcyclic $ plam $ \n -> + pif (n #== 0) + 0 + $ n + f # (n - 1) +``` + +The issue here is that the AST is infinitely large. Plutarch will try to traverse this AST and will in the process not terminate, as there is no end to it. In these cases, consider using `pfix`. + +Relevant issue: [\#19](https://github.com/Plutonomicon/plutarch/issues/19) + +# Couldn't match type `Plutarch.DataRepr.Internal.PUnLabel ...` arising from a use of `pfield` (or `hrecField`, or `pletFields`) + +You might get some weird errors when using `pfield`/`hrecField`/`pletFields` like the above. Don't be scared! It just means that the type application you used is incorrect. Specifically, the type application names a non-existent field. Re-check the field name string you used in the type application for typos! + +# Expected a type, but "fieldName" has kind `GHC.Types.Symbol` + +This just means the argument of a type application wasn't correctly promoted. Most likely arising from a usage of `pletFields`. In the case of `pfield` and `hrecField`, the argument of type application should have kind `Symbol`. A simple string literal representing the field name should work in this case. In the case of `pletFields`, the argument of type application should have kind `[Symbol]` - a type level list of types with kind `Symbol`. When you use a singleton list here, like `["foo"]` - it's actually parsed as a _regular_ list (like `[a]`). A regular list, of course, has kind `Type`. + +All you need to do, is put a `'` (quote) infront of the list, like so- `@'["foo"]`. This will promote the `[a]` to the type level. + +# Lifting `PAsData` + +Don't try to lift a `PAsData` term! It's intentionally blocked and partial. The `PLift` instance for `PAsData` is only there to make some important functionality work correctly. But the instance methods will simply `error` if used. Instead, you should either use `pforgetData` and `plift` that, or extract the `Term s a` out of `Term s (PAsData a)` using `pfromData` and `plift` that instead! + +# Couldn't match type `PLifted (PConstanted Foo)` with `Foo` + +`PLifted (PConstanted h)` should always just be `h` - right? What's this then? + +Orphan instances! Specifically, in order for those type family applications to fully compute (and yield `h`), you need the `PConstant` instance for `h` in scope, as well as the `PLift` instance for the corresponding Plutarch type. Recall that `h` here is a Haskell type - its corresponding `PConstant` instance is _probably_ an orphan instance that you haven't imported. + +This happens often with Plutarch ledger API types. If you didn't import `Plutarch.Api.V1.Contexts` (or some other module that imports it), and you're using `pconstant` on a `ScriptContext` - you'll get an error like this. The `PConstant` instance for `ScriptContext` hasn't been imported - so GHC has no idea what `PConstanted ScriptContext` is! + +Relevant issue: [\#252](https://github.com/Plutonomicon/plutarch/issues/252) + +# Type match errors when using `pfield`/`hrecField` (or `OverloadedRecordDot` to access field) + +You might get nonsensical "Couldn't match type" errors when extracting fields. This has to do with GHC incorrectly inferring the return type. Field extraction is meant to be polymorphic in its return type in the sense that it might either return a `Term s (PAsData p)` term, or simply a `Term s p` (automatic `pfromData`). Unfortunately, sometimes this polymorphism makes it harder for GHC to infer the types. + +You can fix this by providing an explicit type annotation on _the result_ of `pfield` or `hrecField` (or `OverloadedRecordDot` for field access). Otherwise, you can also explicitly use `pfromData` on the result. + +Relevant issue: [\#275](https://github.com/Plutonomicon/plutarch/issues/275) diff --git a/docs/Typeclasses.md b/docs/Typeclasses.md new file mode 100644 index 000000000..627ac970b --- /dev/null +++ b/docs/Typeclasses.md @@ -0,0 +1,20 @@ +This section describes the primary typeclasses used in Plutarch. + +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +- [`PEq` & `POrd`](./Typeclasses/PEq%20and%20POrd.md) +- [`PIntegral`](./Typeclasses/PIntegral.md) +- [`PIsData`](./Typeclasses/PIsData.md) +- [`PlutusType`, `PCon`, and `PMatch`](./Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md) + - [Implementing `PlutusType` for your own types (Scott Encoding)](./Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md#implementing-plutustype-for-your-own-types-scott-encoding) + - [Implementing `PlutusType` for your own types (`Data` Encoding)](./Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md#implementing-plutustype-for-your-own-types-data-encoding) + - [Implementing `PlutusType` for your own types (`newtype`)](./Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md#implementing-plutustype-for-your-own-types-newtype) +- [`PConstant` & `PLift`](./Typeclasses/PConstant%20and%20PLift.md) + - [Implementing `PConstant` & `PLift`](./Typeclasses/PConstant%20and%20PLift.md#implementing-pconstant--plift) + - [Implementing `PConstant` & `PLift` for types with type variables (generic types)](./Typeclasses/PConstant%20and%20PLift.md#implementing-pconstant--plift-for-types-with-type-variables-generic-types) +- [`PListLike`](./Typeclasses/PListLike.md) +- [`PIsDataRepr` & `PDataFields`](./Typeclasses/PIsDataRepr%20and%20PDataFields.md) + - [All about extracting fields](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#all-about-extracting-fields) + - [Alternatives to `OverloadedRecordDot`](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#alternatives-to-overloadedrecorddot) + - [All about constructing data values](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#all-about-constructing-data-values) + - [Implementing `PIsDataRepr` and friends](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) diff --git a/docs/Typeclasses/PConstant and PLift.md b/docs/Typeclasses/PConstant and PLift.md new file mode 100644 index 000000000..9b3b99d2e --- /dev/null +++ b/docs/Typeclasses/PConstant and PLift.md @@ -0,0 +1,217 @@ +# `PConstant` & `PLift` + +These two closely tied together typeclasses establish a bridge between a Plutarch level type (that is represented as a builtin type, i.e. [`DefaultUni`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultUni)) and its corresponding [Haskell synonym](./../Concepts/Haskell%20Synonym.md). The gory details of these two are not too useful to users, but you can read all about it if you want at [Developers' corner](../DEVGUIDE.md#pconstant-and-plift). + +What's more important, are the abilities that `PConstant`/`PLift` instances have: + +```hs +pconstant :: PLift p => PLifted p -> Term s p + +plift :: (PLift p, HasCallStack) => ClosedTerm p -> PLifted p +``` + +These typeclasses also bestow the associated type families: + +```hs +type PLifted :: PType -> Type + +type PConstanted :: Type -> PType +``` + +These are meant to be inverse type families of each other. In particular, `PLifted p` represents the Haskell synonym of the Plutarch type, `p`. Similarly, `PConstanted h` represents the Plutarch type corresponding to the Haskell type, `h`. + +`pconstant` lets you build a Plutarch value from its corresponding Haskell synonym. For example, the Haskell synonym of [`PBool`](./../Types/PBool.md) is [`Bool`](https://hackage.haskell.org/package/base-4.16.0.0/docs/Data-Bool.html#t:Bool). + +```hs +b :: Term s PBool +b = pconstant False +``` + +On the other end, `plift` lets you obtain the Haskell synonym of a Plutarch value (that is represented as a builtin value, i.e. [`DefaultUni`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultUni)): + +```hs +import Plutus.V1.Ledger.Contexts + +purp :: Term s PScriptPurpose +purp = pconstant $ Minting "be" + +> plift purp +Minting "be" +``` + +There's also another handy utility, `pconstantData`: + +```hs +pconstantData :: (PLift p, ToData (PLifted p)) => PLifted p -> Term s (PAsData p) +``` + +> Note: This isn't the actual type of `pconstantData` - it's simplified here for the sake of documentation ;) + +It's simply the `PAsData` building cousin of `pconstant`! + +## Implementing `PConstant` & `PLift` + +If your custom Plutarch type is represented by a builtin type under the hood (i.e. not [Scott encoded](./../Concepts/Data%20and%20Scott%20encoding.md#scott-encoding) - rather one of the [`DefaultUni`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-core/html/PlutusCore.html#t:DefaultUni) types) - you can implement `PLift` for it by using the provided machinery. + +This comes in three flavors: + +- Plutarch type represented **directly** by a builtin type that **is not** `Data` (`DefaultUniData`) ==> `DerivePConstantDirect` + + Ex: `PInteger` is directly represented as a builtin integer. +- Plutarch type represented **indirectly** by a builtin type that **is not** `Data` (`DefaultUniData`) ==> `DerivePConstantViaNewtype` + + Ex: `PPubKeyHash` is a newtype to a `PByteString`, and `PByteString` is _directly_ represented as a builtin bytestring. +- Plutarch type represented by `Data`, i.e. [data encoded](./../Concepts/Data%20and%20Scott%20encoding.md#data-encoding) (`DefaultUniData`) ==> `DerivePConstantViaData` + + Ex: `PScriptPurpose` is represented as a `Data` value. It is synonymous to `ScriptPurpose` from the Plutus ledger api. + +Whichever path you need to go down, there is one common part- implementing `PLift`, or rather `PUnsafeLiftDecl`. See, `PLift` is actually just a type synonym to `PUnsafeLiftDecl`. Essentially an empty typeclass with an associated type family that provides insight on the relationship between a Plutarch type and its Haskell synonym. + +```hs +instance PUnsafeLiftDecl YourPlutarchType where + type PLifted YourPlutarchType = YourHaskellType +``` + +You're tasked with assigning the correct Haskell synonym to your Plutarch type, and what an important task it is! Recall that `pconstant`'s argument type will depend on your assignment here. In particular: `pconstant :: YourHaskellType -> YourPlutarchType`. + +Some examples: + +- for `YourPlutarchType` = `PInteger`, `YourHaskellType` = `Integer` + + ```hs + instance PUnsafeLiftDecl PInteger where type PLifted PInteger = Integer + ``` +- for `YourPlutarchType` = `PValidatorHash`, `YourHaskellType` = `ValidatorHash` + + ```hs + instance PUnsafeLiftDecl PValidatorHash where type PLifted PValidatorHash = Plutus.ValidatorHash + ``` +- for `YourPlutarchType` = `PScriptPurpose`, `YourHaskellType` = `ScriptPurpose` + + ```hs + instance PUnsafeLiftDecl PScriptPurpose where type PLifted PScriptPurpose = Plutus.ScriptPurpose + ``` + +Now, let's get to implementing `PConstant` for the Haskell synonym, via the three methods. The first of which is `DerivePConstantDirect`: + +```hs +{-# LANGUAGE UndecidableInstances #-} + +import Plutarch.Lift (DerivePConstantDirect (DerivePConstantDirect)) +import Plutarch.Prelude + +deriving via (DerivePConstantDirect Integer PInteger) instance (PConstant Integer) +``` + +`DerivePConstantDirect` takes in two type parameters: + +- The Haskell type itself, for which `PConstant` is being implemented for. +- The **direct** Plutarch synonym to the Haskell type. + +Pretty simple! Let's check out `DerivePConstantViaNewtype` now: + +```hs +{-# LANGUAGE UndecidableInstances #-} + +import Plutarch.Lift (DerivePConstantViaNewtype (DerivePConstantViaNewtype)) +import Plutarch.Prelude + +import qualified Plutus.V1.Ledger.Api as Plutus + +newtype PValidatorHash (s :: S) = PValidatorHash (Term s PByteString) + +... + +deriving via (DerivePConstantViaNewtype Plutus.ValidatorHash PValidatorHash PByteString) instance (PConstant Plutus.ValidatorHash) +``` + +`DerivePConstantViaNewtype` takes in three type parameters: + +- The Haskell newtype itself, for which `PConstant` is being implemented for. +- The Plutarch synonym to the Haskell type. +- The actual Plutarch type corresponding to the Haskell type contained within the newtype. + + For example, `ValidatorHash` is a newtype to a `ByteString`, which is synonymous to `PByteString`. In the same way, `PValidatorHash` is actually just a newtype to a `PByteString` term. + During runtime, `ValidatorHash` is actually just a `ByteString`, the same applies for `PValidatorHash`. So we give it the `newtype` treatment with `DerivePConstantViaNewtype`! + +Finally, we have `DerivePConstantViaData` for `Data` values: + +```hs +{-# LANGUAGE UndecidableInstances #-} + +import Plutarch.Lift (DerivePConstantViaNewtype (DerivePConstantViaNewtype)) +import Plutarch.Prelude + +import qualified Plutus.V1.Ledger.Api as Plutus + +data PScriptPurpose (s :: S) + = PMinting (Term s (PDataRecord '["_0" ':= PCurrencySymbol])) + | PSpending (Term s (PDataRecord '["_0" ':= PTxOutRef])) + | PRewarding (Term s (PDataRecord '["_0" ':= PStakingCredential])) + | PCertifying (Term s (PDataRecord '["_0" ':= PDCert])) + +... + +deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) instance (PConstant Plutus.ScriptPurpose) +``` + +`DerivePConstantViaData` takes in two type parameters: + +- The Haskell type itself, for which `PConstant` is being implemented for. +- The Plutarch synonym to the Haskell type. + And that's all you need to know to implement `PConstant` and `PLift`! + +## Implementing `PConstant` & `PLift` for types with type variables (generic types) + +If your Plutarch type and its Haskell synonym are generic types (e.g. `PMaybeData a`) - the implementation gets a tad more difficult. In particular, you need to constrain the generic type variables to be able to use the derivers. + +The constraints observed when implementing `PLift`: + +- Each type variable must also have a `PLift` instance. +- For each type variable `a`: `a ~ PConstanted (PLifted a)` +- Depending on the data declaration, your type variable `PLifted a`, for each `a`, might also need [`FromData`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:FromData) and [`ToData`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:ToData) instances. + +The constraints observed when implementing `PConstant`: + +- Each type variable must also have a `PConstant` instance. +- For each type variable `a`: `a ~ PLifted (PConstanted a)` +- Depending on the data declaration, each type variable `a` might also need [`FromData`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:FromData) and [`ToData`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:ToData) instances. + +Here's how you'd set up all this for `PMaybeData a`: + +```hs +import Plutarch.DataRepr (DerivePConstantViaData (DerivePConstantViaData)) +import Plutarch.Lift (PUnsafeLiftDecl) +import Plutarch.Prelude + +import PlutusTx (FromData, ToData) + +data PMaybeData a (s :: S) + = PDJust (Term s (PDataRecord '["_0" ':= a])) + | PDNothing (Term s (PDataRecord '[])) + +instance + ( PLift p + , p ~ PConstanted (PLifted p) + , FromData (PLifted p) + , ToData (PLifted p) + ) => + PUnsafeLiftDecl (PMaybeData p) + where + type PLifted (PMaybeData p) = Maybe (PLifted p) + +deriving via + ( DerivePConstantViaData + (Maybe h) + (PMaybeData (PConstanted h)) + ) + instance + ( PConstant h + , h ~ PLifted (PConstanted h) + , FromData h + , ToData h + ) => + PConstant (Maybe h) +``` + +Relevant issue: [\#286](https://github.com/Plutonomicon/plutarch/issues/286) diff --git a/docs/Typeclasses/PEq and POrd.md b/docs/Typeclasses/PEq and POrd.md new file mode 100644 index 000000000..f0322c945 --- /dev/null +++ b/docs/Typeclasses/PEq and POrd.md @@ -0,0 +1,78 @@ +# `PEq` & `POrd` + +Plutarch level equality is provided by the `PEq` typeclass: + +```haskell +class PEq t where + (#==) :: Term s t -> Term s t -> Term s PBool +``` + +`PInteger` implements `PEq` as you would expect. So you could do: + +```haskell +1 #== 2 +``` + +That would yield a `Term s PBool`, which you would probably use with `pif` (or similar). + +Similarly, `POrd` emulates `Ord`: + +```haskell +class POrd t where + (#<=) :: Term s t -> Term s t -> Term s PBool + (#<) :: Term s t -> Term s t -> Term s PBool +``` + +It works as you would expect: + +```haskell +{-# LANGUAGE OverloadedStrings #-} + +pif (1 #< 7) "indeed" "what" +``` + +evaluates to `"indeed"` - of type `Term s PString`. + +For scott encoded types, you can easily derive `PEq` via generic deriving: + +```hs +import qualified GHC.Generics as GHC +import Generics.SOP + +import Plutarch.Prelude + +data PMaybe a s + = PNothing + | PJust (Term s a) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PlutusType, PEq) +``` + +For data encoded types, you can derive `PEq` and `POrd` via `PIsDataReprInstances`: + +```hs +import qualified GHC.Generics as GHC +import Generics.SOP + +import Plutarch.Prelude +import Plutarch.DataRepr + +newtype PTriplet a s + = PTriplet + ( Term + s + ( PDataRecord + '[ "x" ':= a + , "y" ':= a + , "z" ':= a + ] + ) + ) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData, PEq, POrd) + via (PIsDataReprInstances (PTriplet a)) +``` + +> Aside: `PEq` derivation for data encoded types uses "Data equality". It simply ensures the structure (as represented through [data encoding](../Concepts/Data%20and%20Scott%20encoding.md#data-encoding)) of both values are _exactly_ the same. It does not take into account any custom `PEq` instances for the individual fields within. diff --git a/docs/Typeclasses/PIntegral.md b/docs/Typeclasses/PIntegral.md new file mode 100644 index 000000000..ad3feea98 --- /dev/null +++ b/docs/Typeclasses/PIntegral.md @@ -0,0 +1,16 @@ +# `PIntegral` + +This is similar to the `Integral` typeclass. However, it only has the following class methods: + +- `pdiv` - similar to `div` +- `pmod` - similar to `mod` +- `pquot` - similar to `quot` +- `prem` - similar to `rem` + +Using these functions, you can do division/modulus etc. on Plutarch level values: + +```hs +pdiv # 6 # 3 +``` + +where `6` and `3` are `Term s PInteger`s yields `2` - also a `Term s PInteger`. diff --git a/docs/Typeclasses/PIsData.md b/docs/Typeclasses/PIsData.md new file mode 100644 index 000000000..71e7de8f2 --- /dev/null +++ b/docs/Typeclasses/PIsData.md @@ -0,0 +1,23 @@ +# `PIsData` + +The `PIsData` typeclass facilitates easy and type safe conversion between Plutarch types and their corresponding [`BuiltinData`/`Data`](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md) representation. It keeps track of the type information through [`PAsData`](./../Types/PAsData.md). + +```hs +class PIsData a where + pfromData :: Term s (PAsData a) -> Term s a + pdata :: Term s a -> Term s (PAsData a) +``` + +[`PInteger`](./../Types/PInteger.md) has a `PIsData` instance. The `PData` representation of `PInteger` is, of course, an `I` data. And you can get the `PInteger` back from an `I` data using `UnIData` (i.e. `pasInt`). + +```hs +instance PIsData PInteger where + pfromData x = pasInt # pforgetData x + pdata x = punsafeBuiltin PLC.IData # x +``` + +In essence, `pdata` wraps a `PInteger` into an `I` data value. Whereas `pfromData` simply unwraps the `I` data value to get a `PInteger`. + +> Aside: You might be asking, what's an "`I` data value"? This is referring to the different constructors of `Data`/`BuiltinData`. You can find a full explanation of this at [Plutonomicon](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). + +For the simple constructors that merely wrap a builtin type into `Data`, e.g. integers, bytestrings, lists, and map, `PIsData` works in much the same way as above. However, what about `Constr` data values? When you have an ADT that doesn't correspond to those simple builtin types directly - but you still need to encode it as `Data` (e.g. `PScriptContext`). In this case, you should [implement `PIsDataRepr`](./PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) and you'll get the `PIsData` instance for free! diff --git a/docs/Typeclasses/PIsDataRepr and PDataFields.md b/docs/Typeclasses/PIsDataRepr and PDataFields.md new file mode 100644 index 000000000..979a39290 --- /dev/null +++ b/docs/Typeclasses/PIsDataRepr and PDataFields.md @@ -0,0 +1,333 @@ +# `PIsDataRepr` & `PDataFields` + +`PIsDataRepr` allows for easily constructing _and_ deconstructing `Constr` [`BuiltinData`/`Data`](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md) values. It allows fully type safe matching on [`Data` encoded](./../Concepts/Data%20and%20Scott%20encoding.md) values, without embedding type information within the generated script - unlike PlutusTx. `PDataFields`, on top of that, allows for ergonomic field access. + +> Aside: What's a `Constr` data value? Briefly, it's how Plutus Core encodes non-trivial ADTs into `Data`/`BuiltinData`. It's essentially a sum-of-products encoding. But you don't have to care too much about any of this. Essentially, whenever you have a custom non-trivial ADT (that isn't just an integer, bytestring, string/text, list, or assoc map) - and you want to represent it as a data encoded value - you should implement `PIsDataRepr` for it. + +For example, `PScriptContext` - which is the Plutarch synonym to [`ScriptContext`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Contexts.html#t:ScriptContext) - has the necessary instances. This lets you easily keep track of its type, match on it, deconstruct it - you name it! + +```hs +-- NOTE: REQUIRES GHC 9! +{-# LANGUAGE QualifiedDo #-} + +import Plutarch.Prelude +import Plutarch.Api.V1.Contexts +import qualified Plutarch.Monadic as P + +foo :: Term s (PScriptContext :--> PString) +foo = plam $ \ctx -> P.do + purpose <- pmatch pfield @"purpose" # ctx + case purpose of + PMinting _ -> "It's minting!" + PSpending _ -> "It's spending!" + PRewarding _ -> "It's rewarding!" + PCertifying _ -> "It's certifying!" +``` + +> Note: The above snippet uses GHC 9 features (`QualifiedDo`). Be sure to check out [Do syntax with `TermCont`](./../Usage/Do%20syntax%20with%20TermCont.md). + +Of course, just like `ScriptContext` - `PScriptContext` is represented as a `Data` value in Plutus Core. Plutarch just lets you keep track of the _exact representation_ of it within the type system. + +Here's how `PScriptContext` is defined: + +```hs +newtype PScriptContext (s :: S) + = PScriptContext + ( Term + s + ( PDataRecord + '[ "txInfo" ':= PTxInfo + , "purpose" ':= PScriptPurpose + ] + ) + ) +``` + +It's a constructor containing a [`PDataRecord`](./../Types/PDataSum%20and%20PDataRecord.md) term. It has 2 fields- `txInfo` and `purpose`. + +First, we extract the `purpose` field using `pfield @"purpose"`: + +```hs +pfield :: Term s (PScriptContext :--> PScriptPurpose) +``` + +> Note: When extracting several fields from the same variable, you should instead use `pletFields`. See: [Extracting fields](#all-about-extracting-fields) + +> Aside: `pfield` is actually return type polymorhpic. It could've returned either `PAsData PScriptPurpose` and `PScriptPurpose`. In this case, GHC correctly infers that we actually want a `PScriptPurpose`, since `pmatch` doesn't work on `PAsData PScriptPurpose`! +> +> Sometimes GHC isn't so smart, and you're forced to provide an explicit type annotation. Or you can simply use `pfromData $ pfield ....`. + +Now, we can `pmatch` on our `Term s PScriptPurpose` to extract the Haskell ADT (`PScriptPurpose s`) out of the Plutarch term: + +```hs +pmatch :: Term s PScriptPurpose -> (PScriptPurpose s -> Term s PString) -> Term s PString +``` + +Now that we have `PScriptPurpose s`, we can just `case` match on it! `PScriptPurpose` is defined as: + +```hs +data PScriptPurpose (s :: S) + = PMinting (Term s (PDataRecord '["_0" ':= PCurrencySymbol])) + | PSpending (Term s (PDataRecord '["_0" ':= PTxOutRef])) + | PRewarding (Term s (PDataRecord '["_0" ':= PStakingCredential])) + | PCertifying (Term s (PDataRecord '["_0" ':= PDCert])) +``` + +It's just a Plutarch sum type. + +We're not really interested in the fields (the `PDataRecord` term), so we just match on the constructor with the familar `case`. Easy! + +Let's pass in a `ScriptContext` as a `Data` value from Haskell to this Plutarch script and see if it works! + +```hs +import Plutus.V1.Ledger.Api +import Plutus.V1.Ledger.Interval +import qualified PlutusTx + +mockCtx :: ScriptContext +mockCtx = + ScriptContext + (TxInfo + mempty + mempty + mempty + mempty + mempty + mempty + (interval (POSIXTime 1) (POSIXTime 2)) + mempty + mempty + "" + ) + (Minting (CurrencySymbol "")) + +> foo `evalWithArgsT` [PlutusTx.toData mockCtx] +Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf string "It's minting!")))) +``` + +> Aside: You can find the definition of `evalWithArgsT` at [Compiling and Running](../README.md#compiling-and-running). + +## All about extracting fields + +We caught a glimpse of field extraction in the example above, thanks to `pfield`. However, that barely touched the surface. + +Once a type has a `PDataFields` instance, field extraction can be done with these 3 functions: + +- `pletFields` +- `pfield` +- `hrecField` (when not using `OverloadedRecordDot` or [record dot preprocessor](https://hackage.haskell.org/package/record-dot-preprocessor)) + +Each has its own purpose. However, `pletFields` is arguably the most general purpose and most efficient. Whenever you need to extract several fields from the same variable, you should use `pletFields`: + +```hs +-- NOTE: REQUIRES GHC 9! +{-# LANGUAGE QualifiedDo #-} +{-# LANGUAGE OverloadedRecordDot #-} + +import Plutarch.Prelude +import Plutarch.Api.V1.Contexts +import qualified Plutarch.Monadic as P + +foo :: Term s (PScriptContext :--> PUnit) +foo = plam $ \ctx' -> P.do + ctx <- pletFields @["txInfo", "purpose"] ctx' + let + purpose = ctx.purpose + txInfo = ctx.txInfo + -- + pconstant () +``` + +> Note: The above snippet uses GHC 9 features (`QualifiedDo` and `OverloadedRecordDot`). Be sure to check out [Do syntax with `TermCont`](./../Usage/Do%20syntax%20with%20TermCont.md) and [alternatives to `OverloadedRecordDot`](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#alternatives-to-overloadedrecorddot). + +In essence, `pletFields` takes in a type level list of the field names that you want to access and a continuation function that takes in an `HRec`. This `HRec` is essentially a collection of the bound fields. You don't have to worry too much about the details of `HRec`. This particular usage has type: + +```hs +pletFields :: Term s PScriptContext + -> (HRec + (BoundTerms + '[ "txInfo" ':= PTxInfo, "purpose" ':= PScriptPurpose] + '[ 'Bind, 'Bind] + s) + -> Term s PUnit) + -> Term s PUnit +``` + +You can then access the fields on this `HRec` using `OverloadedRecordDot`. + +Next up is `pfield`. You should _only ever_ use this if you just want one field from a variable and no more. Its usage is simply `pfield @"fieldName" # variable`. You can, however, also use `pletFields` in this case (e.g. `pletFields @'["fieldName"] variable`). `pletFields` with a singular field has the same efficiency as `pfield`! + +Finally, `hrecField` is merely there to supplement the lack of record dot syntax. See: [Alternative to `OverloadedRecordDot`](#alternatives-to-overloadedrecorddot). + +> Note: An important thing to realize is that `pfield` and `hrecField` (or overloaded record dot on `HRec`) are _return type polymorphic_. They can return both `PAsData Foo` or `Foo` terms, depending on the surrounding context. This is very useful in the case of `pmatch`, as `pmatch` doesn't work on `PAsData` terms. So you can simply write `pmatch $ pfield ...` and `pfield` will correctly choose to _unwrap_ the `PAsData` term. + +### Alternatives to `OverloadedRecordDot` + +If `OverloadedRecordDot` is not available, you can also try using the [record dot preprocessor plugin](https://hackage.haskell.org/package/record-dot-preprocessor). + +If you don't want to use either, you can simply use `hrecField`. In fact, `ctx.purpose` above just translates to `hrecField @"purpose" ctx`. Nothing magical there! + +## All about constructing data values + +We learned about type safe matching (through `PlutusType`) as well as type safe field access (through `PDataFields`) - how about construction? Since `PIsDataRepr` allows you to derive [`PlutusType`](./PlutusType,%20PCon,%20and%20PMatch.md), and `PlutusType` bestows the ability to not only _deconstruct_, but also **construct** values - you can do that just as easily! + +Let's see how we could build a `PMinting` `PScriptPurpose` given a `PCurrencySymbol`: + +```hs +import Plutarch.Prelude +import Plutarch.Api.V1 + +currSym :: Term s PCurrencySymbol +``` + +```hs +purpose :: Term s PScriptPurpose +purpose = pcon $ PMinting fields + where + currSymDat :: Term _ (PAsData PCurrencySymbol) + currSymDat = pdata currSym + fields :: Term _ (PDataRecord '[ "_0" ':= PCurrencySymbol ]) + fields = pdcons # currSymDat # pdnil +``` + +All the type annotations are here to help! + +This is just like regular `pcon` usage you've [from `PlutusType`/`PCon`](./PlutusType,%20PCon,%20and%20PMatch.md). It takes in the Haskell ADT of your Plutarch type and gives back a Plutarch term. + +What's more interesting, is the `fields` binding. Recall that `PMinting` is a constructor with one argument, that argument is a [`PDataRecord`](../Types/PDataSum%20and%20PDataRecord.md) term. In particular, we want: `Term s (PDataRecord '["_0" ':= PCurrencySymbol ])`. It encodes the exact type, position, and name of the field. So, all we have to do is create a `PDataRecord` term! + +Of course, we do that using `pdcons` - which is just the familiar `cons` specialized for `PDataRecord` terms. + +```hs +pdcons :: forall label a l s. Term s (PAsData a :--> PDataRecord l :--> PDataRecord ((label ':= a) ': l)) +``` + +It takes a `PAsData a` and adds that `a` to the `PDataRecord` heterogenous list. We feed it a `PAsData PCurrencySymbol` term and `pdnil` - the empty data record. That should give us: + +```hs +pdcons # currSymDat # pdnil :: Term _ (PDataRecord '[ label ':= PCurrencySymbol ]) +``` + +Cool! Wait, what's `label`? It's the field name associated with the field, in our case, we want the field name to be `_0` - because that's what the `PMinting` constructor wants. You can either specify the label with a type application or you can just have a type annotation for the binding (which is what we do here). Or you can let GHC try and match up the `label` with the surrounding environment! + +Now that we have `fields`, we can use it with `PMinting` to build a `PScriptPurpose s` and feed it to `pcon` - we're done! + +## Implementing `PIsDataRepr` and friends + +Implementing these is rather simple with generic deriving and `PIsDataReprInstances`. All you need is a well formed type using `PDataRecord`. For example, suppose you wanted to implement `PIsDataRepr` for the Plutarch version of this Haskell type: + +```hs +data Vehicle + = FourWheeler Integer Integer Integer Integer + | TwoWheeler Integer Integer + | ImmovableBox +``` + +You'd declare the corresponding Plutarch type as: + +```hs +import Plutarch.Prelude + +data PVehicle (s :: S) + = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) + | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) + | PImmovableBox (Term s (PDataRecord '[])) +``` + +Each field type must also have a `PIsData` instance. We've fulfilled this criteria above as `PInteger` does indeed have a `PIsData` instance. However, think of `PBuiltinList`s, as an example. `PBuiltinList`'s `PIsData` instance is restricted to only `PAsData` elements. + +```hs +instance PIsData a => PIsData (PBuiltinList (PAsData a)) +``` + +Thus, you can use `PBuiltinList (PAsData PInteger)` as a field type, but not `PBuiltinList PInteger`. + +> Note: The constructor ordering in `PVehicle` matters! If you used [`makeIsDataIndexed`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#v:makeIsDataIndexed) on `Vehicle` to assign an index to each constructor - the Plutarch type's constructors must follow the same indexing order. +> +> In this case, `PFourWheeler` is at the 0th index, `PTwoWheeler` is at the 1st index, and `PImmovableBox` is at the 3rd index. Thus, the corresponding `makeIsDataIndexed` usage should be: +> +> ```hs +> PlutusTx.makeIsDataIndexed ''FourWheeler [('FourWheeler,0),('TwoWheeler,1),('ImmovableBox,2)] +> ``` +> +> Also see: [Isomorphism between Haskell ADTs and `PIsDataRepr`](./../Tricks/makeIsDataIndexed,%20Haskell%20ADTs,%20and%20PIsDataRepr.md) + +And you'd simply derive `PIsDataRepr` using generics. However, you **must** also derive `PIsData` and `PlutusType` using `PIsDataReprInstances`. For single constructor data types, you should also derive `PDataFields`. + +Furthermore, you can also derive the following typeclasses via `PIsDataReprInstances`: + +- [`PEq`](./PEq%20and%20POrd.md) +- [`POrd`](./PEq%20and%20POrd.md) + +Combine all that, and you have: + +```hs +{-# LANGUAGE UndecidableInstances #-} + +import qualified GHC.Generics as GHC +import Generics.SOP + +import Plutarch.Prelude +import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) + +data PVehicle (s :: S) + = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) + | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) + | PImmovableBox (Term s (PDataRecord '[])) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData) + via PIsDataReprInstances PVehicle +``` + +> Note: You cannot derive `PIsDataRepr` for types that are represented using [Scott encoding](./../Concepts/Data%20and%20Scott%20encoding.md#scott-encoding). Your types must be well formed and should be using `PDataRecord` terms instead. + +That's it! Now you can represent `PVehicle` as a `Data` value, as well as deconstruct and access its fields super ergonomically. Let's try it! + +```hs +-- NOTE: REQUIRES GHC 9! +{-# LANGUAGE QualifiedDo #-} +{-# LANGUAGE OverloadedRecordDot #-} + +import Plutarch.Prelude +import qualified Plutarch.Monadic as P + +test :: Term s (PVehicle :--> PInteger) +test = plam $ \veh' -> P.do + veh <- pmatch veh' + case veh of + PFourWheeler fwh' -> P.do + fwh <- pletFields @'["_0", "_1", "_2", "_3"] fwh' + fwh._0 + fwh._1 + fwh._2 + fwh._3 + PTwoWheeler twh' -> P.do + twh <- pletFields @'["_0", "_1"] twh' + twh._0 + twh._1 + PImmovableBox _ -> 0 +``` + +> Note: The above snippet uses GHC 9 features (`QualifiedDo` and `OverloadedRecordDot`). Be sure to check out [Do syntax with `TermCont`](./../Usage/Do%20syntax%20with%20TermCont.md) and [alternatives to `OverloadedRecordDot`](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#alternatives-to-overloadedrecorddot). + +What about types with singular constructors? It's quite similar to the sum type case. Here's how it looks: + +```hs +{-# LANGUAGE UndecidableInstances #-} + +import qualified GHC.Generics as GHC +import Generics.SOP + +import Plutarch.Prelude +import Plutarch.DataRepr ( + PDataFields, + PIsDataReprInstances (PIsDataReprInstances), + ) + +newtype PFoo (s :: S) = PMkFoo (Term s (PDataRecord '["foo" ':= PByteString])) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData, PDataFields) + via PIsDataReprInstances PFoo +``` + +Just an extra `PDataFields` derivation compared to the sum type usage! diff --git a/docs/Typeclasses/PListLike.md b/docs/Typeclasses/PListLike.md new file mode 100644 index 000000000..944a5cf40 --- /dev/null +++ b/docs/Typeclasses/PListLike.md @@ -0,0 +1,61 @@ +# `PListLike` + +The `PListLike` typeclass bestows beautiful and familiar list utilities to its instances. Plutarch has two list types- [`PBuiltinList`](./../Types/PBuiltinList.md) and [`PList`](./../Types/PList.md). Both have `PListLike` instances! However, `PBuiltinList` can only contain builtin types. It cannot contain Plutarch functions. The element type of `PBuiltinList` can be constrained using `PLift a => PBuiltinList a`. + +As long as it's a `PLift a => PBuiltinList a` or `PList a` - it has access to all the `PListLike` goodies, out of the box. It helps to look into some of these functions at [`Plutarch.List`](https://github.com/Plutonomicon/plutarch/blob/master/Plutarch/List.hs). + +Along the way, you might be confronted by 2 big mean baddies ...err, constraints: + +```hs +PIsListLike list a +``` + +This just means that the type `list a`, is _indeed_ a valid `PListLike` containing valid elements! Of course, all `PList a`s are valid `PListLike`, but we have to think about `PBuiltinList` since it can only contain `PLift a => a` elements! So, in essence a function declared as: + +```hs +pfoo :: PIsListLike list a => Term s (list a :--> list a) +``` + +when specialized to `PBuiltinList`, can be simplified as: + +```hs +pfoo :: PLift a => Term s (PBuiltinList a :--> PBuiltinList a) +``` + +That's all it is. Don't be scared of it! + +What about this one: + +```hs +PElemConstraint list a +``` + +This one ensures that the element type `a` can indeed be contained within the list type - `list`. For `PList`, this constraint means nothing - it's always true. For `PBuiltinList`, it can be simplified as `PLift a`. Easy! + +Here's two of my favorite `PListLike` utilities (not biased): + +```hs +-- | Cons an element onto an existing list. +pcons :: PElemConstraint list a => Term s (a :--> list a :--> list a) + +-- | The empty list +pnil :: PElemConstraint list a => Term s (list a) +``` + +What would life be without cons and nil? + +Let's build a `PBuiltinList` of `PInteger`s with that: + +```hs +x :: Term s (PBuiltinList PInteger) +x = pcons # 1 #$ pcons # 2 #$ pcons # 3 # pnil +``` + +Wooo! Let's not leave `PList` alone in the corner though: + +```hs +x :: Term s (PList PInteger) +x = pcons # 1 #$ pcons # 2 #$ pcons # 3 # pnil +``` + +The code is the same, we just changed the type annotation. Cool! diff --git a/docs/Typeclasses/PTryFrom.md b/docs/Typeclasses/PTryFrom.md new file mode 100644 index 000000000..2fd29798e --- /dev/null +++ b/docs/Typeclasses/PTryFrom.md @@ -0,0 +1,81 @@ +# `PTryFrom` + +```haskell +class PTryFrom (a :: PType) (b :: PType) where + type PTryFromExcess a b :: PType + ptryFrom :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r +``` + +`PTryFrom` is a typeclass to prove equality between a type that in some way can't be trusted about its representation and another type that we want the untrusted type to be represented as. +`PTryFrom` proves the structure of the untrusted type and recovers it as the trusted, type which hence also carries more information. + +A good example is getting a `PData` from a redeemer and wanting to prove that it is of a certain kind, e.g. a `PAsData (PBuiltinList (PAsData PInteger))`. We could do this with: + +```haskell +recoverListFromPData opq = unTermCont $ fst <$> ptryFromData @(PAsData (PBuiltinList (PAsData PInteger)) opq +``` + +As you can see, it uses the utility function `ptryFromData @b`, which does the same as `ptryFrom @PData @b`. + +## Laws + +- the operation `ptryFrom` mustn't change the representation of the underlying data +- the operation `ptryFrom` must always prove the integrity of the whole target type + - example: + `ptryFrom @PData @(PAsData (PBuiltinList PData))` ssucceeds iff the underlying representation is a `BuiltinList` containing any `PData` +- all conversions are fallible, this happens if the representation doesn't match the expected type. +- the operation `ptryFrom @a @b` proves equality between the less expressive `PType` `a` and the more expressive `PType` `b`, hence the first + element of the resulting Tuple must always be wrapped in `PAsData` if the origin type was `PData` (see law 1) +- the result type `b` must always be safer than the origin type `a`, i.e. it must carry more information + +## `PTryFromExcess` + +An important note is, that `PTryFrom` carries a type `PTryFromExcess` which safes data that arose as "excess" during the act of verifying. For `PData (PAsData PSomething)` instances this most times +carries a `PSomething`, i.e. the type that has been proven equality for but without `PAsData` wrapper. In cases where this type is not useful, the excess type is just an empty `HRec`. + +In case of the recovered type being a record or anything that contains a record, the excess type is more interesting: +It contains an `HRec`, that has all the fields that have been recoverd and all *their* excess stored. If you recover a `PAsData (PDataRecord xs)` from `PData`, there is another field under the accessor `"unwrapped"` that contains the unwrapped record, which representation wise is just a `PBuiltinList +PData`, of course. + +Generally, when recovering a `PDataRecord`, the procedure is as follows + +```haskell +untrustedRecord :: Term s PData +untrustedRecord = + let rec :: Term s (PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) + rec = pdata $ pdcons # (pdata $ pdcons # pdata (pconstant 42) # pdnil) # pdnil + in pforgetData rec + +-- obviously, `untrustedRecord` would be what we get from our untrusted party + +theField :: Term s PInteger +theField = unTermCont $ do + (_, exc) <- tcont (ptryFromData @(PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) untrustedRecord) + pure $ exc._0._1 +``` + +Because the record excess stores the field already in its unwrapped form, you don't have to `pfromData` it again. + +If you don't use `OverloadedRecordDot`, there is an equivalent function `getExcessField` that does the same and works with type applications. + +## Recovering only partially + +In case we don't want to verify the whole structure but rather part of it (this can be a reasonable decision to lower the fees), we can just leave the part of the data that is not to be +verified a `PData` which serves as the base case: + +```haskell +recoverListPartially = ptryFrom @PData @(PAsData (PBuiltinList PData)) +``` + +This is especially important with something like `PDataSum` which simply cannot store the excess types over the barrier of `pmatch` because obviously, +you don't know the type of the excess before actually matching on it. The solution would be to recover an equivalent `PDataSum` whose constructors +contain `PData` and after having matched on those, recover the underlying record or whatever field you're interested in. If you're not interested +in the excess, you could of course also just recover the whole Sum without issue, in this case it won't be more expensive. + +Please be aware, that nuances can already make a performance difference, e.g. +- recovering `ptryFromData @(PAsData (PBuiltinList PData))` is cheaper than `ptryFromData @(PAsData (PBuiltinList (PAsData PDAta)))` because the latter + maps over no-ops, whereas the former just asserts that the `PData` indeed contains a `PBuiltinList`. +- If you only, say, need the head of a list, first recovering a `PAsData (PBuiltinList PData)` (don't forget to use the excess instead of using + `pfromData`), *then* using head and after that recovering the field in there will be cheaper than recovering the whole list with the target type and + using head on that. + diff --git a/docs/Typeclasses/PlutusType, PCon, and PMatch.md b/docs/Typeclasses/PlutusType, PCon, and PMatch.md new file mode 100644 index 000000000..9b5d48d13 --- /dev/null +++ b/docs/Typeclasses/PlutusType, PCon, and PMatch.md @@ -0,0 +1,93 @@ +# `PlutusType`, `PCon`, and `PMatch` + +`PlutusType` is the primary typeclass that determines the underlying representation for a Plutarch type. It lets you construct and deconstruct Plutus Core constants from a Plutarch type's constructors (possibly containing other Plutarch terms). It's essentially a combination of `PCon` (for term construction) and `PMatch` (for term deconstruction). + +```hs +class (PCon a, PMatch a) => PlutusType (a :: k -> Type) where + type PInner a (b' :: k -> Type) :: k -> Type + pcon' :: forall s b. a s -> Term s (PInner a b) + pmatch' :: forall s b. Term s (PInner a b) -> (a s -> Term s b) -> Term s b +``` + +> Note: You don't need to look too much into the types! After all, you'll be using `pcon` and `pmatch`, rather than `pcon'` and `pmatch'`. +> `PInner` is meant to represent the "inner" type of `a` - the Plutarch type representing the Plutus Core constant used to represent `a`. + +Here's the `PlutusType` instance for `PMaybe`: + +```hs +data PMaybe a s = PJust (Term s a) | PNothing + +instance PlutusType (PMaybe a) where + type PInner (PMaybe a) b = (a :--> b) :--> PDelayed b :--> b + pcon' (PJust x) = plam $ \f (_ :: Term _ _) -> f # x + pcon' PNothing = plam $ \_ g -> pforce g + pmatch' x f = x # (plam $ \inner -> f (PJust inner)) # (pdelay $ f PNothing) +``` + +This is a [Scott encoded representation of the familiar `Maybe` data type](./../Concepts/Data%20and%20Scott%20encoding.md#scott-encoding). As you can see, `PInner` of `PMaybe` is actually a Plutarch level function. And that's exactly why `pcon'` creates a _function_. `pmatch'`, then, simply "matches" on the function - Scott encoding fashion. + +You should always use `pcon` and `pmatch` instead of `pcon'` and `pmatch'` - these are provided by the `PCon` and `PMatch` typeclasses: + +```hs +class PCon a where + pcon :: a s -> Term s a + +class PMatch a where + pmatch :: Term s a -> (a s -> Term s b) -> Term s b +``` + +All `PlutusType` instances get `PCon` and `PMatch` instances for free! + +For types that cannot easily be both `PCon` and `PMatch` - feel free to implement just one of them! However, in general, **prefer implementing `PlutusType`**! + +Another feature of `PlutusType` instances is that you can extract out the *inner* type of any `PlutusType` instance! Above, the inner type (or representation) of `PMaybe` was a function. You can use `pto` to safely take this inner type out- + +```hs +pto :: Term s a -> (forall b. Term s (PInner a b)) +``` + +This is quite useful when working with `newtype`s. Notice how `PCurrencySymbol`, for example, is simply a newtype to a `PByteString`. Its `PInner` is also `PByteString`. To be able to use functions that operate on `PByteString`s with your `PCurrencySymbol`, you can simply take out the `PByteString` using `pto`! + +## Implementing `PlutusType` for your own types (Scott Encoding) + +If you want to represent your data type with [Scott encoding](./../Concepts/Data%20and%20Scott%20encoding.md#scott-encoding) (and therefore don't need to make it `Data` encoded), you should simply derive it generically: + +```hs +import qualified GHC.Generics as GHC +import Generics.SOP +import Plutarch.Prelude + +data MyType (a :: PType) (b :: PType) (s :: S) + = One (Term s a) + | Two (Term s b) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PlutusType) +``` + +> Note: This requires the `generics-sop` package. + +## Implementing `PlutusType` for your own types (`Data` Encoding) + +If your type is supposed to be represented using [`Data` encoding](./../Concepts/Data%20and%20Scott%20encoding.md#data-encoding) instead (i.e. has a [`PIsDataRepr`](./PIsDataRepr%20and%20PDataFields.md) instance), you can derive `PlutusType` via `PIsDataReprInstances`: + +```hs +import qualified GHC.Generics as GHC +import Generics.SOP +import Plutarch.Prelude +import Plutarch.DataRepr (PIsDataReprInstances(PIsDataReprInstances)) + +data MyType (a :: PType) (b :: PType) (s :: S) + = One (Term s (PDataRecord '[ "_0" ':= a ])) + | Two (Term s (PDataRecord '[ "_0" ':= b ])) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData) + via PIsDataReprInstances (MyType a b) +``` + +See: [Implementing `PIsDataRepr` and friends](./PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends). + +## Implementing `PlutusType` for your own types (`newtype`) + +See: [`DerivePNewtype`](./../Usage/Deriving%20for%20newtypes.md). diff --git a/docs/Types.md b/docs/Types.md new file mode 100644 index 000000000..c5da79d64 --- /dev/null +++ b/docs/Types.md @@ -0,0 +1,19 @@ +This section describes the fundamental, commonly used Plutarch types. + +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +- [`PInteger`](./Types/PInteger.md) +- [`PBool`](./Types/PBool.md) +- [`PString`](./Types/PString.md) +- [`PByteString`](./Types/PByteString.md) +- [`PUnit`](./Types/PUnit.md) +- [`PBuiltinList`](./Types/PBuiltinList.md) +- [`PList`](./Types/PList.md) +- [`PBuiltinPair`](./Types/PBuiltinPair.md) +- [`PTuple`](./Types/PTuple.md) +- [`PAsData`](./Types/PAsData.md) +- [`PDataSum` & `PDataRecord`](./Types/PDataSum%20and%20PDataRecord.md) +- [`PRecord`](./Types/PRecord.md) + - [letrec](./Types/PRecord.md#letrec) + - [Record Data](./Types/PRecord.md#record-data) +- [`PData`](./Types/PData.md) diff --git a/docs/Types/PAsData.md b/docs/Types/PAsData.md new file mode 100644 index 000000000..62b396376 --- /dev/null +++ b/docs/Types/PAsData.md @@ -0,0 +1,35 @@ +# `PAsData` + +This is a typed way of representing [`BuiltinData`/`Data`](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). It is highly encouraged you use `PAsData` to keep track of what "species" of `Data` value you actually have. `Data` can be a `Constr` (for sum of products - ADTs), `Map` (for wrapping assoc maps of Data to Data), `List` (for wrapping builtin lists of data), `I` (for wrapping builtin integers), and `B` (for wrapping builtin bytestrings). + +Consider a function that takes in and returns a `B` data value - aka `ByteString` as a `Data` value. If you use the direct Plutarch synonym to `Data` - `PData`, you'd have: + +```hs +foo :: Term s (PData :--> PData) +``` + +That's not very informative - you have no way to ensure that you're actually working with `B` data values. You could use `PAsData` instead: + +```hs +foo :: Term s (PAsData PByteString :--> PAsData PByteString) +``` + +Now, you have assurance that you're working with a `Data` value that actually represents a builtin bytestring! + +Wrapping and unwrapping to and from `PAsData` terms is provided by the [`PIsData`](./../Typeclasses/PIsData.md) typeclass. Specifically, by the functions- `pfromData` and `pdata`. + +Some useful instances of these functions: + +```hs +pfromData :: Term s (PAsData PInteger) -> Term s PInteger + +pfromData :: Term s (PAsData PByteString) -> Term s PByteString + +pfromData :: Term s (PAsData (PBuiltinList (PAsData a))) -> Term s (PBuiltinList (PAsData a)) + +pdata :: Term s PInteger -> Term s (PAsData PInteger) + +pdata :: Term s PByteString -> Term s (PAsData PByteString) + +pdata :: Term s (PBuiltinList (PAsData a)) -> Term s (PAsData (PBuiltinList (PAsData a))) +``` diff --git a/docs/Types/PBool.md b/docs/Types/PBool.md new file mode 100644 index 000000000..91d82faeb --- /dev/null +++ b/docs/Types/PBool.md @@ -0,0 +1,12 @@ +# `PBool` + +Plutarch level boolean terms can be constructed using `pconstant True` and `pconstant False`. + +```haskell +pif (pconstant PFalse) 7 42 +-- evaluates to 42 +``` + +You can combine Plutarch booleans terms using `#&&` and `#||`, which are synonyms to `&&` and `||`. These are Haskell level operators and therefore have short circuiting. If you don't need short circuiting, you can use the Plutarch level alternatives- `pand'` and `por'` respectively. + +This is synonymous to Plutus Core [builtin boolean](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins-Internal.html#t:BuiltinBool). diff --git a/docs/Types/PBuiltinList.md b/docs/Types/PBuiltinList.md new file mode 100644 index 000000000..3d6a5fad9 --- /dev/null +++ b/docs/Types/PBuiltinList.md @@ -0,0 +1,39 @@ +# `PBuiltinList` + +You'll be using builtin lists quite a lot in Plutarch. `PBuiltinList` has a [`PListLike`](./../Typeclasses/PListLike.md) instance, giving you access to all the goodies from there! However, `PBuiltinList` can only contain builtin types. In particular, it cannot contain Plutarch functions. + +You can express the constraint of "only builtin types" using `PLift`, exported from `Plutarch.Builtin`- + +```hs +validBuiltinList :: PLift a => PBuiltinList a +``` + +As mentioned before, `PBuiltinList` gets access to all the `PListLike` utilities. Other than that, `PLift a => PBuiltinList a` also has a [`PlutusType`](./../Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md) instance. You can construct a `PBuiltinList` using `pcon` (but you should prefer using `pcons` from `PListLike`): + +```hs +> pcon $ PCons (phexByteStr "fe") $ pcon PNil +``` + +would yield a `PBuiltinList PByteString` with one element - `0xfe`. Of course, you could have done that with `pcons # phexByteStr "fe" # pnil` instead! + +You can also use `pmatch` to match on a list: + +```hs +pmatch (pcon $ PCons (phexByteStr "fe") $ pcon PNil) $ \case + PNil -> "hey hey there's nothing here!" + PCons _ _ -> "oooo fancy!" +``` + +But you should prefer `pelimList` from `PListLike` instead: + +```hs +pelimList (\_ _ -> "oooo fancy") "hey hey there's nothing here!" $ pcon $ PCons (phexByteStr "fe") $ pcon PNil +``` + +The first argument is a function that is invoked for the `PCons` case, with the head and tail of the list as arguments. + +The second argument is the value to return when the list is empty. It's _only evaluated_ **if the list is empty**. + +The final argument is, of course, the list itself. + +> Aside: Interested in the lower level details of `PBuiltinList` (i.e. Plutus Core builtin lists)? You can find all you need to know about it at [Plutonomicon](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-lists.md). diff --git a/docs/Types/PBuiltinPair.md b/docs/Types/PBuiltinPair.md new file mode 100644 index 000000000..17dd23e78 --- /dev/null +++ b/docs/Types/PBuiltinPair.md @@ -0,0 +1,11 @@ +# `PBuiltinPair` + +Much like in the case of builtin lists, you'll just be working with builtin functions (or rather, Plutarch synonyms to builtin functions) here. You can find everything about that in [builtin-pairs](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-pairs.md). Feel free to only read the `Plutarch` examples. + +In particular, you can deconstruct `PBuiltinPair` using `pfstBuiltin` and `psndBuiltin`. You can build `PBuiltinPair (PAsData a) (PAsData b)` terms with `ppairDataBuiltin`: + +```hs +ppairDataBuiltin :: Term s (PAsData a :--> PAsData b :--> PBuiltinPair (PAsData a) (PAsData b)) +``` + +It's also helpful to note that `PAsData (PBuiltinPair (PAsData a) (PAsData b))` and `PAsData (PTuple a b)` actually have the same representation under the hood. See [`PTuple`](./PTuple.md) diff --git a/docs/Types/PByteString.md b/docs/Types/PByteString.md new file mode 100644 index 000000000..f6107629a --- /dev/null +++ b/docs/Types/PByteString.md @@ -0,0 +1,19 @@ +# `PByteString` + +Plutarch level bytestring terms can be created using `phexByteStr` and `pbyteStr`. `phexByteStr` interprets a hex string literal as a `Term s PByteString` and `pbyteStr` merely converts a `ByteString` into a `Term s PByteString`. + +```haskell +import qualified Data.ByteString as BS + +phexByteStr "41" +-- yields a `Term s PByteString`, which represents [65] + +pbyteStr (BS.pack [91]) +-- yields a `Term s PByteString`, which represents [91] +``` + +Similar to `PString`, it has a `PEq` instance. As well as `Semigroup` and `Monoid` instances for its terms. + +It **does not** have a `PlutusType` instance. + +This is synonymous to Plutus Core [builtin bytestring](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins.html#t:BuiltinByteString). diff --git a/docs/Types/PData.md b/docs/Types/PData.md new file mode 100644 index 000000000..b714c3ab7 --- /dev/null +++ b/docs/Types/PData.md @@ -0,0 +1,9 @@ +# `PData` + +This is a direct synonym to [`BuiltinData`/`Data`](https://github.com/Plutonomicon/plutonomicon/blob/main/builtin-data.md). As such, it doesn't keep track of what "species" of `Data` it actually is. Is it an `I` data? Is it a `B` data? Nobody can tell for sure! + +Consider using [`PAsData`](./PAsData.md) instead for simple cases, i.e. cases other than `Constr`. + +Consider using [`PDataSum`/`PDataList`](./PDataSum%20and%20PDataRecord.md) instead when dealing with ADTs, i.e. `Constr` data values. + +You can find more information about `PData` at [Developers' Corner](../DEVGUIDE.md). diff --git a/docs/Types/PDataSum and PDataRecord.md b/docs/Types/PDataSum and PDataRecord.md new file mode 100644 index 000000000..6dff59d6a --- /dev/null +++ b/docs/Types/PDataSum and PDataRecord.md @@ -0,0 +1,48 @@ +# `PDataSum` & `PDataRecord` + +Plutarch sum and product types are represented using `PDataSum` and `PDataRecord` respectively. These types are crucial to the [`PIsDataRepr`](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md) machinery. + +Whenever you need to represent a non-trivial ADT using [`Data` encoding](./../Concepts/Data%20and%20Scott%20encoding.md#data-encoding), you'll likely be reaching for these. + +More often than not, you'll be using `PDataRecord`. This is used to denote all the fields of a constructor: + +```hs +import Plutarch.Prelude + +newtype Foo (s :: S) = Foo (Term s (PDataRecord '["fooField" ':= PInteger])) +``` + +`Foo` is a Plutarch type with a single constructor with a single field, named `fooField`, of type `PInteger`. You can [implement `PIsDataRepr`](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) for it so that `PAsData Foo` is represented as a `Constr` encoded data value. + +You can build `PDataRecord` terms using `pdcons` and `pdnil`. These are the familiar `cons` and `nil` specialized to `PDataRecord` terms. + +```hs +pdcons :: forall label a l s. Term s (PAsData a :--> PDataRecord l :--> PDataRecord ((label ':= a) ': l)) + +pdnil :: Term s (PDataRecord '[]) +``` + +To add an `a` to the `PDataRecord` term, you must have a `PAsData a`. The other type variable of interest, is `label`. This is just the name of the field you're adding. You can either use type application to specify the field, or use a type annotation, or let GHC match up the types. + +Here's how you'd build a `PDataRecord` with two integer fields, one is named `foo`, the other is named `bar`: + +```hs +test :: +test = pdcons @"foo" @PInteger # 7 #$ pdcons @"bar" @PInteger # 42 # pnil +``` + +`PDataSum` on the other hand, is more "free-standing". In particular, the following type: + +```hs +PDataSum + [ '[ "_0" ':= PInteger + , "_1" ':= PByteString + ] + , '[ "myField" ':= PBool + ] + ] +``` + +represents a sum type with 2 constructors. The first constructor has two fields- `_0`, and `_1`, with types `PInteger` and `PByteString` respectively. The second constructor has one field- `myField`, with type `PBool`. + +> Note: It's convention to give names like `_0`, `_1` etc. to fields that don't have a canonically meaningful name. They are merely the "0th field", "1st field" etc. diff --git a/docs/Types/PInteger.md b/docs/Types/PInteger.md new file mode 100644 index 000000000..1ded902f1 --- /dev/null +++ b/docs/Types/PInteger.md @@ -0,0 +1,17 @@ +# `PInteger` + +`Term s PInteger` has a convenient `Num` instance that allows you to construct Plutarch level integer terms from integer literals. It also means you have all the typical arithmetic operations available to you: + +```haskell +1 + 2 +``` + +where `1` and `2` are `Term s PInteger`s. + +Alongside `Num`, it also has a `PIntegral` instance, allowing you to use division, modulus etc. + +It also has a `PEq` and `POrd` instance, allowing you to do Plutarch level equality and comparison. + +It **does not** have a `PlutusType` instance. + +This is synonymous to Plutus Core [builtin integer](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins.html#t:Integer). diff --git a/docs/Types/PList.md b/docs/Types/PList.md new file mode 100644 index 000000000..645148d49 --- /dev/null +++ b/docs/Types/PList.md @@ -0,0 +1,25 @@ +# `PList` + +Here's the [Scott encoded](./../Concepts/Data%20and%20Scott%20encoding.md#scott-encoding) cousin of `PBuiltinList`. What does that mean? Well, in practice, it just means that `PList` can contain _any arbitrary_ term - not just builtin types. `PList` also has a [`PListLike`](./../Typeclasses/PListLike.md) instance - so you won't be missing any of those utilities here! + +`PList` also has a [`PlutusType`](../Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md) instance. You can construct a `PList` using `pcon` (but you should prefer using `pcons` from `PListLike`): + +```hs +> pcon $ PSCons (phexByteStr "fe") $ pcon PSNil +``` + +would yield a `PList PByteString` with one element - `0xfe`. Of course, you could have done that with `pcons # phexByteStr "fe" # pnil` instead! + +You can also use `pmatch` to match on a list: + +```hs +pmatch (pcon $ PSCons (phexByteStr "fe") $ pcon PSNil) $ \case + PSNil -> "hey hey there's nothing here!" + PSCons _ _ -> "oooo fancy!" +``` + +But you should prefer `pelimList` from `PListLike` instead: + +```hs +pelimList (\_ _ -> "oooo fancy") "hey hey there's nothing here!" $ pcon $ PSCons (phexByteStr "fe") $ pcon PSNil +``` diff --git a/docs/Types/PRecord.md b/docs/Types/PRecord.md new file mode 100644 index 000000000..f1714d77d --- /dev/null +++ b/docs/Types/PRecord.md @@ -0,0 +1,82 @@ +# `PRecord` + +You can define and use product ADTs, including records with named fields in Plutarch similar to Haskell's records. For a Haskell data type like + +```hs +data Circle = Circle{ + x, y :: Integer, + radius :: Natural + } +``` + +the equivalent in Plutarch would be + +```hs +data Circle f = Circle{ + x, y :: f PInteger, + radius :: f PNatural + } +Plutarch.Rec.TH.deriveAll ''Circle +``` + +Each field type needs to be wrapped into the type parameter `f` of kind `PType -> Type`. This is a slight modification of a common coding style known as Higher-Kinded Data. + +With this definition, `PRecord Circle` will be an instance of [PlutusType](../Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md), so you can use the usual `pcon` and `pcon'` to construct its value and `pmatch` and `pmatch'` to de-construct it: + +```hs +circle :: Term s (PRecord Circle) +circle = pcon $ PRecord Circle{ + x = 100, + y = 100, + radius = 50 + } + +distanceFromOrigin :: Term s (PRecord Circle :--> PNatural) +distanceFromOrigin = plam $ flip pmatch $ \(PRecord Circle{x, y})-> sqrt #$ projectAbs #$ x * x + y * y +``` + +You may also find `rcon` and `rmatch` from `Plutarch.Rec` a bit more convenient because they don't require the `PRecord` wrapper. Alternatively, instead of using `pmatch` or its alternatives you can access individual fields using the `field` accessor from the same module: + +```hs +containsOrigin :: Term s (PRecord Circle :--> PBool) +containsOrigin = plam $ \c-> distanceFromOrigin # c #< pto c # field radius +``` + +## letrec + +You can use records to define mutually-recursive functions, or more generally (but less usefully) mutually-recursive values. + +```hs +circleFixedPoint :: Term s (PRecord Circle) +circleFixedPoint = punsafeFrom $ letrec $ \Circle{y, radius}-> Circle{ + x = y, + y = 2 * radius, + radius = 50 + } +``` + +## Record Data + +You can provide a [`PIsData`](../Typeclasses/PIsData.md) instance for `PRecord Circle` using the following definition: + +```hs +instance RecordFromData Circle +instance PIsData (PRecord Circle) where + pfromData = readData $ recordFromFieldReaders Circle{ + x = DataReader pfromData, + y = DataReader pfromData, + radius = DataReader pfromData + } + pdata = writeData $ recordDataFromFieldWriters Circle{ + x = DataWriter pdata, + y = DataWriter pdata, + radius = DataWriter pdata + } +``` + +If your record has many fields and you only need to a couple of them from `Data`, it's more efficient to use `pfromData` only on individual fields. You can focus on a single field using the function `fieldFromData`: + +```hs +radiusFromCircleData :: Term s (PAsData (PRecord Circle) :--> PAsData PNatural) +radiusFromCircleData = fieldFromData radius +``` diff --git a/docs/Types/PString.md b/docs/Types/PString.md new file mode 100644 index 000000000..258b2451e --- /dev/null +++ b/docs/Types/PString.md @@ -0,0 +1,17 @@ +# `PString` + +`Term s PString` has a `IsString` instance. This allows you to make Plutarch level string terms from regular string literals, provided you have `OverloadedStrings` turned on. + +```haskell +{-# LANGUAGE OverloadedStrings #-} + +"foo" +``` + +where "foo" is actually `Term s PString`. + +It also has a `PEq` instance. And its terms have `Semigroup` and `Monoid` instances - which work the way you would expect. + +It **does not** have a `PlutusType` instance. + +This is synonymous to Plutus Core [builtin string](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins.html#t:BuiltinString) (actually Text). diff --git a/docs/Types/PTuple.md b/docs/Types/PTuple.md new file mode 100644 index 000000000..8eb42e605 --- /dev/null +++ b/docs/Types/PTuple.md @@ -0,0 +1,17 @@ +# `PTuple` + +These are [data encoded](./../Concepts/Data%20and%20Scott%20encoding.md#data-encoding) pairs. You can build `PTuple`s using `ptuple`: + +```hs +ptuple :: Term s (PAsData a :--> PAsData b :--> PTuple a b) +``` + +`PTuple` has a [`PDataFields`](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#all-about-extracting-fields) instance. As such, you can extract its fields using `pletFields` or `pfield`. + +Since `PAsData (PBuiltinPair (PAsData a) (PAsData b))` and `PAsData (PTuple a b)` have the same representation - you can safely convert between them at no cost: + +```hs +ptupleFromBuiltin :: Term s (PAsData (PBuiltinPair (PAsData a) (PAsData b))) -> Term s (PAsData (PTuple a b)) + +pbuiltinPairFromTuple :: Term s (PAsData (PTuple a b)) -> Term s (PAsData (PBuiltinPair (PAsData a) (PAsData b))) +``` diff --git a/docs/Types/PUnit.md b/docs/Types/PUnit.md new file mode 100644 index 000000000..f8a6a84a4 --- /dev/null +++ b/docs/Types/PUnit.md @@ -0,0 +1,5 @@ +# `PUnit` + +The Plutarch level unit term can be constructed using `pconstant ()`. + +This is synonymous to Plutus Core [builtin unit](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Builtins-Internal.html#t:BuiltinUnit). diff --git a/docs/Usage.md b/docs/Usage.md new file mode 100644 index 000000000..26383377a --- /dev/null +++ b/docs/Usage.md @@ -0,0 +1,15 @@ +This section describes various core Plutarch usage concepts. + +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +- [Conditionals](./Usage/Conditionals.md) +- [Recursion](./Usage/Recursion.md) +- [Using the Plutarch Prelude](./Usage/Prelude%20mixin.md) +- [Do syntax with `TermCont`](./Usage/Do%20syntax%20with%20TermCont.md) +- [Do syntax with `QualifiedDo` and `Plutarch.Monadic`](./Usage/Do%20syntax%20with%20QualifiedDo.md) +- [Deriving typeclasses for `newtype`s](./Usage/Deriving%20for%20newtypes.md) +- [Deriving typeclasses with generics](./Usage/Deriving%20with%20generics.md) +- [`plet` to avoid work duplication](./Usage/Avoid%20work%20duplication%20using%20plet.md) +- [Tracing](./Usage/Tracing.md) +- [Raising errors](./Usage/Raising%20errors.md) +- [Unsafe functions](./Usage/Unsafe%20functions.md) diff --git a/docs/Usage/Avoid work duplication using plet.md b/docs/Usage/Avoid work duplication using plet.md new file mode 100644 index 000000000..8ee355f3b --- /dev/null +++ b/docs/Usage/Avoid work duplication using plet.md @@ -0,0 +1,10 @@ +# `plet` to avoid work duplication + +Sometimes, when writing Haskell level functions working on Plutarch terms, you may find yourself needing to re-use the Haskell level function's argument(s) multiple times: + +```hs +foo :: Term s PString -> Term s PString +foo x = x <> x +``` + +In such cases, you should use `plet` on the argument to [avoid duplicating work](./../Tricks/Don't%20duplicate%20work.md). \ No newline at end of file diff --git a/docs/Usage/Conditionals.md b/docs/Usage/Conditionals.md new file mode 100644 index 000000000..22fb454cc --- /dev/null +++ b/docs/Usage/Conditionals.md @@ -0,0 +1,15 @@ +# Conditionals + +You can simulate `if/then/else` at the Plutarch level using `pif`: + +```haskell +pif :: Term s PBool -> Term s a -> Term s a -> Term s a +``` + +This has similar semantics to Haskell's `if/then/else`. That is, only the branch for which the predicate holds - is evaluated. + +```haskell +pif (pconstant True) 1 2 +``` + +The above evaluates to `1`, which has type `Term s PInteger`. \ No newline at end of file diff --git a/docs/Usage/Deriving for newtypes.md b/docs/Usage/Deriving for newtypes.md new file mode 100644 index 000000000..6e7d992e5 --- /dev/null +++ b/docs/Usage/Deriving for newtypes.md @@ -0,0 +1,48 @@ +# Deriving typeclasses for `newtype`s + +If you're defining a `newtype` to an existing Plutarch type, like so: + +```hs +newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) +``` + +You ideally want to just have this `newtype` be represented as a `PByteString` under the hood. Therefore, all the typeclass instances of `PByteString` make sense for `PPubKeyHash` as well. In this case, you can simply derive all those typeclasses for your `PPubKeyHash` type as well! Via `DerivePNewtype`: + +```hs +{-# LANGUAGE UndecidableInstances #-} + +import Plutarch.Prelude + +newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) + deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PPubKeyHash PByteString) +``` + +(yes, you need `UndecidableInstances` to derive `PlutusType`) + +`DerivePNewtype` takes two type parameters. Both of them are Plutarch types (i.e. types with kind `PType`). The first one is the type you're deriving the instances for, while the second one is the _inner_ type (whatever `PPubKeyHash` is a newtype to). + +> Note: It's important to note that the content of a `newtype` _that aims to be a Plutarch type_ (i.e. can be represented as a Plutarch term), must also be a Plutarch term. The type `PByteString s` simply doesn't exist in the Plutus Core world after compilation. It's all just `Term`s. So, when you say `Term s PPubKeyHash`, you're really just describing a `Term s PByteString` under the hood - since that's what it _is_ during runtime. + +> Aside: You can access the inner type using `pto` (assuming it's a `PlutusType` instance). For example, `pto x`, where `x :: Term s PPubKeyHash`, would give you `Term s PByteString`. `pto` converts a [`PlutusType`](./../Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md) term to its inner type. This is very useful, for example, when you need to use a function that operates on bytestring terms, but all you have is a `Term s PPubKeyHash`. You _know_ it's literally a bytestring under the hood anyway - but how do you obtain that? Using `pto`! + +Currently, `DerivePNewtype` lets you derive the following typeclasses for your Plutarch _types_: + +- `PlutusType` +- `PIsData` +- `PEq` +- `POrd` +- `PIntegral` + +You can also derive the following typeclasses for Plutarch _terms_: + +- `Num` +- `Semigroup` +- `Monoid` + +What does this mean? Well, `Num` would actually be implemented for `Term s a`, where `a` is a Plutarch type. For example, if you wanted to implement `Semigroup` for `Term s PPubKeyHash` (`Term s PByteString` already has a `Semigroup` instance), you can write: + +```hs +{-# LANGUAGE StandaloneDeriving #-} + +deriving via (Term s (DerivePNewtype PPubKeyHash PByteString)) instance Semigroup (Term s PPubKeyHash) +``` diff --git a/docs/Usage/Deriving with generics.md b/docs/Usage/Deriving with generics.md new file mode 100644 index 000000000..49694721b --- /dev/null +++ b/docs/Usage/Deriving with generics.md @@ -0,0 +1,25 @@ +# Deriving typeclasses with generics + +Plutarch also provides sophisticated generic deriving support for completely custom types. In particular, you can easily derive `PlutusType` for your own type: + +```hs +import qualified GHC.Generics as GHC +import Generics.SOP +import Plutarch.Prelude + +data MyType (a :: PType) (b :: PType) (s :: S) + = One (Term s a) + | Two (Term s b) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PlutusType) +``` + +> Note: This requires the `generics-sop` package. + +This will use a [Scott encoding representation](./../Concepts/Data%20and%20Scott%20encoding.md#scott-encoding) for `MyType`, which is typically what you want. If you want to use [data encoding representation](./../Concepts/Data%20and%20Scott%20encoding.md) instead in your `PlutusType` instance - you should derive it using `PIsDataReprInstances`. Check out: [implementing `PIsDataRepr` and friends](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) + +Currently, generic deriving supports the following typeclasses: + +- [`PlutusType`](./../Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md#implementing-plutustype-for-your-own-types-scott-encoding) (Scott encoding only) +- [`PIsDataRepr`](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) +- [`PEq`](./../Typeclasses/PEq%20and%20POrd.md) diff --git a/docs/Usage/Do syntax with QualifiedDo.md b/docs/Usage/Do syntax with QualifiedDo.md new file mode 100644 index 000000000..a35dce279 --- /dev/null +++ b/docs/Usage/Do syntax with QualifiedDo.md @@ -0,0 +1,26 @@ +# Do syntax with `QualifiedDo` and `Plutarch.Monadic` + +There's another way of having `do` syntax. Though this one doesn't use a lawful monad. Instead, it uses `QualifiedDo` - and therefore requires GHC 9. + +The `Plutarch.Monadic` module exports `>>=`, `>>`, and `fail` functions suitable to be used with `QualifiedDo`. + +```hs +-- NOTE: REQUIRES GHC 9! +{-# LANGUAGE QualifiedDo #-} + +import Plutarch.Api.Contexts +import qualified Plutarch.Monadic as P +import Plutarch.Prelude + +f :: Term s (PScriptPurpose :--> PUnit) +f = plam $ \x -> P.do + PSpending _ <- pmatch x + ptrace "matched spending script purpose" + pconstant () +``` + +In essence, `P.do { x; y }` simply translates to `x y`; where `x :: a -> Term s b` and `y :: a`. + +Similarly, `P.do { y <- x; z }` translates to `x $ \case { y -> z; _ -> ptraceError }`; where `x :: (a -> Term s b) -> Term s b`, `y :: a`, and `z :: Term s b`. Of course, if `y` is a fully exhaustive pattern match (e.g. singular constructor), the extra `_ -> ptraceError ` case will not be generated at all and you'd simply get `x $ \y -> z`. + +Finally, `P.do { x }` is just `x`. \ No newline at end of file diff --git a/docs/Usage/Do syntax with TermCont.md b/docs/Usage/Do syntax with TermCont.md new file mode 100644 index 000000000..65351323f --- /dev/null +++ b/docs/Usage/Do syntax with TermCont.md @@ -0,0 +1,58 @@ +# Do syntax with `TermCont` + +Continuation functions like `pmatch`, `plet`, and `pletFields` aren't exactly the most convenient, are they? Fortunately, `TermCont` makes it much easier to use. `TermCont` is the familiar [`Cont`](https://hackage.haskell.org/package/mtl-2.2.2/docs/Control-Monad-Cont.html) monad, specialized for Plutarch terms. + +`TermCont @b s a` essentially represents `(a -> Term s b) -> Term s b`. `a` being the input to the continuation, and `Term s b` being the output. Notice the type application - `b` must have been brought into scope through another binding first. + +Consider the snippet: + +```hs +import Plutarch.Api.V1.Contexts +import Plutarch.Prelude + +test :: Term s (PScriptPurpose :--> PUnit) +test = plam $ \x -> pmatch x $ \case + PSpending _ -> ptrace "matched spending script purpose" $ pconstant () + _ -> ptraceError "pattern match failure" +``` + +That's rather ugly! [`pmatch`](./../Typeclasses/PlutusType,%20PCon,%20and%20PMatch.md) takes in a continuation as its second argument. Can we make this a bit more ergonomic? + +```hs +import Plutarch.Api.Contexts +import Plutarch.Prelude + +pmatchC :: PlutusType a => Term s a -> TermCont s (a s) +pmatchC = tcont . pmatch + +ptraceC :: Term s PString -> TermCont s () +ptraceC s = tcont $ \f -> ptrace s (f ()) + +test :: Term s (PScriptPurpose :--> PUnit) +test = plam $ \x -> unTermCont $ do + PSpending _ <- pmatchC x + ptraceC "matched spending script purpose" + pure $ pconstant () +``` + +How cool is that? You can use regular `do` syntax on the `TermCont` monad. All the continuations are flattened! Just remember to `unTermCont` the result. + +Furthermore, this is very similar to the `Cont` monad - it just operates on Plutarch level terms. This means you can draw parallels to utilities and patterns one would use when utilizing the `Cont` monad. Here's an example: + +```hs +import Plutarch.Prelude + +-- | Terminate with given value on empty list, otherwise continue with head and tail. +nonEmpty :: Term s r -> PList a s -> TermCont @r s (Term s a, Term s (PList a)) +nonEmpty x0 list = tcont $ \k -> + case list of + PSCons x xs -> k (x, xs) + PSNil -> x0 + +foo :: Term s (PList PInteger :--> PInteger) +foo = plam $ \l -> unTermCont $ do + (x, xs) <- nonEmpty 0 =<< tcont (pmatch l) + pure $ x + plength # xs +``` + +`foo` adds up the first element of the given list with the length of its tail. Unless the list was empty, in which case, it just returns 0. It uses continuations with the `do` syntax to elegantly utilize short circuiting! \ No newline at end of file diff --git a/docs/Usage/FFI.md b/docs/Usage/FFI.md new file mode 100644 index 000000000..4e6e113c4 --- /dev/null +++ b/docs/Usage/FFI.md @@ -0,0 +1,93 @@ +# Interoperability with PlutusTx + +If you already have a codebase built using PlutusTx, you can choose to +re-write only its critical parts in Plutarch and to call them from +PlutusTx. The function to use is `Plutarch.FFI.foreignExport`: + +```haskell +doubleInPlutarch :: Term s (PInteger :--> PInteger) +doubleInPlutarch = plam (2 *) + +doubleExported :: PlutusTx.CompiledCode (Integer -> Integer) +doubleExported = foreignExport doubleInPlutarch + +doubleUseInPlutusTx :: PlutusTx.CompiledCode Integer +doubleUseInPlutusTx = doubleExported `PlutusTx.applyCode` PlutusTx.liftCode 21 +``` + +Alternatively, you may go in the opposite direction and call an existing +PlutusTx function from Plutarch using `Plutarch.FFI.foreignImport`: + +```haskell +doubleInPlutusTx :: CompiledCode (Integer -> Integer) +doubleInPlutusTx = $$(PlutusTx.compile [||(2 *) :: Integer -> Integer||]) + +doubleImported :: Term s (PInteger :--> PInteger) +doubleImported = foreignImport doubleInPlutusTx + +doubleUseInPlutarch :: Term s PInteger +doubleUseInPlutarch = doubleImported # 21 +``` + +Note how Plutarch type `PInteger :--> PInteger` corresponds to Haskell +function type `Integer -> Integer`. If the types didn't corespond, the +`foreignExport` and `foreignImport` applications wouldn't compile. The +following table shows the correspondence between the two universes of types: + +| Plutarch | Haskell | +| -------------- | ------------------- | +| `pa :--> pb` | `a -> b` | +| `PTxList pa` | `[a]` | +| `PTxMaybe pa` | `Maybe a` | +| `PInteger` | `Integer` | +| `PBool` | `BuiltinBool` | +| `PString` | `BuiltinString` | +| `PByteString` | `BuiltinByteString` | +| `PBuiltinData` | `Data` | +| `PUnit` | `BuiltinUnit` | +| `PDelayed pa` | `Delayed a` | + +## User-defined types + +When it comes to user-defined types, you have a choice of passing their values +encoded as `Data` or directly. In the latter case, you'll have to declare your +type twice with two kinds: as a Haskell `Type` and as a Plutarch +`PType`. Futhermore, both types must be instances of `SOP.Generic`, as in this +example: + +```haskell +data SampleRecord = SampleRecord + { sampleBool :: BuiltinBool + , sampleInt :: Integer + , sampleString :: BuiltinString + } + deriving stock (Generic) + deriving anyclass (SOP.Generic) + +data PSampleRecord (s :: S) = PSampleRecord + { psampleBool :: Term s PBool + , psampleInt :: Term s PInteger + , psampleString :: Term s PString + } + deriving stock (Generic) + deriving anyclass (SOP.Generic, PlutusType) +``` + +With these two declarations in place, the preceding table can gain another +row: + +| Plutarch | Haskell | +| ----------------------- | -------------------- | +| `PDelayed PSampleRecord` | `SampleRecord` | + +The reason for `PDelayed` above is a slight difference in Scott encodings of +data types between Plutarch and PlutusTx. It means you'll need to apply +`pdelay` to a `PSampleRecord` value before passing it through FFI to Haskell, +and `pforce` after passing it in the opposite direction. + +This technique can be used for most data types, but it doesn't cover recursive +types (such as lists) nor data types with nullary constructors (such as +`Maybe`). To interface with these two common Haskell types, use `PTxMaybe` and +`PTxList` types from `Plutarch.FFI`. The module also exports the means to +convert between these special purpose types and the regular Plutarch `PMaybe` +and `PList`. diff --git a/docs/Usage/Prelude mixin.md b/docs/Usage/Prelude mixin.md new file mode 100644 index 000000000..abcca065d --- /dev/null +++ b/docs/Usage/Prelude mixin.md @@ -0,0 +1,12 @@ +# Using the Plutarch Prelude + +Plutarch exports a Prelude (`Plutarch.Prelude`) that contains the most commonly used Plutarch functions, types and constructors. + +The Plutarch Prelude `Plutarch.Prelude` has no overlap with `base` Prelude, which is the reason why you can use both of them together +without trouble. If you want to avoid importing `Plutarch.Prelude` in each of your modules, add the following to your `*.cabal` file: + +```haskell +mixins: + base hiding (Prelude) + , plutarch-preludes (PPrelude as Prelude) +``` diff --git a/docs/Usage/Raising errors.md b/docs/Usage/Raising errors.md new file mode 100644 index 000000000..3aae29004 --- /dev/null +++ b/docs/Usage/Raising errors.md @@ -0,0 +1,8 @@ +# Raising errors + +In PlutusTx, you'd signal validation failure with the [`error`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Prelude.html#v:error) function. You can do the same in Plutarch using `perror`. + +```hs +fails :: Term s (PData :--> PData :--> PData :--> PUnit) +fails = plam $ \_ _ _ -> perror +``` \ No newline at end of file diff --git a/docs/Usage/Recursion.md b/docs/Usage/Recursion.md new file mode 100644 index 000000000..520e973c6 --- /dev/null +++ b/docs/Usage/Recursion.md @@ -0,0 +1,30 @@ +# Recursion + +To emulate recursion in [UPLC (Untyped Plutus Core)](https://github.com/Plutonomicon/plutonomicon/blob/main/uplc.md), you need to use [the Y combinator](https://stackoverflow.com/questions/93526/what-is-a-y-combinator). Plutarch provides the Y combinator with the name `pfix`: + +```haskell +pfix :: Term s (((a :--> b) :--> (a :--> b)) :--> (a :--> b)) +``` + +It works as you would expect, though the type is scary. Think of it as the Haskell type: + +```haskell +fix :: ((a -> b) -> (a -> b)) -> (a -> b) +``` + +The first argument is "self", or the function you want to recurse with. + +The below example implements a Plutarch-level factorial function: + +```haskell +import Plutarch.Prelude + +pfac :: Term s (PInteger :--> PInteger) +pfac = pfix #$ plam f + where + f :: Term s (PInteger :--> PInteger) -> Term s PInteger -> Term s PInteger + f self n = pif (n #== 1) n $ n * (self #$ n - 1) +-- (ignore the existence of non positives :D) +``` + +Note how `f` takes in a `self` and just recurses on it. All you have to do, is create a Plutarch level function by using `plam` on `f` and `pfix` the result - and that `self` argument will be taken care of for you. \ No newline at end of file diff --git a/docs/Usage/Tracing.md b/docs/Usage/Tracing.md new file mode 100644 index 000000000..b9c8b0d71 --- /dev/null +++ b/docs/Usage/Tracing.md @@ -0,0 +1,5 @@ +# Tracing + +You can use the functions `ptrace`, `ptraceError`, `ptraceIfFalse`, `ptraceIfTrue` (from `Plutarch.Trace` or `Plutarch.Prelude`) for tracing. These behave similarly to the ones you're used to from [PlutusTx](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx-Trace.html). + +If you have the `development` flag for `plutarch` turned on - you'll see the trace messages appear in the trace log during script evaluation. When not in development mode - these functions basically do nothing. \ No newline at end of file diff --git a/docs/Usage/Unsafe functions.md b/docs/Usage/Unsafe functions.md new file mode 100644 index 000000000..09cfce14e --- /dev/null +++ b/docs/Usage/Unsafe functions.md @@ -0,0 +1,9 @@ +# Unsafe functions + +There are internal functions such as `punsafeCoerce`, `punsafeConstant` etc. that give you terms without their specific type. These **should not** be used by Plutarch users. It is the duty of the user of these unsafe functions to get the type right - and it is very easy to get the type wrong. You can easily make the type system believe you're creating a `Term s PInteger`, when in reality, you created a function. + +Things will go very wrong during script evaluation if you do that kind of thing. + +The good thing is that unsafe functions all have explicit indicators through the names, as long as you don't use any `punsafe*` functions - you should be fine! + +Of course, these have legitimate use cases. Most often, we use these functions to convert between types that _truly_ have the same internal representation in UPLC - but the type system simply isn't expressive enough to infer that. diff --git a/docs/examples/BASIC.md b/docs/examples/BASIC.md new file mode 100644 index 000000000..e4a229210 --- /dev/null +++ b/docs/examples/BASIC.md @@ -0,0 +1,31 @@ +Basic examples demonstrating Plutarch usage. + +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +> Aside: Be sure to check out [Compiling and Running](./../README.md#compiling-and-running) first! + +# Fibonacci number at given index + +```hs +import Plutarch.Prelude + +fib :: Term s (PInteger :--> PInteger) +fib = phoistAcyclic $ + pfix #$ plam $ \self n -> + pif + (n #== 0) + 0 + $ pif + (n #== 1) + 1 + $ self # (n - 1) + self # (n - 2) +``` + +from [examples](https://github.com/Plutonomicon/plutarch/tree/master/plutarch-test). + +Execution: + +```hs +> evalT $ fib # 2 +Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf integer 2)))) +``` diff --git a/docs/examples/VALIDATOR.md b/docs/examples/VALIDATOR.md new file mode 100644 index 000000000..60fbd56ac --- /dev/null +++ b/docs/examples/VALIDATOR.md @@ -0,0 +1,124 @@ +Examples of validators and minting policies written in Plutarch. + +> Note: If you spot any mistakes/have any related questions that this guide lacks the answer to, please don't hesitate to raise an issue. The goal is to have high quality documentation for Plutarch users! + +- [Validator that always succeeds](#validator-that-always-succeeds) +- [Validator that always fails](#validator-that-always-fails) +- [Validator that checks whether a value is present within signatories](#validator-that-checks-whether-a-value-is-present-within-signatories) +- [Using custom datum/redeemer in your Validator](#using-custom-datumredeemer-in-your-validator) + +> Aside: Be sure to check out [Compiling and Running](./../README.md#compiling-and-running) first! + +# Validator that always succeeds + +```hs +import Plutarch.Prelude +import Plutarch.Api.V1.Contexts +import Plutarch.Api.V1.Scripts + +alwaysSucceeds :: Term s (PAsData PDatum :--> PAsData PRedeemer :--> PAsData PScriptContext :--> PUnit) +alwaysSucceeds = plam $ \datm redm ctx -> pconstant () +``` + +All the arguments are ignored. So we use the generic `PDatum` and `PRedeemer` types. + +Execution: + +```hs +import qualified PlutusTx + +> alwaysSucceeds `evalWithArgsT` [PlutusTx.toData (), PlutusTx.toData (), PlutusTx.toData ()] +Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf unit ())))) +``` + +# Validator that always fails + +```hs +import Plutarch.Prelude +import Plutarch.Api.V1.Contexts +import Plutarch.Api.V1.Scripts + +alwaysFails :: Term s (PAsData PDatum :--> PAsData PRedeemer :--> PAsData PScriptContext :--> PUnit) +alwaysFails = plam $ \datm redm ctx -> perror +``` + +Similar to the example above. + +Execution: + +```hs +import qualified PlutusTx + +> alwaysFails `evalWithArgsT` [PlutusTx.toData (), PlutusTx.toData (), PlutusTx.toData ()] +Left (EvaluationError [] "(CekEvaluationFailure,Nothing)") +``` + +# Validator that checks whether a value is present within signatories + +```hs +-- NOTE: REQUIRES GHC 9! +{-# LANGUAGE QualifiedDo #-} +{-# LANGUAGE OverloadedRecordDot #-} + +import Plutarch.Prelude +import Plutarch.Api.V1.Contexts +import Plutarch.Api.V1.Crypto +import Plutarch.Api.V1.Scripts +import qualified Plutarch.Monadic as P + +checkSignatory :: Term s (PPubKeyHash :--> PAsData PDatum :--> PAsData PRedeemer :--> PAsData PScriptContext :--> PUnit) +checkSignatory = plam $ \ph _ _ ctx' -> P.do + ctx <- pletFields @["txInfo", "purpose"] ctx' + PSpending _ <- pmatch ctx.purpose + let signatories = pfield @"signatories" # ctx.txInfo + pif + (pelem # pdata ph # pfromData signatories) + -- Success! + (pconstant ()) + -- Signature not present. + perror +``` + +> Note: The above snippet uses GHC 9 features (`QualifiedDo` and `OverloadedRecordDot`). Be sure to check out [Do syntax with `TermCont`](./../Usage/Do%20syntax%20with%20TermCont.md) and [alternatives to `OverloadedRecordDot`](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#alternatives-to-overloadedrecorddot). + +We match on the script purpose to see if its actually for _spending_ - and we get the signatories field from `txInfo` (the 7th field), check if the given pub key hash is present within the signatories and that's it! + +It's important that we pass a `PPubKeyHash` _prior_ to treating `checkSignatory` as a validator script. + +```hs +{-# LANGUAGE OverloadedStrings #-} + +import Plutus.V1.Ledger.Api +import Plutus.V1.Ledger.Interval +import qualified PlutusTx + +hashStr :: PubKeyHash +hashStr = "abce0f123e" + +pubKeyHash :: Term s PPubKeyHash +pubKeyHash = pconstant hashStr + +mockCtx :: ScriptContext +mockCtx = + ScriptContext + (TxInfo + mempty + mempty + mempty + mempty + mempty + mempty + (interval (POSIXTime 1) (POSIXTime 2)) + [fromString hashStr, "f013", "ab45"] + mempty + "" + ) + (Spending (TxOutRef "" 1)) + +> evalWithArgsT (checkSignatory # pubKeyHash) [PlutusTx.toData (), PlutusTx.toData (), PlutusTx.toData mockCtx] +Right (Program () (Version () 1 0 0) (Constant () (Some (ValueOf unit ())))) +``` + +# Using custom datum/redeemer in your Validator + +All you have to do is [implement `PIsDataRepr` and friends](./../Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) for your custom datum/redeemer and you can use it just like `PScriptContext` in your validators! diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000..5a320541b --- /dev/null +++ b/docs/index.md @@ -0,0 +1,3 @@ +# Plutarch Guide + +See [[README]] diff --git a/docs/index.yaml b/docs/index.yaml new file mode 100644 index 000000000..964c3f6f5 --- /dev/null +++ b/docs/index.yaml @@ -0,0 +1,14 @@ +# Emanote settings +# +# For list of possible settings and their defaults, see: +# https://github.com/srid/emanote/blob/master/default/index.yaml + +template: + # Change this to 'pretty' to use URLs without .html suffix. + urlStrategy: direct + theme: green + +page: + siteTitle: Plutarch Guide + headHtml: | + diff --git a/examples/Examples/ConstrData.hs b/examples/Examples/ConstrData.hs deleted file mode 100644 index 5913600ba..000000000 --- a/examples/Examples/ConstrData.hs +++ /dev/null @@ -1,134 +0,0 @@ -{-# LANGUAGE UndecidableInstances #-} - -module Examples.ConstrData (tests) where - -import Data.String (fromString) -import qualified GHC.Generics as GHC -import Generics.SOP - -import Test.Tasty (TestTree, testGroup) -import Test.Tasty.HUnit (testCase) - -import Utils - -import Plutarch.Api.V1 -import Plutarch.DataRepr (PDataFields, PIsDataReprInstances (PIsDataReprInstances)) -import Plutarch.Prelude -import Plutarch.Unsafe (punsafeCoerce) - -import Plutus.V1.Ledger.Api -import qualified PlutusTx - -{- | - We can defined a data-type using PDataRecord, with labeled fields. - - With an appropriate instance of 'PIsDataRepr', we can automatically - derive 'PDataFields'. --} -newtype Triplet (a :: PType) (s :: S) - = Triplet - ( Term - s - ( PDataRecord - '[ "x" ':= a - , "y" ':= a - , "z" ':= a - ] - ) - ) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields) - via (PIsDataReprInstances (Triplet a)) - -data PVehicle (s :: S) - = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) - | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) - | PImmovableBox (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData) - via PIsDataReprInstances PVehicle - -data PEnumType (s :: S) - = PA (Term s (PDataRecord '[])) - | PB (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData) - via PIsDataReprInstances PEnumType - -tests :: HasTester => TestTree -tests = - testGroup - "Data construction tests" - [ testCase "Sum of products construction" $ do - pcon - ( PFourWheeler $ - pdcons - # pconstantData 2 #$ pdcons - # pconstantData 5 #$ pdcons - # pconstantData 42 #$ pdcons - # pconstantData 0 - # pdnil - ) - `equal` punsafeCoerce - (pconstant $ PlutusTx.Constr 0 [PlutusTx.I 2, PlutusTx.I 5, PlutusTx.I 42, PlutusTx.I 0]) - pcon (PTwoWheeler $ pdcons # pconstantData 5 #$ pdcons # pconstantData 0 # pdnil) - `equal` punsafeCoerce - (pconstant $ PlutusTx.Constr 1 [PlutusTx.I 5, PlutusTx.I 0]) - pcon (PImmovableBox pdnil) - `equal` punsafeCoerce - (pconstant $ PlutusTx.Constr 2 []) - , testCase "Product construction" $ do - pcon - ( Triplet $ - pdcons - # pconstantData @PCurrencySymbol "ab" #$ pdcons - # pconstantData "41" #$ pdcons - # pconstantData "0e" - # pdnil - ) - `equal` punsafeCoerce - ( pconstant $ - PlutusTx.Constr - 0 - [ PlutusTx.toData @CurrencySymbol "ab" - , PlutusTx.toData @CurrencySymbol "41" - , PlutusTx.toData @CurrencySymbol "0e" - ] - ) - let minting = Minting "" - spending = Spending $ TxOutRef "ab" 0 - rewarding = Rewarding . StakingHash $ PubKeyCredential "da" - pcon - ( Triplet $ - pdcons - # pconstantData minting #$ pdcons - # pconstantData spending #$ pdcons - # pconstantData rewarding - # pdnil - ) - `equal` punsafeCoerce - ( pconstant $ - PlutusTx.Constr - 0 - [PlutusTx.toData minting, PlutusTx.toData spending, PlutusTx.toData rewarding] - ) - , testCase "Enumerable sum type construction" $ do - pcon (PA pdnil) `equal` punsafeCoerce (pconstant $ PlutusTx.Constr 0 []) - pcon (PB pdnil) `equal` punsafeCoerce (pconstant $ PlutusTx.Constr 1 []) - , testCase "Relation between pconstant and pcon" $ do - let valHash = "01" - addr = Address (ScriptCredential $ fromString valHash) Nothing - pscriptCredential :: Term s PCredential - pscriptCredential = - pcon $ - PScriptCredential $ - pdcons # pdata (pcon $ PValidatorHash $ phexByteStr valHash) # pdnil - pconstant addr - `equal` pcon (PAddress $ pdcons # pdata pscriptCredential #$ pdcons # pdata (pcon $ PDNothing pdnil) # pdnil) - ] diff --git a/examples/Examples/LetRec.hs b/examples/Examples/LetRec.hs deleted file mode 100644 index 3a839f2cc..000000000 --- a/examples/Examples/LetRec.hs +++ /dev/null @@ -1,410 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE TemplateHaskell #-} - -module Examples.LetRec (tests) where - -import Plutarch (pcon', pmatch', printTerm) -import Plutarch.Builtin (pasConstr, pforgetData) -import Plutarch.Prelude -import Plutarch.Rec ( - DataReader (DataReader, readData), - DataWriter (DataWriter, writeData), - PRecord (PRecord), - RecordFromData, - ScottEncoded, - ScottEncoding, - field, - fieldFromData, - letrec, - rcon, - recordDataFromFieldWriters, - recordFromFieldReaders, - rmatch, - ) -import Plutarch.Rec.TH (deriveAll) -import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) -import qualified Rank2.TH -import Test.Tasty (TestTree, testGroup) -import Test.Tasty.HUnit (testCase, (@?=)) -import Utils -import Prelude hiding (even, odd) - -data FlatOuterRecord f = FlatOuterRecord - { flatOuterBool :: f PBool - , flatInner1 :: SampleRecord f - , flatOuterInt :: f PInteger - , flatInner2 :: SampleRecord f - , flatOuterString :: f PString - } - -data ShallowOuterRecord f = ShallowOuterRecord - { shallowOuterBool :: f PBool - , shallowInner1 :: f (PRecord SampleRecord) - , shallowOuterInt :: f PInteger - , shallowInner2 :: f (PRecord SampleRecord) - , shallowOuterString :: f PString - } - -data SampleRecord f = SampleRecord - { sampleBool :: f PBool - , sampleInt :: f PInteger - , sampleString :: f PString - } - -data EvenOdd f = EvenOdd - { even :: f (PInteger :--> PBool) - , odd :: f (PInteger :--> PBool) - } - -type instance ScottEncoded EvenOdd a = (PInteger :--> PBool) :--> (PInteger :--> PBool) :--> a - -$(Rank2.TH.deriveAll ''EvenOdd) -$(deriveAll ''SampleRecord) -- also autoderives the @type instance ScottEncoded@ -$(deriveAll ''FlatOuterRecord) -$(deriveAll ''ShallowOuterRecord) -instance RecordFromData SampleRecord -instance RecordFromData FlatOuterRecord -instance RecordFromData ShallowOuterRecord - -instance PIsData (PRecord SampleRecord) where - pfromData = readData (recordFromFieldReaders sampleReader) - pdata = writeData (recordDataFromFieldWriters sampleWriter) - -instance PIsData (PRecord FlatOuterRecord) where - pfromData = readData (recordFromFieldReaders flatOuterReader) - pdata = writeData (recordDataFromFieldWriters flatOuterWriter) - -instance PIsData (PRecord ShallowOuterRecord) where - pfromData = readData (recordFromFieldReaders shallowOuterReader) - pdata = writeData (recordDataFromFieldWriters shallowOuterWriter) - -sampleReader :: SampleRecord (DataReader s) -sampleReader = - SampleRecord - { sampleBool = DataReader pfromData - , sampleInt = DataReader pfromData - , sampleString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d - } - -sampleWriter :: SampleRecord (DataWriter s) -sampleWriter = - SampleRecord - { sampleBool = DataWriter pdata - , sampleInt = DataWriter pdata - , sampleString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s - } - -flatOuterReader :: FlatOuterRecord (DataReader s) -flatOuterReader = - FlatOuterRecord - { flatOuterBool = DataReader pfromData - , flatInner1 = sampleReader - , flatOuterInt = DataReader pfromData - , flatInner2 = sampleReader - , flatOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d - } - -flatOuterWriter :: FlatOuterRecord (DataWriter s) -flatOuterWriter = - FlatOuterRecord - { flatOuterBool = DataWriter pdata - , flatInner1 = sampleWriter - , flatOuterInt = DataWriter pdata - , flatInner2 = sampleWriter - , flatOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s - } - -shallowOuterReader :: ShallowOuterRecord (DataReader s) -shallowOuterReader = - ShallowOuterRecord - { shallowOuterBool = DataReader pfromData - , shallowInner1 = DataReader pfromData - , shallowOuterInt = DataReader pfromData - , shallowInner2 = DataReader pfromData - , shallowOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d - } - -shallowOuterWriter :: ShallowOuterRecord (DataWriter s) -shallowOuterWriter = - ShallowOuterRecord - { shallowOuterBool = DataWriter pdata - , shallowInner1 = DataWriter pdata - , shallowOuterInt = DataWriter pdata - , shallowInner2 = DataWriter pdata - , shallowOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s - } - -sampleFlatOuter :: Term (s :: S) (ScottEncoding FlatOuterRecord (t :: PType)) -sampleFlatOuter = rcon rawFlatOuter - -rawFlatOuter :: FlatOuterRecord (Term s) -rawFlatOuter = - FlatOuterRecord - { flatOuterBool = pcon PFalse - , flatInner1 = rawRecord - , flatOuterInt = 4 - , flatInner2 = rawRecord {sampleInt = 9} - , flatOuterString = "Hola, Mundo!" - } - -sampleShallowOuter :: Term (s :: S) (ScottEncoding ShallowOuterRecord (t :: PType)) -sampleShallowOuter = rcon rawShallowOuter - -rawShallowOuter :: ShallowOuterRecord (Term s) -rawShallowOuter = - ShallowOuterRecord - { shallowOuterBool = pcon PFalse - , shallowInner1 = pcon $ PRecord rawRecord - , shallowOuterInt = 4 - , shallowInner2 = pcon $ PRecord rawRecord {sampleInt = 9} - , shallowOuterString = "Hola, Mundo!" - } - -sampleRecord :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) -sampleRecord = rcon rawRecord - -sampleRecord' :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) -sampleRecord' = pcon' $ PRecord rawRecord - -sampleRecord'' :: Term (s :: S) (PRecord SampleRecord :: PType) -sampleRecord'' = pcon $ PRecord rawRecord - -rawRecord :: SampleRecord (Term s) -rawRecord = - SampleRecord - { sampleBool = pcon PFalse - , sampleInt = 6 - , sampleString = "Salut, Monde!" - } - -sampleRecur :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) -sampleRecur = - letrec $ - const - SampleRecord - { sampleBool = pcon PTrue - , sampleInt = 12 - , sampleString = "Hello, World!" - } - -evenOdd :: Term (s :: S) (ScottEncoding EvenOdd (t :: PType)) -evenOdd = letrec evenOddRecursion - where - evenOddRecursion :: EvenOdd (Term s) -> EvenOdd (Term s) - evenOddRecursion EvenOdd {even, odd} = - EvenOdd - { even = plam $ \n -> pif (n #== 0) (pcon PTrue) (odd #$ n - 1) - , odd = plam $ \n -> pif (n #== 0) (pcon PFalse) (even #$ n - 1) - } - -sampleData :: Term s (PAsData (PRecord SampleRecord)) -sampleData = pdata (punsafeFrom sampleRecord) - -flatOuterData :: Term s (PAsData (PRecord FlatOuterRecord)) -flatOuterData = pdata (punsafeFrom sampleFlatOuter) - -shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) -shallowOuterData = pdata (punsafeFrom sampleShallowOuter) - -tests :: HasTester => TestTree -tests = - testGroup - "Records" - [ testGroup - "Simple" - [ testCase "record construction with pcon" $ - printTerm sampleRecord'' - @?= "(program 1.0.0 (\\i0 -> i1 False 6 \"Salut, Monde!\"))" - , testCase "record construction with pcon'" $ - printTerm sampleRecord' - @?= "(program 1.0.0 (\\i0 -> i1 False 6 \"Salut, Monde!\"))" - , testCase "record construction with rcon" $ - printTerm sampleRecord - @?= "(program 1.0.0 (\\i0 -> i1 False 6 \"Salut, Monde!\"))" - , testCase "field access term" $ - printTerm (sampleRecord' # field sampleInt) - @?= "(program 1.0.0 ((\\i0 -> i1 False 6 \"Salut, Monde!\") (\\i0 -> \\i0 -> \\i0 -> i2)))" - , testGroup "field value" $ - [ testCase "direct access" $ - equal' (sampleRecord # field sampleInt) "(program 1.0.0 6)" - , testCase "pmatch" $ - equal' (pmatch sampleRecord'' $ \(PRecord r) -> sampleString r) "(program 1.0.0 \"Salut, Monde!\")" - , testCase "pmatch'" $ - equal' (pmatch' sampleRecord $ \(PRecord r) -> sampleString r) "(program 1.0.0 \"Salut, Monde!\")" - , testCase "rmatch" $ - equal' (rmatch sampleRecord $ \SampleRecord {sampleString = s} -> s) "(program 1.0.0 \"Salut, Monde!\")" - ] - , testCase "record reconstruction with pcon" $ - printTerm (pmatch' sampleRecord' (pcon @(PRecord SampleRecord))) - @?= "(program 1.0.0 ((\\i0 -> i1 False 6 \"Salut, Monde!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> i1 i4 i3 i2)))" - , testCase "reconstructed field access" $ - equal' (pto (pmatch' sampleRecord' (pcon @(PRecord SampleRecord))) # field sampleInt) "(program 1.0.0 6)" - ] - , testGroup - "Letrec" - [ testCase "record" $ (printTerm $ sampleRecur # field sampleInt) @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i2 (\\i0 -> i2 i2 i1)) (\\i0 -> i2 (\\i0 -> i2 i2 i1))) (\\i0 -> \\i0 -> i1 True 12 \"Hello, World!\") (\\i0 -> \\i0 -> \\i0 -> i2)))" - , testCase "record field" $ equal' (sampleRecur # field sampleInt) "(program 1.0.0 12)" - , testCase "even" $ (printTerm $ evenOdd # field even) @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> i2 (\\i0 -> i2 i2 i1)) (\\i0 -> i2 (\\i0 -> i2 i2 i1))) (\\i0 -> \\i0 -> i1 (\\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\\i0 -> \\i0 -> i1) (subtractInteger i1 1))))) (\\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\\i0 -> \\i0 -> i2)))" - , testCase "even 4" $ equal' (evenOdd # field even # (4 :: Term s PInteger)) "(program 1.0.0 True)" - , testCase "even 5" $ equal' (evenOdd # field even # (5 :: Term s PInteger)) "(program 1.0.0 False)" - ] - , testGroup - "flat nested" - [ testCase "record construction with rcon" $ - printTerm (sampleFlatOuter) - @?= "(program 1.0.0 ((\\i0 -> \\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") \"Salut, Monde!\"))" - , testCase "nested field access" $ - printTerm (sampleFlatOuter # field (sampleInt . flatInner2)) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i3)) \"Salut, Monde!\"))" - , testGroup "nested field value" $ - [ testCase "direct access" $ - equal' (sampleFlatOuter # field (sampleInt . flatInner2)) "(program 1.0.0 9)" - , testCase "pmatch" $ - equal' (pmatch (pcon $ PRecord rawFlatOuter) $ \(PRecord r) -> sampleInt $ flatInner2 r) "(program 1.0.0 9)" - , testCase "pmatch'" $ - equal' (pmatch' sampleFlatOuter $ \(PRecord r) -> sampleString $ flatInner2 r) "(program 1.0.0 \"Salut, Monde!\")" - , testCase "rmatch" $ - equal' (rmatch sampleFlatOuter $ \FlatOuterRecord {flatInner2 = SampleRecord {sampleString = s}} -> s) "(program 1.0.0 \"Salut, Monde!\")" - ] - , testCase "reconstruct with pcon" $ - printTerm (pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord))) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) \"Salut, Monde!\"))" - , testCase "reconstruction nested field value" $ - equal' (pto (pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord))) # field (sampleInt . flatInner2)) "(program 1.0.0 9)" - , testCase "nested record access term" $ - printTerm - ( pmatch' (rcon rawFlatOuter) $ - \(PRecord FlatOuterRecord {flatInner1}) -> pcon $ PRecord flatInner1 - ) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i1 i9 i8 i7)) \"Salut, Monde!\"))" - , testCase "nested match term" $ - printTerm - ( rmatch (rcon rawFlatOuter) $ \(FlatOuterRecord {flatInner2}) -> - rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> - sampleString - ) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False False 6 i2 4 False 9 i2 \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> (\\i0 -> i1 i5 i4 i3) (\\i0 -> \\i0 -> \\i0 -> i1))) \"Salut, Monde!\"))" - , testCase "nested match value" $ - equal' - ( rmatch (rcon rawFlatOuter) $ \(FlatOuterRecord {flatInner2}) -> - rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> - sampleString - ) - "(program 1.0.0 \"Salut, Monde!\")" - ] - , testGroup - "shallow nested" - [ testCase "record construction with rcon" $ - printTerm (sampleShallowOuter) - @?= "(program 1.0.0 ((\\i0 -> \\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") \"Salut, Monde!\"))" - , testCase "nested field access" $ - printTerm (pto (sampleShallowOuter # field shallowInner2) # field sampleInt) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i2) (\\i0 -> \\i0 -> \\i0 -> i2)) \"Salut, Monde!\"))" - , testGroup "nested field value" $ - [ testCase "direct access" $ - equal' (pto (sampleShallowOuter # field shallowInner2) # field sampleInt) "(program 1.0.0 9)" - , testCase "pmatch" $ - equal' (pmatch (pcon $ PRecord rawShallowOuter) $ \(PRecord r) -> pto (shallowInner2 r) # field sampleInt) "(program 1.0.0 9)" - , testCase "pmatch'" $ - equal' (pmatch' sampleShallowOuter $ \(PRecord r) -> pto (shallowInner2 r) # field sampleString) "(program 1.0.0 \"Salut, Monde!\")" - , testCase "rmatch" $ - equal' (rmatch sampleShallowOuter $ \ShallowOuterRecord {shallowInner2 = inner} -> pto inner # field sampleString) "(program 1.0.0 \"Salut, Monde!\")" - ] - , testCase "reconstruct with pcon" $ - printTerm (pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord))) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i1 i6 i5 i4 i3 i2)) \"Salut, Monde!\"))" - , testCase "reconstruction nested field value" $ - equal' (pto (pto (pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord))) # field shallowInner2) # field sampleInt) "(program 1.0.0 9)" - , testCase "nested record access term" $ - printTerm (pmatch' sampleShallowOuter $ \(PRecord ShallowOuterRecord {shallowInner1}) -> shallowInner1) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i4)) \"Salut, Monde!\"))" - , testCase "nested match term" $ - printTerm - ( pmatch' sampleShallowOuter $ \(PRecord ShallowOuterRecord {shallowInner2}) -> - pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> - sampleString - ) - @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> i1 False (\\i0 -> i1 False 6 i3) 4 (\\i0 -> i1 False 9 i3) \"Hola, Mundo!\") (\\i0 -> \\i0 -> \\i0 -> \\i0 -> \\i0 -> i2 (\\i0 -> \\i0 -> \\i0 -> i1))) \"Salut, Monde!\"))" - , testCase "nested match value" $ - equal' - ( pmatch' sampleShallowOuter $ \(PRecord ShallowOuterRecord {shallowInner2}) -> - pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> - sampleString - ) - "(program 1.0.0 \"Salut, Monde!\")" - ] - , testGroup - "Data" - [ testGroup - "pdata" - [ testCase "simple" $ printTerm sampleData @?= "(program 1.0.0 ((\\i0 -> i1 False 6 \"Salut, Monde!\") (\\i0 -> \\i0 -> \\i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))" - , testCase "simple value deconstructed" $ equal' (pasConstr # pforgetData sampleData) "(program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521]))" - , testCase "flat data deconstructed" $ - equal' - (pasConstr # pforgetData flatOuterData) - "(program 1.0.0 ( 0\n, [ #d87980\n , #d87980\n , #06\n , #4d53616c75742c204d6f6e646521\n , #04\n , #d87980\n , #09\n , #4d53616c75742c204d6f6e646521\n , #4c486f6c612c204d756e646f21 ] ))" - , testCase "shallow data deconstructed" $ - equal' - (pasConstr # pforgetData shallowOuterData) - "(program 1.0.0 ( 0\n, [ #d87980\n , #d8799fd87980064d53616c75742c204d6f6e646521ff\n , #04\n , #d8799fd87980094d53616c75742c204d6f6e646521ff\n , #4c486f6c612c204d756e646f21 ] ))" - ] - , testGroup - "fieldFromData term" - [ testCase "simple record" $ - (printTerm $ plam $ \dat -> plam pfromData #$ fieldFromData sampleInt # dat) - @?= result_fieldFromDataTerm'simpleRecord - , testCase "flat nested" $ - (printTerm $ plam $ \dat -> plam pfromData #$ fieldFromData (sampleInt . flatInner2) # dat) - @?= result_fieldFromDataTerm'flatNested - , testCase "shallow nested" $ - ( printTerm $ - plam $ \dat -> pto (plam pfromData #$ fieldFromData shallowInner2 # dat) # field sampleInt - ) - @?= result_fieldFromDataTerm'shallowNested - ] - , testGroup - "fieldFromData value" - [ testCase "simple" $ equal' (fieldFromData sampleInt # sampleData) "(program 1.0.0 #06)" - , testCase "flat nested" $ equal' (fieldFromData (sampleInt . flatInner2) # flatOuterData) "(program 1.0.0 #09)" - , testCase "shallow nested" $ equal' (fieldFromData sampleInt #$ fieldFromData shallowInner2 #$ shallowOuterData) "(program 1.0.0 #09)" - ] - , testCase "pfromData term" $ - (printTerm $ plam $ \d -> punsafeCoerce (pfromData d :: Term _ (PRecord SampleRecord)) # field sampleInt) - @?= result_fieldFromDataValue'shallowNested - ] - ] - --- CPP support isn't great in fourmolu. -{- ORMOLU_DISABLE -} - -result_fieldFromDataTerm'simpleRecord :: String -result_fieldFromDataTerm'simpleRecord = -#ifdef Development - "(program 1.0.0 (\\i0 -> unIData ((\\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace \"verifySoleConstructor failed\" (delay error)))))) (unConstrData i1))))" -#else - "(program 1.0.0 (\\i0 -> unIData ((\\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1))))" -#endif - -result_fieldFromDataTerm'flatNested :: String -result_fieldFromDataTerm'flatNested = -#ifdef Development - "(program 1.0.0 ((\\i0 -> \\i0 -> unIData ((\\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay (force (force trace \"verifySoleConstructor failed\" (delay error)))))) (unConstrData i1))) (force tailList)))" -#else - "(program 1.0.0 ((\\i0 -> \\i0 -> unIData ((\\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1))) (force tailList)))" -#endif - -result_fieldFromDataTerm'shallowNested :: String -result_fieldFromDataTerm'shallowNested = -#ifdef Development - "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> \\i0 -> (\\i0 -> (\\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\\i0 -> i1 ((\\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay (force (i9 i10 (delay error)))))) (unConstrData i1)) ((\\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay (force (i8 i9 (delay error)))))) (unConstrData i1)) (\\i0 -> \\i0 -> \\i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (force trace)) \"verifySoleConstructor failed\"))" -#else - "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> \\i0 -> (\\i0 -> (\\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\\i0 -> i1 ((\\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay error))) (unConstrData i1)) ((\\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay error))) (unConstrData i1)) (\\i0 -> \\i0 -> \\i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))))" -#endif - -result_fieldFromDataValue'shallowNested :: String -result_fieldFromDataValue'shallowNested = -#ifdef Development - "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> \\i0 -> (\\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\\i0 -> i1 ((\\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay (force (force trace \"verifySoleConstructor failed\" (delay error)))))) (unConstrData i1) (\\i0 -> \\i0 -> \\i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))))" -#else - "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> (\\i0 -> \\i0 -> (\\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\\i0 -> i1 ((\\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay error))) (unConstrData i1) (\\i0 -> \\i0 -> \\i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))))" -#endif diff --git a/examples/Examples/Lift.hs b/examples/Examples/Lift.hs deleted file mode 100644 index 847923125..000000000 --- a/examples/Examples/Lift.hs +++ /dev/null @@ -1,37 +0,0 @@ -module Examples.Lift (tests) where - -import Test.Tasty (TestTree, testGroup) -import Test.Tasty.HUnit (Assertion, testCase, (@?=)) - -import Utils - -import Plutarch (printTerm) -import Plutarch.Api.V1 () -import Plutarch.Lift (PLifted) -import Plutarch.Prelude -import Plutus.V1.Ledger.Api -import qualified PlutusTx - -testPConstantDataSan :: forall p. (HasTester, PIsData p, PLift p, PlutusTx.ToData (PLifted p)) => PLifted p -> Assertion -testPConstantDataSan x = pconstantData @p x `equal` pdata (pconstant @p x) - -tests :: HasTester => TestTree -tests = testGroup "pconstant/plift tests" [pconstantDataTests] - -pconstantDataTests :: HasTester => TestTree -pconstantDataTests = - testGroup - "pconstantData" - [ testCase "pconstantData ≡ pdata . pconstant" $ do - testPConstantDataSan False - testPConstantDataSan @PInteger 42 - testPConstantDataSan $ PubKeyHash "04" - testPConstantDataSan $ Minting "" - testPConstantDataSan $ TxOutRef "41" 12 - , testCase "pconstantData compiled output" $ do - printTerm (pconstantData @PInteger 42) @?= "(program 1.0.0 #182a)" - printTerm (pconstantData True) @?= "(program 1.0.0 #d87a80)" - printTerm (pconstantData $ PubKeyHash "04") @?= "(program 1.0.0 #423034)" - printTerm (pconstantData $ Minting "") @?= "(program 1.0.0 #d8799f40ff)" - printTerm (pconstantData $ TxOutRef "41" 12) @?= "(program 1.0.0 #d8799fd8799f4141ff0cff)" - ] diff --git a/examples/Main.hs b/examples/Main.hs deleted file mode 100644 index 8b3641b42..000000000 --- a/examples/Main.hs +++ /dev/null @@ -1,212 +0,0 @@ -{-# LANGUAGE ImplicitParams #-} -{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} - -module Main (main) where - -import Test.Tasty -import Test.Tasty.HUnit - -import qualified Data.Aeson as Aeson -import Data.Maybe (fromJust) -import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Plutarch (POpaque, popaque, printTerm) -import Plutarch.Api.V1 (PScriptPurpose (PMinting)) -import Plutarch.Internal (punsafeConstantInternal) -import Plutarch.Prelude -import Plutarch.Unsafe (punsafeBuiltin) -import Plutus.V1.Ledger.Value (CurrencySymbol (CurrencySymbol)) -import Plutus.V2.Ledger.Contexts (ScriptPurpose (Minting)) -import qualified PlutusCore as PLC -import qualified PlutusTx - -import qualified Examples.ConstrData as ConstrData -import qualified Examples.LetRec as LetRec -import qualified Examples.Lift as Lift -import Utils - -import Data.Text (Text) - -main :: IO () -main = do - setLocaleEncoding utf8 - defaultMain $ testGroup "all tests" [standardTests] -- , shrinkTests ] - --- FIXME: Make the below impossible using run-time checks. --- loop :: Term (PInteger :--> PInteger) --- loop = plam $ \x -> loop # x --- loopHoisted :: Term (PInteger :--> PInteger) --- loopHoisted = phoistAcyclic $ plam $ \x -> loop # x - --- _shrinkTests :: TestTree --- _shrinkTests = testGroup "shrink tests" [let ?tester = shrinkTester in tests] - -standardTests :: TestTree -standardTests = testGroup "standard tests" [let ?tester = standardTester in tests] - -tests :: HasTester => TestTree -tests = - testGroup - "unit tests" - [ plutarchTests - , uplcTests - , LetRec.tests - , ConstrData.tests - , Lift.tests - ] - -plutarchTests :: HasTester => TestTree -plutarchTests = - testGroup - "plutarch tests" - [ testCase "1 + 2 == 3" $ equal (pconstant @PInteger $ 1 + 2) (pconstant @PInteger 3) - , testCase "fails: perror" $ fails perror - , testGroup - "PlutusType scott encoding " - [ testCase "PMaybe" $ do - let a = 42 :: Term s PInteger - let x = pmatch (pcon $ PJust a) $ \case - PJust x -> x - -- We expect this perror not to be evaluated eagerly when mx - -- is a PJust. - PNothing -> perror - printTerm x @?= "(program 1.0.0 ((\\i0 -> \\i0 -> i2 42) (\\i0 -> i1) (delay error)))" - , testCase "PPair" $ do - let a = 42 :: Term s PInteger - b = "Universe" :: Term s PString - let x = pmatch (pcon (PPair a b) :: Term s (PPair PInteger PString)) $ \(PPair _ y) -> y - printTerm x @?= "(program 1.0.0 ((\\i0 -> i1 42 \"Universe\") (\\i0 -> \\i0 -> i1)))" - ] - , testCase "pconstant \"abc\" == \"abc\"" $ do - pconstant @PString "abc" `equal` pconstant @PString "abc" - expect $ pconstant @PString "foo" #== "foo" - , testCase "ScriptPurpose literal" $ - let d :: ScriptPurpose - d = Minting dummyCurrency - f :: Term s PScriptPurpose - f = pconstant @PScriptPurpose d - in printTerm f @?= "(program 1.0.0 #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff)" - , testCase "decode ScriptPurpose" $ - let d :: ScriptPurpose - d = Minting dummyCurrency - d' :: Term s PScriptPurpose - d' = pconstant @PScriptPurpose d - f :: Term s POpaque - f = pmatch d' $ \case - PMinting c -> popaque c - _ -> perror - in printTerm f @?= "(program 1.0.0 ((\\i0 -> (\\i0 -> (\\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff)))" - , testCase "error # 1 => error" $ - printTerm (perror # (1 :: Term s PInteger)) @?= "(program 1.0.0 error)" - , -- TODO: Port this to pluatrch-test - -- , testCase "fib error => error" $ - -- printTerm (fib # perror) @?= "(program 1.0.0 error)" - testCase "force (delay 0) => 0" $ - printTerm (pforce . pdelay $ (0 :: Term s PInteger)) @?= "(program 1.0.0 0)" - , testCase "delay (force (delay 0)) => delay 0" $ - printTerm (pdelay . pforce . pdelay $ (0 :: Term s PInteger)) @?= "(program 1.0.0 (delay 0))" - , testCase "id # 0 => 0" $ - printTerm ((plam $ \x -> x) # (0 :: Term s PInteger)) @?= "(program 1.0.0 0)" - , testCase "hoist id 0 => 0" $ - printTerm ((phoistAcyclic $ plam $ \x -> x) # (0 :: Term s PInteger)) @?= "(program 1.0.0 0)" - , testCase "hoist fstPair => fstPair" $ - printTerm (phoistAcyclic (punsafeBuiltin PLC.FstPair)) @?= "(program 1.0.0 fstPair)" - , testCase "throws: hoist error" $ throws $ phoistAcyclic perror - , testCase "PData equality" $ do - expect $ let dat = pconstant @PData (PlutusTx.List [PlutusTx.Constr 1 [PlutusTx.I 0]]) in dat #== dat - expect $ pnot #$ pconstant @PData (PlutusTx.Constr 0 []) #== pconstant @PData (PlutusTx.I 42) - , testCase "PAsData equality" $ do - expect $ let dat = pdata @PInteger 42 in dat #== dat - expect $ pnot #$ pdata (phexByteStr "12") #== pdata (phexByteStr "ab") - , testGroup - "η-reduction optimisations" - [ testCase "λx y. addInteger x y => addInteger" $ - printTerm (plam $ \x y -> (x :: Term _ PInteger) + y) @?= "(program 1.0.0 addInteger)" - , testCase "λx y. hoist (force mkCons) x y => force mkCons" $ - printTerm (plam $ \x y -> (pforce $ punsafeBuiltin PLC.MkCons) # x # y) @?= "(program 1.0.0 (force mkCons))" - , testCase "λx y. hoist mkCons x y => mkCons x y" $ - printTerm (plam $ \x y -> (punsafeBuiltin PLC.MkCons) # x # y) @?= "(program 1.0.0 (\\i0 -> \\i0 -> mkCons i2 i1))" - , testCase "λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x" $ - printTerm (plam $ \x y -> (phoistAcyclic $ plam $ \(x :: Term _ PInteger) y -> x + y - y - x) # x # y) @?= "(program 1.0.0 (\\i0 -> \\i0 -> subtractInteger (subtractInteger (addInteger i2 i1) i1) i2))" - , testCase "λx y. x + x" $ - printTerm (plam $ \(x :: Term _ PInteger) (_ :: Term _ PInteger) -> x + x) @?= "(program 1.0.0 (\\i0 -> \\i0 -> addInteger i2 i2))" - , testCase "let x = addInteger in x 1 1" $ - printTerm (plet (punsafeBuiltin PLC.AddInteger) $ \x -> x # (1 :: Term _ PInteger) # (1 :: Term _ PInteger)) @?= "(program 1.0.0 (addInteger 1 1))" - , testCase "let x = 0 in x => 0" $ - printTerm (plet 0 $ \(x :: Term _ PInteger) -> x) @?= "(program 1.0.0 0)" - , testCase "let x = hoist (λx. x + x) in 0 => 0" $ - printTerm (plet (phoistAcyclic $ plam $ \(x :: Term _ PInteger) -> x + x) $ \_ -> (0 :: Term _ PInteger)) @?= "(program 1.0.0 0)" - , testCase "let x = hoist (λx. x + x) in x" $ - printTerm (plet (phoistAcyclic $ plam $ \(x :: Term _ PInteger) -> x + x) $ \x -> x) @?= "(program 1.0.0 (\\i0 -> addInteger i1 i1))" - , testCase "λx y. sha2_256 x y =>!" $ - printTerm ((plam $ \x y -> punsafeBuiltin PLC.Sha2_256 # x # y)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> sha2_256 i2 i1))" - , testCase "let f = hoist (λx. x) in λx y. f x y => λx y. x y" $ - printTerm ((plam $ \x y -> (phoistAcyclic $ plam $ \x -> x) # x # y)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> i2 i1))" - , testCase "let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y" $ - printTerm ((plam $ \x y -> ((phoistAcyclic $ plam $ \x -> x # pcon PTrue)) # x # y)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> i2 True i1))" - , testCase "λy. (λx. x + x) y" $ - printTerm (plam $ \y -> (plam $ \(x :: Term _ PInteger) -> x + x) # y) @?= "(program 1.0.0 (\\i0 -> addInteger i1 i1))" - ] - , testGroup - "Lifting of constants" - [ testCase "plift on primitive types" $ do - plift (pcon PTrue) @?= True - plift (pcon PFalse) @?= False - , testCase "pconstant on primitive types" $ do - plift (pconstant @PBool False) @?= False - plift (pconstant @PBool True) @?= True - , testCase "plift on list and pair" $ do - plift (pconstant ([1, 2, 3] :: [Integer])) @?= [1, 2, 3] - plift (pconstant ("IOHK" :: Text, 42 :: Integer)) @?= ("IOHK", 42) - , testCase "plift on data" $ do - let d :: PlutusTx.Data - d = PlutusTx.toData @(Either Bool Bool) $ Right False - plift (pconstant d) @?= d - , testCase "plift on nested containers" $ do - -- List of pairs - let v1 = [("IOHK", 42), ("Plutus", 31)] :: [(Text, Integer)] - plift (pconstant v1) @?= v1 - -- List of pair of lists - let v2 = [("IOHK", [1, 2, 3]), ("Plutus", [9, 8, 7])] :: [(Text, [Integer])] - plift (pconstant v2) @?= v2 - ] - ] - --- | Tests for the behaviour of UPLC itself. -uplcTests :: HasTester => TestTree -uplcTests = - testGroup - "uplc tests" - [ testCase "2:[1]" $ - let l :: Term _ (PBuiltinList PInteger) = - punsafeConstantInternal . PLC.Some $ - PLC.ValueOf (PLC.DefaultUniApply PLC.DefaultUniProtoList PLC.DefaultUniInteger) [1] - l' :: Term _ (PBuiltinList PInteger) = - pforce (punsafeBuiltin PLC.MkCons) # (2 :: Term _ PInteger) # l - in equal' l' "(program 1.0.0 [2,1])" - , testCase "fails: True:[1]" $ - let l :: Term _ (PBuiltinList POpaque) = - punsafeConstantInternal . PLC.Some $ - PLC.ValueOf (PLC.DefaultUniApply PLC.DefaultUniProtoList PLC.DefaultUniInteger) [1] - l' :: Term _ (PBuiltinList POpaque) = - pforce (punsafeBuiltin PLC.MkCons) # pcon PTrue # l - in fails l' - , testCase "(2,1)" $ - let p :: Term _ (PBuiltinPair PInteger PInteger) = - punsafeConstantInternal . PLC.Some $ - PLC.ValueOf - ( PLC.DefaultUniApply - (PLC.DefaultUniApply PLC.DefaultUniProtoPair PLC.DefaultUniInteger) - PLC.DefaultUniInteger - ) - (1, 2) - in equal' p "(program 1.0.0 (1, 2))" - , testCase "fails: MkPair 1 2" $ - let p :: Term _ (PBuiltinPair PInteger PInteger) = - punsafeBuiltin PLC.MkPairData # (1 :: Term _ PInteger) # (2 :: Term _ PInteger) - in fails p - ] - -dummyCurrency :: CurrencySymbol -dummyCurrency = - CurrencySymbol . fromJust . Aeson.decode $ - "\"1111111111111111111111111111111111111111111111111111111111111111\"" diff --git a/examples/Utils.hs b/examples/Utils.hs deleted file mode 100644 index 761bdc7d9..000000000 --- a/examples/Utils.hs +++ /dev/null @@ -1,195 +0,0 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE ImplicitParams #-} - -module Utils ( - HasTester, - standardTester, - eval, - equal, - equalBudgeted, - equal', - fails, - expect, - throws, - traces, - succeeds, -) where - -import Control.Exception (SomeException, try) -import Data.Text (Text) -import Plutarch (ClosedTerm, compile, printScript) -import Plutarch.Evaluate (evaluateBudgetedScript, evaluateScript) -import Plutarch.Prelude -import qualified Plutus.V1.Ledger.Scripts as Scripts -import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) -import qualified PlutusCore.Evaluation.Machine.ExMemory as ExMemory - --- import Shrink (shrinkScript) -import Test.Tasty.HUnit - -newtype EvalImpl = EvalImpl {runEvalImpl :: forall (a :: PType). HasCallStack => ClosedTerm a -> IO Scripts.Script} -newtype EqualImpl = EqualImpl {runEqualImpl :: forall (a :: PType) (b :: PType). HasCallStack => ClosedTerm a -> ClosedTerm b -> Assertion} -newtype Equal'Impl = Equal'Impl {runEqual'Impl :: forall (a :: PType). HasCallStack => ClosedTerm a -> String -> Assertion} -newtype FailsImpl = FailsImpl {runFailsImpl :: forall (a :: PType). HasCallStack => ClosedTerm a -> Assertion} -newtype ExpectImpl = ExpectImpl {runExpectImpl :: HasCallStack => ClosedTerm PBool -> Assertion} -newtype ThrowsImpl = ThrowsImpl {runThrowsImpl :: forall (a :: PType). ClosedTerm a -> Assertion} -newtype TracesImpl = TracesImpl {runTracesImpl :: forall (a :: PType). ClosedTerm a -> [Text] -> Assertion} -newtype SucceedsImpl = SucceedsImpl {runSucceedsImpl :: ClosedTerm PUnit -> Assertion} - -data Tester = Tester - { evalImpl :: EvalImpl - , equalImpl :: EqualImpl - , equal'Impl :: Equal'Impl - , failsImpl :: FailsImpl - , expectImpl :: ExpectImpl - , throwsImpl :: ThrowsImpl - , tracesImpl :: TracesImpl - , succeedsImpl :: SucceedsImpl - } - -type HasTester = (?tester :: Tester) - -eval' :: HasCallStack => Scripts.Script -> IO Scripts.Script -eval' s = case evaluateScript s of - Left e -> assertFailure $ "Script evaluation failed: " <> show e - Right (_, _, x') -> pure x' - -standardTester :: Tester -standardTester = - Tester - { evalImpl = EvalImpl evalImpl - , equalImpl = EqualImpl equalImpl - , equal'Impl = Equal'Impl equal'Impl - , failsImpl = FailsImpl failsImpl - , expectImpl = ExpectImpl expectImpl - , throwsImpl = ThrowsImpl throwsImpl - , tracesImpl = TracesImpl tracesImpl - , succeedsImpl = SucceedsImpl succeedsImpl - } - where - evalImpl :: HasCallStack => ClosedTerm a -> IO Scripts.Script - evalImpl x = eval' $ compile x - - equalImpl :: HasCallStack => ClosedTerm a -> ClosedTerm b -> Assertion - equalImpl x y = do - x' <- evalImpl x - y' <- evalImpl y - printScript x' @?= printScript y' - - equal'Impl :: HasCallStack => ClosedTerm a -> String -> Assertion - equal'Impl x y = do - x' <- evalImpl x - printScript x' @?= y - - failsImpl :: HasCallStack => ClosedTerm a -> Assertion - failsImpl x = - case evaluateScript $ compile x of - Left (Scripts.EvaluationError _ _) -> mempty - Left (Scripts.EvaluationException _ _) -> mempty - Left e -> assertFailure $ "Script is malformed: " <> show e - Right (_, _, s) -> assertFailure $ "Script didn't err: " <> printScript s - - expectImpl :: HasCallStack => ClosedTerm PBool -> Assertion - expectImpl = equalImpl (pcon PTrue :: Term s PBool) - - throwsImpl :: HasCallStack => ClosedTerm a -> Assertion - throwsImpl x = - try @SomeException (putStrLn $ printScript $ compile x) >>= \case - Right _ -> assertFailure "Supposed to throw" - Left _ -> pure () - - tracesImpl :: HasCallStack => ClosedTerm a -> [Text] -> Assertion - tracesImpl x sl = - case evaluateScript $ compile x of - Left e -> assertFailure $ "Script evalImpluation failed: " <> show e - Right (_, traceLog, _) -> traceLog @?= sl - - succeedsImpl :: HasCallStack => ClosedTerm PUnit -> Assertion - succeedsImpl x = case evaluateScript $ compile x of - Left e -> assertFailure $ "Script evaluation failed: " <> show e - Right _ -> pure () - -{- -shrinkTester :: Tester -shrinkTester = - Tester - { evalImpl = EvalImpl evalImpl - , equalImpl = EqualImpl equalImpl - , equal'Impl = Equal'Impl equal'Impl - , failsImpl = FailsImpl failsImpl - , expectImpl = ExpectImpl expectImpl - , throwsImpl = ThrowsImpl throwsImpl - , tracesImpl = TracesImpl tracesImpl - } - where - evalImpl :: HasCallStack => ClosedTerm a -> IO Scripts.Script - evalImpl x = eval' . shrinkScript $ compile x - - equalImpl :: HasCallStack => ClosedTerm a -> ClosedTerm b -> Assertion - equalImpl x y = do - x' <- evalImpl x - y' <- evalImpl y - printScript x' @?= printScript y' - - equal'Impl :: HasCallStack => ClosedTerm a -> String -> Assertion - equal'Impl x y = do - x' <- let ?tester = standardTester in eval x - printScript x' @?= y - - failsImpl :: HasCallStack => ClosedTerm a -> Assertion - failsImpl x = - case evaluateScript . shrinkScript $ compile x of - Left (Scripts.EvaluationError _ _) -> mempty - Left (Scripts.EvaluationException _ _) -> mempty - Left e -> assertFailure $ "Script is malformed: " <> show e - Right (_, _, s) -> assertFailure $ "Script didn't err: " <> printScript s - - expectImpl :: HasCallStack => ClosedTerm PBool -> Assertion - expectImpl = equalImpl (pcon PTrue :: Term s PBool) - - throwsImpl :: HasCallStack => ClosedTerm a -> Assertion - throwsImpl x = - try @SomeException (putStrLn . printScript . shrinkScript $ compile x) >>= \case - Right _ -> assertFailure "Supposed to throw" - Left _ -> pure () - - tracesImpl :: HasCallStack => ClosedTerm a -> [Text] -> Assertion - tracesImpl x sl = - case evaluateScript . shrinkScript $ compile x of - Left e -> assertFailure $ "Script evalImpluation failed: " <> show e - Right (_, traceLog, _) -> traceLog @?= sl --} - -eval :: (HasCallStack, HasTester) => ClosedTerm a -> IO Scripts.Script -eval = runEvalImpl (evalImpl ?tester) -equal :: forall (a :: PType) (b :: PType). (HasCallStack, HasTester) => ClosedTerm a -> ClosedTerm b -> Assertion -equal x y = runEqualImpl (equalImpl ?tester) x y -equal' :: (HasCallStack, HasTester) => ClosedTerm a -> String -> Assertion -equal' = runEqual'Impl (equal'Impl ?tester) -fails :: (HasCallStack, HasTester) => ClosedTerm a -> Assertion -fails = runFailsImpl (failsImpl ?tester) -expect :: (HasCallStack, HasTester) => ClosedTerm PBool -> Assertion -expect = runExpectImpl (expectImpl ?tester) -throws :: (HasCallStack, HasTester) => ClosedTerm a -> Assertion -throws = runThrowsImpl (throwsImpl ?tester) -traces :: (HasCallStack, HasTester) => ClosedTerm a -> [Text] -> Assertion -traces = runTracesImpl (tracesImpl ?tester) -succeeds :: (HasCallStack, HasTester) => ClosedTerm PUnit -> Assertion -succeeds = runSucceedsImpl (succeedsImpl ?tester) - -evalBudgeted :: HasCallStack => ClosedTerm a -> IO Scripts.Script -evalBudgeted x = case evaluateBudgetedScript (ExBudget maxCPU maxMemory) $ compile x of - Left e -> assertFailure $ "Script evaluation failed: " <> show e - Right (_, _, x') -> pure x' - -maxCPU :: ExMemory.ExCPU -maxCPU = ExMemory.ExCPU 4000 - -maxMemory :: ExMemory.ExMemory -maxMemory = ExMemory.ExMemory 4000 - -equalBudgeted :: HasCallStack => ClosedTerm a -> ClosedTerm b -> Assertion -equalBudgeted x y = do - x' <- evalBudgeted x - y' <- evalBudgeted y - printScript x' @?= printScript y' diff --git a/flake.lock b/flake.lock index 04c436ddb..7e9cfadf3 100644 --- a/flake.lock +++ b/flake.lock @@ -32,31 +32,14 @@ "type": "github" } }, - "Win32-network": { - "flake": false, - "locked": { - "lastModified": 1636063162, - "narHash": "sha256-uvYEWalN62ETpH45/O7lNHo4rAIaJtYpLWdIcAkq3dA=", - "owner": "input-output-hk", - "repo": "Win32-network", - "rev": "2d1a01c7cbb9f68a1aefe2934aad6c70644ebfea", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "Win32-network", - "rev": "2d1a01c7cbb9f68a1aefe2934aad6c70644ebfea", - "type": "github" - } - }, "cabal-32": { "flake": false, "locked": { "lastModified": 1603716527, - "narHash": "sha256-sDbrmur9Zfp4mPKohCD8IDZfXJ0Tjxpmr2R+kg5PpSY=", + "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", "owner": "haskell", "repo": "cabal", - "rev": "94aaa8e4720081f9c75497e2735b90f6a819b08e", + "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", "type": "github" }, "original": { @@ -69,11 +52,11 @@ "cabal-34": { "flake": false, "locked": { - "lastModified": 1622475795, - "narHash": "sha256-chwTL304Cav+7p38d9mcb+egABWmxo2Aq+xgVBgEb/U=", + "lastModified": 1640353650, + "narHash": "sha256-N1t6M3/wqj90AEdRkeC8i923gQYUpzSr8b40qVOZ1Rk=", "owner": "haskell", "repo": "cabal", - "rev": "b086c1995cdd616fc8d91f46a21e905cc50a1049", + "rev": "942639c18c0cd8ec53e0a6f8d120091af35312cd", "type": "github" }, "original": { @@ -86,11 +69,11 @@ "cabal-36": { "flake": false, "locked": { - "lastModified": 1640163203, - "narHash": "sha256-TwDWP2CffT0j40W6zr0J1Qbu+oh3nsF1lUx9446qxZM=", + "lastModified": 1641652457, + "narHash": "sha256-BlFPKP4C4HRUJeAbdembX1Rms1LD380q9s0qVDeoAak=", "owner": "haskell", "repo": "cabal", - "rev": "ecf418050c1821f25e2e218f1be94c31e0465df1", + "rev": "f27667f8ec360c475027dcaee0138c937477b070", "type": "github" }, "original": { @@ -199,50 +182,95 @@ "type": "github" } }, - "flake-compat": { - "flake": false, + "ema": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "lint-utils": "lint-utils", + "nixpkgs": "nixpkgs" + }, "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "lastModified": 1648411303, + "narHash": "sha256-OhAbDxl+AaTQDvPUEVYn9xnW7iP++bZ3dCJEOLM29fk=", + "owner": "srid", + "repo": "ema", + "rev": "976590c6cb7836cc4caeeaf2ca65d84a6c2502e3", "type": "github" }, "original": { - "owner": "edolstra", - "repo": "flake-compat", + "owner": "srid", + "ref": "multisite", + "repo": "ema", "type": "github" } }, - "flake-compat-ci": { + "emanote": { + "inputs": { + "ema": "ema", + "flake-compat": [ + "emanote", + "ema", + "flake-compat" + ], + "flake-utils": [ + "emanote", + "ema", + "flake-utils" + ], + "heist": "heist", + "lint-utils": "lint-utils_2", + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ], + "pathtree": "pathtree", + "tailwind-haskell": "tailwind-haskell", + "unionmount": "unionmount" + }, "locked": { - "lastModified": 1641672839, - "narHash": "sha256-Bdwv+DKeEMlRNPDpZxSz0sSrqQBvdKO5fZ8LmvrgCOU=", - "owner": "hercules-ci", - "repo": "flake-compat-ci", - "rev": "e832114bc18376c0f3fa13c19bf5ff253cc6570a", + "lastModified": 1649015242, + "narHash": "sha256-CUB+JJawmI+4PeuCYwME/rZFebg9HTbbWAS66fRLHig=", + "owner": "srid", + "repo": "emanote", + "rev": "34a2040d5b77e425f22183232dcbd6735f9b49a5", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "flake-compat-ci", + "owner": "srid", + "ref": "master", + "repo": "emanote", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1648199409, + "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", "type": "github" } }, "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1606424373, - "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", "owner": "edolstra", "repo": "flake-compat", - "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", "type": "github" }, "original": { "owner": "edolstra", - "ref": "master", "repo": "flake-compat", "type": "github" } @@ -250,11 +278,11 @@ "flake-compat_3": { "flake": false, "locked": { - "lastModified": 1606424373, - "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", "owner": "edolstra", "repo": "flake-compat", - "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", "type": "github" }, "original": { @@ -265,11 +293,86 @@ }, "flake-utils": { "locked": { - "lastModified": 1623875721, - "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "lastModified": 1648297722, + "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "locked": { + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "locked": { + "lastModified": 1631561581, + "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_6": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", "owner": "numtide", "repo": "flake-utils", - "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", "type": "github" }, "original": { @@ -348,11 +451,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1642554756, - "narHash": "sha256-1+SN+z80HgKYshlCf8dRxwRojQzuwwsQ5uq14N/JP1Y=", + "lastModified": 1644887696, + "narHash": "sha256-o4gltv4npUl7+1gEQIcrRqZniwqC9kK8QsPaftlrawc=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "f9d5e67ca90926b244c0ad68815371d37582a149", + "rev": "6ff64aa49b88e75dd6e0bbd2823c2a92c9174fa5", "type": "github" }, "original": { @@ -364,11 +467,11 @@ "hackage-nix": { "flake": false, "locked": { - "lastModified": 1637291070, - "narHash": "sha256-hTX2Xo36i9MR6PNwA/89C8daKjxmx5ZS5lwR2Cbp8Yo=", + "lastModified": 1644369434, + "narHash": "sha256-WqU6f1OhSM0UHXFW8Mhhvhz0tcij+NQVtmb6sW4RiFw=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "6ea4ad5f4a5e2303cd64974329ba90ccc410a012", + "rev": "644a0d702abf84cdec62f4e620ff1034000e6146", "type": "github" }, "original": { @@ -380,11 +483,11 @@ "haskell-language-server": { "flake": false, "locked": { - "lastModified": 1642772345, - "narHash": "sha256-fjdNOcd0S35OAvMZu81/im32B7hSIimjs08VKQA58Mw=", + "lastModified": 1645014262, + "narHash": "sha256-f49So1teiroV+S7sbGTK4AhzUOXpoiQ26/fTjdIKkqc=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "f0bbc390b995953885506b755f4e4b5c6af618fb", + "rev": "96ea854debd92f9a54e2270b9b9a080c0ce6f3d1", "type": "github" }, "original": { @@ -396,16 +499,16 @@ "haskell-language-server_2": { "flake": false, "locked": { - "lastModified": 1638136578, - "narHash": "sha256-Reo9BQ12O+OX7tuRfaDPZPBpJW4jnxZetm63BxYncoM=", + "lastModified": 1643835246, + "narHash": "sha256-5LQHcQmi3mUGRgJu+X/m3jeM3kdkYjLD+KwgnxBlbeU=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "745ef26f406dbdd5e4a538585f8519af9f1ccb09", + "rev": "024ddc8b3904f8b8e8fe67ba6b9ebd8a4bd7ce76", "type": "github" }, "original": { "owner": "haskell", - "ref": "1.5.1", + "ref": "1.6.1.1", "repo": "haskell-language-server", "type": "github" } @@ -417,14 +520,14 @@ "cabal-34": "cabal-34", "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_6", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", "hpc-coveralls": "hpc-coveralls", "nix-tools": "nix-tools", "nixpkgs": [ "haskell-nix", - "nixpkgs-2111" + "nixpkgs-unstable" ], "nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2105": "nixpkgs-2105", @@ -434,11 +537,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1642811877, - "narHash": "sha256-7YbbFF4ISWMcs5hHDfH7GkCSccvwEwhvKZ5D74Cuajo=", + "lastModified": 1644944726, + "narHash": "sha256-jJWdP/3Ne1y1akC3m9rSO5ItRoBc4UTdVQZBCuPmmrM=", "owner": "L-as", "repo": "haskell.nix", - "rev": "ac825b91c202947ec59b1a477003564cc018fcec", + "rev": "45c583b5580c130487eb5a342679f0bdbc2b23fc", "type": "github" }, "original": { @@ -464,42 +567,33 @@ "type": "github" } }, - "hercules-ci-agent": { - "inputs": { - "flake-compat": "flake-compat_3", - "nix-darwin": "nix-darwin", - "nixos-20_09": "nixos-20_09", - "nixos-unstable": "nixos-unstable", - "pre-commit-hooks-nix": "pre-commit-hooks-nix" - }, + "heist": { + "flake": false, "locked": { - "lastModified": 1642766877, - "narHash": "sha256-EXvI+1cKZHWfAaRV1PrSrQe0knc4rg5vMF4qz6/5bkI=", - "owner": "hercules-ci", - "repo": "hercules-ci-agent", - "rev": "0aa916f487be7da03bc2a6dec2ac7149b05499c5", + "lastModified": 1649013405, + "narHash": "sha256-4NK8ZLHm4iHWU+LCu3M0jnALCnQCa7lEu72NIOQ1YI8=", + "owner": "srid", + "repo": "heist", + "rev": "a4b3d6d5573a4ba9c410b382fa3771e8ae53fcfa", "type": "github" }, "original": { - "owner": "hercules-ci", - "ref": "master", - "repo": "hercules-ci-agent", + "owner": "srid", + "ref": "emanote-release", + "repo": "heist", "type": "github" } }, "hercules-ci-effects": { "inputs": { - "flake-compat": "flake-compat_2", - "hercules-ci-agent": "hercules-ci-agent", - "nixpkgs": "nixpkgs_2", - "nixpkgs-nixops": "nixpkgs-nixops" + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1641914281, - "narHash": "sha256-3qJ6tDPkrsFqm4E74JROZlQbnKKLNTHV7QOD1LdcVqs=", + "lastModified": 1647711660, + "narHash": "sha256-ZoV/oAH8g4NYeTzC7OCZnlM7l0hNBs0nUHf4l1+lmDc=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "2e165352d92782e7ae149f4f1a9b3174f718a3af", + "rev": "d17e41cfb454d07f5d8d3b667bf45b079d868541", "type": "github" }, "original": { @@ -541,100 +635,164 @@ "type": "github" } }, - "iohk-nix": { + "hspec": { "flake": false, "locked": { - "lastModified": 1626953580, - "narHash": "sha256-iEI9aTOaZMGsjWzcrctrC0usmiagwKT2v1LSDe9/tMU=", - "owner": "input-output-hk", - "repo": "iohk-nix", - "rev": "cbd497f5844249ef8fe617166337d59f2a6ebe90", + "lastModified": 1649095108, + "narHash": "sha256-cPmt4hvmdh727VT6UAL8yFArmm4FAWeg3K5Qi3XtU4g=", + "owner": "srid", + "repo": "hspec", + "rev": "44f2a143e10c93df237af428457d0e4b74ae270a", "type": "github" }, "original": { - "owner": "input-output-hk", - "repo": "iohk-nix", + "owner": "srid", + "ref": "askAncestors", + "repo": "hspec", "type": "github" } }, - "nix-darwin": { - "inputs": { - "nixpkgs": "nixpkgs" + "hspec-golden": { + "flake": false, + "locked": { + "lastModified": 1648755064, + "narHash": "sha256-5a6BksZx00o2iL0Ei/L1Kkou2BsnsIagN+tTmqYyKfs=", + "owner": "stackbuilders", + "repo": "hspec-golden", + "rev": "4b0ad56b2de0254a7b1e0feda917656f78a5bcda", + "type": "github" }, + "original": { + "owner": "stackbuilders", + "repo": "hspec-golden", + "type": "github" + } + }, + "hspec-hedgehog": { + "flake": false, "locked": { - "lastModified": 1622060422, - "narHash": "sha256-hPVlvrAyf6zL7tTx0lpK+tMxEfZeMiIZ/A2xaJ41WOY=", - "owner": "LnL7", - "repo": "nix-darwin", - "rev": "007d700e644ac588ad6668e6439950a5b6e2ff64", + "lastModified": 1602603478, + "narHash": "sha256-XnS3zjQ7eh3iBOWq+Z/YcwrfWI55hV6k8LsZ8qm/qOc=", + "owner": "parsonsmatt", + "repo": "hspec-hedgehog", + "rev": "eb617d854542510f0129acdea4bf52e50b13042e", "type": "github" }, "original": { - "owner": "LnL7", - "repo": "nix-darwin", + "owner": "parsonsmatt", + "repo": "hspec-hedgehog", "type": "github" } }, - "nix-tools": { + "iohk-nix": { "flake": false, "locked": { - "lastModified": 1636018067, - "narHash": "sha256-ng306fkuwr6V/malWtt3979iAC4yMVDDH2ViwYB6sQE=", + "lastModified": 1643251385, + "narHash": "sha256-Czbd69lg0ARSZfC18V6h+gtPMioWDAEVPbiHgL2x9LM=", "owner": "input-output-hk", - "repo": "nix-tools", - "rev": "ed5bd7215292deba55d6ab7a4e8c21f8b1564dda", + "repo": "iohk-nix", + "rev": "9d6ee3dcb3482f791e40ed991ad6fc649b343ad4", "type": "github" }, "original": { "owner": "input-output-hk", - "repo": "nix-tools", + "repo": "iohk-nix", "type": "github" } }, - "nixos-20_09": { + "iohk-nix_2": { + "flake": false, "locked": { - "lastModified": 1623585158, - "narHash": "sha256-AjK7M1/six8IBPOI28nm7yC2k8mZIR2F9QrOwFYHAS0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "115dbbe82eb4ec8aabf959068286468a68e0b244", + "lastModified": 1626953580, + "narHash": "sha256-iEI9aTOaZMGsjWzcrctrC0usmiagwKT2v1LSDe9/tMU=", + "owner": "input-output-hk", + "repo": "iohk-nix", + "rev": "cbd497f5844249ef8fe617166337d59f2a6ebe90", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-20.09", - "repo": "nixpkgs", + "owner": "input-output-hk", + "repo": "iohk-nix", "type": "github" } }, - "nixos-unstable": { + "lint-utils": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1630248577, - "narHash": "sha256-9d/yq96TTrnF7qjA6wPYk+rYjWAXwfUmwk3qewezSeg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512", + "lastModified": 1648405819, + "narHash": "sha256-Rv9QsHg5a3OurGxbC0Y2aERAZ0sFXYQyaxGYXdDPiZ4=", + "ref": "parameterized", + "rev": "9ba45de1fc3dbbe65c39d7d0107b99a8046a8081", + "revCount": 21, + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + }, + "original": { + "ref": "parameterized", + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + } + }, + "lint-utils_2": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "emanote", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1648667273, + "narHash": "sha256-eQUb40xDyv0Ye3oMzGz6tcHPF9y9Xhq1QksV9h7uEDk=", + "ref": "spec-type", + "rev": "4648a98d91f754ae0f7a3d035a1aaa871eb1b4fc", + "revCount": 34, + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + }, + "original": { + "ref": "spec-type", + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + } + }, + "nix-tools": { + "flake": false, + "locked": { + "lastModified": 1644395812, + "narHash": "sha256-BVFk/BEsTLq5MMZvdy3ZYHKfaS3dHrsKh4+tb5t5b58=", + "owner": "input-output-hk", + "repo": "nix-tools", + "rev": "d847c63b99bbec78bf83be2a61dc9f09b8a9ccc1", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", + "owner": "input-output-hk", + "repo": "nix-tools", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1602411953, - "narHash": "sha256-gbupmxRpoQZqL5NBQCJN2GI5G7XDEHHHYKhVwEj5+Ps=", - "owner": "LnL7", + "lastModified": 1648219316, + "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "f780534ea2d0c12e62607ff254b6b45f46653f7a", + "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "nixos", + "repo": "nixpkgs", + "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", + "type": "github" } }, "nixpkgs-2003": { @@ -655,11 +813,11 @@ }, "nixpkgs-2105": { "locked": { - "lastModified": 1640283157, - "narHash": "sha256-6Ddfop+rKE+Gl9Tjp9YIrkfoYPzb8F80ergdjcq3/MY=", + "lastModified": 1642244250, + "narHash": "sha256-vWpUEqQdVP4srj+/YLJRTN9vjpTs4je0cdWKXPbDItc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dde1557825c5644c869c5efc7448dc03722a8f09", + "rev": "0fd9ee1aa36ce865ad273f4f07fdc093adeb5c00", "type": "github" }, "original": { @@ -671,11 +829,11 @@ }, "nixpkgs-2111": { "locked": { - "lastModified": 1640283207, - "narHash": "sha256-SCwl7ZnCfMDsuSYvwIroiAlk7n33bW8HFfY8NvKhcPA=", + "lastModified": 1644510859, + "narHash": "sha256-xjpVvL5ecbyi0vxtVl/Fh9bwGlMbw3S06zE5nUzFB8A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64c7e3388bbd9206e437713351e814366e0c3284", + "rev": "0d1d5d7e3679fec9d07f2eb804d9f9fdb98378d3", "type": "github" }, "original": { @@ -685,29 +843,13 @@ "type": "github" } }, - "nixpkgs-nixops": { - "locked": { - "lastModified": 1630248577, - "narHash": "sha256-9d/yq96TTrnF7qjA6wPYk+rYjWAXwfUmwk3qewezSeg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "8d8a28b47b7c41aeb4ad01a2bd8b7d26986c3512", - "type": "github" - } - }, "nixpkgs-unstable": { "locked": { - "lastModified": 1641285291, - "narHash": "sha256-KYaOBNGar3XWTxTsYPr9P6u74KAqNq0wobEC236U+0c=", + "lastModified": 1644486793, + "narHash": "sha256-EeijR4guVHgVv+JpOX3cQO+1XdrkJfGmiJ9XVsVU530=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0432195a4b8d68faaa7d3d4b355260a3120aeeae", + "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292", "type": "github" }, "original": { @@ -719,16 +861,16 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1633463774, - "narHash": "sha256-y3GjapcRzd42NgebQ4sx5GFJ53dYqNdF3UQu7/t6mUg=", - "owner": "hercules-ci", + "lastModified": 1647297614, + "narHash": "sha256-ulGq3W5XsrBMU/u5k9d4oPy65pQTkunR4HKKtTq0RwY=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "c70f908fd1f129aede2744d4385fae57d2e252b1", + "rev": "73ad5f9e147c0d2a2061f1d4bd91e05078dc0b58", "type": "github" }, "original": { - "owner": "hercules-ci", - "ref": "init-nixops-hercules-ci", + "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -767,6 +909,30 @@ "type": "github" } }, + "pathtree": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1649011952, + "narHash": "sha256-RuNIoPXx0xy5TZ81JH33V8EqXWX5erv8gepM0Aaeat8=", + "owner": "srid", + "repo": "pathtree", + "rev": "d60f22b356f79663aca3f5fde9f23bb4a1412963", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "pathtree", + "type": "github" + } + }, "plutus": { "inputs": { "cardano-repo-tool": "cardano-repo-tool", @@ -774,44 +940,28 @@ "hackage-nix": "hackage-nix", "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", - "iohk-nix": "iohk-nix", + "iohk-nix": "iohk-nix_2", "nixpkgs": "nixpkgs_3", - "pre-commit-hooks-nix": "pre-commit-hooks-nix_2", + "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sphinxcontrib-haddock": "sphinxcontrib-haddock", "stackage-nix": "stackage-nix" }, "locked": { - "lastModified": 1642004499, - "narHash": "sha256-LMAMixBJRYZ5wgINjp4rb8hifEGkXptX8Z5e2Ip8HeM=", + "lastModified": 1645203653, + "narHash": "sha256-HAi60mSkyMXzu1Wg3h6KdYZg+ufNMvX6obfcLo0ArL0=", "owner": "L-as", "repo": "plutus", - "rev": "6cceda4793ee125dc700c63ff780593e387696b0", + "rev": "5ec17953aae3ac9546f6d923201eb1dbb4e058bb", "type": "github" }, "original": { "owner": "L-as", - "ref": "master", + "ref": "ghc9", "repo": "plutus", "type": "github" } }, "pre-commit-hooks-nix": { - "flake": false, - "locked": { - "lastModified": 1622650193, - "narHash": "sha256-qSzUpJDv04ajS9FXoCq6NjVF3qOt9IiGIiGh0P8amyw=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "0398f0649e0a741660ac5e8216760bae5cc78579", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "pre-commit-hooks-nix_2": { "flake": false, "locked": { "lastModified": 1624971177, @@ -847,19 +997,21 @@ "root": { "inputs": { "Shrinker": "Shrinker", - "Win32-network": "Win32-network", "cardano-base": "cardano-base", "cardano-crypto": "cardano-crypto", "cardano-prelude": "cardano-prelude", "cryptonite": "cryptonite", - "flake-compat": "flake-compat", - "flake-compat-ci": "flake-compat-ci", + "emanote": "emanote", "flat": "flat", "foundation": "foundation", "haskell-language-server": "haskell-language-server", "haskell-nix": "haskell-nix", "hercules-ci-effects": "hercules-ci-effects", "hs-memory": "hs-memory", + "hspec": "hspec", + "hspec-golden": "hspec-golden", + "hspec-hedgehog": "hspec-hedgehog", + "iohk-nix": "iohk-nix", "nixpkgs": [ "haskell-nix", "nixpkgs-unstable" @@ -906,11 +1058,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1642468901, - "narHash": "sha256-+Hu4m9i8v8Moey/C8fy8juyxB729JdsXz02cK8nJXLk=", + "lastModified": 1644887829, + "narHash": "sha256-tjUXJpqB7MMnqM4FF5cdtZipfratUcTKRQVA6F77sEQ=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "7544f8fd16bb92b7cf90cb51cb4ddc43173526de", + "rev": "db8bdef6588cf4f38e6069075ba76f0024381f68", "type": "github" }, "original": { @@ -935,6 +1087,39 @@ "type": "github" } }, + "tailwind-haskell": { + "inputs": { + "flake-compat": [ + "emanote", + "ema", + "flake-compat" + ], + "flake-utils": [ + "emanote", + "ema", + "flake-utils" + ], + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1649012698, + "narHash": "sha256-Kosm6SyTjbyD869o+qM4Zg7IUKdqRXq4FN/HCpXcflk=", + "owner": "srid", + "repo": "tailwind-haskell", + "rev": "f17cea75ad6a27976e9445eba9f77fa8d323885c", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "master", + "repo": "tailwind-haskell", + "type": "github" + } + }, "th-extras": { "flake": false, "locked": { @@ -951,6 +1136,31 @@ "rev": "787ed752c1e5d41b5903b74e171ed087de38bffa", "type": "github" } + }, + "unionmount": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_5", + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1649012450, + "narHash": "sha256-m0qlPd3jxjyDEkd7cQKLX0GT9a00qnvygec9GCBZ1hc=", + "owner": "srid", + "repo": "unionmount", + "rev": "27584567d9182c12018f988db899593a896f86ff", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "master", + "repo": "unionmount", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 8bb61d311..6d261720e 100644 --- a/flake.nix +++ b/flake.nix @@ -3,15 +3,12 @@ inputs.haskell-nix.url = "github:L-as/haskell.nix?ref=master"; inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; - inputs.flake-compat-ci.url = "github:hercules-ci/flake-compat-ci"; inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; - inputs.flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; - # https://github.com/input-output-hk/plutus/pull/4328 - inputs.plutus.url = "github:L-as/plutus?ref=master"; + inputs.iohk-nix.url = "github:input-output-hk/iohk-nix"; + inputs.iohk-nix.flake = false; + # we use sphinxcontrib-haddock input + inputs.plutus.url = "github:L-as/plutus?ref=ghc9"; # https://github.com/input-output-hk/cardano-prelude/pull/162 inputs.cardano-prelude.url = "github:locallycompact/cardano-prelude?rev=93f95047bb36a055bdd56fb0cafd887c072cdce2"; inputs.cardano-prelude.flake = false; @@ -22,9 +19,6 @@ # https://github.com/Quid2/flat/pull/27 inputs.flat.url = "github:Quid2/flat?rev=41a040c413351e021982bb78bd00f750628f8060"; inputs.flat.flake = false; - # https://github.com/input-output-hk/Win32-network/pull/10 - inputs.Win32-network.url = "github:input-output-hk/Win32-network?rev=2d1a01c7cbb9f68a1aefe2934aad6c70644ebfea"; - inputs.Win32-network.flake = false; # https://github.com/haskell-foundation/foundation/pull/555 inputs.foundation.url = "github:haskell-foundation/foundation?rev=0bb195e1fea06d144dafc5af9a0ff79af0a5f4a0"; inputs.foundation.flake = false; @@ -48,7 +42,18 @@ inputs.haskell-language-server.url = "github:haskell/haskell-language-server"; inputs.haskell-language-server.flake = false; - outputs = inputs@{ self, nixpkgs, haskell-nix, plutus, flake-compat, flake-compat-ci, hercules-ci-effects, ... }: + # https://github.com/hspec/hspec/pull/648 + inputs.hspec.url = "github:srid/hspec/askAncestors"; + inputs.hspec.flake = false; + # Overriding hspec (above) necessitates overriding these for some reason. + inputs.hspec-hedgehog.url = "github:parsonsmatt/hspec-hedgehog"; + inputs.hspec-hedgehog.flake = false; + inputs.hspec-golden.url = "github:stackbuilders/hspec-golden"; + inputs.hspec-golden.flake = false; + + inputs.emanote.url = "github:srid/emanote/master"; + + outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, hercules-ci-effects, ... }: let extraSources = [ { @@ -109,65 +114,88 @@ "word-array" ]; } + { + src = inputs.hspec; + subdirs = [ + "." + "hspec-core" + "hspec-contrib" + "hspec-discover" + ]; + } + { + src = inputs.hspec-hedgehog; + subdirs = [ "." ]; + } + { + src = inputs.hspec-golden; + subdirs = [ "." ]; + } ]; supportedSystems = with nixpkgs.lib.systems.supported; tier1 ++ tier2 ++ tier3; perSystem = nixpkgs.lib.genAttrs supportedSystems; - nixpkgsFor = system: import nixpkgs { inherit system; overlays = [ haskell-nix.overlay ]; inherit (haskell-nix) config; }; - nixpkgsFor' = system: import nixpkgs { inherit system; inherit (haskell-nix) config; }; + nixpkgsFor = system: import nixpkgs { + inherit system; + overlays = [ haskell-nix.overlay (import "${iohk-nix}/overlays/crypto") ]; + inherit (haskell-nix) config; + }; + nixpkgsFor' = system: import nixpkgs { inherit system; }; ghcVersion = "ghc921"; + # https://github.com/input-output-hk/haskell.nix/issues/1177 + nonReinstallablePkgs = [ + "rts" + "ghc-heap" + "ghc-prim" + "integer-gmp" + "integer-simple" + "base" + "deepseq" + "array" + "ghc-boot-th" + "pretty" + "template-haskell" + # ghcjs custom packages + "ghcjs-prim" + "ghcjs-th" + "ghc-bignum" + "exceptions" + "stm" + "ghc-boot" + "ghc" + "Cabal" + "Win32" + "array" + "binary" + "bytestring" + "containers" + "directory" + "filepath" + "ghc-boot" + "ghc-compact" + "ghc-prim" + # "ghci" "haskeline" + "hpc" + "mtl" + "parsec" + "process" + "text" + "time" + "transformers" + "unix" + "xhtml" + "terminfo" + ]; + tools.fourmolu = { }; tools.haskell-language-server = { - modules = [{ - # https://github.com/input-output-hk/haskell.nix/issues/1177 - nonReinstallablePkgs = [ - "rts" - "ghc-heap" - "ghc-prim" - "integer-gmp" - "integer-simple" - "base" - "deepseq" - "array" - "ghc-boot-th" - "pretty" - "template-haskell" - # ghcjs custom packages - "ghcjs-prim" - "ghcjs-th" - "ghc-bignum" - "exceptions" - "stm" - "ghc-boot" - "ghc" - "Cabal" - "Win32" - "array" - "binary" - "bytestring" - "containers" - "directory" - "filepath" - "ghc-boot" - "ghc-compact" - "ghc-prim" - # "ghci" "haskeline" - "hpc" - "mtl" - "parsec" - "process" - "text" - "time" - "transformers" - "unix" - "xhtml" - "terminfo" - ]; - }]; + modules = [ + { inherit nonReinstallablePkgs; } + ]; compiler-nix-name = ghcVersion; # For some reason it doesn't use the latest version automatically. index-state = @@ -182,13 +210,13 @@ primitive-unlifted < 1.0.0.0 package haskell-language-server - flags: +use-ghc-stub +pedantic +ignore-plugins-ghc-bounds -alternateNumberFormat -brittany -callhierarchy -class -eval -floskell -fourmolu -haddockComments -hlint -importLens -ormolu -refineImports -retrie -splice -stylishhaskell -tactic -importLens - + flags: +use-ghc-stub +pedantic +ignore-plugins-ghc-bounds -alternateNumberFormat -brittany -class -eval -haddockComments -hlint -retrie -splice -stylishhaskell -tactic ''; src = "${inputs.haskell-language-server}"; }; haskellModule = system: { + inherit nonReinstallablePkgs; # Needed only so we can use hspec; https://github.com/Plutonomicon/plutarch/issues/409 packages = { basement.src = "${inputs.foundation}/basement"; basement.components.library.postUnpack = "\n"; @@ -196,12 +224,12 @@ cardano-binary.ghcOptions = [ "-Wwarn" ]; cardano-binary.src = "${inputs.cardano-base}/binary"; cardano-binary.components.library.postUnpack = "\n"; - cardano-crypto-class.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ]; + cardano-crypto-class.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (nixpkgsFor system).libsodium-vrf ] ]; cardano-crypto-class.doHaddock = false; cardano-crypto-class.ghcOptions = [ "-Wwarn" ]; cardano-crypto-class.src = "${inputs.cardano-base}/cardano-crypto-class"; cardano-crypto-class.components.library.postUnpack = "\n"; - cardano-crypto-praos.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ]; + cardano-crypto-praos.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (nixpkgsFor system).libsodium-vrf ] ]; cardano-crypto.src = "${inputs.cardano-crypto}"; cardano-crypto.components.library.postUnpack = "\n"; cardano-prelude.doHaddock = false; # somehow above options are not applied? @@ -216,8 +244,8 @@ foundation.components.library.postUnpack = "\n"; memory.src = "${inputs.hs-memory}"; memory.components.library.postUnpack = "\n"; - plutus-core.src = "${inputs.plutus}/plutus-core"; - plutus-core.components.library.postUnpack = "\n"; + #plutus-core.src = "${inputs.plutus}/plutus-core"; + #plutus-core.components.library.postUnpack = "\n"; plutus-tx.src = "${inputs.plutus}/plutus-tx"; plutus-tx.components.library.postUnpack = "\n"; plutus-ledger-api.src = "${inputs.plutus}/plutus-ledger-api"; @@ -232,9 +260,6 @@ }; cabalProjectLocal = '' - package plutus-tx-plugin - flags: +use-ghc-stub - allow-newer: cardano-binary:base , cardano-crypto-class:base @@ -254,192 +279,200 @@ , size-based:template-haskell constraints: - OneTuple ^>= 0.3.1 - , Only ^>= 0.1 - , QuickCheck ^>= 2.14.2 - , StateVar ^>= 1.2.2 - , Stream ^>= 0.4.7.2 - , adjunctions ^>= 4.4 - , aeson ^>= 2.0.3.0 - , algebraic-graphs ^>= 0.6 - , ansi-terminal ^>= 0.11.1 - , ansi-wl-pprint ^>= 0.6.9 - , assoc ^>= 1.0.2 - , async ^>= 2.2.4 - , attoparsec ^>= 0.14.4 - , barbies ^>= 2.0.3.1 - , base-compat ^>= 0.12.1 - , base-compat-batteries ^>= 0.12.1 - , base-orphans ^>= 0.8.6 - , base16-bytestring ^>= 1.0.2.0 - , basement ^>= 0.0.12 - , bifunctors ^>= 5.5.11 - , bimap ^>= 0.4.0 - , bin ^>= 0.1.2 - , boring ^>= 0.2 - , boxes ^>= 0.1.5 - , cabal-doctest ^>= 1.0.9 - , call-stack ^>= 0.4.0 - , canonical-json ^>= 0.6.0.0 - , cardano-binary ^>= 1.5.0 - , cardano-crypto ^>= 1.1.0 - , cardano-crypto-class ^>= 2.0.0 - , cardano-prelude ^>= 0.1.0.0 - , case-insensitive ^>= 1.2.1.0 - , cassava ^>= 0.5.2.0 - , cborg ^>= 0.2.6.0 - , clock ^>= 0.8.2 - , colour ^>= 2.3.6 - , comonad ^>= 5.0.8 - , composition-prelude ^>= 3.0.0.2 - , concurrent-output ^>= 1.10.14 - , constraints ^>= 0.13.2 - , constraints-extras ^>= 0.3.2.1 - , contravariant ^>= 1.5.5 - , cryptonite ^>= 0.29 - , data-default ^>= 0.7.1.1 - , data-default-class ^>= 0.1.2.0 - , data-default-instances-containers ^>= 0.0.1 - , data-default-instances-dlist ^>= 0.0.1 - , data-default-instances-old-locale ^>= 0.0.1 - , data-fix ^>= 0.3.2 - , dec ^>= 0.0.4 - , dependent-map ^>= 0.4.0.0 - , dependent-sum ^>= 0.7.1.0 - , dependent-sum-template ^>= 0.1.1.1 - , deriving-aeson ^>= 0.2.8 - , deriving-compat ^>= 0.6 - , dictionary-sharing ^>= 0.1.0.0 - , distributive ^>= 0.6.2.1 - , dlist ^>= 1.0 - , dom-lt ^>= 0.2.3 - , double-conversion ^>= 2.0.2.0 - , erf ^>= 2.0.0.0 - , exceptions ^>= 0.10.4 - , extra ^>= 1.7.10 - , fin ^>= 0.2.1 - , flat ^>= 0.4.5 - , foldl ^>= 1.4.12 - , formatting ^>= 7.1.3 - , foundation ^>= 0.0.26.1 - , free ^>= 5.1.7 - , half ^>= 0.3.1 - , hashable ^>= 1.4.0.2 - , haskell-lexer ^>= 1.1 - , hedgehog ^>= 1.0.5 - , indexed-traversable ^>= 0.1.2 - , indexed-traversable-instances ^>= 0.1.1 - , integer-logarithms ^>= 1.0.3.1 - , invariant ^>= 0.5.5 - , kan-extensions ^>= 5.2.3 - , lazy-search ^>= 0.1.2.1 - , lazysmallcheck ^>= 0.6 - , lens ^>= 5.1 - , lifted-async ^>= 0.10.2.2 - , lifted-base ^>= 0.2.3.12 - , list-t ^>= 1.0.5.1 - , logict ^>= 0.7.0.3 - , megaparsec ^>= 9.2.0 - , memory ^>= 0.16.0 - , microlens ^>= 0.4.12.0 - , mmorph ^>= 1.2.0 - , monad-control ^>= 1.0.3.1 - , mono-traversable ^>= 1.0.15.3 - , monoidal-containers ^>= 0.6.2.0 - , mtl-compat ^>= 0.2.2 - , newtype ^>= 0.2.2.0 - , newtype-generics ^>= 0.6.1 - , nothunks ^>= 0.1.3 - , old-locale ^>= 1.0.0.7 - , old-time ^>= 1.1.0.3 - , optparse-applicative ^>= 0.16.1.0 - , parallel ^>= 3.2.2.0 - , parser-combinators ^>= 1.3.0 - , plutus-core ^>= 0.1.0.0 - , plutus-ledger-api ^>= 0.1.0.0 - , plutus-tx ^>= 0.1.0.0 - , pretty-show ^>= 1.10 - , prettyprinter ^>= 1.7.1 - , prettyprinter-configurable ^>= 0.1.0.0 - , primitive ^>= 0.7.3.0 - , profunctors ^>= 5.6.2 - , protolude ^>= 0.3.0 - , quickcheck-instances ^>= 0.3.27 - , ral ^>= 0.2.1 - , random ^>= 1.2.1 - , rank2classes ^>= 1.4.4 - , recursion-schemes ^>= 5.2.2.2 - , reflection ^>= 2.1.6 - , resourcet ^>= 1.2.4.3 - , safe ^>= 0.3.19 - , safe-exceptions ^>= 0.1.7.2 - , scientific ^>= 0.3.7.0 - , semialign ^>= 1.2.0.1 - , semigroupoids ^>= 5.3.7 - , semigroups ^>= 0.20 - , serialise ^>= 0.2.4.0 - , size-based ^>= 0.1.2.0 - , some ^>= 1.0.3 - , split ^>= 0.2.3.4 - , splitmix ^>= 0.1.0.4 - , stm ^>= 2.5.0.0 - , strict ^>= 0.4.0.1 - , syb ^>= 0.7.2.1 - , tagged ^>= 0.8.6.1 - , tasty ^>= 1.4.2.1 - , tasty-golden ^>= 2.3.5 - , tasty-hedgehog ^>= 1.1.0.0 - , tasty-hunit ^>= 0.10.0.3 - , temporary ^>= 1.3 - , terminal-size ^>= 0.3.2.1 - , testing-type-modifiers ^>= 0.1.0.1 - , text-short ^>= 0.1.5 - , th-abstraction ^>= 0.4.3.0 - , th-compat ^>= 0.1.3 - , th-expand-syns ^>= 0.4.9.0 - , th-extras ^>= 0.0.0.6 - , th-lift ^>= 0.8.2 - , th-lift-instances ^>= 0.1.19 - , th-orphans ^>= 0.13.12 - , th-reify-many ^>= 0.1.10 - , th-utilities ^>= 0.2.4.3 - , these ^>= 1.1.1.1 - , time-compat ^>= 1.9.6.1 - , transformers-base ^>= 0.4.6 - , transformers-compat ^>= 0.7.1 - , type-equality ^>= 1 - , typed-process ^>= 0.2.8.0 - , unbounded-delays ^>= 0.1.1.1 - , universe-base ^>= 1.1.3 - , unliftio-core ^>= 0.2.0.1 - , unordered-containers ^>= 0.2.16.0 - , uuid-types ^>= 1.0.5 - , vector ^>= 0.12.3.1 - , vector-algorithms ^>= 0.8.0.4 - , void ^>= 0.7.3 - , wcwidth ^>= 0.0.2 - , witherable ^>= 0.4.2 - , wl-pprint-annotated ^>= 0.1.0.1 - , word-array ^>= 0.1.0.0 + OneTuple >= 0.3.1 + , Only >= 0.1 + , QuickCheck >= 2.14.2 + , StateVar >= 1.2.2 + , Stream >= 0.4.7.2 + , adjunctions >= 4.4 + , aeson >= 2.0.3.0 + , algebraic-graphs >= 0.6 + , ansi-terminal >= 0.11.1 + , ansi-wl-pprint >= 0.6.9 + , assoc >= 1.0.2 + , async >= 2.2.4 + , attoparsec >= 0.14.4 + , barbies >= 2.0.3.1 + , base-compat >= 0.12.1 + , base-compat-batteries >= 0.12.1 + , base-orphans >= 0.8.6 + , base16-bytestring >= 1.0.2.0 + , basement >= 0.0.12 + , bifunctors >= 5.5.11 + , bimap >= 0.4.0 + , bin >= 0.1.2 + , boring >= 0.2 + , boxes >= 0.1.5 + , cabal-doctest >= 1.0.9 + , call-stack >= 0.4.0 + , canonical-json >= 0.6.0.0 + , cardano-binary >= 1.5.0 + , cardano-crypto >= 1.1.0 + , cardano-crypto-class >= 2.0.0 + , cardano-prelude >= 0.1.0.0 + , case-insensitive >= 1.2.1.0 + , cassava >= 0.5.2.0 + , cborg >= 0.2.6.0 + , clock >= 0.8.2 + , colour >= 2.3.6 + , comonad >= 5.0.8 + , composition-prelude >= 3.0.0.2 + , concurrent-output >= 1.10.14 + , constraints >= 0.13.2 + , constraints-extras >= 0.3.2.1 + , contravariant >= 1.5.5 + , cryptonite >= 0.29 + , data-default >= 0.7.1.1 + , data-default-class >= 0.1.2.0 + , data-default-instances-containers >= 0.0.1 + , data-default-instances-dlist >= 0.0.1 + , data-default-instances-old-locale >= 0.0.1 + , data-fix >= 0.3.2 + , dec >= 0.0.4 + , dependent-map >= 0.4.0.0 + , dependent-sum >= 0.7.1.0 + , dependent-sum-template >= 0.1.1.1 + , deriving-aeson >= 0.2.8 + , deriving-compat >= 0.6 + , dictionary-sharing >= 0.1.0.0 + , distributive >= 0.6.2.1 + , dlist >= 1.0 + , dom-lt >= 0.2.3 + , double-conversion >= 2.0.2.0 + , erf >= 2.0.0.0 + , exceptions >= 0.10.4 + , extra >= 1.7.10 + , fin >= 0.2.1 + , flat >= 0.4.5 + , foldl >= 1.4.12 + , formatting >= 7.1.3 + , foundation >= 0.0.26.1 + , free >= 5.1.7 + , half >= 0.3.1 + , hashable >= 1.4.0.2 + , haskell-lexer >= 1.1 + , hedgehog >= 1.0.5 + , indexed-traversable >= 0.1.2 + , indexed-traversable-instances >= 0.1.1 + , integer-logarithms >= 1.0.3.1 + , invariant >= 0.5.5 + , kan-extensions >= 5.2.3 + , lazy-search >= 0.1.2.1 + , lazysmallcheck >= 0.6 + , lens >= 5.1 + , lifted-async >= 0.10.2.2 + , lifted-base >= 0.2.3.12 + , list-t >= 1.0.5.1 + , logict >= 0.7.0.3 + , megaparsec >= 9.2.0 + , memory >= 0.16.0 + , microlens >= 0.4.12.0 + , mmorph >= 1.2.0 + , monad-control >= 1.0.3.1 + , mono-traversable >= 1.0.15.3 + , monoidal-containers >= 0.6.2.0 + , mtl-compat >= 0.2.2 + , newtype >= 0.2.2.0 + , newtype-generics >= 0.6.1 + , nothunks >= 0.1.3 + , old-locale >= 1.0.0.7 + , old-time >= 1.1.0.3 + , optparse-applicative >= 0.16.1.0 + , parallel >= 3.2.2.0 + , parser-combinators >= 1.3.0 + , plutus-core >= 0.1.0.0 + , plutus-ledger-api >= 0.1.0.0 + , plutus-tx >= 0.1.0.0 + , pretty-show >= 1.10 + , prettyprinter >= 1.7.1 + , prettyprinter-configurable >= 0.1.0.0 + , primitive >= 0.7.3.0 + , profunctors >= 5.6.2 + , protolude >= 0.3.0 + , quickcheck-instances >= 0.3.27 + , ral >= 0.2.1 + , random >= 1.2.1 + , rank2classes >= 1.4.4 + , recursion-schemes >= 5.2.2.2 + , reflection >= 2.1.6 + , resourcet >= 1.2.4.3 + , safe >= 0.3.19 + , safe-exceptions >= 0.1.7.2 + , scientific >= 0.3.7.0 + , semialign >= 1.2.0.1 + , semigroupoids >= 5.3.7 + , semigroups >= 0.20 + , serialise >= 0.2.4.0 + , size-based >= 0.1.2.0 + , some >= 1.0.3 + , split >= 0.2.3.4 + , splitmix >= 0.1.0.4 + , stm >= 2.5.0.0 + , strict >= 0.4.0.1 + , syb >= 0.7.2.1 + , tagged >= 0.8.6.1 + , tasty >= 1.4.2.1 + , tasty-golden >= 2.3.5 + , tasty-hedgehog >= 1.1.0.0 + , tasty-hunit >= 0.10.0.3 + , temporary >= 1.3 + , terminal-size >= 0.3.2.1 + , testing-type-modifiers >= 0.1.0.1 + , text-short >= 0.1.5 + , th-abstraction >= 0.4.3.0 + , th-compat >= 0.1.3 + , th-expand-syns >= 0.4.9.0 + , th-extras >= 0.0.0.6 + , th-lift >= 0.8.2 + , th-lift-instances >= 0.1.19 + , th-orphans >= 0.13.12 + , th-reify-many >= 0.1.10 + , th-utilities >= 0.2.4.3 + , these >= 1.1.1.1 + , time-compat >= 1.9.6.1 + , transformers-base >= 0.4.6 + , transformers-compat >= 0.7.1 + , type-equality >= 1 + , typed-process >= 0.2.8.0 + , unbounded-delays >= 0.1.1.1 + , universe-base >= 1.1.3 + , unliftio-core >= 0.2.0.1 + , unordered-containers >= 0.2.16.0 + , uuid-types >= 1.0.5 + , vector >= 0.12.3.1 + , vector-algorithms >= 0.8.0.4 + , void >= 0.7.3 + , wcwidth >= 0.0.2 + , witherable >= 0.4.2 + , wl-pprint-annotated >= 0.1.0.1 + , word-array >= 0.1.0.0 ''; projectForGhc = ghcName: flagDevelopment: system: let pkgs = nixpkgsFor system; in let pkgs' = nixpkgsFor' system; in - (nixpkgsFor system).haskell-nix.cabalProject' ({ - # This is truly a horrible hack but is necessary. We can't disable tests otherwise in haskell.nix. - src = if ghcName == ghcVersion then ./. else - pkgs.runCommand "fake-src" { } '' - cp -rT ${./.} $out - chmod u+w $out $out/plutarch.cabal - # Remove stanzas from .cabal that won't work in GHC 8.10 - sed -i '/-- Everything below this line is deleted for GHC 8.10/,$d' $out/plutarch.cabal - ''; + let addSubDir = target: subdir: source: + if source.src == target + then source // { subdirs = source.subdirs ++ [ subdir ]; } + else source; in + let pkgSet = (nixpkgsFor system).haskell-nix.cabalProject' ({ + src = ./.; compiler-nix-name = ghcName; - inherit extraSources; + extraSources = + if ghcName == ghcVersion then extraSources + else map (addSubDir inputs.plutus "plutus-tx-plugin") extraSources + ++ [{ + src = inputs.Shrinker; + subdirs = [ "." ]; + }]; modules = [ (haskellModule system) { + # Workaround missing support for build-tools: + # https://github.com/input-output-hk/haskell.nix/issues/231 + packages.plutarch-test.components.exes.plutarch-test.build-tools = [ + pkgSet.hsPkgs.hspec-discover + ]; packages.plutarch-test.flags.development = flagDevelopment; packages.plutarch.flags.development = flagDevelopment; } @@ -456,19 +489,28 @@ pkgs'.hlint pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt + pkgSet.hsPkgs.hspec-discover.components.exes.hspec-discover ]; inherit tools; additional = ps: [ ps.plutus-ledger-api + + ps.hspec + ps.hspec-core + ps.hspec-contrib + ps.hspec-discover + ps.hspec-hedgehog + ps.hspec-golden #ps.shrinker #ps.shrinker-testing ]; }; } // (if ghcName == ghcVersion then { inherit cabalProjectLocal; - } else { })); + } else { })); in + pkgSet; projectFor = projectForGhc ghcVersion; projectFor810 = projectForGhc "ghc8107"; @@ -528,6 +570,35 @@ ''; }; }; + plutarchWebsiteStatic = system: + let + pkgs = nixpkgsFor system; + configFile = (pkgs.formats.yaml { }).generate "emanote-configFile" { + template.baseUrl = "/"; # Use this when pushing to github.io: "/plutarch/"; + }; + configDir = pkgs.runCommand "emanote-configDir" { } '' + mkdir -p $out + cp ${configFile} $out/index.yaml + ''; + in + pkgs.runCommand "plutarch-docs-html" { } + '' + mkdir $out + ${inputs.emanote.defaultPackage.${system}}/bin/emanote \ + --layers "${self}/docs;${configDir}" \ + gen $out + ''; + plutarchWebsiteLive = system: path: + rec { + type = "app"; + # '' is required for escaping ${} in nix + script = (nixpkgsFor system).writers.writeBash "emanoteLiveReload.sh" '' + set -xe + export PORT="''${EMANOTE_PORT:-7072}" + ${inputs.emanote.defaultPackage.${system}}/bin/emanote --layers ${path} run --port "$PORT" + ''; + program = builtins.toString script; + }; # Checks the shell script using ShellCheck checkedShellScript = system: name: text: @@ -542,7 +613,7 @@ in { type = "app"; - program = checkedShellScript system "plutatch-test-${name}" + program = checkedShellScript system "plutarch-test-${name}" '' cd ${self}/plutarch-test ${flake.packages."plutarch-test:exe:plutarch-test"}/bin/plutarch-test; @@ -551,7 +622,7 @@ # Take a flake app (identified as the key in the 'apps' set), and return a # derivation that runs it in the compile phase. - # + # # In effect, this allows us to run an 'app' as part of the build process (eg: in CI). flakeApp2Derivation = system: appName: (nixpkgsFor system).runCommand appName { } "${self.apps.${system}.${appName}.program} | tee $out"; @@ -579,22 +650,22 @@ packages = perSystem (system: self.flake.${system}.packages // { haddock = haddock system; + website = plutarchWebsiteStatic system; }); checks = perSystem (system: self.flake.${system}.checks // { formatCheck = formatCheckFor system; - benchmark = (nixpkgsFor system).runCommand "benchmark" { } "${self.apps.${system}.benchmark.program} | tee $out"; test-ghc9-nodev = flakeApp2Derivation system "test-ghc9-nodev"; test-ghc9-dev = flakeApp2Derivation system "test-ghc9-dev"; test-ghc810-nodev = flakeApp2Derivation system "test-ghc810-nodev"; test-ghc810-dev = flakeApp2Derivation system "test-ghc810-dev"; "ghc810-plutarch:lib:plutarch" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch:lib:plutarch"; "ghc810-plutarch:lib:plutarch-test" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch-test:lib:plutarch-test"; - "ghc810-plutarch:lib:plutarch-benchmark" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch-benchmark:lib:plutarch-benchmark"; + hls = checkedShellScript system "hls" "${self.project.${system}.pkgs.haskell-language-server}/bin/haskell-language-server"; }); - # Because `nix flake check` does not work with haskell.nix (due to IFD), + # Because `nix flake check` does not work with haskell.nix (due to IFD), # we provide this attribute for running the checks locally, using: # nix build .#check.x86_64-linux check = perSystem (system: @@ -614,55 +685,22 @@ test-ghc9-dev = plutarchTestApp system "ghc9-dev" self.projectMatrix.ghc9.dev; test-ghc810-nodev = plutarchTestApp system "ghc810-nodev" self.projectMatrix.ghc810.nodev; test-ghc810-dev = plutarchTestApp system "ghc810-dev" self.projectMatrix.ghc810.dev; - # TODO: The bellow apps will be removed eventually. - benchmark = { - type = "app"; - program = "${self.flake.${system}.packages."plutarch-benchmark:bench:benchmark"}/bin/benchmark"; - }; - benchmark-diff = { - type = "app"; - program = "${self.flake.${system}.packages."plutarch-benchmark:exe:benchmark-diff"}/bin/benchmark-diff"; - }; + + # `nix run .#docs` should be run from the Git repo. + docs = plutarchWebsiteLive system "./docs"; + # `nix run github:Plutonomicon/plutarch#website` can be run from anywhere + website = plutarchWebsiteLive system "${self}/docs"; } ); devShell = perSystem (system: self.flake.${system}.devShell); - effects = { src }: + effects = { ref, ... }: let pkgs = nixpkgs.legacyPackages.x86_64-linux; hci-effects = hercules-ci-effects.lib.withPkgs pkgs; in { - # Hercules 0.9 will allow us to calculate the merge-base so we can test all PRs. - # Right now we just hardcode this effect to test every commit against - # origin/staging. We set != "refs/head/master" so that merges into master don't - # cause a lot of unnecessary bogus benchmarks to appear in CI for the time - # being. - benchmark-diff = hci-effects.runIf (src.ref != "refs/heads/master") ( - hci-effects.mkEffect { - src = self; - buildInputs = with pkgs; [ git nixFlakes ]; - effectScript = '' - git clone https://github.com/Plutonomicon/plutarch.git plutarch - cd plutarch - - git checkout $(git merge-base origin/staging ${src.rev}) - nix --extra-experimental-features 'nix-command flakes' run .#benchmark -- --csv > before.csv - - git checkout ${src.rev} - nix --extra-experimental-features 'nix-command flakes' run .#benchmark -- --csv > after.csv - - echo - echo - echo "Benchmark diff between $(git merge-base origin/staging ${src.rev}) and ${src.rev}:" - echo - echo - - nix --extra-experimental-features 'nix-command flakes' run .#benchmark-diff -- before.csv after.csv - ''; - } - ); - gh-pages = hci-effects.runIf (src.ref == "refs/heads/master") ( + gh-pages = hci-effects.runIf (ref == "refs/heads/master") ( hci-effects.mkEffect { src = self; buildInputs = with pkgs; [ openssh git ]; @@ -689,11 +727,6 @@ } ); }; - - ciNix = args@{ src }: flake-compat-ci.lib.recurseIntoFlakeWith { - flake = self; - systems = [ "x86_64-linux" ]; - effectsArgs = args; - }; + herculesCI.ciSystems = [ "x86_64-linux" ]; }; } diff --git a/plutarch-benchmark/README.md b/plutarch-benchmark/README.md deleted file mode 100644 index cbbf2d9d8..000000000 --- a/plutarch-benchmark/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# `plutarch-benchmark` - -**NOTE**: These benchmarks will soon be removed, to be replaced by the golden tests in `./plutarch-test`. - -```sh -# If running from repo root: -cabal bench plutarch-benchmark -# Or, if running from this sub directory: -cabal bench -``` - -This will write the benchmark report to `bench.csv` as well as output a table view of the same. - -## Benchmarking a commit -To run benchmarks on a particular commit, - -``` -nix run github:Plutonomicon/plutarch/#benchmark -``` - -You can also emit a `.csv` file into stdout by passing the `--csv` flag: - -``` -nix run github:Plutonomicon/plutarch/#benchmark -- --csv -``` - -## Benchmarking in CI - -Note that you can also view these benchmarks on a per-commit basis by looking at Hercules CI logs. Go to the Hercules CI job run for a given commit, and navigate to the `checks.x86_64-linux.benchmark` page in the Attributes table, and then click on the "Log" header to view its output. - -Additionally, a Hercules Effect to diff benchmarks between commits is created for PRs into staging. This is findable from the effects link on the PR. - -## Diffing two `.csv` files - -You can diff two previous result files using the `benchmark-diff` binary: - -``` -nix run .#benchmark-diff -- -``` diff --git a/plutarch-benchmark/bench/Main.hs b/plutarch-benchmark/bench/Main.hs deleted file mode 100644 index 781ce8f12..000000000 --- a/plutarch-benchmark/bench/Main.hs +++ /dev/null @@ -1,427 +0,0 @@ -{-# LANGUAGE QualifiedDo #-} - -module Main (main) where - -import Control.Monad.Trans.Cont (cont, runCont) -import Data.ByteString (ByteString) -import Plutarch (ClosedTerm) -import Plutarch.Api.V1 -import Plutarch.Benchmark (NamedBenchmark, bench, bench', benchGroup, benchMain) -import Plutarch.Bool -import Plutarch.Builtin -import qualified Plutarch.List as List -import qualified Plutarch.Monadic as P -import Plutarch.Prelude -import Plutus.V1.Ledger.Address (Address (Address)) -import Plutus.V1.Ledger.Api (DCert (DCertGenesis), toData) -import Plutus.V1.Ledger.Contexts (ScriptPurpose (Certifying, Minting, Rewarding, Spending), TxOutRef (TxOutRef)) -import Plutus.V1.Ledger.Credential ( - Credential (PubKeyCredential, ScriptCredential), - StakingCredential (StakingPtr), - ) - -main :: IO () -main = do - benchMain benchmarks - -benchmarks :: [NamedBenchmark] -benchmarks = - benchGroup - "types" - [ benchGroup "int" integerBench - , benchGroup "bool" boolBench - , benchGroup "builtin:intlist" intListBench - , benchGroup "data" dataBench - , benchGroup "syn" syntaxBench - ] - -integerBench :: [[NamedBenchmark]] -integerBench = - [ -- Calling add twice - benchGroup - "add(2)" - $ let addInlined :: Term s PInteger -> Term s PInteger -> Term s PInteger - addInlined x y = x + y + 1 - addUnhoisted :: Term s (PInteger :--> PInteger :--> PInteger) - addUnhoisted = plam $ \x y -> x + y + 1 - addHoisted :: Term s (PInteger :--> PInteger :--> PInteger) - addHoisted = phoistAcyclic $ plam $ \x y -> x + y + 1 - in [ bench "inlined" $ addInlined 12 32 + addInlined 5 4 - , bench "unhoist" $ addUnhoisted # 12 # 32 + addUnhoisted # 5 # 4 - , bench "hoisted" $ addHoisted # 12 # 32 + addHoisted # 5 # 4 - ] - ] - -boolBench :: [[NamedBenchmark]] -boolBench = - let true = pconstant @PBool True - false = pconstant @PBool False - pandNoHoist = phoistAcyclic $ plam $ \x y -> pif' # x # y # (pdelay $ pcon PFalse) - in [ benchGroup - "and" - [ bench "strict" $ pand' # true # false - , bench "lazy" $ (#&&) true false - , -- Calling `pand` twice. - bench "pand(2)" $ - let x = pand # true # pdelay false - in pand # true # x - , bench "pand(2):unhoisted" $ - let x = pandNoHoist # true # pdelay false - in pandNoHoist # true # x - ] - ] - -intListBench :: [[NamedBenchmark]] -intListBench = - let numList = pconstant @(PBuiltinList PInteger) [1 .. 5] - in [ bench "phead" $ List.phead # numList - , bench "ptail" $ List.ptail # numList - , -- Accessing the first two elements, and adds them. - benchGroup - "x1+x2" - [ -- Via HeadList and TailList only - bench "builtin" $ - (List.phead #$ List.ptail # numList) + (List.phead # numList) - , -- Via ChooseList (twice invoked) - bench "pmatch" $ - pmatch numList $ \case - PNil -> perror - PCons x xs -> - pmatch xs $ \case - PNil -> perror - PCons y _ -> - x + y - ] - , -- Various ways to uncons a list - benchGroup - "uncons" - [ -- ChooseList builtin, like uncons but fails on null lists - bench "ChooseList" $ - pmatch numList $ \case - PNil -> perror - PCons _x xs -> - xs - , -- Retrieving head and tail of a list - bench "head-and-tail" $ - plet (List.phead # numList) $ \_x -> - List.ptail # numList - , -- Retrieve head and tail using builtins, but fail on null lists. - bench "head-and-tail-and-null" $ - plet (List.pnull # numList) $ \isEmpty -> - pmatch isEmpty $ \case - PTrue -> perror - PFalse -> plet (List.phead # numList) $ \_x -> - List.ptail # numList - ] - , bench - "plength" - $ List.plength # pconstant @(PBuiltinList PInteger) [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] - , bench - "pelem" - $ List.pelem # 1 # pconstant @(PBuiltinList PInteger) [5, 2, 3, 4, 7, 5, 1, 6, 2] - , bench - "pall" - $ List.pall @PBuiltinList @PInteger # plam (const $ pconstant @PBool False) # pconstant [1, 2, 3, 4, 5, 6] - , benchGroup - "plistEquals" - [ bench "==(n=3)" $ List.plistEquals @PBuiltinList @PInteger # pconstant [1, 2, 3] # pconstant [1, 2, 3] - , bench "/=(n=4)" $ List.plistEquals @PBuiltinList @PInteger # pconstant [1, 2, 3, 4] # pconstant [1, 2, 3] - , bench "/=(empty;n=3)" $ List.plistEquals @PBuiltinList @PInteger # pconstant [] # pconstant [1, 2, 3] - ] - , benchGroup - "primitives" - [ bench' $ plam $ \_ -> pconstant True - , bench' $ plam $ \_ -> (0 :: Term _ PInteger) - , bench' $ plam $ \_ -> (1 :: Term _ PInteger) - , bench' $ plam $ \_ -> (512 :: Term _ PInteger) - , bench' $ plam $ \_ -> (1048576 :: Term _ PInteger) - , bench' $ plam $ \_ -> pconstant ("1" :: ByteString) - , bench' $ plam $ \_ -> pconstant ("1111111" :: ByteString) - , bench' $ plam $ \_ -> pconstant ([()] :: [()]) - , bench' $ plam $ \_ -> pconstant () - , bench' $ pconstant () - , bench' $ plam $ \x -> x - , bench' $ plam $ \_ -> (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) - , bench' $ (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) - ] - ] - -dataBench :: [[NamedBenchmark]] -dataBench = - [ benchGroup "deconstruction" deconstrBench - , benchGroup - "pmatch-pfield" - -- These two should ideally have the exact same efficiency. - [ benchGroup - "pmatch" - [ bench "newtype" $ P.do - let addr = pconstant $ Address (PubKeyCredential "ab") Nothing - PAddress addrFields <- pmatch addr - y <- pletFields @'["credential", "stakingCredential"] addrFields - ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y - ] - , benchGroup - "pfield" - [ bench "newtype" $ P.do - let addr = pconstant $ Address (PubKeyCredential "ab") Nothing - y <- pletFields @'["credential", "stakingCredential"] addr - ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y - ] - ] - , benchGroup - "pfield-pletFields" - -- These two should ideally have the exact same efficiency. - [ benchGroup - "pfield" - [ bench "single" $ P.do - let addr = pconstant $ Address (PubKeyCredential "ab") Nothing - pfromData $ pfield @"credential" # addr - ] - , benchGroup - "pletFields" - [ bench "single" $ P.do - let addr = pconstant $ Address (PubKeyCredential "ab") Nothing - y <- pletFields @'["credential"] addr - pfromData $ hrecField @"credential" y - ] - ] - ] - -{- | For comparing typed and untyped data deconstruction approaches. - -We ideally want the typed and raw versions to have as little deviation as possible. --} -deconstrBench :: [[NamedBenchmark]] -deconstrBench = - [ benchGroup - "matching" - $ [ benchGroup - "typed" - [ bench "newtype" $ - plam - ( \x -> P.do - PAddress addrFields <- pmatch x - addrFields - ) - # pconstant addrPC - , bench "sumtype(ignore-fields)" $ - plam - ( \x -> P.do - PMinting _ <- pmatch x - pconstant () - ) - # pconstant minting - , bench "sumtype(partial-match)" $ - plam - ( \x -> P.do - PMinting hs <- pmatch x - hs - ) - # pconstant minting - , benchGroup "sumtype(exhaustive)" $ - benchPurpose $ - plam - ( \x -> P.do - purp <- pmatch x - case purp of - PMinting f -> plet f $ const $ phexByteStr "01" - PSpending f -> plet f $ const $ phexByteStr "02" - PRewarding f -> plet f $ const $ phexByteStr "03" - PCertifying f -> plet f $ const $ phexByteStr "04" - ) - , benchGroup "sumtype(exhaustive)(ignore-fields)" $ - benchPurpose $ - plam - ( \x -> P.do - purp <- pmatch x - case purp of - PMinting _ -> phexByteStr "01" - PSpending _ -> phexByteStr "02" - PRewarding _ -> phexByteStr "03" - PCertifying _ -> phexByteStr "04" - ) - ] - , benchGroup - "raw" - [ bench "newtype" $ - plam - ( \x -> - psndBuiltin #$ pasConstr # x - ) - #$ pconstant - $ toData addrPC - , bench "sumtype(ignore-fields)" $ - plam - ( \x -> - pif - ((pfstBuiltin #$ pasConstr # x) #== 0) - (pconstant ()) - perror - ) - #$ pconstant - $ toData minting - , bench "sumtype(partial-match)" $ - plam - ( \x -> - plet (pasConstr # x) $ \d -> - pif - (pfstBuiltin # d #== 0) - (psndBuiltin # d) - perror - ) - #$ pconstant - $ toData minting - , benchGroup "sumtype(exhaustive)" $ - benchPurpose' $ - plam - ( \x -> P.do - d <- plet $ pasConstr # x - constr <- plet $ pfstBuiltin # d - _ <- plet $ psndBuiltin # d - pif - (constr #== 1) - (phexByteStr "02") - $ pif - (constr #== 2) - (phexByteStr "03") - $ pif - (constr #== 3) - (phexByteStr "04") - $ phexByteStr "01" - ) - , benchGroup "sumtype(exhaustive)(ignore-fields)" $ - benchPurpose' $ - plam - ( \x -> P.do - constr <- plet $ pfstBuiltin #$ pasConstr # x - pif - (constr #== 1) - (phexByteStr "02") - $ pif - (constr #== 2) - (phexByteStr "03") - $ pif - (constr #== 3) - (phexByteStr "04") - $ phexByteStr "01" - ) - ] - ] - , benchGroup - "fields" - $ [ benchGroup - "typed" - [ bench "extract-single" $ - plam - ( \x -> - pfield @"credential" # x - ) - # pconstant addrSC - ] - , benchGroup - "raw" - [ bench "extract-single" $ - plam - ( \x -> - phead #$ psndBuiltin #$ pasConstr # x - ) - #$ pconstant - $ toData addrSC - ] - ] - , benchGroup - "combined" - [ benchGroup - "typed" - [ bench "toValidatorHash" $ - plam - ( \x -> P.do - cred <- pmatch . pfromData $ pfield @"credential" # x - case cred of - PPubKeyCredential _ -> pcon PNothing - PScriptCredential credFields -> pcon . PJust $ pto $ pfromData $ pfield @"_0" # credFields - ) - # pconstant addrSC - ] - , benchGroup - "raw" - [ bench "toValidatorHash" $ - plam - ( \x -> - P.do - let cred = phead #$ psndBuiltin #$ pasConstr # x - deconstrCred <- plet $ pasConstr # cred - pif - (pfstBuiltin # deconstrCred #== 0) - (pcon PNothing) - $ pcon . PJust $ pasByteStr #$ phead #$ psndBuiltin # deconstrCred - ) - #$ pconstant - $ toData addrSC - ] - ] - ] - where - addrSC = Address (ScriptCredential "ab") Nothing - addrPC = Address (PubKeyCredential "ab") Nothing - minting = Minting "" - spending = Spending (TxOutRef "ab" 0) - rewarding = Rewarding (StakingPtr 42 0 7) - certifying = Certifying DCertGenesis - -- Bench given function feeding in all 4 types of script purpose (typed). - benchPurpose :: ClosedTerm (PScriptPurpose :--> PByteString) -> [[NamedBenchmark]] - benchPurpose f = - [ bench "minting" $ f # pconstant minting - , bench "spending" $ f # pconstant spending - , bench "rewarding" $ f # pconstant rewarding - , bench "certifying" $ f # pconstant certifying - ] - - -- Bench given function feeding in all 4 types of script purpose (untyped). - benchPurpose' :: ClosedTerm (PData :--> PByteString) -> [[NamedBenchmark]] - benchPurpose' f = - [ bench "minting" $ f #$ pconstant $ toData minting - , bench "spending" $ f #$ pconstant $ toData spending - , bench "rewarding" $ f #$ pconstant $ toData rewarding - , bench "certifying" $ f #$ pconstant $ toData certifying - ] - --- | Nested lambda, vs do-syntax vs cont monad. -syntaxBench :: [[NamedBenchmark]] -syntaxBench = - let integerList :: [Integer] -> Term s (PList PInteger) - integerList xs = List.pconvertLists #$ pconstant @(PBuiltinList PInteger) xs - xs = integerList [1 .. 10] - in [ benchGroup - "ttail-pmatch" - [ -- We expect all these benchmarks to produce equivalent numbers - bench "nested" $ do - pmatch xs $ \case - PSCons _x xs' -> do - pmatch xs' $ \case - PSCons _ xs'' -> - xs'' - PSNil -> perror - PSNil -> perror - , bench "do" $ - P.do - PSCons _ xs' <- pmatch xs - PSCons _ xs'' <- pmatch xs' - xs'' - , bench "cont" $ - flip runCont id $ do - ls <- cont $ pmatch xs - case ls of - PSCons _ xs' -> do - ls' <- cont $ pmatch xs' - case ls' of - PSCons _ xs'' -> pure xs'' - PSNil -> pure perror - PSNil -> pure perror - , bench "termcont" $ - unTermCont $ do - PSCons _ xs' <- TermCont $ pmatch xs - PSCons _ xs'' <- TermCont $ pmatch xs' - pure xs'' - ] - ] diff --git a/plutarch-benchmark/benchmark-diff/Main.hs b/plutarch-benchmark/benchmark-diff/Main.hs deleted file mode 100644 index b8eace681..000000000 --- a/plutarch-benchmark/benchmark-diff/Main.hs +++ /dev/null @@ -1,23 +0,0 @@ -module Main (main) where - -import Plutarch.Benchmark (decodeBenchmarks, diffBenchmarks, renderDiffTable) - -import qualified Data.ByteString.Lazy as BSL -import System.Environment (getArgs) -import qualified Text.PrettyPrint.Boxes as B - --------------------------------------------------------------------------------- - -main :: IO () -main = - getArgs >>= \case - [oldPath, newPath] -> do - Right old <- decodeBenchmarks <$> BSL.readFile oldPath - Right new <- decodeBenchmarks <$> BSL.readFile newPath - - putStrLn . B.render . renderDiffTable $ diffBenchmarks old new - _ -> usage - -usage :: IO () -usage = - putStrLn "usage: benchmark-diff [old] [new]" diff --git a/plutarch-benchmark/src/Plutarch/Benchmark.hs b/plutarch-benchmark/src/Plutarch/Benchmark.hs deleted file mode 100644 index 2d9201a0f..000000000 --- a/plutarch-benchmark/src/Plutarch/Benchmark.hs +++ /dev/null @@ -1,243 +0,0 @@ -{-# LANGUAGE RecordWildCards #-} - --- | Benchmark (exbudget and script size) for Plutus scripts -module Plutarch.Benchmark ( - -- | * Types - Benchmark, - NamedBenchmark, - ScriptSizeBytes, - -- | * Benchmark an arbitraty Plutus script - benchmarkScript, - benchmarkScript', - -- | * Benchmark entrypoints - bench, - bench', - benchGroup, - benchMain, - -- | * Working with benchmark results - decodeBenchmarks, - diffBenchmarks, - renderDiffTable, -) where - -import Codec.Serialise (serialise) -import Control.Arrow ((&&&)) -import Control.Monad (mzero) -import Data.Aeson (ToJSON) -import qualified Data.ByteString.Lazy as BSL -import Data.Coerce (coerce) -import qualified Data.Map.Strict as Map -import Data.Vector (Vector, (!)) -import qualified Data.Vector as Vector -import System.Environment (getArgs) -import Text.PrettyPrint.Boxes ((//)) -import qualified Text.PrettyPrint.Boxes as B - -import qualified Data.ByteString.Lazy as LB -import qualified Data.ByteString.Short as SBS -import Data.Csv ( - DefaultOrdered, - ToField, - ToNamedRecord, - header, - namedRecord, - (.!), - (.=), - ) -import qualified Data.Csv as Csv -import Data.Int (Int64) -import qualified Data.List as List -import Data.Maybe (fromJust) -import GHC.Generics (Generic) -import GHC.Stack (HasCallStack) -import Plutarch (ClosedTerm, compile, printTerm) -import Plutus.V1.Ledger.Api ( - ExBudget (ExBudget), - ExCPU (ExCPU), - ExMemory (ExMemory), - Script, - ) -import qualified Plutus.V1.Ledger.Api as Plutus - --------------------------------------------------------------------------------- - --- | Benchmark the given script -benchmarkScript :: String -> Script -> NamedBenchmark -benchmarkScript name = NamedBenchmark . (name,) . benchmarkScript' - -benchmarkScript' :: Script -> Benchmark -benchmarkScript' = - uncurry mkBenchmark . (evalScriptCounting &&& (fromInteger . toInteger . SBS.length)) . serialiseScriptShort - where - mkBenchmark :: ExBudget -> Int64 -> Benchmark - mkBenchmark (ExBudget cpu mem) = Benchmark cpu mem . ScriptSizeBytes - - serialiseScriptShort :: Script -> SBS.ShortByteString - serialiseScriptShort = SBS.toShort . LB.toStrict . serialise -- Using `flat` here breaks `evalScriptCounting` - evalScriptCounting :: HasCallStack => Plutus.SerializedScript -> Plutus.ExBudget - evalScriptCounting script = - let costModel = fromJust Plutus.defaultCostModelParams - (_logout, e) = Plutus.evaluateScriptCounting Plutus.Verbose costModel script [] - in case e of - Left evalErr -> error ("Eval Error: " <> show evalErr) - Right exbudget -> exbudget - -data Benchmark = Benchmark - { exBudgetCPU :: ExCPU - -- ^ CPU budget used by the script - , exBudgetMemory :: ExMemory - -- ^ Memory budget used by the script - , scriptSizeBytes :: ScriptSizeBytes - -- ^ Size of Plutus script in bytes - } - deriving stock (Show, Generic) - deriving anyclass (ToJSON) - -newtype ScriptSizeBytes = ScriptSizeBytes Int64 - deriving stock (Eq, Ord, Show, Generic) - deriving newtype (Num, ToField) - deriving newtype (ToJSON) - -{- | A `Benchmark` with a name. - - Handy for writing CSV files with headers. --} -newtype NamedBenchmark = NamedBenchmark (String, Benchmark) - deriving stock (Show, Generic) - deriving newtype (ToJSON) - -instance ToNamedRecord NamedBenchmark where - toNamedRecord (NamedBenchmark (name, Benchmark {..})) = - namedRecord ["name" .= name, "cpu" .= exBudgetCPU, "mem" .= exBudgetMemory, "size" .= scriptSizeBytes] - -instance DefaultOrdered NamedBenchmark where - headerOrder _ = header ["name", "cpu", "mem", "size"] - --- | Create a benchmark group with a shared prefix -benchGroup :: String -> [[NamedBenchmark]] -> [NamedBenchmark] -benchGroup groupName bs = - [NamedBenchmark (groupName ++ ":" ++ name, benchmark) | NamedBenchmark (name, benchmark) <- concat bs] - --- | Create a benchmark with a name -bench :: String -> ClosedTerm a -> [NamedBenchmark] -bench name prog = - [coerce . benchmarkScript name $ compile prog] - --- | Create a benchmark with itself as name -bench' :: ClosedTerm a -> [NamedBenchmark] -bench' prog = bench (init . drop (length ("(program 1.0.0 " :: String)) $ printTerm prog) prog - --- | Decode benchmark results from a CSV file -decodeBenchmarks :: LB.ByteString -> Either String [NamedBenchmark] -decodeBenchmarks = - let (#!) :: Num a => Vector Csv.Field -> Int -> Csv.Parser a - (#!) v f = fmap fromInteger . Csv.parseField $ v ! f - in fmap Vector.toList - <$> Csv.decodeWithP - ( \case - v - | length v == 4 -> - fmap NamedBenchmark $ - (,) <$> v .! 0 <*> (Benchmark <$> v #! 1 <*> v #! 2 <*> v #! 3) - _ | otherwise -> mzero - ) - Csv.defaultDecodeOptions - Csv.HasHeader - -data BenchmarkDiffs = BenchmarkDiffs - { dropped :: [NamedBenchmark] - , changed :: [BenchmarkDiff] - , added :: [NamedBenchmark] - } - deriving stock (Show, Generic) - -data BenchmarkDiff = BenchmarkDiff - { benchmark :: Benchmark - , change :: (Double, Double, Double) - , name :: String - } - deriving stock (Show, Generic) - -diffBenchmark :: String -> Benchmark -> Benchmark -> Maybe BenchmarkDiff -diffBenchmark - name - (Benchmark (ExCPU oldCpu) (ExMemory oldMem) (ScriptSizeBytes oldSize)) - new@(Benchmark (ExCPU cpu) (ExMemory mem) (ScriptSizeBytes size)) - | oldCpu /= cpu || oldMem /= mem || oldSize /= size = - let pctChange old new = softRound (fromInteger (toInteger new - toInteger old) / fromInteger (toInteger $ max old new) * 100) - - softRound n = fromInteger @Double (round @Double @Integer n * 10) / 10 - in Just $ - BenchmarkDiff - { benchmark = new - , change = (pctChange oldCpu cpu, pctChange oldMem mem, pctChange oldSize size) - , name = name - } - | otherwise = Nothing - -diffBenchmarks :: [NamedBenchmark] -> [NamedBenchmark] -> BenchmarkDiffs -diffBenchmarks (Map.fromList . coerce -> old) (Map.fromList . coerce -> new) = - BenchmarkDiffs - { changed = - Map.elems $ - Map.mapMaybeWithKey - ( \k new -> - old Map.!? k >>= \old -> diffBenchmark k old new - ) - new - , dropped = coerce . Map.toList $ old `Map.difference` new - , added = coerce . Map.toList $ new `Map.difference` old - } - -renderDiffTable :: BenchmarkDiffs -> B.Box -renderDiffTable (BenchmarkDiffs dropped changed added) = - let renderChange change - | abs change <= 0.01 = B.text "" - | otherwise = B.text $ if change > 0 then "+" <> show change <> "%" else show change <> "%" - - renderResult old diff tag = - [B.text $ show old <> "(" <> tag <> ")", renderChange diff] - - renderBenchmarkDiff :: BenchmarkDiff -> [B.Box] - renderBenchmarkDiff (BenchmarkDiff (Benchmark (ExCPU x) (ExMemory y) (ScriptSizeBytes z)) (dx, dy, dz) name) = - mconcat - [ [B.text name] - , renderResult x dx "cpu" - , renderResult y dy "mem" - , renderResult z dz "bytes" - ] - in B.vsep - 1 - B.top - [ if null dropped then B.nullBox else B.text "Dropped benchmarks:" // renderBudgetTable dropped - , if null changed then B.nullBox else B.text "Changed benchmarks:" // renderTable [renderBenchmarkDiff change | change <- changed] - , if null added then B.nullBox else B.text "Added benchmarks:" // renderBudgetTable added - ] - -renderTable :: [[B.Box]] -> B.Box -renderTable rows = - let alignments = - -- Align all but the first column to the right, because they represent numeric values. - B.left : repeat B.right - in B.hsep 2 B.left . fmap (uncurry B.vcat) $ zip alignments (List.transpose rows) - -renderBudgetTable :: [NamedBenchmark] -> B.Box -renderBudgetTable bs = - renderTable $ - [ [ B.text name - , B.text $ show cpu <> "(cpu)" - , B.text $ show mem <> "(mem)" - , B.text $ show sz <> "(bytes)" - ] - | NamedBenchmark (name, Benchmark (ExCPU cpu) (ExMemory mem) (ScriptSizeBytes sz)) <- bs - ] - -benchMain :: [NamedBenchmark] -> IO () -benchMain benchmarks = - getArgs >>= \case - ["--csv"] -> BSL.putStr $ Csv.encodeDefaultOrderedByName benchmarks - _ -> do - let csv = Csv.encodeDefaultOrderedByName benchmarks - BSL.writeFile "bench.csv" csv - putStrLn "Wrote to bench.csv:" - putStrLn . B.render $ renderBudgetTable benchmarks diff --git a/plutarch-extra/Plutarch/Extra.hs b/plutarch-extra/Plutarch/Extra.hs new file mode 100644 index 000000000..b390b7b96 --- /dev/null +++ b/plutarch-extra/Plutarch/Extra.hs @@ -0,0 +1 @@ +module Plutarch.Extra () where diff --git a/plutarch-extra/Plutarch/ListUtils.hs b/plutarch-extra/Plutarch/ListUtils.hs new file mode 100644 index 000000000..24dd40e05 --- /dev/null +++ b/plutarch-extra/Plutarch/ListUtils.hs @@ -0,0 +1,23 @@ +module Plutarch.ListUtils (preverse, pcheckSorted) where + +import Plutarch.Prelude + +-- | / O(n) /. reverses a list +preverse :: (PIsListLike l a) => Term s (l a :--> l a) +preverse = + phoistAcyclic $ + pfoldl # plam (\ys y -> pcons # y # ys) # pnil + +-- | / O(n) /.checks whether a list is sorted +pcheckSorted :: (PIsListLike l a, POrd a) => Term s (l a :--> PBool) +pcheckSorted = + pfix #$ plam $ \self xs -> + pelimList + ( \x1 xs -> + pelimList + (\x2 _ -> x1 #<= x2 #&& (self # xs)) + (pcon PTrue) + xs + ) + (pcon PTrue) + xs diff --git a/plutarch-benchmark/plutarch-benchmark.cabal b/plutarch-extra/plutarch-extra.cabal similarity index 61% rename from plutarch-benchmark/plutarch-benchmark.cabal rename to plutarch-extra/plutarch-extra.cabal index eee1a346b..d17c91b4d 100644 --- a/plutarch-benchmark/plutarch-benchmark.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -1,9 +1,6 @@ -cabal-version: 2.4 -name: plutarch-benchmark -version: 1.1.0 -author: Las Safin -license: MIT -extra-source-files: README.md +cabal-version: 2.4 +name: plutarch-extra +version: 1.1.0 common c default-language: Haskell2010 @@ -69,51 +66,20 @@ common c -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls -fprint-explicit-kinds -library - import: c - exposed-modules: Plutarch.Benchmark +common deps build-depends: - , aeson , base - , boxes - , bytestring - , cassava - , containers - , data-default - , flat - , foldl - , mtl , plutarch - , plutus-core - , plutus-ledger-api - , serialise - , text - , these - , vector - hs-source-dirs: src +library plutarch-preludes + import: c, deps + hs-source-dirs: preludes + exposed-modules: PPrelude -benchmark benchmark - import: c - type: exitcode-stdio-1.0 - hs-source-dirs: bench - main-is: Main.hs - build-depends: - , base - , bytestring - , plutarch - , plutarch-benchmark - , plutus-ledger-api - , transformers +library + import: c, deps + exposed-modules: + Plutarch.Extra + Plutarch.ListUtils -executable benchmark-diff - import: c - hs-source-dirs: benchmark-diff - main-is: Main.hs - build-depends: - , base - , boxes - , bytestring - , cassava - , plutarch - , plutarch-benchmark +-- other-modules: diff --git a/plutarch-extra/preludes/PPrelude.hs b/plutarch-extra/preludes/PPrelude.hs new file mode 100644 index 000000000..3a8025b4b --- /dev/null +++ b/plutarch-extra/preludes/PPrelude.hs @@ -0,0 +1,7 @@ +module PPrelude ( + module Prelude, + module Plutarch.Prelude, +) where + +import Plutarch.Prelude +import Prelude diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs new file mode 100644 index 000000000..206697b7c --- /dev/null +++ b/plutarch-test/Main.hs @@ -0,0 +1,42 @@ +{-# LANGUAGE CPP #-} + +module Main (main) where + +import qualified BaseSpec +import qualified ExtraSpec + +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) +import qualified Plutarch.FieldSpec as FieldSpec +import qualified Plutarch.MonadicSpec as MonadicSpec +import Plutarch.Test.Run (noUnusedGoldens) +#else +import qualified Plutarch.FFISpec as FFISpec +#endif + +import GHC.IO.Encoding (setLocaleEncoding, utf8) +import Test.Hspec (Spec, describe, hspec) + +main :: IO () +main = do + setLocaleEncoding utf8 + hspec spec + +-- We test for unused goldens, but do so only in GHC 9. Because, under GHC 8 +-- certain modules are disabled (see the CPP below) which leads to legitimately +-- unused goldens detected leading to false positive in test failure. +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + noUnusedGoldens spec +#endif + +spec :: Spec +spec = do + BaseSpec.spec + ExtraSpec.spec +#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + describe "GHC-9-only" $ do + FieldSpec.spec + MonadicSpec.spec +#else + describe "GHC-8-only" $ do + FFISpec.spec +#endif diff --git a/plutarch-test/README.md b/plutarch-test/README.md index 4255fe999..468e54c8a 100644 --- a/plutarch-test/README.md +++ b/plutarch-test/README.md @@ -23,18 +23,30 @@ $ vim cabal.project # And then uncomment the "flags: +developmenet" line. $ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test' -T Main.main ``` -## The `developmenmt` flag +Note: `cabal run` should be run inside `./plutarch-test` directory. + +## The `development` flag Plutarch has a `development` flag. Right now, the flag is used to control tracing functions, wherein turning on the flag will inject `Trace` instructions in the generated UPLC. -Since this will impact the printTerm goldens in tests, we provide `plutarchDevFlagDescribe` that should be used everywhere in the test hierarchy where the immediate sub-tree of tests are known to use tracing functions (or any other development-flag-specific featuresto use tracing functions (or any other development-flag-specific features). +Since this will impact the printTerm goldens in tests, we provide `plutarchDevFlagDescribe` that should be used everywhere in the test hierarchy where the immediate sub-tree of tests are known to use tracing functions (or any other development-flag-specific features to use tracing functions (or any other development-flag-specific features). ## Goldens +### Navigation + To quickly nagivate and preview the golden files in the terminal, run: -``` +```sh-session nix run nixpkgs#ranger -- ./plutarch-test/goldens/ ``` Then hit `zv` to toggle on preview. Use `hjkl` to naviate. + +### Reset + +When writing tests you may want to clean up working copy goldens, and start from base. To do this, run: + +```sh-session +rm plutarch-test/goldens/*.golden; git restore --source=HEAD --staged --worktree -- plutarch-test/goldens/ +``` \ No newline at end of file diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs new file mode 100644 index 000000000..830b81322 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test.hs @@ -0,0 +1,167 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE ImpredicativeTypes #-} + +-- | Common functions for testing Plutarch code +module Plutarch.Test ( + -- * Plutarch specific `Expectation` operators + passert, + passertNot, + pfails, + psucceeds, + ptraces, + pshouldBe, + (#@?=), + + -- * Budget expectation + psatisfyWithinBenchmark, + + -- * For Development flag tests + plutarchDevFlagDescribe, + + -- * Golden testing + (@|), + (@\), + (@->), + (@:->), + (@==), + pgoldenSpec, + PlutarchGoldens, + + -- * Benchmark type for use in `(@:->)` + Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), + ScriptSizeBytes, +) where + +import Data.Text (Text) + +import Plutarch (ClosedTerm, PCon (pcon), compile, printScript) +import Plutarch.Bool (PBool (PFalse, PTrue)) +import Plutarch.Evaluate (evalScript) +import Plutarch.Test.Benchmark ( + Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), + ScriptSizeBytes, + ) +import Plutarch.Test.Golden ( + PlutarchGoldens, + TermExpectation, + evalScriptAlwaysWithBenchmark, + pgoldenSpec, + (@->), + (@:->), + (@\), + (@|), + ) +import qualified Plutus.V1.Ledger.Scripts as Scripts +import Test.Hspec (Expectation, Spec, describe, expectationFailure, shouldBe, shouldSatisfy) +import Test.Tasty.HUnit (assertFailure) + +{- | + Like `shouldBe` but but for Plutarch terms +-} +pshouldBe :: ClosedTerm a -> ClosedTerm b -> Expectation +pshouldBe x y = do + p1 <- eval $ compile x + p2 <- eval $ compile y + pscriptShouldBe p1 p2 + where + eval :: Scripts.Script -> IO Scripts.Script + eval s = case evalScript s of + (Left e, _, _) -> assertFailure $ "Script evaluation failed: " <> show e + (Right x', _, _) -> pure x' + +{- | + Like `pshouldBe` but on `Script` +-} +pscriptShouldBe :: Scripts.Script -> Scripts.Script -> Expectation +pscriptShouldBe x y = + printScript x `shouldBe` printScript y + +-- | Like `@?=` but for Plutarch terms +(#@?=) :: ClosedTerm a -> ClosedTerm b -> Expectation +(#@?=) = pshouldBe + +-- | Asserts the term to be true +passert :: ClosedTerm a -> Expectation +passert p = p #@?= pcon PTrue + +-- | Asserts the term to be false +passertNot :: ClosedTerm a -> Expectation +passertNot p = p #@?= pcon PFalse + +-- | Asserts the term evaluates successfully without failing +psucceeds :: ClosedTerm a -> Expectation +psucceeds p = + case evalScript (compile p) of + (Left _, _, _) -> expectationFailure $ "Term failed to evaluate" + (Right _, _, _) -> pure () + +-- | Asserts the term evaluates without success +pfails :: ClosedTerm a -> Expectation +pfails p = do + case evalScript (compile p) of + (Left _, _, _) -> pure () + (Right _, _, _) -> expectationFailure $ "Term succeeded" + +{- | Check that the given benchmark is within certain maximum values. + + Use this to ensure that a program's benchmark doesn't exceed expected values + (such as script size or memory budget). You will need this because, + + - `Plutarch.Test`'s golden testing uses maximum possible ExBudget for evaluating + programs + - You may want to check that the script size is within a certain value +-} +psatisfyWithinBenchmark :: Benchmark -> Benchmark -> Expectation +psatisfyWithinBenchmark bench maxBudget = do + shouldSatisfy bench $ \_ -> + exBudgetCPU bench <= exBudgetCPU maxBudget + shouldSatisfy bench $ \_ -> + exBudgetMemory bench <= exBudgetMemory maxBudget + shouldSatisfy bench $ \_ -> + scriptSizeBytes bench <= scriptSizeBytes maxBudget + +{- | Asserts that the term evaluates successfully with the given trace sequence + + See also: `plutarchDevFlagDescribe` +-} +ptraces :: ClosedTerm a -> [Text] -> Expectation +ptraces p develTraces = + case evalScript (compile p) of + (Left _, _, _) -> expectationFailure $ "Term failed to evaluate" + (Right _, _, traceLog) -> do +#ifdef Development + traceLog `shouldBe` develTraces +#else + -- Tracing is disabled in non-developed modes, so we should expect an + -- empty trace log. + let noTraces = const [] develTraces + traceLog `shouldBe` noTraces +#endif + +{- | Like `describe`, but determines description from `Development` CPP flag + + Useful to create two sets of othersise identical group of tests that differ + only by `Development` flag. This has the effect of creating two sets of golden + tests (with different filepaths) for corresponding flag values. + + Typically meant to be used in conjunction with `ptraces`. +-} +plutarchDevFlagDescribe :: Spec -> Spec + +-- CPP support isn't great in fourmolu. +{- ORMOLU_DISABLE -} +plutarchDevFlagDescribe m = +#ifdef Development + describe "dev=true" m +#else + describe "dev=false" m +#endif +{- ORMOLU_ENABLE -} + +-- | Test that the Plutarch program evaluates to the given term +(@==) :: ClosedTerm a -> ClosedTerm b -> TermExpectation a +(@==) p x = p @:-> \(_, script, _) -> script `pscriptShouldBe` xScript + where + xScript = fst . evalScriptAlwaysWithBenchmark $ compile x + +infixr 1 @== diff --git a/plutarch-test/common/Plutarch/Test/Benchmark.hs b/plutarch-test/common/Plutarch/Test/Benchmark.hs new file mode 100644 index 000000000..544a706b0 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Benchmark.hs @@ -0,0 +1,41 @@ +module Plutarch.Test.Benchmark ( + -- * Working with `Benchmark` type + Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), + ScriptSizeBytes, + + -- * Producing benchmark values + mkBenchmark, + scriptSize, +) where + +import Codec.Serialise (serialise) +import Data.Aeson (ToJSON) +import qualified Data.ByteString.Lazy as LB +import qualified Data.ByteString.Short as SBS +import Data.Int (Int64) +import GHC.Generics (Generic) +import Plutus.V1.Ledger.Api (ExBudget (ExBudget), ExCPU, ExMemory, Script) + +data Benchmark = Benchmark + { exBudgetCPU :: ExCPU + -- ^ CPU budget used by the script. + , exBudgetMemory :: ExMemory + -- ^ Memory budget used by the script. + , scriptSizeBytes :: ScriptSizeBytes + -- ^ Size of Plutus script in bytes + } + deriving stock (Show, Generic) + deriving anyclass (ToJSON) + +mkBenchmark :: ExBudget -> ScriptSizeBytes -> Benchmark +mkBenchmark (ExBudget cpu mem) = Benchmark cpu mem + +newtype ScriptSizeBytes = ScriptSizeBytes Int64 + deriving stock (Eq, Ord, Show, Generic) + deriving newtype (Num, ToJSON) + +scriptSize :: Script -> ScriptSizeBytes +scriptSize = ScriptSizeBytes . fromIntegral . SBS.length . serialiseScriptShort + +serialiseScriptShort :: Script -> SBS.ShortByteString +serialiseScriptShort = SBS.toShort . LB.toStrict . serialise diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs new file mode 100644 index 000000000..7b913d2a7 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -0,0 +1,261 @@ +{-# LANGUAGE ImpredicativeTypes #-} + +module Plutarch.Test.Golden ( + -- * DSL + pgoldenSpec, + (@|), + (@\), + (@->), + (@:->), + TermExpectation, + PlutarchGoldens, + + -- * Golden key and path + GoldenKey, + currentGoldenKey, + goldenKeyString, + mkGoldenKeyFromSpecPath, + defaultGoldenBasePath, + goldenTestPath, + + -- * Evaluation + evalScriptAlwaysWithBenchmark, + compileD, +) where + +import Control.Monad (forM_, unless) +import qualified Data.Aeson.Text as Aeson +import Data.List.NonEmpty (nonEmpty) +import Data.Maybe (mapMaybe) +import Data.Semigroup (sconcat) +import Data.String (IsString) +import Data.Text (Text) +import qualified Data.Text as T +import qualified Data.Text.IO as TIO +import qualified Data.Text.Lazy as TL +import GHC.Stack (HasCallStack) +import System.FilePath (()) +import Test.Hspec.Golden + +import qualified Data.List.NonEmpty as NE +import Plutarch (compile, printScript) +import Plutarch.Evaluate (evalScript) +import Plutarch.Internal (punsafeAsClosedTerm) +import Plutarch.Prelude +import Plutarch.Test.Benchmark (Benchmark, mkBenchmark, scriptSize) +import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) +import Plutus.V1.Ledger.Scripts (Script) +import qualified Plutus.V1.Ledger.Scripts as Scripts +import Test.Hspec (Expectation, Spec, describe, it) +import Test.Hspec.Core.Spec (SpecM, getSpecDescriptionPath) + +data GoldenValue = GoldenValue + { goldenValueUplcPreEval :: Text + -- ^ Golden string for UPLC + , goldenValueUplcPostEval :: Text + -- ^ Golden string for evaluated UPLC + , goldenValueBench :: Text + -- ^ Golden string for benchmark JSON + , goldenValueEvaluated :: Script + -- ^ Evaluated result + , goldenValueBenchVal :: Benchmark + -- ^ `Benchmark` for evaluated UPLC + , goldenValueExpectation :: Maybe (Script -> Benchmark -> Expectation) + -- ^ User test's expectation function + } + +{- | Class of types that represent `GoldenValue` + + This class exists for syntatic sugar provided by (@->) (via `TermExpectation`). +-} +class HasGoldenValue (t :: S -> PType -> Type) where + mkGoldenValue :: forall a. (forall s. t s a) -> GoldenValue + +mkGoldenValue' :: ClosedTerm a -> Maybe (Script -> Benchmark -> Expectation) -> GoldenValue +mkGoldenValue' p mexp = + let compiledScript = compileD p + (evaluatedScript, bench) = evalScriptAlwaysWithBenchmark compiledScript + in GoldenValue + (T.pack $ printScript compiledScript) + (T.pack $ printScript evaluatedScript) + (TL.toStrict $ Aeson.encodeToLazyText bench) + evaluatedScript + bench + mexp + +-- We derive for `Term s a` only because GHC prevents us from deriving for +-- `ClosedTerm a`. In practice, this instance should be used only for closed +-- terms. +instance HasGoldenValue Term where + mkGoldenValue p = mkGoldenValue' (punsafeAsClosedTerm p) Nothing + +{- | A `Term` paired with its evaluation/benchmark expectation + + Example: + >>> TermExpectation (pcon PTrue) $ \(p, _script, _benchmark) -> pshouldBe (pcon PTrue) +-} +data TermExpectation' s a = TermExpectation (Term s a) ((Term s a, Script, Benchmark) -> Expectation) + +type TermExpectation a = forall s. TermExpectation' s a + +-- | Test an expectation on a golden Plutarch program +(@->) :: ClosedTerm a -> (ClosedTerm a -> Expectation) -> TermExpectation a +(@->) p f = p @:-> \(p', _, _) -> f $ punsafeAsClosedTerm p' + +infixr 1 @-> + +{- | Like `@->` but also takes the evaluated script and benchmark as arguments + + Useful to do assertion checks on post-evaluation benchmark (eg: to check if + script size is below certain threshold) -- use in conjunction with + `psatisfyWithinBenchmark` -- or on evaluated script (ie., without + re-evaluating the program). +-} +(@:->) :: ClosedTerm a -> ((ClosedTerm a, Script, Benchmark) -> Expectation) -> TermExpectation a +(@:->) p f = TermExpectation p (\(p', pe, b) -> f (punsafeAsClosedTerm p', pe, b)) + +infixr 1 @:-> + +instance HasGoldenValue TermExpectation' where + mkGoldenValue (TermExpectation p f) = + mkGoldenValue' (punsafeAsClosedTerm p) (Just $ (\pe b -> f (p, pe, b))) + +-- | The key used in the .golden files containing multiple golden values +newtype GoldenKey = GoldenKey Text + deriving newtype (Eq, Show, Ord, IsString) + +goldenKeyString :: GoldenKey -> String +goldenKeyString (GoldenKey s) = T.unpack s + +instance Semigroup GoldenKey where + GoldenKey s1 <> GoldenKey s2 = GoldenKey $ s1 <> "." <> s2 + +currentGoldenKey :: HasCallStack => SpecM () GoldenKey +currentGoldenKey = do + mkGoldenKeyFromSpecPath . fmap T.pack <$> getSpecDescriptionPath + +mkGoldenKeyFromSpecPath :: HasCallStack => [Text] -> GoldenKey +mkGoldenKeyFromSpecPath path = + case nonEmpty path of + Nothing -> error "cannot use currentGoldenKey from top-level spec" + Just anc -> + case nonEmpty (NE.drop 1 . NE.reverse $ anc) of + Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" + Just path -> + sconcat $ fmap GoldenKey path + +goldenPath :: FilePath -> GoldenKey -> FilePath +goldenPath baseDir (GoldenKey k) = + baseDir T.unpack k <> ".golden" + +type PlutarchGoldens = ListSyntax (GoldenKey, GoldenValue) + +-- | Specify goldens for the given Plutarch program +(@|) :: forall t a. HasGoldenValue t => GoldenKey -> (forall s. t s a) -> PlutarchGoldens +(@|) k v = listSyntaxAdd (k, mkGoldenValue v) + +infixr 0 @| + +-- | Add an expectation for the Plutarch program specified with (@|) +(@\) :: GoldenKey -> PlutarchGoldens -> PlutarchGoldens +(@\) = listSyntaxAddSubList + +{- | Create golden specs for pre/post-eval UPLC and benchmarks. + + A *single* golden file will be created (for each metric) for all the programs + in the given tree. + + For example, + ``` + pgoldenSpec $ do + "foo" @| pconstant 42 + "bar" @\ do + "qux" @| pconstant "Hello" + ``` + + Will create three golden files -- uplc.golden, uplc.eval.golden and + bench.golden -- each containing three lines one for each program above. + Hierarchy is represented by intercalating with a dot; for instance, the key + for 'qux' will be "bar.qux". +-} +pgoldenSpec :: HasCallStack => PlutarchGoldens -> Spec +pgoldenSpec map = do + base <- currentGoldenKey + let bs = runListSyntax map + -- Golden tests + describe "golden" $ do + goldenTestSpec base bs `mapM_` [minBound .. maxBound] + -- Assertion tests (if any) + let asserts = flip mapMaybe bs $ \(k, v) -> do + (k,) . (\f -> f (goldenValueEvaluated v) $ goldenValueBenchVal v) <$> goldenValueExpectation v + unless (null asserts) $ do + forM_ asserts $ \(k, v) -> + it (goldenKeyString $ "" <> k <> "assert") v + +data GoldenTest + = -- | The unevaluated UPLC (compiled target of Plutarch term) + UPLCPreEval + | -- | The evaluated UPLC (evaluated result of Plutarch term) + UPLCPostEval + | -- | Benchmark of Plutarch term (will never fail) + Bench + deriving stock (Eq, Show, Ord, Enum, Bounded) + +goldenTestKey :: GoldenTest -> GoldenKey +goldenTestKey = \case + UPLCPreEval -> "uplc" + UPLCPostEval -> "uplc.eval" + Bench -> "bench" + +defaultGoldenBasePath :: FilePath +defaultGoldenBasePath = "goldens" + +goldenTestPath :: GoldenKey -> GoldenTest -> FilePath +goldenTestPath base gt = + goldenPath defaultGoldenBasePath $ base <> goldenTestKey gt + +goldenTestVal :: GoldenTest -> GoldenValue -> Text +goldenTestVal t v = case t of + UPLCPreEval -> goldenValueUplcPreEval v + UPLCPostEval -> goldenValueUplcPostEval v + Bench -> goldenValueBench v + +goldenTestSpec :: GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> Spec +goldenTestSpec base vals gt = do + it (goldenKeyString $ goldenTestKey gt) $ do + Golden + { output = combineGoldens $ fmap (goldenTestVal gt) <$> vals + , goldenFile = goldenTestPath base gt + , actualFile = Nothing + , encodePretty = show + , writeToFile = TIO.writeFile + , readFromFile = TIO.readFile + , failFirstTime = False + } + where + -- Group multiple goldens values in the same file + combineGoldens :: [(GoldenKey, Text)] -> Text + combineGoldens xs = + T.intercalate "\n" $ + (\(GoldenKey k, v) -> k <> " " <> v) <$> xs + +{- | Like `evalScript` but doesn't throw `EvalError`, and returns `Benchmark`. + + On `EvalError`, this function returns `perror` as evaluated script. Plutus + does not provide an accurate way to tell if the program evalutes to `Error` or + not; see https://github.com/input-output-hk/plutus/issues/4270 +-} +evalScriptAlwaysWithBenchmark :: Scripts.Script -> (Scripts.Script, Benchmark) +evalScriptAlwaysWithBenchmark script = + let (res, exbudget, _traces) = evalScript script + bench = mkBenchmark exbudget (scriptSize script) + in ( case res of + Left _ -> compile perror + Right x -> x + , bench + ) + +-- TODO: Make this deterministic +-- See https://github.com/Plutonomicon/plutarch/pull/297 +compileD :: ClosedTerm a -> Scripts.Script +compileD = compile diff --git a/plutarch-test/common/Plutarch/Test/ListSyntax.hs b/plutarch-test/common/Plutarch/Test/ListSyntax.hs new file mode 100644 index 000000000..f60923cee --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/ListSyntax.hs @@ -0,0 +1,30 @@ +module Plutarch.Test.ListSyntax ( + ListSyntax, + runListSyntax, + listSyntaxAdd, + listSyntaxAddSubList, +) where + +import Control.Monad (void) +import Control.Monad.Writer (Writer, execWriter, tell) + +listSyntaxAddSubList :: Semigroup k => k -> ListSyntax (k, v) -> ListSyntax (k, v) +listSyntaxAddSubList name m = + void $ + flip traverse (runListSyntax m) $ \(k, v) -> do + let k' = name <> k + listSyntaxAdd (k', v) + +newtype ListSyntaxM elem a = ListSyntax {unListSyntax :: Writer [elem] a} + deriving newtype (Functor, Applicative, Monad) + +type ListSyntax elem = ListSyntaxM elem () + +runListSyntax :: ListSyntax elem -> [elem] +runListSyntax = + execWriter . unListSyntax + +listSyntaxAdd :: elem -> ListSyntax elem +listSyntaxAdd = ListSyntax . tell . one + where + one x = [x] diff --git a/plutarch-test/common/Plutarch/Test/Property.hs b/plutarch-test/common/Plutarch/Test/Property.hs new file mode 100644 index 000000000..5bce715a1 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property.hs @@ -0,0 +1,8 @@ +-- | Helper for writing property tests for Plutarch terms. +module Plutarch.Test.Property ( + module X, +) where + +import Plutarch.Test.Property.Extra as X +import Plutarch.Test.Property.HaskEquiv as X +import Plutarch.Test.Property.Marshal as X diff --git a/plutarch-test/common/Plutarch/Test/Property/Extra.hs b/plutarch-test/common/Plutarch/Test/Property/Extra.hs new file mode 100644 index 000000000..3a0d8377f --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property/Extra.hs @@ -0,0 +1,74 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} + +{- | + Extra properties based on `prop_haskEquiv` +-} +module Plutarch.Test.Property.Extra ( + prop_leftInverse, + prop_dataRoundTrip, +) where + +import Hedgehog (Gen, Property) + +import Plutarch.Prelude + +import Plutarch.Test.Property.HaskEquiv ( + Equality (OnPEq), + HaskEquiv, + LamArgs, + NP (Nil, (:*)), + Totality (TotalFun), + prop_haskEquiv, + ) +import Plutarch.Test.Property.Marshal (Marshal) + +{- | + `l` is a left inverse of `r` + + See https://en.wikipedia.org/wiki/Inverse_function#Left_inverses + + Like `prop_haskEquiv`, you want to call this with @TypeApplications@ + specifying the value of `e`. For example, + + >>> prop_leftInverse + @'OnPEq + mapJoin + mapSplit + $ mapOf (pairOf integer integer) rational +-} +prop_leftInverse :: + forall e p p' h. + ( LamArgs h ~ '[] + , HaskEquiv e 'TotalFun (h -> h) (p :--> p) '[h] + , Show h + , Marshal h p + ) => + ClosedTerm (p' :--> p) -> + ClosedTerm (p :--> p') -> + Gen h -> + Property +prop_leftInverse l r arg = + prop_haskEquiv @e @( 'TotalFun) (id @h) (plam $ \x -> l #$ r # x) (arg :* Nil) + +{- | + A Plutarch term that is a `PIsData` can be encoded to and decoded back to the + same value. +-} +prop_dataRoundTrip :: + forall h p. + ( LamArgs h ~ '[] + , Show h + , Marshal h p + , PIsData p + , PEq p + ) => + Gen h -> + Property +prop_dataRoundTrip = + prop_leftInverse + @( 'OnPEq) + @p + @(PAsData p) + @h + (plam pfromData) + (plam pdata) diff --git a/plutarch-test/common/Plutarch/Test/Property/Gen.hs b/plutarch-test/common/Plutarch/Test/Property/Gen.hs new file mode 100644 index 000000000..88c34dd06 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property/Gen.hs @@ -0,0 +1,22 @@ +-- | Generator helpers +module Plutarch.Test.Property.Gen ( + genRational, + genInteger, + genList, +) where + +import Control.Monad (MonadPlus, liftM2, mfilter) +import Data.Ratio ((%)) + +import Hedgehog (MonadGen) +import qualified Hedgehog.Gen as Gen +import qualified Hedgehog.Range as Range + +genInteger :: MonadGen g => g Integer +genInteger = Gen.integral (Range.linear (-1_000_000_000) 1_000_000_000) + +genRational :: (MonadPlus g, MonadGen g) => g Rational +genRational = liftM2 (%) genInteger (mfilter (/= 0) genInteger) + +genList :: MonadGen g => g a -> g [a] +genList = Gen.list (Range.linear 0 100) diff --git a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs new file mode 100644 index 000000000..ee68c636f --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs @@ -0,0 +1,187 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE UndecidableInstances #-} + +{- | + The property of Plutarch terms corresponding to a Haskell term. + + Assuming Haskell functions are already well-tested, by verifying the property + that a Plutarch term functions equivalently to the corresponding Haskell term + we automatically (more or less) verify the correctness of the Plutarch term. + + This modules provides a `prop_haskEquiv` to that end. +-} +module Plutarch.Test.Property.HaskEquiv ( + -- * The principal property of the module #prop# + prop_haskEquiv, + Equality (..), + Totality (..), + NP ((:*), Nil), -- Re-exports from sop-core for building Gen arguments + + -- * For writing helper functions using `prop_haskEquiv` #types# + LamArgs, + HaskEquiv, + + -- * Underlying equality tests #util# + testDataEq, + testPEq, +) where + +import Control.Exception (SomeException, evaluate, try) +import Control.Monad.IO.Class (liftIO) +import Data.SOP (NP (Nil, (:*))) +import Data.Text (Text) +import Hedgehog (Gen, Property, PropertyT, annotate, annotateShow, assert, forAll, property, (===)) +import Plutus.V1.Ledger.Scripts (Script (Script, unScript)) +import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) +import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) + +import Plutarch (compile) +import Plutarch.Evaluate (EvalError, evalScript') +import Plutarch.Prelude +import Plutarch.Test.Property.Marshal (Marshal (marshal)) + +-- | The nature of equality between two Plutarch terms. +data Equality + = OnPEq + | OnPData + | -- | Terms are equal on both `PEq` and `PData` + OnBoth + deriving stock (Eq, Show, Ord) + +-- | Whether a function is total or partial. +data Totality + = TotalFun + | -- | The Plutarch *and* Haskell function is expected to be partial (error's on + -- certain inputs). + PartialFun + deriving stock (Eq, Show, Ord) + +{- | + Class of pairs of Plutarch and Haskell types that are semantically + equivalent, upto the given `Equality` and `Totality`. +-} +class LamArgs h ~ args => HaskEquiv (e :: Equality) (t :: Totality) h p args | h -> p where + -- | Test that `h` and `p` are equal when applied on the given `args`. + haskEquiv :: h -> ClosedTerm p -> NP Gen args -> PropertyT IO () + +-- | Argument types for a Haskell function (empty if a term value) +type family LamArgs f :: [Type] where + LamArgs (a -> b) = a ': LamArgs b + LamArgs _ = '[] + +-- For lambda terms generate the first argument and delegate. +instance + (Show ha, Marshal ha pa, HaskEquiv e t hb pb hbArgs, LamArgs hb ~ hbArgs) => + HaskEquiv e t (ha -> hb) (pa :--> pb) (ha ': hbArgs) + where + haskEquiv hf pf (a :* as) = do + x <- forAll a + haskEquiv @e @t (hf x) (pf # marshal x) as + +instance (PIsData p, Marshal h p, LamArgs h ~ '[]) => HaskEquiv 'OnPData 'TotalFun h p '[] where + haskEquiv h p Nil = testDataEq' h p + +instance (PEq p, Marshal h p, LamArgs h ~ '[]) => HaskEquiv 'OnPEq 'TotalFun h p '[] where + haskEquiv h p Nil = testPEq (marshal h) p + +instance + ( PEq p + , PIsData p + , Marshal h p + , HaskEquiv 'OnPEq 'TotalFun h p '[] + , HaskEquiv 'OnPData 'TotalFun h p '[] + ) => + HaskEquiv 'OnBoth 'TotalFun h p '[] + where + haskEquiv h p Nil = do + haskEquiv @( 'OnPEq) @( 'TotalFun) h p Nil + haskEquiv @( 'OnPData) @( 'TotalFun) h p Nil + +instance + (PIsData p, Marshal h p, HaskEquiv eq 'TotalFun h p '[]) => + HaskEquiv eq 'PartialFun h p '[] + where + haskEquiv h p Nil = testPartial (\h' p' -> haskEquiv @eq @( 'TotalFun) h' p' Nil) h p + +{- | + The given Plutarch term is equivalent to the given Haskell type upto the given + `Equality` and `Totality`. + + Generator arguments must be non-empty if the term is a lambda. This function + must always be called using `TypeApplications` specifying the first two + type variables. + + Example: + + >>> prop_haskEquiv + @'OnPEq + @'TotalFun + (reverse :: [Integer] -> [Integer]) + preverse + (genList genInteger :* Nil) +-} +prop_haskEquiv :: + forall (e :: Equality) (t :: Totality) h p. + HaskEquiv e t h p (LamArgs h) => + h -> + ClosedTerm p -> + NP Gen (LamArgs h) -> + Property +prop_haskEquiv h p = do + property . haskEquiv @e @t h p + +testDataEq' :: (PIsData a, Marshal h a) => h -> ClosedTerm a -> PropertyT IO () +testDataEq' x y = + testDataEq (marshal x) y + +testDataEq :: (PIsData a) => ClosedTerm a -> ClosedTerm a -> PropertyT IO () +testDataEq x y = pshouldBe (pdata x) (pdata y) + +testPartial :: (h -> ClosedTerm p -> PropertyT IO ()) -> h -> ClosedTerm p -> PropertyT IO () +testPartial baseTest h p = + liftIO (try $ evaluate h) >>= \case + Left (_ :: SomeException) -> + case run p of + (Left _, _, _) -> assert True + (Right _, _, _) -> do + annotate "plutarch didn't fail but haskell did" + assert False + Right _ -> baseTest h p + +testPEq :: PEq a => ClosedTerm a -> ClosedTerm a -> PropertyT IO () +testPEq x y = + -- Evaluate the terms once so we can annotate them individually. + -- Then, evaluate `x #== y`. + case (run x, run y) of + ((Right (Script x'), _, _), (Right (Script y'), _, _)) -> do + annotateShow x' + annotateShow y' + pshouldBe (pcon PTrue) (x #== y) + _ -> assert False + +-- | Like `Plutarch.Test.pshouldBe` but in Hedgehog property monad. +pshouldBe :: ClosedTerm a -> ClosedTerm a -> PropertyT IO () +pshouldBe x y = + -- testing equality of Scott encoded types + -- this way is generally prone to false errors + -- hence this function not being directly exposed + case (run x, run y) of + ((Right script1, _, trace1), (Right script2, _, trace2)) -> do + annotateShow trace1 + annotateShow trace2 + annotateShow $ unScript script1 + annotateShow $ unScript script2 + trace1 === trace2 + script1 === script2 + _ -> assert False + +run :: ClosedTerm h -> (Either EvalError Script, ExBudget, [Text]) +run t = evalScriptHugeBudget $ compile t + +{- | A more suitable version of `evalScript` geared towards property tests that + can use lots of resources +-} +evalScriptHugeBudget :: Script -> (Either EvalError Script, ExBudget, [Text]) +evalScriptHugeBudget = + evalScript' $ + ExBudget (ExCPU 10_000_000_000_000) (ExMemory 10_000_000_000) diff --git a/plutarch-test/common/Plutarch/Test/Property/Marshal.hs b/plutarch-test/common/Plutarch/Test/Property/Marshal.hs new file mode 100644 index 000000000..f18238c75 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Property/Marshal.hs @@ -0,0 +1,38 @@ +{-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.Test.Property.Marshal ( + Marshal (marshal), +) where + +import Plutarch.Lift (PLifted) +import Plutarch.Prelude + +-- | Class of Haskell types that can be marshalled to a Plutarch term. +class Marshal h (p :: PType) | h -> p where + marshal :: h -> ClosedTerm p + default marshal :: (PLifted p ~ h, PLift p) => h -> ClosedTerm p + marshal x = pconstant x + +instance Marshal h p => Marshal [h] (PList p) where + marshal xs = foldr (\h t -> pcons # marshal h # t) pnil xs + +instance Marshal ha pa => Marshal (Maybe ha) (PMaybe pa) where + marshal (Just x) = pcon $ PJust $ marshal x + marshal Nothing = pcon PNothing + +instance (Marshal ha pa, Marshal hb pb) => Marshal (ha, hb) (PPair pa pb) where + marshal (a, b) = pcon $ PPair (marshal a) (marshal b) + +instance Marshal Integer PInteger where + marshal n = fromInteger n + +instance Marshal Rational PRational where + marshal r = fromRational r + +instance Marshal Bool PBool where + marshal True = pcon PTrue + marshal False = pcon PFalse + +instance Marshal () PUnit where + marshal () = pcon PUnit diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs new file mode 100644 index 000000000..546366576 --- /dev/null +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -0,0 +1,73 @@ +module Plutarch.Test.Run (noUnusedGoldens) where + +import Control.Monad (forM_) +import Data.Set (Set) +import qualified Data.Set as Set +import qualified Data.Text as T +import Plutarch.Test.Golden (GoldenKey, defaultGoldenBasePath, goldenTestPath, mkGoldenKeyFromSpecPath) +import System.Directory (listDirectory) +import System.Exit (ExitCode (ExitFailure), exitWith) +import System.FilePath (()) +import Test.Hspec (Spec) +import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup), runSpecM) + +{- | Ensures that there are no unused goldens left behind. + + Use this on any `SpecTree` that interally uses `pgoldenSpec` to define the + golden tests. These golden file paths are accumulated, and compared to the + actual files existing on disk. If any golden file exists on disk, but is not + tracked by the `SpecTree` this function will fail, reporting the list of + untracked golden files. +-} +noUnusedGoldens :: Spec -> IO () +noUnusedGoldens spec = do + -- A second traversal here (`runSpecM`) can be obviated after + -- https://github.com/hspec/hspec/issues/649 + usedGoldens <- goldenPathsUsedBy . snd <$> runSpecM spec + unusedGoldens usedGoldens >>= \case + [] -> pure () + unused -> do + putStrLn "ERROR: Unused golden files found lying around! Namely:" + forM_ unused $ \fp -> + putStrLn $ "- " <> fp + exitWith (ExitFailure 1) + +-- | Given a list of "used" goldens, return any unused golden files on disk. +unusedGoldens :: [FilePath] -> IO [FilePath] +unusedGoldens usedGoldens' = do + let usedGoldens = foldMap knownGoldens usedGoldens' + allGoldens <- Set.fromList . fmap (defaultGoldenBasePath ) <$> listDirectory defaultGoldenBasePath + pure $ Set.toList $ allGoldens `Set.difference` usedGoldens + where + knownGoldens :: FilePath -> Set FilePath + knownGoldens fp = + Set.fromList + [ fp + , -- Inject goldens for other flag values to be comprehensive in our + -- search. + replace "dev=true" "dev=false" fp + , replace "dev=false" "dev=true" fp + ] + replace a b = T.unpack . T.replace a b . T.pack + +goldenPathsUsedBy :: [SpecTree a] -> [FilePath] +goldenPathsUsedBy trees = do + flip foldMap (queryGoldens trees) $ \k -> + flip fmap [minBound .. maxBound] $ \t -> + goldenTestPath k t + +-- | Retrieve all golden keys used by the given test tree. +queryGoldens :: [SpecTree a] -> [GoldenKey] +queryGoldens = + -- `drop 1`, to drop the hspec-discover generated root node. + fmap mkGoldenKeyFromSpecPath . concatMap (go []) + where + go ancestors = \case + Node "golden" _children -> + ancestors : [] + Node k children -> + concatMap (go $ T.pack k : ancestors) children + NodeWithCleanup _ _ trees -> + concatMap (go ancestors) trees + Leaf _ -> + mempty diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs new file mode 100644 index 000000000..6b7673db6 --- /dev/null +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -0,0 +1,394 @@ +{-# LANGUAGE ImportQualifiedPost #-} +{-# LANGUAGE TemplateHaskell #-} + +module Plutarch.FFISpec (spec) where + +import GHC.Generics (Generic) +import Generics.SOP qualified as SOP +import Plutarch (compile, printScript, printTerm) +import Plutarch.Api.V1 (PCurrencySymbol, PPubKeyHash, PScriptContext, PTokenName, PTxInfo) +import Plutarch.Evaluate (EvalError, evalScript) +import Plutarch.FFI ( + PTxList, + PTxMaybe (PTxJust, PTxNothing), + foreignExport, + foreignImport, + opaqueExport, + opaqueImport, + pmaybeFromTx, + pmaybeToTx, + ) +import Plutarch.List (pconvertLists) +import Plutarch.Prelude +import Plutarch.Rec qualified as Rec +import Plutarch.Rec.TH (deriveAll) +import Plutus.V1.Ledger.Api ( + Address (Address), + Credential (ScriptCredential), + CurrencySymbol, + DatumHash, + PubKeyHash (..), + ScriptContext (ScriptContext), + ScriptPurpose (Spending), + TxInInfo (TxInInfo, txInInfoOutRef, txInInfoResolved), + TxInfo ( + TxInfo, + txInfoDCert, + txInfoData, + txInfoFee, + txInfoId, + txInfoInputs, + txInfoMint, + txInfoOutputs, + txInfoSignatories, + txInfoValidRange, + txInfoWdrl + ), + TxOut (TxOut, txOutAddress, txOutDatumHash, txOutValue), + TxOutRef (TxOutRef), + ValidatorHash, + Value, + adaSymbol, + adaToken, + getTxId, + ) +import Plutus.V1.Ledger.Contexts qualified as Contexts +import Plutus.V1.Ledger.Interval qualified as Interval +import Plutus.V1.Ledger.Scripts (fromCompiledCode) +import Plutus.V1.Ledger.Value qualified as Value +import PlutusTx (CompiledCode, applyCode) +import PlutusTx qualified +import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinUnit) +import PlutusTx.Prelude +import Shrink (shrinkScript, shrinkScriptSp, withoutTactics) + +import Test.Hspec +import Test.Tasty.HUnit ((@?=)) + +-- import Test.Tasty.Plutus.Internal.Context (ContextBuilder (cbSignatories), TransactionConfig(..), compileSpending) +import Prelude (String) +import Prelude qualified + +printCode :: CompiledCode a -> String +printCode = printScript . fromCompiledCode + +printShrunkCode :: CompiledCode a -> String +printShrunkCode = printScript . shrink . shrink . shrink . fromCompiledCode + where + shrink = shrinkScriptSp (withoutTactics ["strongUnsubs", "weakUnsubs"]) + +printEvaluatedCode :: CompiledCode a -> Either EvalError String +printEvaluatedCode = fmap printScript . fstOf3 . evalScript . fromCompiledCode + +printShrunkTerm :: ClosedTerm a -> String +printShrunkTerm x = printScript $ shrinkScript $ compile x + +printEvaluatedTerm :: ClosedTerm a -> Either EvalError String +printEvaluatedTerm s = fmap printScript . fstOf3 . evalScript $ compile s + +fstOf3 :: (a, _, _) -> a +fstOf3 (x, _, _) = x + +doubleInPlutusTx :: CompiledCode (Integer -> Integer) +doubleInPlutusTx = $$(PlutusTx.compile [||(2 *) :: Integer -> Integer||]) + +doubleInPlutarch :: Term s (PInteger :--> PInteger) +doubleInPlutarch = plam (2 Prelude.*) + +doubleImported :: Term s (PInteger :--> PInteger) +doubleImported = foreignImport doubleInPlutusTx + +doubleExported :: PlutusTx.CompiledCode (Integer -> Integer) +doubleExported = foreignExport doubleInPlutarch + +data SampleRecord = SampleRecord + { sampleBool :: BuiltinBool + , sampleInt :: Integer + , sampleString :: BuiltinString + } + deriving stock (Generic) + deriving anyclass (SOP.Generic) + +data PSampleRecord f = PSampleRecord + { psampleBool :: f PBool + , psampleInt :: f PInteger + , psampleString :: f PString + } +$(deriveAll ''PSampleRecord) + +data PSampleRecord' (s :: S) = PSampleRecord' + { psampleBool' :: Term s PBool + , psampleInt' :: Term s PInteger + , psampleString' :: Term s PString + } + deriving stock (Generic) + deriving anyclass (SOP.Generic, PlutusType) + +importedField :: Term _ (PDelayed (Rec.PRecord PSampleRecord) :--> PInteger) +importedField = foreignImport ($$(PlutusTx.compile [||sampleInt||]) :: CompiledCode (SampleRecord -> Integer)) + +exportedField :: CompiledCode (SampleRecord -> Integer) +exportedField = + foreignExport + ( (plam $ \r -> pmatch (pforce r) $ \(Rec.PRecord rr) -> psampleInt rr) :: + Term _ (PDelayed (Rec.PRecord PSampleRecord) :--> PInteger) + ) + +getTxInfo :: Term _ (PAsData PScriptContext :--> PAsData PTxInfo) +getTxInfo = pfield @"txInfo" + +exportedTxInfo :: CompiledCode (PlutusTx.BuiltinData -> PlutusTx.BuiltinData) +exportedTxInfo = foreignExport getTxInfo + +importedTxSignedBy :: Term _ (PAsData PTxInfo :--> PAsData PPubKeyHash :--> PBool) +importedTxSignedBy = foreignImport $$(PlutusTx.compile [||txDataSignedBy||]) + where + txDataSignedBy :: BuiltinData -> BuiltinData -> BuiltinBool + txDataSignedBy tx pkh = toBuiltin $ any id (Contexts.txSignedBy <$> PlutusTx.fromBuiltinData tx <*> PlutusTx.fromBuiltinData pkh) + +importedTxSignedBy' :: Term _ (PAsData PTxInfo :--> PPubKeyHash :--> PBool) +importedTxSignedBy' = foreignImport $$(PlutusTx.compile [||txDataSignedBy||]) + where + txDataSignedBy :: BuiltinData -> PubKeyHash -> BuiltinBool + txDataSignedBy tx pkh = toBuiltin $ any id (flip Contexts.txSignedBy pkh <$> PlutusTx.fromBuiltinData tx) + +type PSValue = PSMap PCurrencySymbol (PSMap PTokenName PInteger) + +type PSMap k v = PTxList (PDelayed (PPair k v)) + +sumValueAmounts :: Term _ (PSValue :--> PInteger) +sumValueAmounts = + pfoldl + # (plam $ \s vals -> pfoldl # (plam $ \s' p -> s' Prelude.+ psnd # p) # s # (psnd # vals)) + # 0 + +pfst :: Term s (PDelayed (PPair a b) :--> a) +pfst = plam $ \p -> pmatch (pforce p) $ \(PPair x _) -> x + +psnd :: Term s (PDelayed (PPair a b) :--> b) +psnd = plam $ \p -> pmatch (pforce p) $ \(PPair _ y) -> y + +---- lifted from https://github.com/Plutonomicon/plutarch/blob/master/examples/Examples/Api.hs ---- + +{- | + An example 'PScriptContext' Term, + lifted with 'pconstant' +-} +ctx :: ScriptContext +ctx = ScriptContext info purpose + +-- | Simple script context, with minting and a single input +info :: TxInfo +info = + TxInfo + { txInfoInputs = [inp] + , txInfoOutputs = [] + , txInfoFee = mempty + , txInfoMint = val + , txInfoDCert = [] + , txInfoWdrl = [] + , txInfoValidRange = Interval.always + , txInfoSignatories = signatories + , txInfoData = [] + , txInfoId = "b0" + } + +-- | A script input +inp :: TxInInfo +inp = + TxInInfo + { txInInfoOutRef = ref + , txInInfoResolved = + TxOut + { txOutAddress = + Address (ScriptCredential validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Just datum + } + } + +val :: Value +val = Value.singleton sym "sometoken" 1 <> Value.singleton adaSymbol adaToken 2 + +ref :: TxOutRef +ref = TxOutRef "a0" 0 + +purpose :: ScriptPurpose +purpose = Spending ref + +validator :: ValidatorHash +validator = "a1" + +datum :: DatumHash +datum = "d0" + +sym :: CurrencySymbol +sym = "c0" + +signatories :: [PubKeyHash] +signatories = ["ab01fe235c", "123014", "abcdef"] + +{- | Project wide tests + + @since 0.1 +-} +spec :: Spec +spec = describe "FFI" $ do + describe "Simple types" $ do + it "integer literal" $ + printCode $$(PlutusTx.compile [||42 :: Integer||]) @?= "(program 1.0.0 42)" + it "PlutusTx integer function" $ + printCode doubleInPlutusTx @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Plutarch integer function" $ + printTerm (plam $ \(x :: Term _ PInteger) -> 2 Prelude.* x) @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Imported PlutusTx integer function" $ + printTerm doubleImported @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Exported Plutarch integer function" $ + printCode doubleExported @?= "(program 1.0.0 (\\i0 -> multiplyInteger 2 i1))" + it "Imported and applied PlutusTx integer function" $ + printTerm (plam $ \n -> doubleImported #$ doubleImported # n) + @?= "(program 1.0.0 (\\i0 -> (\\i0 -> multiplyInteger 2 i1) (multiplyInteger 2 i1)))" + it "Exported and applied Plutarch integer function" $ + printCode (doubleExported `applyCode` PlutusTx.liftCode (21 :: Integer)) + @?= "(program 1.0.0 ((\\i0 -> multiplyInteger 2 i1) 21))" + it "Bool->Integer in Plutarch" $ + printShrunkTerm (plam $ \x -> pif x (1 :: Term _ PInteger) 0) + @?= "(program 1.0.0 (\\i0 -> force (force ifThenElse i1 (delay 1) (delay 0))))" + it "Bool->Integer in PlutusTx" $ + printShrunkCode $$(PlutusTx.compile [||\x -> if x then 1 :: Integer else 0||]) + @?= "(program 1.0.0 (\\i0 -> force i1 1 0))" + it "newtype in PlutusTx" $ + printShrunkCode $$(PlutusTx.compile [||PubKeyHash||]) @?= "(program 1.0.0 (\\i0 -> i1))" + it "export unit to PlutusTx" $ + printShrunkCode (foreignExport (pconstant ()) :: CompiledCode BuiltinUnit) @?= "(program 1.0.0 ())" + it "import unit from PlutusTx" $ + printShrunkTerm (foreignImport $$(PlutusTx.compile [||toBuiltin ()||]) :: ClosedTerm PUnit) @?= "(program 1.0.0 ())" + describe "Opaque" $ do + it "Export an integer and ignore it" $ + printCode ($$(PlutusTx.compile [||const (7 :: Integer)||]) `applyCode` opaqueExport (4 :: ClosedTerm PInteger)) + @?= "(program 1.0.0 ((\\i0 -> 7) 4))" + it "Import an integer and ignore it" $ + printTerm (plam (\_ -> 4 :: ClosedTerm PInteger) # opaqueImport (PlutusTx.liftCode (7 :: Integer))) + @?= "(program 1.0.0 ((\\i0 -> 4) 7))" + describe "Records" $ do + it "PlutusTx record value" $ + printShrunkCode $$(PlutusTx.compile [||SampleRecord (toBuiltin False) 6 "Hello"||]) @?= sampleScottEncoding + it "Plutarch HKD record value" $ + printTerm (pdelay $ Rec.rcon $ PSampleRecord (pcon PFalse) 6 "Hello") @?= sampleScottEncoding + it "Plutarch SOP record value" $ + printTerm (pdelay $ pcon $ PSampleRecord' (pcon PFalse) 6 "Hello") @?= sampleScottEncoding + it "PlutusTx record function" $ + printShrunkCode $$(PlutusTx.compile [||sampleInt||]) @?= sampleScottField + it "Plutarch record function" $ + printTerm (plam $ \r -> pforce r # Rec.field psampleInt) @?= sampleScottField + it "Apply PlutusTx record function in Plutarch" $ + printShrunkTerm (importedField #$ pdelay $ pcon $ Rec.PRecord $ PSampleRecord (pcon PFalse) 6 "Hello") @?= "(program 1.0.0 6)" + it "Apply Plutarch record function in PlutusTx" $ + printShrunkCode (exportedField `applyCode` $$(PlutusTx.compile [||SampleRecord (toBuiltin False) 6 "Hello"||])) + @?= "(program 1.0.0 6)" + it "import a pair" $ + printEvaluatedTerm + ( foreignImport (PlutusTx.liftCode ("foo" :: BuiltinString, 4 :: Integer)) :: + Term _ (PDelayed (PPair PString PInteger)) + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> i1 \"foo\" 4)))" + it "import a pair" $ + printEvaluatedTerm + ( foreignImport (PlutusTx.liftCode ("foo" :: Value.TokenName, 4 :: Integer)) :: + Term _ (PDelayed (PPair PTokenName PInteger)) + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> i1 #666f6f 4)))" + describe "Maybe" $ do + it "a PlutusTx Just Integer" $ + printShrunkCode (PlutusTx.liftCode (Just 4 :: Maybe Integer)) @?= justFour + it "a converted Plutarch PJust PInteger" $ + printShrunkTerm (pmaybeToTx # (pcon (PJust 4) :: Term _ (PMaybe PInteger))) @?= justFour + it "a Plutarch PTxJust PInteger" $ + printTerm (pcon (PTxJust 4) :: Term _ (PTxMaybe PInteger)) @?= justFour + it "a converted Plutarch PTxJust PInteger" $ + printShrunkTerm (pmaybeFromTx # (pcon $ PTxJust 4) :: Term _ (PMaybe PInteger)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> i2 4))" + it "a PlutusTx Nothing" $ + printShrunkCode (PlutusTx.liftCode (Nothing :: Maybe Integer)) @?= nothing + it "a converted Plutarch PNothing" $ + printShrunkTerm (pmaybeToTx # (pcon PNothing :: Term _ (PMaybe PInteger))) @?= nothing + it "a Plutarch PTxNothing" $ + printTerm (pcon PTxNothing :: Term _ (PTxMaybe PInteger)) @?= nothing + it "a converted Plutarch PTxNothing" $ + printShrunkTerm (pmaybeFromTx # (pcon PTxNothing) :: Term _ (PMaybe PInteger)) @?= "(program 1.0.0 (\\i0 -> \\i0 -> force i1))" + it "import a Just Integer" $ + printEvaluatedTerm (foreignImport (PlutusTx.liftCode (Just 4 :: Maybe Integer)) :: Term _ (PTxMaybe PInteger)) @?= Right justFour + it "export a PTxJust PInteger" $ + printEvaluatedCode + ( (foreignExport (pcon (PTxJust 4) :: Term _ (PTxMaybe PInteger))) :: + CompiledCode (Maybe Integer) + ) + @?= Right justFour + describe "Lists" $ do + it "a PlutusTx list of integers" $ + printShrunkCode (PlutusTx.liftCode [1 :: Integer .. 3]) @?= oneTwoThree + it "import a list of integers" $ + printEvaluatedTerm (foreignImport (PlutusTx.liftCode [1 :: Integer .. 3]) :: Term _ (PTxList PInteger)) @?= Right oneTwoThree + it "import and map over a Value" $ + printEvaluatedTerm (pmap # pfst # (foreignImport (PlutusTx.liftCode val) :: Term _ PSValue)) + @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1 #c0 (delay (\\i0 -> \\i0 -> i1 # (delay (\\i0 -> \\i0 -> i2)))))))" + it "import and fold over a Value" $ + printEvaluatedTerm + (sumValueAmounts # (foreignImport (PlutusTx.liftCode val) :: Term _ PSValue)) + @?= Right "(program 1.0.0 3)" + it "export a list of integers" $ + printEvaluatedCode + ( foreignExport (pconvertLists #$ pconstant @(PBuiltinList PInteger) [1 .. 3] :: Term _ (PTxList PInteger)) :: + CompiledCode [Integer] + ) + @?= Right oneTwoThree + it "export a fold and apply it to a Value" $ + printEvaluatedCode + ((foreignExport sumValueAmounts :: CompiledCode (Value -> Integer)) `PlutusTx.applyCode` PlutusTx.liftCode val) + @?= Right "(program 1.0.0 3)" + + describe "Data" $ do + describe "Export and use a PData :--> PData function" $ do + it "evaluate a field" $ + printEvaluatedCode + ( $$(PlutusTx.compile [||\gti ctx -> maybe "undecoded" (getTxId . txInfoId) (PlutusTx.fromBuiltinData (gti ctx))||]) + `applyCode` exportedTxInfo + `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) + ) + @?= Right "(program 1.0.0 #b0)" + it "evaluate a function to True" $ + printEvaluatedCode + ( $$(PlutusTx.compile [||\gti ctx pkh -> any (`Contexts.txSignedBy` pkh) (PlutusTx.fromBuiltinData (gti ctx))||]) + `applyCode` exportedTxInfo + `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) + `applyCode` PlutusTx.liftCode (head signatories) + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i2)))" + it "evaluate a function to False" $ + printEvaluatedCode + ( $$(PlutusTx.compile [||\gti ctx pkh -> any (`Contexts.txSignedBy` pkh) (PlutusTx.fromBuiltinData (gti ctx))||]) + `applyCode` exportedTxInfo + `applyCode` PlutusTx.liftCode (PlutusTx.toBuiltinData ctx) + `applyCode` PlutusTx.liftCode "0123" + ) + @?= Right "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1)))" + + describe "Import and use a BuiltinData -> x function" $ do + it "evaluate a Data -> Data -> Bool function to True" $ + printEvaluatedTerm (importedTxSignedBy # pconstantData info # pconstantData (head signatories)) + @?= Right "(program 1.0.0 True)" + it "evaluate a Data -> Data -> Bool function to False" $ + printEvaluatedTerm (importedTxSignedBy # pconstantData info # pconstantData "0123") + @?= Right "(program 1.0.0 False)" + it "evaluate a Data -> PubKeyHash -> Bool function to True" $ + printEvaluatedTerm (importedTxSignedBy' # pconstantData info # pconstant (head signatories)) + @?= Right "(program 1.0.0 True)" + it "evaluate a Data -> PubKeyHash -> Bool function to False" $ + printEvaluatedTerm (importedTxSignedBy' # pconstantData info # pconstant "0123") + @?= Right "(program 1.0.0 False)" + where + sampleScottEncoding = "(program 1.0.0 (delay (\\i0 -> i1 False 6 \"Hello\")))" + sampleScottField = "(program 1.0.0 (\\i0 -> force i1 (\\i0 -> \\i0 -> \\i0 -> i2)))" + oneTwoThree, justFour :: String + oneTwoThree = "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1 1 (delay (\\i0 -> \\i0 -> i1 2 (delay (\\i0 -> \\i0 -> i1 3 (delay (\\i0 -> \\i0 -> i2)))))))))" + justFour = "(program 1.0.0 (delay (\\i0 -> \\i0 -> i2 4)))" + nothing = "(program 1.0.0 (delay (\\i0 -> \\i0 -> i1)))" diff --git a/plutarch-test/src/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs similarity index 56% rename from plutarch-test/src/Plutarch/FieldSpec.hs rename to plutarch-test/conditional/Plutarch/FieldSpec.hs index 2aefba9cc..fc3ca8b76 100644 --- a/plutarch-test/src/Plutarch/FieldSpec.hs +++ b/plutarch-test/conditional/Plutarch/FieldSpec.hs @@ -1,120 +1,91 @@ {-# LANGUAGE OverloadedRecordDot #-} -{-# LANGUAGE UndecidableInstances #-} module Plutarch.FieldSpec (spec) where -import Test.Tasty.HUnit - -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) -import Plutarch -import Plutarch.DataRepr ( - PDataFields, - PIsDataReprInstances (PIsDataReprInstances), - ) -import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) - +import Plutus.V1.Ledger.Address (Address (Address)) +import Plutus.V1.Ledger.Credential (Credential (PubKeyCredential)) import qualified PlutusCore as PLC import qualified PlutusTx +import Test.Tasty.HUnit +import Plutarch.Api.V1 (PAddress (PAddress)) +import Plutarch.Builtin (ppairDataBuiltin) import Plutarch.Prelude +import Plutarch.SpecTypes (PTriplet) import Plutarch.Test +import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) +import Test.Hspec spec :: Spec spec = do describe "field" $ do -- example: Trips - describe "trips" $ do + describe "trips" . pgoldenSpec $ do -- compilation - describe "tripSum" $ do - golden All tripSum - describe "getY" $ do - golden All getY - describe "tripYZ" $ do - golden All tripYZ - -- tests - describe "tripSum # tripA = 1000" $ do - let p = 1000 - it "works" $ plift (tripSum # tripA) @?= p - describe "tripSum # tripB = 100" $ do - let p = 100 - it "works" $ plift (tripSum # tripB) @?= p - describe "tripSum # tripC = 10" $ do - let p = 10 - it "works" $ plift (tripSum # tripC) @?= p - describe "tripYZ = tripZY" $ - it "works" $ tripZY #@?= tripYZ + "lam" @\ do + "tripSum" @| tripSum + "getY" @| getY + "tripYZ" @| tripYZ + "tripSum" @\ do + "A" @| tripSum # tripA @-> \p -> + plift p @?= 1000 + "B" @| tripSum # tripB @-> \p -> + plift p @?= 100 + "C" @| tripSum # tripC @-> \p -> + plift p @?= 10 + "tripYZ=tripZY" @| tripZY @== tripYZ -- rangeFields - describe "rangeFields" $ do + describe "rangeFields" . pgoldenSpec $ do -- compilation - describe "rangeFields" $ do - golden All rangeFields - -- tests - describe "rangeFields someFields = 11" $ do - let p = 11 - it "works" $ plift (rangeFields # someFields) @?= p + "lam" @| rangeFields + "app" @| rangeFields # someFields @-> \p -> plift p @?= 11 -- dropFields - describe "dropFields" $ do + describe "dropFields" . pgoldenSpec $ do -- compilation - describe "dropFields" $ do - golden All dropFields - -- tests - describe "dropFields someFields = 17" $ do - let p = 17 - it "works" $ plift (dropFields # someFields) @?= p + "lam" @| dropFields + "app" @| dropFields # someFields @-> \p -> plift p @?= 17 -- pletFields - describe "pletFields" $ do + describe "pletFields" . pgoldenSpec $ do -- compilation - describe "letSomeFields" $ do - golden All letSomeFields - describe "nFields" $ do - golden All nFields - -- tests - describe "letSomeFields = letSomeFields'" $ do - it "works" $ letSomeFields #@?= letSomeFields' - describe "letSomeFields someFields = 14" $ do - let p = 14 - it "works" $ plift (letSomeFields # someFields) @?= p - describe "nFields someFields = 1" $ do - let p = 1 - it "works" $ plift (nFields # someFields) @?= p - describe "other" $ do - -- tests - describe "by = 10" $ do - let p = 10 - it "works" $ plift by @?= p - describe "dotPlus = 19010" $ do - let p = 19010 - it "works" $ plift dotPlus @?= p + "letSomeFields" @\ do + "lam" @| letSomeFields + "order" @| letSomeFields' @== letSomeFields + "app" @| letSomeFields # someFields @-> \p -> plift p @?= 14 + "nFields" @\ do + "lam" @| nFields + "app" @| nFields # someFields @-> \p -> plift p @?= 1 + describe "other" . pgoldenSpec $ do + "by" @| by @-> \p -> plift p @?= 10 + "dotPlus" @| dotPlus @-> \p -> plift p @?= 19010 + describe "data" . pgoldenSpec $ do + "pmatch-pfield" @\ do + -- These two should ideally have the exact same efficiency. + "pmatch" @\ do + "newtype" + @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing + in pmatch addr $ \(PAddress addrFields) -> + pletFields @'["credential", "stakingCredential"] addrFields $ \y -> + ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y + "pfield" @\ do + "newtype" + @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing + in pletFields @'["credential", "stakingCredential"] addr $ \y -> + ppairDataBuiltin # hrecField @"credential" y # hrecField @"stakingCredential" y + "pfield-pletFields" @\ do + "pfield" @\ do + "single" + @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing + in pfromData $ pfield @"credential" # addr + "pletFields" @\ do + "single" + @| let addr = pconstant $ Address (PubKeyCredential "ab") Nothing + in pletFields @'["credential"] addr $ \y -> + pfromData $ hrecField @"credential" y -------------------------------------------------------------------------------- -{- | - We can defined a data-type using PDataRecord, with labeled fields. - - With an appropriate instance of 'PIsDataRepr', we can automatically - derive 'PDataFields'. --} -newtype Triplet (a :: PType) (s :: S) - = Triplet - ( Term - s - ( PDataRecord - '[ "x" ':= a - , "y" ':= a - , "z" ':= a - ] - ) - ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields) - via (PIsDataReprInstances (Triplet a)) - mkTrip :: - forall a s. (PIsData a) => Term s a -> Term s a -> Term s a -> Term s (Triplet a) + forall a s. (PIsData a) => Term s a -> Term s a -> Term s a -> Term s (PTriplet a) mkTrip x y z = punsafeBuiltin PLC.ConstrData # (0 :: Term _ PInteger) # ( ( pcons # (pdata x) @@ -126,19 +97,19 @@ mkTrip x y z = ) -- | An example term -tripA :: Term s (Triplet PInteger) +tripA :: Term s (PTriplet PInteger) tripA = mkTrip 150 750 100 -- | Another -tripB :: Term s (Triplet PInteger) +tripB :: Term s (PTriplet PInteger) tripB = mkTrip 50 10 40 -- | Another -tripC :: Term s (Triplet PInteger) +tripC :: Term s (PTriplet PInteger) tripC = mkTrip 1 8 1 --- | Nested triplet -tripTrip :: Term s (Triplet (Triplet PInteger)) +-- | Nested PTriplet +tripTrip :: Term s (PTriplet (PTriplet PInteger)) tripTrip = mkTrip tripA tripB tripC {- | @@ -148,7 +119,7 @@ tripTrip = mkTrip tripA tripB tripC The fields in the 'HRec' can them be accessed with RecordDotSyntax. -} -tripSum :: Term s ((Triplet PInteger) :--> PInteger) +tripSum :: Term s ((PTriplet PInteger) :--> PInteger) tripSum = plam $ \x -> pletFields @["x", "y", "z"] x $ \fs -> @@ -159,7 +130,7 @@ tripSum = {- | A subset of fields can be specified. -} -tripYZ :: Term s ((Triplet PInteger) :--> PInteger) +tripYZ :: Term s ((PTriplet PInteger) :--> PInteger) tripYZ = plam $ \x -> pletFields @["y", "z"] x $ \fs -> @@ -169,7 +140,7 @@ tripYZ = The ordering of fields specified is irrelevant, this is equivalent to 'tripYZ'. -} -tripZY :: Term s ((Triplet PInteger) :--> PInteger) +tripZY :: Term s ((PTriplet PInteger) :--> PInteger) tripZY = plam $ \x -> pletFields @["z", "y"] x $ \fs -> @@ -184,7 +155,7 @@ tripZY = by :: Term s PInteger by = pfield @"y" # tripB -getY :: Term s (Triplet PInteger :--> PAsData PInteger) +getY :: Term s (PTriplet PInteger :--> PAsData PInteger) getY = pfield @"y" {- | diff --git a/plutarch-test/conditional/Plutarch/MonadicSpec.hs b/plutarch-test/conditional/Plutarch/MonadicSpec.hs new file mode 100644 index 000000000..7b772f496 --- /dev/null +++ b/plutarch-test/conditional/Plutarch/MonadicSpec.hs @@ -0,0 +1,92 @@ +{-# LANGUAGE OverloadedRecordDot #-} +{-# LANGUAGE QualifiedDo #-} + +module Plutarch.MonadicSpec (spec) where + +import Plutarch.Api.V1 ( + PAddress (PAddress), + PCredential, + PMaybeData, + PPubKeyHash, + PScriptContext, + PScriptPurpose (PSpending), + PStakingCredential, + ) +import qualified Plutarch.ApiSpec as ApiSpec +import qualified Plutarch.Monadic as P +import Plutarch.Prelude +import Plutarch.Test +import Plutus.V1.Ledger.Api +import Test.Hspec + +spec :: Spec +spec = do + describe "monadic" $ do + {- TODO: Uncomment this after flakiness is fixed + See https://github.com/Plutonomicon/plutarch/issues/290 + -} + {- describe "pmatch-twice" . pgoldenSpec $ do + -- We expect all these benchmarks to produce equivalent numbers + let integerList :: [Integer] -> Term s (PList PInteger) + integerList xs = List.pconvertLists #$ pconstant @(PBuiltinList PInteger) xs + xs = integerList [1 .. 10] + "normal" + @| pmatch xs + $ \case + PSCons _x xs' -> do + pmatch xs' $ \case + PSCons _ xs'' -> + xs'' + PSNil -> perror + PSNil -> perror + "do" + @| P.do + PSCons _ xs' <- pmatch xs + PSCons _ xs'' <- pmatch xs' + xs'' + "cont" + @| flip runCont id + $ do + ls <- cont $ pmatch xs + case ls of + PSCons _ xs' -> do + ls' <- cont $ pmatch xs' + case ls' of + PSCons _ xs'' -> pure xs'' + PSNil -> pure perror + PSNil -> pure perror + "termcont" + @| unTermCont + $ do + PSCons _ xs' <- TermCont $ pmatch xs + PSCons _ xs'' <- TermCont $ pmatch xs' + pure xs'' + -} + describe "api.example" $ do + -- The checkSignatory family of functions implicitly use tracing due to + -- monadic syntax, and as such we need two sets of tests here. + describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do + let aSig :: PubKeyHash = "ab01fe235c" + "do" @\ do + "succeeds" @| checkSignatory # pconstant aSig # ApiSpec.ctx @-> psucceeds + "fails" @| checkSignatory # pconstant "41" # ApiSpec.ctx @-> pfails + describe "getFields" . pgoldenSpec $ do + "0" @| getFields + +checkSignatory :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) +checkSignatory = plam $ \ph ctx' -> + pletFields @["txInfo", "purpose"] ctx' $ \ctx -> P.do + PSpending _ <- pmatch $ ctx.purpose + let signatories = pfield @"signatories" # ctx.txInfo + pif + (pelem # pdata ph # pfromData signatories) + -- Success! + (pconstant ()) + -- Signature not present. + perror + +getFields :: Term s (PAddress :--> PDataRecord '["credential" ':= PCredential, "stakingCredential" ':= PMaybeData PStakingCredential]) +getFields = phoistAcyclic $ + plam $ \addr -> P.do + PAddress addrFields <- pmatch addr + addrFields diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs new file mode 100644 index 000000000..a72ffded3 --- /dev/null +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -0,0 +1,494 @@ +{-# LANGUAGE OverloadedRecordDot #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.TryFromSpec (spec) where + +-- Haskell imports +import qualified GHC.Generics as GHC + +import Generics.SOP (Generic, I (I)) + +-- Plutus and PlutusTx imports +import Plutus.V1.Ledger.Api ( + Address (Address), + Credential (ScriptCredential), + Datum (Datum), + DatumHash, + ScriptContext (ScriptContext), + ToData (toBuiltinData), + TxInfo (txInfoData, txInfoOutputs), + TxOut (TxOut, txOutAddress, txOutDatumHash, txOutValue), + ) + +import PlutusTx ( + Data (B, Constr, I), + ) + +-- Plutarch imports +import Plutarch.Prelude + +import Plutarch.Test + +import Plutarch.Unsafe ( + punsafeCoerce, + ) + +import Plutarch.Api.V1 ( + PAddress, + PDatum, + PDatumHash, + PMaybeData (PDJust), + PScriptContext, + PScriptPurpose (PSpending), + PTuple, + PTxInInfo, + PTxInfo, + PTxOut, + PTxOutRef, + PValidator, + ) + +import Plutarch.Builtin ( + PBuiltinMap, + pforgetData, + ppairDataBuiltin, + ) + +import Plutarch.TryFrom ( + PTryFrom, + PTryFromExcess, + ptryFrom, + ptryFrom', + ) + +import Plutarch.Reducible (Reduce, Reducible) + +import Plutarch.ApiSpec (info, purpose) +import qualified Plutarch.ApiSpec as Api + +import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) + +import GHC.Records (getField) +import Test.Hspec + +spec :: Spec +spec = do + describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do + "erroneous" @\ do + "(String, Integer) /= (String, String)" + @| checkDeep + @(PBuiltinPair (PAsData PInteger) (PAsData PByteString)) + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) + @-> pfails + "[String] /= [Integer]" + @| checkDeep + @(PBuiltinList (PAsData PByteString)) + @(PBuiltinList (PAsData PInteger)) + (pdata $ (pcons # (pdata $ pconstant 3)) #$ (psingleton # (pdata $ pconstant 4))) + @-> pfails + "A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer }" + @| checkDeep + @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) + @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) + (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) + @-> pfails + "Map Int String /= Map Int Int" + @| mapTestFails @-> pfails + "PDataSum constr 2" + @| checkDeep + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString]]) + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + (punsafeCoerce $ pconstant $ Constr 1 [PlutusTx.I 5, B "foo"]) + @-> pfails + "PDataSum wrong record type" + @| checkDeep + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PByteString, "b4" ':= PByteString]]) + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + (punsafeCoerce $ pconstant $ Constr 2 [PlutusTx.I 5, B "foo"]) + @-> pfails + "working" @\ do + "(String, String) == (String, String)" + @| checkDeep + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) + @-> psucceeds + "[String] == [String]" + @| checkDeep + @(PBuiltinList (PAsData PByteString)) + @(PBuiltinList (PAsData PByteString)) + (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) + @-> psucceeds + "A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer }" + @| checkDeep + @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) + @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) + (pdata (pdcons @"foo" # (pdata $ pconstant 7) #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) + @-> psucceeds + "A { test := Integer, test2 := Integer } == [Integer]" + @| checkDeep + @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) + @(PBuiltinList (PAsData PInteger)) + (pdata (pcons # (pdata $ pconstant 7) #$ pcons # (pdata $ pconstant 42) # pnil)) + @-> psucceeds + "A { test := String, test2 := Integer } == { test := String, test2 := Integer }" + @| checkDeep + @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) + @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) + (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) + @-> psucceeds + "Map Int String == Map Int String" + @| mapTestSucceeds @-> psucceeds + "PDataSum constr 0" + @| checkDeep + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + (punsafeCoerce $ pconstant $ Constr 0 [PlutusTx.I 5, B "foo"]) + @-> psucceeds + "PDataSum constr 1" + @| checkDeep + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) + (punsafeCoerce $ pconstant $ Constr 1 [PlutusTx.I 5, B "foo"]) + @-> psucceeds + "recover PWrapInt" + @| pconstant 42 #== (unTermCont $ snd <$> tcont (ptryFrom @(PAsData PWrapInt) (pforgetData $ pdata $ pconstant @PInteger 42))) + @-> passert + "recovering a record partially vs completely" @\ do + "partially" + @| checkDeep + @(PDataRecord '["foo" ':= PInteger, "bar" ':= PData]) + @(PDataRecord '["foo" ':= PInteger, "bar" ':= PByteString]) + (pdata $ pdcons @"foo" # (pdata $ pconstant 3) #$ pdcons @"bar" # (pdata $ pconstant "baz") # pdnil) + @-> psucceeds + "completely" + @| checkDeep + @(PDataRecord '["foo" ':= PInteger, "bar" ':= PByteString]) + @(PDataRecord '["foo" ':= PInteger, "bar" ':= PByteString]) + (pdata (pdcons @"foo" # (pdata $ pconstant 3) #$ pdcons @"bar" # (pdata $ pconstant "baz") # pdnil)) + @-> psucceeds + "removing the data wrapper" @\ do + "erroneous" @\ do + "(String, Integer) /= (String, String)" + @| checkDeepUnwrap + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + @(PBuiltinPair (PAsData PInteger) (PAsData PByteString)) + (pdata $ ppairDataBuiltin # (pdata $ pconstant 42) # (pdata $ pconstant "bar")) + @-> pfails + "[String] /= [Integer]" + @| ( checkDeepUnwrap + @(PBuiltinList (PAsData PInteger)) + @(PBuiltinList (PAsData PByteString)) + (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "baz"))) + ) + @-> pfails + "working" @\ do + "(String, String) == (String, String)" + @| ( checkDeepUnwrap + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + @(PBuiltinPair (PAsData PByteString) (PAsData PByteString)) + (pdata $ ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant "bar")) + ) + @-> psucceeds + "[String] == [String]" + @| checkDeepUnwrap + @(PBuiltinList (PAsData PByteString)) + @(PBuiltinList (PAsData PByteString)) + (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) + @-> psucceeds + "partial checks" @\ do + -- this is way more expensive ... + "check whole structure" + @| fullCheck @-> psucceeds + -- ... than this + "check structure partly" + @| partialCheck @-> psucceeds + "recovering a nested record" @\ do + "succeeds" + @| checkDeep + @(PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])]) + @(PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])]) + (pdata $ pdcons # (pdata $ pdcons # pdata (pconstant 42) # pdnil) # pdnil) + @-> psucceeds + "fails" + @| checkDeep + @(PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PByteString])]) + @(PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])]) + (pdata $ pdcons # (pdata $ pdcons # pdata (pconstant 42) # pdnil) # pdnil) + @-> pfails + "sample usage contains the right value" + @| pconstant 42 #== theField @-> passert + "example" @\ do + let validContext0 = ctx validOutputs0 validList1 + invalidContext1 = ctx invalidOutputs1 validList1 + l1 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) + l1 = toDatadList [1 .. 5] + l2 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) + l2 = toDatadList [6 .. 10] + l3 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) + l3 = toDatadList [6 .. 9] + l4 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) + l4 = toDatadList [6, 8, 8, 9, 10] + "concatenate two lists, legal" + @| validator # pforgetData l1 # pforgetData l2 # validContext0 @-> psucceeds + "concatenate two lists, illegal (list too short)" + @| validator # pforgetData l1 # pforgetData l3 # validContext0 @-> pfails + "concatenate two lists, illegal (wrong elements in list)" + @| validator # pforgetData l1 # pforgetData l4 # validContext0 @-> pfails + "concatenate two lists, illegal (more than one output)" + @| validator # pforgetData l1 # pforgetData l2 # invalidContext1 @-> pfails + "example2" @\ do + "recovering a record succeeds" + @| recoverAB @-> psucceeds + +------------------- Checking deeply, shallowly and unwrapping ---------------------- + +checkDeep :: + forall (target :: PType) (actual :: PType). + ( PTryFrom PData (PAsData target) + , PIsData actual + , PIsData target + ) => + ClosedTerm (PAsData actual) -> + ClosedTerm (PAsData target) +checkDeep t = unTermCont $ fst <$> TermCont (ptryFrom @(PAsData target) $ pforgetData t) + +checkDeepUnwrap :: + forall (target :: PType) (actual :: PType) (s :: S). + ( PTryFrom PData (PAsData target) + , PIsData actual + , PIsData target + ) => + Term s (PAsData actual) -> + Term s (PAsData target) +checkDeepUnwrap t = unTermCont $ fst <$> TermCont (ptryFrom @(PAsData target) $ pforgetData t) + +sampleStructure :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) +sampleStructure = pdata $ psingleton #$ pdata $ psingleton #$ toDatadList [1 .. 100] + +-- | PData serves as the base case for recursing into the structure +partialCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList PData)))) +partialCheck = + let dat :: Term _ PData + dat = pforgetData sampleStructure + in unTermCont $ fst <$> TermCont (ptryFrom dat) + +fullCheck :: Term _ (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData (PBuiltinList (PAsData PInteger))))))) +fullCheck = unTermCont $ fst <$> TermCont (ptryFrom $ pforgetData sampleStructure) + +------------------- Example: untrusted Redeemer ------------------------------------ + +newtype PNatural (s :: S) = PMkNatural (Term s PInteger) + deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PNatural PInteger) + +-- | partial +pmkNatural :: Term s (PInteger :--> PNatural) +pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) + +newtype Flip f b a = Flip (f a b) + +instance Reducible (f a b) => Reducible (Flip f b a) where + type Reduce (Flip f b a) = Reduce (f a b) + +instance PTryFrom PData (PAsData PNatural) where + type PTryFromExcess PData (PAsData PNatural) = Flip Term PNatural + ptryFrom' opq = runTermCont $ do + (ter, exc) <- TermCont $ ptryFrom @(PAsData PInteger) opq + ver <- tcont $ plet $ pmkNatural #$ exc + pure $ (punsafeCoerce ter, ver) + +validator :: Term s PValidator +validator = phoistAcyclic $ + plam $ \dat red ctx -> unTermCont $ do + trustedRedeemer <- (\(snd -> red) -> red) <$> (TermCont $ ptryFrom @(PAsData (PBuiltinList (PAsData PNatural))) red) + let trustedDatum :: Term _ (PBuiltinList (PAsData PNatural)) + trustedDatum = pfromData $ punsafeCoerce dat + -- make the Datum and Redeemer trusted + + txInfo :: (Term _ PTxInfo) <- tcont $ plet $ pfield @"txInfo" # ctx + + PJust ownInput <- tcont $ pmatch $ pfindOwnInput # ctx + resolved <- tcont $ pletFields @["address", "datumHash"] $ pfield @"resolved" # ownInput + + let ownAddress :: Term _ PAddress + ownAddress = resolved.address + -- find own script address matching DatumHash + + ownHash :: Term _ PDatumHash + ownHash = unTermCont $ do + PDJust dhash <- tcont $ pmatch resolved.datumHash + pure $ pfield @"_0" # dhash + + data' :: Term _ (PBuiltinList (PAsData (PTuple PDatumHash PDatum))) + data' = pfield @"data" # txInfo + + outputs :: Term _ (PBuiltinList (PAsData PTxOut)) + outputs = pfield @"outputs" # txInfo + -- find the list of the outputs + + matchingHashDatum :: Term _ (PBuiltinList PDatum) + matchingHashDatum = + precList + ( \self x xs -> pletFields @["_0", "_1"] x $ + \tup -> + ptrace "iteration" $ + pif + (tup._0 #== ownHash) + (ptrace "appended something" pcons # (tup._1) # (self # xs)) + (ptrace "called without appending" self # xs) + ) + (const pnil) + #$ data' + -- filter and map at the same time, as there is no efficient way + -- to do that with tools available, I wrote it by hand + + singleOutput :: Term _ PBool + singleOutput = pnull #$ ptail #$ pfilter # pred # outputs + where + pred :: Term _ (PAsData PTxOut :--> PBool) + pred = plam $ \out -> unTermCont $ do + pure $ pfield @"address" # out #== (pdata $ ownAddress) + + -- make sure that after filtering the outputs, only one output + -- remains + + resultList :: Term _ (PAsData (PBuiltinList (PAsData PNatural))) + resultList = pdata $ pconcat # trustedDatum # trustedRedeemer + -- the resulting list with trusted datum and trusted redeemer + + isValid :: Term _ PBool + isValid = pif singleOutput (pto (phead # matchingHashDatum) #== pforgetData resultList) (pcon PFalse) + -- the final check for validity + pure $ + pif isValid (popaque $ pcon PUnit) (ptraceError "not valid") + +pfindOwnInput :: Term s (PScriptContext :--> PMaybe (PAsData PTxInInfo)) +pfindOwnInput = phoistAcyclic $ + plam $ \ctx' -> unTermCont $ do + ctx <- tcont $ pletFields @["txInfo", "purpose"] ctx' + PSpending txoutRef <- tcont $ pmatch $ ctx.purpose + let txInInfos :: Term _ (PBuiltinList (PAsData PTxInInfo)) + txInInfos = pfield @"inputs" #$ ctx.txInfo + target :: Term _ PTxOutRef + target = pfield @"_0" # txoutRef + pred :: Term _ (PAsData PTxInInfo :--> PBool) + pred = plam $ \actual -> + (pfield @"id" # target) #== (pfield @"id" #$ pfield @"outRef" # pfromData actual) + pure $ pfind # pred # txInInfos + +------------------- Mocking a ScriptContext ---------------------------------------- + +ctx :: [TxOut] -> [(DatumHash, Datum)] -> Term s PScriptContext +ctx outs l = pconstant (ScriptContext (info' outs l) purpose) + +info' :: [TxOut] -> [(DatumHash, Datum)] -> TxInfo +info' outs dat = + info + { txInfoData = dat + , txInfoOutputs = outs + } + +validOutputs0 :: [TxOut] +validOutputs0 = + [ TxOut + { txOutAddress = + Address (ScriptCredential Api.validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Just Api.datum + } + ] + +invalidOutputs1 :: [TxOut] +invalidOutputs1 = + [ TxOut + { txOutAddress = + Address (ScriptCredential Api.validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Just Api.datum + } + , TxOut + { txOutAddress = + Address (ScriptCredential Api.validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Nothing + } + ] + +validList1 :: [(DatumHash, Datum)] +validList1 = + let dat :: Datum + dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] + in [("d0", dat)] + +------------------- Helpers -------------------------------------------------------- + +toDatadList :: [Integer] -> Term s (PAsData (PBuiltinList (PAsData PInteger))) +toDatadList = pdata . (foldr go pnil) + where + go :: Integer -> Term _ (PBuiltinList (PAsData PInteger)) -> Term _ (PBuiltinList (PAsData PInteger)) + go i acc = pcons # (pdata $ pconstant i) # acc + +------------------- Special cases for maps ----------------------------------------- + +mapTestSucceeds :: ClosedTerm (PAsData (PBuiltinMap PByteString PInteger)) +mapTestSucceeds = unTermCont $ do + (val, _) <- TermCont $ ptryFrom $ pforgetData sampleMap + pure val + +mapTestFails :: ClosedTerm (PAsData (PBuiltinMap PInteger PInteger)) +mapTestFails = unTermCont $ do + (val, _) <- TermCont $ ptryFrom $ pforgetData sampleMap + pure val + +sampleMap :: Term _ (PAsData (PBuiltinMap PByteString PInteger)) +sampleMap = + pdata $ + pcons + # (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant 42)) #$ pcons + # (ppairDataBuiltin # (pdata $ pconstant "bar") # (pdata $ pconstant 41)) + # pnil + +------------------- Sample type with PIsDataRepr ----------------------------------- + +sampleAB :: Term s (PAsData PAB) +sampleAB = pdata $ pcon $ PA (pdcons @"_0" # (pdata $ pconstant 4) #$ pdcons # (pdata $ pconstant "foo") # pdnil) + +sampleABdata :: Term s PData +sampleABdata = pforgetData sampleAB + +recoverAB :: Term s (PAsData PAB) +recoverAB = unTermCont $ fst <$> (tcont $ ptryFrom sampleABdata) + +data PAB (s :: S) + = PA (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PByteString])) + | PB (Term s (PDataRecord '["_0" ':= PBuiltinList (PAsData PInteger), "_1" ':= PByteString])) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData) + via PIsDataReprInstances PAB + +-- here we can derive the `PTryFrom` instance for PAB via the newtype wrapper +-- `PIsDataReprInstances` +deriving via PAsData (PIsDataReprInstances PAB) instance PTryFrom PData (PAsData PAB) + +------------------- Sample usage with recovered record type ------------------------ + +untrustedRecord :: Term s PData +untrustedRecord = + let rec :: Term s (PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) + rec = pdata $ pdcons # (pdata $ pdcons # pdata (pconstant 42) # pdnil) # pdnil + in pforgetData rec + +theField :: Term s PInteger +theField = unTermCont $ do + (_, exc) <- tcont (ptryFrom @(PAsData (PDataRecord '["_0" ':= (PDataRecord '["_1" ':= PInteger])])) untrustedRecord) + pure $ snd . getField @"_1" . snd . snd . getField @"_0" . snd $ exc + +------------------- Sample usage DerivePNewType ------------------------------------ + +newtype PWrapInt (s :: S) = PMkWrapInt (Term s PInteger) + deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PWrapInt PInteger) + +deriving via DerivePNewtype (PAsData PWrapInt) (PAsData PInteger) instance PTryFrom PData (PAsData PWrapInt) diff --git a/plutarch-test/goldens/api.ctx.bench.golden b/plutarch-test/goldens/api.ctx.bench.golden new file mode 100644 index 000000000..46308ed55 --- /dev/null +++ b/plutarch-test/goldens/api.ctx.bench.golden @@ -0,0 +1,7 @@ +term {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":140} +get.txInfo {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} +get.mint {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} +get.credentials {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} +get.sym {"exBudgetCPU":3825799,"exBudgetMemory":6816,"scriptSizeBytes":188} +ScriptPurpose.literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":48} +ScriptPurpose.decode {"exBudgetCPU":1570478,"exBudgetMemory":3498,"scriptSizeBytes":74} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.credentials.bench.golden b/plutarch-test/goldens/api.ctx.get.credentials.bench.golden deleted file mode 100644 index d158e9e3f..000000000 --- a/plutarch-test/goldens/api.ctx.get.credentials.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.credentials.uplc.eval.golden b/plutarch-test/goldens/api.ctx.get.credentials.uplc.eval.golden deleted file mode 100644 index 761dcf417..000000000 --- a/plutarch-test/goldens/api.ctx.get.credentials.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 [#41a1]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.credentials.uplc.golden b/plutarch-test/goldens/api.ctx.get.credentials.uplc.golden deleted file mode 100644 index bffa1ca61..000000000 --- a/plutarch-test/goldens/api.ctx.get.credentials.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (i5 i1)) (i2 (i4 i1))))))) (\i0 -> i3 (i5 (unConstrData ((\i0 -> i4 (i5 i1)) ((\i0 -> i4 (i5 i1)) (i3 (i2 (i4 i1)))))))) ((\i0 -> unListData (i3 (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.mint.bench.golden b/plutarch-test/goldens/api.ctx.get.mint.bench.golden deleted file mode 100644 index 45672ad50..000000000 --- a/plutarch-test/goldens/api.ctx.get.mint.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.mint.uplc.eval.golden b/plutarch-test/goldens/api.ctx.get.mint.uplc.eval.golden deleted file mode 100644 index 3a63e9a6d..000000000 --- a/plutarch-test/goldens/api.ctx.get.mint.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #a141c0a149736f6d65746f6b656e01) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.mint.uplc.golden b/plutarch-test/goldens/api.ctx.get.mint.uplc.golden deleted file mode 100644 index 9dc0fb79f..000000000 --- a/plutarch-test/goldens/api.ctx.get.mint.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.sym.bench.golden b/plutarch-test/goldens/api.ctx.get.sym.bench.golden deleted file mode 100644 index 4964f58c5..000000000 --- a/plutarch-test/goldens/api.ctx.get.sym.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":3825799,"exBudgetMemory":6816,"scriptSizeBytes":188} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.sym.uplc.eval.golden b/plutarch-test/goldens/api.ctx.get.sym.uplc.eval.golden deleted file mode 100644 index 92ecc58c0..000000000 --- a/plutarch-test/goldens/api.ctx.get.sym.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #c0) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.sym.uplc.golden b/plutarch-test/goldens/api.ctx.get.sym.uplc.golden deleted file mode 100644 index ad9dfedcc..000000000 --- a/plutarch-test/goldens/api.ctx.get.sym.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> force (force fstPair) (i3 i1)) (unMapData ((\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.txInfo.bench.golden b/plutarch-test/goldens/api.ctx.get.txInfo.bench.golden deleted file mode 100644 index bd11f8ac9..000000000 --- a/plutarch-test/goldens/api.ctx.get.txInfo.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.txInfo.uplc.eval.golden b/plutarch-test/goldens/api.ctx.get.txInfo.uplc.eval.golden deleted file mode 100644 index 5d2ba94aa..000000000 --- a/plutarch-test/goldens/api.ctx.get.txInfo.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #d8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffff) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.get.txInfo.uplc.golden b/plutarch-test/goldens/api.ctx.get.txInfo.uplc.golden deleted file mode 100644 index 91bc4fa02..000000000 --- a/plutarch-test/goldens/api.ctx.get.txInfo.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.uplc.eval.golden b/plutarch-test/goldens/api.ctx.uplc.eval.golden index 6d009b355..982f866ad 100644 --- a/plutarch-test/goldens/api.ctx.uplc.eval.golden +++ b/plutarch-test/goldens/api.ctx.uplc.eval.golden @@ -1 +1,7 @@ -0 (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) \ No newline at end of file +term (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) +get.txInfo (program 1.0.0 #d8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffff) +get.mint (program 1.0.0 #a141c0a149736f6d65746f6b656e01) +get.credentials (program 1.0.0 [#41a1]) +get.sym (program 1.0.0 #c0) +ScriptPurpose.literal (program 1.0.0 #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff) +ScriptPurpose.decode (program 1.0.0 [ #58201111111111111111111111111111111111111111111111111111111111111111 ]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.uplc.golden b/plutarch-test/goldens/api.ctx.uplc.golden index 6d009b355..490acea63 100644 --- a/plutarch-test/goldens/api.ctx.uplc.golden +++ b/plutarch-test/goldens/api.ctx.uplc.golden @@ -1 +1,7 @@ -0 (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) \ No newline at end of file +term (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) +get.txInfo (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) +get.mint (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +get.credentials (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (i5 i1)) (i2 (i4 i1))))))) (\i0 -> i3 (i5 (unConstrData ((\i0 -> i4 (i5 i1)) ((\i0 -> i4 (i5 i1)) (i3 (i2 (i4 i1)))))))) ((\i0 -> unListData (i3 (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +get.sym (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> force (force fstPair) (i3 i1)) (unMapData ((\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +ScriptPurpose.literal (program 1.0.0 #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff) +ScriptPurpose.decode (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden new file mode 100644 index 000000000..336511516 --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden @@ -0,0 +1,4 @@ +cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} +cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":286} +termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} +termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.cont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=false.cont.bench.golden deleted file mode 100644 index 8705ffc87..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.cont.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.golden deleted file mode 100644 index d8097f169..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.cont.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=false.termcont.bench.golden deleted file mode 100644 index 8705ffc87..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.golden deleted file mode 100644 index ed510fea3..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.termcont.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden new file mode 100644 index 000000000..0070757cf --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ()) +cont.fails (program 1.0.0 error) +termcont.succeeds (program 1.0.0 ()) +termcont.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden new file mode 100644 index 000000000..7745ac73b --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden new file mode 100644 index 000000000..6759b8694 --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden @@ -0,0 +1,4 @@ +cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} +cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} +termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} +termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.cont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.cont.bench.golden deleted file mode 100644 index 33f6ffc2d..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.cont.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.golden deleted file mode 100644 index 4946be45e..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.cont.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden deleted file mode 100644 index 33f6ffc2d..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden deleted file mode 100644 index 7c786aef0..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.termcont.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden new file mode 100644 index 000000000..0070757cf --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ()) +cont.fails (program 1.0.0 error) +termcont.succeeds (program 1.0.0 ()) +termcont.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden new file mode 100644 index 000000000..0be2377ab --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.bench.golden b/plutarch-test/goldens/bool.bench.golden new file mode 100644 index 000000000..01924390f --- /dev/null +++ b/plutarch-test/goldens/bool.bench.golden @@ -0,0 +1,21 @@ +pnot.lam {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":13} +pnot.app {"exBudgetCPU":327604,"exBudgetMemory":1201,"scriptSizeBytes":15} +pand.tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.laziness.pand {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} +pand.laziness.op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} +pand.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +pand.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +pand.laziness.pand.perror.op {"exBudgetCPU":101,"exBudgetMemory":101,"scriptSizeBytes":18} +por.tf {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.ft {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.tt {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.ff {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.laziness.por {"exBudgetCPU":327604,"exBudgetMemory":1201,"scriptSizeBytes":15} +por.laziness.op {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":15} +por.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +por.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +por.laziness.pand.perror.op.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":15} +por.laziness.pand.perror.op.false {"exBudgetCPU":101,"exBudgetMemory":101,"scriptSizeBytes":15} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.bench.golden b/plutarch-test/goldens/bool.pand.bench.golden deleted file mode 100644 index e6b134eec..000000000 --- a/plutarch-test/goldens/bool.pand.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.laziness.bench.golden b/plutarch-test/goldens/bool.pand.laziness.bench.golden deleted file mode 100644 index dc2ec382c..000000000 --- a/plutarch-test/goldens/bool.pand.laziness.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -pand {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} -op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.laziness.uplc.eval.golden b/plutarch-test/goldens/bool.pand.laziness.uplc.eval.golden deleted file mode 100644 index ffb471430..000000000 --- a/plutarch-test/goldens/bool.pand.laziness.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -pand (program 1.0.0 (delay False)) -op (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.laziness.uplc.golden b/plutarch-test/goldens/bool.pand.laziness.uplc.golden deleted file mode 100644 index 9c7692e99..000000000 --- a/plutarch-test/goldens/bool.pand.laziness.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -pand (program 1.0.0 ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error))) -op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.uplc.eval.golden b/plutarch-test/goldens/bool.pand.uplc.eval.golden deleted file mode 100644 index 3b74b8afe..000000000 --- a/plutarch-test/goldens/bool.pand.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf (program 1.0.0 False) -ft (program 1.0.0 False) -tt (program 1.0.0 True) -ff (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pand.uplc.golden b/plutarch-test/goldens/bool.pand.uplc.golden deleted file mode 100644 index e59d781e5..000000000 --- a/plutarch-test/goldens/bool.pand.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay False)))) -ft (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay True)))) -tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay True)))) -ff (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay False)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pnot.bench.golden b/plutarch-test/goldens/bool.pnot.bench.golden deleted file mode 100644 index 7bd18a8b3..000000000 --- a/plutarch-test/goldens/bool.pnot.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":14} -app {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pnot.uplc.eval.golden b/plutarch-test/goldens/bool.pnot.uplc.eval.golden deleted file mode 100644 index f9a2f86f0..000000000 --- a/plutarch-test/goldens/bool.pnot.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam (program 1.0.0 (\i0 -> force (force ifThenElse i1 (delay False) (delay True)))) -app (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.pnot.uplc.golden b/plutarch-test/goldens/bool.pnot.uplc.golden deleted file mode 100644 index 8426644c8..000000000 --- a/plutarch-test/goldens/bool.pnot.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam (program 1.0.0 (\i0 -> force (force ifThenElse i1 (delay False) (delay True)))) -app (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay False) (delay True))) True)) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.bench.golden b/plutarch-test/goldens/bool.por.bench.golden deleted file mode 100644 index e6b134eec..000000000 --- a/plutarch-test/goldens/bool.por.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.laziness.bench.golden b/plutarch-test/goldens/bool.por.laziness.bench.golden deleted file mode 100644 index c12676d85..000000000 --- a/plutarch-test/goldens/bool.por.laziness.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -por {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} -op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.laziness.uplc.eval.golden b/plutarch-test/goldens/bool.por.laziness.uplc.eval.golden deleted file mode 100644 index ae0c94093..000000000 --- a/plutarch-test/goldens/bool.por.laziness.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -por (program 1.0.0 (delay True)) -op (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.laziness.uplc.golden b/plutarch-test/goldens/bool.por.laziness.uplc.golden deleted file mode 100644 index f66bc7186..000000000 --- a/plutarch-test/goldens/bool.por.laziness.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -por (program 1.0.0 ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error))) -op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.uplc.eval.golden b/plutarch-test/goldens/bool.por.uplc.eval.golden deleted file mode 100644 index 376cf2bb7..000000000 --- a/plutarch-test/goldens/bool.por.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf (program 1.0.0 True) -ft (program 1.0.0 True) -tt (program 1.0.0 True) -ff (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.por.uplc.golden b/plutarch-test/goldens/bool.por.uplc.golden deleted file mode 100644 index bcdd4ba13..000000000 --- a/plutarch-test/goldens/bool.por.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -tf (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay False)))) -ft (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay True)))) -tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) True (delay True)))) -ff (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 (delay True) i1) False (delay False)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.uplc.eval.golden b/plutarch-test/goldens/bool.uplc.eval.golden new file mode 100644 index 000000000..4e839c9bd --- /dev/null +++ b/plutarch-test/goldens/bool.uplc.eval.golden @@ -0,0 +1,21 @@ +pnot.lam (program 1.0.0 (\i0 -> force ifThenElse i1 False True)) +pnot.app (program 1.0.0 False) +pand.tf (program 1.0.0 False) +pand.ft (program 1.0.0 False) +pand.tt (program 1.0.0 True) +pand.ff (program 1.0.0 False) +pand.laziness.pand (program 1.0.0 (delay False)) +pand.laziness.op (program 1.0.0 False) +pand.laziness.pand.perror.false (program 1.0.0 error) +pand.laziness.pand.perror.true (program 1.0.0 error) +pand.laziness.pand.perror.op (program 1.0.0 error) +por.tf (program 1.0.0 True) +por.ft (program 1.0.0 True) +por.tt (program 1.0.0 True) +por.ff (program 1.0.0 False) +por.laziness.por (program 1.0.0 (delay True)) +por.laziness.op (program 1.0.0 True) +por.laziness.pand.perror.false (program 1.0.0 error) +por.laziness.pand.perror.true (program 1.0.0 error) +por.laziness.pand.perror.op.true (program 1.0.0 True) +por.laziness.pand.perror.op.false (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.uplc.golden b/plutarch-test/goldens/bool.uplc.golden new file mode 100644 index 000000000..eb80239f8 --- /dev/null +++ b/plutarch-test/goldens/bool.uplc.golden @@ -0,0 +1,21 @@ +pnot.lam (program 1.0.0 (\i0 -> force ifThenElse i1 False True)) +pnot.app (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) True)) +pand.tf (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay False)))) +pand.ft (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay True)))) +pand.tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay True)))) +pand.ff (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay False)))) +pand.laziness.pand (program 1.0.0 ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error))) +pand.laziness.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error)))) +pand.laziness.pand.perror.false (program 1.0.0 error) +pand.laziness.pand.perror.true (program 1.0.0 error) +pand.laziness.pand.perror.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay error)))) +por.tf (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay False)))) +por.ft (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) False (delay True)))) +por.tt (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay True)))) +por.ff (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) False (delay False)))) +por.laziness.por (program 1.0.0 ((\i0 -> force ifThenElse i1 (delay True)) True (delay error))) +por.laziness.op (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay error)))) +por.laziness.pand.perror.false (program 1.0.0 error) +por.laziness.pand.perror.true (program 1.0.0 error) +por.laziness.pand.perror.op.true (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay error)))) +por.laziness.pand.perror.op.false (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) False (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.bench.golden b/plutarch-test/goldens/bytestring.bench.golden new file mode 100644 index 000000000..547539432 --- /dev/null +++ b/plutarch-test/goldens/bytestring.bench.golden @@ -0,0 +1,10 @@ +empty {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":14} +phexByteStr {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":19} +plengthByteStr {"exBudgetCPU":496379,"exBudgetMemory":805,"scriptSizeBytes":17} +pconsBS {"exBudgetCPU":1381637,"exBudgetMemory":2113,"scriptSizeBytes":33} +pindexByteStr {"exBudgetCPU":298965,"exBudgetMemory":601,"scriptSizeBytes":16} +psliceByteStr {"exBudgetCPU":363511,"exBudgetMemory":801,"scriptSizeBytes":22} +eq {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":16} +semigroup.concats {"exBudgetCPU":546438,"exBudgetMemory":602,"scriptSizeBytes":17} +semigroup.laws.id.1 {"exBudgetCPU":867632,"exBudgetMemory":1303,"scriptSizeBytes":22} +semigroup.laws.id.2 {"exBudgetCPU":867632,"exBudgetMemory":1303,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.eq.bench.golden b/plutarch-test/goldens/bytestring.eq.bench.golden deleted file mode 100644 index 88df2c300..000000000 --- a/plutarch-test/goldens/bytestring.eq.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":16} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.eq.uplc.eval.golden b/plutarch-test/goldens/bytestring.eq.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.eq.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.eq.uplc.golden b/plutarch-test/goldens/bytestring.eq.uplc.golden deleted file mode 100644 index ffa36da0d..000000000 --- a/plutarch-test/goldens/bytestring.eq.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> equalsByteString i1 i1) #12)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.phexByteStr.bench.golden b/plutarch-test/goldens/bytestring.phexByteStr.bench.golden deleted file mode 100644 index 78caf852c..000000000 --- a/plutarch-test/goldens/bytestring.phexByteStr.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":19} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.pindexByteStr.bench.golden b/plutarch-test/goldens/bytestring.pindexByteStr.bench.golden deleted file mode 100644 index ba7e3d462..000000000 --- a/plutarch-test/goldens/bytestring.pindexByteStr.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":555925,"exBudgetMemory":1002,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.pindexByteStr.uplc.eval.golden b/plutarch-test/goldens/bytestring.pindexByteStr.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.pindexByteStr.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.pindexByteStr.uplc.golden b/plutarch-test/goldens/bytestring.pindexByteStr.uplc.golden deleted file mode 100644 index 601ba1807..000000000 --- a/plutarch-test/goldens/bytestring.pindexByteStr.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (equalsInteger (indexByteString #4102af 1) 2)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.bench.golden b/plutarch-test/goldens/bytestring.plengthByteStr.bench.golden deleted file mode 100644 index 04ee115ab..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":496379,"exBudgetMemory":805,"scriptSizeBytes":17} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.bench.golden b/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.bench.golden deleted file mode 100644 index d78a7e10c..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":1381637,"exBudgetMemory":2113,"scriptSizeBytes":33} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.eval.golden b/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.golden b/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.golden deleted file mode 100644 index e45e93136..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.pconsBS.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> equalsInteger (lengthOfByteString (consByteString 91 i1)) (addInteger 1 (lengthOfByteString i1))) #48fcd1)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.uplc.eval.golden b/plutarch-test/goldens/bytestring.plengthByteStr.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.plengthByteStr.uplc.golden b/plutarch-test/goldens/bytestring.plengthByteStr.uplc.golden deleted file mode 100644 index 45a52a44a..000000000 --- a/plutarch-test/goldens/bytestring.plengthByteStr.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (equalsInteger (lengthOfByteString #012f) 2)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.psliceByteStr.bench.golden b/plutarch-test/goldens/bytestring.psliceByteStr.bench.golden deleted file mode 100644 index 7c57b7d58..000000000 --- a/plutarch-test/goldens/bytestring.psliceByteStr.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":595386,"exBudgetMemory":1202,"scriptSizeBytes":33} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.psliceByteStr.uplc.eval.golden b/plutarch-test/goldens/bytestring.psliceByteStr.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/bytestring.psliceByteStr.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.psliceByteStr.uplc.golden b/plutarch-test/goldens/bytestring.psliceByteStr.uplc.golden deleted file mode 100644 index ba2ca0703..000000000 --- a/plutarch-test/goldens/bytestring.psliceByteStr.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (equalsByteString (sliceByteString 2 3 #4102afde5b2a) #afde5b)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.semigroup.bench.golden b/plutarch-test/goldens/bytestring.semigroup.bench.golden deleted file mode 100644 index 3e62faa19..000000000 --- a/plutarch-test/goldens/bytestring.semigroup.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":546438,"exBudgetMemory":602,"scriptSizeBytes":17} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.semigroup.uplc.eval.golden b/plutarch-test/goldens/bytestring.semigroup.uplc.eval.golden deleted file mode 100644 index 1ed73a1ec..000000000 --- a/plutarch-test/goldens/bytestring.semigroup.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 #1234) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.semigroup.uplc.golden b/plutarch-test/goldens/bytestring.semigroup.uplc.golden deleted file mode 100644 index 7de833223..000000000 --- a/plutarch-test/goldens/bytestring.semigroup.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (appendByteString #12 #34)) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.uplc.eval.golden b/plutarch-test/goldens/bytestring.uplc.eval.golden new file mode 100644 index 000000000..f675e1599 --- /dev/null +++ b/plutarch-test/goldens/bytestring.uplc.eval.golden @@ -0,0 +1,10 @@ +empty (program 1.0.0 True) +phexByteStr (program 1.0.0 True) +plengthByteStr (program 1.0.0 True) +pconsBS (program 1.0.0 True) +pindexByteStr (program 1.0.0 2) +psliceByteStr (program 1.0.0 #afde5b) +eq (program 1.0.0 True) +semigroup.concats (program 1.0.0 #1234) +semigroup.laws.id.1 (program 1.0.0 True) +semigroup.laws.id.2 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.uplc.golden b/plutarch-test/goldens/bytestring.uplc.golden new file mode 100644 index 000000000..e111d8201 --- /dev/null +++ b/plutarch-test/goldens/bytestring.uplc.golden @@ -0,0 +1,10 @@ +empty (program 1.0.0 ((\i0 -> equalsByteString i1 i1) #)) +phexByteStr (program 1.0.0 ((\i0 -> equalsByteString i1 i1) #42abdfc9)) +plengthByteStr (program 1.0.0 (equalsInteger (lengthOfByteString #012f) 2)) +pconsBS (program 1.0.0 ((\i0 -> equalsInteger (lengthOfByteString (consByteString 91 i1)) (addInteger 1 (lengthOfByteString i1))) #48fcd1)) +pindexByteStr (program 1.0.0 (indexByteString #4102af 1)) +psliceByteStr (program 1.0.0 (sliceByteString 2 3 #4102afde5b2a)) +eq (program 1.0.0 ((\i0 -> equalsByteString i1 i1) #12)) +semigroup.concats (program 1.0.0 (appendByteString #12 #34)) +semigroup.laws.id.1 (program 1.0.0 ((\i0 -> equalsByteString (appendByteString # i1) i1) #12)) +semigroup.laws.id.2 (program 1.0.0 ((\i0 -> equalsByteString i1 (appendByteString # i1)) #12)) \ No newline at end of file diff --git a/plutarch-test/goldens/either.bench.golden b/plutarch-test/goldens/either.bench.golden new file mode 100644 index 000000000..d12cf9cfb --- /dev/null +++ b/plutarch-test/goldens/either.bench.golden @@ -0,0 +1,5 @@ +eq.true.left {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} +eq.true.right {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} +eq.false.left-right {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":42} +eq.false.left-left {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} +eq.false.right-right {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} \ No newline at end of file diff --git a/plutarch-test/goldens/either.uplc.eval.golden b/plutarch-test/goldens/either.uplc.eval.golden new file mode 100644 index 000000000..7d8b63ad6 --- /dev/null +++ b/plutarch-test/goldens/either.uplc.eval.golden @@ -0,0 +1,5 @@ +eq.true.left (program 1.0.0 True) +eq.true.right (program 1.0.0 True) +eq.false.left-right (program 1.0.0 False) +eq.false.left-left (program 1.0.0 False) +eq.false.right-right (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/either.uplc.golden b/plutarch-test/goldens/either.uplc.golden new file mode 100644 index 000000000..588755f46 --- /dev/null +++ b/plutarch-test/goldens/either.uplc.golden @@ -0,0 +1,5 @@ +eq.true.left (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42))) +eq.true.right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i1 42) (\i0 -> \i0 -> i1 42))) +eq.false.left-right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i1 42))) +eq.false.left-left (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) +eq.false.right-right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i1 24) (\i0 -> \i0 -> i1 42))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.listutils.bench.golden b/plutarch-test/goldens/extra.listutils.bench.golden new file mode 100644 index 000000000..3f32ffa2d --- /dev/null +++ b/plutarch-test/goldens/extra.listutils.bench.golden @@ -0,0 +1,4 @@ +reverse.reverse_[1..5] {"exBudgetCPU":7592215,"exBudgetMemory":25600,"scriptSizeBytes":87} +isSorted.[1..10] {"exBudgetCPU":18915730,"exBudgetMemory":59218,"scriptSizeBytes":115} +isSorted.reverse_[1..10] {"exBudgetCPU":4047007,"exBudgetMemory":13203,"scriptSizeBytes":126} +isSorted.reverse_[] {"exBudgetCPU":803971,"exBudgetMemory":2800,"scriptSizeBytes":56} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.listutils.uplc.eval.golden b/plutarch-test/goldens/extra.listutils.uplc.eval.golden new file mode 100644 index 000000000..f33a1f36b --- /dev/null +++ b/plutarch-test/goldens/extra.listutils.uplc.eval.golden @@ -0,0 +1,4 @@ +reverse.reverse_[1..5] (program 1.0.0 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 1 (\i0 -> \i0 -> force i1))))))) +isSorted.[1..10] (program 1.0.0 True) +isSorted.reverse_[1..10] (program 1.0.0 True) +isSorted.reverse_[] (program 1.0.0 (\i0 -> \i0 -> force i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.listutils.uplc.golden b/plutarch-test/goldens/extra.listutils.uplc.golden new file mode 100644 index 000000000..8aab48a48 --- /dev/null +++ b/plutarch-test/goldens/extra.listutils.uplc.golden @@ -0,0 +1,4 @@ +reverse.reverse_[1..5] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> i3 i1 i2) (\i0 -> \i0 -> force i1) (i1 1 (i1 2 (i1 3 (i1 4 (i1 5 (\i0 -> \i0 -> force i1))))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +isSorted.[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (lessThanEqualsInteger i4 i2) (delay (i6 i3)))) (delay True)) (delay True)) (i1 1 (i1 2 (i1 3 (i1 4 (i1 5 (i1 6 (i1 7 (i1 8 (i1 9 (i1 10 (\i0 -> \i0 -> force i1)))))))))))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +isSorted.reverse_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 i1 False True) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (lessThanEqualsInteger i4 i2) (delay (i6 i3)))) (delay True)) (delay True)) (i2 10 (i2 9 (i2 8 (i2 7 (i2 6 (i2 5 (i2 4 (i2 3 (i2 2 (i2 1 (\i0 -> \i0 -> force i1))))))))))))) (force ifThenElse)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) +isSorted.reverse_[] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (i6 i4 i2) i1) (delay i2))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i3 i4) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> force i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.bench.golden b/plutarch-test/goldens/field.data.bench.golden new file mode 100644 index 000000000..fb3535e2d --- /dev/null +++ b/plutarch-test/goldens/field.data.bench.golden @@ -0,0 +1,4 @@ +pmatch-pfield.pmatch.newtype {"exBudgetCPU":1733744,"exBudgetMemory":3092,"scriptSizeBytes":45} +pmatch-pfield.pfield.newtype {"exBudgetCPU":1733744,"exBudgetMemory":3092,"scriptSizeBytes":45} +pfield-pletFields.pfield.single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} +pfield-pletFields.pletFields.single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.uplc.eval.golden b/plutarch-test/goldens/field.data.uplc.eval.golden new file mode 100644 index 000000000..183cfd7b7 --- /dev/null +++ b/plutarch-test/goldens/field.data.uplc.eval.golden @@ -0,0 +1,4 @@ +pmatch-pfield.pmatch.newtype (program 1.0.0 (#d8799f41abff, #d87a80)) +pmatch-pfield.pfield.newtype (program 1.0.0 (#d8799f41abff, #d87a80)) +pfield-pletFields.pfield.single (program 1.0.0 #d8799f41abff) +pfield-pletFields.pletFields.single (program 1.0.0 #d8799f41abff) \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.uplc.golden b/plutarch-test/goldens/field.data.uplc.golden new file mode 100644 index 000000000..b8d5b8853 --- /dev/null +++ b/plutarch-test/goldens/field.data.uplc.golden @@ -0,0 +1,4 @@ +pmatch-pfield.pmatch.newtype (program 1.0.0 ((\i0 -> (\i0 -> mkPairData (i2 i1) (i2 (force tailList i1))) ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) (force headList))) +pmatch-pfield.pfield.newtype (program 1.0.0 ((\i0 -> (\i0 -> mkPairData (i2 i1) (i2 (force tailList i1))) ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) (force headList))) +pfield-pletFields.pfield.single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f41abffd87a80ff)) +pfield-pletFields.pletFields.single (program 1.0.0 (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.bench.golden b/plutarch-test/goldens/field.dropFields.bench.golden new file mode 100644 index 000000000..48a962abf --- /dev/null +++ b/plutarch-test/goldens/field.dropFields.bench.golden @@ -0,0 +1,2 @@ +lam {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":45} +app {"exBudgetCPU":3487094,"exBudgetMemory":5018,"scriptSizeBytes":88} \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.dropFields.bench.golden b/plutarch-test/goldens/field.dropFields.dropFields.bench.golden deleted file mode 100644 index b73ce5d12..000000000 --- a/plutarch-test/goldens/field.dropFields.dropFields.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":45} \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.dropFields.uplc.eval.golden b/plutarch-test/goldens/field.dropFields.dropFields.uplc.eval.golden deleted file mode 100644 index 1e995ba0a..000000000 --- a/plutarch-test/goldens/field.dropFields.dropFields.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1)))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.dropFields.uplc.golden b/plutarch-test/goldens/field.dropFields.dropFields.uplc.golden deleted file mode 100644 index 27bbee0a2..000000000 --- a/plutarch-test/goldens/field.dropFields.dropFields.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.uplc.eval.golden b/plutarch-test/goldens/field.dropFields.uplc.eval.golden new file mode 100644 index 000000000..e4e3ead44 --- /dev/null +++ b/plutarch-test/goldens/field.dropFields.uplc.eval.golden @@ -0,0 +1,2 @@ +lam (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1)))))))))) +app (program 1.0.0 17) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.uplc.golden b/plutarch-test/goldens/field.dropFields.uplc.golden new file mode 100644 index 000000000..5541a25de --- /dev/null +++ b/plutarch-test/goldens/field.dropFields.uplc.golden @@ -0,0 +1,11 @@ +lam (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) (force headList)) (force tailList))) +app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.bench.golden b/plutarch-test/goldens/field.other.bench.golden new file mode 100644 index 000000000..5dc766302 --- /dev/null +++ b/plutarch-test/goldens/field.other.bench.golden @@ -0,0 +1,2 @@ +by {"exBudgetCPU":3110112,"exBudgetMemory":4884,"scriptSizeBytes":49} +dotPlus {"exBudgetCPU":17921705,"exBudgetMemory":26900,"scriptSizeBytes":239} \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.uplc.eval.golden b/plutarch-test/goldens/field.other.uplc.eval.golden new file mode 100644 index 000000000..b53a90f6a --- /dev/null +++ b/plutarch-test/goldens/field.other.uplc.eval.golden @@ -0,0 +1,2 @@ +by (program 1.0.0 10) +dotPlus (program 1.0.0 19010) \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.uplc.golden b/plutarch-test/goldens/field.other.uplc.golden new file mode 100644 index 000000000..c99ec4f08 --- /dev/null +++ b/plutarch-test/goldens/field.other.uplc.golden @@ -0,0 +1,2 @@ +by (program 1.0.0 ((\i0 -> (\i0 -> unIData (force headList (force tailList (force (force sndPair) (unConstrData i1))))) (constrData 0 (i1 (iData 50) (i1 (iData 10) (i1 (iData 40) [ ]))))) (force mkCons))) +dotPlus (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (addInteger (addInteger (addInteger (multiplyInteger (unIData (i9 i6)) (unIData (i9 i4))) (multiplyInteger (unIData (i9 i5)) (unIData (i9 i3)))) (multiplyInteger (unIData (i9 (i10 i5))) (unIData (i9 (i10 i3))))) (unIData (i9 i2))) (unIData (i9 i1))) (unIData (i9 (i10 i1)))) (i9 i1)) (i9 (i7 (i8 i5)))) (i7 i1)) (i7 (i5 i3))) (i5 i1)) (i5 (i3 i2))) (i3 i1)) (i3 (constrData 0 (i5 (constrData 0 (i5 (iData 150) (i5 (iData 750) (i5 (iData 100) i6)))) (i5 (constrData 0 (i5 (iData 50) (i5 (iData 10) (i5 (iData 40) i6)))) (i5 (constrData 0 (i5 (iData 1) (i5 (iData 8) (i5 (iData 1) i6)))) i6)))))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.bench.golden b/plutarch-test/goldens/field.pletFields.bench.golden new file mode 100644 index 000000000..b31518bc3 --- /dev/null +++ b/plutarch-test/goldens/field.pletFields.bench.golden @@ -0,0 +1,5 @@ +letSomeFields.lam {"exBudgetCPU":357376,"exBudgetMemory":1300,"scriptSizeBytes":55} +letSomeFields.order {"exBudgetCPU":357376,"exBudgetMemory":1300,"scriptSizeBytes":55} +letSomeFields.app {"exBudgetCPU":4160671,"exBudgetMemory":6620,"scriptSizeBytes":97} +nFields.lam {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":23} +nFields.app {"exBudgetCPU":1632088,"exBudgetMemory":2562,"scriptSizeBytes":68} \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.letSomeFields.bench.golden b/plutarch-test/goldens/field.pletFields.letSomeFields.bench.golden deleted file mode 100644 index 8d91d0b6d..000000000 --- a/plutarch-test/goldens/field.pletFields.letSomeFields.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":357376,"exBudgetMemory":1300,"scriptSizeBytes":55} \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.eval.golden b/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.eval.golden deleted file mode 100644 index f7ace1ee9..000000000 --- a/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.golden b/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.golden deleted file mode 100644 index cf5502e85..000000000 --- a/plutarch-test/goldens/field.pletFields.letSomeFields.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.nFields.bench.golden b/plutarch-test/goldens/field.pletFields.nFields.bench.golden deleted file mode 100644 index ba69e6b7f..000000000 --- a/plutarch-test/goldens/field.pletFields.nFields.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":23} \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.nFields.uplc.eval.golden b/plutarch-test/goldens/field.pletFields.nFields.uplc.eval.golden deleted file mode 100644 index 8c9a58f82..000000000 --- a/plutarch-test/goldens/field.pletFields.nFields.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.nFields.uplc.golden b/plutarch-test/goldens/field.pletFields.nFields.uplc.golden deleted file mode 100644 index f973921a7..000000000 --- a/plutarch-test/goldens/field.pletFields.nFields.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> \i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) (force headList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.uplc.eval.golden b/plutarch-test/goldens/field.pletFields.uplc.eval.golden new file mode 100644 index 000000000..395124ffd --- /dev/null +++ b/plutarch-test/goldens/field.pletFields.uplc.eval.golden @@ -0,0 +1,5 @@ +letSomeFields.lam (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) +letSomeFields.order (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) +letSomeFields.app (program 1.0.0 14) +nFields.lam (program 1.0.0 (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1))))) +nFields.app (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.uplc.golden b/plutarch-test/goldens/field.pletFields.uplc.golden new file mode 100644 index 000000000..44ba7ab72 --- /dev/null +++ b/plutarch-test/goldens/field.pletFields.uplc.golden @@ -0,0 +1,23 @@ +letSomeFields.lam (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) +letSomeFields.order (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) +letSomeFields.app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) +nFields.lam (program 1.0.0 ((\i0 -> \i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) (force headList))) +nFields.app (program 1.0.0 ((\i0 -> (\i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.bench.golden b/plutarch-test/goldens/field.rangeFields.bench.golden new file mode 100644 index 000000000..de23c31f9 --- /dev/null +++ b/plutarch-test/goldens/field.rangeFields.bench.golden @@ -0,0 +1,2 @@ +lam {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":39} +app {"exBudgetCPU":2858456,"exBudgetMemory":4322,"scriptSizeBytes":82} \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.rangeFields.bench.golden b/plutarch-test/goldens/field.rangeFields.rangeFields.bench.golden deleted file mode 100644 index d3b27bdbd..000000000 --- a/plutarch-test/goldens/field.rangeFields.rangeFields.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":39} \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.eval.golden b/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.eval.golden deleted file mode 100644 index 879beed7e..000000000 --- a/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.golden b/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.golden deleted file mode 100644 index 0f9952f7a..000000000 --- a/plutarch-test/goldens/field.rangeFields.rangeFields.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.uplc.eval.golden b/plutarch-test/goldens/field.rangeFields.uplc.eval.golden new file mode 100644 index 000000000..16b4687d3 --- /dev/null +++ b/plutarch-test/goldens/field.rangeFields.uplc.eval.golden @@ -0,0 +1,2 @@ +lam (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) +app (program 1.0.0 11) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.uplc.golden b/plutarch-test/goldens/field.rangeFields.uplc.golden new file mode 100644 index 000000000..1161c974b --- /dev/null +++ b/plutarch-test/goldens/field.rangeFields.uplc.golden @@ -0,0 +1,11 @@ +lam (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) (force headList)) (force tailList))) +app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.bench.golden b/plutarch-test/goldens/field.trips.bench.golden new file mode 100644 index 000000000..c3d97a005 --- /dev/null +++ b/plutarch-test/goldens/field.trips.bench.golden @@ -0,0 +1,7 @@ +lam.tripSum {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":46} +lam.getY {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} +lam.tripYZ {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":36} +tripSum.A {"exBudgetCPU":5147720,"exBudgetMemory":8048,"scriptSizeBytes":80} +tripSum.B {"exBudgetCPU":5147720,"exBudgetMemory":8048,"scriptSizeBytes":77} +tripSum.C {"exBudgetCPU":5147720,"exBudgetMemory":8048,"scriptSizeBytes":77} +tripYZ=tripZY {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":36} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.getY.bench.golden b/plutarch-test/goldens/field.trips.getY.bench.golden deleted file mode 100644 index 98f9bc333..000000000 --- a/plutarch-test/goldens/field.trips.getY.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.getY.uplc.eval.golden b/plutarch-test/goldens/field.trips.getY.uplc.eval.golden deleted file mode 100644 index 4afac955e..000000000 --- a/plutarch-test/goldens/field.trips.getY.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.getY.uplc.golden b/plutarch-test/goldens/field.trips.getY.uplc.golden deleted file mode 100644 index 4afac955e..000000000 --- a/plutarch-test/goldens/field.trips.getY.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripSum.bench.golden b/plutarch-test/goldens/field.trips.tripSum.bench.golden deleted file mode 100644 index 7902ff61e..000000000 --- a/plutarch-test/goldens/field.trips.tripSum.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":46} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripSum.uplc.eval.golden b/plutarch-test/goldens/field.trips.tripSum.uplc.eval.golden deleted file mode 100644 index 9322cb241..000000000 --- a/plutarch-test/goldens/field.trips.tripSum.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList (force tailList i1)))) (force tailList i1)) (force (force sndPair) (unConstrData i1)))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripSum.uplc.golden b/plutarch-test/goldens/field.trips.tripSum.uplc.golden deleted file mode 100644 index d670900a9..000000000 --- a/plutarch-test/goldens/field.trips.tripSum.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripYZ.bench.golden b/plutarch-test/goldens/field.trips.tripYZ.bench.golden deleted file mode 100644 index cb5716a05..000000000 --- a/plutarch-test/goldens/field.trips.tripYZ.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":36} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripYZ.uplc.eval.golden b/plutarch-test/goldens/field.trips.tripYZ.uplc.eval.golden deleted file mode 100644 index 33c95036e..000000000 --- a/plutarch-test/goldens/field.trips.tripYZ.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.tripYZ.uplc.golden b/plutarch-test/goldens/field.trips.tripYZ.uplc.golden deleted file mode 100644 index 0f34eb5df..000000000 --- a/plutarch-test/goldens/field.trips.tripYZ.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.uplc.eval.golden b/plutarch-test/goldens/field.trips.uplc.eval.golden new file mode 100644 index 000000000..f21ca2849 --- /dev/null +++ b/plutarch-test/goldens/field.trips.uplc.eval.golden @@ -0,0 +1,7 @@ +lam.tripSum (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList (force tailList i1)))) (force tailList i1)) (force (force sndPair) (unConstrData i1)))) +lam.getY (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) +lam.tripYZ (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) +tripSum.A (program 1.0.0 1000) +tripSum.B (program 1.0.0 100) +tripSum.C (program 1.0.0 10) +tripYZ=tripZY (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.uplc.golden b/plutarch-test/goldens/field.trips.uplc.golden new file mode 100644 index 000000000..04daca150 --- /dev/null +++ b/plutarch-test/goldens/field.trips.uplc.golden @@ -0,0 +1,7 @@ +lam.tripSum (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (force headList)) (force tailList))) +lam.getY (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) +lam.tripYZ (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) +tripSum.A (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 150) (i3 (iData 750) (i3 (iData 100) [ ]))))) (force headList)) (force tailList)) (force mkCons))) +tripSum.B (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 50) (i3 (iData 10) (i3 (iData 40) [ ]))))) (force headList)) (force tailList)) (force mkCons))) +tripSum.C (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 1) (i3 (iData 8) (i3 (iData 1) [ ]))))) (force headList)) (force tailList)) (force mkCons))) +tripYZ=tripZY (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.bench.golden b/plutarch-test/goldens/int.examples.bench.golden index 2928e8042..e6789832b 100644 --- a/plutarch-test/goldens/int.examples.bench.golden +++ b/plutarch-test/goldens/int.examples.bench.golden @@ -2,6 +2,7 @@ add1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} add1Hoisted {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} example1 {"exBudgetCPU":2057973,"exBudgetMemory":3710,"scriptSizeBytes":34} example2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":21} -fib {"exBudgetCPU":416922,"exBudgetMemory":1500,"scriptSizeBytes":72} +fib.lam {"exBudgetCPU":416922,"exBudgetMemory":1500,"scriptSizeBytes":72} fib.app.9 {"exBudgetCPU":187876376,"exBudgetMemory":433318,"scriptSizeBytes":75} +fib.error {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} uglyDouble {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.uplc.eval.golden b/plutarch-test/goldens/int.examples.uplc.eval.golden index 4a5acccef..923ba5104 100644 --- a/plutarch-test/goldens/int.examples.uplc.eval.golden +++ b/plutarch-test/goldens/int.examples.uplc.eval.golden @@ -2,6 +2,7 @@ add1 (program 1.0.0 (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1)) add1Hoisted (program 1.0.0 (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1)) example1 (program 1.0.0 55) example2 (program 1.0.0 (\i0 -> i1 (\i0 -> addInteger i1 1) (\i0 -> subtractInteger i1 1))) -fib (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 1)) ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 2)))))))))) +fib.lam (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 1)) ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 2)))))))))) fib.app.9 (program 1.0.0 34) +fib.error (program 1.0.0 error) uglyDouble (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.uplc.golden b/plutarch-test/goldens/int.examples.uplc.golden index ebf5e4031..1eb85a63f 100644 --- a/plutarch-test/goldens/int.examples.uplc.golden +++ b/plutarch-test/goldens/int.examples.uplc.golden @@ -2,6 +2,7 @@ add1 (program 1.0.0 (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1)) add1Hoisted (program 1.0.0 (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1)) example1 (program 1.0.0 ((\i0 -> addInteger (i1 12 32) (i1 5 4)) (\i0 -> \i0 -> addInteger (addInteger i2 i1) 1))) example2 (program 1.0.0 (\i0 -> i1 (\i0 -> addInteger i1 1) (\i0 -> subtractInteger i1 1))) -fib (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2)))))))))) (force ifThenElse))) +fib.lam (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2)))))))))) (force ifThenElse))) fib.app.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) 9) (force ifThenElse))) +fib.error (program 1.0.0 error) uglyDouble (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/lift.pconstantData.bench.golden b/plutarch-test/goldens/lift.pconstantData.bench.golden new file mode 100644 index 000000000..a1c4f2059 --- /dev/null +++ b/plutarch-test/goldens/lift.pconstantData.bench.golden @@ -0,0 +1,5 @@ +bool {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +int {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +pkh {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +minting {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":14} +txoutref {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":20} \ No newline at end of file diff --git a/plutarch-test/goldens/lift.pconstantData.uplc.eval.golden b/plutarch-test/goldens/lift.pconstantData.uplc.eval.golden new file mode 100644 index 000000000..aa6b1e15c --- /dev/null +++ b/plutarch-test/goldens/lift.pconstantData.uplc.eval.golden @@ -0,0 +1,5 @@ +bool (program 1.0.0 #d87980) +int (program 1.0.0 #182a) +pkh (program 1.0.0 #423034) +minting (program 1.0.0 #d8799f40ff) +txoutref (program 1.0.0 #d8799fd8799f4141ff0cff) \ No newline at end of file diff --git a/plutarch-test/goldens/lift.pconstantData.uplc.golden b/plutarch-test/goldens/lift.pconstantData.uplc.golden new file mode 100644 index 000000000..aa6b1e15c --- /dev/null +++ b/plutarch-test/goldens/lift.pconstantData.uplc.golden @@ -0,0 +1,5 @@ +bool (program 1.0.0 #d87980) +int (program 1.0.0 #182a) +pkh (program 1.0.0 #423034) +minting (program 1.0.0 #d8799f40ff) +txoutref (program 1.0.0 #d8799fd8799f4141ff0cff) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=false.bench.golden b/plutarch-test/goldens/list.dev=false.bench.golden new file mode 100644 index 000000000..553b1cb10 --- /dev/null +++ b/plutarch-test/goldens/list.dev=false.bench.golden @@ -0,0 +1,25 @@ +pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} +phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} +ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} +pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} +pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} +pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} +pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} +pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} +pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} +pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} +pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} +pfoldl.nonempty {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.nonempty-primed {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.empty {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +pfoldl.empty-primed {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +elemAt.elemAt_3_[1..10] {"exBudgetCPU":22527179,"exBudgetMemory":56708,"scriptSizeBytes":127} +elemAt.elemAt_0_[1..10] {"exBudgetCPU":17681228,"exBudgetMemory":43796,"scriptSizeBytes":127} +elemAt.elemAt_9_[1..10] {"exBudgetCPU":32219081,"exBudgetMemory":82532,"scriptSizeBytes":127} +find.find_(==3)_[1..4] {"exBudgetCPU":11027650,"exBudgetMemory":29622,"scriptSizeBytes":100} +find.find_(==5)_[1..4] {"exBudgetCPU":13130537,"exBudgetMemory":36224,"scriptSizeBytes":100} +x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} +x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} +uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} +uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} +uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=false.uplc.eval.golden b/plutarch-test/goldens/list.dev=false.uplc.eval.golden new file mode 100644 index 000000000..24db9cb06 --- /dev/null +++ b/plutarch-test/goldens/list.dev=false.uplc.eval.golden @@ -0,0 +1,25 @@ +pmatch (program 1.0.0 error) +phead (program 1.0.0 True) +ptail (program 1.0.0 True) +pnull.empty (program 1.0.0 True) +pnull.nonempty (program 1.0.0 True) +pconcat.identity (program 1.0.0 True) +pmap.eg (program 1.0.0 True) +pmap.identity (program 1.0.0 True) +pfilter.evens (program 1.0.0 True) +pfilter.gt5 (program 1.0.0 True) +pzipWith.double (program 1.0.0 True) +pfoldl.nonempty (program 1.0.0 True) +pfoldl.nonempty-primed (program 1.0.0 True) +pfoldl.empty (program 1.0.0 True) +pfoldl.empty-primed (program 1.0.0 True) +elemAt.elemAt_3_[1..10] (program 1.0.0 4) +elemAt.elemAt_0_[1..10] (program 1.0.0 1) +elemAt.elemAt_9_[1..10] (program 1.0.0 10) +find.find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) +find.find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) +x1+x2.builtin (program 1.0.0 3) +x1+x2.pmatch (program 1.0.0 3) +uncons.ChooseList (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail-and-null (program 1.0.0 [2,3,4,5]) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=false.uplc.golden b/plutarch-test/goldens/list.dev=false.uplc.golden new file mode 100644 index 000000000..d5c69ce5e --- /dev/null +++ b/plutarch-test/goldens/list.dev=false.uplc.golden @@ -0,0 +1,25 @@ +pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) +phead (program 1.0.0 (equalsInteger 1 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +ptail (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [2,3,4,5,6,7,8,9,10]) ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (i1 [1,2,3,4,5,6,7,8,9,10]))) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) +pnull.nonempty (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i4 i2 i1 (delay False)) (i1 (i3 (i4 i10) (\i0 -> \i0 -> force i1)) (i3 (\i0 -> \i0 -> force i1) (i4 i10))) (delay (i1 (i3 (\i0 -> \i0 -> force i1) (i4 i10)) (i4 i10))))) (i4 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))))) (force ifThenElse)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i10 i2 (i4 i1)) (delay i3)) i2)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) +pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i3 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i9 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 [1,2,3,4,5,6,7,8,9,10])) (i1 [2,4,6,8,10,12,14,16,18,20])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pmap.identity (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> force i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfilter.evens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [2,4,6,8,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfilter.gt5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [6,7,8,9,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pzipWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i2 i1) (i2 i1)) (i2 [2,4,6,8,10,12,14,16,18,20])) [1,2,3,4,5,6,7,8,9,10]) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfoldl.nonempty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.nonempty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==3)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==5)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +x1+x2.builtin (program 1.0.0 ((\i0 -> (\i0 -> addInteger (i1 (force tailList i2)) (i1 i2)) (force headList)) [1,2,3,4,5])) +x1+x2.pmatch (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i1 i3 (delay error) (delay ((\i0 -> force (i2 i1 (delay error) (delay (addInteger (i3 i4) (i3 i1))))) (force tailList i3))))) (force (force chooseList))) (force headList)) [1,2,3,4,5])) +uncons.ChooseList (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay error) (delay (force tailList i1)))) [1,2,3,4,5])) +uncons.head-and-tail (program 1.0.0 ((\i0 -> (\i0 -> force tailList i2) (force headList i1)) [1,2,3,4,5])) +uncons.head-and-tail-and-null (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse i1 (delay error) (delay ((\i0 -> force tailList i3) (force headList i2))))) (force nullList i1)) [1,2,3,4,5])) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.bench.golden b/plutarch-test/goldens/list.dev=true.bench.golden new file mode 100644 index 000000000..64e96914d --- /dev/null +++ b/plutarch-test/goldens/list.dev=true.bench.golden @@ -0,0 +1,25 @@ +pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} +phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} +ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} +pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} +pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} +pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} +pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} +pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} +pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} +pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} +pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} +pfoldl.nonempty {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.nonempty-primed {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.empty {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +pfoldl.empty-primed {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +elemAt.elemAt_3_[1..10] {"exBudgetCPU":22527179,"exBudgetMemory":56708,"scriptSizeBytes":157} +elemAt.elemAt_0_[1..10] {"exBudgetCPU":17681228,"exBudgetMemory":43796,"scriptSizeBytes":157} +elemAt.elemAt_9_[1..10] {"exBudgetCPU":32219081,"exBudgetMemory":82532,"scriptSizeBytes":157} +find.find_(==3)_[1..4] {"exBudgetCPU":11027650,"exBudgetMemory":29622,"scriptSizeBytes":100} +find.find_(==5)_[1..4] {"exBudgetCPU":13130537,"exBudgetMemory":36224,"scriptSizeBytes":100} +x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} +x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} +uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} +uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} +uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.uplc.eval.golden b/plutarch-test/goldens/list.dev=true.uplc.eval.golden new file mode 100644 index 000000000..24db9cb06 --- /dev/null +++ b/plutarch-test/goldens/list.dev=true.uplc.eval.golden @@ -0,0 +1,25 @@ +pmatch (program 1.0.0 error) +phead (program 1.0.0 True) +ptail (program 1.0.0 True) +pnull.empty (program 1.0.0 True) +pnull.nonempty (program 1.0.0 True) +pconcat.identity (program 1.0.0 True) +pmap.eg (program 1.0.0 True) +pmap.identity (program 1.0.0 True) +pfilter.evens (program 1.0.0 True) +pfilter.gt5 (program 1.0.0 True) +pzipWith.double (program 1.0.0 True) +pfoldl.nonempty (program 1.0.0 True) +pfoldl.nonempty-primed (program 1.0.0 True) +pfoldl.empty (program 1.0.0 True) +pfoldl.empty-primed (program 1.0.0 True) +elemAt.elemAt_3_[1..10] (program 1.0.0 4) +elemAt.elemAt_0_[1..10] (program 1.0.0 1) +elemAt.elemAt_9_[1..10] (program 1.0.0 10) +find.find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) +find.find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) +x1+x2.builtin (program 1.0.0 3) +x1+x2.pmatch (program 1.0.0 3) +uncons.ChooseList (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail-and-null (program 1.0.0 [2,3,4,5]) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.uplc.golden b/plutarch-test/goldens/list.dev=true.uplc.golden new file mode 100644 index 000000000..7027f46c2 --- /dev/null +++ b/plutarch-test/goldens/list.dev=true.uplc.golden @@ -0,0 +1,25 @@ +pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) +phead (program 1.0.0 (equalsInteger 1 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +ptail (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [2,3,4,5,6,7,8,9,10]) ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (i1 [1,2,3,4,5,6,7,8,9,10]))) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) +pnull.nonempty (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i4 i2 i1 (delay False)) (i1 (i3 (i4 i10) (\i0 -> \i0 -> force i1)) (i3 (\i0 -> \i0 -> force i1) (i4 i10))) (delay (i1 (i3 (\i0 -> \i0 -> force i1) (i4 i10)) (i4 i10))))) (i4 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))))) (force ifThenElse)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i10 i2 (i4 i1)) (delay i3)) i2)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) +pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i3 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i9 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 [1,2,3,4,5,6,7,8,9,10])) (i1 [2,4,6,8,10,12,14,16,18,20])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pmap.identity (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> force i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfilter.evens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [2,4,6,8,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfilter.gt5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [6,7,8,9,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pzipWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i2 i1) (i2 i1)) (i2 [2,4,6,8,10,12,14,16,18,20])) [1,2,3,4,5,6,7,8,9,10]) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfoldl.nonempty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.nonempty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==3)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==5)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +x1+x2.builtin (program 1.0.0 ((\i0 -> (\i0 -> addInteger (i1 (force tailList i2)) (i1 i2)) (force headList)) [1,2,3,4,5])) +x1+x2.pmatch (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i1 i3 (delay error) (delay ((\i0 -> force (i2 i1 (delay error) (delay (addInteger (i3 i4) (i3 i1))))) (force tailList i3))))) (force (force chooseList))) (force headList)) [1,2,3,4,5])) +uncons.ChooseList (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay error) (delay (force tailList i1)))) [1,2,3,4,5])) +uncons.head-and-tail (program 1.0.0 ((\i0 -> (\i0 -> force tailList i2) (force headList i1)) [1,2,3,4,5])) +uncons.head-and-tail-and-null (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse i1 (delay error) (delay ((\i0 -> force tailList i3) (force headList i2))))) (force nullList i1)) [1,2,3,4,5])) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.bench.golden b/plutarch-test/goldens/list.pconcat.identity.bench.golden deleted file mode 100644 index 520fbab6c..000000000 --- a/plutarch-test/goldens/list.pconcat.identity.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":2054437,"exBudgetMemory":7000,"scriptSizeBytes":64} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden b/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden deleted file mode 100644 index a6fe1ca52..000000000 --- a/plutarch-test/goldens/list.pconcat.identity.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 0 (\i0 -> \i0 -> force i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pconcat.identity.uplc.golden b/plutarch-test/goldens/list.pconcat.identity.uplc.golden deleted file mode 100644 index c2c095d0d..000000000 --- a/plutarch-test/goldens/list.pconcat.identity.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 i2 (i4 i1)) (delay i3)) i2) ((\i0 -> i2 i1 (\i0 -> \i0 -> force i1)) 0) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.bench.golden b/plutarch-test/goldens/list.pfilter.bench.golden deleted file mode 100644 index fa1a61ba1..000000000 --- a/plutarch-test/goldens/list.pfilter.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -p1 {"exBudgetCPU":35949366,"exBudgetMemory":87322,"scriptSizeBytes":115} -p2 {"exBudgetCPU":30925386,"exBudgetMemory":83312,"scriptSizeBytes":110} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.uplc.eval.golden b/plutarch-test/goldens/list.pfilter.uplc.eval.golden deleted file mode 100644 index 6ae3f0591..000000000 --- a/plutarch-test/goldens/list.pfilter.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -p1 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) -p2 (program 1.0.0 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfilter.uplc.golden b/plutarch-test/goldens/list.pfilter.uplc.golden deleted file mode 100644 index 091b0f066..000000000 --- a/plutarch-test/goldens/list.pfilter.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -p1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) -p2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i5 i2) (delay (i7 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.bench.golden b/plutarch-test/goldens/list.pfoldl.bench.golden deleted file mode 100644 index 5f2f40417..000000000 --- a/plutarch-test/goldens/list.pfoldl.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -p1 {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -p1' {"exBudgetCPU":27433517,"exBudgetMemory":71012,"scriptSizeBytes":92} -p2 {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} -p2' {"exBudgetCPU":1608977,"exBudgetMemory":5032,"scriptSizeBytes":80} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.uplc.eval.golden b/plutarch-test/goldens/list.pfoldl.uplc.eval.golden deleted file mode 100644 index 934031787..000000000 --- a/plutarch-test/goldens/list.pfoldl.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -p1 (program 1.0.0 -55) -p1' (program 1.0.0 -55) -p2 (program 1.0.0 0) -p2' (program 1.0.0 0) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pfoldl.uplc.golden b/plutarch-test/goldens/list.pfoldl.uplc.golden deleted file mode 100644 index 20449fe5f..000000000 --- a/plutarch-test/goldens/list.pfoldl.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -p1 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -p1' (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -p2 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -p2' (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.bench.golden b/plutarch-test/goldens/list.phead.bench.golden deleted file mode 100644 index df2056587..000000000 --- a/plutarch-test/goldens/list.phead.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.uplc.eval.golden b/plutarch-test/goldens/list.phead.uplc.eval.golden deleted file mode 100644 index bfe2c27c9..000000000 --- a/plutarch-test/goldens/list.phead.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/list.phead.uplc.golden b/plutarch-test/goldens/list.phead.uplc.golden deleted file mode 100644 index 5e1f40f29..000000000 --- a/plutarch-test/goldens/list.phead.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.bench.golden b/plutarch-test/goldens/list.pmap.bench.golden deleted file mode 100644 index 978a33629..000000000 --- a/plutarch-test/goldens/list.pmap.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29309216,"exBudgetMemory":77312,"scriptSizeBytes":99} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.uplc.eval.golden b/plutarch-test/goldens/list.pmap.uplc.eval.golden deleted file mode 100644 index f5958794f..000000000 --- a/plutarch-test/goldens/list.pmap.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmap.uplc.golden b/plutarch-test/goldens/list.pmap.uplc.golden deleted file mode 100644 index ad1169d66..000000000 --- a/plutarch-test/goldens/list.pmap.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i7 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (i4 (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmatch.uplc.eval.golden b/plutarch-test/goldens/list.pmatch.uplc.eval.golden deleted file mode 100644 index 046ef4db8..000000000 --- a/plutarch-test/goldens/list.pmatch.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pmatch.uplc.golden b/plutarch-test/goldens/list.pmatch.uplc.golden deleted file mode 100644 index 7c74576bf..000000000 --- a/plutarch-test/goldens/list.pmatch.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.bench.golden b/plutarch-test/goldens/list.pnull.bench.golden deleted file mode 100644 index b1909ab24..000000000 --- a/plutarch-test/goldens/list.pnull.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -p0 {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -p1 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.uplc.eval.golden b/plutarch-test/goldens/list.pnull.uplc.eval.golden deleted file mode 100644 index 13f0e5ad0..000000000 --- a/plutarch-test/goldens/list.pnull.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -p0 (program 1.0.0 True) -p1 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pnull.uplc.golden b/plutarch-test/goldens/list.pnull.uplc.golden deleted file mode 100644 index a685f05af..000000000 --- a/plutarch-test/goldens/list.pnull.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -p0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) -p1 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.bench.golden b/plutarch-test/goldens/list.ptail.bench.golden deleted file mode 100644 index df2056587..000000000 --- a/plutarch-test/goldens/list.ptail.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":15904294,"exBudgetMemory":38892,"scriptSizeBytes":75} \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.uplc.eval.golden b/plutarch-test/goldens/list.ptail.uplc.eval.golden deleted file mode 100644 index 1dbbd6e3c..000000000 --- a/plutarch-test/goldens/list.ptail.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 3 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 5 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 7 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 9 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> force i1))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.ptail.uplc.golden b/plutarch-test/goldens/list.ptail.uplc.golden deleted file mode 100644 index 0d8e97d35..000000000 --- a/plutarch-test/goldens/list.ptail.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10]))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.bench.golden b/plutarch-test/goldens/list.pzipWith.bench.golden deleted file mode 100644 index 7d51287d0..000000000 --- a/plutarch-test/goldens/list.pzipWith.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":46106600,"exBudgetMemory":119104,"scriptSizeBytes":120} \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.uplc.eval.golden b/plutarch-test/goldens/list.pzipWith.uplc.eval.golden deleted file mode 100644 index f5958794f..000000000 --- a/plutarch-test/goldens/list.pzipWith.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i2 2 (\i0 -> \i0 -> i2 4 (\i0 -> \i0 -> i2 6 (\i0 -> \i0 -> i2 8 (\i0 -> \i0 -> i2 10 (\i0 -> \i0 -> i2 12 (\i0 -> \i0 -> i2 14 (\i0 -> \i0 -> i2 16 (\i0 -> \i0 -> i2 18 (\i0 -> \i0 -> i2 20 (\i0 -> \i0 -> force i1)))))))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.pzipWith.uplc.golden b/plutarch-test/goldens/list.pzipWith.uplc.golden deleted file mode 100644 index d44aef59c..000000000 --- a/plutarch-test/goldens/list.pzipWith.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i11 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i1 i7) (i1 i7)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.bench.golden b/plutarch-test/goldens/maybe.bench.golden new file mode 100644 index 000000000..5187c86d7 --- /dev/null +++ b/plutarch-test/goldens/maybe.bench.golden @@ -0,0 +1,4 @@ +eq.true.nothing {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":34} +eq.true.just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} +eq.false.nothing-just {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":36} +eq.false.just-just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.eval.golden b/plutarch-test/goldens/maybe.uplc.eval.golden new file mode 100644 index 000000000..4a70ad9fd --- /dev/null +++ b/plutarch-test/goldens/maybe.uplc.eval.golden @@ -0,0 +1,4 @@ +eq.true.nothing (program 1.0.0 True) +eq.true.just (program 1.0.0 True) +eq.false.nothing-just (program 1.0.0 False) +eq.false.just-just (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.golden b/plutarch-test/goldens/maybe.uplc.golden new file mode 100644 index 000000000..2fde37e08 --- /dev/null +++ b/plutarch-test/goldens/maybe.uplc.golden @@ -0,0 +1,4 @@ +eq.true.nothing (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> force i1))) +eq.true.just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42))) +eq.false.nothing-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> i2 42))) +eq.false.just-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden new file mode 100644 index 000000000..bcae55e29 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden @@ -0,0 +1,2 @@ +do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} +do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.bench.golden deleted file mode 100644 index 8705ffc87..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.golden deleted file mode 100644 index ed510fea3..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.haskell.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden new file mode 100644 index 000000000..a9c117adc --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ()) +do.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden new file mode 100644 index 000000000..d5e484e74 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden new file mode 100644 index 000000000..332672742 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -0,0 +1,2 @@ +do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":390} +do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":386} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden deleted file mode 100644 index 5bf28846b..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":382} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden deleted file mode 100644 index fd936ba65..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.haskell.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at src/Plutarch/MonadicSpec.hs:44:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden new file mode 100644 index 000000000..a9c117adc --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ()) +do.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden new file mode 100644 index 000000000..03ca95ab4 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:79:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:79:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/pair.bench.golden b/plutarch-test/goldens/pair.bench.golden new file mode 100644 index 000000000..a85af75ee --- /dev/null +++ b/plutarch-test/goldens/pair.bench.golden @@ -0,0 +1,4 @@ +eq.true {"exBudgetCPU":1811392,"exBudgetMemory":5203,"scriptSizeBytes":59} +eq.false.fst {"exBudgetCPU":1537300,"exBudgetMemory":4802,"scriptSizeBytes":59} +eq.false.snd {"exBudgetCPU":1722073,"exBudgetMemory":4903,"scriptSizeBytes":64} +eq.false.both {"exBudgetCPU":1447981,"exBudgetMemory":4502,"scriptSizeBytes":64} \ No newline at end of file diff --git a/plutarch-test/goldens/pair.uplc.eval.golden b/plutarch-test/goldens/pair.uplc.eval.golden new file mode 100644 index 000000000..f93364c5e --- /dev/null +++ b/plutarch-test/goldens/pair.uplc.eval.golden @@ -0,0 +1,4 @@ +eq.true (program 1.0.0 True) +eq.false.fst (program 1.0.0 False) +eq.false.snd (program 1.0.0 False) +eq.false.both (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/pair.uplc.golden b/plutarch-test/goldens/pair.uplc.golden new file mode 100644 index 000000000..f522de39b --- /dev/null +++ b/plutarch-test/goldens/pair.uplc.golden @@ -0,0 +1,4 @@ +eq.true (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i2) (\i0 -> i1 42 i2)) "Hello")) +eq.false.fst (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i2) (\i0 -> i1 24 i2)) "Hello")) +eq.false.snd (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 42 "World"))) +eq.false.both (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 24 "World"))) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.constr.bench.golden b/plutarch-test/goldens/pisdata.constr.bench.golden new file mode 100644 index 000000000..2a54c6d30 --- /dev/null +++ b/plutarch-test/goldens/pisdata.constr.bench.golden @@ -0,0 +1,8 @@ +sop.4wheeler {"exBudgetCPU":1494425,"exBudgetMemory":2760,"scriptSizeBytes":45} +sop.2wheeler {"exBudgetCPU":956241,"exBudgetMemory":1896,"scriptSizeBytes":30} +sop.immovable {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} +prod.1 {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":40} +prod.2 {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":68} +enum.PA {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} +enum.PB {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} +pconstant-pcon-rel {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":22} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.constr.uplc.eval.golden b/plutarch-test/goldens/pisdata.constr.uplc.eval.golden new file mode 100644 index 000000000..6f3b5cbf0 --- /dev/null +++ b/plutarch-test/goldens/pisdata.constr.uplc.eval.golden @@ -0,0 +1,8 @@ +sop.4wheeler (program 1.0.0 #d8799f0205182a00ff) +sop.2wheeler (program 1.0.0 #d87a9f0500ff) +sop.immovable (program 1.0.0 #d87b80) +prod.1 (program 1.0.0 #d8799f41ab4141410eff) +prod.2 (program 1.0.0 #d8799fd8799f40ffd87a9fd8799fd8799f41abff00ffffd87b9fd8799fd8799f41daffffffff) +enum.PA (program 1.0.0 #d87980) +enum.PB (program 1.0.0 #d87a80) +pconstant-pcon-rel (program 1.0.0 #d8799fd87a9f4101ffd87a80ff) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.constr.uplc.golden b/plutarch-test/goldens/pisdata.constr.uplc.golden new file mode 100644 index 000000000..38bb851e4 --- /dev/null +++ b/plutarch-test/goldens/pisdata.constr.uplc.golden @@ -0,0 +1,8 @@ +sop.4wheeler (program 1.0.0 ((\i0 -> constrData 0 (i1 #02 (i1 #05 (i1 #182a (i1 #00 [ ]))))) (force mkCons))) +sop.2wheeler (program 1.0.0 ((\i0 -> constrData 1 (i1 #05 (i1 #00 []))) (force mkCons))) +sop.immovable (program 1.0.0 (constrData 2 [])) +prod.1 (program 1.0.0 ((\i0 -> constrData 0 (i1 #41ab (i1 #4141 (i1 #410e [ ])))) (force mkCons))) +prod.2 (program 1.0.0 ((\i0 -> constrData 0 (i1 #d8799f40ff (i1 #d87a9fd8799fd8799f41abff00ffff (i1 #d87b9fd8799fd8799f41daffffff [ ])))) (force mkCons))) +enum.PA (program 1.0.0 (constrData 0 [])) +enum.PB (program 1.0.0 (constrData 1 [])) +pconstant-pcon-rel (program 1.0.0 #d8799fd87a9f4101ffd87a80ff) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.equality.bench.golden b/plutarch-test/goldens/pisdata.equality.bench.golden new file mode 100644 index 000000000..823f5cf55 --- /dev/null +++ b/plutarch-test/goldens/pisdata.equality.bench.golden @@ -0,0 +1,4 @@ +PData.1 {"exBudgetCPU":518284,"exBudgetMemory":901,"scriptSizeBytes":22} +PData.2 {"exBudgetCPU":636696,"exBudgetMemory":1602,"scriptSizeBytes":30} +PAsData.1 {"exBudgetCPU":768057,"exBudgetMemory":1065,"scriptSizeBytes":15} +PAsData.1 {"exBudgetCPU":1065788,"exBudgetMemory":2066,"scriptSizeBytes":31} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.equality.uplc.eval.golden b/plutarch-test/goldens/pisdata.equality.uplc.eval.golden new file mode 100644 index 000000000..c177045ae --- /dev/null +++ b/plutarch-test/goldens/pisdata.equality.uplc.eval.golden @@ -0,0 +1,4 @@ +PData.1 (program 1.0.0 True) +PData.2 (program 1.0.0 True) +PAsData.1 (program 1.0.0 True) +PAsData.1 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.equality.uplc.golden b/plutarch-test/goldens/pisdata.equality.uplc.golden new file mode 100644 index 000000000..a6c36e050 --- /dev/null +++ b/plutarch-test/goldens/pisdata.equality.uplc.golden @@ -0,0 +1,4 @@ +PData.1 (program 1.0.0 ((\i0 -> equalsData i1 i1) #9fd87a9f00ffff)) +PData.2 (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) (equalsData #d87980 #182a))) +PAsData.1 (program 1.0.0 (equalsData (iData 42) (iData 42))) +PAsData.1 (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) (equalsData (bData #12) (bData #ab)))) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lt.bench.golden b/plutarch-test/goldens/pisdata.lt.bench.golden new file mode 100644 index 000000000..9f795981e --- /dev/null +++ b/plutarch-test/goldens/pisdata.lt.bench.golden @@ -0,0 +1,12 @@ +PCredential.derived.true {"exBudgetCPU":2477349,"exBudgetMemory":5930,"scriptSizeBytes":101} +PCredential.derived.false {"exBudgetCPU":2972494,"exBudgetMemory":7132,"scriptSizeBytes":101} +PCredential.pmatch.true {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.true {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PTriplet.derived.true {"exBudgetCPU":6200878,"exBudgetMemory":12654,"scriptSizeBytes":158} +PTriplet.derived.false {"exBudgetCPU":6696023,"exBudgetMemory":13856,"scriptSizeBytes":158} +PTriplet.pmatch.true {"exBudgetCPU":6736792,"exBudgetMemory":14454,"scriptSizeBytes":161} +PTriplet.pmatch.false {"exBudgetCPU":7410575,"exBudgetMemory":16256,"scriptSizeBytes":161} +PTriplet.pmatch-pdatarecord.true {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} +PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lt.uplc.eval.golden b/plutarch-test/goldens/pisdata.lt.uplc.eval.golden new file mode 100644 index 000000000..b4f436f15 --- /dev/null +++ b/plutarch-test/goldens/pisdata.lt.uplc.eval.golden @@ -0,0 +1,12 @@ +PCredential.derived.true (program 1.0.0 True) +PCredential.derived.false (program 1.0.0 False) +PCredential.pmatch.true (program 1.0.0 True) +PCredential.pmatch.false (program 1.0.0 False) +PCredential.pmatch-pdatarecord.true (program 1.0.0 True) +PCredential.pmatch-pdatarecord.false (program 1.0.0 False) +PTriplet.derived.true (program 1.0.0 True) +PTriplet.derived.false (program 1.0.0 False) +PTriplet.pmatch.true (program 1.0.0 True) +PTriplet.pmatch.false (program 1.0.0 False) +PTriplet.pmatch-pdatarecord.true (program 1.0.0 True) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lt.uplc.golden b/plutarch-test/goldens/pisdata.lt.uplc.golden new file mode 100644 index 000000000..5ffb8edf5 --- /dev/null +++ b/plutarch-test/goldens/pisdata.lt.uplc.golden @@ -0,0 +1,12 @@ +PCredential.derived.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i10 i2)) (unBData (i10 i1))) (i10 i4)) (i9 i4))) (delay False)))))) (i9 i2)) (i8 i2)) (unConstrData i2)) (unConstrData i2)) #d8799f40ff #d87a9f4141ff) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanByteString (unBData (i10 i2)) (unBData (i10 i1))) (i10 i4)) (i9 i4))) (delay False)))))) (i9 i2)) (i8 i2)) (unConstrData i2)) (unConstrData i2)) #d87a9f4141ff #d8799f40ff) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay False))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay (lessThanByteString (unBData (i8 i4)) (unBData (i8 i1)))) (delay True))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PTriplet.derived.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 (lessThanInteger i2 i1) (delay True) (delay (force (i11 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i15 i2)) (unIData (i15 i1))) (i13 i4)) (i12 i4))) (delay False)))))) (unIData (i12 i2))) (unIData (i11 i2))) (i9 i4)) (i8 i4))) (delay False)))))) (unIData (i8 i2))) (unIData (i7 i2))) (i7 i2)) (i6 i2)) #d8799f010203ff #d8799f010305ff) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 (lessThanInteger i2 i1) (delay True) (delay (force (i11 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i15 i2)) (unIData (i15 i1))) (i13 i4)) (i12 i4))) (delay False)))))) (unIData (i12 i2))) (unIData (i11 i2))) (i9 i4)) (i8 i4))) (delay False)))))) (unIData (i8 i2))) (unIData (i7 i2))) (i7 i2)) (i6 i2)) #d8799f010305ff #d8799f010203ff) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch-pdatarecord.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.bench.golden b/plutarch-test/goldens/pisdata.lte.bench.golden new file mode 100644 index 000000000..37ac92a56 --- /dev/null +++ b/plutarch-test/goldens/pisdata.lte.bench.golden @@ -0,0 +1,18 @@ +PCredential.derived.true.eq {"exBudgetCPU":4542028,"exBudgetMemory":9225,"scriptSizeBytes":91} +PCredential.derived.true.less {"exBudgetCPU":2477349,"exBudgetMemory":5930,"scriptSizeBytes":101} +PCredential.derived.false {"exBudgetCPU":2972494,"exBudgetMemory":7132,"scriptSizeBytes":101} +PCredential.pmatch.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} +PCredential.pmatch.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} +PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} +PTriplet.derived.true.eq {"exBudgetCPU":8308352,"exBudgetMemory":15949,"scriptSizeBytes":147} +PTriplet.derived.true.less {"exBudgetCPU":6200878,"exBudgetMemory":12654,"scriptSizeBytes":158} +PTriplet.derived.false {"exBudgetCPU":6696023,"exBudgetMemory":13856,"scriptSizeBytes":158} +PTriplet.pmatch.true.eq {"exBudgetCPU":9022904,"exBudgetMemory":18349,"scriptSizeBytes":155} +PTriplet.pmatch.true.less {"exBudgetCPU":6736792,"exBudgetMemory":14454,"scriptSizeBytes":161} +PTriplet.pmatch.false {"exBudgetCPU":7410575,"exBudgetMemory":16256,"scriptSizeBytes":161} +PTriplet.pmatch-pdatarecord.true.eq {"exBudgetCPU":8308352,"exBudgetMemory":15949,"scriptSizeBytes":147} +PTriplet.pmatch-pdatarecord.true.less {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} +PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.uplc.eval.golden b/plutarch-test/goldens/pisdata.lte.uplc.eval.golden new file mode 100644 index 000000000..69302c643 --- /dev/null +++ b/plutarch-test/goldens/pisdata.lte.uplc.eval.golden @@ -0,0 +1,18 @@ +PCredential.derived.true.eq (program 1.0.0 True) +PCredential.derived.true.less (program 1.0.0 True) +PCredential.derived.false (program 1.0.0 False) +PCredential.pmatch.true.eq (program 1.0.0 True) +PCredential.pmatch.true.less (program 1.0.0 True) +PCredential.pmatch.false (program 1.0.0 False) +PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 True) +PCredential.pmatch-pdatarecord.true.less (program 1.0.0 True) +PCredential.pmatch-pdatarecord.false (program 1.0.0 False) +PTriplet.derived.true.eq (program 1.0.0 True) +PTriplet.derived.true.less (program 1.0.0 True) +PTriplet.derived.false (program 1.0.0 False) +PTriplet.pmatch.true.eq (program 1.0.0 True) +PTriplet.pmatch.true.less (program 1.0.0 True) +PTriplet.pmatch.false (program 1.0.0 False) +PTriplet.pmatch-pdatarecord.true.eq (program 1.0.0 True) +PTriplet.pmatch-pdatarecord.true.less (program 1.0.0 True) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.uplc.golden b/plutarch-test/goldens/pisdata.lte.uplc.golden new file mode 100644 index 000000000..1d16c7c9b --- /dev/null +++ b/plutarch-test/goldens/pisdata.lte.uplc.golden @@ -0,0 +1,18 @@ +PCredential.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i8 i2)) (unBData (i8 i1))) (i8 i4)) (i7 i4))) (delay False)))))) (i7 i2)) (i6 i2)) (unConstrData i6)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i10 i2)) (unBData (i10 i1))) (i10 i4)) (i9 i4))) (delay False)))))) (i9 i2)) (i8 i2)) (unConstrData i2)) (unConstrData i2)) #d8799f40ff #d87a9f4141ff) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsByteString (unBData (i10 i2)) (unBData (i10 i1))) (i10 i4)) (i9 i4))) (delay False)))))) (i9 i2)) (i8 i2)) (unConstrData i2)) (unConstrData i2)) #d87a9f4141ff #d8799f40ff) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))))) (i5 i2)) (i5 i1)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i8 i2)) (i8 i1)) (unConstrData i8))))) (i5 i2)) (i5 i1)) (unConstrData i5)) (force ifThenElse)) (force headList)) (force (force sndPair))) (force (force fstPair))) #d8799f40ff)) +PCredential.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d8799f40ff)) (force ifThenElse)) (force headList)) #d87a9f4141ff) (force (force sndPair))) (force (force fstPair)))) +PCredential.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay False) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay True) (delay (lessThanEqualsByteString (unBData (i8 i4)) (unBData (i8 i1)))))) (i9 i2)) (i9 i1)) (unConstrData i6))))) (i6 i2)) (i6 i1)) (unConstrData #d87a9f4141ff)) (force ifThenElse)) (force headList)) #d8799f40ff) (force (force sndPair))) (force (force fstPair)))) +PTriplet.derived.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.derived.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 (lessThanInteger i2 i1) (delay True) (delay (force (i11 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i15 i2)) (unIData (i15 i1))) (i13 i4)) (i12 i4))) (delay False)))))) (unIData (i12 i2))) (unIData (i11 i2))) (i9 i4)) (i8 i4))) (delay False)))))) (unIData (i8 i2))) (unIData (i7 i2))) (i7 i2)) (i6 i2)) #d8799f010203ff #d8799f010305ff) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.derived.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay True) (delay (force (i7 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 (lessThanInteger i2 i1) (delay True) (delay (force (i11 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i15 i2)) (unIData (i15 i1))) (i13 i4)) (i12 i4))) (delay False)))))) (unIData (i12 i2))) (unIData (i11 i2))) (i9 i4)) (i8 i4))) (delay False)))))) (unIData (i8 i2))) (unIData (i7 i2))) (i7 i2)) (i6 i2)) #d8799f010305ff #d8799f010203ff) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 i12)) (i8 i1)) (i8 i10)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.pmatch.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010305ff)) (i8 i1)) (i8 #d8799f010203ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (lessThanInteger i2 i1) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay (force (i11 (equalsInteger i2 i1) (delay (lessThanEqualsInteger (unIData (i14 (i15 i7))) (unIData (i14 (i15 i5)))))))))) (unIData (i13 i4))) (unIData (i12 i5))))))))) (unIData (i11 i3))) (unIData (i10 i4))) (i10 i1)) (i10 #d8799f010203ff)) (i8 i1)) (i8 #d8799f010305ff)) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch-pdatarecord.true.eq (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 i7)) (i4 i6)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d8799f010203ff)) +PTriplet.pmatch-pdatarecord.true.less (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010305ff)) (i4 #d8799f010203ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +PTriplet.pmatch-pdatarecord.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (lessThanInteger i2 i1) (delay True) (delay (force (i5 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 (lessThanInteger i2 i1) (delay True) (delay (force (i9 (equalsInteger i2 i1) (delay ((\i0 -> (\i0 -> lessThanEqualsInteger (unIData (i13 i2)) (unIData (i13 i1))) (i11 i4)) (i10 i4))) (delay False)))))) (unIData (i10 i2))) (unIData (i9 i2))) (i7 i4)) (i6 i4))) (delay False)))))) (unIData (i6 i2))) (unIData (i5 i2))) (i5 #d8799f010203ff)) (i4 #d8799f010305ff)) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.ppair.bench.golden b/plutarch-test/goldens/pisdata.ppair.bench.golden new file mode 100644 index 000000000..4e2199b85 --- /dev/null +++ b/plutarch-test/goldens/pisdata.ppair.bench.golden @@ -0,0 +1,5 @@ +simple {"exBudgetCPU":508511,"exBudgetMemory":864,"scriptSizeBytes":19} +scriptcredential {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":28} +isomorphism.pforgetData {"exBudgetCPU":1852836,"exBudgetMemory":3492,"scriptSizeBytes":52} +isomorphism.pbuiltinPairFromTuple {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":68} +isomorphism.ptupleFromBuiltin {"exBudgetCPU":1852836,"exBudgetMemory":3492,"scriptSizeBytes":52} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.ppair.uplc.eval.golden b/plutarch-test/goldens/pisdata.ppair.uplc.eval.golden new file mode 100644 index 000000000..86d4048d5 --- /dev/null +++ b/plutarch-test/goldens/pisdata.ppair.uplc.eval.golden @@ -0,0 +1,5 @@ +simple (program 1.0.0 (#01, #4141)) +scriptcredential (program 1.0.0 (#d8799f4141ff, #d87a9f4182ff)) +isomorphism.pforgetData (program 1.0.0 #d8799fd8799f4141ffd87a9f4182ffff) +isomorphism.pbuiltinPairFromTuple (program 1.0.0 (#d8799f4141ff, #d87a9f4182ff)) +isomorphism.ptupleFromBuiltin (program 1.0.0 #d8799fd8799f4141ffd87a9f4182ffff) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.ppair.uplc.golden b/plutarch-test/goldens/pisdata.ppair.uplc.golden new file mode 100644 index 000000000..87673939a --- /dev/null +++ b/plutarch-test/goldens/pisdata.ppair.uplc.golden @@ -0,0 +1,5 @@ +simple (program 1.0.0 (mkPairData #01 (bData #41))) +scriptcredential (program 1.0.0 (mkPairData #d8799f4141ff #d87a9f4182ff)) +isomorphism.pforgetData (program 1.0.0 ((\i0 -> (\i0 -> constrData 0 (i2 (force (force fstPair) i1) (i2 (force (force sndPair) i1) [ ]))) (mkPairData #d8799f4141ff #d87a9f4182ff)) (force mkCons))) +isomorphism.pbuiltinPairFromTuple (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (force (force sndPair) (unConstrData i1))) ((\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 [ ]))) #d8799f4141ff #d87a9f4182ff)) (force headList)) (force mkCons))) +isomorphism.ptupleFromBuiltin (program 1.0.0 ((\i0 -> (\i0 -> constrData 0 (i2 (force (force fstPair) i1) (i2 (force (force sndPair) i1) [ ]))) (mkPairData #d8799f4141ff #d87a9f4182ff)) (force mkCons))) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.bench.golden b/plutarch-test/goldens/plam.bench.golden new file mode 100644 index 000000000..1756137ec --- /dev/null +++ b/plutarch-test/goldens/plam.bench.golden @@ -0,0 +1,28 @@ +id {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +flip.const {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +plet {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.bool.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.int.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +primitives.int.1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +primitives.int.512 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} +primitives.int.1048576 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +primitives.bytestring.1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +primitives.bytestring.1111111 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} +primitives.unit.list {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} +primitives.unit.() {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.id {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +primitives.fun.lam+ {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.fun.+ {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +η-reduction-optimisations.λx y. addInteger x y => addInteger {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +η-reduction-optimisations.λx y. hoist (force mkCons) x y => force mkCons {"exBudgetCPU":59646,"exBudgetMemory":300,"scriptSizeBytes":6} +η-reduction-optimisations.λx y. hoist mkCons x y => mkCons x y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":19} +η-reduction-optimisations.λx y. x + x {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.let x = addInteger in x 1 1 {"exBudgetCPU":346174,"exBudgetMemory":602,"scriptSizeBytes":11} +η-reduction-optimisations.let x = 0 in x => 0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +η-reduction-optimisations.let x = hoist (λx. x + x) in 0 => 0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +η-reduction-optimisations.let x = hoist (λx. x + x) in x {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +η-reduction-optimisations.λx y. sha2_256 x y =>! {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.let f = hoist (λx. x) in λx y. f x y => λx y. x y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":9} +η-reduction-optimisations.let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.λy. (λx. x + x) y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file diff --git a/plutarch-test/goldens/plam.flip.const.uplc.eval.golden b/plutarch-test/goldens/plam.flip.const.uplc.eval.golden deleted file mode 100644 index d9080ab8b..000000000 --- a/plutarch-test/goldens/plam.flip.const.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.flip.const.uplc.golden b/plutarch-test/goldens/plam.flip.const.uplc.golden deleted file mode 100644 index d9080ab8b..000000000 --- a/plutarch-test/goldens/plam.flip.const.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.id.uplc.eval.golden b/plutarch-test/goldens/plam.id.uplc.eval.golden deleted file mode 100644 index 1e51ae76c..000000000 --- a/plutarch-test/goldens/plam.id.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.id.uplc.golden b/plutarch-test/goldens/plam.id.uplc.golden deleted file mode 100644 index 1e51ae76c..000000000 --- a/plutarch-test/goldens/plam.id.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.plet.uplc.eval.golden b/plutarch-test/goldens/plam.plet.uplc.eval.golden deleted file mode 100644 index 3cf174504..000000000 --- a/plutarch-test/goldens/plam.plet.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> error)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.plet.uplc.golden b/plutarch-test/goldens/plam.plet.uplc.golden deleted file mode 100644 index 3cf174504..000000000 --- a/plutarch-test/goldens/plam.plet.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> error)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.uplc.eval.golden b/plutarch-test/goldens/plam.uplc.eval.golden new file mode 100644 index 000000000..eeaf90097 --- /dev/null +++ b/plutarch-test/goldens/plam.uplc.eval.golden @@ -0,0 +1,28 @@ +id (program 1.0.0 (\i0 -> i1)) +flip.const (program 1.0.0 (\i0 -> \i0 -> i1)) +plet (program 1.0.0 (\i0 -> \i0 -> error)) +primitives.bool.true (program 1.0.0 (\i0 -> True)) +primitives.int.0 (program 1.0.0 (\i0 -> 0)) +primitives.int.1 (program 1.0.0 (\i0 -> 1)) +primitives.int.512 (program 1.0.0 (\i0 -> 512)) +primitives.int.1048576 (program 1.0.0 (\i0 -> 1048576)) +primitives.bytestring.1 (program 1.0.0 (\i0 -> #31)) +primitives.bytestring.1111111 (program 1.0.0 (\i0 -> #31313131313131)) +primitives.unit.list (program 1.0.0 (\i0 -> [()])) +primitives.unit.() (program 1.0.0 (\i0 -> ())) +primitives.id (program 1.0.0 (\i0 -> i1)) +primitives.fun.lam+ (program 1.0.0 (\i0 -> addInteger)) +primitives.fun.+ (program 1.0.0 addInteger) +η-reduction-optimisations.λx y. addInteger x y => addInteger (program 1.0.0 addInteger) +η-reduction-optimisations.λx y. hoist (force mkCons) x y => force mkCons (program 1.0.0 (force mkCons)) +η-reduction-optimisations.λx y. hoist mkCons x y => mkCons x y (program 1.0.0 (\i0 -> \i0 -> mkCons i2 i1)) +η-reduction-optimisations.λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x (program 1.0.0 (\i0 -> \i0 -> subtractInteger (subtractInteger (addInteger i2 i1) i1) i2)) +η-reduction-optimisations.λx y. x + x (program 1.0.0 (\i0 -> \i0 -> addInteger i2 i2)) +η-reduction-optimisations.let x = addInteger in x 1 1 (program 1.0.0 2) +η-reduction-optimisations.let x = 0 in x => 0 (program 1.0.0 0) +η-reduction-optimisations.let x = hoist (λx. x + x) in 0 => 0 (program 1.0.0 0) +η-reduction-optimisations.let x = hoist (λx. x + x) in x (program 1.0.0 (\i0 -> addInteger i1 i1)) +η-reduction-optimisations.λx y. sha2_256 x y =>! (program 1.0.0 (\i0 -> \i0 -> sha2_256 i2 i1)) +η-reduction-optimisations.let f = hoist (λx. x) in λx y. f x y => λx y. x y (program 1.0.0 (\i0 -> \i0 -> i2 i1)) +η-reduction-optimisations.let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y (program 1.0.0 (\i0 -> \i0 -> i2 True i1)) +η-reduction-optimisations.λy. (λx. x + x) y (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plam.uplc.golden b/plutarch-test/goldens/plam.uplc.golden new file mode 100644 index 000000000..2137369c2 --- /dev/null +++ b/plutarch-test/goldens/plam.uplc.golden @@ -0,0 +1,28 @@ +id (program 1.0.0 (\i0 -> i1)) +flip.const (program 1.0.0 (\i0 -> \i0 -> i1)) +plet (program 1.0.0 (\i0 -> \i0 -> error)) +primitives.bool.true (program 1.0.0 (\i0 -> True)) +primitives.int.0 (program 1.0.0 (\i0 -> 0)) +primitives.int.1 (program 1.0.0 (\i0 -> 1)) +primitives.int.512 (program 1.0.0 (\i0 -> 512)) +primitives.int.1048576 (program 1.0.0 (\i0 -> 1048576)) +primitives.bytestring.1 (program 1.0.0 (\i0 -> #31)) +primitives.bytestring.1111111 (program 1.0.0 (\i0 -> #31313131313131)) +primitives.unit.list (program 1.0.0 (\i0 -> [()])) +primitives.unit.() (program 1.0.0 (\i0 -> ())) +primitives.id (program 1.0.0 (\i0 -> i1)) +primitives.fun.lam+ (program 1.0.0 (\i0 -> addInteger)) +primitives.fun.+ (program 1.0.0 addInteger) +η-reduction-optimisations.λx y. addInteger x y => addInteger (program 1.0.0 addInteger) +η-reduction-optimisations.λx y. hoist (force mkCons) x y => force mkCons (program 1.0.0 (force mkCons)) +η-reduction-optimisations.λx y. hoist mkCons x y => mkCons x y (program 1.0.0 (\i0 -> \i0 -> mkCons i2 i1)) +η-reduction-optimisations.λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x (program 1.0.0 (\i0 -> \i0 -> subtractInteger (subtractInteger (addInteger i2 i1) i1) i2)) +η-reduction-optimisations.λx y. x + x (program 1.0.0 (\i0 -> \i0 -> addInteger i2 i2)) +η-reduction-optimisations.let x = addInteger in x 1 1 (program 1.0.0 (addInteger 1 1)) +η-reduction-optimisations.let x = 0 in x => 0 (program 1.0.0 0) +η-reduction-optimisations.let x = hoist (λx. x + x) in 0 => 0 (program 1.0.0 0) +η-reduction-optimisations.let x = hoist (λx. x + x) in x (program 1.0.0 (\i0 -> addInteger i1 i1)) +η-reduction-optimisations.λx y. sha2_256 x y =>! (program 1.0.0 (\i0 -> \i0 -> sha2_256 i2 i1)) +η-reduction-optimisations.let f = hoist (λx. x) in λx y. f x y => λx y. x y (program 1.0.0 (\i0 -> \i0 -> i2 i1)) +η-reduction-optimisations.let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y (program 1.0.0 (\i0 -> \i0 -> i2 True i1)) +η-reduction-optimisations.λy. (λx. x + x) y (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.bench.golden b/plutarch-test/goldens/plutustype.deconstr.bench.golden new file mode 100644 index 000000000..aecc38657 --- /dev/null +++ b/plutarch-test/goldens/plutustype.deconstr.bench.golden @@ -0,0 +1,26 @@ +matching.typed.newtype {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} +matching.typed.sumtype(ignore-fields) {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(partial-match) {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(exhaustive).minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive).spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive).rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive).certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.typed.sumtype(exhaustive)(ignore-fields).minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive)(ignore-fields).spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive)(ignore-fields).rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive)(ignore-fields).certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.raw.newtype {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} +matching.raw.sumtype(ignore-fields) {"exBudgetCPU":1122748,"exBudgetMemory":2466,"scriptSizeBytes":33} +matching.raw.sumtype(partial-match) {"exBudgetCPU":1481159,"exBudgetMemory":3198,"scriptSizeBytes":39} +matching.raw.sumtype(exhaustive).minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.raw.sumtype(exhaustive).spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.raw.sumtype(exhaustive).rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.raw.sumtype(exhaustive).certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.raw.sumtype(exhaustive)(ignore-fields).minting {"exBudgetCPU":2291676,"exBudgetMemory":5470,"scriptSizeBytes":75} +matching.raw.sumtype(exhaustive)(ignore-fields).spending {"exBudgetCPU":1301386,"exBudgetMemory":3066,"scriptSizeBytes":85} +matching.raw.sumtype(exhaustive)(ignore-fields).rewarding {"exBudgetCPU":1796531,"exBudgetMemory":4268,"scriptSizeBytes":82} +matching.raw.sumtype(exhaustive)(ignore-fields).certifying {"exBudgetCPU":2291676,"exBudgetMemory":5470,"scriptSizeBytes":77} +fields.typed.extract-single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} +fields.raw.extract-single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} +combined.typed.toValidatorHash {"exBudgetCPU":2496846,"exBudgetMemory":5194,"scriptSizeBytes":72} +combined.raw.toValidatorHash {"exBudgetCPU":2108662,"exBudgetMemory":4362,"scriptSizeBytes":67} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden b/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden new file mode 100644 index 000000000..f3245ed4f --- /dev/null +++ b/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden @@ -0,0 +1,27 @@ +matching.typed.newtype (program 1.0.0 [#d8799f41abff, #d87a80]) +matching.typed.sumtype(ignore-fields) (program 1.0.0 ()) +matching.typed.sumtype(partial-match) (program 1.0.0 [#40]) +matching.typed.sumtype(exhaustive).minting (program 1.0.0 #01) +matching.typed.sumtype(exhaustive).spending (program 1.0.0 #02) +matching.typed.sumtype(exhaustive).rewarding (program 1.0.0 #03) +matching.typed.sumtype(exhaustive).certifying (program 1.0.0 #04) +matching.typed.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 #01) +matching.typed.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 #02) +matching.typed.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 #03) +matching.typed.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 #04) +matching.raw.newtype (program 1.0.0 [#d8799f41abff, #d87a80]) +matching.raw.sumtype(ignore-fields) (program 1.0.0 ()) +matching.raw.sumtype(partial-match) (program 1.0.0 [#40]) +matching.raw.sumtype(exhaustive).minting (program 1.0.0 #01) +matching.raw.sumtype(exhaustive).spending (program 1.0.0 #02) +matching.raw.sumtype(exhaustive).rewarding (program 1.0.0 #03) +matching.raw.sumtype(exhaustive).certifying (program 1.0.0 #04) +matching.raw.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 #01) +matching.raw.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 #02) +matching.raw.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 #03) +matching.raw.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 #04) +fields.typed.extract-single (program 1.0.0 #d87a9f41abff) +fields.raw.extract-single (program 1.0.0 #d87a9f41abff) +combined.typed.toValidatorHash (program 1.0.0 (\i0 -> \i0 -> i2 (unBData (force headList [#41ab])))) +combined.raw.toValidatorHash (program 1.0.0 (\i0 -> \i0 -> i2 (unBData (force headList (force (force sndPair) ( 1 +, [#41ab] )))))) \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.uplc.golden b/plutarch-test/goldens/plutustype.deconstr.uplc.golden new file mode 100644 index 000000000..e9c9de8d6 --- /dev/null +++ b/plutarch-test/goldens/plutustype.deconstr.uplc.golden @@ -0,0 +1,26 @@ +matching.typed.newtype (program 1.0.0 ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) +matching.typed.sumtype(ignore-fields) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay ()) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) +matching.typed.sumtype(partial-match) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) +matching.typed.sumtype(exhaustive).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.raw.newtype (program 1.0.0 ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) +matching.raw.sumtype(ignore-fields) (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) (unConstrData i1)) 0) (delay ()) (delay error))) #d8799f40ff)) +matching.raw.sumtype(partial-match) (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force (force sndPair) i1)) (delay error))) (unConstrData i1)) #d8799f40ff)) +matching.raw.sumtype(exhaustive).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger i2 1) (delay #02) (delay (force (i5 (equalsInteger i2 2) (delay #03) (delay (force (i5 (equalsInteger i2 3) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.raw.sumtype(exhaustive).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger i2 1) (delay #02) (delay (force (i5 (equalsInteger i2 2) (delay #03) (delay (force (i5 (equalsInteger i2 3) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.raw.sumtype(exhaustive).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger i2 1) (delay #02) (delay (force (i5 (equalsInteger i2 2) (delay #03) (delay (force (i5 (equalsInteger i2 3) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.raw.sumtype(exhaustive).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger i2 1) (delay #02) (delay (force (i5 (equalsInteger i2 2) (delay #03) (delay (force (i5 (equalsInteger i2 3) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.raw.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i3 (equalsInteger i1 1) (delay #02) (delay (force (i3 (equalsInteger i1 2) (delay #03) (delay (force (i3 (equalsInteger i1 3) (delay #04) (delay #01))))))))) (force (force fstPair) (unConstrData i1))) #d8799f40ff) (force ifThenElse))) +matching.raw.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i3 (equalsInteger i1 1) (delay #02) (delay (force (i3 (equalsInteger i1 2) (delay #03) (delay (force (i3 (equalsInteger i1 3) (delay #04) (delay #01))))))))) (force (force fstPair) (unConstrData i1))) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.raw.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i3 (equalsInteger i1 1) (delay #02) (delay (force (i3 (equalsInteger i1 2) (delay #03) (delay (force (i3 (equalsInteger i1 3) (delay #04) (delay #01))))))))) (force (force fstPair) (unConstrData i1))) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.raw.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i3 (equalsInteger i1 1) (delay #02) (delay (force (i3 (equalsInteger i1 2) (delay #03) (delay (force (i3 (equalsInteger i1 3) (delay #04) (delay #01))))))))) (force (force fstPair) (unConstrData i1))) #d87c9fd87e80ff) (force ifThenElse))) +fields.typed.extract-single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd87a9f41abffd87a80ff)) +fields.raw.extract-single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd87a9f41abffd87a80ff)) +combined.typed.toValidatorHash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 1 i2) (delay (\i0 -> \i0 -> i2 (unBData (i7 i3)))) (delay (\i0 -> \i0 -> force i1)))) (i5 i2)) (force (force fstPair) i1)) (unConstrData (i2 (i3 (unConstrData i1))))) #d8799fd87a9f41abffd87a80ff) (force headList)) (force (force sndPair)))) +combined.raw.toValidatorHash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 (unBData (i5 (i6 i3))))))) (unConstrData (i2 (i3 (unConstrData i1))))) #d8799fd87a9f41abffd87a80ff) (force headList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.bench.golden b/plutarch-test/goldens/plutustype.example.bench.golden new file mode 100644 index 000000000..6c43feb59 --- /dev/null +++ b/plutarch-test/goldens/plutustype.example.bench.golden @@ -0,0 +1,6 @@ +A-as-0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +B-as-1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +swap.A {"exBudgetCPU":554791,"exBudgetMemory":1502,"scriptSizeBytes":21} +swap.B {"exBudgetCPU":554791,"exBudgetMemory":1502,"scriptSizeBytes":21} +scottenc.PMaybe {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":14} +scottenc.PPair {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":26} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.uplc.eval.golden b/plutarch-test/goldens/plutustype.example.uplc.eval.golden new file mode 100644 index 000000000..2c3a2a96e --- /dev/null +++ b/plutarch-test/goldens/plutustype.example.uplc.eval.golden @@ -0,0 +1,6 @@ +A-as-0 (program 1.0.0 0) +B-as-1 (program 1.0.0 1) +swap.A (program 1.0.0 1) +swap.B (program 1.0.0 0) +scottenc.PMaybe (program 1.0.0 42) +scottenc.PPair (program 1.0.0 "Universe") \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.uplc.golden b/plutarch-test/goldens/plutustype.example.uplc.golden new file mode 100644 index 000000000..01b5ecaee --- /dev/null +++ b/plutarch-test/goldens/plutustype.example.uplc.golden @@ -0,0 +1,6 @@ +A-as-0 (program 1.0.0 0) +B-as-1 (program 1.0.0 1) +swap.A (program 1.0.0 (force (force ifThenElse (equalsInteger 0 0) (delay 1) (delay 0)))) +swap.B (program 1.0.0 (force (force ifThenElse (equalsInteger 1 0) (delay 1) (delay 0)))) +scottenc.PMaybe (program 1.0.0 ((\i0 -> \i0 -> i2 42) (\i0 -> i1) (delay error))) +scottenc.PPair (program 1.0.0 ((\i0 -> i1 42 "Universe") (\i0 -> \i0 -> i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.bench.golden b/plutarch-test/goldens/rational.bench.golden new file mode 100644 index 000000000..58cc9718e --- /dev/null +++ b/plutarch-test/goldens/rational.bench.golden @@ -0,0 +1,21 @@ +literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +ops.+ {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} +ops.- {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} +ops.* {"exBudgetCPU":53544398,"exBudgetMemory":123567,"scriptSizeBytes":353} +ops.harmonic-sum {"exBudgetCPU":79082665,"exBudgetMemory":181041,"scriptSizeBytes":351} +ops.multi-product {"exBudgetCPU":88311584,"exBudgetMemory":205073,"scriptSizeBytes":364} +compare {"exBudgetCPU":25140684,"exBudgetMemory":58473,"scriptSizeBytes":298} +round.5/3 {"exBudgetCPU":16770462,"exBudgetMemory":34647,"scriptSizeBytes":322} +round.4/3 {"exBudgetCPU":15284005,"exBudgetMemory":31544,"scriptSizeBytes":322} +round.-5/2 {"exBudgetCPU":16459980,"exBudgetMemory":33547,"scriptSizeBytes":336} +round.-1/4 {"exBudgetCPU":15510987,"exBudgetMemory":31646,"scriptSizeBytes":336} +truncate.5/4 {"exBudgetCPU":12715544,"exBudgetMemory":28437,"scriptSizeBytes":273} +truncate.7/4 {"exBudgetCPU":14202001,"exBudgetMemory":31540,"scriptSizeBytes":273} +truncate.1/4 {"exBudgetCPU":11229087,"exBudgetMemory":25334,"scriptSizeBytes":273} +truncate.-7/4 {"exBudgetCPU":16231741,"exBudgetMemory":35147,"scriptSizeBytes":287} +properFraction.-1/2 {"exBudgetCPU":38270534,"exBudgetMemory":87420,"scriptSizeBytes":423} +properFraction.-3/2 {"exBudgetCPU":40073292,"exBudgetMemory":90925,"scriptSizeBytes":428} +properFraction.-4/3 {"exBudgetCPU":40073292,"exBudgetMemory":90925,"scriptSizeBytes":428} +data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.11/3 {"exBudgetCPU":11211248,"exBudgetMemory":26831,"scriptSizeBytes":226} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.bench.golden b/plutarch-test/goldens/rational.compare.bench.golden deleted file mode 100644 index 6491ee7f6..000000000 --- a/plutarch-test/goldens/rational.compare.bench.golden +++ /dev/null @@ -1 +0,0 @@ -< {"exBudgetCPU":25140684,"exBudgetMemory":58473,"scriptSizeBytes":298} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.uplc.eval.golden b/plutarch-test/goldens/rational.compare.uplc.eval.golden deleted file mode 100644 index b33a7688c..000000000 --- a/plutarch-test/goldens/rational.compare.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -< (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.uplc.golden b/plutarch-test/goldens/rational.compare.uplc.golden deleted file mode 100644 index 5d367b7b5..000000000 --- a/plutarch-test/goldens/rational.compare.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -< (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.literal.uplc.eval.golden b/plutarch-test/goldens/rational.literal.uplc.eval.golden deleted file mode 100644 index 0dcc5a2f3..000000000 --- a/plutarch-test/goldens/rational.literal.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> i1 1 2)) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.literal.uplc.golden b/plutarch-test/goldens/rational.literal.uplc.golden deleted file mode 100644 index 0dcc5a2f3..000000000 --- a/plutarch-test/goldens/rational.literal.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> i1 1 2)) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.bench.golden b/plutarch-test/goldens/rational.ops.bench.golden deleted file mode 100644 index 262c8b0b7..000000000 --- a/plutarch-test/goldens/rational.ops.bench.golden +++ /dev/null @@ -1,3 +0,0 @@ -+ {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} -- {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} -* {"exBudgetCPU":53544398,"exBudgetMemory":123567,"scriptSizeBytes":353} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.uplc.eval.golden b/plutarch-test/goldens/rational.ops.uplc.eval.golden deleted file mode 100644 index 9a9de27ef..000000000 --- a/plutarch-test/goldens/rational.ops.uplc.eval.golden +++ /dev/null @@ -1,3 +0,0 @@ -+ (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 4 4)) (multiplyInteger 1 (divideInteger 4 4)))) -- (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) -* (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 4 1)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.uplc.golden b/plutarch-test/goldens/rational.ops.uplc.golden deleted file mode 100644 index efc174720..000000000 --- a/plutarch-test/goldens/rational.ops.uplc.golden +++ /dev/null @@ -1,3 +0,0 @@ -+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.uplc.eval.golden b/plutarch-test/goldens/rational.uplc.eval.golden new file mode 100644 index 000000000..48def975b --- /dev/null +++ b/plutarch-test/goldens/rational.uplc.eval.golden @@ -0,0 +1,21 @@ +literal (program 1.0.0 (\i0 -> i1 1 2)) +ops.+ (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 4 4)) (multiplyInteger 1 (divideInteger 4 4)))) +ops.- (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) +ops.* (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 4 1)))) +ops.harmonic-sum (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 77 1)) (multiplyInteger 1 (divideInteger 60 1)))) +ops.multi-product (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) +compare (program 1.0.0 True) +round.5/3 (program 1.0.0 2) +round.4/3 (program 1.0.0 1) +round.-5/2 (program 1.0.0 -2) +round.-1/4 (program 1.0.0 0) +truncate.5/4 (program 1.0.0 1) +truncate.7/4 (program 1.0.0 1) +truncate.1/4 (program 1.0.0 0) +truncate.-7/4 (program 1.0.0 -1) +properFraction.-1/2 (program 1.0.0 True) +properFraction.-3/2 (program 1.0.0 True) +properFraction.-4/3 (program 1.0.0 True) +data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) +data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) +data.id.11/3 (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 11 1)) (multiplyInteger 1 (divideInteger 3 1)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.uplc.golden b/plutarch-test/goldens/rational.uplc.golden new file mode 100644 index 000000000..100e5a64a --- /dev/null +++ b/plutarch-test/goldens/rational.uplc.golden @@ -0,0 +1,21 @@ +literal (program 1.0.0 (\i0 -> i1 1 2)) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i13 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i13 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i13 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i13 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i13 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i13 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i13 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i13 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i13 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) +data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=false.bench.golden b/plutarch-test/goldens/rec.dev=false.bench.golden new file mode 100644 index 000000000..2d9ec6b78 --- /dev/null +++ b/plutarch-test/goldens/rec.dev=false.bench.golden @@ -0,0 +1,45 @@ +simple.constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} +simple.reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} +LetRec.record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} +LetRec.even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} +LetRec.even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} +nested.flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} +nested.flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} +nested.flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} +nested.flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} +nested.shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} +nested.shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} +nested.shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} +nested.shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +Data.pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} +Data.pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} +Data.pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} +Data.pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} +Data.fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":36} +Data.fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":48} +Data.fieldFromData.nested.shallow {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":115} +Data.pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":83} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.dev=false.uplc.eval.golden new file mode 100644 index 000000000..756e9884a --- /dev/null +++ b/plutarch-test/goldens/rec.dev=false.uplc.eval.golden @@ -0,0 +1,59 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 6) +simple.field.value.direct-access (program 1.0.0 6) +simple.field.value.pmatch (program 1.0.0 "Salut, Monde!") +simple.field.value.pmatch' (program 1.0.0 "Salut, Monde!") +simple.field.value.rmatch (program 1.0.0 "Salut, Monde!") +simple.reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.reconstr.field-access (program 1.0.0 6) +LetRec.record (program 1.0.0 12) +LetRec.record-field (program 1.0.0 12) +LetRec.even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) +LetRec.even.4 (program 1.0.0 True) +LetRec.even.5 (program 1.0.0 False) +nested.flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.nested-field-access (program 1.0.0 9) +nested.flat.nested-field-value.direct-access (program 1.0.0 9) +nested.flat.nested-field-value.pmatch (program 1.0.0 9) +nested.flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 9) +nested.flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.flat.nested-match-value (program 1.0.0 "Salut, Monde!") +nested.shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.nested-field-access (program 1.0.0 9) +nested.shallow.nested-field-value.direct-access (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 9) +nested.shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-match-value (program 1.0.0 "Salut, Monde!") +Data.pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) +Data.pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) +Data.pdata.flat-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d87980 + , #06 + , #4d53616c75742c204d6f6e646521 + , #04 + , #d87980 + , #09 + , #4d53616c75742c204d6f6e646521 + , #4c486f6c612c204d756e646f21 ] )) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d8799fd87980064d53616c75742c204d6f6e646521ff + , #04 + , #d8799fd87980094d53616c75742c204d6f6e646521ff + , #4c486f6c612c204d756e646f21 ] )) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1)))) +Data.fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) +Data.pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=false.uplc.golden b/plutarch-test/goldens/rec.dev=false.uplc.golden new file mode 100644 index 000000000..6c7a400f5 --- /dev/null +++ b/plutarch-test/goldens/rec.dev=false.uplc.golden @@ -0,0 +1,45 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) +simple.reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) +nested.flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) +nested.flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) +nested.shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +Data.pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) +Data.pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) +Data.pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1))) (force tailList))) +Data.fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) +Data.pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.bench.golden b/plutarch-test/goldens/rec.dev=true.bench.golden new file mode 100644 index 000000000..c1d0f244d --- /dev/null +++ b/plutarch-test/goldens/rec.dev=true.bench.golden @@ -0,0 +1,45 @@ +simple.constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} +simple.reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} +LetRec.record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} +LetRec.even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} +LetRec.even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} +nested.flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} +nested.flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} +nested.flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} +nested.flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} +nested.shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} +nested.shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} +nested.shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} +nested.shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +Data.pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} +Data.pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} +Data.pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} +Data.pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} +Data.fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":72} +Data.fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":84} +Data.fieldFromData.nested.shallow {"exBudgetCPU":893290,"exBudgetMemory":3100,"scriptSizeBytes":161} +Data.pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":118} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.dev=true.uplc.eval.golden new file mode 100644 index 000000000..16ab3b629 --- /dev/null +++ b/plutarch-test/goldens/rec.dev=true.uplc.eval.golden @@ -0,0 +1,59 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 6) +simple.field.value.direct-access (program 1.0.0 6) +simple.field.value.pmatch (program 1.0.0 "Salut, Monde!") +simple.field.value.pmatch' (program 1.0.0 "Salut, Monde!") +simple.field.value.rmatch (program 1.0.0 "Salut, Monde!") +simple.reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.reconstr.field-access (program 1.0.0 6) +LetRec.record (program 1.0.0 12) +LetRec.record-field (program 1.0.0 12) +LetRec.even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) +LetRec.even.4 (program 1.0.0 True) +LetRec.even.5 (program 1.0.0 False) +nested.flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.nested-field-access (program 1.0.0 9) +nested.flat.nested-field-value.direct-access (program 1.0.0 9) +nested.flat.nested-field-value.pmatch (program 1.0.0 9) +nested.flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 9) +nested.flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.flat.nested-match-value (program 1.0.0 "Salut, Monde!") +nested.shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.nested-field-access (program 1.0.0 9) +nested.shallow.nested-field-value.direct-access (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 9) +nested.shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-match-value (program 1.0.0 "Salut, Monde!") +Data.pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) +Data.pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) +Data.pdata.flat-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d87980 + , #06 + , #4d53616c75742c204d6f6e646521 + , #04 + , #d87980 + , #09 + , #4d53616c75742c204d6f6e646521 + , #4c486f6c612c204d756e646f21 ] )) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d8799fd87980064d53616c75742c204d6f6e646521ff + , #04 + , #d8799fd87980094d53616c75742c204d6f6e646521ff + , #4c486f6c612c204d756e646f21 ] )) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +Data.fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) +Data.pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.golden b/plutarch-test/goldens/rec.dev=true.uplc.golden new file mode 100644 index 000000000..772f9ecfb --- /dev/null +++ b/plutarch-test/goldens/rec.dev=true.uplc.golden @@ -0,0 +1,45 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) +simple.reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) +nested.flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) +nested.flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) +nested.shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +Data.pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) +Data.pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) +Data.pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1))) (force tailList))) +Data.fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay (force (i9 i10 (delay error)))))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay (force (i8 i9 (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (force trace)) "verifySoleConstructor failed")) +Data.pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.bench.golden b/plutarch-test/goldens/recursion.example.bench.golden new file mode 100644 index 000000000..8d6fc2845 --- /dev/null +++ b/plutarch-test/goldens/recursion.example.bench.golden @@ -0,0 +1,3 @@ +iterateN.lam {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} +iterateN.app.succ {"exBudgetCPU":18918235,"exBudgetMemory":45362,"scriptSizeBytes":65} +iterateN.app.double {"exBudgetCPU":17785665,"exBudgetMemory":45362,"scriptSizeBytes":65} \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.iterateN.bench.golden b/plutarch-test/goldens/recursion.example.iterateN.bench.golden deleted file mode 100644 index 87c0d711b..000000000 --- a/plutarch-test/goldens/recursion.example.iterateN.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.iterateN.uplc.eval.golden b/plutarch-test/goldens/recursion.example.iterateN.uplc.eval.golden deleted file mode 100644 index 9d49a3960..000000000 --- a/plutarch-test/goldens/recursion.example.iterateN.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i3 1) i2 (i2 i1)))))) \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.iterateN.uplc.golden b/plutarch-test/goldens/recursion.example.iterateN.uplc.golden deleted file mode 100644 index b474fd9f1..000000000 --- a/plutarch-test/goldens/recursion.example.iterateN.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.uplc.eval.golden b/plutarch-test/goldens/recursion.example.uplc.eval.golden new file mode 100644 index 000000000..ae3fa5d70 --- /dev/null +++ b/plutarch-test/goldens/recursion.example.uplc.eval.golden @@ -0,0 +1,3 @@ +iterateN.lam (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i3 1) i2 (i2 i1)))))) +iterateN.app.succ (program 1.0.0 10) +iterateN.app.double (program 1.0.0 1024) \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.uplc.golden b/plutarch-test/goldens/recursion.example.uplc.golden new file mode 100644 index 000000000..ccf9c0206 --- /dev/null +++ b/plutarch-test/goldens/recursion.example.uplc.golden @@ -0,0 +1,3 @@ +iterateN.lam (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))))) +iterateN.app.succ (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) 10 (\i0 -> addInteger i1 1) 0)) +iterateN.app.double (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsInteger i3 0) (delay i1) (delay (i4 (subtractInteger i3 1) i2 (i2 i1))))) 10 (\i0 -> multiplyInteger i1 2) 1)) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth stake validator.uplc.golden b/plutarch-test/goldens/scripts.auth stake validator.uplc.golden deleted file mode 100644 index d6b3b2803..000000000 --- a/plutarch-test/goldens/scripts.auth stake validator.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.hash.golden b/plutarch-test/goldens/scripts.auth_policy.hash.golden deleted file mode 100644 index a64f01b91..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.hash.golden +++ /dev/null @@ -1 +0,0 @@ -581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden deleted file mode 100644 index b66a171ce..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_policy.uplc.golden b/plutarch-test/goldens/scripts.auth_policy.uplc.golden deleted file mode 100644 index d6b3b2803..000000000 --- a/plutarch-test/goldens/scripts.auth_policy.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.hash.golden b/plutarch-test/goldens/scripts.auth_stake_validator.hash.golden deleted file mode 100644 index a64f01b91..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.hash.golden +++ /dev/null @@ -1 +0,0 @@ -581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden deleted file mode 100644 index b66a171ce..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden b/plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden deleted file mode 100644 index d6b3b2803..000000000 --- a/plutarch-test/goldens/scripts.auth_stake_validator.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.hash.golden b/plutarch-test/goldens/scripts.auth_validator.hash.golden deleted file mode 100644 index e2c047a34..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.hash.golden +++ /dev/null @@ -1 +0,0 @@ -581cb8c68ee0b38d3c830ae47aec8154b1c35eeabaceaf2c00bea1f33865 \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden b/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden deleted file mode 100644 index 8b9af4f50..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #11661a8aca9b09bb93eefda295b5da2be3f944d1f4253ab29da17db580f50d02d26218e33fbba5e0cc1b0c0cadfb67a5f9a90157dcc19eecd7c9373b0415c888 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.auth_validator.uplc.golden b/plutarch-test/goldens/scripts.auth_validator.uplc.golden deleted file mode 100644 index 8b9af4f50..000000000 --- a/plutarch-test/goldens/scripts.auth_validator.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #11661a8aca9b09bb93eefda295b5da2be3f944d1f4253ab29da17db580f50d02d26218e33fbba5e0cc1b0c0cadfb67a5f9a90157dcc19eecd7c9373b0415c888 (unBData i3) (unBData i2)) (delay ()) (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.bench.golden b/plutarch-test/goldens/scripts.bench.golden new file mode 100644 index 000000000..f3e924bf2 --- /dev/null +++ b/plutarch-test/goldens/scripts.bench.golden @@ -0,0 +1,6 @@ +auth_validator.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":155} +auth_validator.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} +auth_policy.0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} +auth_policy.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} +auth_stake_validator.0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} +auth_stake_validator.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.uplc.eval.golden b/plutarch-test/goldens/scripts.uplc.eval.golden new file mode 100644 index 000000000..c3daaad0a --- /dev/null +++ b/plutarch-test/goldens/scripts.uplc.eval.golden @@ -0,0 +1,6 @@ +auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) +auth_validator.hash (program 1.0.0 "581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047") +auth_policy.0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) +auth_policy.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") +auth_stake_validator.0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) +auth_stake_validator.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.uplc.golden b/plutarch-test/goldens/scripts.uplc.golden new file mode 100644 index 000000000..b08743053 --- /dev/null +++ b/plutarch-test/goldens/scripts.uplc.golden @@ -0,0 +1,6 @@ +auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) +auth_validator.hash (program 1.0.0 "581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047") +auth_policy.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +auth_policy.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") +auth_stake_validator.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +auth_stake_validator.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") \ No newline at end of file diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden new file mode 100644 index 000000000..e583af80d --- /dev/null +++ b/plutarch-test/goldens/show.bench.golden @@ -0,0 +1,36 @@ +unit {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} +bool.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":33} +bool.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":33} +int.0 {"exBudgetCPU":6284427,"exBudgetMemory":14017,"scriptSizeBytes":317} +int.5 {"exBudgetCPU":8760152,"exBudgetMemory":20027,"scriptSizeBytes":317} +int.-5 {"exBudgetCPU":9393754,"exBudgetMemory":20832,"scriptSizeBytes":317} +int.10 {"exBudgetCPU":12293936,"exBudgetMemory":26039,"scriptSizeBytes":317} +int.-10 {"exBudgetCPU":12927538,"exBudgetMemory":26844,"scriptSizeBytes":317} +int.14 {"exBudgetCPU":14274516,"exBudgetMemory":30847,"scriptSizeBytes":317} +int.-14 {"exBudgetCPU":14908118,"exBudgetMemory":31652,"scriptSizeBytes":317} +int.102 {"exBudgetCPU":18800590,"exBudgetMemory":39265,"scriptSizeBytes":318} +int.-102 {"exBudgetCPU":19434192,"exBudgetMemory":40070,"scriptSizeBytes":318} +bytestring.empty {"exBudgetCPU":3357723,"exBudgetMemory":9908,"scriptSizeBytes":414} +bytestring.1 {"exBudgetCPU":11420863,"exBudgetMemory":27240,"scriptSizeBytes":416} +bytestring.2 {"exBudgetCPU":29388903,"exBudgetMemory":68614,"scriptSizeBytes":417} +bytestring.3 {"exBudgetCPU":36465753,"exBudgetMemory":83546,"scriptSizeBytes":418} +bytestring.n {"exBudgetCPU":64689018,"exBudgetMemory":152060,"scriptSizeBytes":418} +bytestring.0 {"exBudgetCPU":20125968,"exBudgetMemory":43880,"scriptSizeBytes":418} +str.empty {"exBudgetCPU":2529484,"exBudgetMemory":5617,"scriptSizeBytes":128} +str.hello123 {"exBudgetCPU":28810676,"exBudgetMemory":65009,"scriptSizeBytes":137} +str.quoted {"exBudgetCPU":32374917,"exBudgetMemory":72847,"scriptSizeBytes":138} +str.slash {"exBudgetCPU":25525527,"exBudgetMemory":57585,"scriptSizeBytes":136} +str.unicode {"exBudgetCPU":35389974,"exBudgetMemory":79858,"scriptSizeBytes":139} +str.unicode-quoted {"exBudgetCPU":42518456,"exBudgetMemory":95520,"scriptSizeBytes":141} +maybe.nothing {"exBudgetCPU":1458977,"exBudgetMemory":5000,"scriptSizeBytes":354} +maybe.just {"exBudgetCPU":15676121,"exBudgetMemory":34060,"scriptSizeBytes":356} +either.right {"exBudgetCPU":15766440,"exBudgetMemory":34361,"scriptSizeBytes":370} +maybe.either {"exBudgetCPU":17334403,"exBudgetMemory":37506,"scriptSizeBytes":431} +list.nil {"exBudgetCPU":3787676,"exBudgetMemory":11335,"scriptSizeBytes":410} +list.1 {"exBudgetCPU":10989375,"exBudgetMemory":26452,"scriptSizeBytes":411} +list.1,2,3 {"exBudgetCPU":29411680,"exBudgetMemory":66720,"scriptSizeBytes":413} +builtinlist.nil {"exBudgetCPU":3519719,"exBudgetMemory":10435,"scriptSizeBytes":401} +builtinlist.1,2,3 {"exBudgetCPU":26855742,"exBudgetMemory":56248,"scriptSizeBytes":404} +pair.int-str {"exBudgetCPU":35143888,"exBudgetMemory":77331,"scriptSizeBytes":464} +pair.int-list {"exBudgetCPU":41712616,"exBudgetMemory":86350,"scriptSizeBytes":443} +rational.1/2 {"exBudgetCPU":23497485,"exBudgetMemory":51676,"scriptSizeBytes":546} \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden new file mode 100644 index 000000000..fe0f3a9aa --- /dev/null +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -0,0 +1,36 @@ +unit (program 1.0.0 "()") +bool.true (program 1.0.0 "PTrue") +bool.false (program 1.0.0 "PFalse") +int.0 (program 1.0.0 "0") +int.5 (program 1.0.0 "5") +int.-5 (program 1.0.0 "-5") +int.10 (program 1.0.0 "10") +int.-10 (program 1.0.0 "-10") +int.14 (program 1.0.0 "14") +int.-14 (program 1.0.0 "-14") +int.102 (program 1.0.0 "102") +int.-102 (program 1.0.0 "-102") +bytestring.empty (program 1.0.0 "0x") +bytestring.1 (program 1.0.0 "0x14") +bytestring.2 (program 1.0.0 "0x14af") +bytestring.3 (program 1.0.0 "0x14af03") +bytestring.n (program 1.0.0 "0xffffff") +bytestring.0 (program 1.0.0 "0x000000") +str.empty (program 1.0.0 "\"\"") +str.hello123 (program 1.0.0 "\"hello123\"") +str.quoted (program 1.0.0 "\"hello\\\"123\"") +str.slash (program 1.0.0 "\"foo\\bar\"") +str.unicode (program 1.0.0 "\"vis-\224-vis\"") +str.unicode-quoted (program 1.0.0 "\"vis-\\\"\224\\\"-vis\"") +maybe.nothing (program 1.0.0 "PNothing") +maybe.just (program 1.0.0 "PJust 42") +either.right (program 1.0.0 "PRight 42") +maybe.either (program 1.0.0 "PJust (PLeft 42)") +list.nil (program 1.0.0 "[]") +list.1 (program 1.0.0 "[1]") +list.1,2,3 (program 1.0.0 "[1, 2, 3]") +builtinlist.nil (program 1.0.0 "[]") +builtinlist.1,2,3 (program 1.0.0 "[1, 2, 3]") +pair.int-str (program 1.0.0 "PPair 42 \"hello\"") +pair.int-list (program 1.0.0 "PPair 42 [1, 2, 3]") +rational.1/2 (program 1.0.0 "1/2") \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden new file mode 100644 index 000000000..ba0751890 --- /dev/null +++ b/plutarch-test/goldens/show.uplc.golden @@ -0,0 +1,36 @@ +unit (program 1.0.0 "()") +bool.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay "PTrue") (delay "PFalse"))) True)) +bool.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay "PTrue") (delay "PFalse"))) False)) +int.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 0) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.-5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 10) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.-10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -10) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 14) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.-14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -14) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.-102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +bytestring.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #14) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #14af) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #14af03) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.n (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #ffffff) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +bytestring.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #000000) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) +str.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "") (force ifThenElse)) "\"")) +str.hello123 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "hello123") (force ifThenElse)) "\"")) +str.quoted (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "hello\"123") (force ifThenElse)) "\"")) +str.slash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "foo\\bar") (force ifThenElse)) "\"")) +str.unicode (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "vis-\224-vis") (force ifThenElse)) "\"")) +str.unicode-quoted (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "vis-\"\224\"-vis") (force ifThenElse)) "\"")) +maybe.nothing (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> force i1)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +maybe.just (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> i2 42)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +maybe.either (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString i16 (i1 (\i0 -> appendString i16 (appendString (appendString "PLeft" (appendString i17 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) i18)) (\i0 -> appendString i16 (appendString (appendString "PRight" (appendString i17 "()")) i18))))) (delay "PNothing")) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i2 42))) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "(") " ") ")")) +list.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +list.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) []) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) +builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) +pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i15 (appendString (i16 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i20 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i19 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i2) (appendString i15 (appendString i18 (appendString (decodeUtf8 (i16 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i21 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i18))))))) (\i0 -> i1 42 "hello")) (\i0 -> force (i14 (equalsInteger i1 0) (delay i2) (delay (force (i14 (equalsInteger i1 1) (delay i3) (delay (force (i14 (equalsInteger i1 2) (delay i4) (delay (force (i14 (equalsInteger i1 3) (delay i5) (delay (force (i14 (equalsInteger i1 4) (delay i6) (delay (force (i14 (equalsInteger i1 5) (delay i7) (delay (force (i14 (equalsInteger i1 6) (delay i8) (delay (force (i14 (equalsInteger i1 7) (delay i9) (delay (force (i14 (equalsInteger i1 8) (delay i10) (delay (force (i14 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") " ") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse)) "\"")) +pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i25 i2))) (delay (appendString (i9 (i25 i2)) (appendString ", " (i3 (i26 i2))))))) (i25 i1))))) i1) "]"))))))) (\i0 -> i1 42 [1,2,3])) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/str.bench.golden b/plutarch-test/goldens/str.bench.golden new file mode 100644 index 000000000..87291e28b --- /dev/null +++ b/plutarch-test/goldens/str.bench.golden @@ -0,0 +1,5 @@ +eq {"exBudgetCPU":391284,"exBudgetMemory":901,"scriptSizeBytes":18} +semigroup.laws.id.1 {"exBudgetCPU":663376,"exBudgetMemory":1304,"scriptSizeBytes":24} +semigroup.laws.id.2 {"exBudgetCPU":663376,"exBudgetMemory":1304,"scriptSizeBytes":23} +semigroup.concat {"exBudgetCPU":580057,"exBudgetMemory":1007,"scriptSizeBytes":35} +semigroup.mempty {"exBudgetCPU":388284,"exBudgetMemory":901,"scriptSizeBytes":14} \ No newline at end of file diff --git a/plutarch-test/goldens/str.eq.bench.golden b/plutarch-test/goldens/str.eq.bench.golden deleted file mode 100644 index f101e03db..000000000 --- a/plutarch-test/goldens/str.eq.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":389284,"exBudgetMemory":901,"scriptSizeBytes":18} \ No newline at end of file diff --git a/plutarch-test/goldens/str.eq.uplc.eval.golden b/plutarch-test/goldens/str.eq.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/str.eq.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/str.eq.uplc.golden b/plutarch-test/goldens/str.eq.uplc.golden deleted file mode 100644 index 63513b313..000000000 --- a/plutarch-test/goldens/str.eq.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ((\i0 -> equalsString i1 i1) "foo")) \ No newline at end of file diff --git a/plutarch-test/goldens/str.semigroup.bench.golden b/plutarch-test/goldens/str.semigroup.bench.golden deleted file mode 100644 index c7b8dada0..000000000 --- a/plutarch-test/goldens/str.semigroup.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":300965,"exBudgetMemory":602,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/str.semigroup.uplc.eval.golden b/plutarch-test/goldens/str.semigroup.uplc.eval.golden deleted file mode 100644 index f164f6bbc..000000000 --- a/plutarch-test/goldens/str.semigroup.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 "foobar") \ No newline at end of file diff --git a/plutarch-test/goldens/str.semigroup.uplc.golden b/plutarch-test/goldens/str.semigroup.uplc.golden deleted file mode 100644 index 2f346f9ce..000000000 --- a/plutarch-test/goldens/str.semigroup.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (appendString "foo" "bar")) \ No newline at end of file diff --git a/plutarch-test/goldens/str.uplc.eval.golden b/plutarch-test/goldens/str.uplc.eval.golden new file mode 100644 index 000000000..ca90e11c5 --- /dev/null +++ b/plutarch-test/goldens/str.uplc.eval.golden @@ -0,0 +1,5 @@ +eq (program 1.0.0 True) +semigroup.laws.id.1 (program 1.0.0 True) +semigroup.laws.id.2 (program 1.0.0 True) +semigroup.concat (program 1.0.0 True) +semigroup.mempty (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/str.uplc.golden b/plutarch-test/goldens/str.uplc.golden new file mode 100644 index 000000000..6ec6d23da --- /dev/null +++ b/plutarch-test/goldens/str.uplc.golden @@ -0,0 +1,5 @@ +eq (program 1.0.0 ((\i0 -> equalsString i1 i1) "foo")) +semigroup.laws.id.1 (program 1.0.0 ((\i0 -> equalsString (appendString "" i1) i1) "foo")) +semigroup.laws.id.2 (program 1.0.0 ((\i0 -> equalsString i1 (appendString "" i1)) "foo")) +semigroup.concat (program 1.0.0 (equalsString (appendString "foo" "bar") "foobar")) +semigroup.mempty (program 1.0.0 ((\i0 -> equalsString i1 i1) "")) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.bench.golden b/plutarch-test/goldens/trace.dev=false.bench.golden new file mode 100644 index 000000000..e2a1b0baf --- /dev/null +++ b/plutarch-test/goldens/trace.dev=false.bench.golden @@ -0,0 +1,10 @@ +ptrace.one {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptrace.two {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceShowId.right-42 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +ptraceIfTrue.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfTrue.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfFalse.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfFalse.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +chained.false.true.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +chained.ptrace.true.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +chained.ptrace.true.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptrace.bench.golden b/plutarch-test/goldens/trace.dev=false.ptrace.bench.golden deleted file mode 100644 index a2816cf9f..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptrace.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -one {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -two {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptrace.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.ptrace.uplc.eval.golden deleted file mode 100644 index afed943f4..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptrace.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -one (program 1.0.0 ()) -two (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptrace.uplc.golden b/plutarch-test/goldens/trace.dev=false.ptrace.uplc.golden deleted file mode 100644 index afed943f4..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptrace.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -one (program 1.0.0 ()) -two (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.bench.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.bench.golden deleted file mode 100644 index a956630ef..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.eval.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfFalse.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.bench.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.bench.golden deleted file mode 100644 index a956630ef..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.eval.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.golden b/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=false.ptraceIfTrue.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.uplc.eval.golden new file mode 100644 index 000000000..51bcda305 --- /dev/null +++ b/plutarch-test/goldens/trace.dev=false.uplc.eval.golden @@ -0,0 +1,10 @@ +ptrace.one (program 1.0.0 ()) +ptrace.two (program 1.0.0 ()) +ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) +ptraceIfTrue.true (program 1.0.0 True) +ptraceIfTrue.false (program 1.0.0 False) +ptraceIfFalse.true (program 1.0.0 True) +ptraceIfFalse.false (program 1.0.0 False) +chained.false.true.false (program 1.0.0 False) +chained.ptrace.true.false (program 1.0.0 False) +chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.uplc.golden b/plutarch-test/goldens/trace.dev=false.uplc.golden new file mode 100644 index 000000000..51bcda305 --- /dev/null +++ b/plutarch-test/goldens/trace.dev=false.uplc.golden @@ -0,0 +1,10 @@ +ptrace.one (program 1.0.0 ()) +ptrace.two (program 1.0.0 ()) +ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) +ptraceIfTrue.true (program 1.0.0 True) +ptraceIfTrue.false (program 1.0.0 False) +ptraceIfFalse.true (program 1.0.0 True) +ptraceIfFalse.false (program 1.0.0 False) +chained.false.true.false (program 1.0.0 False) +chained.ptrace.true.false (program 1.0.0 False) +chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.bench.golden b/plutarch-test/goldens/trace.dev=true.bench.golden new file mode 100644 index 000000000..98057425d --- /dev/null +++ b/plutarch-test/goldens/trace.dev=true.bench.golden @@ -0,0 +1,10 @@ +ptrace.one {"exBudgetCPU":388284,"exBudgetMemory":932,"scriptSizeBytes":16} +ptrace.two {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":30} +ptraceShowId.right-42 {"exBudgetCPU":16124851,"exBudgetMemory":35093,"scriptSizeBytes":379} +ptraceIfTrue.true {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} +ptraceIfTrue.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} +ptraceIfFalse.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} +ptraceIfFalse.false {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} +chained.false.true.false {"exBudgetCPU":1192157,"exBudgetMemory":3634,"scriptSizeBytes":51} +chained.ptrace.true.false {"exBudgetCPU":834880,"exBudgetMemory":2433,"scriptSizeBytes":40} +chained.ptrace.true.true {"exBudgetCPU":1103972,"exBudgetMemory":2865,"scriptSizeBytes":40} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptrace.bench.golden b/plutarch-test/goldens/trace.dev=true.ptrace.bench.golden deleted file mode 100644 index 1170ab911..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptrace.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -one {"exBudgetCPU":388284,"exBudgetMemory":932,"scriptSizeBytes":16} -two {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":30} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptrace.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.ptrace.uplc.eval.golden deleted file mode 100644 index afed943f4..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptrace.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -one (program 1.0.0 ()) -two (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptrace.uplc.golden b/plutarch-test/goldens/trace.dev=true.ptrace.uplc.golden deleted file mode 100644 index 1fee9ffaf..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptrace.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -one (program 1.0.0 (force (force trace "foo" (delay ())))) -two (program 1.0.0 ((\i0 -> force (i1 "foo" (delay (force (i1 "bar" (delay ())))))) (force trace))) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.bench.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.bench.golden deleted file mode 100644 index 6591c746e..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} -false {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.eval.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.golden deleted file mode 100644 index f3c9dcec6..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfFalse.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) True)) -false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) False)) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.bench.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.bench.golden deleted file mode 100644 index 67ae0223c..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -true {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} -false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.eval.golden deleted file mode 100644 index 5ac22f250..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 True) -false (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.golden b/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.golden deleted file mode 100644 index f6214aa00..000000000 --- a/plutarch-test/goldens/trace.dev=true.ptraceIfTrue.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) True)) -false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) False)) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.uplc.eval.golden new file mode 100644 index 000000000..51bcda305 --- /dev/null +++ b/plutarch-test/goldens/trace.dev=true.uplc.eval.golden @@ -0,0 +1,10 @@ +ptrace.one (program 1.0.0 ()) +ptrace.two (program 1.0.0 ()) +ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) +ptraceIfTrue.true (program 1.0.0 True) +ptraceIfTrue.false (program 1.0.0 False) +ptraceIfFalse.true (program 1.0.0 True) +ptraceIfFalse.false (program 1.0.0 False) +chained.false.true.false (program 1.0.0 False) +chained.ptrace.true.false (program 1.0.0 False) +chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.uplc.golden b/plutarch-test/goldens/trace.dev=true.uplc.golden new file mode 100644 index 000000000..5a77c4925 --- /dev/null +++ b/plutarch-test/goldens/trace.dev=true.uplc.golden @@ -0,0 +1,10 @@ +ptrace.one (program 1.0.0 (force (force trace "foo" (delay ())))) +ptrace.two (program 1.0.0 ((\i0 -> force (i1 "foo" (delay (force (i1 "bar" (delay ())))))) (force trace))) +ptraceShowId.right-42 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force trace ((\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) (delay (\i0 -> \i0 -> i1 42)))) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +ptraceIfTrue.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) True)) +ptraceIfTrue.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) False)) +ptraceIfFalse.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) True)) +ptraceIfFalse.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) False)) +chained.false.true.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i2 i1 (delay i1) (delay (i3 "foo" i1)))) ((\i0 -> force (i2 i1 (delay (i3 "bar" i1)) (delay i1))) False)) (force ifThenElse)) (force trace))) +chained.ptrace.true.false (program 1.0.0 ((\i0 -> force (i1 "foo" (delay ((\i0 -> force (force ifThenElse i1 (delay (i2 "bar" i1)) (delay i1))) False)))) (force trace))) +chained.ptrace.true.true (program 1.0.0 ((\i0 -> force (i1 "foo" (delay ((\i0 -> force (force ifThenElse i1 (delay (i2 "bar" i1)) (delay i1))) True)))) (force trace))) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.bench.golden b/plutarch-test/goldens/unit.bench.golden new file mode 100644 index 000000000..ed147f57e --- /dev/null +++ b/plutarch-test/goldens/unit.bench.golden @@ -0,0 +1,5 @@ +pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +pmatch {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +compare.== {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +compare.< {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} +compare.<= {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.compare.bench.golden b/plutarch-test/goldens/unit.compare.bench.golden deleted file mode 100644 index 9b5ece174..000000000 --- a/plutarch-test/goldens/unit.compare.bench.golden +++ /dev/null @@ -1,3 +0,0 @@ -== {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -< {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -<= {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.compare.uplc.eval.golden b/plutarch-test/goldens/unit.compare.uplc.eval.golden deleted file mode 100644 index 8e479b21c..000000000 --- a/plutarch-test/goldens/unit.compare.uplc.eval.golden +++ /dev/null @@ -1,3 +0,0 @@ -== (program 1.0.0 True) -< (program 1.0.0 False) -<= (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.compare.uplc.golden b/plutarch-test/goldens/unit.compare.uplc.golden deleted file mode 100644 index 8e479b21c..000000000 --- a/plutarch-test/goldens/unit.compare.uplc.golden +++ /dev/null @@ -1,3 +0,0 @@ -== (program 1.0.0 True) -< (program 1.0.0 False) -<= (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pcon.bench.golden b/plutarch-test/goldens/unit.pcon.bench.golden deleted file mode 100644 index c735abb6b..000000000 --- a/plutarch-test/goldens/unit.pcon.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pcon.uplc.eval.golden b/plutarch-test/goldens/unit.pcon.uplc.eval.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/unit.pcon.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pcon.uplc.golden b/plutarch-test/goldens/unit.pcon.uplc.golden deleted file mode 100644 index 582b47c79..000000000 --- a/plutarch-test/goldens/unit.pcon.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 ()) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pmatch.bench.golden b/plutarch-test/goldens/unit.pmatch.bench.golden deleted file mode 100644 index c735abb6b..000000000 --- a/plutarch-test/goldens/unit.pmatch.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pmatch.uplc.eval.golden b/plutarch-test/goldens/unit.pmatch.uplc.eval.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/unit.pmatch.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.pmatch.uplc.golden b/plutarch-test/goldens/unit.pmatch.uplc.golden deleted file mode 100644 index 6f6141e6e..000000000 --- a/plutarch-test/goldens/unit.pmatch.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.uplc.eval.golden b/plutarch-test/goldens/unit.uplc.eval.golden new file mode 100644 index 000000000..25660b104 --- /dev/null +++ b/plutarch-test/goldens/unit.uplc.eval.golden @@ -0,0 +1,5 @@ +pcon (program 1.0.0 ()) +pmatch (program 1.0.0 True) +compare.== (program 1.0.0 True) +compare.< (program 1.0.0 False) +compare.<= (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/unit.uplc.golden b/plutarch-test/goldens/unit.uplc.golden new file mode 100644 index 000000000..25660b104 --- /dev/null +++ b/plutarch-test/goldens/unit.uplc.golden @@ -0,0 +1,5 @@ +pcon (program 1.0.0 ()) +pmatch (program 1.0.0 True) +compare.== (program 1.0.0 True) +compare.< (program 1.0.0 False) +compare.<= (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-behaviour.bench.golden b/plutarch-test/goldens/uplc-behaviour.bench.golden new file mode 100644 index 000000000..87aaea128 --- /dev/null +++ b/plutarch-test/goldens/uplc-behaviour.bench.golden @@ -0,0 +1,4 @@ +2:[1] {"exBudgetCPU":328738,"exBudgetMemory":732,"scriptSizeBytes":13} +fails:True:[1] {"exBudgetCPU":150100,"exBudgetMemory":132,"scriptSizeBytes":13} +(2,1) {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +fails:MkPair-1-2 {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":11} \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-behaviour.uplc.eval.golden b/plutarch-test/goldens/uplc-behaviour.uplc.eval.golden new file mode 100644 index 000000000..246399d89 --- /dev/null +++ b/plutarch-test/goldens/uplc-behaviour.uplc.eval.golden @@ -0,0 +1,4 @@ +2:[1] (program 1.0.0 [2,1]) +fails:True:[1] (program 1.0.0 error) +(2,1) (program 1.0.0 (1, 2)) +fails:MkPair-1-2 (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-behaviour.uplc.golden b/plutarch-test/goldens/uplc-behaviour.uplc.golden new file mode 100644 index 000000000..b10d2a70b --- /dev/null +++ b/plutarch-test/goldens/uplc-behaviour.uplc.golden @@ -0,0 +1,4 @@ +2:[1] (program 1.0.0 (force mkCons 2 [1])) +fails:True:[1] (program 1.0.0 (force mkCons True [1])) +(2,1) (program 1.0.0 (1, 2)) +fails:MkPair-1-2 (program 1.0.0 (mkPairData 1 2)) \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-misc.bench.golden b/plutarch-test/goldens/uplc-misc.bench.golden new file mode 100644 index 000000000..e6bd51f17 --- /dev/null +++ b/plutarch-test/goldens/uplc-misc.bench.golden @@ -0,0 +1,6 @@ +perror {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +perror.arg {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} +laziness.f.d {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +laziness.d.f.d {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} +hoist.id.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":9} +hoist.fstPair {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-misc.uplc.eval.golden b/plutarch-test/goldens/uplc-misc.uplc.eval.golden new file mode 100644 index 000000000..016f4bba5 --- /dev/null +++ b/plutarch-test/goldens/uplc-misc.uplc.eval.golden @@ -0,0 +1,6 @@ +perror (program 1.0.0 error) +perror.arg (program 1.0.0 error) +laziness.f.d (program 1.0.0 0) +laziness.d.f.d (program 1.0.0 (delay 0)) +hoist.id.0 (program 1.0.0 (\i0 -> i1 0)) +hoist.fstPair (program 1.0.0 fstPair) \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-misc.uplc.golden b/plutarch-test/goldens/uplc-misc.uplc.golden new file mode 100644 index 000000000..016f4bba5 --- /dev/null +++ b/plutarch-test/goldens/uplc-misc.uplc.golden @@ -0,0 +1,6 @@ +perror (program 1.0.0 error) +perror.arg (program 1.0.0 error) +laziness.f.d (program 1.0.0 0) +laziness.d.f.d (program 1.0.0 (delay 0)) +hoist.id.0 (program 1.0.0 (\i0 -> i1 0)) +hoist.fstPair (program 1.0.0 fstPair) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/BaseSpec.hs b/plutarch-test/plutarch-base/BaseSpec.hs new file mode 100644 index 000000000..108855af1 --- /dev/null +++ b/plutarch-test/plutarch-base/BaseSpec.hs @@ -0,0 +1,2 @@ +{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=BaseSpec #-} +{-# OPTIONS_GHC -Wno-missing-export-lists #-} diff --git a/plutarch-test/src/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs similarity index 74% rename from plutarch-test/src/Plutarch/ApiSpec.hs rename to plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 1c0b6145d..a4cb802eb 100644 --- a/plutarch-test/src/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -1,4 +1,4 @@ -module Plutarch.ApiSpec (spec, ctx) where +module Plutarch.ApiSpec (spec, ctx, info, purpose, validator, datum) where import Test.Tasty.HUnit @@ -12,7 +12,7 @@ import Plutarch.Api.V1 ( PCurrencySymbol, PPubKeyHash, PScriptContext, - PScriptPurpose (PSpending), + PScriptPurpose (PMinting, PSpending), PTxInInfo, PTxInfo, PValue, @@ -20,49 +20,46 @@ import Plutarch.Api.V1 ( import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude import Plutarch.Test +import Test.Hspec + +-- import PlutusTx.AssocMap as PlutusMap spec :: Spec spec = do describe "api" $ do describe "ctx" $ do - golden PrintTerm ctx - describe "get" $ do - describe "txInfo" $ do - let p = pfromData $ getTxInfo # ctx - golden All p - it "works" $ plift p @?= info - describe "mint" $ do - let p = pforgetData $ getMint #$ getTxInfo # ctx - golden All p - it "works" $ plift p @?= toData mint - describe "credentials" $ do - let p = getCredentials ctx - golden All p - it "works" $ plift p @?= [toData validator] - describe "sym" $ do - let p = pfromData $ getSym #$ pfromData $ getMint #$ getTxInfo # ctx - golden All p - it "works" $ plift p @?= sym + pgoldenSpec $ do + "term" @| ctx + "get" @\ do + "txInfo" @| pfromData (getTxInfo # ctx) @-> \p -> + plift p @?= info + "mint" @| pforgetData (getMint #$ getTxInfo # ctx) @-> \p -> + plift p @?= toData mint + "credentials" @| getCredentials ctx @-> \p -> + plift p @?= [toData validator] + "sym" @| pfromData (getSym #$ pfromData $ getMint #$ getTxInfo # ctx) @-> \p -> + plift p @?= sym + "ScriptPurpose" @\ do + "literal" @| pconstant @PScriptPurpose (Minting dummyCurrency) + "decode" + @| pmatch (pconstant @PScriptPurpose (Minting dummyCurrency)) + $ \case + PMinting c -> popaque c + _ -> perror describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. -- See Plutarch.MonadicSpec for GHC9 only syntax. - describe "signatory" . plutarchDevFlagDescribe $ do + describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" - describe "cont" $ do - let p = checkSignatoryCont # pconstant aSig # ctx - pe = checkSignatoryCont # pconstant "41" # ctx - golden All p - it "succeeds" $ psucceeds p - it "fails" $ pfails pe - describe "termcont" $ do - let p = checkSignatoryTermCont # pconstant aSig # ctx - pe = checkSignatoryTermCont # pconstant "41" # ctx - golden All p - it "succeeds" $ psucceeds p - it "fails" $ pfails pe - describe "getFields" $ - golden All getFields + "cont" @\ do + "succeeds" @| checkSignatoryCont # pconstant aSig # ctx @-> psucceeds + "fails" @| checkSignatoryCont # pconstant "41" # ctx @-> pfails + "termcont" @\ do + "succeeds" @| checkSignatoryTermCont # pconstant aSig # ctx @-> psucceeds + "fails" @| checkSignatoryTermCont # pconstant "41" # ctx @-> pfails + describe "getFields" . pgoldenSpec $ do + "0" @| getFields -------------------------------------------------------------------------------- @@ -202,3 +199,6 @@ checkSignatoryTermCont = plam $ \ph ctx' -> unTermCont $ do getFields :: Term s (PData :--> PBuiltinList PData) getFields = phoistAcyclic $ plam $ \addr -> psndBuiltin #$ pasConstr # addr + +dummyCurrency :: CurrencySymbol +dummyCurrency = Value.currencySymbol "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" diff --git a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs new file mode 100644 index 000000000..331a3ae0f --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs @@ -0,0 +1,42 @@ +module Plutarch.BoolSpec (spec) where + +import Plutarch.Bool (pand, por) +import Plutarch.Prelude +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "bool" . pgoldenSpec $ do + "pnot" @\ do + "lam" @| pnot + "app" @| pnot # (pcon PTrue) @-> passertNot + "pand" @\ do + "tf" @| pcon PTrue #&& pcon PFalse @-> passertNot + "ft" @| pcon PFalse #&& pcon PTrue @-> passertNot + "tt" @| pcon PTrue #&& pcon PTrue @-> passert + "ff" @| pcon PFalse #&& pcon PFalse @-> passertNot + "laziness" @\ do + "pand" @| pand # pcon PFalse # pdelay perror @-> \p -> + passert $ pnot # pforce p + "op" @| pcon PFalse #&& perror @-> \p -> + passert $ pnot # p + "pand.perror" @\ do + "false" @| pand # pcon PFalse # perror @-> pfails + "true" @| pand # pcon PTrue # perror @-> pfails + "op" @| pcon PTrue #&& perror @-> pfails + "por" @\ do + "tf" @| pcon PTrue #|| pcon PFalse @-> passert + "ft" @| pcon PFalse #|| pcon PTrue @-> passert + "tt" @| pcon PTrue #|| pcon PTrue @-> passert + "ff" @| pcon PFalse #|| pcon PFalse @-> passertNot + "laziness" @\ do + "por" @| por # pcon PTrue # pdelay perror @-> \p -> + passert (pforce p) + "op" @| pcon PTrue #|| perror @-> \p -> + passert p + "pand.perror" @\ do + "false" @| por # pcon PFalse # perror @-> pfails + "true" @| por # pcon PTrue # perror @-> pfails + "op.true" @| pcon PTrue #|| perror @-> psucceeds + "op.false" @| pcon PFalse #|| perror @-> pfails diff --git a/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs new file mode 100644 index 000000000..681ac9ce2 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/ByteStringSpec.hs @@ -0,0 +1,42 @@ +module Plutarch.ByteStringSpec (spec) where + +import qualified Data.ByteString as BS +import Plutarch.Prelude +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "bytestring" . pgoldenSpec $ do + "empty" @| mempty #== phexByteStr "" @-> passert + "phexByteStr" + @| ( let a :: [String] = ["42", "ab", "df", "c9"] + in pconstant @PByteString (BS.pack $ map readByte a) #== phexByteStr (concat a) + ) + @-> passert + "plengthByteStr" @| (plengthBS # phexByteStr "012f") #== 2 @-> passert + "pconsBS" + @| ( let xs = phexByteStr "48fCd1" + in (plengthBS #$ pconsBS # 91 # xs) #== (1 + plengthBS # xs) + ) + @-> passert + "pindexByteStr" @| (pindexBS # phexByteStr "4102af" # 1) + @== pconstant @PInteger 0x02 + "psliceByteStr" @| (psliceBS # 2 # 3 # phexByteStr "4102afde5b2a") + @== phexByteStr "afde5b" + "eq" @| phexByteStr "12" #== phexByteStr "12" @-> passert + let s1 = phexByteStr "12" + s2 = phexByteStr "34" + "semigroup" @\ do + "concats" @| s1 <> s2 @== (phexByteStr "1234") + "laws" @\ do + "id.1" @| (mempty <> s1) #== s1 @-> passert + "id.2" @| s1 #== (mempty <> s1) @-> passert + +{- | Interpret a byte. + +>>> readByte "41" +65 +-} +readByte :: Num a => String -> a +readByte a = fromInteger $ read $ "0x" <> a diff --git a/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs new file mode 100644 index 000000000..391b30940 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/EitherSpec.hs @@ -0,0 +1,17 @@ +module Plutarch.EitherSpec (spec) where + +import Plutarch.Prelude +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "either" . pgoldenSpec $ do + "eq" @\ do + "true" @\ do + "left" @| pcon @(PEither PInteger PInteger) (PLeft 42) #== pcon (PLeft 42) @-> passert + "right" @| pcon @(PEither PInteger PInteger) (PRight 42) #== pcon (PRight 42) @-> passert + "false" @\ do + "left-right" @| pcon @(PEither PInteger PInteger) (PLeft 42) #== pcon (PRight 42) @-> passertNot + "left-left" @| pcon @(PEither PInteger PInteger) (PLeft 24) #== pcon (PLeft 42) @-> passertNot + "right-right" @| pcon @(PEither PInteger PInteger) (PRight 24) #== pcon (PRight 42) @-> passertNot diff --git a/plutarch-test/src/Plutarch/IntegerSpec.hs b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs similarity index 64% rename from plutarch-test/src/Plutarch/IntegerSpec.hs rename to plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs index 801ce9c83..1c15b3ef2 100644 --- a/plutarch-test/src/Plutarch/IntegerSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs @@ -3,21 +3,25 @@ module Plutarch.IntegerSpec (spec) where import Plutarch import Plutarch.Prelude import Plutarch.Test +import Test.Hspec spec :: Spec spec = do describe "int" $ do describe "examples" $ do - goldens - All - [ ("add1", popaque add1) - , ("add1Hoisted", popaque add1Hoisted) - , ("example1", popaque example1) - , ("example2", popaque example2) - , ("fib", popaque fib) - , ("fib.app.9", popaque $ fib # 9) - , ("uglyDouble", popaque uglyDouble) - ] + pgoldenSpec $ do + "add1" @| add1 + "add1Hoisted" @| add1Hoisted + "example1" @| example1 + "example2" @| example2 + "fib" @\ do + "lam" @| fib + "app" @\ do + "9" @| fib # 9 @:-> \(p, _script, bench) -> do + p `pshouldBe` (34 :: Term _ PInteger) + bench `psatisfyWithinBenchmark` Benchmark 1_000_000_000 1_000_000 100 + "error" @| fib # perror @-> pfails + "uglyDouble" @| uglyDouble add1 :: Term s (PInteger :--> PInteger :--> PInteger) add1 = plam $ \x y -> x + y + 1 diff --git a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs new file mode 100644 index 000000000..68439fbf8 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs @@ -0,0 +1,51 @@ +module Plutarch.LiftSpec (spec) where + +import Data.Text (Text) +import Plutarch.Api.V1 () +import Plutus.V1.Ledger.Api (PubKeyHash (PubKeyHash), ScriptPurpose (Minting), TxOutRef (TxOutRef)) +import qualified PlutusTx + +import Plutarch.Lift (PLifted) +import Plutarch.Prelude +import Plutarch.Test +import Test.Hspec (Expectation, Spec, describe, it, shouldBe) + +spec :: Spec +spec = do + describe "lift" $ do + describe "plift" $ do + it "bool" $ do + plift (pcon PTrue) `shouldBe` True + plift (pcon PFalse) `shouldBe` False + plift (pconstant False) `shouldBe` False + plift (pconstant True) `shouldBe` True + it "list" $ do + plift (pconstant ([1, 2, 3] :: [Integer])) `shouldBe` [1, 2, 3] + plift (pconstant ("IOHK" :: Text, 42 :: Integer)) `shouldBe` ("IOHK", 42) + it "nested" $ do + -- List of pairs + let v1 = [("IOHK", 42), ("Plutus", 31)] :: [(Text, Integer)] + plift (pconstant v1) `shouldBe` v1 + -- List of pair of lists + let v2 = [("IOHK", [1, 2, 3]), ("Plutus", [9, 8, 7])] :: [(Text, [Integer])] + plift (pconstant v2) `shouldBe` v2 + it "data" $ do + let d :: PlutusTx.Data + d = PlutusTx.toData @(Either Bool Bool) $ Right False + plift (pconstant d) `shouldBe` d + describe "pconstant" $ do + it "string" $ do + pconstant @PString "abc" `pshouldBe` pconstant @PString "abc" + pconstant @PString "foo" `pshouldBe` ("foo" :: Term _ PString) + describe "pconstantData" $ do + pgoldenSpec $ do + "bool" @| pconstantData False + "int" @| pconstantData (42 :: Integer) + "pkh" @| pconstantData (PubKeyHash "04") + "minting" @| pconstantData (Minting "") + "txoutref" @| pconstantData (TxOutRef "41" 12) + it "works" $ testPConstantDataSan False + +testPConstantDataSan :: forall p. (PIsData p, PLift p, PlutusTx.ToData (PLifted p)) => PLifted p -> Expectation +testPConstantDataSan x = + pconstantData @p x `pshouldBe` pdata (pconstant @p x) diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs new file mode 100644 index 000000000..36a7ecb26 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -0,0 +1,125 @@ +module Plutarch.ListSpec (spec, integerList) where + +import Data.List (find) + +import Plutarch.List (pconvertLists, pfoldl') +import Plutarch.Prelude + +import Hedgehog (Property) +import qualified Hedgehog.Gen as Gen +import Hedgehog.Internal.Property (Property (propertyTest)) +import qualified Hedgehog.Range as Range +import Plutarch.Test +import Plutarch.Test.Property +import Plutarch.Test.Property.Gen (genInteger, genList) +import Test.Hspec (Spec, describe, it) +import Test.Hspec.Hedgehog (hedgehog) + +integerList :: [Integer] -> Term s (PList PInteger) +integerList xs = pconvertLists #$ pconstant @(PBuiltinList PInteger) xs + +spec :: Spec +spec = do + describe "list" $ do + describe "properties" $ do + describe "find" $ do + it "plutarch level find mirrors haskell level find" . hedgehog . propertyTest $ prop_pfindEquiv + describe "elemAt" $ do + it "plutarch level elemAt mirrors haskell level elemAt" . hedgehog . propertyTest $ prop_pelemAtEquiv + plutarchDevFlagDescribe . pgoldenSpec $ do + let xs10 :: Term _ (PList PInteger) + xs10 = integerList [1 .. 10] + numList :: Term _ (PBuiltinList PInteger) + numList = pconstant [1 .. 5] + "pmatch" @| pmatch (integerList [1, 3, 1]) (const perror) @-> pfails + "phead" @| 1 #== (phead # xs10) @-> passert + "ptail" @| integerList [2 .. 10] #== ptail # xs10 @-> passert + "pnull" @\ do + "empty" @| (pnull # integerList []) @-> passert + "nonempty" @| (pnot #$ pnull # xs10) @-> passert + "pconcat" @\ do + "identity" @| (pconcat # xs10 # pnil #== pconcat # pnil # xs10) #&& (pconcat # pnil # xs10 #== xs10) @-> passert + "pmap" @\ do + "eg" @| pmap # (plam $ \x -> x + x) # xs10 #== (integerList $ fmap (* 2) [1 .. 10]) @-> passert + "identity" @| pmap @PList # (plam $ \(x :: Term _ PInteger) -> x) # pnil #== pnil @-> passert + "pfilter" @\ do + "evens" @| pfilter # (plam $ \x -> pmod # x # 2 #== 0) # xs10 #== integerList [2, 4, 6, 8, 10] @-> passert + "gt5" @| pfilter # (plam $ \x -> 5 #< x) # xs10 #== integerList [6 .. 10] @-> passert + "pzipWith" @\ do + "double" @| pzipWith' (+) # xs10 # xs10 #== integerList (fmap (* 2) [1 .. 10]) @-> passert + "pfoldl" @\ do + "nonempty" @| pfoldl # plam (-) # 0 # xs10 #== pconstant (foldl (-) 0 [1 .. 10]) @-> passert + "nonempty-primed" @| pfoldl' (-) # 0 # xs10 #== pconstant (foldl (-) 0 [1 .. 10]) @-> passert + "empty" @| pfoldl # plam (-) # 0 # integerList [] #== pconstant 0 @-> passert + "empty-primed" @| pfoldl' (-) # 0 # integerList [] #== pconstant 0 @-> passert + "elemAt" @\ do + "elemAt_3_[1..10]" @| pelemAt # 3 # integerList [1 .. 10] + "elemAt_0_[1..10]" @| pelemAt # 0 # integerList [1 .. 10] + "elemAt_9_[1..10]" @| pelemAt # 9 # integerList [1 .. 10] + "find" @\ do + "find_(==3)_[1..4]" @| pfind # plam (#== 3) #$ integerList [1 .. 4] + "find_(==5)_[1..4]" @| pfind # plam (#== 5) #$ integerList [1 .. 4] + -- Two ways of matching on a list + "x1+x2" @\ do + -- Via HeadList and TailList only. + "builtin" @| (phead #$ ptail # numList) + (phead # numList) + -- Via ChooseList (twice invoked) + "pmatch" + @| pmatch numList + $ \case + PNil -> perror + PCons x xs -> + pmatch xs $ \case + PNil -> perror + PCons y _ -> + x + y + -- Various ways of uncons'ing a list + "uncons" @\ do + -- ChooseList builtin, like uncons but fails on null lists + "ChooseList" + @| pmatch numList + $ \case + PNil -> perror + PCons _x xs -> + xs + -- Retrieving head and tail of a list + "head-and-tail" + @| plet (phead # numList) + $ \_x -> + ptail # numList + -- Retrieve head and tail using builtins, but fail on null lists. + "head-and-tail-and-null" + @| plet (pnull # numList) + $ \isEmpty -> + pmatch isEmpty $ \case + PTrue -> perror + PFalse -> plet (phead # numList) $ \_x -> + ptail # numList + +-- plutarch level find mirrors haskell level find +prop_pfindEquiv :: Property +prop_pfindEquiv = + prop_haskEquiv + @( 'OnPEq) + @( 'TotalFun) + (find @[] @Integer even) + (pfind # peven) + (genList genInteger :* Nil) + where + peven :: Term s (PInteger :--> PBool) + peven = plam $ \n -> pmod # n # 2 #== 0 + +-- plutarch level elemAt mirrors haskell level elemAt +prop_pelemAtEquiv :: Property +prop_pelemAtEquiv = + prop_haskEquiv + @( 'OnBoth) + @( 'PartialFun) + elemAt + pelemAt + $ Gen.integral (Range.linear (-10) 100) + :* Gen.list (Range.linear 0 100) genInteger + :* Nil + +elemAt :: Integer -> [Integer] -> Integer +elemAt n xs = xs !! fromInteger n diff --git a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs new file mode 100644 index 000000000..150bd0a0d --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs @@ -0,0 +1,19 @@ +module Plutarch.MaybeSpec (spec) where + +import Plutarch +import Plutarch.Bool (PEq ((#==))) +import Plutarch.Integer (PInteger) +import Plutarch.Maybe (PMaybe (PJust, PNothing)) +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "maybe" . pgoldenSpec $ do + "eq" @\ do + "true" @\ do + "nothing" @| pcon @(PMaybe PInteger) PNothing #== pcon PNothing @-> passert + "just" @| pcon @(PMaybe PInteger) (PJust 42) #== pcon (PJust 42) @-> passert + "false" @\ do + "nothing-just" @| pcon @(PMaybe PInteger) PNothing #== pcon (PJust 42) @-> passertNot + "just-just" @| pcon @(PMaybe PInteger) (PJust 24) #== pcon (PJust 42) @-> passertNot diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs new file mode 100644 index 000000000..b56054dcc --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -0,0 +1,221 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.PIsDataSpec (spec) where + +import Data.Text.Encoding (encodeUtf8) + +import Data.String (fromString) +import qualified GHC.Generics as GHC +import Generics.SOP (Generic, I (I)) +import Plutus.V1.Ledger.Api ( + Address (Address), + Credential (PubKeyCredential, ScriptCredential), + CurrencySymbol, + ScriptPurpose (Minting, Rewarding, Spending), + StakingCredential (StakingHash), + TxOutRef (TxOutRef), + ) +import qualified PlutusTx + +import Test.Tasty.QuickCheck (Arbitrary, property) + +import Plutarch.Api.V1 +import Plutarch.Api.V1.Tuple (pbuiltinPairFromTuple, ptupleFromBuiltin) +import Plutarch.Builtin (pforgetData, ppairDataBuiltin) +import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) +import Plutarch.Lift (PLifted) +import Plutarch.Prelude +import Plutarch.SpecTypes (PTriplet (PTriplet)) +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "pisdata" $ do + propertySet @PBool "PBool" + propertySet @PInteger "PInteger" + propertySet @PUnit "PUnit" + describe "equality" . pgoldenSpec $ do + "PData" @\ do + "1" + @| (let dat = pconstant @PData (PlutusTx.List [PlutusTx.Constr 1 [PlutusTx.I 0]]) in dat #== dat) + @-> passert + "2" + @| (pnot #$ pconstant @PData (PlutusTx.Constr 0 []) #== pconstant @PData (PlutusTx.I 42)) + @-> passert + "PAsData" @\ do + "1" + @| let dat = pdata @PInteger 42 + in dat #== dat + @-> passert + "1" + @| (pnot #$ pdata (phexByteStr "12") #== pdata (phexByteStr "ab")) + @-> passert + describe "ppair" . pgoldenSpec $ do + -- pfromData (pdata (I 1, B 0x41)) ≡ (I 1, I A) + "simple" + @| ( ppairDataBuiltin @_ @PInteger @PByteString + # pconstantData @PInteger 1 + #$ pdata (pconstant $ encodeUtf8 "A") + ) + @-> \p -> + pfromData (pdata p) `pshouldBe` p + -- pfromdata (pdata (ptxid 0x41, pscriptcredential 0x82)) ≡ (ptxid 0x41, pscriptcredential 0x82) + let scPair = + ppairDataBuiltin + # pconstantData @PTxId "41" + #$ pconstantData (ScriptCredential "82") + "scriptcredential" @| scPair @-> \p -> + pfromData (pdata p) `pshouldBe` p + let scTuple = pdata $ ptuple # pconstantData @PTxId "41" #$ pconstantData $ ScriptCredential "82" + "isomorphism" @\ do + "pforgetData" @| pforgetData (pdata scPair) @== pforgetData scTuple + "pbuiltinPairFromTuple" @| pfromData (pbuiltinPairFromTuple scTuple) @== scPair + "ptupleFromBuiltin" @| ptupleFromBuiltin (pdata scPair) @== scTuple + -- Data construction tests + describe "constr" . pgoldenSpec $ do + -- Sum of products construction + "sop" @\ do + "4wheeler" + @| pcon + ( PFourWheeler $ + pdcons + # pconstantData 2 #$ pdcons + # pconstantData 5 #$ pdcons + # pconstantData 42 #$ pdcons + # pconstantData 0 + # pdnil + ) + @== pconstant (PlutusTx.Constr 0 [PlutusTx.I 2, PlutusTx.I 5, PlutusTx.I 42, PlutusTx.I 0]) + "2wheeler" + @| pcon (PTwoWheeler $ pdcons # pconstantData 5 #$ pdcons # pconstantData 0 # pdnil) + @== pconstant (PlutusTx.Constr 1 [PlutusTx.I 5, PlutusTx.I 0]) + "immovable" + @| pcon (PImmovableBox pdnil) + @== pconstant (PlutusTx.Constr 2 []) + -- Product construction + "prod" @\ do + "1" + @| pcon + ( PTriplet $ + pdcons + # pconstantData @PCurrencySymbol "ab" #$ pdcons + # pconstantData "41" #$ pdcons + # pconstantData "0e" + # pdnil + ) + @== pconstant + ( PlutusTx.Constr + 0 + [ PlutusTx.toData @CurrencySymbol "ab" + , PlutusTx.toData @CurrencySymbol "41" + , PlutusTx.toData @CurrencySymbol "0e" + ] + ) + let minting = Minting "" + spending = Spending $ TxOutRef "ab" 0 + rewarding = Rewarding . StakingHash $ PubKeyCredential "da" + "2" + @| pcon + ( PTriplet $ + pdcons + # pconstantData minting #$ pdcons + # pconstantData spending #$ pdcons + # pconstantData rewarding + # pdnil + ) + @== pconstant + ( PlutusTx.Constr + 0 + [PlutusTx.toData minting, PlutusTx.toData spending, PlutusTx.toData rewarding] + ) + -- Enumerable sum type construction + "enum" @\ do + "PA" @| pcon (PA pdnil) @== pconstant (PlutusTx.Constr 0 []) + "PB" @| pcon (PB pdnil) @== pconstant (PlutusTx.Constr 1 []) + -- Relation between pconstant and pcon + "pconstant-pcon-rel" + @| ( let valHash = "01" + addr = Address (ScriptCredential $ fromString valHash) Nothing + pscriptCredential :: Term s PCredential + pscriptCredential = + pcon $ + PScriptCredential $ + pdcons # pdata (pcon $ PValidatorHash $ phexByteStr valHash) # pdnil + in pconstant addr + @== pcon (PAddress $ pdcons # pdata pscriptCredential #$ pdcons # pdata (pcon $ PDNothing pdnil) # pdnil) + ) + +propertySet :: + forall p. + ( PIsData p + , PLift p + , PlutusTx.ToData (PLifted p) + , PlutusTx.FromData (PLifted p) + , Eq (PLifted p) + , Show (PLifted p) + , Arbitrary (PLifted p) + ) => + String -> + Spec +propertySet typeName = do + describe typeName $ do + specify ("x ~ " <> typeName <> ": pfromData (pdata x) ≡ x") $ + property $ ptoFromEqual @p + specify ("x ~ " <> typeName <> ": pfromData (PlutusTx.toData x) ≡ x") $ + property $ pfromDataCompat @p + specify ("x ~ " <> typeName <> ": PlutusTx.fromData (pdata x) ≡ Just x") $ + property $ pdataCompat @p + +ptoFromEqual :: + forall p. + ( PIsData p + , PLift p + ) => + PLifted p -> + _ +ptoFromEqual t = pfromData (pdata $ pconstant @p t) `pshouldBe` pconstant @p t + +pfromDataCompat :: + forall p. + ( PIsData p + , PlutusTx.ToData (PLifted p) + , PLift p + , Eq (PLifted p) + , Show (PLifted p) + ) => + PLifted p -> + IO () +pfromDataCompat x = plift (pfromData $ pconstantData @p x) `shouldBe` x + +pdataCompat :: + forall p. + ( PLift p + , PIsData p + , PlutusTx.FromData (PLifted p) + , Eq (PLifted p) + , Show (PLifted p) + ) => + PLifted p -> + IO () +pdataCompat x = PlutusTx.fromData @(PLifted p) (plift $ pforgetData $ pdata $ pconstant @p x) `shouldBe` Just x + +data PVehicle (s :: S) + = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) + | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) + | PImmovableBox (Term s (PDataRecord '[])) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData) + via PIsDataReprInstances PVehicle + +data PEnumType (s :: S) + = PA (Term s (PDataRecord '[])) + | PB (Term s (PDataRecord '[])) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData) + via PIsDataReprInstances PEnumType diff --git a/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs new file mode 100644 index 000000000..e11c44655 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/PLamSpec.hs @@ -0,0 +1,71 @@ +module Plutarch.PLamSpec (spec) where + +import Data.ByteString (ByteString) +import qualified PlutusCore as PLC + +import Plutarch.Prelude +import Plutarch.Test +import Plutarch.Unsafe (punsafeBuiltin) +import Test.Hspec + +spec :: Spec +spec = do + describe "plam" . pgoldenSpec $ do + "id" @| plam (\x -> x) + "flip.const" @| plam (\_ y -> y) + "plet" @| plam (\x _ -> plet x $ \_ -> perror) + "primitives" @\ do + "bool" @\ do + "true" @| plam $ \_ -> pconstant True + "int" @\ do + "0" @| plam $ \_ -> (0 :: Term _ PInteger) + "1" @| plam $ \_ -> (1 :: Term _ PInteger) + "512" @| plam $ \_ -> (512 :: Term _ PInteger) + "1048576" @| plam $ \_ -> (1048576 :: Term _ PInteger) + "bytestring" @\ do + "1" @| plam $ \_ -> pconstant ("1" :: ByteString) + "1111111" @| plam $ \_ -> pconstant ("1111111" :: ByteString) + "unit" @\ do + "list" @| plam $ \_ -> pconstant ([()] :: [()]) + "()" @| plam $ \_ -> pconstant () + "id" @| plam $ \x -> x + "fun" @\ do + "lam+" @| plam $ \_ -> (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) + "+" @| (plam (+) :: Term _ (PInteger :--> PInteger :--> PInteger)) + "η-reduction-optimisations" @\ do + "λx y. addInteger x y => addInteger" + @| plam + $ \x y -> (x :: Term _ PInteger) + y + "λx y. hoist (force mkCons) x y => force mkCons" + @| plam + $ \x y -> (pforce $ punsafeBuiltin PLC.MkCons) # x # y + "λx y. hoist mkCons x y => mkCons x y" + @| plam + $ \x y -> (punsafeBuiltin PLC.MkCons) # x # y + "λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x" + @| plam + $ \x y -> (phoistAcyclic $ plam $ \(x :: Term _ PInteger) y -> x + y - y - x) # x # y + "λx y. x + x" + @| plam + $ \(x :: Term _ PInteger) (_ :: Term _ PInteger) -> x + x + "let x = addInteger in x 1 1" + @| plet (punsafeBuiltin PLC.AddInteger) + $ \x -> x # (1 :: Term _ PInteger) # (1 :: Term _ PInteger) + "let x = 0 in x => 0" + @| plet 0 + $ \(x :: Term _ PInteger) -> x + "let x = hoist (λx. x + x) in 0 => 0" + @| plet (phoistAcyclic $ plam $ \(x :: Term _ PInteger) -> x + x) + $ \_ -> (0 :: Term _ PInteger) + "let x = hoist (λx. x + x) in x" + @| plet (phoistAcyclic $ plam $ \(x :: Term _ PInteger) -> x + x) + $ \x -> x + "λx y. sha2_256 x y =>!" + @| (plam $ \x y -> punsafeBuiltin PLC.Sha2_256 # x # y) + "let f = hoist (λx. x) in λx y. f x y => λx y. x y" + @| (plam $ \x y -> (phoistAcyclic $ plam $ \x -> x) # x # y) + "let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y" + @| (plam $ \x y -> ((phoistAcyclic $ plam $ \x -> x # pcon PTrue)) # x # y) + "λy. (λx. x + x) y" + @| plam + $ \y -> (plam $ \(x :: Term _ PInteger) -> x + x) # y diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs new file mode 100644 index 000000000..78b9783e6 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -0,0 +1,255 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.POrdSpec (spec) where + +import Data.ByteString (ByteString) + +import Plutus.V1.Ledger.Api ( + Address (Address), + Credential (PubKeyCredential, ScriptCredential), + PubKeyHash (PubKeyHash), + StakingCredential (StakingHash, StakingPtr), + ValidatorHash (ValidatorHash), + ) +import qualified PlutusTx as PlutusTx +import qualified PlutusTx.Builtins as PlutusTx + +import Test.QuickCheck.Instances () + +import Test.Tasty.QuickCheck (Arbitrary, arbitrary, oneof, property) + +import Plutarch.Api.V1 (PAddress, PCredential (PPubKeyCredential, PScriptCredential), PMaybeData) +import Plutarch.Lift ( + DerivePConstantViaNewtype (DerivePConstantViaNewtype), + PConstant (PConstanted), + PUnsafeLiftDecl (PLifted), + ) +import Plutarch.Prelude + +import Plutarch.SpecTypes (PTriplet (PTriplet), Triplet (Triplet)) +import Plutarch.Test +import Test.Hspec (Spec, describe, shouldBe, specify) + +spec :: Spec +spec = do + describe "pisdata" $ do + describe "ord.property" $ do + propertySet @PBool "PBool" + propertySet @(PMaybeData PInteger) "PMaybeData PInteger" + propertySet @(PTriplet PInteger) "PMaybeData PInteger" + propertySet @PAddress' "PAddress" + describe "lt" . pgoldenSpec $ do + "PCredential" @\ do + let c1 = PubKeyCredential "" + c2 = ScriptCredential "41" + "derived" @\ ltWith (#<) c1 c2 + "pmatch" @\ ltWith ltCred c1 c2 + "pmatch-pdatarecord" @\ ltWith ltCred' c1 c2 + "PTriplet" @\ do + let c1 = Triplet @Integer 1 2 3 + c2 = Triplet 1 3 5 + "derived" @\ ltWith (#<) c1 c2 + "pmatch" @\ ltWith ltTrip c1 c2 + "pmatch-pdatarecord" @\ ltWith ltTrip' c1 c2 + describe "lte" . pgoldenSpec $ do + "PCredential" @\ do + let c1 = PubKeyCredential "" + c2 = ScriptCredential "41" + "derived" @\ lteWith (#<=) c1 c2 + "pmatch" @\ lteWith lteCred c1 c2 + "pmatch-pdatarecord" @\ lteWith lteCred' c1 c2 + "PTriplet" @\ do + let c1 = Triplet @Integer 1 2 3 + c2 = Triplet 1 3 5 + "derived" @\ lteWith (#<=) c1 c2 + "pmatch" @\ lteWith lteTrip c1 c2 + "pmatch-pdatarecord" @\ lteWith lteTrip' c1 c2 + where + ltWith :: + PLift p => + (forall s. Term s p -> Term s p -> Term s PBool) -> + PLifted p -> + PLifted p -> + PlutarchGoldens + ltWith f x y = do + "true" + @| (pconstant x `f` pconstant y) + @-> passert + "false" + @| (pconstant y `f` pconstant x) + @-> passertNot + lteWith :: + PLift p => + (forall s. Term s p -> Term s p -> Term s PBool) -> + PLifted p -> + PLifted p -> + PlutarchGoldens + lteWith f x y = do + "true" + @\ do + "eq" + @| (pconstant x `f` pconstant x) + @-> passert + "less" + @| (pconstant x `f` pconstant y) + @-> passert + "false" + @| (pconstant y `f` pconstant x) + @-> passertNot + +propertySet :: + forall p. + ( PIsData p + , PLift p + , POrd p + , PlutusTx.ToData (PLifted p) + , PlutusTx.FromData (PLifted p) + , Ord (PLifted p) + , Show (PLifted p) + , Arbitrary (PLifted p) + ) => + String -> + Spec +propertySet typeName' = do + describe typeName' $ do + let typeName = '(' : typeName' ++ ")" + specify ("(#<) @" <> typeName <> " ≡ (<) @" <> typeName) $ + property $ pltIso @p + specify ("(#<=) @" <> typeName <> " ≡ (<=) @" <> typeName) $ + property $ plteIso @p + specify ("(#==) @" <> typeName <> " ≡ (==) @" <> typeName) $ + property $ peqIso @p + +pltIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Ord h, POrd p) => h -> h -> IO () +pltIso a b = plift (pconstant @p a #< pconstant b) `shouldBe` (a < b) + +plteIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Ord h, POrd p) => h -> h -> IO () +plteIso a b = plift (pconstant @p a #<= pconstant b) `shouldBe` (a <= b) + +peqIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Eq h, PEq p) => h -> h -> IO () +peqIso a b = plift (pconstant @p a #== pconstant b) `shouldBe` (a == b) + +newtype PAddress' s = PAddress' (Term s PAddress) + deriving (PlutusType, PIsData, PEq, POrd) via DerivePNewtype PAddress' PAddress + +instance PUnsafeLiftDecl PAddress' where type PLifted PAddress' = Address' + +newtype Address' = Address' Address + deriving stock (Show, Eq, Ord) + deriving newtype (PlutusTx.FromData, PlutusTx.ToData) + deriving (PConstant) via (DerivePConstantViaNewtype Address' PAddress' PAddress) + +instance Arbitrary Address' where + arbitrary = Address' <$> arbitraryAddr + where + arbitraryAddr = Address <$> arbitraryCred <*> arbitraryMaybeStakingCred + arbitraryCred = + oneof + [ PubKeyCredential . PubKeyHash . PlutusTx.toBuiltin @ByteString <$> arbitrary + , ScriptCredential . ValidatorHash . PlutusTx.toBuiltin @ByteString <$> arbitrary + ] + arbitraryStakingCred = + oneof + [ StakingHash <$> arbitraryCred + , StakingPtr <$> arbitrary <*> arbitrary <*> arbitrary + ] + arbitraryMaybeStakingCred = oneof [pure Nothing, Just <$> arbitraryStakingCred] + +-- A bunch of boilerplate purely for a bit more informative benchmarks. + +-- manual 'pmatch' + manual field extraction impl. +_pmatchHelperCred :: + (Term s PByteString -> Term s PByteString -> Term s PBool) -> + Term s PCredential -> + Term s PCredential -> + Term s PBool +_pmatchHelperCred f cred1 cred2 = unTermCont $ do + x <- tcont $ pmatch cred1 + y <- tcont $ pmatch cred2 + pure $ case (x, y) of + (PPubKeyCredential a, PPubKeyCredential b) -> + pto (pfromData $ pfield @"_0" # a) `f` pto (pfromData $ pfield @"_0" # b) + (PPubKeyCredential _, PScriptCredential _) -> pconstant True + (PScriptCredential _, PPubKeyCredential _) -> pconstant False + (PScriptCredential a, PScriptCredential b) -> + pto (pfromData $ pfield @"_0" # a) `f` pto (pfromData $ pfield @"_0" # b) + +ltCred :: Term s PCredential -> Term s PCredential -> Term s PBool +ltCred = _pmatchHelperCred (#<) + +lteCred :: Term s PCredential -> Term s PCredential -> Term s PBool +lteCred = _pmatchHelperCred (#<=) + +-- manual 'pmatch' + 'PDataRecord' Ord impl. +_pmatchDataRecHelperCred :: + (forall l. POrd (PDataRecord l) => Term s (PDataRecord l) -> Term s (PDataRecord l) -> Term s PBool) -> + Term s PCredential -> + Term s PCredential -> + Term s PBool +_pmatchDataRecHelperCred f cred1 cred2 = unTermCont $ do + x <- tcont $ pmatch cred1 + y <- tcont $ pmatch cred2 + pure $ case (x, y) of + (PPubKeyCredential a, PPubKeyCredential b) -> a `f` b + (PPubKeyCredential _, PScriptCredential _) -> pconstant True + (PScriptCredential _, PPubKeyCredential _) -> pconstant False + (PScriptCredential a, PScriptCredential b) -> a `f` b + +ltCred' :: Term s PCredential -> Term s PCredential -> Term s PBool +ltCred' = _pmatchDataRecHelperCred (#<) + +lteCred' :: Term s PCredential -> Term s PCredential -> Term s PBool +lteCred' = _pmatchDataRecHelperCred (#<=) + +-- manual 'pmatch' + manual field extraction impl. +ltTrip :: Term s (PTriplet PInteger) -> Term s (PTriplet PInteger) -> Term s PBool +ltTrip trip1 trip2 = unTermCont $ do + a <- tcont $ pletFields @'["x", "y", "z"] trip1 + b <- tcont $ pletFields @'["x", "y", "z"] trip2 + + x <- tcont . plet . pfromData $ hrecField @"x" a + x' <- tcont . plet . pfromData $ hrecField @"x" b + pure $ + x #< x' + #|| ( x #== x' + #&& ( unTermCont $ do + y <- tcont . plet . pfromData $ hrecField @"y" a + y' <- tcont . plet . pfromData $ hrecField @"y" b + pure $ y #< y' #|| (y #== y' #&& pfromData (hrecField @"z" a) #< pfromData (hrecField @"z" b)) + ) + ) + +lteTrip :: Term s (PTriplet PInteger) -> Term s (PTriplet PInteger) -> Term s PBool +lteTrip trip1 trip2 = unTermCont $ do + a <- tcont $ pletFields @'["x", "y", "z"] trip1 + b <- tcont $ pletFields @'["x", "y", "z"] trip2 + + x <- tcont . plet . pfromData $ hrecField @"x" a + x' <- tcont . plet . pfromData $ hrecField @"x" b + pure $ + x #< x' + #|| ( x #== x' + #&& ( unTermCont $ do + y <- tcont . plet . pfromData $ hrecField @"y" a + y' <- tcont . plet . pfromData $ hrecField @"y" b + pure $ y #< y' #|| (y #== y' #&& pfromData (hrecField @"z" a) #<= pfromData (hrecField @"z" b)) + ) + ) + +-- manual 'pmatch' + 'PDataRecord' Ord impl. +_pmatchDataRecHelperTrip :: + (forall l. POrd (PDataRecord l) => Term s (PDataRecord l) -> Term s (PDataRecord l) -> Term s PBool) -> + Term s (PTriplet PInteger) -> + Term s (PTriplet PInteger) -> + Term s PBool +_pmatchDataRecHelperTrip f trip1 trip2 = unTermCont $ do + PTriplet a <- tcont $ pmatch trip1 + PTriplet b <- tcont $ pmatch trip2 + pure $ a `f` b + +ltTrip' :: Term s (PTriplet PInteger) -> Term s (PTriplet PInteger) -> Term s PBool +ltTrip' = _pmatchDataRecHelperTrip (#<) + +lteTrip' :: Term s (PTriplet PInteger) -> Term s (PTriplet PInteger) -> Term s PBool +lteTrip' = _pmatchDataRecHelperTrip (#<=) diff --git a/plutarch-test/plutarch-base/Plutarch/PairSpec.hs b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs new file mode 100644 index 000000000..45f1e6c0e --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/PairSpec.hs @@ -0,0 +1,27 @@ +module Plutarch.PairSpec (spec) where + +import Plutarch.Prelude +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "pair" . pgoldenSpec $ do + "eq" @\ do + "true" + @| pcon @(PPair PInteger PString) (PPair 42 "Hello") + #== pcon (PPair 42 "Hello") + @-> passert + "false" @\ do + "fst" + @| pcon @(PPair PInteger PString) (PPair 42 "Hello") + #== pcon (PPair 24 "Hello") + @-> passertNot + "snd" + @| pcon @(PPair PInteger PString) (PPair 42 "Hello") + #== pcon (PPair 42 "World") + @-> passertNot + "both" + @| pcon @(PPair PInteger PString) (PPair 42 "Hello") + #== pcon (PPair 24 "World") + @-> passertNot diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs new file mode 100644 index 000000000..84c9e4146 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -0,0 +1,267 @@ +{-# LANGUAGE CPP #-} + +module Plutarch.PlutusTypeSpec (spec) where + +import Plutarch (pcon', pmatch') +import Plutarch.Api.V1 ( + PAddress (PAddress), + PCredential (PPubKeyCredential, PScriptCredential), + PScriptPurpose (PCertifying, PMinting, PRewarding, PSpending), + ) +import Plutarch.Builtin (pasByteStr, pasConstr) +import Plutarch.Prelude +import Plutarch.Test +import Plutus.V1.Ledger.Address (Address (Address)) +import Plutus.V1.Ledger.Api (DCert (DCertGenesis), toData) +import Plutus.V1.Ledger.Contexts (ScriptPurpose (Certifying, Minting, Rewarding, Spending), TxOutRef (TxOutRef)) +import Plutus.V1.Ledger.Credential ( + Credential (PubKeyCredential, ScriptCredential), + StakingCredential (StakingPtr), + ) + +import Test.Hspec + +spec :: Spec +spec = do + describe "plutustype" $ do + describe "example" . pgoldenSpec $ do + "A-as-0" @| pcon A @== pconstant @PInteger 0 + "B-as-1" @| pcon B @== pconstant @PInteger 1 + "swap" @\ do + "A" @| swap (pcon A) @== pcon B + "B" @| swap (pcon B) @== pcon A + "scottenc" @\ do + "PMaybe" + @| ( let a = 42 :: Term s PInteger + in pmatch (pcon $ PJust a) $ \case + PJust x -> x + -- We expect this perror not to be evaluated eagerly when mx + -- is a PJust. + PNothing -> perror + ) + "PPair" + @| ( let a = 42 :: Term s PInteger + b = "Universe" :: Term s PString + in pmatch (pcon (PPair a b) :: Term s (PPair PInteger PString)) $ \(PPair _ y) -> y + ) + describe "instances-sanity" $ do + plutarchDevFlagDescribe $ do + it "PBuiltinList" $ do + pmatchTargetEval $ pconstant [1 :: Integer, 2, 3, 4] + deconstrSpec + +{- | For comparing typed and untyped data deconstruction approaches. + +We ideally want the typed and raw versions to have as little deviation as possible. +-} +deconstrSpec :: Spec +deconstrSpec = do + describe "deconstr" . pgoldenSpec $ do + "matching" @\ do + "typed" @\ do + "newtype" + @| plam + ( \x -> pmatch x $ \(PAddress addrFields) -> + addrFields + ) + # pconstant addrPC + "sumtype(ignore-fields)" + @| plam + ( \x -> pmatch x $ \case + PMinting _ -> pconstant () + _ -> perror + ) + # pconstant minting + "sumtype(partial-match)" + @| plam + ( \x -> pmatch x $ \case + PMinting hs -> hs + _ -> perror + ) + # pconstant minting + "sumtype(exhaustive)" @\ do + benchPurpose $ + plam + ( \x -> pmatch x $ \case + PMinting f -> plet f $ const $ phexByteStr "01" + PSpending f -> plet f $ const $ phexByteStr "02" + PRewarding f -> plet f $ const $ phexByteStr "03" + PCertifying f -> plet f $ const $ phexByteStr "04" + ) + "sumtype(exhaustive)(ignore-fields)" @\ do + benchPurpose $ + plam + ( \x -> pmatch x $ \case + PMinting _ -> phexByteStr "01" + PSpending _ -> phexByteStr "02" + PRewarding _ -> phexByteStr "03" + PCertifying _ -> phexByteStr "04" + ) + "raw" @\ do + "newtype" + @| plam + ( \x -> + psndBuiltin #$ pasConstr # x + ) + #$ pconstant + (toData addrPC) + "sumtype(ignore-fields)" + @| plam + ( \x -> + pif + ((pfstBuiltin #$ pasConstr # x) #== 0) + (pconstant ()) + perror + ) + #$ pconstant (toData minting) + "sumtype(partial-match)" + @| plam + ( \x -> + plet (pasConstr # x) $ \d -> + pif + (pfstBuiltin # d #== 0) + (psndBuiltin # d) + perror + ) + #$ pconstant (toData minting) + "sumtype(exhaustive)" @\ do + benchPurpose' $ + plam + ( \x -> + plet (pasConstr # x) $ \d -> + plet (pfstBuiltin # d) $ \constr -> + plet (psndBuiltin # d) $ \_ -> + pif + (constr #== 1) + (phexByteStr "02") + $ pif + (constr #== 2) + (phexByteStr "03") + $ pif + (constr #== 3) + (phexByteStr "04") + $ phexByteStr "01" + ) + "sumtype(exhaustive)(ignore-fields)" @\ do + benchPurpose' $ + plam + ( \x -> do + plet (pfstBuiltin #$ pasConstr # x) $ \constr -> + pif + (constr #== 1) + (phexByteStr "02") + $ pif + (constr #== 2) + (phexByteStr "03") + $ pif + (constr #== 3) + (phexByteStr "04") + $ phexByteStr "01" + ) + "fields" @\ do + "typed" @\ do + "extract-single" + @| plam + ( \x -> + pfield @"credential" # x + ) + # pconstant addrSC + "raw" @\ do + "extract-single" + @| plam + ( \x -> + phead #$ psndBuiltin #$ pasConstr # x + ) + #$ pconstant + $ toData addrSC + "combined" @\ do + "typed" @\ do + "toValidatorHash" + @| plam + ( \x -> + pmatch (pfromData $ pfield @"credential" # x) $ \case + PPubKeyCredential _ -> + pcon PNothing + PScriptCredential credFields -> + pcon . PJust $ pto $ pfromData $ pfield @"_0" # credFields + ) + # pconstant addrSC + "raw" @\ do + "toValidatorHash" + @| plam + ( \x -> + let cred = phead #$ psndBuiltin #$ pasConstr # x + in plet (pasConstr # cred) $ \deconstrCred -> + pif + (pfstBuiltin # deconstrCred #== 0) + (pcon PNothing) + $ pcon . PJust $ pasByteStr #$ phead #$ psndBuiltin # deconstrCred + ) + # pconstant (toData addrSC) + where + addrSC = Address (ScriptCredential "ab") Nothing + addrPC = Address (PubKeyCredential "ab") Nothing + minting :: ScriptPurpose + minting = Minting "" + spending = Spending (TxOutRef "ab" 0) + rewarding = Rewarding (StakingPtr 42 0 7) + certifying = Certifying DCertGenesis + -- Bench given function feeding in all 4 types of script purpose (typed). + benchPurpose :: ClosedTerm (PScriptPurpose :--> PByteString) -> PlutarchGoldens + benchPurpose f = do + "minting" @| f # pconstant minting + "spending" @| f # pconstant spending + "rewarding" @| f # pconstant rewarding + "certifying" @| f # pconstant certifying + -- Bench given function feeding in all 4 types of script purpose (untyped). + benchPurpose' :: ClosedTerm (PData :--> PByteString) -> PlutarchGoldens + benchPurpose' f = do + "minting" @| f #$ pconstant $ toData minting + "spending" @| f #$ pconstant $ toData spending + "rewarding" @| f #$ pconstant $ toData rewarding + "certifying" @| f #$ pconstant $ toData certifying + +-- | Make sure the target of 'pmatch' is only evaluated once. +pmatchTargetEval :: PlutusType p => ClosedTerm p -> Expectation +pmatchTargetEval target = + pmatch (ptrace (pconstant tag) target) (\x -> plet (pcon x) $ \_ -> pconstant ()) + `ptraces` replicate 1 tag + where + tag = "evaluating" + +{- TODO: + - move over the testcase with pmatchTargetEval + - add more sanity checks +describe "sanity checks" $ do + describe "PBuiltinList" $ do + let p :: Term s (PBuiltinList PInteger) + p = pconstant [1,2,3,4] + it "works" $ + -} + +{- | + A Sum type, which can be encoded as an Enum +-} +data AB (s :: S) = A | B + +{- | + AB is encoded as an Enum, using values of PInteger + internally. +-} +instance PlutusType AB where + type PInner AB _ = PInteger + + pcon' A = 0 + pcon' B = 1 + + pmatch' x f = + pif (x #== 0) (f A) (f B) + +{- | + Instead of using `pcon'` and `pmatch'` directly, + use 'pcon' and 'pmatch', to hide the `PInner` type. +-} +swap :: Term s AB -> Term s AB +swap x = pmatch x $ \case + A -> pcon B + B -> pcon A diff --git a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs new file mode 100644 index 000000000..7635751d7 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs @@ -0,0 +1,46 @@ +module Plutarch.RationalSpec (spec) where + +import Plutarch.Prelude +import Plutarch.Rational (pproperFraction, ptruncate) +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + let rat :: Term s PRational -> Term s PRational + rat = id + assertRat :: ClosedTerm PRational -> ClosedTerm PRational -> Expectation + assertRat x p = passert $ p #== x + describe "rational" . pgoldenSpec $ do + "literal" @| rat 0.5 + "ops" @\ do + "+" @| rat (1 / 2 + 1 / 2) @-> assertRat 1 + "-" @| rat (1 / 2 - 1 / 3) @-> assertRat (1 / 6) + "*" @| rat ((1 - 3 / 2) * (2 - 5 / 2)) @-> assertRat (1 / 4) + "harmonic-sum" @| rat (1 / 2 + 1 / 3 + 1 / 4 + 1 / 5) + @-> assertRat (77 / 60) + "multi-product" @| rat (1 / 2 * 2 / 3 * 3 / 4 * 4 / 5 * 5 / 6) + @-> assertRat (1 / 6) + "compare" @| rat (2 / 9) #< rat (3 / 10) @-> passert + "round" @\ do + -- NOTE: These will eventually be replaced by property tests. + "5/3" @| pround # rat (5 / 3) @== pconstant @PInteger 2 + "4/3" @| pround # rat (4 / 3) @== pconstant @PInteger 1 + "-5/2" @| pround # rat (-5 / 2) @== pconstant @PInteger (-2) + "-1/4" @| pround # rat (-1 / 4) @== pconstant @PInteger 0 + "truncate" @\ do + "5/4" @| ptruncate # rat (5 / 4) @== pconstant @PInteger 1 + "7/4" @| ptruncate # rat (7 / 4) @== pconstant @PInteger 1 + "1/4" @| ptruncate # rat (1 / 4) @== pconstant @PInteger 0 + "-7/4" @| ptruncate # rat (-7 / 4) @== pconstant @PInteger (-1) + "properFraction" @\ do + let mkP r a b = pmatch (pproperFraction # r) $ \(PPair x y) -> + x #== a #&& y #== b + "-1/2" @| mkP (-1 / 2) 0 (-1 / 2) @-> passert + "-3/2" @| mkP (-3 / 2) (-1) (-1 / 2) @-> passert + "-4/3" @| mkP (-4 / 3) (-1) (-1 / 3) @-> passert + "data" @\ do + "id" @\ do + "0.5" @| rat 0.5 @-> assertRat (pfromData (pdata 0.5)) + "2" @| rat 2 @-> assertRat (pfromData (pdata 2)) + "11/3" @| rat 11 / 3 @-> assertRat (pfromData (pdata $ 11 / 3)) diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs new file mode 100644 index 000000000..2380aa772 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -0,0 +1,306 @@ +{-# LANGUAGE TemplateHaskell #-} + +module Plutarch.RecSpec (spec) where + +import qualified Rank2.TH + +import Prelude hiding (even, odd) + +import Plutarch (pcon', pmatch') +import Plutarch.Builtin (pasConstr, pforgetData) +import Plutarch.Prelude +import Plutarch.Rec ( + DataReader (DataReader, readData), + DataWriter (DataWriter, writeData), + PRecord (PRecord), + RecordFromData, + ScottEncoded, + ScottEncoding, + field, + fieldFromData, + letrec, + rcon, + recordDataFromFieldWriters, + recordFromFieldReaders, + rmatch, + ) +import Plutarch.Rec.TH (deriveAll) +import Plutarch.Test +import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) +import Test.Hspec + +data FlatOuterRecord f = FlatOuterRecord + { flatOuterBool :: f PBool + , flatInner1 :: SampleRecord f + , flatOuterInt :: f PInteger + , flatInner2 :: SampleRecord f + , flatOuterString :: f PString + } + +data ShallowOuterRecord f = ShallowOuterRecord + { shallowOuterBool :: f PBool + , shallowInner1 :: f (PRecord SampleRecord) + , shallowOuterInt :: f PInteger + , shallowInner2 :: f (PRecord SampleRecord) + , shallowOuterString :: f PString + } + +data SampleRecord f = SampleRecord + { sampleBool :: f PBool + , sampleInt :: f PInteger + , sampleString :: f PString + } + +data EvenOdd f = EvenOdd + { even :: f (PInteger :--> PBool) + , odd :: f (PInteger :--> PBool) + } + +type instance ScottEncoded EvenOdd a = (PInteger :--> PBool) :--> (PInteger :--> PBool) :--> a + +$(Rank2.TH.deriveAll ''EvenOdd) +$(deriveAll ''SampleRecord) -- also autoderives the @type instance ScottEncoded@ +$(deriveAll ''FlatOuterRecord) +$(deriveAll ''ShallowOuterRecord) +instance RecordFromData SampleRecord +instance RecordFromData FlatOuterRecord +instance RecordFromData ShallowOuterRecord + +instance PIsData (PRecord SampleRecord) where + pfromData = readData (recordFromFieldReaders sampleReader) + pdata = writeData (recordDataFromFieldWriters sampleWriter) + +instance PIsData (PRecord FlatOuterRecord) where + pfromData = readData (recordFromFieldReaders flatOuterReader) + pdata = writeData (recordDataFromFieldWriters flatOuterWriter) + +instance PIsData (PRecord ShallowOuterRecord) where + pfromData = readData (recordFromFieldReaders shallowOuterReader) + pdata = writeData (recordDataFromFieldWriters shallowOuterWriter) + +sampleReader :: SampleRecord (DataReader s) +sampleReader = + SampleRecord + { sampleBool = DataReader pfromData + , sampleInt = DataReader pfromData + , sampleString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d + } + +sampleWriter :: SampleRecord (DataWriter s) +sampleWriter = + SampleRecord + { sampleBool = DataWriter pdata + , sampleInt = DataWriter pdata + , sampleString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s + } + +flatOuterReader :: FlatOuterRecord (DataReader s) +flatOuterReader = + FlatOuterRecord + { flatOuterBool = DataReader pfromData + , flatInner1 = sampleReader + , flatOuterInt = DataReader pfromData + , flatInner2 = sampleReader + , flatOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d + } + +flatOuterWriter :: FlatOuterRecord (DataWriter s) +flatOuterWriter = + FlatOuterRecord + { flatOuterBool = DataWriter pdata + , flatInner1 = sampleWriter + , flatOuterInt = DataWriter pdata + , flatInner2 = sampleWriter + , flatOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s + } + +shallowOuterReader :: ShallowOuterRecord (DataReader s) +shallowOuterReader = + ShallowOuterRecord + { shallowOuterBool = DataReader pfromData + , shallowInner1 = DataReader pfromData + , shallowOuterInt = DataReader pfromData + , shallowInner2 = DataReader pfromData + , shallowOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d + } + +shallowOuterWriter :: ShallowOuterRecord (DataWriter s) +shallowOuterWriter = + ShallowOuterRecord + { shallowOuterBool = DataWriter pdata + , shallowInner1 = DataWriter pdata + , shallowOuterInt = DataWriter pdata + , shallowInner2 = DataWriter pdata + , shallowOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s + } + +sampleFlatOuter :: Term (s :: S) (ScottEncoding FlatOuterRecord (t :: PType)) +sampleFlatOuter = rcon rawFlatOuter + +rawFlatOuter :: FlatOuterRecord (Term s) +rawFlatOuter = + FlatOuterRecord + { flatOuterBool = pcon PFalse + , flatInner1 = rawRecord + , flatOuterInt = 4 + , flatInner2 = rawRecord {sampleInt = 9} + , flatOuterString = "Hola, Mundo!" + } + +sampleShallowOuter :: Term (s :: S) (ScottEncoding ShallowOuterRecord (t :: PType)) +sampleShallowOuter = rcon rawShallowOuter + +rawShallowOuter :: ShallowOuterRecord (Term s) +rawShallowOuter = + ShallowOuterRecord + { shallowOuterBool = pcon PFalse + , shallowInner1 = pcon $ PRecord rawRecord + , shallowOuterInt = 4 + , shallowInner2 = pcon $ PRecord rawRecord {sampleInt = 9} + , shallowOuterString = "Hola, Mundo!" + } + +sampleRecord :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) +sampleRecord = rcon rawRecord + +sampleRecord' :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) +sampleRecord' = pcon' $ PRecord rawRecord + +sampleRecord'' :: Term (s :: S) (PRecord SampleRecord :: PType) +sampleRecord'' = pcon $ PRecord rawRecord + +rawRecord :: SampleRecord (Term s) +rawRecord = + SampleRecord + { sampleBool = pcon PFalse + , sampleInt = 6 + , sampleString = "Salut, Monde!" + } + +sampleRecur :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) +sampleRecur = + letrec $ + const + SampleRecord + { sampleBool = pcon PTrue + , sampleInt = 12 + , sampleString = "Hello, World!" + } + +evenOdd :: Term (s :: S) (ScottEncoding EvenOdd (t :: PType)) +evenOdd = letrec evenOddRecursion + where + evenOddRecursion :: EvenOdd (Term s) -> EvenOdd (Term s) + evenOddRecursion EvenOdd {even, odd} = + EvenOdd + { even = plam $ \n -> pif (n #== 0) (pcon PTrue) (odd #$ n - 1) + , odd = plam $ \n -> pif (n #== 0) (pcon PFalse) (even #$ n - 1) + } + +sampleData :: Term s (PAsData (PRecord SampleRecord)) +sampleData = pdata (punsafeFrom sampleRecord) + +flatOuterData :: Term s (PAsData (PRecord FlatOuterRecord)) +flatOuterData = pdata (punsafeFrom sampleFlatOuter) + +shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) +shallowOuterData = pdata (punsafeFrom sampleShallowOuter) + +spec :: Spec +spec = do + -- Plutarch.Rec.verifySoleConstructor uses tracing, so we must create two sets + -- of golden. + describe "rec" . plutarchDevFlagDescribe . pgoldenSpec $ do + "simple" @\ do + -- Record construction + "constr" @\ do + "pcon" @| sampleRecord'' + "pcon'" @| sampleRecord' + "rcon" @| sampleRecord + "field" @\ do + "access-term" @| sampleRecord' # field sampleInt + "value" @\ do + "direct-access" @| sampleRecord # field sampleInt + "pmatch" @| pmatch sampleRecord'' $ \(PRecord r) -> sampleString r + "pmatch'" @| pmatch' sampleRecord $ \(PRecord r) -> sampleString r + "rmatch" @| rmatch sampleRecord $ \SampleRecord {sampleString = s} -> s + -- Record reconstruction + "reconstr" @\ do + "pcon" @| pmatch' sampleRecord' (pcon @(PRecord SampleRecord)) + -- reconstructed field access + "field-access" @| pto (pmatch' sampleRecord' (pcon @(PRecord SampleRecord))) # field sampleInt + "LetRec" @\ do + "record" @| sampleRecur # field sampleInt + "record-field" @| sampleRecur # field sampleInt + "even" @| evenOdd # field even + "even.4" @| evenOdd # field even # (4 :: Term s PInteger) + "even.5" @| evenOdd # field even # (5 :: Term s PInteger) + "nested" @\ do + "flat" @\ do + "reconstr-with-rcon" @| sampleFlatOuter + "nested-field-access" @| sampleFlatOuter # field (sampleInt . flatInner2) + "nested-field-value" @\ do + "direct-access" @| sampleFlatOuter # field (sampleInt . flatInner2) + "pmatch" @| pmatch (pcon $ PRecord rawFlatOuter) $ \(PRecord r) -> sampleInt $ flatInner2 r + "pmatch'" @| pmatch' sampleFlatOuter $ \(PRecord r) -> sampleString $ flatInner2 r + "rmatch" @| rmatch sampleFlatOuter $ \FlatOuterRecord {flatInner2 = SampleRecord {sampleString = s}} -> s + "reconstr-with-pcon" @| pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord)) + "reconstr-nested-field-value" + @| pto (pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord))) # field (sampleInt . flatInner2) + "nested-record-access-term" + @| pmatch' (rcon rawFlatOuter) + $ \(PRecord FlatOuterRecord {flatInner1}) -> pcon $ PRecord flatInner1 + "nested-match-term" + @| rmatch (rcon rawFlatOuter) + $ \(FlatOuterRecord {flatInner2}) -> + rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> + sampleString + "nested-match-value" + @| rmatch (rcon rawFlatOuter) + $ \(FlatOuterRecord {flatInner2}) -> + rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> + sampleString + "shallow" @\ do + "constr-with-rcon" @| sampleShallowOuter + "nested-field-access" + @| pto (sampleShallowOuter # field shallowInner2) # field sampleInt + "nested-field-value" @\ do + "direct-access" + @| pto (sampleShallowOuter # field shallowInner2) # field sampleInt + "pmatch" + @| pmatch (pcon $ PRecord rawShallowOuter) + $ \(PRecord r) -> pto (shallowInner2 r) # field sampleInt + "pmatch'" + @| pmatch' sampleShallowOuter + $ \(PRecord r) -> pto (shallowInner2 r) # field sampleString + "rmatch" + @| rmatch sampleShallowOuter + $ \ShallowOuterRecord {shallowInner2 = inner} -> pto inner # field sampleString + "reconstr-with-pcon" + @| pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord)) + "reconstr-nested-field-value" + @| pto (pto (pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord))) # field shallowInner2) # field sampleInt + "nested-record-access-term" + @| pmatch' sampleShallowOuter + $ \(PRecord ShallowOuterRecord {shallowInner1}) -> shallowInner1 + "nested-match-term" + @| pmatch' sampleShallowOuter + $ \(PRecord ShallowOuterRecord {shallowInner2}) -> + pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> + sampleString + "nested-match-value" + @| pmatch' sampleShallowOuter + $ \(PRecord ShallowOuterRecord {shallowInner2}) -> + pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> + sampleString + "Data" @\ do + "pdata" @\ do + "simple" @| sampleData + "simple-value-deconstructed" @| pasConstr # pforgetData sampleData + "flat-data-deconstructed" @| pasConstr # pforgetData flatOuterData + "shallow-data-deconstructed" @| pasConstr # pforgetData shallowOuterData + "fieldFromData" @\ do + "simple" @| plam $ \dat -> plam pfromData #$ fieldFromData sampleInt # dat + "nested.flat" @| plam $ \dat -> plam pfromData #$ fieldFromData (sampleInt . flatInner2) # dat + "nested.shallow" @| plam $ \dat -> pto (plam pfromData #$ fieldFromData shallowInner2 # dat) # field sampleInt + "pfromData" @| plam $ \d -> punsafeCoerce (pfromData d :: Term _ (PRecord SampleRecord)) # field sampleInt diff --git a/plutarch-test/src/Plutarch/RecursionSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs similarity index 64% rename from plutarch-test/src/Plutarch/RecursionSpec.hs rename to plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs index bc2c1ec06..889c4c0f5 100644 --- a/plutarch-test/src/Plutarch/RecursionSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecursionSpec.hs @@ -6,24 +6,21 @@ import Plutarch import Plutarch.Bool (pif, (#==)) import Plutarch.Integer (PInteger) +import Plutarch.Lift (pconstant) import Plutarch.Test +import Test.Hspec spec :: Spec spec = do describe "recursion" $ do - describe "example" $ do - -- compilation - describe "iterateN" $ - golden All iterateN - -- tests - describe "iterateN (10) (+1) 0 == 10" $ do - let p :: Term s PInteger - p = 10 - it "works" $ (iterateN # 10 # succ # 0) #@?= p - describe "iterateN 10 (*2) 1 == 1024" $ do - let p :: Term s PInteger - p = 1024 - it "works" $ (iterateN # 10 # double # 1) #@?= p + describe "example" . pgoldenSpec $ do + "iterateN" @\ do + "lam" @| iterateN + "app" @\ do + "succ" @| iterateN # 10 # succ # 0 + @== pconstant @PInteger 10 + "double" @| iterateN # 10 # double # 1 + @== pconstant @PInteger 1024 succ :: Term s (PInteger :--> PInteger) succ = plam $ \x -> x + 1 diff --git a/plutarch-test/src/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs similarity index 77% rename from plutarch-test/src/Plutarch/ScriptsSpec.hs rename to plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 5654e016e..80ba3d202 100644 --- a/plutarch-test/src/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -20,10 +20,14 @@ module Plutarch.ScriptsSpec ( import Data.Text (Text) import qualified Plutus.V1.Ledger.Api as Plutus -import qualified Plutus.V1.Ledger.Crypto as Plutus -import Data.Aeson.Extras (encodeSerialise) -import Plutarch (ClosedTerm, POpaque, popaque) +import Data.Coerce (coerce) + +import qualified Codec.CBOR.Write as Write +import Codec.Serialise (Serialise, encode) +import Data.ByteString (ByteString) +import qualified Data.ByteString.Base16 as Base16 +import qualified Data.Text.Encoding as TE import Plutarch.Api.V1 ( PScriptContext, mintingPolicySymbol, @@ -36,40 +40,31 @@ import Plutarch.Api.V1 ( type PStakeValidator, type PValidator, ) -import Plutarch.Api.V1.Crypto (PPubKey, PPubKeyHash, PSignature (PSignature)) +import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Builtin (pasByteStr) import Plutarch.Prelude -import Plutarch.Test ( - PlutarchGolden (PrintTerm), - getGoldenFilePrefix, - golden, - goldenFilePath, - ) +import Plutarch.Test +import Test.Hspec spec :: Spec spec = do - describe "scripts" $ do - describe "auth_validator" $ do - prefix <- getGoldenFilePrefix - golden PrintTerm authValidatorTerm - it "hash" $ do - pureGoldenTextFile - (goldenFilePath "goldens" prefix "hash") - validatorHashEncoded - describe "auth_policy" $ do - prefix <- getGoldenFilePrefix - golden PrintTerm authPolicyTerm - it "hash" $ - pureGoldenTextFile - (goldenFilePath "goldens" prefix "hash") - policySymEncoded - describe "auth_stake_validator" $ do - prefix <- getGoldenFilePrefix - golden PrintTerm authStakeValidatorTerm - it "hash" $ - pureGoldenTextFile - (goldenFilePath "goldens" prefix "hash") - stakeValidatorHashEncoded + describe "scripts" . pgoldenSpec $ do + "auth_validator" @\ do + "0" @| authValidatorTerm + "hash" @| pconstant validatorHashEncoded + "auth_policy" @\ do + "0" @| authPolicyTerm + "hash" @| pconstant policySymEncoded + "auth_stake_validator" @\ do + "0" @| authStakeValidatorTerm + "hash" @| pconstant stakeValidatorHashEncoded + +encodeSerialise :: Serialise a => a -> Text +encodeSerialise = TE.decodeUtf8 . Base16.encode . Write.toStrictByteString . encode + +type PSignature = PByteString +type PPubKey = PByteString +type PubKey = ByteString {- | A parameterized Validator which may be unlocked @@ -83,7 +78,7 @@ authorizedValidator :: Term s POpaque authorizedValidator authKey datumMessage redeemerSig _ctx = pif - (pverifySignature # pto authKey # datumMessage # pto redeemerSig) + (pverifySignature # authKey # datumMessage # redeemerSig) (popaque $ pcon PUnit) perror @@ -123,7 +118,7 @@ authorizedStakeValidator authHash _redeemer ctx = (popaque $ pcon PUnit) perror -adminPubKey :: Plutus.PubKey +adminPubKey :: PubKey adminPubKey = "11661a8aca9b09bb93eefda295b5da2be3f944d1f4253ab29da17db580f50d02d26218e33fbba5e0cc1b0c0cadfb67a5f9a90157dcc19eecd7c9373b0415c888" adminPubKeyHash :: Plutus.PubKeyHash @@ -143,7 +138,7 @@ authValidatorTerm = authorizedValidator (pconstant adminPubKey) (pasByteStr # datum) - (pcon $ PSignature $ pasByteStr # redeemer) + (pasByteStr # redeemer) ctx -- | `validatorHash` gets the Plutus `ValidatorHash` @@ -207,12 +202,12 @@ stakeValidatorEncoded = encodeSerialise authStakeValidatorCompiled Also note that this is not the addr1/CIP-0019 Address encoding of the script. -} validatorHashEncoded :: Text -validatorHashEncoded = encodeSerialise authValidatorHash +validatorHashEncoded = encodeSerialise (coerce authValidatorHash :: Plutus.BuiltinByteString) -- | The same goes for `CurrencySymbol` policySymEncoded :: Text -policySymEncoded = encodeSerialise authPolicySymbol +policySymEncoded = encodeSerialise (coerce authPolicySymbol :: Plutus.BuiltinByteString) -- | ... And `StakeValidatorHash` stakeValidatorHashEncoded :: Text -stakeValidatorHashEncoded = encodeSerialise authStakeValidatorHash +stakeValidatorHashEncoded = encodeSerialise (coerce authStakeValidatorHash :: Plutus.BuiltinByteString) diff --git a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs new file mode 100644 index 000000000..816862fb6 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs @@ -0,0 +1,79 @@ +module Plutarch.ShowSpec (spec) where + +import Control.Monad (forM_) +import Data.String (IsString (fromString)) +import qualified Data.Text as T + +import Plutarch.ListSpec (integerList) +import Plutarch.Prelude +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "show" . pgoldenSpec $ do + let str x = pconstant @PString x + "unit" @| pshow (pcon PUnit) @== str "()" + "bool" @\ do + "true" @| pshow (pcon PTrue) @== str "PTrue" + "false" @| pshow (pcon PFalse) @== str "PFalse" + "int" @\ do + "0" @| pshow (pconstant @PInteger 0) @== str "0" + forM_ [5, 10, 14, 102] $ \n -> do + (fromString $ show n) + @| pshow (pconstant @PInteger n) + @== pconstant (T.pack $ show n) + (fromString $ show (-n)) + @| pshow (pconstant @PInteger (-n)) + @== pconstant (T.pack $ show (-n)) + "bytestring" @\ do + "empty" @| pshow (phexByteStr "") @== str "0x" + "1" @| pshow (phexByteStr "14") @== str "0x14" + "2" @| pshow (phexByteStr "14AF") @== str "0x14af" + "3" @| pshow (phexByteStr "14AF03") @== str "0x14af03" + "n" @| pshow (phexByteStr "FFFFFF") @== str "0xffffff" + "0" @| pshow (phexByteStr "000000") @== str "0x000000" + "str" @\ do + "empty" @| pshow (str "") @== str "\"\"" + "hello123" @| pshow (str "hello123") @== str "\"hello123\"" + "quoted" @| pshow (str "hello\"123") @== str "\"hello\\\"123\"" + "slash" @| pshow (str "foo\\bar") @== str "\"foo\\bar\"" + "unicode" @| pshow (str "vis-à-vis") @== str "\"vis-à-vis\"" + "unicode-quoted" @| pshow (str "vis-\"à\"-vis") @== str "\"vis-\\\"à\\\"-vis\"" + "maybe" @\ do + "nothing" + @| pshow @(PMaybe PInteger) (pcon PNothing) + @== str "PNothing" + "just" + @| pshow @(PMaybe PInteger) (pcon $ PJust $ pconstant @PInteger 42) + @== str "PJust 42" + "either" @\ do + "right" + @| pshow (pcon @(PEither PUnit PInteger) $ PRight 42) + @== str "PRight 42" + -- Test automatic injection of `(..)`. + "maybe.either" + @| pshow (pcon $ PJust $ pcon @(PEither PInteger PUnit) $ PLeft 42) + @== str "PJust (PLeft 42)" + "list" @\ do + "nil" @| pshow (integerList []) @== str "[]" + "1" @| pshow (integerList [1]) @== str "[1]" + "1,2,3" @| pshow (integerList [1, 2, 3]) @== str "[1, 2, 3]" + "builtinlist" @\ do + let xs3 = pconstant @(PBuiltinList PInteger) [1, 2, 3] + xs0 = pconstant @(PBuiltinList PInteger) [] + "nil" @| pshow xs0 @== str "[]" + "1,2,3" @| pshow xs3 @== str "[1, 2, 3]" + "pair" @\ do + "int-str" + @| pshow (pcon @(PPair PInteger PString) $ PPair 42 "hello") + @== str "PPair 42 \"hello\"" + "int-list" + @| pshow (pcon @(PPair PInteger (PBuiltinList PInteger)) $ PPair 42 $ pconstant [1, 2, 3]) + @== str "PPair 42 [1, 2, 3]" + "rational" @\ do + let rat :: Term s PRational -> Term s PRational + rat = id + "1/2" + @| pshow (rat $ 1 / 2) + @== str "1/2" diff --git a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs new file mode 100644 index 000000000..823bc34d8 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs @@ -0,0 +1,69 @@ +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.SpecTypes (Triplet (..), PTriplet (..)) where + +import qualified GHC.Generics as GHC +import Generics.SOP (Generic, I (I)) +import qualified PlutusTx + +import Plutarch.DataRepr ( + DerivePConstantViaData (DerivePConstantViaData), + PDataFields, + PIsDataReprInstances (PIsDataReprInstances), + ) +import Plutarch.Lift ( + PConstant (PConstanted), + PUnsafeLiftDecl (PLifted), + ) +import Plutarch.Prelude +import Test.Tasty.QuickCheck (Arbitrary, arbitrary) + +data Triplet a = Triplet a a a + deriving stock (Show, Eq, Ord) + +{- | + We can defined a data-type using PDataRecord, with labeled fields. + + With an appropriate instance of 'PIsDataRepr', we can automatically + derive 'PDataFields'. +-} +newtype PTriplet (a :: PType) (s :: S) + = PTriplet + ( Term + s + ( PDataRecord + '[ "x" ':= a + , "y" ':= a + , "z" ':= a + ] + ) + ) + deriving stock (GHC.Generic) + deriving anyclass (Generic, PIsDataRepr) + deriving + (PlutusType, PIsData, PDataFields, PEq, POrd) + via (PIsDataReprInstances (PTriplet a)) + +PlutusTx.makeIsDataIndexed ''Triplet ([('Triplet, 0)]) + +instance + ( PConstanted (PLifted a) ~ a + , PlutusTx.FromData (PLifted a) + , PlutusTx.ToData (PLifted a) + ) => + PUnsafeLiftDecl (PTriplet a) + where + type PLifted (PTriplet a) = Triplet (PLifted a) + +deriving via + (DerivePConstantViaData (Triplet a) (PTriplet (PConstanted a))) + instance + ( PlutusTx.FromData a + , PlutusTx.ToData a + , PLifted (PConstanted a) ~ a + ) => + PConstant (Triplet a) + +instance Arbitrary a => Arbitrary (Triplet a) where + arbitrary = Triplet <$> arbitrary <*> arbitrary <*> arbitrary diff --git a/plutarch-test/plutarch-base/Plutarch/StringSpec.hs b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs new file mode 100644 index 000000000..ae0c67886 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/StringSpec.hs @@ -0,0 +1,19 @@ +module Plutarch.StringSpec (spec) where + +import Plutarch.Prelude +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "str" $ do + pgoldenSpec $ do + "eq" @| "foo" #== pconstant @PString "foo" @-> passert + "semigroup" @\ do + let s1 = pconstant @PString "foo" + s2 = pconstant @PString "bar" + "laws" @\ do + "id.1" @| (mempty <> s1) #== s1 @-> passert + "id.2" @| s1 #== (mempty <> s1) @-> passert + "concat" @| s1 <> s2 #== pconstant @PString "foobar" @-> passert + "mempty" @| mempty #== pconstant @PString "" @-> passert diff --git a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs new file mode 100644 index 000000000..4bb5c5577 --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs @@ -0,0 +1,38 @@ +module Plutarch.TraceSpec (spec) where + +import Plutarch.Prelude +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do + "ptrace" @\ do + "one" @| ptrace "foo" (pcon PUnit) @-> \p -> + ptraces p ["foo"] + "two" @| ptrace "foo" (ptrace "bar" (pcon PUnit)) @-> \p -> + ptraces p ["foo", "bar"] + "ptraceShowId" @\ do + let x = pcon @(PEither PUnit PInteger) $ PRight 42 + "right-42" @| ptraceShowId x @-> \p -> + p `ptraces` ["PRight 42"] + "ptraceIfTrue" @\ do + "true" @| ptraceIfTrue "foo" (pcon PTrue) @-> \p -> + p `ptraces` ["foo"] + "false" @| ptraceIfTrue "foo" (pcon PFalse) @-> \p -> + p `ptraces` [] + "ptraceIfFalse" @\ do + "true" @| ptraceIfFalse "foo" (pcon PTrue) @-> \p -> + p `ptraces` [] + "false" @| ptraceIfFalse "foo" (pcon PFalse) @-> \p -> + p `ptraces` ["foo"] + "chained" @\ do + "false.true.false" + @| ptraceIfFalse "foo" (ptraceIfTrue "bar" $ pcon PFalse) + @-> \p -> p `ptraces` ["foo"] + "ptrace.true.false" + @| ptrace "foo" (ptraceIfTrue "bar" $ pcon PFalse) + @-> \p -> p `ptraces` ["foo"] + "ptrace.true.true" + @| ptrace "foo" (ptraceIfTrue "bar" $ pcon PTrue) + @-> \p -> p `ptraces` ["foo", "bar"] diff --git a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs new file mode 100644 index 000000000..38ac616ad --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs @@ -0,0 +1,48 @@ +module Plutarch.UPLCSpec (spec) where + +import qualified PlutusCore as PLC + +import Plutarch.Internal (punsafeConstantInternal) +import Plutarch.Prelude +import Plutarch.Test +import Plutarch.Unsafe (punsafeBuiltin) +import Test.Hspec + +spec :: Spec +spec = do + -- Tests for the behaviour of UPLC itself. + describe "uplc-behaviour" . pgoldenSpec $ do + "2:[1]" + @| ( let l :: Term _ (PBuiltinList PInteger) = + punsafeConstantInternal . PLC.Some $ + PLC.ValueOf (PLC.DefaultUniApply PLC.DefaultUniProtoList PLC.DefaultUniInteger) [1] + in pforce (punsafeBuiltin PLC.MkCons) # (2 :: Term _ PInteger) # l + ) + "fails:True:[1]" + @| ( let l :: Term _ (PBuiltinList POpaque) = + punsafeConstantInternal . PLC.Some $ + PLC.ValueOf (PLC.DefaultUniApply PLC.DefaultUniProtoList PLC.DefaultUniInteger) [1] + in pforce (punsafeBuiltin PLC.MkCons) # pcon PTrue # l @-> pfails + ) + "(2,1)" + @| punsafeConstantInternal . PLC.Some + $ PLC.ValueOf + ( PLC.DefaultUniApply + (PLC.DefaultUniApply PLC.DefaultUniProtoPair PLC.DefaultUniInteger) + PLC.DefaultUniInteger + ) + (1, 2) + "fails:MkPair-1-2" + @| punsafeBuiltin PLC.MkPairData # (1 :: Term _ PInteger) # (2 :: Term _ PInteger) + @-> pfails + describe "uplc-misc" . pgoldenSpec $ do + "perror" @| perror @-> pfails + "perror.arg" @| perror # (1 :: Term s PInteger) @-> pfails + "laziness" @\ do + "f.d" @| (pforce . pdelay $ (0 :: Term s PInteger)) + "d.f.d" @| (pdelay . pforce . pdelay $ (0 :: Term s PInteger)) + "hoist" @\ do + -- hoist id 0 => 0 + "id.0" @| phoistAcyclic $ plam $ \x -> x # (0 :: Term s PInteger) + -- hoist fstPair => fstPair + "fstPair" @| phoistAcyclic (punsafeBuiltin PLC.FstPair) diff --git a/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs new file mode 100644 index 000000000..534b8168a --- /dev/null +++ b/plutarch-test/plutarch-base/Plutarch/UnitSpec.hs @@ -0,0 +1,16 @@ +module Plutarch.UnitSpec (spec) where + +import Plutarch +import Plutarch.Prelude +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = do + describe "unit" . pgoldenSpec $ do + "pcon" @| pcon PUnit + "pmatch" @| pmatch (pcon PUnit) (\case PUnit -> pcon PTrue) @-> passert + "compare" @\ do + "==" @| pcon PUnit #== pcon PUnit @-> passert + "<" @| pcon PUnit #< pcon PUnit @-> passertNot + "<=" @| pcon PUnit #<= pcon PUnit @-> passert diff --git a/plutarch-test/plutarch-extra/ExtraSpec.hs b/plutarch-test/plutarch-extra/ExtraSpec.hs new file mode 100644 index 000000000..25d177796 --- /dev/null +++ b/plutarch-test/plutarch-extra/ExtraSpec.hs @@ -0,0 +1,2 @@ +{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=ExtraSpec #-} +{-# OPTIONS_GHC -Wno-missing-export-lists #-} diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs new file mode 100644 index 000000000..2e5440097 --- /dev/null +++ b/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs @@ -0,0 +1,36 @@ +module Plutarch.ListUtilsSpec (spec) where + +import Plutarch.ListUtils (pcheckSorted, preverse) +import Plutarch.Prelude + +import Hedgehog (Property) +import Hedgehog.Internal.Property (propertyTest) +import Plutarch.Test +import Plutarch.Test.Property +import Plutarch.Test.Property.Gen (genInteger, genList) +import Test.Hspec (Spec, describe, it) +import Test.Hspec.Hedgehog (hedgehog) + +spec :: Spec +spec = do + describe "extra.listutils" $ do + describe "properties" $ do + describe "reverse" $ do + it "plutarch level reversing behaves like haskell level reversing" . hedgehog . propertyTest $ prop_preverseEquiv + pgoldenSpec $ do + "reverse" @\ do + "reverse_[1..5]" @| preverse # marshal [1 .. 5 :: Integer] + "isSorted" @\ do + "[1..10]" @| pcheckSorted # marshal [1 .. 10 :: Integer] @-> passert + "reverse_[1..10]" @| (pnot #$ pcheckSorted #$ marshal $ reverse [1 .. 10 :: Integer]) @-> passert + "reverse_[]" @| preverse # marshal ([] :: [Integer]) + +-- plutarch level reversing behaves like haskell level reversing +prop_preverseEquiv :: Property +prop_preverseEquiv = do + prop_haskEquiv + @( 'OnPEq) + @( 'TotalFun) + (reverse :: [Integer] -> [Integer]) + preverse + (genList genInteger :* Nil) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 5639f3328..095a5c693 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -34,6 +34,7 @@ common c FlexibleContexts FlexibleInstances ForeignFunctionInterface + FunctionalDependencies GADTSyntax GeneralisedNewtypeDeriving HexFloatLiterals @@ -73,16 +74,28 @@ common c common deps build-depends: - , aeson >=2.0 + , aeson >=2.0 , base , bytestring + , containers + , directory , filepath , generics-sop + , hedgehog + , hspec + , hspec-core + , hspec-discover + , hspec-golden + , hspec-hedgehog + , mtl , plutarch - , plutarch-benchmark + , plutarch-extra , plutus-core , plutus-ledger-api , plutus-tx + , quickcheck-instances + , serialise + , sop-core , tasty , tasty-hunit , tasty-quickcheck @@ -91,39 +104,89 @@ common deps library import: c, deps - hs-source-dirs: src - exposed-modules: Plutarch.Test + hs-source-dirs: common + exposed-modules: + Plutarch.Test + Plutarch.Test.Property + + other-modules: + Plutarch.Test.Benchmark + Plutarch.Test.Golden + Plutarch.Test.ListSyntax + Plutarch.Test.Property.Extra + Plutarch.Test.Property.Gen + Plutarch.Test.Property.HaskEquiv + Plutarch.Test.Property.Marshal + Plutarch.Test.Run + + if flag(development) + cpp-options: -DDevelopment executable plutarch-test import: c, deps - type: exitcode-stdio-1.0 main-is: Main.hs - hs-source-dirs: src + hs-source-dirs: plutarch-base plutarch-extra common conditional ./. + build-depends: + , base16-bytestring + , cborg + , containers + , plutarch-test + , rank2classes + , serialise + + if impl(ghc <9.0) + build-depends: + , plutus-tx-plugin + , shrinker + + other-modules: Plutarch.FFISpec if impl(ghc >=9.0) other-modules: Plutarch.FieldSpec Plutarch.MonadicSpec + Plutarch.TryFromSpec other-modules: + BaseSpec + ExtraSpec Plutarch.ApiSpec Plutarch.BoolSpec Plutarch.ByteStringSpec + Plutarch.EitherSpec Plutarch.IntegerSpec + Plutarch.LiftSpec Plutarch.ListSpec + Plutarch.ListUtilsSpec + Plutarch.MaybeSpec + Plutarch.PairSpec Plutarch.PIsDataSpec Plutarch.PLamSpec Plutarch.PlutusTypeSpec + Plutarch.POrdSpec Plutarch.RationalSpec + Plutarch.RecSpec Plutarch.RecursionSpec Plutarch.ScriptsSpec + Plutarch.ShowSpec + Plutarch.SpecTypes Plutarch.StringSpec Plutarch.Test + Plutarch.Test.Benchmark + Plutarch.Test.Golden + Plutarch.Test.ListSyntax + Plutarch.Test.Property + Plutarch.Test.Property.Extra + Plutarch.Test.Property.Gen + Plutarch.Test.Property.HaskEquiv + Plutarch.Test.Property.Marshal + Plutarch.Test.Run Plutarch.TraceSpec Plutarch.UnitSpec - Spec + Plutarch.UPLCSpec if flag(development) cpp-options: -DDevelopment - ghc-options: -threaded -rtsopts -with-rtsopts=-N + -- FIXME remove -Wwarn=deprecations + ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wwarn=deprecations diff --git a/plutarch-test/src/Main.hs b/plutarch-test/src/Main.hs deleted file mode 100644 index 9a040eda5..000000000 --- a/plutarch-test/src/Main.hs +++ /dev/null @@ -1,8 +0,0 @@ -module Main (main) where - -import GHC.IO.Encoding (setLocaleEncoding, utf8) - -main :: IO () -main = do - setLocaleEncoding utf8 - pure () diff --git a/plutarch-test/src/Plutarch/BoolSpec.hs b/plutarch-test/src/Plutarch/BoolSpec.hs deleted file mode 100644 index d7622df4d..000000000 --- a/plutarch-test/src/Plutarch/BoolSpec.hs +++ /dev/null @@ -1,62 +0,0 @@ -module Plutarch.BoolSpec (spec) where - -import Plutarch -import Plutarch.Bool (PBool (PFalse, PTrue), pand, pnot, por, (#&&), (#||)) -import Plutarch.Test - -spec :: Spec -spec = do - describe "bool" $ do - describe "pnot" $ do - goldens - All - [ ("lam", popaque pnot) - , ("app", popaque $ pnot #$ pcon PTrue) - ] - it "true" $ (pnot #$ pcon PTrue) #@?= pcon PFalse - it "false" $ (pnot #$ pcon PFalse) #@?= pcon PTrue - describe "pand" $ do - goldens - All - [ ("tf", pcon PTrue #&& pcon PFalse) - , ("ft", pcon PFalse #&& pcon PTrue) - , ("tt", pcon PTrue #&& pcon PTrue) - , ("ff", pcon PFalse #&& pcon PFalse) - ] - it "tf" $ (pcon PTrue #&& pcon PFalse) #@?= pcon PFalse - it "ft" $ (pcon PFalse #&& pcon PTrue) #@?= pcon PFalse - it "tt" $ (pcon PTrue #&& pcon PTrue) #@?= pcon PTrue - it "ff" $ (pcon PFalse #&& pcon PFalse) #@?= pcon PFalse - describe "laziness" $ do - let p1 = pand # pcon PFalse # pdelay perror - p2 = pcon PFalse #&& perror - goldens All [("pand", popaque p1), ("op", popaque p2)] - it "pand" $ passert $ pnot # pforce p1 - it "op" $ passert $ pnot # p2 - it "pand.perror" $ do - pfails $ pand # pcon PFalse # perror - pfails $ pand # pcon PTrue # perror - pfails $ pcon PTrue #&& perror - describe "por" $ do - goldens - All - [ ("tf", pcon PTrue #|| pcon PFalse) - , ("ft", pcon PFalse #|| pcon PTrue) - , ("tt", pcon PTrue #|| pcon PTrue) - , ("ff", pcon PFalse #|| pcon PFalse) - ] - it "tf" $ (pcon PTrue #|| pcon PFalse) #@?= pcon PTrue - it "ft" $ (pcon PFalse #|| pcon PTrue) #@?= pcon PTrue - it "tt" $ (pcon PTrue #|| pcon PTrue) #@?= pcon PTrue - it "ff" $ (pcon PFalse #|| pcon PFalse) #@?= pcon PFalse - describe "laziness" $ do - let p1 = por # pcon PTrue # pdelay perror - p2 = pcon PTrue #|| perror - goldens All [("por", popaque p1), ("op", popaque p2)] - it "por" $ passert $ pforce p1 - it "op" $ passert p2 - it "pand.perror" $ do - pfails $ por # pcon PFalse # perror - pfails $ por # pcon PTrue # perror - passert $ pcon PTrue #|| perror - pfails $ pcon PFalse #|| perror diff --git a/plutarch-test/src/Plutarch/ByteStringSpec.hs b/plutarch-test/src/Plutarch/ByteStringSpec.hs deleted file mode 100644 index ad2bb6336..000000000 --- a/plutarch-test/src/Plutarch/ByteStringSpec.hs +++ /dev/null @@ -1,54 +0,0 @@ -module Plutarch.ByteStringSpec (spec) where - -import qualified Data.ByteString as BS -import Plutarch.Prelude -import Plutarch.Test - -spec :: Spec -spec = do - describe "bytestring" $ do - it "empty" $ - passert $ mempty #== phexByteStr "" - describe "phexByteStr" $ do - let a :: [String] = ["42", "ab", "df", "c9"] - p = pconstant @PByteString (BS.pack $ map readByte a) #== phexByteStr (concat a) - golden Bench p - it "relation" $ passert p - describe "plengthByteStr" $ do - let p = (plengthBS # phexByteStr "012f") #== 2 - golden All p - it "works" $ passert p - describe "pconsBS" $ do - let xs = phexByteStr "48fCd1" - p = (plengthBS #$ pconsBS # 91 # xs) #== (1 + plengthBS # xs) - golden All p - it "works" $ passert p - describe "pindexByteStr" $ do - let p = (pindexBS # phexByteStr "4102af" # 1) #== pconstant @PInteger 0x02 - golden All p - it "works" $ passert p - describe "psliceByteStr" $ do - let p = (psliceBS # 2 # 3 # phexByteStr "4102afde5b2a") #== phexByteStr "afde5b" - golden All p - it "works" $ passert p - describe "eq" $ do - let p = phexByteStr "12" #== phexByteStr "12" - golden All p - it "works" $ passert p - describe "semigroup" $ do - let s1 = phexByteStr "12" - s2 = phexByteStr "34" - golden All $ s1 <> s2 - it "laws" $ do - passert $ (mempty <> s1) #== s1 - passert $ s1 #== (mempty <> s1) - it "concats" $ do - passert $ s1 <> s2 #== phexByteStr "1234" - -{- | Interpret a byte. - ->>> readByte "41" -65 --} -readByte :: Num a => String -> a -readByte a = fromInteger $ read $ "0x" <> a diff --git a/plutarch-test/src/Plutarch/ListSpec.hs b/plutarch-test/src/Plutarch/ListSpec.hs deleted file mode 100644 index fc81dfc40..000000000 --- a/plutarch-test/src/Plutarch/ListSpec.hs +++ /dev/null @@ -1,63 +0,0 @@ -module Plutarch.ListSpec (spec) where - -import Plutarch.List (pconvertLists, pfoldl') -import Plutarch.Prelude -import Plutarch.Test - -integerList :: [Integer] -> Term s (PList PInteger) -integerList xs = pconvertLists #$ pconstant @(PBuiltinList PInteger) xs - -spec :: Spec -spec = do - describe "list" $ do - let xs10 :: Term _ (PList PInteger) - xs10 = integerList [1 .. 10] - describe "pmatch" $ do - let p = pmatch (integerList [1, 3, 1]) $ \_ -> perror - golden PrintTerm p - describe "phead" $ do - let p = phead # xs10 - golden All p - it "works" $ passert $ p #== 1 - describe "ptail" $ do - let p = ptail # xs10 - golden All p - it "works" $ passert $ p #== integerList [2 .. 10] - describe "pnull" $ do - let p0 = pnull # integerList [] - p1 = pnull # xs10 - goldens All [("p0", p0), ("p1", p1)] - it "empty" $ passert p0 - it "nonempty" $ passert $ pnot # p1 - describe "pconcat" $ do - describe "identity" $ do - let xs :: Term s (PList PInteger) - xs = psingleton # (fromInteger @(Term _ PInteger) 0) - p = pconcat # xs # pnil - golden All p - it "works" $ passert $ p #== xs - describe "pmap" $ do - let p = pmap # (plam $ \x -> x + x) # xs10 - golden All p - it "eg" $ passert $ p #== (integerList $ fmap (* 2) [1 .. 10]) - it "identity" $ passert $ pmap @PList # (plam $ \(x :: Term _ PInteger) -> x) # pnil #== pnil - describe "pfilter" $ do - let p1 = pfilter # (plam $ \x -> pmod # x # 2 #== 0) # xs10 - p2 = pfilter # (plam $ \x -> 5 #< x) # xs10 - goldens All [("p1", p1), ("p2", p2)] - it "p1" $ passert $ p1 #== integerList [2, 4, 6, 8, 10] - it "p2" $ passert $ p2 #== integerList [6 .. 10] - describe "pzipWith" $ do - let p = pzipWith' (+) # xs10 # xs10 - golden All p - it "works" $ passert $ p #== integerList (fmap (* 2) [1 .. 10]) - describe "pfoldl" $ do - let p1 = pfoldl # plam (-) # 0 # xs10 - p1' = pfoldl' (-) # 0 # xs10 - p2 = pfoldl # plam (-) # 0 # integerList [] - p2' = pfoldl' (-) # 0 # integerList [] - goldens All [("p1", p1), ("p1'", p1'), ("p2", p2), ("p2'", p2)] - it "nonempty" $ passert $ p1 #== pconstant (foldl (-) 0 [1 .. 10]) - it "nonempty'" $ passert $ p1' #== pconstant (foldl (-) 0 [1 .. 10]) - it "empty" $ passert $ p2 #== pconstant 0 - it "empty'" $ passert $ p2' #== pconstant 0 diff --git a/plutarch-test/src/Plutarch/MonadicSpec.hs b/plutarch-test/src/Plutarch/MonadicSpec.hs deleted file mode 100644 index b62bb8fd4..000000000 --- a/plutarch-test/src/Plutarch/MonadicSpec.hs +++ /dev/null @@ -1,55 +0,0 @@ -{-# LANGUAGE OverloadedRecordDot #-} -{-# LANGUAGE QualifiedDo #-} - -module Plutarch.MonadicSpec (spec) where - -import Plutus.V1.Ledger.Api - -import Plutarch.Api.V1 ( - PAddress (PAddress), - PCredential, - PMaybeData, - PPubKeyHash, - PScriptContext, - PScriptPurpose (PSpending), - PStakingCredential, - ) -import qualified Plutarch.ApiSpec as ApiSpec -import qualified Plutarch.Monadic as P -import Plutarch.Prelude -import Plutarch.Test - -spec :: Spec -spec = do - describe "monadic" $ do - describe "api.example" $ do - -- The checkSignatory family of functions implicitly use tracing due to - -- monadic syntax, and as such we need two sets of tests here. - describe "signatory" . plutarchDevFlagDescribe $ do - let aSig :: PubKeyHash = "ab01fe235c" - describe "haskell" $ do - let p = checkSignatory # pconstant aSig # ApiSpec.ctx - pe = checkSignatory # pconstant "41" # ApiSpec.ctx - golden All p - it "succeeds" $ psucceeds p - it "fails" $ pfails pe - describe "getFields" $ - golden All getFields - -checkSignatory :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) -checkSignatory = plam $ \ph ctx' -> - pletFields @["txInfo", "purpose"] ctx' $ \ctx -> P.do - PSpending _ <- pmatch $ ctx.purpose - let signatories = pfield @"signatories" # ctx.txInfo - pif - (pelem # pdata ph # pfromData signatories) - -- Success! - (pconstant ()) - -- Signature not present. - perror - -getFields :: Term s (PAddress :--> PDataRecord '["credential" ':= PCredential, "stakingCredential" ':= PMaybeData PStakingCredential]) -getFields = phoistAcyclic $ - plam $ \addr -> P.do - PAddress addrFields <- pmatch addr - addrFields diff --git a/plutarch-test/src/Plutarch/PIsDataSpec.hs b/plutarch-test/src/Plutarch/PIsDataSpec.hs deleted file mode 100644 index 2bc7a302b..000000000 --- a/plutarch-test/src/Plutarch/PIsDataSpec.hs +++ /dev/null @@ -1,102 +0,0 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} - -module Plutarch.PIsDataSpec (spec) where - -import Data.Text.Encoding (encodeUtf8) - -import Plutarch.Api.V1 -import Plutarch.Api.V1.Tuple (pbuiltinPairFromTuple, ptupleFromBuiltin) -import Plutarch.Builtin (pforgetData, ppairDataBuiltin) -import Plutarch.Lift (PLifted) -import Plutarch.Prelude - -import Plutus.V1.Ledger.Credential (Credential (ScriptCredential)) -import qualified PlutusTx - -import Plutarch.Test -import Test.Tasty.QuickCheck (Arbitrary, property) - -spec :: Spec -spec = do - describe "pisdata" $ do - propertySet @PBool "PBool" - propertySet @PInteger "PInteger" - propertySet @PUnit "PUnit" - describe "ppair" $ do - describe "pfromData (pdata (I 1, B 0x41)) ≡ (I 1, I 2)" $ do - let p :: Term s (PBuiltinPair (PAsData PInteger) (PAsData PByteString)) - p = - ppairDataBuiltin # pconstantData @PInteger 1 - -- ByteString doesn't have a ToData instance - can't use pconstantData.... - #$ pdata - $ pconstant $ encodeUtf8 "A" - it "works" $ pfromData (pdata p) #@?= p - describe "pfromData (pdata (PTxId 0x41, PScriptCredential 0x82)) ≡ (PTxId 0x41, PScriptCredential 0x82)" $ do - let p = - ppairDataBuiltin - # pconstantData @PTxId "41" #$ pconstantData - $ ScriptCredential "82" - it "works" $ pfromData (pdata p) #@?= p - describe "ptuple isomorphism" $ do - let p = - ppairDataBuiltin - # pconstantData @PTxId "41" #$ pconstantData - $ ScriptCredential "82" - tup = pdata $ ptuple # pconstantData @PTxId "41" #$ pconstantData $ ScriptCredential "82" - it "works" $ pforgetData (pdata p) #@?= pforgetData tup - it "works" $ pfromData (pbuiltinPairFromTuple tup) #@?= p - it "works" $ ptupleFromBuiltin (pdata p) #@?= tup - -propertySet :: - forall p. - ( PIsData p - , PLift p - , PlutusTx.ToData (PLifted p) - , PlutusTx.FromData (PLifted p) - , Eq (PLifted p) - , Show (PLifted p) - , Arbitrary (PLifted p) - ) => - String -> - Spec -propertySet typeName = do - describe typeName $ do - specify ("x ~ " <> typeName <> ": pfromData (pdata x) ≡ x") $ - property $ ptoFromEqual @p - specify ("x ~ " <> typeName <> ": pfromData (PlutusTx.toData x) ≡ x") $ - property $ pfromDataCompat @p - specify ("x ~ " <> typeName <> ": PlutusTx.fromData (pdata x) ≡ Just x") $ - property $ pdataCompat @p - -ptoFromEqual :: - forall p. - ( PIsData p - , PLift p - ) => - PLifted p -> - _ -ptoFromEqual t = pfromData (pdata $ pconstant @p t) `pshouldBe` pconstant @p t - -pfromDataCompat :: - forall p. - ( PIsData p - , PlutusTx.ToData (PLifted p) - , PLift p - , Eq (PLifted p) - , Show (PLifted p) - ) => - PLifted p -> - IO () -pfromDataCompat x = plift (pfromData $ pconstantData @p x) `shouldBe` x - -pdataCompat :: - forall p. - ( PLift p - , PIsData p - , PlutusTx.FromData (PLifted p) - , Eq (PLifted p) - , Show (PLifted p) - ) => - PLifted p -> - IO () -pdataCompat x = PlutusTx.fromData @(PLifted p) (plift $ pforgetData $ pdata $ pconstant @p x) `shouldBe` Just x diff --git a/plutarch-test/src/Plutarch/PLamSpec.hs b/plutarch-test/src/Plutarch/PLamSpec.hs deleted file mode 100644 index 4d387c894..000000000 --- a/plutarch-test/src/Plutarch/PLamSpec.hs +++ /dev/null @@ -1,14 +0,0 @@ -module Plutarch.PLamSpec (spec) where - -import Plutarch -import Plutarch.Test - -spec :: Spec -spec = do - describe "plam" $ do - describe "id" $ do - golden PrintTerm $ plam (\x -> x) - describe "flip.const" $ do - golden PrintTerm $ plam (\_ y -> y) - describe "plet" $ do - golden PrintTerm $ plam (\x _ -> plet x $ \_ -> perror) diff --git a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs b/plutarch-test/src/Plutarch/PlutusTypeSpec.hs deleted file mode 100644 index 0f3319f5c..000000000 --- a/plutarch-test/src/Plutarch/PlutusTypeSpec.hs +++ /dev/null @@ -1,74 +0,0 @@ -{-# LANGUAGE CPP #-} - -module Plutarch.PlutusTypeSpec (spec) where - -import Plutarch -import Plutarch.Prelude - -import Plutarch.Test - -spec :: Spec -spec = do - describe "plutustype" $ do - describe "example" $ do - describe "A encoded as 0" $ do - let p :: Term s PInteger - p = 0 - it "works" (pcon A #@?= p) - describe "B encoded as 1" $ do - let p :: Term s PInteger - p = 1 - it "works" $ pcon B #@?= p - describe "swap A == B" $ do - it "works" $ swap (pcon A) #@?= pcon B - describe "swap B == A" $ do - it "works" $ swap (pcon B) #@?= pcon A - describe "instances-sanity" $ do - plutarchDevFlagDescribe $ do - it "PBuiltinList" $ do - pmatchTargetEval $ pconstant [1 :: Integer, 2, 3, 4] - --- | Make sure the target of 'pmatch' is only evaluated once. -pmatchTargetEval :: PlutusType p => ClosedTerm p -> Expectation -pmatchTargetEval target = - pmatch (ptrace (pconstant tag) target) (\x -> plet (pcon x) $ \_ -> pconstant ()) - `ptraces` replicate 1 tag - where - tag = "evaluating" - -{- TODO: - - move over the testcase with pmatchTargetEval - - add more sanity checks -describe "sanity checks" $ do - describe "PBuiltinList" $ do - let p :: Term s (PBuiltinList PInteger) - p = pconstant [1,2,3,4] - it "works" $ - -} - -{- | - A Sum type, which can be encoded as an Enum --} -data AB (s :: S) = A | B - -{- | - AB is encoded as an Enum, using values of PInteger - internally. --} -instance PlutusType AB where - type PInner AB _ = PInteger - - pcon' A = 0 - pcon' B = 1 - - pmatch' x f = - pif (x #== 0) (f A) (f B) - -{- | - Instead of using `pcon'` and `pmatch'` directly, - use 'pcon' and 'pmatch', to hide the `PInner` type. --} -swap :: Term s AB -> Term s AB -swap x = pmatch x $ \case - A -> pcon B - B -> pcon A diff --git a/plutarch-test/src/Plutarch/RationalSpec.hs b/plutarch-test/src/Plutarch/RationalSpec.hs deleted file mode 100644 index 5acff7efe..000000000 --- a/plutarch-test/src/Plutarch/RationalSpec.hs +++ /dev/null @@ -1,62 +0,0 @@ -module Plutarch.RationalSpec (spec) where - -import Plutarch.Prelude -import Plutarch.Rational (pproperFraction, ptruncate) -import Plutarch.Test - -spec :: Spec -spec = do - describe "rational" $ do - describe "literal" $ do - let p = 0.5 :: Term s PRational - golden PrintTerm p - describe "ops" $ do - let p1 = (1 / 2 + 1 / 2) :: Term s PRational - p2 = 1 / 2 - 1 / 3 :: Term s PRational - p3 = (1 - 3 / 2) * (2 - 5 / 2) :: Term s PRational - goldens - All - [ ("+", p1) - , ("-", p2) - , ("*", p3) - ] - it "+" $ passert $ p1 #== 1 - it "-" $ passert $ p2 #== 1 / 6 - it "*" $ passert $ p3 #== 1 / 4 - it "harmonic-sum" $ - passert $ 1 / 2 + 1 / 3 + 1 / 4 + 1 / 5 #== (77 / 60 :: Term s PRational) - it "multi-product" $ - passert $ 1 / 2 * 2 / 3 * 3 / 4 * 4 / 5 * 5 / 6 #== (1 / 6 :: Term s PRational) - describe "compare" $ do - let p1 = 2 / 9 #< (3 / 10 :: Term s PRational) - goldens All [("<", p1)] - it "<" $ passert p1 - describe "round" $ do - -- NOTE: These will eventually be replaced by property tests. - it "5/3" $ passert $ pround # (5 / 3) #== 2 - it "4/3" $ passert $ pround # (4 / 3) #== 1 - it "-5/2" $ passert $ pround # (-5 / 2) #== -2 - it "-1/4" $ passert $ pround # (-1 / 4) #== 0 - describe "truncate" $ do - it "5/4" $ passert $ ptruncate # (5 / 4) #== 1 - it "7/4" $ passert $ ptruncate # (7 / 4) #== 1 - it "1/4" $ passert $ ptruncate # (1 / 4) #== 0 - it "-7/4" $ passert $ ptruncate # (-7 / 4) #== -1 - describe "properFraction" $ do - it "-1/2" $ - passert $ - pmatch (pproperFraction # (-1 / 2)) $ \(PPair x y) -> - x #== 0 #&& y #== (-1 / 2) - it "-3/2" $ - passert $ - pmatch (pproperFraction # (-3 / 2)) $ \(PPair x y) -> - x #== -1 #&& y #== (-1 / 2) - it "-4/3" $ - passert $ - pmatch (pproperFraction # (-4 / 3)) $ \(PPair x y) -> - x #== -1 #&& y #== (-1 / 3) - describe "data" $ do - describe "id" $ do - it "0.5" $ passert $ (0.5 :: Term s PRational) #== pfromData (pdata 0.5) - it "2" $ passert $ (2 :: Term s PRational) #== pfromData (pdata 2) - it "11/3" $ passert $ (11 / 3 :: Term s PRational) #== pfromData (pdata $ 11 / 3) diff --git a/plutarch-test/src/Plutarch/StringSpec.hs b/plutarch-test/src/Plutarch/StringSpec.hs deleted file mode 100644 index 55a866d25..000000000 --- a/plutarch-test/src/Plutarch/StringSpec.hs +++ /dev/null @@ -1,23 +0,0 @@ -module Plutarch.StringSpec (spec) where - -import Plutarch.Prelude -import Plutarch.Test - -spec :: Spec -spec = do - describe "str" $ do - describe "eq" $ do - let p = "foo" #== pconstant @PString "foo" - golden All p - it "works" $ passert p - describe "semigroup" $ do - let s1 = pconstant @PString "foo" - s2 = pconstant @PString "bar" - golden All $ s1 <> s2 - it "laws" $ do - passert $ (mempty <> s1) #== s1 - passert $ s1 #== (mempty <> s1) - it "concats" $ do - passert $ s1 <> s2 #== pconstant @PString "foobar" - it "mempty" $ do - passert $ mempty #== pconstant @PString "" diff --git a/plutarch-test/src/Plutarch/Test.hs b/plutarch-test/src/Plutarch/Test.hs deleted file mode 100644 index 7993c2e79..000000000 --- a/plutarch-test/src/Plutarch/Test.hs +++ /dev/null @@ -1,199 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE ImpredicativeTypes #-} - --- | Common functions for testing Plutarch code -module Plutarch.Test ( - -- | Plutarch specific `Expectation` operators - passert, - pfails, - psucceeds, - ptraces, - pshouldBe, - (#@?=), - plutarchDevFlagDescribe, - -- | Golden testing - -- - -- Typically you want to use `golden`. For grouping multiple goldens, use - -- `goldens`. - golden, - goldens, - PlutarchGolden (All, Bench, PrintTerm), - getGoldenFilePrefix, - goldenFilePath, -) where - -import Control.Monad (when) -import qualified Data.Aeson.Text as Aeson -import Data.Kind (Type) -import Data.Text (Text) -import qualified Data.Text as T -import qualified Data.Text.Lazy as TL -import System.FilePath - -import Plutarch -import Plutarch.Benchmark (benchmarkScript') -import Plutarch.Bool (PBool (PTrue)) -import Plutarch.Evaluate (evaluateScript) -import qualified Plutus.V1.Ledger.Scripts as Scripts - -{- | - Like `shouldBe` but but for Plutarch terms --} -pshouldBe :: ClosedTerm a -> ClosedTerm b -> Expectation -pshouldBe x y = do - p1 <- fmap printScript $ eval $ compile x - p2 <- fmap printScript $ eval $ compile y - p1 `shouldBe` p2 - where - eval :: Scripts.Script -> IO Scripts.Script - eval s = case evaluateScript s of - Left e -> expectationFailure $ "Script evaluation failed: " <> show e - Right (_, _, x') -> pure x' - -{- Like `@?=` but for Plutarch terms -} -(#@?=) :: ClosedTerm a -> ClosedTerm b -> Expectation -(#@?=) = pshouldBe - -{- Asserts the term to be true -} -passert :: ClosedTerm a -> Expectation -passert p = p #@?= pcon PTrue - -{- Asserts the term evaluates successfully without failing -} -psucceeds :: ClosedTerm a -> Expectation -psucceeds p = - case evaluateScript (compile p) of - Left _ -> expectationFailure $ "Term failed to evaluate" - Right _ -> pure () - -{- Like `printTerm` but evaluates the term beforehand. - - All evaluation failures are treated as equivalent to a `perror`. Plutus does - not provide an accurate way to tell if the program evalutes to `Error` or not; - see https://github.com/input-output-hk/plutus/issues/4270 - --} -printTermEvaluated :: ClosedTerm a -> String -printTermEvaluated p = - case evaluateScript (compile p) of - Left _ -> printTerm perror - Right (_, _, x) -> printScript x - -{- | Asserts that the term evaluates successfully with the given trace sequence - - See also: `plutarchDevFlagDescribe` --} -ptraces :: ClosedTerm a -> [Text] -> Expectation -ptraces p develTraces = - case evaluateScript (compile p) of - Left _ -> expectationFailure $ "Term failed to evaluate" - Right (_, traceLog, _) -> do -#ifdef Development - traceLog `shouldBe` develTraces -#else - -- Tracing is disabled in non-developed modes, so we should expect an - -- empty trace log. - let noTraces = const [] develTraces - traceLog `shouldBe` noTraces -#endif - -{- | Like `describe`, but determines description from `Development` CPP flag - - Useful to create two sets of othersise identical group of tests that differ - only by `Development` flag. This has the effect of creating two sets of golden - tests (with different filepaths) for corresponding flag values. - - Typically meant to be used in conjunction with `ptraces`. --} -plutarchDevFlagDescribe :: forall (outers :: [Type]) inner. TestDefM outers inner () -> TestDefM outers inner () - --- CPP support isn't great in fourmolu. -{- ORMOLU_DISABLE -} -plutarchDevFlagDescribe m = -#ifdef Development - describe "dev=true" m -#else - describe "dev=false" m -#endif -{- ORMOLU_ENABLE -} - -{- Asserts the term evaluates without success -} -pfails :: ClosedTerm a -> Expectation -pfails p = do - case evaluateScript (compile p) of - Left _ -> pure () - Right _ -> expectationFailure $ "Term succeeded" - -{- Whether to run all or a particular golden test - - Typically you want to use `All` -- this produces printTerm and benchmark - goldens. - - Occasionally you want `PrintTerm` because you don't care to benchmark that - program. - - Use `Bench` to only benchmark the program. --} -data PlutarchGolden - = All - | Bench - | PrintTerm - deriving stock (Eq, Show) - -hasBenchGolden :: PlutarchGolden -> Bool -hasBenchGolden = \case - PrintTerm -> False - _ -> True - -hasPrintTermGolden :: PlutarchGolden -> Bool -hasPrintTermGolden = \case - Bench -> False - _ -> True - -{- Run golden tests on the given Plutarch program -} -golden :: PlutarchGolden -> ClosedTerm a -> Spec -golden pg p = - goldens pg [("0", popaque p)] - -{- | Like `golden` but for multiple programs - - Multiple programs use a single golden file. Each output separated from the - keyword with a space. --} -goldens :: PlutarchGolden -> [(String, ClosedTerm a)] -> Spec -goldens pg ps = do - name <- getGoldenFilePrefix - describe "golden" $ do - -- Golden test for UPLC - when (hasPrintTermGolden pg) $ do - it "uplc" $ - pureGoldenTextFile (goldenFilePath "goldens" name "uplc") $ - multiGolden ps $ \p -> - T.pack $ printTerm p - it "uplc.eval" $ - let evaluateds = flip fmap ps $ \(s, p) -> (s, printTermEvaluated p) - in pureGoldenTextFile (goldenFilePath "goldens" name "uplc.eval") $ - multiGolden evaluateds T.pack - -- Golden test for Plutus benchmarks - when (hasBenchGolden pg) $ - it "bench" $ - pureGoldenTextFile (goldenFilePath "goldens" name "bench") $ - multiGolden ps $ \p -> - TL.toStrict $ Aeson.encodeToLazyText $ benchmarkScript' $ compile p - --- | Get a golden filename prefix from the test description path -getGoldenFilePrefix :: - forall (outers :: [Type]) (inner :: Type). - TestDefM outers inner String -getGoldenFilePrefix = - T.unpack . T.intercalate "." . drop 1 . reverse <$> getTestDescriptionPath - --- | Get the golden file name given the basepath, an optional suffix and a name -goldenFilePath :: FilePath -> String -> String -> FilePath -goldenFilePath base name suffix = - base - (name <> "." <> suffix <> ".golden") - -multiGolden :: forall a. [(String, a)] -> (a -> T.Text) -> Text -multiGolden xs f = - T.intercalate "\n" $ - (\(s, x) -> T.pack s <> " " <> f x) <$> xs diff --git a/plutarch-test/src/Plutarch/TraceSpec.hs b/plutarch-test/src/Plutarch/TraceSpec.hs deleted file mode 100644 index 4b312dcb1..000000000 --- a/plutarch-test/src/Plutarch/TraceSpec.hs +++ /dev/null @@ -1,48 +0,0 @@ -module Plutarch.TraceSpec (spec) where - -import Plutarch.Prelude -import Plutarch.Test - -spec :: Spec -spec = do - describe "trace" . plutarchDevFlagDescribe $ do - describe "ptrace" $ do - let p1 = ptrace "foo" (pcon PUnit) - p2 = ptrace "foo" (ptrace "bar" (pcon PUnit)) - goldens - All - [ ("one", p1) - , ("two", p2) - ] - it "traces one" $ p1 `ptraces` ["foo"] - it "traces two" $ p2 `ptraces` ["foo", "bar"] - describe "ptraceIfTrue" $ do - let p1 = ptraceIfTrue "foo" (pcon PTrue) - p2 = ptraceIfTrue "foo" (pcon PFalse) - goldens - All - [ ("true", p1) - , ("false", p2) - ] - it "true" $ p1 `ptraces` ["foo"] - it "false" $ p2 `ptraces` [] - describe "ptraceIfFalse" $ do - let p1 = ptraceIfFalse "foo" (pcon PTrue) - p2 = ptraceIfFalse "foo" (pcon PFalse) - goldens - All - [ ("true", p1) - , ("false", p2) - ] - it "true" $ p1 `ptraces` [] - it "false" $ p2 `ptraces` ["foo"] - describe "more traces" $ do - it "false.true.false" $ - ptraceIfFalse "foo" (ptraceIfTrue "bar" $ pcon PFalse) - `ptraces` ["foo"] - it "ptrace.true.false" $ - ptrace "foo" (ptraceIfTrue "bar" $ pcon PFalse) - `ptraces` ["foo"] - it "ptrace.true.true" $ - ptrace "foo" (ptraceIfTrue "bar" $ pcon PTrue) - `ptraces` ["foo", "bar"] diff --git a/plutarch-test/src/Plutarch/UnitSpec.hs b/plutarch-test/src/Plutarch/UnitSpec.hs deleted file mode 100644 index 45cc96c98..000000000 --- a/plutarch-test/src/Plutarch/UnitSpec.hs +++ /dev/null @@ -1,28 +0,0 @@ -module Plutarch.UnitSpec (spec) where - -import Plutarch -import Plutarch.Prelude -import Plutarch.Test - -spec :: Spec -spec = do - describe "unit" $ do - describe "pcon" $ do - golden All $ pcon PUnit - describe "pmatch" $ do - let p = pmatch (pcon PUnit) (\case PUnit -> pcon PTrue) - golden All p - it "works" $ passert p - describe "compare" $ do - let pEq = pcon PUnit #== pcon PUnit - pLt = pcon PUnit #< pcon PUnit - pLe = pcon PUnit #<= pcon PUnit - goldens - All - [ ("==", pEq) - , ("<", pLt) - , ("<=", pLe) - ] - it "==" $ passert pEq - it "<" $ passert $ pnot # pLt - it "<=" $ passert pLe diff --git a/plutarch.cabal b/plutarch.cabal index 192d8d27e..eb888f62d 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -100,13 +100,14 @@ library Plutarch.DataRepr.Internal Plutarch.DataRepr.Internal.Field Plutarch.DataRepr.Internal.FromData - Plutarch.DataRepr.Internal.Generic Plutarch.DataRepr.Internal.HList Plutarch.DataRepr.Internal.HList.Utils Plutarch.Either Plutarch.Evaluate + Plutarch.FFI Plutarch.Integer Plutarch.Internal + Plutarch.Internal.Generic Plutarch.Internal.Other Plutarch.Internal.PLam Plutarch.Internal.PlutusType @@ -120,9 +121,12 @@ library Plutarch.Rational Plutarch.Rec Plutarch.Rec.TH + Plutarch.Reducible + Plutarch.Show Plutarch.String Plutarch.TermCont Plutarch.Trace + Plutarch.TryFrom Plutarch.Unit Plutarch.Unsafe @@ -135,6 +139,7 @@ library , flat , generics-sop , hashable + , lens , memory , mtl , plutus-core @@ -149,41 +154,3 @@ library if flag(development) cpp-options: -DDevelopment - --- Everything below this line is deleted for GHC 8.10 - -test-suite examples - import: c - type: exitcode-stdio-1.0 - main-is: Main.hs - hs-source-dirs: examples - default-extensions: - OverloadedRecordDot - QualifiedDo - - other-modules: - Examples.ConstrData - Examples.LetRec - Examples.Lift - Utils - - build-depends: - , aeson - , base - , bytestring - , generics-sop - , plutarch - , plutus-core - , plutus-ledger-api - , plutus-tx - , rank2classes >=1.4.4 - , serialise - , tasty - , tasty-golden - , tasty-hunit - , text - , transformers - - --, shrinker - if flag(development) - cpp-options: -DDevelopment From 2b11be185ca4601d11141852401847b08faa6c1b Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Apr 2022 14:35:44 +0530 Subject: [PATCH 307/584] Minor refinement --- Plutarch/DataRepr/Internal.hs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 8bd4fe289..300352287 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -110,15 +110,12 @@ data PDataRecord (as :: [PLabeledType]) (s :: S) where instance {-# OVERLAPPABLE #-} PlutusType (PDataRecord l) where type PInner (PDataRecord l) _ = PBuiltinList PData pcon' (PDCons x xs) = pcons # pforgetData x # pto xs - pcon' PDNil = pnil + pcon' PDNil = pnil pmatch' _ _ = undefined -- FIXME instance PlutusType (PDataRecord ((name ':= x) ': xs)) where type PInner (PDataRecord ((name ':= x) ': xs)) _ = PBuiltinList PData - pcon' (PDCons x xs) = pto result - where - result :: Term _ (PDataRecord ((name ':= x) ': xs)) - result = pdcons # x # xs + pcon' (PDCons x xs) = pcons # pforgetData x # pto xs pmatch' l' f = plet l' $ \l -> let x :: Term _ (PAsData x) x = punsafeCoerce $ phead # l @@ -377,11 +374,11 @@ instance mkSOP :: NP (Term s) r -> SOP (Term s) (PCode s a) mkSOP = SOP . mkSum @_ @n @pcode -newtype DualReprHandler s out def = LTRepr (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s out) +newtype DualReprHandler s out def = DualRepr (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s out) -- | Optimized dual pmatch specialized for lexicographic '#<' and '#<=' implementations. pmatchLT :: Term s (PDataSum defs) -> Term s (PDataSum defs) -> NP (DualReprHandler s PBool) defs -> Term s PBool -pmatchLT d1 d2 (LTRepr handler :* Nil) = handler (punDataSum # d1) (punDataSum # d2) +pmatchLT d1 d2 (DualRepr handler :* Nil) = handler (punDataSum # d1) (punDataSum # d2) pmatchLT d1 d2 handlers = unTermCont $ do a <- tcont . plet $ pasConstr #$ pforgetData $ pdata d1 b <- tcont . plet $ pasConstr #$ pforgetData $ pdata d2 @@ -413,7 +410,7 @@ pmatchLT d1 d2 handlers = unTermCont $ do NP (DualReprHandler s PBool) defs -> [Term s PBool] applyHandlers _ _ Nil = [] - applyHandlers args1 args2 (LTRepr handler :* rest) = + applyHandlers args1 args2 (DualRepr handler :* rest) = handler (punsafeCoerce args1) (punsafeCoerce args2) : applyHandlers args1 args2 rest @@ -454,7 +451,7 @@ mkLTHandler = cana_NP (Proxy @(Compose POrd PDataRecord)) rer $ Const () Compose POrd PDataRecord y => Const () (y : ys) -> (DualReprHandler s PBool y, Const () ys) - rer _ = (LTRepr (#<), Const ()) + rer _ = (DualRepr (#<), Const ()) mkLTEHandler :: forall def s. All (Compose POrd PDataRecord) def => NP (DualReprHandler s PBool) def mkLTEHandler = cana_NP (Proxy @(Compose POrd PDataRecord)) rer $ Const () @@ -464,7 +461,7 @@ mkLTEHandler = cana_NP (Proxy @(Compose POrd PDataRecord)) rer $ Const () Compose POrd PDataRecord y => Const () (y : ys) -> (DualReprHandler s PBool y, Const () ys) - rer _ = (LTRepr (#<=), Const ()) + rer _ = (DualRepr (#<=), Const ()) {- | Use this for implementing the necessary instances for getting the `Data` representation. You must implement 'PIsDataRepr' to use this. From 414436f7c71ac3369945275b794c984db177ebb9 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Apr 2022 19:51:19 +0530 Subject: [PATCH 308/584] Finish up `PlutusType (PDataSum xs)` --- Plutarch/DataRepr.hs | 2 +- Plutarch/DataRepr/Internal.hs | 106 +++++++++++++------------------- Plutarch/Internal/Generic.hs | 23 ++++--- Plutarch/Internal/PlutusType.hs | 6 +- 4 files changed, 61 insertions(+), 76 deletions(-) diff --git a/Plutarch/DataRepr.hs b/Plutarch/DataRepr.hs index 181952638..0e5dc7533 100644 --- a/Plutarch/DataRepr.hs +++ b/Plutarch/DataRepr.hs @@ -1,6 +1,6 @@ module Plutarch.DataRepr ( -- * DataRepr - I.PDataSum, + I.PDataSum (PDataSum), I.punDataSum, I.ptryIndexDataSum, I.DataReprHandlers (DRHNil, DRHCons), diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 2a7893cac..16ebccd78 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -1,10 +1,11 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans -Wno-redundant-constraints #-} module Plutarch.DataRepr.Internal ( - PDataSum, + PDataSum (..), punDataSum, ptryIndexDataSum, pmatchDataSum, @@ -25,6 +26,7 @@ module Plutarch.DataRepr.Internal ( DualReprHandler (..), ) where +import qualified Data.Functor.Compose as F import Data.Functor.Const (Const (Const)) import Data.Kind (Type) import Data.List (groupBy, maximumBy, sortOn) @@ -47,15 +49,13 @@ import Generics.SOP ( Generic, K (K), NP (Nil, (:*)), - NS (Z, S), - SList (SNil, SCons), + NS, SListI, SOP (SOP), hcmap, hcollapse, hindex, - lengthSList, - sList, + hmap, ) import Plutarch ( Dig, @@ -94,12 +94,11 @@ import Plutarch.Builtin ( ) import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) import Plutarch.Integer (PInteger) -import Plutarch.Internal (S (SI)) -import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) +import Plutarch.Internal (S (SI), punsafeCoerce) +import Plutarch.Internal.Generic (MkNS, PCode, PGeneric, gpfrom, gpto, mkNS, mkSum) import Plutarch.Lift (PConstant, PConstantRepr, PConstanted, PLift, pconstant, pconstantFromRepr, pconstantToRepr) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont, tcont, unTermCont) -import Plutarch.Unsafe (punsafeCoerce) import qualified Plutus.V1.Ledger.Api as Ledger {- | A "record" of `exists a. PAsData a`. The underlying representation is @@ -224,62 +223,25 @@ instance {-# OVERLAPPABLE #-} PIsData (PDataRecord xs) where pfromData x = punsafeCoerce $ (pfromData (punsafeCoerce x) :: Term _ (PBuiltinList PData)) pdata x = punsafeCoerce $ pdata (punsafeCoerce x :: Term _ (PBuiltinList PData)) -{- | A sum of 'PDataRecord's. The underlying representation is the `PDataConstr` constructor, - where the integer is the index of the variant and the list is the record. +type PDataSum :: [[PLabeledType]] -> PType +newtype PDataSum defs s = PDataSum (NS (F.Compose (Term s) PDataRecord) defs) - This is how most data structures are stored on-chain. --} -newtype DRec s x = DRec (forall {out :: PType}. ((Term s (PDataRecord x) -> Term s out) -> Term s out)) +instance + ( SListI defs + , forall s. MkDataSumHandler s defs 0 defs + ) => + PlutusType (PDataSum defs) + where + type PInner (PDataSum defs) _ = PData + pcon' (PDataSum xss) = + let constrIx = fromIntegral $ hindex xss + datRec = hcollapse $ hmap (K . pdToBuiltin . F.getCompose) xss + in pforgetData $ pconstrBuiltin # pconstant constrIx # datRec -type PDataSum :: [[PLabeledType]] -> PType -newtype PDataSum defs s = PDataSum (NS (DRec s) defs) - --- the length functions in sop-core gives the actual length, we want length-1 -adjustedLength :: forall x xs proxy. SListI (x : xs) => proxy (x : xs) -> Integer -adjustedLength proxy = fromIntegral (lengthSList proxy) - 1 - -instance SListI (def : defs) => PlutusType (PDataSum (def : defs)) where - type PInner (PDataSum (def : defs)) _ = PData - pcon' :: - forall - {s :: S} - {b :: PType}. - PDataSum (def : defs) s -> - Term s (PInner (PDataSum (def : defs)) b) - pcon' (PDataSum xss) = case xss of - Z (DRec f) -> punsafeCoerce $ pconstrBuiltin # (pconstant @PInteger $ adjustedLength $ Proxy @(def : defs)) # (punsafeCoerce $ f id) - S rest -> case rest of - Z (DRec f) -> punsafeCoerce $ pconstrBuiltin # (pconstant @PInteger $ adjustedLength $ Proxy @defs) # (punsafeCoerce $ f $ id) - dss@(S _) -> pcon' (PDataSum dss) - - pmatch' :: - forall - {s :: S} - {b :: PType}. - Term s (PInner (PDataSum (def : defs)) b) -> - (PDataSum (def : defs) s -> Term s b) -> - Term s b - pmatch' d f = - plet (pasConstr #$ pforgetData $ pdata d) $ \d' -> - plet (pfstBuiltin # d') $ \constr -> - plet (psndBuiltin # d') $ \args -> - go constr args sList (f . PDataSum) + pmatch' d = pmatchDataSum target . mkDataSumHandler @_ @defs @0 @defs where - go :: - forall {d :: [PLabeledType]} {ds :: [[PLabeledType]]}. - Term s PInteger -> - Term s (PBuiltinList PData) -> - SList (d : ds) -> - (NS (DRec s) (d : ds) -> Term s b) -> - Term s b - go constr args SCons g = - case sList @ds of - SNil -> g . Z $ DRec (\k -> k $ punsafeCoerce args) - rest@SCons -> - pif - (constr #== pconstant (adjustedLength $ Proxy @(d : ds))) - (g . Z $ DRec (\k -> k $ punsafeCoerce args)) - (go constr args rest (g . S)) + target :: Term _ (PDataSum defs) + target = punsafeCoerce d instance PIsData (PDataSum defs) where pdata = punsafeCoerce @@ -417,7 +379,7 @@ instance , pcode ~ PCode s a , r ~ IndexList n pcode , r ~ '[(PDataRecord fs)] - , MkSum n pcode (Term s) + , MkNS n pcode (NP (Term s)) , MkDataReprHandler s a (n + 1) rs ) => MkDataReprHandler s a n (r ': rs) @@ -429,7 +391,25 @@ instance mkProduct :: Term s (PDataRecord fs) -> NP (Term s) r mkProduct x = x :* Nil mkSOP :: NP (Term s) r -> SOP (Term s) (PCode s a) - mkSOP = SOP . mkSum @_ @n @pcode + mkSOP = SOP . mkSum @n @pcode + +class MkDataSumHandler s a (n :: Nat) rest where + mkDataSumHandler :: forall out. (PDataSum a s -> Term s out) -> DataReprHandlers out rest s + +instance MkDataSumHandler s a n '[] where + mkDataSumHandler _ = DRHNil + +instance + ( MkDataSumHandler s a (n + 1) defs + , IndexList n a ~ def + , MkNS n a (F.Compose (Term s) PDataRecord) + ) => + MkDataSumHandler s a n (def : defs) + where + mkDataSumHandler f = DRHCons (f . dataSumFrom) $ mkDataSumHandler @s @a @(n + 1) @defs f + where + dataSumFrom :: Term s (PDataRecord def) -> PDataSum a s + dataSumFrom = PDataSum . mkNS @_ @n . F.Compose newtype DualReprHandler s out def = LTRepr (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s out) diff --git a/Plutarch/Internal/Generic.hs b/Plutarch/Internal/Generic.hs index 15c721f47..72068e297 100644 --- a/Plutarch/Internal/Generic.hs +++ b/Plutarch/Internal/Generic.hs @@ -11,7 +11,9 @@ module Plutarch.Internal.Generic ( gpto, -- * Helpers for when existing generics-sop combinators are insufficient. - MkSum (mkSum), + MkNS, + mkNS, + mkSum, ) where import Data.Kind (Constraint, Type) @@ -56,17 +58,20 @@ Infrastructure to create a single sum constructor given its type index and value It is type-checked that the `x` here matches the type of nth constructor of `a`. -} -class MkSum (idx :: Nat) (xss :: [[k]]) (f :: k -> Type) where - mkSum :: NP f (IndexList idx xss) -> NS (NP f) xss +class MkNS (idx :: Nat) (xs :: [k]) (f :: k -> Type) where + mkNS :: f (IndexList idx xs) -> NS f xs -instance {-# OVERLAPPING #-} MkSum 0 (xs ': xss) f where - mkSum = Z +instance {-# OVERLAPPING #-} MkNS 0 (x ': xs) f where + mkNS = Z instance {-# OVERLAPPABLE #-} - ( MkSum (idx - 1) xss f - , IndexList idx (xs ': xss) ~ IndexList (idx - 1) xss + ( MkNS (idx - 1) xs f + , IndexList idx (x ': xs) ~ IndexList (idx - 1) xs ) => - MkSum idx (xs ': xss) f + MkNS idx (x ': xs) f where - mkSum x = S $ mkSum @_ @(idx - 1) @xss x + mkNS x = S $ mkNS @_ @(idx - 1) @xs x + +mkSum :: forall idx xss f. MkNS idx xss (NP f) => NP f (IndexList idx xss) -> NS (NP f) xss +mkSum = mkNS @_ @idx @xss @(NP f) diff --git a/Plutarch/Internal/PlutusType.hs b/Plutarch/Internal/PlutusType.hs index 4b0d18b46..afc60261f 100644 --- a/Plutarch/Internal/PlutusType.hs +++ b/Plutarch/Internal/PlutusType.hs @@ -21,7 +21,7 @@ import Generics.SOP ( import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Internal (PType, S, Term, pforce, plam', punsafeCoerce, (:-->)) import qualified Plutarch.Internal as PI -import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) +import Plutarch.Internal.Generic (MkNS, PCode, PGeneric, gpfrom, gpto, mkSum) import Plutarch.Internal.PLam ((#)) import Plutarch.Internal.TypeFamily (ToPType, ToPType2) @@ -198,14 +198,14 @@ instance , ToPType xs ~ IndexList n (PCode s a) , GPMatch a (n + 1) xss c s , PLamL (ToPType xs) c s - , MkSum n (PCode s a) (Term s) + , MkNS n (PCode s a) (NP (Term s)) , All Top (ToPType xs) , All Top xs ) => GPMatch a n (xs : xss) c s where gpmatch' f = - plamL @(ToPType xs) @c (f . SOP . mkSum @_ @n @(PCode s a) @(Term s)) + plamL @(ToPType xs) @c (f . SOP . mkSum @n @(PCode s a) @(Term s)) :* gpmatch' @a @(n + 1) @xss @c @s f {- | From 546b7e5261bac00d9625a8815ca9923ac6b1be03 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Apr 2022 19:52:36 +0530 Subject: [PATCH 309/584] Add tests for `PDataSum` `PlutusType` instance --- plutarch-test/common/Plutarch/Test.hs | 4 +- .../goldens/pisdata.constr.bench.golden | 15 ++- .../goldens/pisdata.constr.uplc.eval.golden | 15 ++- .../goldens/pisdata.constr.uplc.golden | 15 ++- .../goldens/plutustype.deconstr.bench.golden | 33 ++++--- .../plutustype.deconstr.uplc.eval.golden | 33 ++++--- .../goldens/plutustype.deconstr.uplc.golden | 33 ++++--- .../plutarch-base/Plutarch/PIsDataSpec.hs | 94 +++++++++++-------- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 89 +++++++++++++----- 9 files changed, 222 insertions(+), 109 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index 830b81322..aa9e0bb67 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -129,7 +129,7 @@ ptraces p develTraces = case evalScript (compile p) of (Left _, _, _) -> expectationFailure $ "Term failed to evaluate" (Right _, _, traceLog) -> do -#ifdef Development +#ifdef Development traceLog `shouldBe` develTraces #else -- Tracing is disabled in non-developed modes, so we should expect an @@ -151,7 +151,7 @@ plutarchDevFlagDescribe :: Spec -> Spec -- CPP support isn't great in fourmolu. {- ORMOLU_DISABLE -} plutarchDevFlagDescribe m = -#ifdef Development +#ifdef Development describe "dev=true" m #else describe "dev=false" m diff --git a/plutarch-test/goldens/pisdata.constr.bench.golden b/plutarch-test/goldens/pisdata.constr.bench.golden index 2a54c6d30..0e240d135 100644 --- a/plutarch-test/goldens/pisdata.constr.bench.golden +++ b/plutarch-test/goldens/pisdata.constr.bench.golden @@ -1,8 +1,13 @@ -sop.4wheeler {"exBudgetCPU":1494425,"exBudgetMemory":2760,"scriptSizeBytes":45} -sop.2wheeler {"exBudgetCPU":956241,"exBudgetMemory":1896,"scriptSizeBytes":30} -sop.immovable {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} -prod.1 {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":40} -prod.2 {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":68} +sop.4wheeler.normal {"exBudgetCPU":1494425,"exBudgetMemory":2760,"scriptSizeBytes":45} +sop.4wheeler.pdatasum {"exBudgetCPU":1494425,"exBudgetMemory":2760,"scriptSizeBytes":45} +sop.2wheeler.normal {"exBudgetCPU":956241,"exBudgetMemory":1896,"scriptSizeBytes":30} +sop.2wheeler.pdatasum {"exBudgetCPU":956241,"exBudgetMemory":1896,"scriptSizeBytes":30} +sop.immovable.normal {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} +sop.immovable.pdatasum {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} +prod.1.normal {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":40} +prod.1.pdatasum {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":40} +prod.2.normal {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":68} +prod.2.datasum {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":68} enum.PA {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} enum.PB {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} pconstant-pcon-rel {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":22} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.constr.uplc.eval.golden b/plutarch-test/goldens/pisdata.constr.uplc.eval.golden index 6f3b5cbf0..ac6f1e88e 100644 --- a/plutarch-test/goldens/pisdata.constr.uplc.eval.golden +++ b/plutarch-test/goldens/pisdata.constr.uplc.eval.golden @@ -1,8 +1,13 @@ -sop.4wheeler (program 1.0.0 #d8799f0205182a00ff) -sop.2wheeler (program 1.0.0 #d87a9f0500ff) -sop.immovable (program 1.0.0 #d87b80) -prod.1 (program 1.0.0 #d8799f41ab4141410eff) -prod.2 (program 1.0.0 #d8799fd8799f40ffd87a9fd8799fd8799f41abff00ffffd87b9fd8799fd8799f41daffffffff) +sop.4wheeler.normal (program 1.0.0 #d8799f0205182a00ff) +sop.4wheeler.pdatasum (program 1.0.0 #d8799f0205182a00ff) +sop.2wheeler.normal (program 1.0.0 #d87a9f0500ff) +sop.2wheeler.pdatasum (program 1.0.0 #d87a9f0500ff) +sop.immovable.normal (program 1.0.0 #d87b80) +sop.immovable.pdatasum (program 1.0.0 #d87b80) +prod.1.normal (program 1.0.0 #d8799f41ab4141410eff) +prod.1.pdatasum (program 1.0.0 #d8799f41ab4141410eff) +prod.2.normal (program 1.0.0 #d8799fd8799f40ffd87a9fd8799fd8799f41abff00ffffd87b9fd8799fd8799f41daffffffff) +prod.2.datasum (program 1.0.0 #d8799fd8799f40ffd87a9fd8799fd8799f41abff00ffffd87b9fd8799fd8799f41daffffffff) enum.PA (program 1.0.0 #d87980) enum.PB (program 1.0.0 #d87a80) pconstant-pcon-rel (program 1.0.0 #d8799fd87a9f4101ffd87a80ff) \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.constr.uplc.golden b/plutarch-test/goldens/pisdata.constr.uplc.golden index 38bb851e4..c45fb7081 100644 --- a/plutarch-test/goldens/pisdata.constr.uplc.golden +++ b/plutarch-test/goldens/pisdata.constr.uplc.golden @@ -1,8 +1,13 @@ -sop.4wheeler (program 1.0.0 ((\i0 -> constrData 0 (i1 #02 (i1 #05 (i1 #182a (i1 #00 [ ]))))) (force mkCons))) -sop.2wheeler (program 1.0.0 ((\i0 -> constrData 1 (i1 #05 (i1 #00 []))) (force mkCons))) -sop.immovable (program 1.0.0 (constrData 2 [])) -prod.1 (program 1.0.0 ((\i0 -> constrData 0 (i1 #41ab (i1 #4141 (i1 #410e [ ])))) (force mkCons))) -prod.2 (program 1.0.0 ((\i0 -> constrData 0 (i1 #d8799f40ff (i1 #d87a9fd8799fd8799f41abff00ffff (i1 #d87b9fd8799fd8799f41daffffff [ ])))) (force mkCons))) +sop.4wheeler.normal (program 1.0.0 ((\i0 -> constrData 0 (i1 #02 (i1 #05 (i1 #182a (i1 #00 [ ]))))) (force mkCons))) +sop.4wheeler.pdatasum (program 1.0.0 ((\i0 -> constrData 0 (i1 #02 (i1 #05 (i1 #182a (i1 #00 [ ]))))) (force mkCons))) +sop.2wheeler.normal (program 1.0.0 ((\i0 -> constrData 1 (i1 #05 (i1 #00 []))) (force mkCons))) +sop.2wheeler.pdatasum (program 1.0.0 ((\i0 -> constrData 1 (i1 #05 (i1 #00 []))) (force mkCons))) +sop.immovable.normal (program 1.0.0 (constrData 2 [])) +sop.immovable.pdatasum (program 1.0.0 (constrData 2 [])) +prod.1.normal (program 1.0.0 ((\i0 -> constrData 0 (i1 #41ab (i1 #4141 (i1 #410e [ ])))) (force mkCons))) +prod.1.pdatasum (program 1.0.0 ((\i0 -> constrData 0 (i1 #41ab (i1 #4141 (i1 #410e [ ])))) (force mkCons))) +prod.2.normal (program 1.0.0 ((\i0 -> constrData 0 (i1 #d8799f40ff (i1 #d87a9fd8799fd8799f41abff00ffff (i1 #d87b9fd8799fd8799f41daffffff [ ])))) (force mkCons))) +prod.2.datasum (program 1.0.0 ((\i0 -> constrData 0 (i1 #d8799f40ff (i1 #d87a9fd8799fd8799f41abff00ffff (i1 #d87b9fd8799fd8799f41daffffff [ ])))) (force mkCons))) enum.PA (program 1.0.0 (constrData 0 [])) enum.PB (program 1.0.0 (constrData 1 [])) pconstant-pcon-rel (program 1.0.0 #d8799fd87a9f4101ffd87a80ff) \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.bench.golden b/plutarch-test/goldens/plutustype.deconstr.bench.golden index aecc38657..5b4582dd9 100644 --- a/plutarch-test/goldens/plutustype.deconstr.bench.golden +++ b/plutarch-test/goldens/plutustype.deconstr.bench.golden @@ -1,14 +1,25 @@ -matching.typed.newtype {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} -matching.typed.sumtype(ignore-fields) {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} -matching.typed.sumtype(partial-match) {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} -matching.typed.sumtype(exhaustive).minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} -matching.typed.sumtype(exhaustive).spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} -matching.typed.sumtype(exhaustive).rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} -matching.typed.sumtype(exhaustive).certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} -matching.typed.sumtype(exhaustive)(ignore-fields).minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} -matching.typed.sumtype(exhaustive)(ignore-fields).spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} -matching.typed.sumtype(exhaustive)(ignore-fields).rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} -matching.typed.sumtype(exhaustive)(ignore-fields).certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.typed.newtype.normal {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} +matching.typed.newtype.datasum {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} +matching.typed.sumtype(ignore-fields).normal {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(ignore-fields).datasum {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(partial-match).normal {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(partial-match).datasum {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(exhaustive).normal.minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive).normal.spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive).normal.rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive).normal.certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.typed.sumtype(exhaustive).datasum.minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive).datasum.spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive).datasum.rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive).datasum.certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.typed.sumtype(exhaustive)(ignore-fields).normal.minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive)(ignore-fields).normal.spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive)(ignore-fields).normal.rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive)(ignore-fields).normal.certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} matching.raw.newtype {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} matching.raw.sumtype(ignore-fields) {"exBudgetCPU":1122748,"exBudgetMemory":2466,"scriptSizeBytes":33} matching.raw.sumtype(partial-match) {"exBudgetCPU":1481159,"exBudgetMemory":3198,"scriptSizeBytes":39} diff --git a/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden b/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden index f3245ed4f..05fea6e3a 100644 --- a/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden +++ b/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden @@ -1,14 +1,25 @@ -matching.typed.newtype (program 1.0.0 [#d8799f41abff, #d87a80]) -matching.typed.sumtype(ignore-fields) (program 1.0.0 ()) -matching.typed.sumtype(partial-match) (program 1.0.0 [#40]) -matching.typed.sumtype(exhaustive).minting (program 1.0.0 #01) -matching.typed.sumtype(exhaustive).spending (program 1.0.0 #02) -matching.typed.sumtype(exhaustive).rewarding (program 1.0.0 #03) -matching.typed.sumtype(exhaustive).certifying (program 1.0.0 #04) -matching.typed.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 #01) -matching.typed.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 #02) -matching.typed.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 #03) -matching.typed.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 #04) +matching.typed.newtype.normal (program 1.0.0 [#d8799f41abff, #d87a80]) +matching.typed.newtype.datasum (program 1.0.0 [#d8799f41abff, #d87a80]) +matching.typed.sumtype(ignore-fields).normal (program 1.0.0 ()) +matching.typed.sumtype(ignore-fields).datasum (program 1.0.0 ()) +matching.typed.sumtype(partial-match).normal (program 1.0.0 [#40]) +matching.typed.sumtype(partial-match).datasum (program 1.0.0 [#40]) +matching.typed.sumtype(exhaustive).normal.minting (program 1.0.0 #01) +matching.typed.sumtype(exhaustive).normal.spending (program 1.0.0 #02) +matching.typed.sumtype(exhaustive).normal.rewarding (program 1.0.0 #03) +matching.typed.sumtype(exhaustive).normal.certifying (program 1.0.0 #04) +matching.typed.sumtype(exhaustive).datasum.minting (program 1.0.0 #01) +matching.typed.sumtype(exhaustive).datasum.spending (program 1.0.0 #02) +matching.typed.sumtype(exhaustive).datasum.rewarding (program 1.0.0 #03) +matching.typed.sumtype(exhaustive).datasum.certifying (program 1.0.0 #04) +matching.typed.sumtype(exhaustive)(ignore-fields).normal.minting (program 1.0.0 #01) +matching.typed.sumtype(exhaustive)(ignore-fields).normal.spending (program 1.0.0 #02) +matching.typed.sumtype(exhaustive)(ignore-fields).normal.rewarding (program 1.0.0 #03) +matching.typed.sumtype(exhaustive)(ignore-fields).normal.certifying (program 1.0.0 #04) +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.minting (program 1.0.0 #01) +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.spending (program 1.0.0 #02) +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.rewarding (program 1.0.0 #03) +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.certifying (program 1.0.0 #04) matching.raw.newtype (program 1.0.0 [#d8799f41abff, #d87a80]) matching.raw.sumtype(ignore-fields) (program 1.0.0 ()) matching.raw.sumtype(partial-match) (program 1.0.0 [#40]) diff --git a/plutarch-test/goldens/plutustype.deconstr.uplc.golden b/plutarch-test/goldens/plutustype.deconstr.uplc.golden index e9c9de8d6..b3cddc722 100644 --- a/plutarch-test/goldens/plutustype.deconstr.uplc.golden +++ b/plutarch-test/goldens/plutustype.deconstr.uplc.golden @@ -1,14 +1,25 @@ -matching.typed.newtype (program 1.0.0 ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) -matching.typed.sumtype(ignore-fields) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay ()) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) -matching.typed.sumtype(partial-match) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) -matching.typed.sumtype(exhaustive).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) -matching.typed.sumtype(exhaustive).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) -matching.typed.sumtype(exhaustive).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) -matching.typed.sumtype(exhaustive).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) -matching.typed.sumtype(exhaustive)(ignore-fields).minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) -matching.typed.sumtype(exhaustive)(ignore-fields).spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) -matching.typed.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) -matching.typed.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.typed.newtype.normal (program 1.0.0 ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) +matching.typed.newtype.datasum (program 1.0.0 ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) +matching.typed.sumtype(ignore-fields).normal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay ()) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) +matching.typed.sumtype(ignore-fields).datasum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay ()) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) +matching.typed.sumtype(partial-match).normal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) +matching.typed.sumtype(partial-match).datasum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff)) +matching.typed.sumtype(exhaustive).normal.minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).normal.spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).normal.rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).normal.certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).datasum.minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).datasum.spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).datasum.rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive).datasum.certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).normal.minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).normal.spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).normal.rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).normal.certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.minting (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d8799f40ff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.spending (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87a9fd8799fd8799f41abff00ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.rewarding (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87b9fd87a9f182a0007ffff) (force ifThenElse))) +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay #02) (delay (force (i5 (equalsInteger 2 i2) (delay #03) (delay (force (i5 (equalsInteger 3 i2) (delay #04) (delay #01))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i1)) #d87c9fd87e80ff) (force ifThenElse))) matching.raw.newtype (program 1.0.0 ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) matching.raw.sumtype(ignore-fields) (program 1.0.0 ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) (unConstrData i1)) 0) (delay ()) (delay error))) #d8799f40ff)) matching.raw.sumtype(partial-match) (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force (force sndPair) i1)) (delay error))) (unConstrData i1)) #d8799f40ff)) diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index b56054dcc..e4b72975b 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -5,9 +5,10 @@ module Plutarch.PIsDataSpec (spec) where import Data.Text.Encoding (encodeUtf8) +import Data.Functor.Compose (Compose (Compose)) import Data.String (fromString) import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +import Generics.SOP (Generic, I (I), NS (S, Z)) import Plutus.V1.Ledger.Api ( Address (Address), Credential (PubKeyCredential, ScriptCredential), @@ -23,7 +24,7 @@ import Test.Tasty.QuickCheck (Arbitrary, property) import Plutarch.Api.V1 import Plutarch.Api.V1.Tuple (pbuiltinPairFromTuple, ptupleFromBuiltin) import Plutarch.Builtin (pforgetData, ppairDataBuiltin) -import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) +import Plutarch.DataRepr (PDataSum (PDataSum), PIsDataRepr (PIsDataReprRepr), PIsDataReprInstances (PIsDataReprInstances)) import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.SpecTypes (PTriplet (PTriplet)) @@ -77,59 +78,78 @@ spec = do describe "constr" . pgoldenSpec $ do -- Sum of products construction "sop" @\ do - "4wheeler" - @| pcon - ( PFourWheeler $ + "4wheeler" @\ do + let datrec = pdcons # pconstantData 2 #$ pdcons # pconstantData 5 #$ pdcons # pconstantData 42 #$ pdcons # pconstantData 0 # pdnil - ) - @== pconstant (PlutusTx.Constr 0 [PlutusTx.I 2, PlutusTx.I 5, PlutusTx.I 42, PlutusTx.I 0]) - "2wheeler" - @| pcon (PTwoWheeler $ pdcons # pconstantData 5 #$ pdcons # pconstantData 0 # pdnil) - @== pconstant (PlutusTx.Constr 1 [PlutusTx.I 5, PlutusTx.I 0]) - "immovable" - @| pcon (PImmovableBox pdnil) - @== pconstant (PlutusTx.Constr 2 []) + expected = + pconstant $ + PlutusTx.Constr 0 [PlutusTx.I 2, PlutusTx.I 5, PlutusTx.I 42, PlutusTx.I 0] + "normal" + @| pcon (PFourWheeler datrec) @== expected + "pdatasum" + @| pcon @(PDataSum (PIsDataReprRepr PVehicle)) (PDataSum . Z $ Compose datrec) @== expected + "2wheeler" @\ do + let datrec = pdcons # pconstantData 5 #$ pdcons # pconstantData 0 # pdnil + expected = pconstant $ PlutusTx.Constr 1 [PlutusTx.I 5, PlutusTx.I 0] + "normal" + @| pcon (PTwoWheeler datrec) @== expected + "pdatasum" + @| pcon @(PDataSum (PIsDataReprRepr PVehicle)) (PDataSum . S . Z $ Compose datrec) @== expected + "immovable" @\ do + let datrec = pdnil + expected = pconstant $ PlutusTx.Constr 2 [] + "normal" + @| pcon (PImmovableBox datrec) @== expected + "pdatasum" + @| pcon @(PDataSum (PIsDataReprRepr PVehicle)) (PDataSum . S . S . Z $ Compose datrec) @== expected -- Product construction "prod" @\ do - "1" - @| pcon - ( PTriplet $ + "1" @\ do + let datrec = pdcons # pconstantData @PCurrencySymbol "ab" #$ pdcons # pconstantData "41" #$ pdcons # pconstantData "0e" # pdnil - ) - @== pconstant - ( PlutusTx.Constr - 0 - [ PlutusTx.toData @CurrencySymbol "ab" - , PlutusTx.toData @CurrencySymbol "41" - , PlutusTx.toData @CurrencySymbol "0e" - ] - ) - let minting = Minting "" - spending = Spending $ TxOutRef "ab" 0 - rewarding = Rewarding . StakingHash $ PubKeyCredential "da" - "2" - @| pcon - ( PTriplet $ + expected = + pconstant $ + PlutusTx.Constr + 0 + [ PlutusTx.toData @CurrencySymbol "ab" + , PlutusTx.toData @CurrencySymbol "41" + , PlutusTx.toData @CurrencySymbol "0e" + ] + "normal" + @| pcon (PTriplet datrec) @== expected + "pdatasum" + @| pcon @(PDataSum (PIsDataReprRepr (PTriplet PCurrencySymbol))) (PDataSum . Z $ Compose datrec) + @== expected + "2" @\ do + let minting = Minting "" + spending = Spending $ TxOutRef "ab" 0 + rewarding = Rewarding . StakingHash $ PubKeyCredential "da" + + datrec = pdcons # pconstantData minting #$ pdcons # pconstantData spending #$ pdcons # pconstantData rewarding # pdnil - ) - @== pconstant - ( PlutusTx.Constr - 0 - [PlutusTx.toData minting, PlutusTx.toData spending, PlutusTx.toData rewarding] - ) + expected = + pconstant $ + PlutusTx.Constr + 0 + [PlutusTx.toData minting, PlutusTx.toData spending, PlutusTx.toData rewarding] + "normal" + @| pcon (PTriplet datrec) @== expected + "datasum" + @| pcon @(PDataSum (PIsDataReprRepr (PTriplet PScriptPurpose))) (PDataSum . Z $ Compose datrec) + @== expected -- Enumerable sum type construction "enum" @\ do "PA" @| pcon (PA pdnil) @== pconstant (PlutusTx.Constr 0 []) diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index 84c9e4146..ad6e3b83f 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -20,6 +20,9 @@ import Plutus.V1.Ledger.Credential ( ) import Test.Hspec +import Plutarch.DataRepr +import Data.SOP.NS +import Data.Functor.Compose spec :: Spec spec = do @@ -59,28 +62,52 @@ deconstrSpec = do describe "deconstr" . pgoldenSpec $ do "matching" @\ do "typed" @\ do - "newtype" - @| plam - ( \x -> pmatch x $ \(PAddress addrFields) -> - addrFields - ) - # pconstant addrPC - "sumtype(ignore-fields)" - @| plam - ( \x -> pmatch x $ \case - PMinting _ -> pconstant () - _ -> perror - ) - # pconstant minting - "sumtype(partial-match)" - @| plam - ( \x -> pmatch x $ \case - PMinting hs -> hs - _ -> perror - ) - # pconstant minting + "newtype" @\ do + "normal" + @| plam + ( \x -> pmatch x $ \(PAddress addrFields) -> + addrFields + ) + # pconstant addrPC + "datasum" + @| plam + ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + Z (Compose addrFields) -> addrFields + _ -> perror + ) + # pconstant addrPC + "sumtype(ignore-fields)" @\ do + "normal" + @| plam + ( \x -> pmatch x $ \case + PMinting _ -> pconstant () + _ -> perror + ) + # pconstant minting + "datasum" + @| plam + ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + Z _ -> pconstant () + _ -> perror + ) + # pconstant minting + "sumtype(partial-match)" @\ do + "normal" + @| plam + ( \x -> pmatch x $ \case + PMinting hs -> hs + _ -> perror + ) + # pconstant minting + "datasum" + @| plam + ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + Z (Compose hs) -> hs + _ -> perror + ) + # pconstant minting "sumtype(exhaustive)" @\ do - benchPurpose $ + ("normal" @\) $ benchPurpose $ plam ( \x -> pmatch x $ \case PMinting f -> plet f $ const $ phexByteStr "01" @@ -88,8 +115,17 @@ deconstrSpec = do PRewarding f -> plet f $ const $ phexByteStr "03" PCertifying f -> plet f $ const $ phexByteStr "04" ) + ("datasum" @\) $ benchPurpose $ + plam + ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + Z (Compose f) -> plet f $ const $ phexByteStr "01" + S (Z (Compose f)) -> plet f $ const $ phexByteStr "02" + S (S (Z (Compose f))) -> plet f $ const $ phexByteStr "03" + S (S (S (Z (Compose f)))) -> plet f $ const $ phexByteStr "04" + _ -> perror + ) "sumtype(exhaustive)(ignore-fields)" @\ do - benchPurpose $ + ("normal" @\) $ benchPurpose $ plam ( \x -> pmatch x $ \case PMinting _ -> phexByteStr "01" @@ -97,6 +133,15 @@ deconstrSpec = do PRewarding _ -> phexByteStr "03" PCertifying _ -> phexByteStr "04" ) + ("datasum" @\) $ benchPurpose $ + plam + ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + Z _ -> phexByteStr "01" + S (Z _) -> phexByteStr "02" + S (S (Z _)) -> phexByteStr "03" + S (S (S (Z _))) -> phexByteStr "04" + _ -> perror + ) "raw" @\ do "newtype" @| plam From b413f431c51a3a59130893a3e480ad8b9bbd3d1a Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Apr 2022 20:05:50 +0530 Subject: [PATCH 310/584] Fix formatting and cleanup --- Plutarch/DataRepr/Internal.hs | 3 +- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 63 ++++++++++--------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 275ff862c..1e20b3bd3 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -224,7 +224,8 @@ instance {-# OVERLAPPABLE #-} PIsData (PDataRecord xs) where pdata x = punsafeCoerce $ pdata (punsafeCoerce x :: Term _ (PBuiltinList PData)) {- | A sum of 'PDataRecord's. The underlying representation is the `Constr` constructor, -where the integer is the index of the variant and the list is the record. -} +where the integer is the index of the variant and the list is the record. +-} type PDataSum :: [[PLabeledType]] -> PType newtype PDataSum defs s = PDataSum (NS (F.Compose (Term s) PDataRecord) defs) diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index ad6e3b83f..9c4cead45 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -2,6 +2,9 @@ module Plutarch.PlutusTypeSpec (spec) where +import Data.Functor.Compose (Compose (Compose)) +import Data.SOP.NS (NS (S, Z)) + import Plutarch (pcon', pmatch') import Plutarch.Api.V1 ( PAddress (PAddress), @@ -9,6 +12,7 @@ import Plutarch.Api.V1 ( PScriptPurpose (PCertifying, PMinting, PRewarding, PSpending), ) import Plutarch.Builtin (pasByteStr, pasConstr) +import Plutarch.DataRepr (PDataSum (PDataSum), pasDataSum) import Plutarch.Prelude import Plutarch.Test import Plutus.V1.Ledger.Address (Address (Address)) @@ -20,9 +24,6 @@ import Plutus.V1.Ledger.Credential ( ) import Test.Hspec -import Plutarch.DataRepr -import Data.SOP.NS -import Data.Functor.Compose spec :: Spec spec = do @@ -107,33 +108,37 @@ deconstrSpec = do ) # pconstant minting "sumtype(exhaustive)" @\ do - ("normal" @\) $ benchPurpose $ - plam - ( \x -> pmatch x $ \case - PMinting f -> plet f $ const $ phexByteStr "01" - PSpending f -> plet f $ const $ phexByteStr "02" - PRewarding f -> plet f $ const $ phexByteStr "03" - PCertifying f -> plet f $ const $ phexByteStr "04" - ) - ("datasum" @\) $ benchPurpose $ - plam - ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of - Z (Compose f) -> plet f $ const $ phexByteStr "01" - S (Z (Compose f)) -> plet f $ const $ phexByteStr "02" - S (S (Z (Compose f))) -> plet f $ const $ phexByteStr "03" - S (S (S (Z (Compose f)))) -> plet f $ const $ phexByteStr "04" - _ -> perror - ) + ("normal" @\) $ + benchPurpose $ + plam + ( \x -> pmatch x $ \case + PMinting f -> plet f $ const $ phexByteStr "01" + PSpending f -> plet f $ const $ phexByteStr "02" + PRewarding f -> plet f $ const $ phexByteStr "03" + PCertifying f -> plet f $ const $ phexByteStr "04" + ) + ("datasum" @\) $ + benchPurpose $ + plam + ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + Z (Compose f) -> plet f $ const $ phexByteStr "01" + S (Z (Compose f)) -> plet f $ const $ phexByteStr "02" + S (S (Z (Compose f))) -> plet f $ const $ phexByteStr "03" + S (S (S (Z (Compose f)))) -> plet f $ const $ phexByteStr "04" + _ -> perror + ) "sumtype(exhaustive)(ignore-fields)" @\ do - ("normal" @\) $ benchPurpose $ - plam - ( \x -> pmatch x $ \case - PMinting _ -> phexByteStr "01" - PSpending _ -> phexByteStr "02" - PRewarding _ -> phexByteStr "03" - PCertifying _ -> phexByteStr "04" - ) - ("datasum" @\) $ benchPurpose $ + ("normal" @\) $ + benchPurpose $ + plam + ( \x -> pmatch x $ \case + PMinting _ -> phexByteStr "01" + PSpending _ -> phexByteStr "02" + PRewarding _ -> phexByteStr "03" + PCertifying _ -> phexByteStr "04" + ) + ("datasum" @\) $ + benchPurpose $ plam ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of Z _ -> phexByteStr "01" From 4684e1a7520fddb39a7ff19e102d920876863382 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 12:14:11 +0530 Subject: [PATCH 311/584] Add type family dependency --- Plutarch/DataRepr/Internal.hs | 4 ++-- Plutarch/Lift.hs | 6 +++--- plutarch.cabal | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index cd5090824..70ddd39d0 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -28,7 +28,7 @@ module Plutarch.DataRepr.Internal ( ) where import Data.Functor.Const (Const (Const)) -import Data.Kind (Type, Constraint) +import Data.Kind (Constraint, Type) import Data.List (groupBy, maximumBy, sortOn) import Data.Proxy (Proxy (Proxy)) import Data.SOP.NP (cana_NP) @@ -93,6 +93,7 @@ import Plutarch.Builtin ( import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) import Plutarch.Integer (PInteger) import Plutarch.Internal (S (SI)) +import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) import Plutarch.Lift ( PConstant, PConstantRepr, @@ -104,7 +105,6 @@ import Plutarch.Lift ( pconstantFromRepr, pconstantToRepr, ) -import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont, tcont, unTermCont) import Plutarch.Unsafe (punsafeCoerce) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index ed0fbf29b..44dd73eb7 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -50,7 +50,7 @@ Laws: in UPLC (via the 'UntypedPlutusCore.Constant' constructor) is a valid @p@. -} class (PConstant (PLifted p), PConstanted (PLifted p) ~ p) => PUnsafeLiftDecl (p :: PType) where - type PLifted p :: Type + type PLifted p = (r :: Type) | r -> p {- | Class of Haskell types `h` that can be represented as a Plutus core builtin and converted to a Plutarch type. @@ -80,7 +80,7 @@ The Haskell type is determined by `PLifted p`. This typeclass is closely tied with 'PConstant'. -} type PLift :: PType -> Constraint -type PLift p = (p ~ (PConstanted (PLifted p)), PUnsafeLiftDecl p) +type PLift p = (p ~ PConstanted (PLifted p), PUnsafeLiftDecl p) {- | Create a Plutarch-level constant, from a Haskell value. Example: @@ -186,7 +186,7 @@ For deriving @PConstant@ for a wrapped type represented in UPLC as @Data@, see @DerivePConstantViaData@. -} type PConstantable :: Type -> Constraint -type PConstantable a = (a ~ (PLifted (PConstanted a)), PUnsafeLiftDecl (PConstanted a), PConstant a) +type PConstantable a = (a ~ PLifted (PConstanted a), PConstant a) instance (PLift p, PLift p', Coercible h (PLifted p')) => PConstant (DerivePConstantViaNewtype h p p') where type PConstantRepr (DerivePConstantViaNewtype h p p') = PConstantRepr (PLifted p') diff --git a/plutarch.cabal b/plutarch.cabal index eb888f62d..e7e01c118 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -62,7 +62,7 @@ common c TraditionalRecordSyntax TupleSections TypeApplications - TypeFamilies + TypeFamilyDependencies TypeOperators TypeSynonymInstances ViewPatterns From aa3c3a23732a8938c511c1d612d28b8fb0eb1a15 Mon Sep 17 00:00:00 2001 From: Geometer1729 <16kuhnb@gmail.com> Date: Wed, 16 Feb 2022 15:57:24 -0500 Subject: [PATCH 312/584] error on division by 0 for rationals --- Plutarch/Rational.hs | 11 ++- .../goldens/rational.compare.bench.golden | 1 + .../goldens/rational.compare.uplc.golden | 1 + .../goldens/rational.ops.bench.golden | 3 + .../goldens/rational.ops.uplc.golden | 3 + plutarch-test/src/Plutarch/RationalSpec.hs | 68 +++++++++++++++++++ 6 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 plutarch-test/goldens/rational.compare.bench.golden create mode 100644 plutarch-test/goldens/rational.compare.uplc.golden create mode 100644 plutarch-test/goldens/rational.ops.bench.golden create mode 100644 plutarch-test/goldens/rational.ops.uplc.golden create mode 100644 plutarch-test/src/Plutarch/RationalSpec.hs diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 88d6cd891..b1ab545b0 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -39,6 +39,7 @@ import Plutarch.Integer (PInteger, PIntegral (pdiv, pmod)) import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) import Plutarch.Pair (PPair (..)) import Plutarch.Show (PShow (pshow'), pshow) +import Plutarch.Trace (ptraceError) import Plutarch.Unsafe (punsafeCoerce) data PRational s @@ -175,7 +176,10 @@ instance Fractional (Term s PRational) where phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - pcon (PRational xd xn) + pif + (xn #== 0) + (ptraceError "division by 0") + (pcon (PRational xd xn)) ) # x' @@ -200,7 +204,10 @@ preduce = phoistAcyclic $ pmatch x $ \(PRational xn xd) -> plet (pgcd # xn # xd) $ \r -> plet (signum xd) $ \s -> - pcon $ PRational (s * pdiv # xn # r) (s * pdiv # xd # r) + pif + (xd #== 0) + (ptraceError "division by 0") + (pcon $ PRational (s * pdiv # xn # r) (s * pdiv # xd # r)) pgcd :: Term s (PInteger :--> PInteger :--> PInteger) pgcd = phoistAcyclic $ diff --git a/plutarch-test/goldens/rational.compare.bench.golden b/plutarch-test/goldens/rational.compare.bench.golden new file mode 100644 index 000000000..c40255379 --- /dev/null +++ b/plutarch-test/goldens/rational.compare.bench.golden @@ -0,0 +1 @@ +< {"exBudgetCPU":26130974,"exBudgetMemory":60877,"scriptSizeBytes":310} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.uplc.golden b/plutarch-test/goldens/rational.compare.uplc.golden new file mode 100644 index 000000000..fc1f1c665 --- /dev/null +++ b/plutarch-test/goldens/rational.compare.uplc.golden @@ -0,0 +1 @@ +< (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i3 0) (delay error) (delay (\i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3)))))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.bench.golden b/plutarch-test/goldens/rational.ops.bench.golden new file mode 100644 index 000000000..9be782a07 --- /dev/null +++ b/plutarch-test/goldens/rational.ops.bench.golden @@ -0,0 +1,3 @@ ++ {"exBudgetCPU":31109957,"exBudgetMemory":73997,"scriptSizeBytes":320} +- {"exBudgetCPU":31109957,"exBudgetMemory":73997,"scriptSizeBytes":320} +* {"exBudgetCPU":56020123,"exBudgetMemory":129577,"scriptSizeBytes":364} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.uplc.golden b/plutarch-test/goldens/rational.ops.uplc.golden new file mode 100644 index 000000000..09550f054 --- /dev/null +++ b/plutarch-test/goldens/rational.ops.uplc.golden @@ -0,0 +1,3 @@ ++ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i3 0) (delay error) (delay (\i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3)))))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i3 0) (delay error) (delay (\i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3)))))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) +* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i3 0) (delay error) (delay (\i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3)))))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/src/Plutarch/RationalSpec.hs b/plutarch-test/src/Plutarch/RationalSpec.hs new file mode 100644 index 000000000..697d3b765 --- /dev/null +++ b/plutarch-test/src/Plutarch/RationalSpec.hs @@ -0,0 +1,68 @@ +module Plutarch.RationalSpec (spec) where + +import Test.Syd + +import Plutarch.Prelude +import Plutarch.Rational (pproperFraction, ptruncate) +import Plutarch.Test + +spec :: Spec +spec = do + describe "rational" $ do + describe "literal" $ do + let p = 0.5 :: Term s PRational + golden PrintTerm p + describe "ops" $ do + let p1 = (1 / 2 + 1 / 2) :: Term s PRational + p2 = 1 / 2 - 1 / 3 :: Term s PRational + p3 = (1 - 3 / 2) * (2 - 5 / 2) :: Term s PRational + goldens + All + [ ("+", p1) + , ("-", p2) + , ("*", p3) + ] + it "+" $ passert $ p1 #== 1 + it "-" $ passert $ p2 #== 1 / 6 + it "*" $ passert $ p3 #== 1 / 4 + it "harmonic-sum" $ + passert $ 1 / 2 + 1 / 3 + 1 / 4 + 1 / 5 #== (77 / 60 :: Term s PRational) + it "multi-product" $ + passert $ 1 / 2 * 2 / 3 * 3 / 4 * 4 / 5 * 5 / 6 #== (1 / 6 :: Term s PRational) + describe "compare" $ do + let p1 = 2 / 9 #< (3 / 10 :: Term s PRational) + goldens All [("<", p1)] + it "<" $ passert p1 + describe "round" $ do + -- NOTE: These will eventually be replaced by property tests. + it "5/3" $ passert $ pround # (5 / 3) #== 2 + it "4/3" $ passert $ pround # (4 / 3) #== 1 + it "-5/2" $ passert $ pround # (-5 / 2) #== -2 + it "-1/4" $ passert $ pround # (-1 / 4) #== 0 + describe "truncate" $ do + it "5/4" $ passert $ ptruncate # (5 / 4) #== 1 + it "7/4" $ passert $ ptruncate # (7 / 4) #== 1 + it "1/4" $ passert $ ptruncate # (1 / 4) #== 0 + it "-7/4" $ passert $ ptruncate # (-7 / 4) #== -1 + describe "properFraction" $ do + it "-1/2" $ + passert $ + pmatch (pproperFraction # (-1 / 2)) $ \(PPair x y) -> + x #== 0 #&& y #== (-1 / 2) + it "-3/2" $ + passert $ + pmatch (pproperFraction # (-3 / 2)) $ \(PPair x y) -> + x #== -1 #&& y #== (-1 / 2) + it "-4/3" $ + passert $ + pmatch (pproperFraction # (-4 / 3)) $ \(PPair x y) -> + x #== -1 #&& y #== (-1 / 3) + describe "data" $ do + describe "id" $ do + it "0.5" $ passert $ (0.5 :: Term s PRational) #== pfromData (pdata 0.5) + it "2" $ passert $ (2 :: Term s PRational) #== pfromData (pdata 2) + it "11/3" $ passert $ (11 / 3 :: Term s PRational) #== pfromData (pdata $ 11 / 3) + describe "div by 0 tests" $ do + it "1/0" $ pfails ((1 :: Term s PRational) / 0) + it "recip 0" $ pfails (recip (0 :: Term s PRational)) + it "1/(1-1)" $ pfails ((1 :: Term s PRational) / (1 - 1)) From e76b88767a1604e7bc345ed67046b2364b65a7cd Mon Sep 17 00:00:00 2001 From: Geometer1729 <16kuhnb@gmail.com> Date: Wed, 16 Feb 2022 16:22:37 -0500 Subject: [PATCH 313/584] abstract out failOnZero --- Plutarch/Rational.hs | 22 +++++++++++-------- .../goldens/rational.compare.bench.golden | 2 +- .../goldens/rational.compare.uplc.golden | 2 +- .../goldens/rational.ops.bench.golden | 6 ++--- .../goldens/rational.ops.uplc.golden | 6 ++--- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index b1ab545b0..9dc47e2ef 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -176,10 +176,7 @@ instance Fractional (Term s PRational) where phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - pif - (xn #== 0) - (ptraceError "division by 0") - (pcon (PRational xd xn)) + pfailOnZero # xn # (pcon (PRational xd xn)) ) # x' @@ -190,7 +187,9 @@ instance Fractional (Term s PRational) where #$ pmatch x $ \(PRational xn xd) -> pmatch y $ \(PRational yn yd) -> - pcon (PRational (xn * yd) (xd * yn)) + plet (xd * yn) $ \den -> + pfailOnZero # den + #$ pcon (PRational (xn * yd) den) ) # x' # y' @@ -198,16 +197,21 @@ instance Fractional (Term s PRational) where fromRational r = pcon $ PRational (fromInteger $ numerator r) (fromInteger $ denominator r) +pfailOnZero :: Term s (PInteger :--> a :--> a) +pfailOnZero = phoistAcyclic $ + plam $ \n x -> + pif + (n #== 0) + (ptraceError "division by 0") + x + preduce :: Term s (PRational :--> PRational) preduce = phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational xn xd) -> plet (pgcd # xn # xd) $ \r -> plet (signum xd) $ \s -> - pif - (xd #== 0) - (ptraceError "division by 0") - (pcon $ PRational (s * pdiv # xn # r) (s * pdiv # xd # r)) + (pcon $ PRational (s * pdiv # xn # r) (s * pdiv # xd # r)) pgcd :: Term s (PInteger :--> PInteger :--> PInteger) pgcd = phoistAcyclic $ diff --git a/plutarch-test/goldens/rational.compare.bench.golden b/plutarch-test/goldens/rational.compare.bench.golden index c40255379..0f0d48761 100644 --- a/plutarch-test/goldens/rational.compare.bench.golden +++ b/plutarch-test/goldens/rational.compare.bench.golden @@ -1 +1 @@ -< {"exBudgetCPU":26130974,"exBudgetMemory":60877,"scriptSizeBytes":310} \ No newline at end of file +< {"exBudgetCPU":26756207,"exBudgetMemory":62977,"scriptSizeBytes":320} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.uplc.golden b/plutarch-test/goldens/rational.compare.uplc.golden index fc1f1c665..65789d8b8 100644 --- a/plutarch-test/goldens/rational.compare.uplc.golden +++ b/plutarch-test/goldens/rational.compare.uplc.golden @@ -1 +1 @@ -< (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i3 0) (delay error) (delay (\i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3)))))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file +< (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.bench.golden b/plutarch-test/goldens/rational.ops.bench.golden index 9be782a07..1845e39ad 100644 --- a/plutarch-test/goldens/rational.ops.bench.golden +++ b/plutarch-test/goldens/rational.ops.bench.golden @@ -1,3 +1,3 @@ -+ {"exBudgetCPU":31109957,"exBudgetMemory":73997,"scriptSizeBytes":320} -- {"exBudgetCPU":31109957,"exBudgetMemory":73997,"scriptSizeBytes":320} -* {"exBudgetCPU":56020123,"exBudgetMemory":129577,"scriptSizeBytes":364} \ No newline at end of file ++ {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} +- {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} +* {"exBudgetCPU":55159921,"exBudgetMemory":128071,"scriptSizeBytes":374} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.uplc.golden b/plutarch-test/goldens/rational.ops.uplc.golden index 09550f054..6009c9ab6 100644 --- a/plutarch-test/goldens/rational.ops.uplc.golden +++ b/plutarch-test/goldens/rational.ops.uplc.golden @@ -1,3 +1,3 @@ -+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i3 0) (delay error) (delay (\i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3)))))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i3 0) (delay error) (delay (\i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3)))))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i3 0) (delay error) (delay (\i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3)))))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file ++ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) \ No newline at end of file From 75a8afa3882125e5029de42a5863b02ac2180fde Mon Sep 17 00:00:00 2001 From: Geometer1729 <16kuhnb@gmail.com> Date: Thu, 17 Feb 2022 09:01:10 -0500 Subject: [PATCH 314/584] remove tests sufix --- plutarch-test/src/Plutarch/RationalSpec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plutarch-test/src/Plutarch/RationalSpec.hs b/plutarch-test/src/Plutarch/RationalSpec.hs index 697d3b765..3598527d0 100644 --- a/plutarch-test/src/Plutarch/RationalSpec.hs +++ b/plutarch-test/src/Plutarch/RationalSpec.hs @@ -62,7 +62,7 @@ spec = do it "0.5" $ passert $ (0.5 :: Term s PRational) #== pfromData (pdata 0.5) it "2" $ passert $ (2 :: Term s PRational) #== pfromData (pdata 2) it "11/3" $ passert $ (11 / 3 :: Term s PRational) #== pfromData (pdata $ 11 / 3) - describe "div by 0 tests" $ do + describe "div by 0" $ do it "1/0" $ pfails ((1 :: Term s PRational) / 0) it "recip 0" $ pfails (recip (0 :: Term s PRational)) it "1/(1-1)" $ pfails ((1 :: Term s PRational) / (1 - 1)) From b81685aa743ed5a932d08c726529bcef0c04d01b Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 00:18:50 +0530 Subject: [PATCH 315/584] Merge staging and update goldens --- Plutarch/Rational.hs | 4 +- plutarch-test/goldens/rational.bench.golden | 21 --- .../goldens/rational.compare.bench.golden | 1 - .../goldens/rational.compare.uplc.golden | 1 - .../goldens/rational.dev=false.bench.golden | 24 ++++ ...en => rational.dev=false.uplc.eval.golden} | 5 +- .../goldens/rational.dev=false.uplc.golden | 24 ++++ .../goldens/rational.dev=true.bench.golden | 24 ++++ .../rational.dev=true.uplc.eval.golden | 24 ++++ .../goldens/rational.dev=true.uplc.golden | 24 ++++ .../goldens/rational.ops.bench.golden | 3 - .../goldens/rational.ops.uplc.golden | 3 - plutarch-test/goldens/rational.uplc.golden | 21 --- plutarch-test/goldens/show.bench.golden | 3 +- .../goldens/show.dev=false.bench.golden | 1 + .../goldens/show.dev=false.uplc.eval.golden | 1 + .../goldens/show.dev=false.uplc.golden | 1 + .../goldens/show.dev=true.bench.golden | 1 + .../goldens/show.dev=true.uplc.eval.golden | 1 + .../goldens/show.dev=true.uplc.golden | 1 + plutarch-test/goldens/show.uplc.eval.golden | 3 +- plutarch-test/goldens/show.uplc.golden | 3 +- .../plutarch-base/Plutarch/RationalSpec.hs | 6 +- .../plutarch-base/Plutarch/ShowSpec.hs | 134 +++++++++--------- plutarch-test/src/Plutarch/RationalSpec.hs | 68 --------- 25 files changed, 208 insertions(+), 194 deletions(-) delete mode 100644 plutarch-test/goldens/rational.bench.golden delete mode 100644 plutarch-test/goldens/rational.compare.bench.golden delete mode 100644 plutarch-test/goldens/rational.compare.uplc.golden create mode 100644 plutarch-test/goldens/rational.dev=false.bench.golden rename plutarch-test/goldens/{rational.uplc.eval.golden => rational.dev=false.uplc.eval.golden} (87%) create mode 100644 plutarch-test/goldens/rational.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/rational.dev=true.bench.golden create mode 100644 plutarch-test/goldens/rational.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/rational.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/rational.ops.bench.golden delete mode 100644 plutarch-test/goldens/rational.ops.uplc.golden delete mode 100644 plutarch-test/goldens/rational.uplc.golden create mode 100644 plutarch-test/goldens/show.dev=false.bench.golden create mode 100644 plutarch-test/goldens/show.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/show.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/show.dev=true.bench.golden create mode 100644 plutarch-test/goldens/show.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/show.dev=true.uplc.golden delete mode 100644 plutarch-test/src/Plutarch/RationalSpec.hs diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 9dc47e2ef..6f570ba92 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -202,7 +202,7 @@ pfailOnZero = phoistAcyclic $ plam $ \n x -> pif (n #== 0) - (ptraceError "division by 0") + (ptraceError "pfailOnZero: division by 0") x preduce :: Term s (PRational :--> PRational) @@ -211,7 +211,7 @@ preduce = phoistAcyclic $ pmatch x $ \(PRational xn xd) -> plet (pgcd # xn # xd) $ \r -> plet (signum xd) $ \s -> - (pcon $ PRational (s * pdiv # xn # r) (s * pdiv # xd # r)) + pcon $ PRational (s * pdiv # xn # r) (s * pdiv # xd # r) pgcd :: Term s (PInteger :--> PInteger :--> PInteger) pgcd = phoistAcyclic $ diff --git a/plutarch-test/goldens/rational.bench.golden b/plutarch-test/goldens/rational.bench.golden deleted file mode 100644 index 58cc9718e..000000000 --- a/plutarch-test/goldens/rational.bench.golden +++ /dev/null @@ -1,21 +0,0 @@ -literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -ops.+ {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} -ops.- {"exBudgetCPU":29624522,"exBudgetMemory":70391,"scriptSizeBytes":309} -ops.* {"exBudgetCPU":53544398,"exBudgetMemory":123567,"scriptSizeBytes":353} -ops.harmonic-sum {"exBudgetCPU":79082665,"exBudgetMemory":181041,"scriptSizeBytes":351} -ops.multi-product {"exBudgetCPU":88311584,"exBudgetMemory":205073,"scriptSizeBytes":364} -compare {"exBudgetCPU":25140684,"exBudgetMemory":58473,"scriptSizeBytes":298} -round.5/3 {"exBudgetCPU":16770462,"exBudgetMemory":34647,"scriptSizeBytes":322} -round.4/3 {"exBudgetCPU":15284005,"exBudgetMemory":31544,"scriptSizeBytes":322} -round.-5/2 {"exBudgetCPU":16459980,"exBudgetMemory":33547,"scriptSizeBytes":336} -round.-1/4 {"exBudgetCPU":15510987,"exBudgetMemory":31646,"scriptSizeBytes":336} -truncate.5/4 {"exBudgetCPU":12715544,"exBudgetMemory":28437,"scriptSizeBytes":273} -truncate.7/4 {"exBudgetCPU":14202001,"exBudgetMemory":31540,"scriptSizeBytes":273} -truncate.1/4 {"exBudgetCPU":11229087,"exBudgetMemory":25334,"scriptSizeBytes":273} -truncate.-7/4 {"exBudgetCPU":16231741,"exBudgetMemory":35147,"scriptSizeBytes":287} -properFraction.-1/2 {"exBudgetCPU":38270534,"exBudgetMemory":87420,"scriptSizeBytes":423} -properFraction.-3/2 {"exBudgetCPU":40073292,"exBudgetMemory":90925,"scriptSizeBytes":428} -properFraction.-4/3 {"exBudgetCPU":40073292,"exBudgetMemory":90925,"scriptSizeBytes":428} -data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.11/3 {"exBudgetCPU":11211248,"exBudgetMemory":26831,"scriptSizeBytes":226} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.bench.golden b/plutarch-test/goldens/rational.compare.bench.golden deleted file mode 100644 index 0f0d48761..000000000 --- a/plutarch-test/goldens/rational.compare.bench.golden +++ /dev/null @@ -1 +0,0 @@ -< {"exBudgetCPU":26756207,"exBudgetMemory":62977,"scriptSizeBytes":320} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.compare.uplc.golden b/plutarch-test/goldens/rational.compare.uplc.golden deleted file mode 100644 index 65789d8b8..000000000 --- a/plutarch-test/goldens/rational.compare.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -< (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=false.bench.golden b/plutarch-test/goldens/rational.dev=false.bench.golden new file mode 100644 index 000000000..4a97891a0 --- /dev/null +++ b/plutarch-test/goldens/rational.dev=false.bench.golden @@ -0,0 +1,24 @@ +literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +ops.+ {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} +ops.- {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} +ops.* {"exBudgetCPU":55159921,"exBudgetMemory":128071,"scriptSizeBytes":374} +ops.harmonic-sum {"exBudgetCPU":82224392,"exBudgetMemory":189749,"scriptSizeBytes":372} +ops.multi-product {"exBudgetCPU":92216413,"exBudgetMemory":215883,"scriptSizeBytes":385} +compare {"exBudgetCPU":26756207,"exBudgetMemory":62977,"scriptSizeBytes":320} +round.5/3 {"exBudgetCPU":17444245,"exBudgetMemory":36449,"scriptSizeBytes":338} +round.4/3 {"exBudgetCPU":15957788,"exBudgetMemory":33346,"scriptSizeBytes":338} +round.-5/2 {"exBudgetCPU":17133763,"exBudgetMemory":35349,"scriptSizeBytes":353} +round.-1/4 {"exBudgetCPU":16184770,"exBudgetMemory":33448,"scriptSizeBytes":353} +truncate.5/4 {"exBudgetCPU":13389327,"exBudgetMemory":30239,"scriptSizeBytes":289} +truncate.7/4 {"exBudgetCPU":14875784,"exBudgetMemory":33342,"scriptSizeBytes":289} +truncate.1/4 {"exBudgetCPU":11902870,"exBudgetMemory":27136,"scriptSizeBytes":289} +truncate.-7/4 {"exBudgetCPU":16905524,"exBudgetMemory":36949,"scriptSizeBytes":303} +properFraction.-1/2 {"exBudgetCPU":39886057,"exBudgetMemory":91924,"scriptSizeBytes":444} +properFraction.-3/2 {"exBudgetCPU":41688815,"exBudgetMemory":95429,"scriptSizeBytes":449} +properFraction.-4/3 {"exBudgetCPU":41688815,"exBudgetMemory":95429,"scriptSizeBytes":449} +data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.11/3 {"exBudgetCPU":11885031,"exBudgetMemory":28633,"scriptSizeBytes":242} +div by 0.1/0 {"exBudgetCPU":221921,"exBudgetMemory":104,"scriptSizeBytes":242} +div by 0.recip 0 {"exBudgetCPU":137969,"exBudgetMemory":102,"scriptSizeBytes":37} +div by 0.1/(1-1) {"exBudgetCPU":9048111,"exBudgetMemory":20136,"scriptSizeBytes":312} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.uplc.eval.golden b/plutarch-test/goldens/rational.dev=false.uplc.eval.golden similarity index 87% rename from plutarch-test/goldens/rational.uplc.eval.golden rename to plutarch-test/goldens/rational.dev=false.uplc.eval.golden index 48def975b..7043e1a1d 100644 --- a/plutarch-test/goldens/rational.uplc.eval.golden +++ b/plutarch-test/goldens/rational.dev=false.uplc.eval.golden @@ -18,4 +18,7 @@ properFraction.-3/2 (program 1.0.0 True) properFraction.-4/3 (program 1.0.0 True) data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 11 1)) (multiplyInteger 1 (divideInteger 3 1)))) \ No newline at end of file +data.id.11/3 (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 11 1)) (multiplyInteger 1 (divideInteger 3 1)))) +div by 0.1/0 (program 1.0.0 error) +div by 0.recip 0 (program 1.0.0 error) +div by 0.1/(1-1) (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=false.uplc.golden b/plutarch-test/goldens/rational.dev=false.uplc.golden new file mode 100644 index 000000000..d5e8b5d4c --- /dev/null +++ b/plutarch-test/goldens/rational.dev=false.uplc.golden @@ -0,0 +1,24 @@ +literal (program 1.0.0 (\i0 -> i1 1 2)) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) +data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay error) (delay i1))) (\i0 -> i1 i2 i3))) (\i0 -> i1 0 1))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.bench.golden b/plutarch-test/goldens/rational.dev=true.bench.golden new file mode 100644 index 000000000..566a00d57 --- /dev/null +++ b/plutarch-test/goldens/rational.dev=true.bench.golden @@ -0,0 +1,24 @@ +literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +ops.+ {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":369} +ops.- {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":369} +ops.* {"exBudgetCPU":55368332,"exBudgetMemory":128771,"scriptSizeBytes":413} +ops.harmonic-sum {"exBudgetCPU":82432803,"exBudgetMemory":190449,"scriptSizeBytes":412} +ops.multi-product {"exBudgetCPU":92424824,"exBudgetMemory":216583,"scriptSizeBytes":424} +compare {"exBudgetCPU":26964618,"exBudgetMemory":63677,"scriptSizeBytes":359} +round.5/3 {"exBudgetCPU":17444245,"exBudgetMemory":36449,"scriptSizeBytes":372} +round.4/3 {"exBudgetCPU":15957788,"exBudgetMemory":33346,"scriptSizeBytes":372} +round.-5/2 {"exBudgetCPU":17133763,"exBudgetMemory":35349,"scriptSizeBytes":387} +round.-1/4 {"exBudgetCPU":16184770,"exBudgetMemory":33448,"scriptSizeBytes":387} +truncate.5/4 {"exBudgetCPU":13389327,"exBudgetMemory":30239,"scriptSizeBytes":323} +truncate.7/4 {"exBudgetCPU":14875784,"exBudgetMemory":33342,"scriptSizeBytes":323} +truncate.1/4 {"exBudgetCPU":11902870,"exBudgetMemory":27136,"scriptSizeBytes":323} +truncate.-7/4 {"exBudgetCPU":16905524,"exBudgetMemory":36949,"scriptSizeBytes":337} +properFraction.-1/2 {"exBudgetCPU":40094468,"exBudgetMemory":92624,"scriptSizeBytes":483} +properFraction.-3/2 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":488} +properFraction.-4/3 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":488} +data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.11/3 {"exBudgetCPU":11885031,"exBudgetMemory":28633,"scriptSizeBytes":277} +div by 0.1/0 {"exBudgetCPU":371921,"exBudgetMemory":136,"scriptSizeBytes":277} +div by 0.recip 0 {"exBudgetCPU":287969,"exBudgetMemory":134,"scriptSizeBytes":71} +div by 0.1/(1-1) {"exBudgetCPU":9198111,"exBudgetMemory":20168,"scriptSizeBytes":346} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.uplc.eval.golden b/plutarch-test/goldens/rational.dev=true.uplc.eval.golden new file mode 100644 index 000000000..7043e1a1d --- /dev/null +++ b/plutarch-test/goldens/rational.dev=true.uplc.eval.golden @@ -0,0 +1,24 @@ +literal (program 1.0.0 (\i0 -> i1 1 2)) +ops.+ (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 4 4)) (multiplyInteger 1 (divideInteger 4 4)))) +ops.- (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) +ops.* (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 4 1)))) +ops.harmonic-sum (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 77 1)) (multiplyInteger 1 (divideInteger 60 1)))) +ops.multi-product (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) +compare (program 1.0.0 True) +round.5/3 (program 1.0.0 2) +round.4/3 (program 1.0.0 1) +round.-5/2 (program 1.0.0 -2) +round.-1/4 (program 1.0.0 0) +truncate.5/4 (program 1.0.0 1) +truncate.7/4 (program 1.0.0 1) +truncate.1/4 (program 1.0.0 0) +truncate.-7/4 (program 1.0.0 -1) +properFraction.-1/2 (program 1.0.0 True) +properFraction.-3/2 (program 1.0.0 True) +properFraction.-4/3 (program 1.0.0 True) +data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) +data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) +data.id.11/3 (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 11 1)) (multiplyInteger 1 (divideInteger 3 1)))) +div by 0.1/0 (program 1.0.0 error) +div by 0.recip 0 (program 1.0.0 error) +div by 0.1/(1-1) (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.uplc.golden b/plutarch-test/goldens/rational.dev=true.uplc.golden new file mode 100644 index 000000000..91818aea0 --- /dev/null +++ b/plutarch-test/goldens/rational.dev=true.uplc.golden @@ -0,0 +1,24 @@ +literal (program 1.0.0 (\i0 -> i1 1 2)) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) +data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 i2 i3))) (\i0 -> i1 0 1))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.bench.golden b/plutarch-test/goldens/rational.ops.bench.golden deleted file mode 100644 index 1845e39ad..000000000 --- a/plutarch-test/goldens/rational.ops.bench.golden +++ /dev/null @@ -1,3 +0,0 @@ -+ {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} -- {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} -* {"exBudgetCPU":55159921,"exBudgetMemory":128071,"scriptSizeBytes":374} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.ops.uplc.golden b/plutarch-test/goldens/rational.ops.uplc.golden deleted file mode 100644 index 6009c9ab6..000000000 --- a/plutarch-test/goldens/rational.ops.uplc.golden +++ /dev/null @@ -1,3 +0,0 @@ -+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.uplc.golden b/plutarch-test/goldens/rational.uplc.golden deleted file mode 100644 index 100e5a64a..000000000 --- a/plutarch-test/goldens/rational.uplc.golden +++ /dev/null @@ -1,21 +0,0 @@ -literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i13 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i13 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i13 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i13 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i13 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i13 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i13 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i13 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i13 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) -data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) -data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index e583af80d..00a08cd7b 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -32,5 +32,4 @@ list.1,2,3 {"exBudgetCPU":29411680,"exBudgetMemory":66720,"scriptSizeBytes":413} builtinlist.nil {"exBudgetCPU":3519719,"exBudgetMemory":10435,"scriptSizeBytes":401} builtinlist.1,2,3 {"exBudgetCPU":26855742,"exBudgetMemory":56248,"scriptSizeBytes":404} pair.int-str {"exBudgetCPU":35143888,"exBudgetMemory":77331,"scriptSizeBytes":464} -pair.int-list {"exBudgetCPU":41712616,"exBudgetMemory":86350,"scriptSizeBytes":443} -rational.1/2 {"exBudgetCPU":23497485,"exBudgetMemory":51676,"scriptSizeBytes":546} \ No newline at end of file +pair.int-list {"exBudgetCPU":41712616,"exBudgetMemory":86350,"scriptSizeBytes":443} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.bench.golden b/plutarch-test/goldens/show.dev=false.bench.golden new file mode 100644 index 000000000..5dff81677 --- /dev/null +++ b/plutarch-test/goldens/show.dev=false.bench.golden @@ -0,0 +1 @@ +rational.1/2 {"exBudgetCPU":24171268,"exBudgetMemory":53478,"scriptSizeBytes":562} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.uplc.eval.golden b/plutarch-test/goldens/show.dev=false.uplc.eval.golden new file mode 100644 index 000000000..97ecea086 --- /dev/null +++ b/plutarch-test/goldens/show.dev=false.uplc.eval.golden @@ -0,0 +1 @@ +rational.1/2 (program 1.0.0 "1/2") \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.uplc.golden b/plutarch-test/goldens/show.dev=false.uplc.golden new file mode 100644 index 000000000..3f77234a2 --- /dev/null +++ b/plutarch-test/goldens/show.dev=false.uplc.golden @@ -0,0 +1 @@ +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i24 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.bench.golden b/plutarch-test/goldens/show.dev=true.bench.golden new file mode 100644 index 000000000..ce15d96c2 --- /dev/null +++ b/plutarch-test/goldens/show.dev=true.bench.golden @@ -0,0 +1 @@ +rational.1/2 {"exBudgetCPU":24171268,"exBudgetMemory":53478,"scriptSizeBytes":595} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.uplc.eval.golden b/plutarch-test/goldens/show.dev=true.uplc.eval.golden new file mode 100644 index 000000000..97ecea086 --- /dev/null +++ b/plutarch-test/goldens/show.dev=true.uplc.eval.golden @@ -0,0 +1 @@ +rational.1/2 (program 1.0.0 "1/2") \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.uplc.golden b/plutarch-test/goldens/show.dev=true.uplc.golden new file mode 100644 index 000000000..328405ea7 --- /dev/null +++ b/plutarch-test/goldens/show.dev=true.uplc.golden @@ -0,0 +1 @@ +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i24 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden index fe0f3a9aa..d1efb455b 100644 --- a/plutarch-test/goldens/show.uplc.eval.golden +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -32,5 +32,4 @@ list.1,2,3 (program 1.0.0 "[1, 2, 3]") builtinlist.nil (program 1.0.0 "[]") builtinlist.1,2,3 (program 1.0.0 "[1, 2, 3]") pair.int-str (program 1.0.0 "PPair 42 \"hello\"") -pair.int-list (program 1.0.0 "PPair 42 [1, 2, 3]") -rational.1/2 (program 1.0.0 "1/2") \ No newline at end of file +pair.int-list (program 1.0.0 "PPair 42 [1, 2, 3]") \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index ba0751890..f8fcfce97 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -32,5 +32,4 @@ list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) []) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i15 (appendString (i16 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i20 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i19 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i2) (appendString i15 (appendString i18 (appendString (decodeUtf8 (i16 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i21 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i18))))))) (\i0 -> i1 42 "hello")) (\i0 -> force (i14 (equalsInteger i1 0) (delay i2) (delay (force (i14 (equalsInteger i1 1) (delay i3) (delay (force (i14 (equalsInteger i1 2) (delay i4) (delay (force (i14 (equalsInteger i1 3) (delay i5) (delay (force (i14 (equalsInteger i1 4) (delay i6) (delay (force (i14 (equalsInteger i1 5) (delay i7) (delay (force (i14 (equalsInteger i1 6) (delay i8) (delay (force (i14 (equalsInteger i1 7) (delay i9) (delay (force (i14 (equalsInteger i1 8) (delay i10) (delay (force (i14 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") " ") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse)) "\"")) -pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i25 i2))) (delay (appendString (i9 (i25 i2)) (appendString ", " (i3 (i26 i2))))))) (i25 i1))))) i1) "]"))))))) (\i0 -> i1 42 [1,2,3])) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i2) (multiplyInteger i4 i3))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file +pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i25 i2))) (delay (appendString (i9 (i25 i2)) (appendString ", " (i3 (i26 i2))))))) (i25 i1))))) i1) "]"))))))) (\i0 -> i1 42 [1,2,3])) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs index 7635751d7..a5f8d295f 100644 --- a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs @@ -11,7 +11,7 @@ spec = do rat = id assertRat :: ClosedTerm PRational -> ClosedTerm PRational -> Expectation assertRat x p = passert $ p #== x - describe "rational" . pgoldenSpec $ do + describe "rational" . plutarchDevFlagDescribe . pgoldenSpec $ do "literal" @| rat 0.5 "ops" @\ do "+" @| rat (1 / 2 + 1 / 2) @-> assertRat 1 @@ -44,3 +44,7 @@ spec = do "0.5" @| rat 0.5 @-> assertRat (pfromData (pdata 0.5)) "2" @| rat 2 @-> assertRat (pfromData (pdata 2)) "11/3" @| rat 11 / 3 @-> assertRat (pfromData (pdata $ 11 / 3)) + "div by 0" @\ do + "1/0" @| ((1 :: Term s PRational) / 0) @-> pfails + "recip 0" @| recip (0 :: Term s PRational) @-> pfails + "1/(1-1)" @| ((1 :: Term s PRational) / (1 - 1)) @-> pfails diff --git a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs index 816862fb6..a954ba258 100644 --- a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs @@ -11,69 +11,71 @@ import Test.Hspec spec :: Spec spec = do - describe "show" . pgoldenSpec $ do - let str x = pconstant @PString x - "unit" @| pshow (pcon PUnit) @== str "()" - "bool" @\ do - "true" @| pshow (pcon PTrue) @== str "PTrue" - "false" @| pshow (pcon PFalse) @== str "PFalse" - "int" @\ do - "0" @| pshow (pconstant @PInteger 0) @== str "0" - forM_ [5, 10, 14, 102] $ \n -> do - (fromString $ show n) - @| pshow (pconstant @PInteger n) - @== pconstant (T.pack $ show n) - (fromString $ show (-n)) - @| pshow (pconstant @PInteger (-n)) - @== pconstant (T.pack $ show (-n)) - "bytestring" @\ do - "empty" @| pshow (phexByteStr "") @== str "0x" - "1" @| pshow (phexByteStr "14") @== str "0x14" - "2" @| pshow (phexByteStr "14AF") @== str "0x14af" - "3" @| pshow (phexByteStr "14AF03") @== str "0x14af03" - "n" @| pshow (phexByteStr "FFFFFF") @== str "0xffffff" - "0" @| pshow (phexByteStr "000000") @== str "0x000000" - "str" @\ do - "empty" @| pshow (str "") @== str "\"\"" - "hello123" @| pshow (str "hello123") @== str "\"hello123\"" - "quoted" @| pshow (str "hello\"123") @== str "\"hello\\\"123\"" - "slash" @| pshow (str "foo\\bar") @== str "\"foo\\bar\"" - "unicode" @| pshow (str "vis-à-vis") @== str "\"vis-à-vis\"" - "unicode-quoted" @| pshow (str "vis-\"à\"-vis") @== str "\"vis-\\\"à\\\"-vis\"" - "maybe" @\ do - "nothing" - @| pshow @(PMaybe PInteger) (pcon PNothing) - @== str "PNothing" - "just" - @| pshow @(PMaybe PInteger) (pcon $ PJust $ pconstant @PInteger 42) - @== str "PJust 42" - "either" @\ do - "right" - @| pshow (pcon @(PEither PUnit PInteger) $ PRight 42) - @== str "PRight 42" - -- Test automatic injection of `(..)`. - "maybe.either" - @| pshow (pcon $ PJust $ pcon @(PEither PInteger PUnit) $ PLeft 42) - @== str "PJust (PLeft 42)" - "list" @\ do - "nil" @| pshow (integerList []) @== str "[]" - "1" @| pshow (integerList [1]) @== str "[1]" - "1,2,3" @| pshow (integerList [1, 2, 3]) @== str "[1, 2, 3]" - "builtinlist" @\ do - let xs3 = pconstant @(PBuiltinList PInteger) [1, 2, 3] - xs0 = pconstant @(PBuiltinList PInteger) [] - "nil" @| pshow xs0 @== str "[]" - "1,2,3" @| pshow xs3 @== str "[1, 2, 3]" - "pair" @\ do - "int-str" - @| pshow (pcon @(PPair PInteger PString) $ PPair 42 "hello") - @== str "PPair 42 \"hello\"" - "int-list" - @| pshow (pcon @(PPair PInteger (PBuiltinList PInteger)) $ PPair 42 $ pconstant [1, 2, 3]) - @== str "PPair 42 [1, 2, 3]" - "rational" @\ do - let rat :: Term s PRational -> Term s PRational - rat = id - "1/2" - @| pshow (rat $ 1 / 2) - @== str "1/2" + let str x = pconstant @PString x + describe "show" $ do + pgoldenSpec $ do + "unit" @| pshow (pcon PUnit) @== str "()" + "bool" @\ do + "true" @| pshow (pcon PTrue) @== str "PTrue" + "false" @| pshow (pcon PFalse) @== str "PFalse" + "int" @\ do + "0" @| pshow (pconstant @PInteger 0) @== str "0" + forM_ [5, 10, 14, 102] $ \n -> do + (fromString $ show n) + @| pshow (pconstant @PInteger n) + @== pconstant (T.pack $ show n) + (fromString $ show (-n)) + @| pshow (pconstant @PInteger (-n)) + @== pconstant (T.pack $ show (-n)) + "bytestring" @\ do + "empty" @| pshow (phexByteStr "") @== str "0x" + "1" @| pshow (phexByteStr "14") @== str "0x14" + "2" @| pshow (phexByteStr "14AF") @== str "0x14af" + "3" @| pshow (phexByteStr "14AF03") @== str "0x14af03" + "n" @| pshow (phexByteStr "FFFFFF") @== str "0xffffff" + "0" @| pshow (phexByteStr "000000") @== str "0x000000" + "str" @\ do + "empty" @| pshow (str "") @== str "\"\"" + "hello123" @| pshow (str "hello123") @== str "\"hello123\"" + "quoted" @| pshow (str "hello\"123") @== str "\"hello\\\"123\"" + "slash" @| pshow (str "foo\\bar") @== str "\"foo\\bar\"" + "unicode" @| pshow (str "vis-à-vis") @== str "\"vis-à-vis\"" + "unicode-quoted" @| pshow (str "vis-\"à\"-vis") @== str "\"vis-\\\"à\\\"-vis\"" + "maybe" @\ do + "nothing" + @| pshow @(PMaybe PInteger) (pcon PNothing) + @== str "PNothing" + "just" + @| pshow @(PMaybe PInteger) (pcon $ PJust $ pconstant @PInteger 42) + @== str "PJust 42" + "either" @\ do + "right" + @| pshow (pcon @(PEither PUnit PInteger) $ PRight 42) + @== str "PRight 42" + -- Test automatic injection of `(..)`. + "maybe.either" + @| pshow (pcon $ PJust $ pcon @(PEither PInteger PUnit) $ PLeft 42) + @== str "PJust (PLeft 42)" + "list" @\ do + "nil" @| pshow (integerList []) @== str "[]" + "1" @| pshow (integerList [1]) @== str "[1]" + "1,2,3" @| pshow (integerList [1, 2, 3]) @== str "[1, 2, 3]" + "builtinlist" @\ do + let xs3 = pconstant @(PBuiltinList PInteger) [1, 2, 3] + xs0 = pconstant @(PBuiltinList PInteger) [] + "nil" @| pshow xs0 @== str "[]" + "1,2,3" @| pshow xs3 @== str "[1, 2, 3]" + "pair" @\ do + "int-str" + @| pshow (pcon @(PPair PInteger PString) $ PPair 42 "hello") + @== str "PPair 42 \"hello\"" + "int-list" + @| pshow (pcon @(PPair PInteger (PBuiltinList PInteger)) $ PPair 42 $ pconstant [1, 2, 3]) + @== str "PPair 42 [1, 2, 3]" + plutarchDevFlagDescribe . pgoldenSpec $ do + "rational" @\ do + let rat :: Term s PRational -> Term s PRational + rat = id + "1/2" + @| pshow (rat $ 1 / 2) + @== str "1/2" diff --git a/plutarch-test/src/Plutarch/RationalSpec.hs b/plutarch-test/src/Plutarch/RationalSpec.hs deleted file mode 100644 index 3598527d0..000000000 --- a/plutarch-test/src/Plutarch/RationalSpec.hs +++ /dev/null @@ -1,68 +0,0 @@ -module Plutarch.RationalSpec (spec) where - -import Test.Syd - -import Plutarch.Prelude -import Plutarch.Rational (pproperFraction, ptruncate) -import Plutarch.Test - -spec :: Spec -spec = do - describe "rational" $ do - describe "literal" $ do - let p = 0.5 :: Term s PRational - golden PrintTerm p - describe "ops" $ do - let p1 = (1 / 2 + 1 / 2) :: Term s PRational - p2 = 1 / 2 - 1 / 3 :: Term s PRational - p3 = (1 - 3 / 2) * (2 - 5 / 2) :: Term s PRational - goldens - All - [ ("+", p1) - , ("-", p2) - , ("*", p3) - ] - it "+" $ passert $ p1 #== 1 - it "-" $ passert $ p2 #== 1 / 6 - it "*" $ passert $ p3 #== 1 / 4 - it "harmonic-sum" $ - passert $ 1 / 2 + 1 / 3 + 1 / 4 + 1 / 5 #== (77 / 60 :: Term s PRational) - it "multi-product" $ - passert $ 1 / 2 * 2 / 3 * 3 / 4 * 4 / 5 * 5 / 6 #== (1 / 6 :: Term s PRational) - describe "compare" $ do - let p1 = 2 / 9 #< (3 / 10 :: Term s PRational) - goldens All [("<", p1)] - it "<" $ passert p1 - describe "round" $ do - -- NOTE: These will eventually be replaced by property tests. - it "5/3" $ passert $ pround # (5 / 3) #== 2 - it "4/3" $ passert $ pround # (4 / 3) #== 1 - it "-5/2" $ passert $ pround # (-5 / 2) #== -2 - it "-1/4" $ passert $ pround # (-1 / 4) #== 0 - describe "truncate" $ do - it "5/4" $ passert $ ptruncate # (5 / 4) #== 1 - it "7/4" $ passert $ ptruncate # (7 / 4) #== 1 - it "1/4" $ passert $ ptruncate # (1 / 4) #== 0 - it "-7/4" $ passert $ ptruncate # (-7 / 4) #== -1 - describe "properFraction" $ do - it "-1/2" $ - passert $ - pmatch (pproperFraction # (-1 / 2)) $ \(PPair x y) -> - x #== 0 #&& y #== (-1 / 2) - it "-3/2" $ - passert $ - pmatch (pproperFraction # (-3 / 2)) $ \(PPair x y) -> - x #== -1 #&& y #== (-1 / 2) - it "-4/3" $ - passert $ - pmatch (pproperFraction # (-4 / 3)) $ \(PPair x y) -> - x #== -1 #&& y #== (-1 / 3) - describe "data" $ do - describe "id" $ do - it "0.5" $ passert $ (0.5 :: Term s PRational) #== pfromData (pdata 0.5) - it "2" $ passert $ (2 :: Term s PRational) #== pfromData (pdata 2) - it "11/3" $ passert $ (11 / 3 :: Term s PRational) #== pfromData (pdata $ 11 / 3) - describe "div by 0" $ do - it "1/0" $ pfails ((1 :: Term s PRational) / 0) - it "recip 0" $ pfails (recip (0 :: Term s PRational)) - it "1/(1-1)" $ pfails ((1 :: Term s PRational) / (1 - 1)) From a7203febc7c4e4e9dd836a0a9207d2fe8816dc94 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 17:22:19 +0530 Subject: [PATCH 316/584] Address review comments --- Plutarch/Api/V1/Contexts.hs | 19 ++++++++++--------- Plutarch/Api/V1/Tx.hs | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 652369143..d81b302a1 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -40,16 +40,16 @@ newtype PTxInfo (s :: S) ( Term s ( PDataRecord - '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- ^ Transaction inputs - , "outputs" ':= PBuiltinList (PAsData PTxOut) -- ^ Transaction outputs - , "fee" ':= PValue -- ^ The fee paid by this transaction. - , "mint" ':= PValue -- ^ The value minted by the transaction. - , "dcert" ':= PBuiltinList (PAsData PDCert) -- ^ Digests of the certificates included in this transaction. - , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- ^ Staking withdrawals - , "validRange" ':= PPOSIXTimeRange -- ^ The valid range for the transaction. - , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) -- ^ Signatories attesting that they all signed the tx. + '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- Transaction inputs + , "outputs" ':= PBuiltinList (PAsData PTxOut) -- Transaction outputs + , "fee" ':= PValue -- The fee paid by this transaction. + , "mint" ':= PValue -- The value minted by the transaction. + , "dcert" ':= PBuiltinList (PAsData PDCert) -- Digests of the certificates included in this transaction. + , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- Staking withdrawals + , "validRange" ':= PPOSIXTimeRange -- The valid range for the transaction. + , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) -- Signatories attesting that they all signed the tx. , "data" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) - , "id" ':= PTxId -- ^ The hash of the pending transaction. + , "id" ':= PTxId -- The hash of the pending transaction. ] ) ) @@ -85,6 +85,7 @@ instance PUnsafeLiftDecl PScriptContext where type PLifted PScriptContext = Plut deriving via (DerivePConstantViaData Plutus.ScriptContext PScriptContext) instance (PConstant Plutus.ScriptContext) -- General types, used by V1 and V2 + -- | The purpose of the script that is currently running data PScriptPurpose (s :: S) = PMinting (Term s (PDataRecord '["_0" ':= PCurrencySymbol])) diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 6c2d3cc5e..889e1fdc9 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -40,7 +40,7 @@ newtype PTxId (s :: S) instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId deriving via (DerivePConstantViaData Plutus.TxId PTxId) instance (PConstant Plutus.TxId) --- | Reference to a transaction output with a index referencing which of the outputs is being referred to. +-- | Reference to a transaction output with a index referencing which of the outputs is being referred to. newtype PTxOutRef (s :: S) = PTxOutRef ( Term @@ -61,7 +61,7 @@ newtype PTxOutRef (s :: S) instance PUnsafeLiftDecl PTxOutRef where type PLifted PTxOutRef = Plutus.TxOutRef deriving via (DerivePConstantViaData Plutus.TxOutRef PTxOutRef) instance (PConstant Plutus.TxOutRef) --- | A input of a pending transaction. +-- | A input of the pending transaction. newtype PTxInInfo (s :: S) = PTxInInfo ( Term From 4e7c2ae2cc92d6bc7dce0b07c368a2512a349203 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 20:21:03 +0530 Subject: [PATCH 317/584] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43a945d6c..99b4d321e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -123,6 +123,10 @@ Added by: [#371](https://github.com/Plutonomicon/plutarch/pull/371) +- Add `PlutusType` instance for `PDataSum`. `PDataSum` can now be hand-constructed. + + Added by: [#345](https://github.com/Plutonomicon/plutarch/pull/345) + # 1.1.0 - General repository changes. From 0b884a89729afc1b6a0abf0426064f7e8a418235 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 20:23:19 +0530 Subject: [PATCH 318/584] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43a945d6c..eb141b55e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -123,6 +123,10 @@ Added by: [#371](https://github.com/Plutonomicon/plutarch/pull/371) +- Make `PRational` construction machinery fail when the denominator is 0. + + Fixed by: [#299](https://github.com/Plutonomicon/plutarch/pull/299) + # 1.1.0 - General repository changes. From ecc6777136ee72f36f6ea3f65b69b5d01c8cb046 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 21:48:42 +0530 Subject: [PATCH 319/584] Rename `PConstant` -> `PConstantDecl` Also simplify several places in the codebase And demonstrate usage of `PConstant` and `PLift` --- Plutarch/Api/V1/Address.hs | 7 ++-- Plutarch/Api/V1/AssocMap.hs | 21 +++------- Plutarch/Api/V1/Contexts.hs | 7 ++-- Plutarch/Api/V1/Crypto.hs | 3 +- Plutarch/Api/V1/DCert.hs | 4 +- Plutarch/Api/V1/Maybe.hs | 17 ++------ Plutarch/Api/V1/Scripts.hs | 13 ++++--- Plutarch/Api/V1/Time.hs | 3 +- Plutarch/Api/V1/Tx.hs | 9 +++-- Plutarch/Api/V1/Value.hs | 7 ++-- Plutarch/Bool.hs | 4 +- Plutarch/Builtin.hs | 9 +++-- Plutarch/ByteString.hs | 4 +- Plutarch/DataRepr.hs | 4 +- Plutarch/DataRepr/Internal.hs | 33 +++++++++------- Plutarch/Integer.hs | 4 +- Plutarch/Lift.hs | 39 ++++++++++++------- Plutarch/Prelude.hs | 2 + Plutarch/String.hs | 4 +- Plutarch/Unit.hs | 4 +- .../plutarch-base/Plutarch/POrdSpec.hs | 14 +++---- .../plutarch-base/Plutarch/SpecTypes.hs | 16 ++------ 22 files changed, 113 insertions(+), 115 deletions(-) diff --git a/Plutarch/Api/V1/Address.hs b/Plutarch/Api/V1/Address.hs index 40412de7e..7bbbebe91 100644 --- a/Plutarch/Api/V1/Address.hs +++ b/Plutarch/Api/V1/Address.hs @@ -21,6 +21,7 @@ import Plutarch.DataRepr ( PIsDataReprInstances (PIsDataReprInstances), ) import Plutarch.Lift ( + PConstantDecl, PLifted, PUnsafeLiftDecl, ) @@ -37,7 +38,7 @@ data PCredential (s :: S) via (PIsDataReprInstances PCredential) instance PUnsafeLiftDecl PCredential where type PLifted PCredential = Plutus.Credential -deriving via (DerivePConstantViaData Plutus.Credential PCredential) instance (PConstant Plutus.Credential) +deriving via (DerivePConstantViaData Plutus.Credential PCredential) instance PConstantDecl Plutus.Credential data PStakingCredential (s :: S) = PStakingHash (Term s (PDataRecord '["_0" ':= PCredential])) @@ -59,7 +60,7 @@ data PStakingCredential (s :: S) via PIsDataReprInstances PStakingCredential instance PUnsafeLiftDecl PStakingCredential where type PLifted PStakingCredential = Plutus.StakingCredential -deriving via (DerivePConstantViaData Plutus.StakingCredential PStakingCredential) instance (PConstant Plutus.StakingCredential) +deriving via (DerivePConstantViaData Plutus.StakingCredential PStakingCredential) instance PConstantDecl Plutus.StakingCredential newtype PAddress (s :: S) = PAddress @@ -79,4 +80,4 @@ newtype PAddress (s :: S) via PIsDataReprInstances PAddress instance PUnsafeLiftDecl PAddress where type PLifted PAddress = Plutus.Address -deriving via (DerivePConstantViaData Plutus.Address PAddress) instance (PConstant Plutus.Address) +deriving via (DerivePConstantViaData Plutus.Address PAddress) instance PConstantDecl Plutus.Address diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 63f83505d..7853d5489 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -10,6 +10,7 @@ import qualified PlutusTx.AssocMap as PlutusMap import Plutarch.Builtin (PBuiltinMap) import Plutarch.Lift ( + PConstantDecl, PConstantRepr, PConstanted, PLifted, @@ -23,12 +24,8 @@ newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v) deriving (PlutusType, PIsData) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) instance - ( Plutus.ToData (PLifted v) - , Plutus.ToData (PLifted k) - , Plutus.FromData (PLifted v) - , Plutus.FromData (PLifted k) - , PLift k - , PLift v + ( PLiftData k + , PLiftData v , Ord (PLifted k) ) => PUnsafeLiftDecl (PMap k v) @@ -36,17 +33,11 @@ instance type PLifted (PMap k v) = PlutusMap.Map (PLifted k) (PLifted v) instance - ( PLifted (PConstanted k) ~ k - , PLifted (PConstanted v) ~ v - , Plutus.ToData v - , Plutus.FromData v - , Plutus.ToData k - , Plutus.FromData k - , PConstant v - , PConstant k + ( PConstantData k + , PConstantData v , Ord k ) => - PConstant (PlutusMap.Map k v) + PConstantDecl (PlutusMap.Map k v) where type PConstantRepr (PlutusMap.Map k v) = [(Plutus.Data, Plutus.Data)] type PConstanted (PlutusMap.Map k v) = PMap (PConstanted k) (PConstanted v) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 8be0264eb..b1b9b7deb 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -29,6 +29,7 @@ import Plutarch.DataRepr ( PIsDataReprInstances (PIsDataReprInstances), ) import Plutarch.Lift ( + PConstantDecl, PLifted, PUnsafeLiftDecl, ) @@ -60,7 +61,7 @@ newtype PTxInfo (s :: S) via PIsDataReprInstances PTxInfo instance PUnsafeLiftDecl PTxInfo where type PLifted PTxInfo = Plutus.TxInfo -deriving via (DerivePConstantViaData Plutus.TxInfo PTxInfo) instance (PConstant Plutus.TxInfo) +deriving via (DerivePConstantViaData Plutus.TxInfo PTxInfo) instance PConstantDecl Plutus.TxInfo newtype PScriptContext (s :: S) = PScriptContext @@ -80,7 +81,7 @@ newtype PScriptContext (s :: S) via PIsDataReprInstances PScriptContext instance PUnsafeLiftDecl PScriptContext where type PLifted PScriptContext = Plutus.ScriptContext -deriving via (DerivePConstantViaData Plutus.ScriptContext PScriptContext) instance (PConstant Plutus.ScriptContext) +deriving via (DerivePConstantViaData Plutus.ScriptContext PScriptContext) instance PConstantDecl Plutus.ScriptContext -- General types, used by V1 and V2 @@ -97,4 +98,4 @@ data PScriptPurpose (s :: S) via (PIsDataReprInstances PScriptPurpose) instance PUnsafeLiftDecl PScriptPurpose where type PLifted PScriptPurpose = Plutus.ScriptPurpose -deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) instance (PConstant Plutus.ScriptPurpose) +deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) instance PConstantDecl Plutus.ScriptPurpose diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index b80c7e370..3619b6b38 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -9,6 +9,7 @@ import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), + PConstantDecl, PLifted, PUnsafeLiftDecl, ) @@ -21,4 +22,4 @@ instance PUnsafeLiftDecl PPubKeyHash where type PLifted PPubKeyHash = Plutus.Pub deriving via (DerivePConstantViaBuiltin Plutus.PubKeyHash PPubKeyHash PByteString) instance - (PConstant Plutus.PubKeyHash) + PConstantDecl Plutus.PubKeyHash diff --git a/Plutarch/Api/V1/DCert.hs b/Plutarch/Api/V1/DCert.hs index 9375a36a6..5c0e8e4cf 100644 --- a/Plutarch/Api/V1/DCert.hs +++ b/Plutarch/Api/V1/DCert.hs @@ -24,7 +24,7 @@ import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PIsDataReprInstances (PIsDataReprInstances), ) -import Plutarch.Lift (PLifted, PUnsafeLiftDecl) +import Plutarch.Lift (PConstantDecl, PLifted, PUnsafeLiftDecl) import Plutarch.Prelude data PDCert (s :: S) @@ -51,4 +51,4 @@ data PDCert (s :: S) via (PIsDataReprInstances PDCert) instance PUnsafeLiftDecl PDCert where type PLifted PDCert = Plutus.DCert -deriving via (DerivePConstantViaData Plutus.DCert PDCert) instance (PConstant Plutus.DCert) +deriving via (DerivePConstantViaData Plutus.DCert PDCert) instance PConstantDecl Plutus.DCert diff --git a/Plutarch/Api/V1/Maybe.hs b/Plutarch/Api/V1/Maybe.hs index 8c3f70e81..f2eb2de88 100644 --- a/Plutarch/Api/V1/Maybe.hs +++ b/Plutarch/Api/V1/Maybe.hs @@ -7,7 +7,6 @@ module Plutarch.Api.V1.Maybe ( import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -import qualified PlutusTx import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.DataRepr.Internal ( @@ -17,7 +16,7 @@ import Plutarch.DataRepr.Internal ( ) import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Lift ( - PConstant (PConstanted), + PConstantDecl (PConstanted), PUnsafeLiftDecl (..), ) import Plutarch.Prelude @@ -34,23 +33,13 @@ data PMaybeData a (s :: S) (PlutusType, PIsData, PEq) via PIsDataReprInstances (PMaybeData a) -instance - ( PConstanted (PLifted a) ~ a - , PlutusTx.FromData (PLifted a) - , PlutusTx.ToData (PLifted a) - ) => - PUnsafeLiftDecl (PMaybeData a) - where +instance PLiftData a => PUnsafeLiftDecl (PMaybeData a) where type PLifted (PMaybeData a) = Maybe (PLifted a) deriving via (DerivePConstantViaData (Maybe a) (PMaybeData (PConstanted a))) instance - ( PlutusTx.FromData a - , PlutusTx.ToData a - , PLifted (PConstanted a) ~ a - ) => - PConstant (Maybe a) + PConstantData a => PConstantDecl (Maybe a) -- Have to manually write this instance because the constructor id ordering is screwed for 'Maybe'.... instance (PIsData a, POrd a) => POrd (PMaybeData a) where diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index cda6d5aa7..f4c291432 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -15,6 +15,7 @@ import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), + PConstantDecl, PLifted, PUnsafeLiftDecl, ) @@ -24,19 +25,19 @@ newtype PDatum (s :: S) = PDatum (Term s PData) deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PDatum PData) instance PUnsafeLiftDecl PDatum where type PLifted PDatum = Plutus.Datum -deriving via (DerivePConstantViaBuiltin Plutus.Datum PDatum PData) instance (PConstant Plutus.Datum) +deriving via (DerivePConstantViaBuiltin Plutus.Datum PDatum PData) instance PConstantDecl Plutus.Datum newtype PRedeemer (s :: S) = PRedeemer (Term s PData) deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PRedeemer PData) instance PUnsafeLiftDecl PRedeemer where type PLifted PRedeemer = Plutus.Redeemer -deriving via (DerivePConstantViaBuiltin Plutus.Redeemer PRedeemer PData) instance (PConstant Plutus.Redeemer) +deriving via (DerivePConstantViaBuiltin Plutus.Redeemer PRedeemer PData) instance PConstantDecl Plutus.Redeemer newtype PDatumHash (s :: S) = PDatumHash (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PDatumHash PByteString) instance PUnsafeLiftDecl PDatumHash where type PLifted PDatumHash = Plutus.DatumHash -deriving via (DerivePConstantViaBuiltin Plutus.DatumHash PDatumHash PByteString) instance (PConstant Plutus.DatumHash) +deriving via (DerivePConstantViaBuiltin Plutus.DatumHash PDatumHash PByteString) instance PConstantDecl Plutus.DatumHash newtype PStakeValidatorHash (s :: S) = PStakeValidatorHash (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PStakeValidatorHash PByteString) @@ -45,7 +46,7 @@ instance PUnsafeLiftDecl PStakeValidatorHash where type PLifted PStakeValidatorH deriving via (DerivePConstantViaBuiltin Plutus.StakeValidatorHash PStakeValidatorHash PByteString) instance - (PConstant Plutus.StakeValidatorHash) + PConstantDecl Plutus.StakeValidatorHash newtype PRedeemerHash (s :: S) = PRedeemerHash (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PRedeemerHash PByteString) @@ -54,7 +55,7 @@ instance PUnsafeLiftDecl PRedeemerHash where type PLifted PRedeemerHash = Plutus deriving via (DerivePConstantViaBuiltin Plutus.RedeemerHash PRedeemerHash PByteString) instance - (PConstant Plutus.RedeemerHash) + PConstantDecl Plutus.RedeemerHash newtype PValidatorHash (s :: S) = PValidatorHash (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PValidatorHash PByteString) @@ -63,4 +64,4 @@ instance PUnsafeLiftDecl PValidatorHash where type PLifted PValidatorHash = Plut deriving via (DerivePConstantViaBuiltin Plutus.ValidatorHash PValidatorHash PByteString) instance - (PConstant Plutus.ValidatorHash) + PConstantDecl Plutus.ValidatorHash diff --git a/Plutarch/Api/V1/Time.hs b/Plutarch/Api/V1/Time.hs index 44f022666..bb62a6e1f 100644 --- a/Plutarch/Api/V1/Time.hs +++ b/Plutarch/Api/V1/Time.hs @@ -11,6 +11,7 @@ import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Api.V1.Interval (PInterval) import Plutarch.Lift ( DerivePConstantViaNewtype (DerivePConstantViaNewtype), + PConstantDecl, PLifted, PUnsafeLiftDecl, ) @@ -24,6 +25,6 @@ instance PUnsafeLiftDecl PPOSIXTime where type PLifted PPOSIXTime = Plutus.POSIX deriving via (DerivePConstantViaNewtype Plutus.POSIXTime PPOSIXTime PInteger) instance - (PConstant Plutus.POSIXTime) + PConstantDecl Plutus.POSIXTime type PPOSIXTimeRange = PInterval PPOSIXTime diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index dc49ca0d9..ac64d3b83 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -23,6 +23,7 @@ import Plutarch.DataRepr ( PIsDataReprInstances (PIsDataReprInstances), ) import Plutarch.Lift ( + PConstantDecl, PLifted, PUnsafeLiftDecl, ) @@ -38,7 +39,7 @@ newtype PTxId (s :: S) via PIsDataReprInstances PTxId instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId -deriving via (DerivePConstantViaData Plutus.TxId PTxId) instance (PConstant Plutus.TxId) +deriving via (DerivePConstantViaData Plutus.TxId PTxId) instance PConstantDecl Plutus.TxId newtype PTxOutRef (s :: S) = PTxOutRef @@ -58,7 +59,7 @@ newtype PTxOutRef (s :: S) via PIsDataReprInstances PTxOutRef instance PUnsafeLiftDecl PTxOutRef where type PLifted PTxOutRef = Plutus.TxOutRef -deriving via (DerivePConstantViaData Plutus.TxOutRef PTxOutRef) instance (PConstant Plutus.TxOutRef) +deriving via (DerivePConstantViaData Plutus.TxOutRef PTxOutRef) instance PConstantDecl Plutus.TxOutRef newtype PTxInInfo (s :: S) = PTxInInfo @@ -78,7 +79,7 @@ newtype PTxInInfo (s :: S) via PIsDataReprInstances PTxInInfo instance PUnsafeLiftDecl PTxInInfo where type PLifted PTxInInfo = Plutus.TxInInfo -deriving via (DerivePConstantViaData Plutus.TxInInfo PTxInInfo) instance (PConstant Plutus.TxInInfo) +deriving via (DerivePConstantViaData Plutus.TxInInfo PTxInInfo) instance PConstantDecl Plutus.TxInInfo newtype PTxOut (s :: S) = PTxOut @@ -99,4 +100,4 @@ newtype PTxOut (s :: S) via (PIsDataReprInstances PTxOut) instance PUnsafeLiftDecl PTxOut where type PLifted PTxOut = Plutus.TxOut -deriving via (DerivePConstantViaData Plutus.TxOut PTxOut) instance (PConstant Plutus.TxOut) +deriving via (DerivePConstantViaData Plutus.TxOut PTxOut) instance PConstantDecl Plutus.TxOut diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 676aa1db5..4281dcc2c 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -13,6 +13,7 @@ import Plutarch.Api.V1.AssocMap (PMap) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), + PConstantDecl, PLifted, PUnsafeLiftDecl, ) @@ -26,7 +27,7 @@ instance PUnsafeLiftDecl PTokenName where type PLifted PTokenName = Plutus.Token deriving via (DerivePConstantViaBuiltin Plutus.TokenName PTokenName PByteString) instance - (PConstant Plutus.TokenName) + PConstantDecl Plutus.TokenName newtype PCurrencySymbol (s :: S) = PCurrencySymbol (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PCurrencySymbol PByteString) @@ -35,7 +36,7 @@ instance PUnsafeLiftDecl PCurrencySymbol where type PLifted PCurrencySymbol = Pl deriving via (DerivePConstantViaBuiltin Plutus.CurrencySymbol PCurrencySymbol PByteString) instance - (PConstant Plutus.CurrencySymbol) + PConstantDecl Plutus.CurrencySymbol newtype PValue (s :: S) = PValue (Term s (PMap PCurrencySymbol (PMap PTokenName PInteger))) deriving @@ -46,4 +47,4 @@ instance PUnsafeLiftDecl PValue where type PLifted PValue = Plutus.Value deriving via (DerivePConstantViaNewtype Plutus.Value PValue (PMap PCurrencySymbol (PMap PTokenName PInteger))) instance - (PConstant Plutus.Value) + PConstantDecl Plutus.Value diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 522d9fa3c..58d10aaf3 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -50,7 +50,7 @@ import Plutarch.Internal.Other ( ) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), - PConstant, + PConstantDecl, PLifted, PUnsafeLiftDecl, pconstant, @@ -63,7 +63,7 @@ data PBool (s :: S) = PTrue | PFalse deriving stock (Show) instance PUnsafeLiftDecl PBool where type PLifted PBool = Bool -deriving via (DerivePConstantDirect Bool PBool) instance (PConstant Bool) +deriving via (DerivePConstantDirect Bool PBool) instance PConstantDecl Bool instance PlutusType PBool where type PInner PBool _ = PBool diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 0f4f9ff47..01aaaa809 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -56,6 +56,7 @@ import Plutarch.Integer (PInteger) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstant, + PConstantDecl, PConstantRepr, PConstanted, PLift, @@ -92,7 +93,7 @@ instance (PLift a, PLift b) => PUnsafeLiftDecl (PBuiltinPair a b) where type PLifted (PBuiltinPair a b) = (PLifted a, PLifted b) -- FIXME: figure out good way of deriving this -instance (PConstant a, PConstant b) => PConstant (a, b) where +instance (PConstant a, PConstant b) => PConstantDecl (a, b) where type PConstantRepr (a, b) = (PConstantRepr a, PConstantRepr b) type PConstanted (a, b) = PBuiltinPair (PConstanted a) (PConstanted b) pconstantToRepr (x, y) = (pconstantToRepr x, pconstantToRepr y) @@ -137,7 +138,7 @@ pnullBuiltin = phoistAcyclic $ pforce $ punsafeBuiltin PLC.NullList pconsBuiltin :: Term s (a :--> PBuiltinList a :--> PBuiltinList a) pconsBuiltin = phoistAcyclic $ pforce $ punsafeBuiltin PLC.MkCons -instance PConstant a => PConstant [a] where +instance PConstant a => PConstantDecl [a] where type PConstantRepr [a] = [PConstantRepr a] type PConstanted [a] = PBuiltinList (PConstanted a) pconstantToRepr x = pconstantToRepr <$> x @@ -186,7 +187,7 @@ instance PlutusType PData where pmatch' t f = f (PData t) instance PUnsafeLiftDecl PData where type PLifted PData = Data -deriving via (DerivePConstantDirect Data PData) instance (PConstant Data) +deriving via (DerivePConstantDirect Data PData) instance PConstantDecl Data instance PEq PData where x #== y = punsafeBuiltin PLC.EqualsData # x # y @@ -226,7 +227,7 @@ data PAsData (a :: PType) (s :: S) type role PAsDataLifted representational data PAsDataLifted (a :: PType) -instance PConstant (PAsDataLifted a) where +instance PConstantDecl (PAsDataLifted a) where type PConstantRepr (PAsDataLifted a) = Data type PConstanted (PAsDataLifted a) = PAsData a pconstantToRepr = \case {} diff --git a/Plutarch/ByteString.hs b/Plutarch/ByteString.hs index 4b0f46d4d..0d639e779 100644 --- a/Plutarch/ByteString.hs +++ b/Plutarch/ByteString.hs @@ -25,7 +25,7 @@ import Plutarch.Internal.Other ( ) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), - PConstant, + PConstantDecl, PLifted, PUnsafeLiftDecl, pconstant, @@ -37,7 +37,7 @@ import qualified PlutusCore as PLC data PByteString s instance PUnsafeLiftDecl PByteString where type PLifted PByteString = ByteString -deriving via (DerivePConstantDirect ByteString PByteString) instance (PConstant ByteString) +deriving via (DerivePConstantDirect ByteString PByteString) instance PConstantDecl ByteString instance PEq PByteString where x #== y = punsafeBuiltin PLC.EqualsByteString # x # y diff --git a/Plutarch/DataRepr.hs b/Plutarch/DataRepr.hs index 9ea32b016..a876b1d7e 100644 --- a/Plutarch/DataRepr.hs +++ b/Plutarch/DataRepr.hs @@ -15,8 +15,8 @@ module Plutarch.DataRepr ( I.pdropDataRecord, I.DerivePConstantViaData (DerivePConstantViaData), I.pasDataSum, - I.PConstantableData, - I.PLiftableData, + I.PConstantData, + I.PLiftData, -- * Fields F.PDataFields (ptoFields, type PFields), diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 70ddd39d0..fd4d6dd8b 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -1,7 +1,7 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -Wno-orphans -Wno-redundant-constraints #-} +{-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.DataRepr.Internal ( PDataSum, @@ -11,9 +11,9 @@ module Plutarch.DataRepr.Internal ( pdcons, pdnil, DataReprHandlers (..), - PConstantableData, + PConstantData, PDataRecord (..), - PLiftableData, + PLiftData, PLabeledType (..), type PLabelIndex, type PUnLabel, @@ -96,8 +96,8 @@ import Plutarch.Internal (S (SI)) import Plutarch.Internal.Generic (MkSum (mkSum), PCode, PGeneric, gpfrom, gpto) import Plutarch.Lift ( PConstant, + PConstantDecl, PConstantRepr, - PConstantable, PConstanted, PLift, PLifted, @@ -522,7 +522,7 @@ Polymorphic types can be derived as follows: > >instance > forall a. -> PLiftableData a => +> PLiftData a => > PUnsafeLiftDecl (PBar a) > where > type PLifted (PBar a) = Bar (PLifted a) @@ -533,18 +533,18 @@ Polymorphic types can be derived as follows: > (PBar (PConstanted a)) > ) > instance -> PConstantableData a => -> PConstant (Bar a) +> PConstantData a => +> PConstantDecl (Bar a) -} -type PConstantableData :: Type -> Constraint -type PConstantableData h = - ( PConstantable h +type PConstantData :: Type -> Constraint +type PConstantData h = + ( PConstant h , Ledger.FromData (h) , Ledger.ToData (h) ) -type PLiftableData :: PType -> Constraint -type PLiftableData p = +type PLiftData :: PType -> Constraint +type PLiftData p = ( PLift p , Ledger.FromData (PLifted p) , Ledger.ToData (PLifted p) @@ -571,7 +571,14 @@ instance (PIsDataRepr a, All (Compose POrd PDataRecord) (PIsDataReprRepr a)) => x #< y = pto x #< pto y x #<= y = pto x #<= pto y -instance (PIsDataRepr p, PLift p, Ledger.FromData h, Ledger.ToData h) => PConstant (DerivePConstantViaData h p) where +instance + ( PIsDataRepr p + , PLift p + , Ledger.FromData h + , Ledger.ToData h + ) => + PConstantDecl (DerivePConstantViaData h p) + where type PConstantRepr (DerivePConstantViaData h p) = Ledger.Data type PConstanted (DerivePConstantViaData h p) = p pconstantToRepr (DerivePConstantViaData x) = Ledger.toData x diff --git a/Plutarch/Integer.hs b/Plutarch/Integer.hs index 4bb079b09..dec79bb0e 100644 --- a/Plutarch/Integer.hs +++ b/Plutarch/Integer.hs @@ -16,7 +16,7 @@ import Plutarch.Internal.Other ( ) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), - PConstant, + PConstantDecl, PLifted, PUnsafeLiftDecl, pconstant, @@ -28,7 +28,7 @@ import qualified PlutusCore as PLC data PInteger s instance PUnsafeLiftDecl PInteger where type PLifted PInteger = Integer -deriving via (DerivePConstantDirect Integer PInteger) instance (PConstant Integer) +deriving via (DerivePConstantDirect Integer PInteger) instance PConstantDecl Integer class PIntegral a where pdiv :: Term s (a :--> a :--> a) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 44dd73eb7..ae9f856f0 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -19,19 +19,19 @@ module Plutarch.Lift ( LiftError, -- * Define your own conversion - PConstant (..), + PConstantDecl (..), PLift, + PConstant, DerivePConstantDirect (..), DerivePConstantViaNewtype (..), DerivePConstantViaBuiltin (..), - PConstantable, -- * Internal use PUnsafeLiftDecl (..), ) where import Control.Lens ((^?)) -import Data.Coerce +import Data.Coerce (Coercible, coerce) import Data.Kind (Constraint, Type) import GHC.Stack (HasCallStack) import Plutarch.Evaluate (EvalError, evalScript) @@ -49,7 +49,7 @@ Laws: - It must be that @PConstantRepr (PLifted p)@ when encoded as a constant in UPLC (via the 'UntypedPlutusCore.Constant' constructor) is a valid @p@. -} -class (PConstant (PLifted p), PConstanted (PLifted p) ~ p) => PUnsafeLiftDecl (p :: PType) where +class (PConstantDecl (PLifted p), PConstanted (PLifted p) ~ p) => PUnsafeLiftDecl (p :: PType) where type PLifted p = (r :: Type) | r -> p {- | Class of Haskell types `h` that can be represented as a Plutus core builtin @@ -67,7 +67,12 @@ Laws: These laws must be upheld for the sake of soundness of the type system. -} -class (PUnsafeLiftDecl (PConstanted h), PLC.DefaultUni `PLC.Includes` PConstantRepr h) => PConstant (h :: Type) where +class + ( PUnsafeLiftDecl (PConstanted h) + , PLC.DefaultUni `PLC.Includes` PConstantRepr h + ) => + PConstantDecl (h :: Type) + where type PConstantRepr h :: Type type PConstanted h :: PType pconstantToRepr :: h -> PConstantRepr h @@ -80,7 +85,7 @@ The Haskell type is determined by `PLifted p`. This typeclass is closely tied with 'PConstant'. -} type PLift :: PType -> Constraint -type PLift p = (p ~ PConstanted (PLifted p), PUnsafeLiftDecl p) +type PLift p = PUnsafeLiftDecl p {- | Create a Plutarch-level constant, from a Haskell value. Example: @@ -132,7 +137,7 @@ newtype DerivePConstantDirect (h :: Type) (p :: PType) = DerivePConstantDirect h instance (PLift p, PLC.DefaultUni `PLC.Includes` h) => - PConstant (DerivePConstantDirect h p) + PConstantDecl (DerivePConstantDirect h p) where type PConstantRepr (DerivePConstantDirect h p) = h type PConstanted (DerivePConstantDirect h p) = p @@ -161,8 +166,8 @@ Polymorphic types can be derived as follows: > (PConstanted a) > ) > instance -> PConstantable a => -> PConstant (Foo a) +> PConstant a => +> PConstantDecl (Foo a) -} newtype DerivePConstantViaNewtype @@ -185,10 +190,10 @@ These constraints are sufficient to derive a @PConstant@ instance for the newtyp For deriving @PConstant@ for a wrapped type represented in UPLC as @Data@, see @DerivePConstantViaData@. -} -type PConstantable :: Type -> Constraint -type PConstantable a = (a ~ PLifted (PConstanted a), PConstant a) +type PConstant :: Type -> Constraint +type PConstant a = (a ~ PLifted (PConstanted a), PConstantDecl a) -instance (PLift p, PLift p', Coercible h (PLifted p')) => PConstant (DerivePConstantViaNewtype h p p') where +instance (PLift p, PLift p', Coercible h (PLifted p')) => PConstantDecl (DerivePConstantViaNewtype h p p') where type PConstantRepr (DerivePConstantViaNewtype h p p') = PConstantRepr (PLifted p') type PConstanted (DerivePConstantViaNewtype h p p') = p pconstantToRepr x = pconstantToRepr @(PLifted p') $ coerce x @@ -214,7 +219,15 @@ instance FromBuiltin' BuiltinData Data where newtype DerivePConstantViaBuiltin (h :: Type) (p :: PType) (p' :: PType) = DerivePConstantViaBuiltin h -instance (PLift p, PLift p', Coercible h h', ToBuiltin' (PLifted p') h', FromBuiltin' h' (PLifted p')) => PConstant (DerivePConstantViaBuiltin h p p') where +instance + ( PLift p + , PLift p' + , Coercible h h' + , ToBuiltin' (PLifted p') h' + , FromBuiltin' h' (PLifted p') + ) => + PConstantDecl (DerivePConstantViaBuiltin h p p') + where type PConstantRepr (DerivePConstantViaBuiltin h p p') = PConstantRepr (PLifted p') type PConstanted (DerivePConstantViaBuiltin h p p') = p pconstantToRepr x = pconstantToRepr @(PLifted p') $ fromBuiltin' (coerce x :: h') diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 759519708..54f18ea59 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -140,6 +140,8 @@ module Plutarch.Prelude ( plift, PConstant, PLift, + PConstantData, + PLiftData, -- * Typeclass derivers. DerivePNewtype (DerivePNewtype), diff --git a/Plutarch/String.hs b/Plutarch/String.hs index 06f5949fb..31618bc28 100644 --- a/Plutarch/String.hs +++ b/Plutarch/String.hs @@ -15,7 +15,7 @@ import Plutarch.Internal.Other ( ) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), - PConstant, + PConstantDecl, PLifted, PUnsafeLiftDecl, pconstant, @@ -27,7 +27,7 @@ import qualified PlutusCore as PLC data PString s instance PUnsafeLiftDecl PString where type PLifted PString = Text -deriving via (DerivePConstantDirect Text PString) instance (PConstant Text) +deriving via (DerivePConstantDirect Text PString) instance PConstantDecl Text {-# DEPRECATED pfromText "Use `pconstant` instead." #-} diff --git a/Plutarch/Unit.hs b/Plutarch/Unit.hs index ec9f14f80..7a7a42626 100644 --- a/Plutarch/Unit.hs +++ b/Plutarch/Unit.hs @@ -7,7 +7,7 @@ import Plutarch (PlutusType (PInner, pcon', pmatch'), Term, pcon) import Plutarch.Bool (PBool (PFalse, PTrue), PEq, POrd, (#<), (#<=), (#==)) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), - PConstant, + PConstantDecl, PLifted, PUnsafeLiftDecl, pconstant, @@ -17,7 +17,7 @@ import Plutarch.Show (PShow (pshow')) data PUnit s = PUnit instance PUnsafeLiftDecl PUnit where type PLifted PUnit = () -deriving via (DerivePConstantDirect () PUnit) instance (PConstant ()) +deriving via (DerivePConstantDirect () PUnit) instance PConstantDecl () instance PlutusType PUnit where type PInner PUnit _ = PUnit diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index 78b9783e6..68f1f1282 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -22,7 +22,7 @@ import Test.Tasty.QuickCheck (Arbitrary, arbitrary, oneof, property) import Plutarch.Api.V1 (PAddress, PCredential (PPubKeyCredential, PScriptCredential), PMaybeData) import Plutarch.Lift ( DerivePConstantViaNewtype (DerivePConstantViaNewtype), - PConstant (PConstanted), + PConstantDecl, PUnsafeLiftDecl (PLifted), ) import Plutarch.Prelude @@ -101,10 +101,8 @@ spec = do propertySet :: forall p. ( PIsData p - , PLift p + , PLiftData p , POrd p - , PlutusTx.ToData (PLifted p) - , PlutusTx.FromData (PLifted p) , Ord (PLifted p) , Show (PLifted p) , Arbitrary (PLifted p) @@ -121,13 +119,13 @@ propertySet typeName' = do specify ("(#==) @" <> typeName <> " ≡ (==) @" <> typeName) $ property $ peqIso @p -pltIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Ord h, POrd p) => h -> h -> IO () +pltIso :: forall p. (PLift p, POrd p, Arbitrary (PLifted p), Ord (PLifted p)) => PLifted p -> PLifted p -> IO () pltIso a b = plift (pconstant @p a #< pconstant b) `shouldBe` (a < b) -plteIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Ord h, POrd p) => h -> h -> IO () +plteIso :: forall p. (PLift p, POrd p, Arbitrary (PLifted p), Ord (PLifted p)) => PLifted p -> PLifted p -> IO () plteIso a b = plift (pconstant @p a #<= pconstant b) `shouldBe` (a <= b) -peqIso :: forall p h. (p ~ PConstanted h, h ~ PLifted p, PConstant h, Arbitrary h, Eq h, PEq p) => h -> h -> IO () +peqIso :: forall p. (PLift p, PEq p, Arbitrary (PLifted p), Eq (PLifted p)) => PLifted p -> PLifted p -> IO () peqIso a b = plift (pconstant @p a #== pconstant b) `shouldBe` (a == b) newtype PAddress' s = PAddress' (Term s PAddress) @@ -138,7 +136,7 @@ instance PUnsafeLiftDecl PAddress' where type PLifted PAddress' = Address' newtype Address' = Address' Address deriving stock (Show, Eq, Ord) deriving newtype (PlutusTx.FromData, PlutusTx.ToData) - deriving (PConstant) via (DerivePConstantViaNewtype Address' PAddress' PAddress) + deriving (PConstantDecl) via (DerivePConstantViaNewtype Address' PAddress' PAddress) instance Arbitrary Address' where arbitrary = Address' <$> arbitraryAddr diff --git a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs index 823bc34d8..0bb078f78 100644 --- a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs +++ b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs @@ -13,7 +13,7 @@ import Plutarch.DataRepr ( PIsDataReprInstances (PIsDataReprInstances), ) import Plutarch.Lift ( - PConstant (PConstanted), + PConstantDecl (PConstanted), PUnsafeLiftDecl (PLifted), ) import Plutarch.Prelude @@ -47,23 +47,13 @@ newtype PTriplet (a :: PType) (s :: S) PlutusTx.makeIsDataIndexed ''Triplet ([('Triplet, 0)]) -instance - ( PConstanted (PLifted a) ~ a - , PlutusTx.FromData (PLifted a) - , PlutusTx.ToData (PLifted a) - ) => - PUnsafeLiftDecl (PTriplet a) - where +instance PLiftData a => PUnsafeLiftDecl (PTriplet a) where type PLifted (PTriplet a) = Triplet (PLifted a) deriving via (DerivePConstantViaData (Triplet a) (PTriplet (PConstanted a))) instance - ( PlutusTx.FromData a - , PlutusTx.ToData a - , PLifted (PConstanted a) ~ a - ) => - PConstant (Triplet a) + PConstantData a => PConstantDecl (Triplet a) instance Arbitrary a => Arbitrary (Triplet a) where arbitrary = Triplet <$> arbitrary <*> arbitrary <*> arbitrary From 87b03b758c2e38f1638bd776c4e717f37ba4080d Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 21:48:50 +0530 Subject: [PATCH 320/584] Update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43a945d6c..85efeb1d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -123,6 +123,12 @@ Added by: [#371](https://github.com/Plutonomicon/plutarch/pull/371) +- Rename `PConstant` (the typeclass) to `PConstantDecl`. `PConstant` is now a type alias with extra constraints for better type checking. + + Add `PLiftData` and `PConstantData` type aliases. + + Added by: [#354](https://github.com/Plutonomicon/plutarch/pull/354) + # 1.1.0 - General repository changes. From 74962bb9abd1d9da72d9666225bd3ee533ba1c48 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 21:49:12 +0530 Subject: [PATCH 321/584] Update guide --- docs/Typeclasses/PConstant and PLift.md | 48 ++++++++++--------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/docs/Typeclasses/PConstant and PLift.md b/docs/Typeclasses/PConstant and PLift.md index 9b3b99d2e..d2af3625f 100644 --- a/docs/Typeclasses/PConstant and PLift.md +++ b/docs/Typeclasses/PConstant and PLift.md @@ -65,13 +65,15 @@ This comes in three flavors: Ex: `PScriptPurpose` is represented as a `Data` value. It is synonymous to `ScriptPurpose` from the Plutus ledger api. -Whichever path you need to go down, there is one common part- implementing `PLift`, or rather `PUnsafeLiftDecl`. See, `PLift` is actually just a type synonym to `PUnsafeLiftDecl`. Essentially an empty typeclass with an associated type family that provides insight on the relationship between a Plutarch type and its Haskell synonym. +Whichever path you need to go down, there is one common part- implementing `PLift`, or rather `PUnsafeLiftDecl`. See, `PLift` is actually just a type synonym to `PUnsafeLiftDecl` (with a bit more machinery). Essentially an empty typeclass with an associated type family that provides insight on the relationship between a Plutarch type and its Haskell synonym. ```hs instance PUnsafeLiftDecl YourPlutarchType where type PLifted YourPlutarchType = YourHaskellType ``` +In fact, `PConstant` is _also_ a type synonym. The actual typeclass you'll be implementing is `PConstantDecl`. + You're tasked with assigning the correct Haskell synonym to your Plutarch type, and what an important task it is! Recall that `pconstant`'s argument type will depend on your assignment here. In particular: `pconstant :: YourHaskellType -> YourPlutarchType`. Some examples: @@ -97,10 +99,10 @@ Now, let's get to implementing `PConstant` for the Haskell synonym, via the thre ```hs {-# LANGUAGE UndecidableInstances #-} -import Plutarch.Lift (DerivePConstantDirect (DerivePConstantDirect)) +import Plutarch.Lift (DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, PUnsafeLiftDecl) import Plutarch.Prelude -deriving via (DerivePConstantDirect Integer PInteger) instance (PConstant Integer) +deriving via (DerivePConstantDirect Integer PInteger) instance PConstantDecl Integer ``` `DerivePConstantDirect` takes in two type parameters: @@ -113,7 +115,7 @@ Pretty simple! Let's check out `DerivePConstantViaNewtype` now: ```hs {-# LANGUAGE UndecidableInstances #-} -import Plutarch.Lift (DerivePConstantViaNewtype (DerivePConstantViaNewtype)) +import Plutarch.Lift (DerivePConstantViaNewtype (DerivePConstantViaNewtype), PConstantDecl, PUnsafeLiftDecl) import Plutarch.Prelude import qualified Plutus.V1.Ledger.Api as Plutus @@ -122,7 +124,8 @@ newtype PValidatorHash (s :: S) = PValidatorHash (Term s PByteString) ... -deriving via (DerivePConstantViaNewtype Plutus.ValidatorHash PValidatorHash PByteString) instance (PConstant Plutus.ValidatorHash) +deriving via (DerivePConstantViaNewtype Plutus.ValidatorHash PValidatorHash PByteString) + instance PConstantDecl Plutus.ValidatorHash ``` `DerivePConstantViaNewtype` takes in three type parameters: @@ -139,7 +142,8 @@ Finally, we have `DerivePConstantViaData` for `Data` values: ```hs {-# LANGUAGE UndecidableInstances #-} -import Plutarch.Lift (DerivePConstantViaNewtype (DerivePConstantViaNewtype)) +import Plutarch.DataRepr (DerivePConstantViaData (DerivePConstantViaData)) +import Plutarch.Lift (PConstantDecl, PUnsafeLiftDecl) import Plutarch.Prelude import qualified Plutus.V1.Ledger.Api as Plutus @@ -152,7 +156,8 @@ data PScriptPurpose (s :: S) ... -deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) instance (PConstant Plutus.ScriptPurpose) +deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) + instance PConstantDecl Plutus.ScriptPurpose ``` `DerivePConstantViaData` takes in two type parameters: @@ -163,25 +168,23 @@ deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) instan ## Implementing `PConstant` & `PLift` for types with type variables (generic types) -If your Plutarch type and its Haskell synonym are generic types (e.g. `PMaybeData a`) - the implementation gets a tad more difficult. In particular, you need to constrain the generic type variables to be able to use the derivers. +If your Plutarch type and its Haskell synonym are generic types (e.g. `PMaybeData a`) - the implementation gets a tad more difficult. In particular, you need to constrain the generic type variables to also have the relevant instance. The constraints observed when implementing `PLift`: - Each type variable must also have a `PLift` instance. -- For each type variable `a`: `a ~ PConstanted (PLifted a)` -- Depending on the data declaration, your type variable `PLifted a`, for each `a`, might also need [`FromData`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:FromData) and [`ToData`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:ToData) instances. The constraints observed when implementing `PConstant`: - Each type variable must also have a `PConstant` instance. -- For each type variable `a`: `a ~ PLifted (PConstanted a)` -- Depending on the data declaration, each type variable `a` might also need [`FromData`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:FromData) and [`ToData`](https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#t:ToData) instances. + +If you're using `DerivePConstantViaData`, you should use the `PLiftData` and `PConstantData` constraints instead respectively. Here's how you'd set up all this for `PMaybeData a`: ```hs import Plutarch.DataRepr (DerivePConstantViaData (DerivePConstantViaData)) -import Plutarch.Lift (PUnsafeLiftDecl) +import Plutarch.Lift (PConstantDecl, PUnsafeLiftDecl) import Plutarch.Prelude import PlutusTx (FromData, ToData) @@ -190,14 +193,7 @@ data PMaybeData a (s :: S) = PDJust (Term s (PDataRecord '["_0" ':= a])) | PDNothing (Term s (PDataRecord '[])) -instance - ( PLift p - , p ~ PConstanted (PLifted p) - , FromData (PLifted p) - , ToData (PLifted p) - ) => - PUnsafeLiftDecl (PMaybeData p) - where +instance PLiftData p => PUnsafeLiftDecl (PMaybeData p) where type PLifted (PMaybeData p) = Maybe (PLifted p) deriving via @@ -205,13 +201,5 @@ deriving via (Maybe h) (PMaybeData (PConstanted h)) ) - instance - ( PConstant h - , h ~ PLifted (PConstanted h) - , FromData h - , ToData h - ) => - PConstant (Maybe h) + instance PConstantData h => PConstantDecl (Maybe h) ``` - -Relevant issue: [\#286](https://github.com/Plutonomicon/plutarch/issues/286) From 0cf84303c7cb20bd8b9276a42d4e64738ce6eb68 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 22:11:24 +0530 Subject: [PATCH 322/584] Finish up `PlutusType (PDataRecord l)` --- Plutarch/DataRepr/Internal.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 300352287..9874d796f 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -109,9 +109,11 @@ data PDataRecord (as :: [PLabeledType]) (s :: S) where instance {-# OVERLAPPABLE #-} PlutusType (PDataRecord l) where type PInner (PDataRecord l) _ = PBuiltinList PData - pcon' (PDCons x xs) = pcons # pforgetData x # pto xs - pcon' PDNil = pnil - pmatch' _ _ = undefined -- FIXME + pcon' :: PDataRecord l s -> Term s (PBuiltinList PData) + pcon' (PDCons x xs) = pcon' $ PDCons x xs + pcon' PDNil = pcon' PDNil + pmatch' :: Term s (PBuiltinList PData) -> (PDataRecord l s -> Term s b) -> Term s b + pmatch' _ _ = error "PDataRecord l: pmatch' unsupported ('l' should be more specific)" instance PlutusType (PDataRecord ((name ':= x) ': xs)) where type PInner (PDataRecord ((name ':= x) ': xs)) _ = PBuiltinList PData From 1e89980f17e351e644bcc8634635251d2621c68b Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Apr 2022 22:24:42 +0530 Subject: [PATCH 323/584] Remove redundant change in `PLift` type alias --- Plutarch/Lift.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index ae9f856f0..30ddad496 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -85,7 +85,7 @@ The Haskell type is determined by `PLifted p`. This typeclass is closely tied with 'PConstant'. -} type PLift :: PType -> Constraint -type PLift p = PUnsafeLiftDecl p +type PLift = PUnsafeLiftDecl {- | Create a Plutarch-level constant, from a Haskell value. Example: From ab6886fd6d4b9e002723366c1c238c3d7de8cb68 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sat, 9 Apr 2022 13:34:53 +0530 Subject: [PATCH 324/584] Update CHANGELOG --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85efeb1d7..f0796380a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,6 +129,22 @@ Added by: [#354](https://github.com/Plutonomicon/plutarch/pull/354) +- Remove `hrecField` export. Use `getField` instead. + + Removed by: [#415](https://github.com/Plutonomicon/plutarch/pull/415) + +- Rename the `"data"` field of `PTxInfo` to `"datums"`. + + Renamed by: [#415](https://github.com/Plutonomicon/plutarch/pull/415) + +- Add `Num` instance for `PPOSIXTime` and export its constructor. + + Added by: [#415](https://github.com/Plutonomicon/plutarch/pull/415) + +- `PlutusType` is now a superclass of `PIsDataRepr`, strengthening the existing `PMatch` superclass constraint. + + Added by: [#415](https://github.com/Plutonomicon/plutarch/pull/415) + # 1.1.0 - General repository changes. From 78d8e0b1c0f2c1b0d20562614048840b41f8d01a Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sat, 9 Apr 2022 14:49:54 +0530 Subject: [PATCH 325/584] Explicit type applications for local binds --- .../plutarch-base/Plutarch/PIsDataSpec.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index e4b72975b..5b79b24cd 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -81,10 +81,10 @@ spec = do "4wheeler" @\ do let datrec = pdcons - # pconstantData 2 #$ pdcons - # pconstantData 5 #$ pdcons - # pconstantData 42 #$ pdcons - # pconstantData 0 + # pconstantData @PInteger 2 #$ pdcons + # pconstantData @PInteger 5 #$ pdcons + # pconstantData @PInteger 42 #$ pdcons + # pconstantData @PInteger 0 # pdnil expected = pconstant $ @@ -94,7 +94,7 @@ spec = do "pdatasum" @| pcon @(PDataSum (PIsDataReprRepr PVehicle)) (PDataSum . Z $ Compose datrec) @== expected "2wheeler" @\ do - let datrec = pdcons # pconstantData 5 #$ pdcons # pconstantData 0 # pdnil + let datrec = pdcons # pconstantData @PInteger 5 #$ pdcons # pconstantData @PInteger 0 # pdnil expected = pconstant $ PlutusTx.Constr 1 [PlutusTx.I 5, PlutusTx.I 0] "normal" @| pcon (PTwoWheeler datrec) @== expected @@ -113,8 +113,8 @@ spec = do let datrec = pdcons # pconstantData @PCurrencySymbol "ab" #$ pdcons - # pconstantData "41" #$ pdcons - # pconstantData "0e" + # pconstantData @PCurrencySymbol "41" #$ pdcons + # pconstantData @PCurrencySymbol "0e" # pdnil expected = pconstant $ From 574261eae9dd1e982a016e7e72ca0f8e95c5f7a0 Mon Sep 17 00:00:00 2001 From: Geometer1729 <16kuhnb@gmail.com> Date: Wed, 6 Apr 2022 13:38:25 -0400 Subject: [PATCH 326/584] Add getContinuingOutputs, findOwnInput, findDatum from plutus-ledge-api; and cont monad utils they use. author=BrianK upstreamed from a client project. --- plutarch-extra/Plutarch/Extra/Api.hs | 85 ++++++++++++++++++++++++++ plutarch-extra/Plutarch/Extra/Monad.hs | 44 +++++++++++++ plutarch-extra/plutarch-extra.cabal | 2 + 3 files changed, 131 insertions(+) create mode 100644 plutarch-extra/Plutarch/Extra/Api.hs create mode 100644 plutarch-extra/Plutarch/Extra/Monad.hs diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs new file mode 100644 index 000000000..c0271b8ee --- /dev/null +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -0,0 +1,85 @@ +module Plutarch.Extra.Api (getContinuingOutputs, findOwnInput, findDatum) where + +import Plutarch.Prelude + +import Plutarch.Api.V1 ( + PAddress, + PDatum (..), + PDatumHash, + PScriptContext (..), + PScriptPurpose (PSpending), + PTuple, + PTxInInfo (..), + PTxInfo (..), + PTxOut, + PTxOutRef (..), + ) +import Plutarch.Extra.Monad (tlet, tletField, tmatch, tmatchField) + +{- | gets a list of continuing outputs by finding + - its own input and returning a list of outputs with the same outAddress +-} +getContinuingOutputs :: Term s (PScriptContext :--> PBuiltinList PTxOut) +getContinuingOutputs = phoistAcyclic $ + plam $ \sc -> unTermCont $ do + txinfo <- tletField @"txInfo" sc + outs <- tletField @"outputs" txinfo + pure $ + pmatch (findOwnInput # sc) $ \case + PJust te -> unTermCont $ do + resolved <- tletField @"resolved" te + outAdr <- tletField @"address" resolved + pure $ pfilter # (matches # outAdr) #$ pmap # plam pfromData # outs + PNothing -> ptraceError "can't get any continuing outputs" + where + matches :: Term s (PAddress :--> PTxOut :--> PBool) + matches = phoistAcyclic $ + plam $ \adr txOut -> unTermCont $ do + outAdr <- tletField @"address" txOut + pure $ adr #== outAdr + +{- | tries to finds the transaction's input + - by looking for a txininfo in the inputs coresponding to the TxOutRef which the script purpose is spending +-} +findOwnInput :: Term s (PScriptContext :--> PMaybe PTxInInfo) +findOwnInput = phoistAcyclic $ + plam $ \sc -> unTermCont $ do + PScriptContext te <- tmatch sc + pure $ + pmatch (pfromData $ pfield @"purpose" # te) $ \case + PSpending outRef' -> unTermCont $ do + outRef <- tletField @"_0" outRef' + PTxInfo txinfo <- tmatchField @"txInfo" te + is <- tlet $ pmap # plam pfromData #$ pfromData $ pfield @"inputs" # txinfo + pure $ + pfind # (matches # outRef) # is + _ -> pcon PNothing + where + matches :: Term s (PTxOutRef :--> PTxInInfo :--> PBool) + matches = phoistAcyclic $ + plam $ \outref txininfo -> unTermCont $ do + PTxOutRef outref' <- tmatch outref + outRefId <- tletField @"id" outref' + PTxInInfo txininfo' <- tmatch txininfo + PTxOutRef inOutRef <- tmatchField @"outRef" txininfo' + inOutRefId <- tletField @"id" inOutRef + pure $ + outRefId #== inOutRefId + +-- | Looks up a datum by it's hash from the PTxInfo +findDatum :: Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum) +findDatum = phoistAcyclic $ + plam $ \dh txinfo -> unTermCont $ do + txInfoData <- tletField @"data" txinfo + maybeEnt <- tlet $ pfind # (matches # dh) # txInfoData + pure $ + pmatch maybeEnt $ \case + PNothing -> pcon PNothing + PJust x -> pcon $ PJust $ pfromData $ pfield @"_1" # x + where + matches :: Term s (PDatumHash :--> PAsData (PTuple PDatumHash PDatum) :--> PBool) + matches = phoistAcyclic $ + plam $ \dh dataTupe -> unTermCont $ do + tupe <- tlet $ pfromData dataTupe + pure $ + dh #== pfromData (pfield @"_0" # tupe) diff --git a/plutarch-extra/Plutarch/Extra/Monad.hs b/plutarch-extra/Plutarch/Extra/Monad.hs new file mode 100644 index 000000000..0d1341482 --- /dev/null +++ b/plutarch-extra/Plutarch/Extra/Monad.hs @@ -0,0 +1,44 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.Extra.Monad (tlet, tletField, tmatch, tmatchField) where + +import Plutarch.Prelude + +import GHC.TypeLits (KnownNat) +import Plutarch.DataRepr (PDataFields (PFields)) +import Plutarch.DataRepr.Internal (PLabelIndex, PUnLabel) +import Plutarch.DataRepr.Internal.HList (IndexList) + +tlet :: Term s a -> TermCont s (Term s a) +tlet = tcont . plet + +tletField :: + forall name p s a as n. + ( PDataFields p + , as ~ PFields p + , n ~ PLabelIndex name as + , KnownNat n + , a ~ PUnLabel (IndexList n as) + , PIsData a + ) => + Term s p -> + TermCont s (Term s a) +tletField t = tlet $ pfromData $ pfield @name # t + +tmatch :: PMatch a => Term s a -> TermCont s (a s) +tmatch = tcont . pmatch + +tmatchField :: + forall name p s a as n. + ( PDataFields p + , as ~ PFields p + , n ~ PLabelIndex name as + , KnownNat n + , a ~ PUnLabel (IndexList n as) + , PIsData a + , PMatch a + ) => + Term s p -> + TermCont s (a s) +tmatchField t = tmatch $ pfromData $ pfield @name # t diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index d17c91b4d..65e73a489 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -80,6 +80,8 @@ library import: c, deps exposed-modules: Plutarch.Extra + Plutarch.Extra.Api + Plutarch.Extra.Monad Plutarch.ListUtils -- other-modules: From 1826e5b7a0bcfd52174d3f60f1d039654ddab804 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 6 Apr 2022 13:42:10 -0400 Subject: [PATCH 327/584] Refactor imports for repo standards --- plutarch-extra/Plutarch/Extra/Api.hs | 20 ++++++++++++-------- plutarch-extra/Plutarch/Extra/Monad.hs | 11 ++++++++--- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index c0271b8ee..3de06305f 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -1,19 +1,23 @@ -module Plutarch.Extra.Api (getContinuingOutputs, findOwnInput, findDatum) where - -import Plutarch.Prelude +module Plutarch.Extra.Api ( + getContinuingOutputs, + findOwnInput, + findDatum, +) where import Plutarch.Api.V1 ( PAddress, - PDatum (..), + PDatum, PDatumHash, - PScriptContext (..), + PScriptContext (PScriptContext), PScriptPurpose (PSpending), PTuple, - PTxInInfo (..), - PTxInfo (..), + PTxInInfo (PTxInInfo), + PTxInfo (PTxInfo), PTxOut, - PTxOutRef (..), + PTxOutRef (PTxOutRef), ) +import Plutarch.Prelude + import Plutarch.Extra.Monad (tlet, tletField, tmatch, tmatchField) {- | gets a list of continuing outputs by finding diff --git a/plutarch-extra/Plutarch/Extra/Monad.hs b/plutarch-extra/Plutarch/Extra/Monad.hs index 0d1341482..bcff4b78f 100644 --- a/plutarch-extra/Plutarch/Extra/Monad.hs +++ b/plutarch-extra/Plutarch/Extra/Monad.hs @@ -1,14 +1,19 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-} -module Plutarch.Extra.Monad (tlet, tletField, tmatch, tmatchField) where - -import Plutarch.Prelude +module Plutarch.Extra.Monad ( + tlet, + tletField, + tmatch, + tmatchField, +) where import GHC.TypeLits (KnownNat) + import Plutarch.DataRepr (PDataFields (PFields)) import Plutarch.DataRepr.Internal (PLabelIndex, PUnLabel) import Plutarch.DataRepr.Internal.HList (IndexList) +import Plutarch.Prelude tlet :: Term s a -> TermCont s (Term s a) tlet = tcont . plet From 3711806e2447f242cd40ea37deb3708f689720fd Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 6 Apr 2022 13:45:09 -0400 Subject: [PATCH 328/584] Remove inner unTermCont --- plutarch-extra/Plutarch/Extra/Api.hs | 31 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 3de06305f..064cf4ac7 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -28,13 +28,13 @@ getContinuingOutputs = phoistAcyclic $ plam $ \sc -> unTermCont $ do txinfo <- tletField @"txInfo" sc outs <- tletField @"outputs" txinfo - pure $ - pmatch (findOwnInput # sc) $ \case - PJust te -> unTermCont $ do - resolved <- tletField @"resolved" te - outAdr <- tletField @"address" resolved - pure $ pfilter # (matches # outAdr) #$ pmap # plam pfromData # outs - PNothing -> ptraceError "can't get any continuing outputs" + tmatch (findOwnInput # sc) >>= \case + PJust te -> do + resolved <- tletField @"resolved" te + outAdr <- tletField @"address" resolved + pure $ pfilter # (matches # outAdr) #$ pmap # plam pfromData # outs + PNothing -> + pure $ ptraceError "can't get any continuing outputs" where matches :: Term s (PAddress :--> PTxOut :--> PBool) matches = phoistAcyclic $ @@ -49,15 +49,14 @@ findOwnInput :: Term s (PScriptContext :--> PMaybe PTxInInfo) findOwnInput = phoistAcyclic $ plam $ \sc -> unTermCont $ do PScriptContext te <- tmatch sc - pure $ - pmatch (pfromData $ pfield @"purpose" # te) $ \case - PSpending outRef' -> unTermCont $ do - outRef <- tletField @"_0" outRef' - PTxInfo txinfo <- tmatchField @"txInfo" te - is <- tlet $ pmap # plam pfromData #$ pfromData $ pfield @"inputs" # txinfo - pure $ - pfind # (matches # outRef) # is - _ -> pcon PNothing + tmatch (pfromData $ pfield @"purpose" # te) >>= \case + PSpending outRef' -> do + outRef <- tletField @"_0" outRef' + PTxInfo txinfo <- tmatchField @"txInfo" te + is <- tlet $ pmap # plam pfromData #$ pfromData $ pfield @"inputs" # txinfo + pure $ pfind # (matches # outRef) # is + _ -> + pure $ pcon PNothing where matches :: Term s (PTxOutRef :--> PTxInInfo :--> PBool) matches = phoistAcyclic $ From da3018a1e198d042b8d6e0037e7d2eb62cae9d32 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 6 Apr 2022 14:35:14 -0400 Subject: [PATCH 329/584] Add golden tests for the 3 functions in Plutarch.Extra.Api --- .../conditional/Plutarch/TryFromSpec.hs | 2 +- plutarch-test/goldens/extra.api.bench.golden | 3 +++ .../goldens/extra.api.uplc.eval.golden | 3 +++ plutarch-test/goldens/extra.api.uplc.golden | 3 +++ .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 23 +++++++++++++++++++ plutarch-test/plutarch-test.cabal | 1 + 6 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 plutarch-test/goldens/extra.api.bench.golden create mode 100644 plutarch-test/goldens/extra.api.uplc.eval.golden create mode 100644 plutarch-test/goldens/extra.api.uplc.golden create mode 100644 plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 16a73a10f..9f4d530a4 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE UndecidableInstances #-} -module Plutarch.TryFromSpec (spec) where +module Plutarch.TryFromSpec (spec, ctx, validOutputs0, validList1) where -- Haskell imports import qualified GHC.Generics as GHC diff --git a/plutarch-test/goldens/extra.api.bench.golden b/plutarch-test/goldens/extra.api.bench.golden new file mode 100644 index 000000000..11a1e6b73 --- /dev/null +++ b/plutarch-test/goldens/extra.api.bench.golden @@ -0,0 +1,3 @@ +findOwnInput {"exBudgetCPU":11905533,"exBudgetMemory":24196,"scriptSizeBytes":371} +getContinuingOutputs {"exBudgetCPU":22798091,"exBudgetMemory":46026,"scriptSizeBytes":471} +findDatum {"exBudgetCPU":7462012,"exBudgetMemory":14406,"scriptSizeBytes":327} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.uplc.eval.golden b/plutarch-test/goldens/extra.api.uplc.eval.golden new file mode 100644 index 000000000..3612e5306 --- /dev/null +++ b/plutarch-test/goldens/extra.api.uplc.eval.golden @@ -0,0 +1,3 @@ +findOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) +getContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) +findDatum (program 1.0.0 (\i0 -> \i0 -> i2 (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.uplc.golden b/plutarch-test/goldens/extra.api.uplc.golden new file mode 100644 index 000000000..9beda8b32 --- /dev/null +++ b/plutarch-test/goldens/extra.api.uplc.golden @@ -0,0 +1,3 @@ +findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i13 i1)) (delay (\i0 -> \i0 -> i2 (i15 i3))) (delay (i3 i2 (i14 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i12 (i14 (i12 (i14 i2))))) (i11 (i13 i3))) i1) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData (i9 (i11 (i9 (i11 i5))))))) (i8 i1))) (delay (\i0 -> \i0 -> force i1)))) (i10 i2)) (force (force fstPair) i1)) (unConstrData ((\i0 -> i6 (i7 i1)) (i7 i1)))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i11 (\i0 -> \i0 -> \i0 -> force (i15 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i12 (i2 (i19 i1)) (delay (\i0 -> \i0 -> i2 (i21 i3))) (delay (i3 i2 (i18 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i18 (i19 (i18 (i19 i2))))) (i17 (i18 i3))) i1) (i9 (\i0 -> i1) (unListData (i15 (i16 (i15 (i16 i7))))))) (i14 i1))) (delay (\i0 -> \i0 -> force i1)))) (i15 i2)) (force (force fstPair) i1)) (unConstrData ((\i0 -> i12 (i11 i1)) (i12 i3))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i14) (delay ((\i0 -> force (i11 (i4 i1) (delay (i16 i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i17 i1)))))) (\i0 -> (\i0 -> equalsData i3 i1) (i15 (i16 i1))) (i8 (\i0 -> i1) i4)) (i13 (i14 i1))) (i12 (i11 (i13 i1)))) (delay error)) (unListData (i10 (i9 (i11 i1))))) (i9 (i10 i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (i9 (i8 (i10 i3)))) (delay (\i0 -> \i0 -> force i1))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i8 i1)) (delay (\i0 -> \i0 -> i2 (i10 i3))) (delay (i3 i2 (i7 i1)))))))) (\i0 -> equalsByteString i4 (unBData (i6 (i7 i1)))) i1)) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1))))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs new file mode 100644 index 000000000..cdc298503 --- /dev/null +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -0,0 +1,23 @@ +module Plutarch.Extra.ApiSpec (spec) where + +import Plutarch.Extra.Api +import Plutarch.Prelude + +import Plutarch.Test +import Test.Hspec (Spec, describe) + +import qualified Plutarch.TryFromSpec as TFS + +spec :: Spec +spec = do + describe "extra.api" $ do + -- Let's reuse the mock ctx from `Plutarch.TryFromSpec`, because that has + -- datums. + let ctx = TFS.ctx TFS.validOutputs0 TFS.validList1 + pgoldenSpec $ do + "findOwnInput" + @| findOwnInput # ctx + "getContinuingOutputs" + @| getContinuingOutputs # ctx + "findDatum" + @| findDatum # pconstant "d0" # (pfield @"txInfo" # ctx) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 095a5c693..778edf040 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -154,6 +154,7 @@ executable plutarch-test Plutarch.BoolSpec Plutarch.ByteStringSpec Plutarch.EitherSpec + Plutarch.Extra.ApiSpec Plutarch.IntegerSpec Plutarch.LiftSpec Plutarch.ListSpec From 82f1e8013c690114ef1441a2e78320c9af7993cd Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 6 Apr 2022 14:54:41 -0400 Subject: [PATCH 330/584] Factor out script context mocks out of ghc9 only module --- .../conditional/Plutarch/TryFromSpec.hs | 66 ++----------------- .../plutarch-base/Plutarch/ApiSpec.hs | 60 ++++++++++++++++- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 4 +- 3 files changed, 65 insertions(+), 65 deletions(-) diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 9f4d530a4..bfe06163a 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE UndecidableInstances #-} -module Plutarch.TryFromSpec (spec, ctx, validOutputs0, validList1) where +module Plutarch.TryFromSpec (spec) where -- Haskell imports import qualified GHC.Generics as GHC @@ -9,16 +9,6 @@ import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -- Plutus and PlutusTx imports -import Plutus.V1.Ledger.Api ( - Address (Address), - Credential (ScriptCredential), - Datum (Datum), - DatumHash, - ScriptContext (ScriptContext), - ToData (toBuiltinData), - TxInfo (txInfoData, txInfoOutputs), - TxOut (TxOut, txOutAddress, txOutDatumHash, txOutValue), - ) import PlutusTx ( Data (B, Constr, I), @@ -63,9 +53,7 @@ import Plutarch.TryFrom ( import Plutarch.Reducible (Reduce, Reducible) -import Plutarch.ApiSpec (info, purpose) -import qualified Plutarch.ApiSpec as Api - +import Plutarch.ApiSpec (invalidContext1, validContext0) import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) import Test.Hspec @@ -219,9 +207,7 @@ spec = do "sample usage contains the right value" @| pconstant 42 #== theField @-> passert "example" @\ do - let validContext0 = ctx validOutputs0 validList1 - invalidContext1 = ctx invalidOutputs1 validList1 - l1 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) + let l1 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) l1 = toDatadList [1 .. 5] l2 :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) l2 = toDatadList [6 .. 10] @@ -376,51 +362,7 @@ pfindOwnInput = phoistAcyclic $ (pfield @"id" # target) #== (pfield @"id" #$ pfield @"outRef" # pfromData actual) pure $ pfind # pred # txInInfos -------------------- Mocking a ScriptContext ---------------------------------------- - -ctx :: [TxOut] -> [(DatumHash, Datum)] -> Term s PScriptContext -ctx outs l = pconstant (ScriptContext (info' outs l) purpose) - -info' :: [TxOut] -> [(DatumHash, Datum)] -> TxInfo -info' outs dat = - info - { txInfoData = dat - , txInfoOutputs = outs - } - -validOutputs0 :: [TxOut] -validOutputs0 = - [ TxOut - { txOutAddress = - Address (ScriptCredential Api.validator) Nothing - , txOutValue = mempty - , txOutDatumHash = Just Api.datum - } - ] - -invalidOutputs1 :: [TxOut] -invalidOutputs1 = - [ TxOut - { txOutAddress = - Address (ScriptCredential Api.validator) Nothing - , txOutValue = mempty - , txOutDatumHash = Just Api.datum - } - , TxOut - { txOutAddress = - Address (ScriptCredential Api.validator) Nothing - , txOutValue = mempty - , txOutDatumHash = Nothing - } - ] - -validList1 :: [(DatumHash, Datum)] -validList1 = - let dat :: Datum - dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] - in [("d0", dat)] - -------------------- Helpers -------------------------------------------------------- +------------- Helpers -------------------------------------------------------- toDatadList :: [Integer] -> Term s (PAsData (PBuiltinList (PAsData PInteger))) toDatadList = pdata . (foldr go pnil) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 4dc8d3254..5f9c77a3f 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -1,4 +1,12 @@ -module Plutarch.ApiSpec (spec, ctx, info, purpose, validator, datum) where +-- NOTE: This module also contains ScriptContext mocks, which should ideally +-- moved to a module of its own after cleaning up to expose a easy to reason +-- about API. +module Plutarch.ApiSpec ( + spec, + ctx, + validContext0, + invalidContext1, +) where import Test.Tasty.HUnit @@ -200,3 +208,53 @@ getFields = phoistAcyclic $ plam $ \addr -> psndBuiltin #$ pasConstr # addr dummyCurrency :: CurrencySymbol dummyCurrency = Value.currencySymbol "\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11" + +------------------- Mocking a ScriptContext ---------------------------------------- + +validContext0 :: Term s PScriptContext +validContext0 = mkCtx validOutputs0 validDatums1 + +invalidContext1 :: Term s PScriptContext +invalidContext1 = mkCtx invalidOutputs1 validDatums1 + +mkCtx :: [TxOut] -> [(DatumHash, Datum)] -> Term s PScriptContext +mkCtx outs l = pconstant (ScriptContext (info' outs l) purpose) + where + info' :: [TxOut] -> [(DatumHash, Datum)] -> TxInfo + info' outs dat = + info + { txInfoData = dat + , txInfoOutputs = outs + } + +validOutputs0 :: [TxOut] +validOutputs0 = + [ TxOut + { txOutAddress = + Address (ScriptCredential validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Just datum + } + ] + +invalidOutputs1 :: [TxOut] +invalidOutputs1 = + [ TxOut + { txOutAddress = + Address (ScriptCredential validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Just datum + } + , TxOut + { txOutAddress = + Address (ScriptCredential validator) Nothing + , txOutValue = mempty + , txOutDatumHash = Nothing + } + ] + +validDatums1 :: [(DatumHash, Datum)] +validDatums1 = + let dat :: Datum + dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] + in [("d0", dat)] diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index cdc298503..75ffe44c3 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -6,14 +6,14 @@ import Plutarch.Prelude import Plutarch.Test import Test.Hspec (Spec, describe) -import qualified Plutarch.TryFromSpec as TFS +import Plutarch.ApiSpec (validContext0) spec :: Spec spec = do describe "extra.api" $ do -- Let's reuse the mock ctx from `Plutarch.TryFromSpec`, because that has -- datums. - let ctx = TFS.ctx TFS.validOutputs0 TFS.validList1 + let ctx = validContext0 pgoldenSpec $ do "findOwnInput" @| findOwnInput # ctx From 789b4761cae0d63f61f7c39b411b00a2465609be Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 6 Apr 2022 15:07:52 -0400 Subject: [PATCH 331/584] Use plutarchDevFlagDescribe to deal with trace-flaky goldens --- ...xtra.api.bench.golden => extra.api.dev=false.bench.golden} | 0 ....uplc.eval.golden => extra.api.dev=false.uplc.eval.golden} | 0 ...{extra.api.uplc.golden => extra.api.dev=false.uplc.golden} | 0 plutarch-test/goldens/extra.api.dev=true.bench.golden | 3 +++ plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden | 3 +++ plutarch-test/goldens/extra.api.dev=true.uplc.golden | 3 +++ plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs | 4 +--- 7 files changed, 10 insertions(+), 3 deletions(-) rename plutarch-test/goldens/{extra.api.bench.golden => extra.api.dev=false.bench.golden} (100%) rename plutarch-test/goldens/{extra.api.uplc.eval.golden => extra.api.dev=false.uplc.eval.golden} (100%) rename plutarch-test/goldens/{extra.api.uplc.golden => extra.api.dev=false.uplc.golden} (100%) create mode 100644 plutarch-test/goldens/extra.api.dev=true.bench.golden create mode 100644 plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/extra.api.dev=true.uplc.golden diff --git a/plutarch-test/goldens/extra.api.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden similarity index 100% rename from plutarch-test/goldens/extra.api.bench.golden rename to plutarch-test/goldens/extra.api.dev=false.bench.golden diff --git a/plutarch-test/goldens/extra.api.uplc.eval.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/extra.api.uplc.eval.golden rename to plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden diff --git a/plutarch-test/goldens/extra.api.uplc.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.golden similarity index 100% rename from plutarch-test/goldens/extra.api.uplc.golden rename to plutarch-test/goldens/extra.api.dev=false.uplc.golden diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden new file mode 100644 index 000000000..f64fe9777 --- /dev/null +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -0,0 +1,3 @@ +findOwnInput {"exBudgetCPU":11905533,"exBudgetMemory":24196,"scriptSizeBytes":371} +getContinuingOutputs {"exBudgetCPU":22798091,"exBudgetMemory":46026,"scriptSizeBytes":511} +findDatum {"exBudgetCPU":7462012,"exBudgetMemory":14406,"scriptSizeBytes":327} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden new file mode 100644 index 000000000..3612e5306 --- /dev/null +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden @@ -0,0 +1,3 @@ +findOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) +getContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) +findDatum (program 1.0.0 (\i0 -> \i0 -> i2 (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.golden new file mode 100644 index 000000000..d558c93f1 --- /dev/null +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.golden @@ -0,0 +1,3 @@ +findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i13 i1)) (delay (\i0 -> \i0 -> i2 (i15 i3))) (delay (i3 i2 (i14 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i12 (i14 (i12 (i14 i2))))) (i11 (i13 i3))) i1) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData (i9 (i11 (i9 (i11 i5))))))) (i8 i1))) (delay (\i0 -> \i0 -> force i1)))) (i10 i2)) (force (force fstPair) i1)) (unConstrData ((\i0 -> i6 (i7 i1)) (i7 i1)))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i11 (\i0 -> \i0 -> \i0 -> force (i15 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i12 (i2 (i19 i1)) (delay (\i0 -> \i0 -> i2 (i21 i3))) (delay (i3 i2 (i18 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i18 (i19 (i18 (i19 i2))))) (i17 (i18 i3))) i1) (i9 (\i0 -> i1) (unListData (i15 (i16 (i15 (i16 i7))))))) (i14 i1))) (delay (\i0 -> \i0 -> force i1)))) (i15 i2)) (force (force fstPair) i1)) (unConstrData ((\i0 -> i12 (i11 i1)) (i12 i3))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i14) (delay ((\i0 -> force (i11 (i4 i1) (delay (i16 i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i17 i1)))))) (\i0 -> (\i0 -> equalsData i3 i1) (i15 (i16 i1))) (i8 (\i0 -> i1) i4)) (i13 (i14 i1))) (i12 (i11 (i13 i1)))) (delay (force (force trace "can't get any continuing outputs" (delay error))))) (unListData (i10 (i9 (i11 i1))))) (i9 (i10 i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (i9 (i8 (i10 i3)))) (delay (\i0 -> \i0 -> force i1))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i8 i1)) (delay (\i0 -> \i0 -> i2 (i10 i3))) (delay (i3 i2 (i7 i1)))))))) (\i0 -> equalsByteString i4 (unBData (i6 (i7 i1)))) i1)) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1))))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index 75ffe44c3..5c5088b51 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -11,10 +11,8 @@ import Plutarch.ApiSpec (validContext0) spec :: Spec spec = do describe "extra.api" $ do - -- Let's reuse the mock ctx from `Plutarch.TryFromSpec`, because that has - -- datums. let ctx = validContext0 - pgoldenSpec $ do + plutarchDevFlagDescribe . pgoldenSpec $ do "findOwnInput" @| findOwnInput # ctx "getContinuingOutputs" From 145f3574d9d7cd5ef42c2ac7695f028c9d6c3f74 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 6 Apr 2022 15:35:17 -0400 Subject: [PATCH 332/584] Remove tletField, tmatchField. They are redundant, especially pfromData is now implicit. --- plutarch-extra/Plutarch/Extra/Api.hs | 24 ++++++------ plutarch-extra/Plutarch/Extra/Monad.hs | 37 ++----------------- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 2 +- 3 files changed, 16 insertions(+), 47 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 064cf4ac7..c646a7130 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -18,7 +18,7 @@ import Plutarch.Api.V1 ( ) import Plutarch.Prelude -import Plutarch.Extra.Monad (tlet, tletField, tmatch, tmatchField) +import Plutarch.Extra.Monad (tlet, tmatch) {- | gets a list of continuing outputs by finding - its own input and returning a list of outputs with the same outAddress @@ -26,12 +26,12 @@ import Plutarch.Extra.Monad (tlet, tletField, tmatch, tmatchField) getContinuingOutputs :: Term s (PScriptContext :--> PBuiltinList PTxOut) getContinuingOutputs = phoistAcyclic $ plam $ \sc -> unTermCont $ do - txinfo <- tletField @"txInfo" sc - outs <- tletField @"outputs" txinfo + txinfo <- tlet $ pfield @"txInfo" # sc + outs <- tlet $ pfield @"outputs" # txinfo tmatch (findOwnInput # sc) >>= \case PJust te -> do - resolved <- tletField @"resolved" te - outAdr <- tletField @"address" resolved + resolved <- tlet $ pfield @"resolved" # te + outAdr <- tlet $ pfield @"address" # resolved pure $ pfilter # (matches # outAdr) #$ pmap # plam pfromData # outs PNothing -> pure $ ptraceError "can't get any continuing outputs" @@ -39,7 +39,7 @@ getContinuingOutputs = phoistAcyclic $ matches :: Term s (PAddress :--> PTxOut :--> PBool) matches = phoistAcyclic $ plam $ \adr txOut -> unTermCont $ do - outAdr <- tletField @"address" txOut + outAdr <- tlet $ pfield @"address" # txOut pure $ adr #== outAdr {- | tries to finds the transaction's input @@ -51,8 +51,8 @@ findOwnInput = phoistAcyclic $ PScriptContext te <- tmatch sc tmatch (pfromData $ pfield @"purpose" # te) >>= \case PSpending outRef' -> do - outRef <- tletField @"_0" outRef' - PTxInfo txinfo <- tmatchField @"txInfo" te + outRef <- tlet $ pfield @"_0" # outRef' + PTxInfo txinfo <- tmatch $ pfield @"txInfo" # te is <- tlet $ pmap # plam pfromData #$ pfromData $ pfield @"inputs" # txinfo pure $ pfind # (matches # outRef) # is _ -> @@ -62,10 +62,10 @@ findOwnInput = phoistAcyclic $ matches = phoistAcyclic $ plam $ \outref txininfo -> unTermCont $ do PTxOutRef outref' <- tmatch outref - outRefId <- tletField @"id" outref' + outRefId <- tlet $ pfield @"id" # outref' PTxInInfo txininfo' <- tmatch txininfo - PTxOutRef inOutRef <- tmatchField @"outRef" txininfo' - inOutRefId <- tletField @"id" inOutRef + PTxOutRef inOutRef <- tmatch $ pfield @"outRef" # txininfo' + inOutRefId <- tlet $ pfield @"id" # inOutRef pure $ outRefId #== inOutRefId @@ -73,7 +73,7 @@ findOwnInput = phoistAcyclic $ findDatum :: Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum) findDatum = phoistAcyclic $ plam $ \dh txinfo -> unTermCont $ do - txInfoData <- tletField @"data" txinfo + txInfoData <- tlet $ pfield @"data" # txinfo maybeEnt <- tlet $ pfind # (matches # dh) # txInfoData pure $ pmatch maybeEnt $ \case diff --git a/plutarch-extra/Plutarch/Extra/Monad.hs b/plutarch-extra/Plutarch/Extra/Monad.hs index bcff4b78f..bb879ca63 100644 --- a/plutarch-extra/Plutarch/Extra/Monad.hs +++ b/plutarch-extra/Plutarch/Extra/Monad.hs @@ -1,49 +1,18 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-} +-- | TermCont-related adapters for Plutarch functions. module Plutarch.Extra.Monad ( tlet, - tletField, tmatch, - tmatchField, ) where -import GHC.TypeLits (KnownNat) - -import Plutarch.DataRepr (PDataFields (PFields)) -import Plutarch.DataRepr.Internal (PLabelIndex, PUnLabel) -import Plutarch.DataRepr.Internal.HList (IndexList) import Plutarch.Prelude +-- | Like `plet` but works in a `TermCont` monad tlet :: Term s a -> TermCont s (Term s a) tlet = tcont . plet -tletField :: - forall name p s a as n. - ( PDataFields p - , as ~ PFields p - , n ~ PLabelIndex name as - , KnownNat n - , a ~ PUnLabel (IndexList n as) - , PIsData a - ) => - Term s p -> - TermCont s (Term s a) -tletField t = tlet $ pfromData $ pfield @name # t - +-- | Like `pmatch` but works in a `TermCont` monad tmatch :: PMatch a => Term s a -> TermCont s (a s) tmatch = tcont . pmatch - -tmatchField :: - forall name p s a as n. - ( PDataFields p - , as ~ PFields p - , n ~ PLabelIndex name as - , KnownNat n - , a ~ PUnLabel (IndexList n as) - , PIsData a - , PMatch a - ) => - Term s p -> - TermCont s (a s) -tmatchField t = tmatch $ pfromData $ pfield @name # t diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index 5c5088b51..f47fc92a0 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -4,7 +4,7 @@ import Plutarch.Extra.Api import Plutarch.Prelude import Plutarch.Test -import Test.Hspec (Spec, describe) +import Test.Hspec import Plutarch.ApiSpec (validContext0) From 7181f5e96f32b991425967c11d746bfe4e84ed9d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 6 Apr 2022 15:55:05 -0400 Subject: [PATCH 333/584] Add assertion checks to Plutarch.Extra.ApiSpec --- plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 10 +++++++--- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 11 +++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 5f9c77a3f..415b252a5 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -5,7 +5,10 @@ module Plutarch.ApiSpec ( spec, ctx, validContext0, + validOutputs0, invalidContext1, + d0Dat, + inp, ) where import Test.Tasty.HUnit @@ -255,6 +258,7 @@ invalidOutputs1 = validDatums1 :: [(DatumHash, Datum)] validDatums1 = - let dat :: Datum - dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] - in [("d0", dat)] + [("d0", d0Dat)] + +d0Dat :: Datum +d0Dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index f47fc92a0..9ca52794a 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -6,7 +6,7 @@ import Plutarch.Prelude import Plutarch.Test import Test.Hspec -import Plutarch.ApiSpec (validContext0) +import Plutarch.ApiSpec (d0Dat, inp, validContext0, validOutputs0) spec :: Spec spec = do @@ -14,8 +14,11 @@ spec = do let ctx = validContext0 plutarchDevFlagDescribe . pgoldenSpec $ do "findOwnInput" - @| findOwnInput # ctx + @| findOwnInput # ctx @-> \res -> + passert $ res #== pcon (PJust $ pconstant inp) "getContinuingOutputs" - @| getContinuingOutputs # ctx + @| getContinuingOutputs # ctx @-> \txOuts -> + passert $ txOuts #== pconstant validOutputs0 "findDatum" - @| findDatum # pconstant "d0" # (pfield @"txInfo" # ctx) + @| findDatum # pconstant "d0" # (pfield @"txInfo" # ctx) @-> \res -> + passert $ res #== pcon (PJust $ pconstant d0Dat) From dadeff1aab944957a96efdadca387ec2c8f6f72e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 7 Apr 2022 09:57:54 -0400 Subject: [PATCH 334/584] README: running test ghcid in development mode --- cabal.project | 4 ---- plutarch-test/README.md | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cabal.project b/cabal.project index 147f5f2e2..436b95495 100644 --- a/cabal.project +++ b/cabal.project @@ -3,7 +3,3 @@ packages: ./plutarch-* benchmarks: true - --- Enabling the flag here allows TraceSpec.hs and such tests to actually test --- the `ptrace` family of functions. --- flags: +development \ No newline at end of file diff --git a/plutarch-test/README.md b/plutarch-test/README.md index 468e54c8a..ea0d0cd87 100644 --- a/plutarch-test/README.md +++ b/plutarch-test/README.md @@ -19,8 +19,7 @@ $ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test' -T Main.main To run ghcid with development flag set: ```sh-session -$ vim cabal.project # And then uncomment the "flags: +developmenet" line. -$ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test' -T Main.main +$ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test -f development' -T Main.main ``` Note: `cabal run` should be run inside `./plutarch-test` directory. From 07144cdaca2383a7ea9ba6565ba4782f46377507 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 7 Apr 2022 10:04:22 -0400 Subject: [PATCH 335/584] optimize: use `pletFields` for multi-field access --- plutarch-extra/Plutarch/Extra/Api.hs | 13 +++++++------ .../goldens/extra.api.dev=false.bench.golden | 4 ++-- .../goldens/extra.api.dev=false.uplc.golden | 4 ++-- .../goldens/extra.api.dev=true.bench.golden | 4 ++-- .../goldens/extra.api.dev=true.uplc.golden | 4 ++-- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 3 +-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index c646a7130..da9385b91 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -4,15 +4,17 @@ module Plutarch.Extra.Api ( findDatum, ) where +import GHC.Records (HasField (getField)) + import Plutarch.Api.V1 ( PAddress, PDatum, PDatumHash, - PScriptContext (PScriptContext), + PScriptContext, PScriptPurpose (PSpending), PTuple, PTxInInfo (PTxInInfo), - PTxInfo (PTxInfo), + PTxInfo, PTxOut, PTxOutRef (PTxOutRef), ) @@ -48,12 +50,11 @@ getContinuingOutputs = phoistAcyclic $ findOwnInput :: Term s (PScriptContext :--> PMaybe PTxInInfo) findOwnInput = phoistAcyclic $ plam $ \sc -> unTermCont $ do - PScriptContext te <- tmatch sc - tmatch (pfromData $ pfield @"purpose" # te) >>= \case + ctx <- tcont $ pletFields @["txInfo", "purpose"] sc + tmatch (getField @"purpose" ctx) >>= \case PSpending outRef' -> do outRef <- tlet $ pfield @"_0" # outRef' - PTxInfo txinfo <- tmatch $ pfield @"txInfo" # te - is <- tlet $ pmap # plam pfromData #$ pfromData $ pfield @"inputs" # txinfo + is <- tlet $ pmap # plam pfromData #$ pfromData $ pfield @"inputs" # (getField @"txInfo" ctx) pure $ pfind # (matches # outRef) # is _ -> pure $ pcon PNothing diff --git a/plutarch-test/goldens/extra.api.dev=false.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden index 11a1e6b73..545895980 100644 --- a/plutarch-test/goldens/extra.api.dev=false.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=false.bench.golden @@ -1,3 +1,3 @@ -findOwnInput {"exBudgetCPU":11905533,"exBudgetMemory":24196,"scriptSizeBytes":371} -getContinuingOutputs {"exBudgetCPU":22798091,"exBudgetMemory":46026,"scriptSizeBytes":471} +findOwnInput {"exBudgetCPU":11486441,"exBudgetMemory":23732,"scriptSizeBytes":371} +getContinuingOutputs {"exBudgetCPU":22378999,"exBudgetMemory":45562,"scriptSizeBytes":471} findDatum {"exBudgetCPU":7462012,"exBudgetMemory":14406,"scriptSizeBytes":327} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.golden index 9beda8b32..cebbf45ef 100644 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=false.uplc.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i13 i1)) (delay (\i0 -> \i0 -> i2 (i15 i3))) (delay (i3 i2 (i14 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i12 (i14 (i12 (i14 i2))))) (i11 (i13 i3))) i1) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData (i9 (i11 (i9 (i11 i5))))))) (i8 i1))) (delay (\i0 -> \i0 -> force i1)))) (i10 i2)) (force (force fstPair) i1)) (unConstrData ((\i0 -> i6 (i7 i1)) (i7 i1)))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i11 (\i0 -> \i0 -> \i0 -> force (i15 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i12 (i2 (i19 i1)) (delay (\i0 -> \i0 -> i2 (i21 i3))) (delay (i3 i2 (i18 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i18 (i19 (i18 (i19 i2))))) (i17 (i18 i3))) i1) (i9 (\i0 -> i1) (unListData (i15 (i16 (i15 (i16 i7))))))) (i14 i1))) (delay (\i0 -> \i0 -> force i1)))) (i15 i2)) (force (force fstPair) i1)) (unConstrData ((\i0 -> i12 (i11 i1)) (i12 i3))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i14) (delay ((\i0 -> force (i11 (i4 i1) (delay (i16 i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i17 i1)))))) (\i0 -> (\i0 -> equalsData i3 i1) (i15 (i16 i1))) (i8 (\i0 -> i1) i4)) (i13 (i14 i1))) (i12 (i11 (i13 i1)))) (delay error)) (unListData (i10 (i9 (i11 i1))))) (i9 (i10 i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i11 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i13 (i15 (i13 (i15 i2))))) (i12 (i14 i3))) i1) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay [ ]) (delay (force mkCons (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i11 (i13 i1)) (i10 i5))))) (i9 i1))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i12 (\i0 -> \i0 -> \i0 -> force (i16 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i20 i1)) (delay (\i0 -> \i0 -> i2 (i22 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i19 (i20 (i19 (i20 i2))))) (i18 (i19 i3))) i1) (i10 (\i0 -> i1) (unListData ((\i0 -> i17 (i18 i1)) (i16 i5))))) (i15 i1))) (delay (\i0 -> \i0 -> force i1)))) (i16 i2)) (force (force fstPair) i1)) (unConstrData (i12 (i11 i1)))) (i12 i3) (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i14) (delay ((\i0 -> force (i11 (i4 i1) (delay (i16 i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i17 i1)))))) (\i0 -> (\i0 -> equalsData i3 i1) (i15 (i16 i1))) (i8 (\i0 -> i1) i4)) (i13 (i14 i1))) (i12 (i11 (i13 i1)))) (delay error)) (unListData (i10 (i9 (i11 i1))))) (i9 (i10 i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (i9 (i8 (i10 i3)))) (delay (\i0 -> \i0 -> force i1))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i8 i1)) (delay (\i0 -> \i0 -> i2 (i10 i3))) (delay (i3 i2 (i7 i1)))))))) (\i0 -> equalsByteString i4 (unBData (i6 (i7 i1)))) i1)) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1))))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden index f64fe9777..0a59fd471 100644 --- a/plutarch-test/goldens/extra.api.dev=true.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -1,3 +1,3 @@ -findOwnInput {"exBudgetCPU":11905533,"exBudgetMemory":24196,"scriptSizeBytes":371} -getContinuingOutputs {"exBudgetCPU":22798091,"exBudgetMemory":46026,"scriptSizeBytes":511} +findOwnInput {"exBudgetCPU":11486441,"exBudgetMemory":23732,"scriptSizeBytes":371} +getContinuingOutputs {"exBudgetCPU":22378999,"exBudgetMemory":45562,"scriptSizeBytes":511} findDatum {"exBudgetCPU":7462012,"exBudgetMemory":14406,"scriptSizeBytes":327} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.golden index d558c93f1..5c065709d 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i13 i1)) (delay (\i0 -> \i0 -> i2 (i15 i3))) (delay (i3 i2 (i14 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i12 (i14 (i12 (i14 i2))))) (i11 (i13 i3))) i1) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData (i9 (i11 (i9 (i11 i5))))))) (i8 i1))) (delay (\i0 -> \i0 -> force i1)))) (i10 i2)) (force (force fstPair) i1)) (unConstrData ((\i0 -> i6 (i7 i1)) (i7 i1)))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i11 (\i0 -> \i0 -> \i0 -> force (i15 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i12 (i2 (i19 i1)) (delay (\i0 -> \i0 -> i2 (i21 i3))) (delay (i3 i2 (i18 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i18 (i19 (i18 (i19 i2))))) (i17 (i18 i3))) i1) (i9 (\i0 -> i1) (unListData (i15 (i16 (i15 (i16 i7))))))) (i14 i1))) (delay (\i0 -> \i0 -> force i1)))) (i15 i2)) (force (force fstPair) i1)) (unConstrData ((\i0 -> i12 (i11 i1)) (i12 i3))) (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i14) (delay ((\i0 -> force (i11 (i4 i1) (delay (i16 i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i17 i1)))))) (\i0 -> (\i0 -> equalsData i3 i1) (i15 (i16 i1))) (i8 (\i0 -> i1) i4)) (i13 (i14 i1))) (i12 (i11 (i13 i1)))) (delay (force (force trace "can't get any continuing outputs" (delay error))))) (unListData (i10 (i9 (i11 i1))))) (i9 (i10 i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i11 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i13 (i15 (i13 (i15 i2))))) (i12 (i14 i3))) i1) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay [ ]) (delay (force mkCons (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i11 (i13 i1)) (i10 i5))))) (i9 i1))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i12 (\i0 -> \i0 -> \i0 -> force (i16 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i20 i1)) (delay (\i0 -> \i0 -> i2 (i22 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i19 (i20 (i19 (i20 i2))))) (i18 (i19 i3))) i1) (i10 (\i0 -> i1) (unListData ((\i0 -> i17 (i18 i1)) (i16 i5))))) (i15 i1))) (delay (\i0 -> \i0 -> force i1)))) (i16 i2)) (force (force fstPair) i1)) (unConstrData (i12 (i11 i1)))) (i12 i3) (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i14) (delay ((\i0 -> force (i11 (i4 i1) (delay (i16 i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i17 i1)))))) (\i0 -> (\i0 -> equalsData i3 i1) (i15 (i16 i1))) (i8 (\i0 -> i1) i4)) (i13 (i14 i1))) (i12 (i11 (i13 i1)))) (delay (force (force trace "can't get any continuing outputs" (delay error))))) (unListData (i10 (i9 (i11 i1))))) (i9 (i10 i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (i9 (i8 (i10 i3)))) (delay (\i0 -> \i0 -> force i1))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i8 i1)) (delay (\i0 -> \i0 -> i2 (i10 i3))) (delay (i3 i2 (i7 i1)))))))) (\i0 -> equalsByteString i4 (unBData (i6 (i7 i1)))) i1)) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1))))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index 9ca52794a..59b840bc6 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -3,11 +3,10 @@ module Plutarch.Extra.ApiSpec (spec) where import Plutarch.Extra.Api import Plutarch.Prelude +import Plutarch.ApiSpec (d0Dat, inp, validContext0, validOutputs0) import Plutarch.Test import Test.Hspec -import Plutarch.ApiSpec (d0Dat, inp, validContext0, validOutputs0) - spec :: Spec spec = do describe "extra.api" $ do From db70814ee6ae0cb605b1a49379b47a4c3da006c6 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 7 Apr 2022 10:33:18 -0400 Subject: [PATCH 336/584] optimize: avoid plet in single-use cases creates slightly worse code, as `plet` doesn't seem to inline for all cases. --- plutarch-extra/Plutarch/Extra/Api.hs | 34 +++++++++---------- .../goldens/extra.api.dev=false.bench.golden | 6 ++-- .../goldens/extra.api.dev=false.uplc.golden | 6 ++-- .../goldens/extra.api.dev=true.bench.golden | 6 ++-- .../goldens/extra.api.dev=true.uplc.golden | 6 ++-- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index da9385b91..8f2c3e8e7 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -20,7 +20,7 @@ import Plutarch.Api.V1 ( ) import Plutarch.Prelude -import Plutarch.Extra.Monad (tlet, tmatch) +import Plutarch.Extra.Monad (tmatch) {- | gets a list of continuing outputs by finding - its own input and returning a list of outputs with the same outAddress @@ -28,21 +28,20 @@ import Plutarch.Extra.Monad (tlet, tmatch) getContinuingOutputs :: Term s (PScriptContext :--> PBuiltinList PTxOut) getContinuingOutputs = phoistAcyclic $ plam $ \sc -> unTermCont $ do - txinfo <- tlet $ pfield @"txInfo" # sc - outs <- tlet $ pfield @"outputs" # txinfo + let txinfo = pfield @"txInfo" # sc tmatch (findOwnInput # sc) >>= \case PJust te -> do - resolved <- tlet $ pfield @"resolved" # te - outAdr <- tlet $ pfield @"address" # resolved + let outs = pfield @"outputs" # txinfo + resolved = pfield @"resolved" # te + outAdr = pfield @"address" # resolved pure $ pfilter # (matches # outAdr) #$ pmap # plam pfromData # outs PNothing -> pure $ ptraceError "can't get any continuing outputs" where matches :: Term s (PAddress :--> PTxOut :--> PBool) matches = phoistAcyclic $ - plam $ \adr txOut -> unTermCont $ do - outAdr <- tlet $ pfield @"address" # txOut - pure $ adr #== outAdr + plam $ \adr txOut -> + adr #== pfield @"address" # txOut {- | tries to finds the transaction's input - by looking for a txininfo in the inputs coresponding to the TxOutRef which the script purpose is spending @@ -53,9 +52,12 @@ findOwnInput = phoistAcyclic $ ctx <- tcont $ pletFields @["txInfo", "purpose"] sc tmatch (getField @"purpose" ctx) >>= \case PSpending outRef' -> do - outRef <- tlet $ pfield @"_0" # outRef' - is <- tlet $ pmap # plam pfromData #$ pfromData $ pfield @"inputs" # (getField @"txInfo" ctx) - pure $ pfind # (matches # outRef) # is + let outRef = pfield @"_0" # outRef' + pure $ + pfind # (matches # outRef) + #$ pmap # plam pfromData + #$ pfromData + $ pfield @"inputs" # (getField @"txInfo" ctx) _ -> pure $ pcon PNothing where @@ -63,19 +65,17 @@ findOwnInput = phoistAcyclic $ matches = phoistAcyclic $ plam $ \outref txininfo -> unTermCont $ do PTxOutRef outref' <- tmatch outref - outRefId <- tlet $ pfield @"id" # outref' PTxInInfo txininfo' <- tmatch txininfo PTxOutRef inOutRef <- tmatch $ pfield @"outRef" # txininfo' - inOutRefId <- tlet $ pfield @"id" # inOutRef pure $ - outRefId #== inOutRefId + pfield @"id" # outref' #== pfield @"id" # inOutRef -- | Looks up a datum by it's hash from the PTxInfo findDatum :: Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum) findDatum = phoistAcyclic $ plam $ \dh txinfo -> unTermCont $ do - txInfoData <- tlet $ pfield @"data" # txinfo - maybeEnt <- tlet $ pfind # (matches # dh) # txInfoData + let txInfoData = pfield @"data" # txinfo + maybeEnt = pfind # (matches # dh) # txInfoData pure $ pmatch maybeEnt $ \case PNothing -> pcon PNothing @@ -84,6 +84,6 @@ findDatum = phoistAcyclic $ matches :: Term s (PDatumHash :--> PAsData (PTuple PDatumHash PDatum) :--> PBool) matches = phoistAcyclic $ plam $ \dh dataTupe -> unTermCont $ do - tupe <- tlet $ pfromData dataTupe + let tupe = pfromData dataTupe pure $ dh #== pfromData (pfield @"_0" # tupe) diff --git a/plutarch-test/goldens/extra.api.dev=false.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden index 545895980..7e18a78d9 100644 --- a/plutarch-test/goldens/extra.api.dev=false.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=false.bench.golden @@ -1,3 +1,3 @@ -findOwnInput {"exBudgetCPU":11486441,"exBudgetMemory":23732,"scriptSizeBytes":371} -getContinuingOutputs {"exBudgetCPU":22378999,"exBudgetMemory":45562,"scriptSizeBytes":471} -findDatum {"exBudgetCPU":7462012,"exBudgetMemory":14406,"scriptSizeBytes":327} \ No newline at end of file +findOwnInput {"exBudgetCPU":11218484,"exBudgetMemory":22832,"scriptSizeBytes":364} +getContinuingOutputs {"exBudgetCPU":21932404,"exBudgetMemory":44062,"scriptSizeBytes":459} +findDatum {"exBudgetCPU":7283374,"exBudgetMemory":13806,"scriptSizeBytes":322} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.golden index cebbf45ef..c0d41d00b 100644 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=false.uplc.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i11 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i13 (i15 (i13 (i15 i2))))) (i12 (i14 i3))) i1) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay [ ]) (delay (force mkCons (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i11 (i13 i1)) (i10 i5))))) (i9 i1))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i12 (\i0 -> \i0 -> \i0 -> force (i16 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i20 i1)) (delay (\i0 -> \i0 -> i2 (i22 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i19 (i20 (i19 (i20 i2))))) (i18 (i19 i3))) i1) (i10 (\i0 -> i1) (unListData ((\i0 -> i17 (i18 i1)) (i16 i5))))) (i15 i1))) (delay (\i0 -> \i0 -> force i1)))) (i16 i2)) (force (force fstPair) i1)) (unConstrData (i12 (i11 i1)))) (i12 i3) (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i14) (delay ((\i0 -> force (i11 (i4 i1) (delay (i16 i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i17 i1)))))) (\i0 -> (\i0 -> equalsData i3 i1) (i15 (i16 i1))) (i8 (\i0 -> i1) i4)) (i13 (i14 i1))) (i12 (i11 (i13 i1)))) (delay error)) (unListData (i10 (i9 (i11 i1))))) (i9 (i10 i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (i9 (i8 (i10 i3)))) (delay (\i0 -> \i0 -> force i1))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i8 i1)) (delay (\i0 -> \i0 -> i2 (i10 i3))) (delay (i3 i2 (i7 i1)))))))) (\i0 -> equalsByteString i4 (unBData (i6 (i7 i1)))) i1)) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1))))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i7 (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i12 i1)) (delay (\i0 -> \i0 -> i2 (i14 i3))) (delay (i3 i2 (i13 i1)))))))) ((\i0 -> \i0 -> equalsData (i11 (i13 i2)) (i11 (i13 (i11 (i13 i1))))) (i9 i1)) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i10 (i12 i1)) (i9 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i16 i1)) (delay (\i0 -> \i0 -> i2 (i18 i3))) (delay (i3 i2 (i15 i1)))))))) ((\i0 -> \i0 -> equalsData (i15 (i16 i2)) (i15 (i16 (i15 (i16 i1))))) (i13 i1)) (i7 (\i0 -> i1) (unListData ((\i0 -> i14 (i15 i1)) (i13 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i14 i2)) (force (force fstPair) i1)) (unConstrData (i10 (i9 i1)))) (i10 i1) (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i10) (delay ((\i0 -> force (i7 (i4 i1) (delay (i12 i1 (i3 (i13 i2)))) (delay (i3 (i13 i2))))) (i13 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i12 (i13 i1))) ((\i0 -> i11 (i12 i1)) (i10 (i9 (i11 i1))))) (i4 (\i0 -> i1) ((\i0 -> unListData (i11 (i10 (i12 i1)))) (i10 (i11 i2))))) (delay error)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1)))) (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden index 0a59fd471..fe2a6d267 100644 --- a/plutarch-test/goldens/extra.api.dev=true.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -1,3 +1,3 @@ -findOwnInput {"exBudgetCPU":11486441,"exBudgetMemory":23732,"scriptSizeBytes":371} -getContinuingOutputs {"exBudgetCPU":22378999,"exBudgetMemory":45562,"scriptSizeBytes":511} -findDatum {"exBudgetCPU":7462012,"exBudgetMemory":14406,"scriptSizeBytes":327} \ No newline at end of file +findOwnInput {"exBudgetCPU":11218484,"exBudgetMemory":22832,"scriptSizeBytes":364} +getContinuingOutputs {"exBudgetCPU":21932404,"exBudgetMemory":44062,"scriptSizeBytes":499} +findDatum {"exBudgetCPU":7283374,"exBudgetMemory":13806,"scriptSizeBytes":322} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.golden index 5c065709d..2d0a481f5 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i9 (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i11 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i13 (i15 (i13 (i15 i2))))) (i12 (i14 i3))) i1) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay [ ]) (delay (force mkCons (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i11 (i13 i1)) (i10 i5))))) (i9 i1))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i8 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> i12 (\i0 -> \i0 -> \i0 -> force (i16 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i20 i1)) (delay (\i0 -> \i0 -> i2 (i22 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> (\i0 -> (\i0 -> equalsData i2 i1) (i19 (i20 (i19 (i20 i2))))) (i18 (i19 i3))) i1) (i10 (\i0 -> i1) (unListData ((\i0 -> i17 (i18 i1)) (i16 i5))))) (i15 i1))) (delay (\i0 -> \i0 -> force i1)))) (i16 i2)) (force (force fstPair) i1)) (unConstrData (i12 (i11 i1)))) (i12 i3) (\i0 -> (\i0 -> (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i14) (delay ((\i0 -> force (i11 (i4 i1) (delay (i16 i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i17 i1)))))) (\i0 -> (\i0 -> equalsData i3 i1) (i15 (i16 i1))) (i8 (\i0 -> i1) i4)) (i13 (i14 i1))) (i12 (i11 (i13 i1)))) (delay (force (force trace "can't get any continuing outputs" (delay error))))) (unListData (i10 (i9 (i11 i1))))) (i9 (i10 i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (i9 (i8 (i10 i3)))) (delay (\i0 -> \i0 -> force i1))) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i8 i1)) (delay (\i0 -> \i0 -> i2 (i10 i3))) (delay (i3 i2 (i7 i1)))))))) (\i0 -> equalsByteString i4 (unBData (i6 (i7 i1)))) i1)) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1))))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i7 (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i12 i1)) (delay (\i0 -> \i0 -> i2 (i14 i3))) (delay (i3 i2 (i13 i1)))))))) ((\i0 -> \i0 -> equalsData (i11 (i13 i2)) (i11 (i13 (i11 (i13 i1))))) (i9 i1)) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i10 (i12 i1)) (i9 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i16 i1)) (delay (\i0 -> \i0 -> i2 (i18 i3))) (delay (i3 i2 (i15 i1)))))))) ((\i0 -> \i0 -> equalsData (i15 (i16 i2)) (i15 (i16 (i15 (i16 i1))))) (i13 i1)) (i7 (\i0 -> i1) (unListData ((\i0 -> i14 (i15 i1)) (i13 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i14 i2)) (force (force fstPair) i1)) (unConstrData (i10 (i9 i1)))) (i10 i1) (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i10) (delay ((\i0 -> force (i7 (i4 i1) (delay (i12 i1 (i3 (i13 i2)))) (delay (i3 (i13 i2))))) (i13 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i12 (i13 i1))) ((\i0 -> i11 (i12 i1)) (i10 (i9 (i11 i1))))) (i4 (\i0 -> i1) ((\i0 -> unListData (i11 (i10 (i12 i1)))) (i10 (i11 i2))))) (delay (force (force trace "can't get any continuing outputs" (delay error))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1)))) (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file From 79a16e057222c013993f846c7ff080f26e8005e5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 7 Apr 2022 10:36:21 -0400 Subject: [PATCH 337/584] ghcid: builddir must be separate to avoid using wrong plutarch library --- .gitignore | 2 +- plutarch-test/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 36f5659ea..98e8047a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ /result* -/dist-newstyle +/dist-* .direnv diff --git a/plutarch-test/README.md b/plutarch-test/README.md index ea0d0cd87..565d6feda 100644 --- a/plutarch-test/README.md +++ b/plutarch-test/README.md @@ -19,7 +19,7 @@ $ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test' -T Main.main To run ghcid with development flag set: ```sh-session -$ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test -f development' -T Main.main +$ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test -f development --builddir=dist-ghc9-dev' -T Main.main ``` Note: `cabal run` should be run inside `./plutarch-test` directory. From 2ac9734032407881817c3b4625edd2184475ff76 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 7 Apr 2022 11:15:03 -0400 Subject: [PATCH 338/584] Simplify findDatum, by removing pfromData --- plutarch-extra/Plutarch/Extra/Api.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 8f2c3e8e7..d8f88ba80 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -79,11 +79,9 @@ findDatum = phoistAcyclic $ pure $ pmatch maybeEnt $ \case PNothing -> pcon PNothing - PJust x -> pcon $ PJust $ pfromData $ pfield @"_1" # x + PJust x -> pcon $ PJust $ pfield @"_1" # x where - matches :: Term s (PDatumHash :--> PAsData (PTuple PDatumHash PDatum) :--> PBool) + matches :: (PEq k, PIsData k) => Term s (k :--> PAsData (PTuple k v) :--> PBool) matches = phoistAcyclic $ - plam $ \dh dataTupe -> unTermCont $ do - let tupe = pfromData dataTupe - pure $ - dh #== pfromData (pfield @"_0" # tupe) + plam $ \dh dataTupe -> + dh #== pfield @"_0" # dataTupe From 30eefdc7c31d06fc6328959e3b7264e44122f15e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 7 Apr 2022 11:40:45 -0400 Subject: [PATCH 339/584] idiom: avoid unwrapping newtypes, because pfield can work on them This does make the performance slightly worse, but that should be fixed in Plutarch. --- plutarch-extra/Plutarch/Extra/Api.hs | 13 +++++-------- .../goldens/extra.api.dev=false.bench.golden | 4 ++-- .../goldens/extra.api.dev=false.uplc.golden | 4 ++-- .../goldens/extra.api.dev=true.bench.golden | 4 ++-- .../goldens/extra.api.dev=true.uplc.golden | 4 ++-- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index d8f88ba80..e03ebfbea 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -13,10 +13,10 @@ import Plutarch.Api.V1 ( PScriptContext, PScriptPurpose (PSpending), PTuple, - PTxInInfo (PTxInInfo), + PTxInInfo, PTxInfo, PTxOut, - PTxOutRef (PTxOutRef), + PTxOutRef, ) import Plutarch.Prelude @@ -63,12 +63,9 @@ findOwnInput = phoistAcyclic $ where matches :: Term s (PTxOutRef :--> PTxInInfo :--> PBool) matches = phoistAcyclic $ - plam $ \outref txininfo -> unTermCont $ do - PTxOutRef outref' <- tmatch outref - PTxInInfo txininfo' <- tmatch txininfo - PTxOutRef inOutRef <- tmatch $ pfield @"outRef" # txininfo' - pure $ - pfield @"id" # outref' #== pfield @"id" # inOutRef + plam $ \outref txininfo -> + pfield @"id" # outref + #== pfield @"id" # (pfield @"outRef" # txininfo) -- | Looks up a datum by it's hash from the PTxInfo findDatum :: Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum) diff --git a/plutarch-test/goldens/extra.api.dev=false.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden index 7e18a78d9..de39a38a6 100644 --- a/plutarch-test/goldens/extra.api.dev=false.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=false.bench.golden @@ -1,3 +1,3 @@ -findOwnInput {"exBudgetCPU":11218484,"exBudgetMemory":22832,"scriptSizeBytes":364} -getContinuingOutputs {"exBudgetCPU":21932404,"exBudgetMemory":44062,"scriptSizeBytes":459} +findOwnInput {"exBudgetCPU":11307803,"exBudgetMemory":23132,"scriptSizeBytes":366} +getContinuingOutputs {"exBudgetCPU":22021723,"exBudgetMemory":44362,"scriptSizeBytes":461} findDatum {"exBudgetCPU":7283374,"exBudgetMemory":13806,"scriptSizeBytes":322} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.golden index c0d41d00b..5489d7aa9 100644 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=false.uplc.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i7 (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i12 i1)) (delay (\i0 -> \i0 -> i2 (i14 i3))) (delay (i3 i2 (i13 i1)))))))) ((\i0 -> \i0 -> equalsData (i11 (i13 i2)) (i11 (i13 (i11 (i13 i1))))) (i9 i1)) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i10 (i12 i1)) (i9 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i16 i1)) (delay (\i0 -> \i0 -> i2 (i18 i3))) (delay (i3 i2 (i15 i1)))))))) ((\i0 -> \i0 -> equalsData (i15 (i16 i2)) (i15 (i16 (i15 (i16 i1))))) (i13 i1)) (i7 (\i0 -> i1) (unListData ((\i0 -> i14 (i15 i1)) (i13 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i14 i2)) (force (force fstPair) i1)) (unConstrData (i10 (i9 i1)))) (i10 i1) (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i10) (delay ((\i0 -> force (i7 (i4 i1) (delay (i12 i1 (i3 (i13 i2)))) (delay (i3 (i13 i2))))) (i13 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i12 (i13 i1))) ((\i0 -> i11 (i12 i1)) (i10 (i9 (i11 i1))))) (i4 (\i0 -> i1) ((\i0 -> unListData (i11 (i10 (i12 i1)))) (i10 (i11 i2))))) (delay error)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i7 (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i12 i1)) (delay (\i0 -> \i0 -> i2 (i14 i3))) (delay (i3 i2 (i13 i1)))))))) ((\i0 -> \i0 -> equalsData (i11 (i13 i2)) ((\i0 -> i12 (i14 i1)) (i11 (i13 i1)))) (i9 i1)) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i10 (i12 i1)) (i9 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i16 i1)) (delay (\i0 -> \i0 -> i2 (i18 i3))) (delay (i3 i2 (i15 i1)))))))) ((\i0 -> \i0 -> equalsData (i15 (i16 i2)) ((\i0 -> i16 (i17 i1)) (i15 (i16 i1)))) (i13 i1)) (i7 (\i0 -> i1) (unListData ((\i0 -> i14 (i15 i1)) (i13 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i14 i2)) (force (force fstPair) i1)) (unConstrData (i10 (i9 i1)))) (i10 i1) (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i10) (delay ((\i0 -> force (i7 (i4 i1) (delay (i12 i1 (i3 (i13 i2)))) (delay (i3 (i13 i2))))) (i13 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i12 (i13 i1))) ((\i0 -> i11 (i12 i1)) (i10 (i9 (i11 i1))))) (i4 (\i0 -> i1) ((\i0 -> unListData (i11 (i10 (i12 i1)))) (i10 (i11 i2))))) (delay error)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1)))) (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden index fe2a6d267..aa4174a2c 100644 --- a/plutarch-test/goldens/extra.api.dev=true.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -1,3 +1,3 @@ -findOwnInput {"exBudgetCPU":11218484,"exBudgetMemory":22832,"scriptSizeBytes":364} -getContinuingOutputs {"exBudgetCPU":21932404,"exBudgetMemory":44062,"scriptSizeBytes":499} +findOwnInput {"exBudgetCPU":11307803,"exBudgetMemory":23132,"scriptSizeBytes":366} +getContinuingOutputs {"exBudgetCPU":22021723,"exBudgetMemory":44362,"scriptSizeBytes":501} findDatum {"exBudgetCPU":7283374,"exBudgetMemory":13806,"scriptSizeBytes":322} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.golden index 2d0a481f5..fa003aa75 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i7 (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i12 i1)) (delay (\i0 -> \i0 -> i2 (i14 i3))) (delay (i3 i2 (i13 i1)))))))) ((\i0 -> \i0 -> equalsData (i11 (i13 i2)) (i11 (i13 (i11 (i13 i1))))) (i9 i1)) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i10 (i12 i1)) (i9 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i16 i1)) (delay (\i0 -> \i0 -> i2 (i18 i3))) (delay (i3 i2 (i15 i1)))))))) ((\i0 -> \i0 -> equalsData (i15 (i16 i2)) (i15 (i16 (i15 (i16 i1))))) (i13 i1)) (i7 (\i0 -> i1) (unListData ((\i0 -> i14 (i15 i1)) (i13 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i14 i2)) (force (force fstPair) i1)) (unConstrData (i10 (i9 i1)))) (i10 i1) (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i10) (delay ((\i0 -> force (i7 (i4 i1) (delay (i12 i1 (i3 (i13 i2)))) (delay (i3 (i13 i2))))) (i13 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i12 (i13 i1))) ((\i0 -> i11 (i12 i1)) (i10 (i9 (i11 i1))))) (i4 (\i0 -> i1) ((\i0 -> unListData (i11 (i10 (i12 i1)))) (i10 (i11 i2))))) (delay (force (force trace "can't get any continuing outputs" (delay error))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i7 (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i12 i1)) (delay (\i0 -> \i0 -> i2 (i14 i3))) (delay (i3 i2 (i13 i1)))))))) ((\i0 -> \i0 -> equalsData (i11 (i13 i2)) ((\i0 -> i12 (i14 i1)) (i11 (i13 i1)))) (i9 i1)) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i10 (i12 i1)) (i9 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i16 i1)) (delay (\i0 -> \i0 -> i2 (i18 i3))) (delay (i3 i2 (i15 i1)))))))) ((\i0 -> \i0 -> equalsData (i15 (i16 i2)) ((\i0 -> i16 (i17 i1)) (i15 (i16 i1)))) (i13 i1)) (i7 (\i0 -> i1) (unListData ((\i0 -> i14 (i15 i1)) (i13 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i14 i2)) (force (force fstPair) i1)) (unConstrData (i10 (i9 i1)))) (i10 i1) (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i10) (delay ((\i0 -> force (i7 (i4 i1) (delay (i12 i1 (i3 (i13 i2)))) (delay (i3 (i13 i2))))) (i13 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i12 (i13 i1))) ((\i0 -> i11 (i12 i1)) (i10 (i9 (i11 i1))))) (i4 (\i0 -> i1) ((\i0 -> unListData (i11 (i10 (i12 i1)))) (i10 (i11 i2))))) (delay (force (force trace "can't get any continuing outputs" (delay error))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1)))) (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file From 54eda098cc5ffb33fddbc87e782b67d2507f4c45 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 7 Apr 2022 17:18:27 -0400 Subject: [PATCH 340/584] Finalize haddocks, and hoist pair extractors --- plutarch-extra/Plutarch/Extra/Api.hs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index e03ebfbea..47a42849f 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -22,9 +22,7 @@ import Plutarch.Prelude import Plutarch.Extra.Monad (tmatch) -{- | gets a list of continuing outputs by finding - - its own input and returning a list of outputs with the same outAddress --} +-- | Find the output txns corresponding to the input being validated. getContinuingOutputs :: Term s (PScriptContext :--> PBuiltinList PTxOut) getContinuingOutputs = phoistAcyclic $ plam $ \sc -> unTermCont $ do @@ -43,8 +41,10 @@ getContinuingOutputs = phoistAcyclic $ plam $ \adr txOut -> adr #== pfield @"address" # txOut -{- | tries to finds the transaction's input - - by looking for a txininfo in the inputs coresponding to the TxOutRef which the script purpose is spending +{- | Find the input currently being validated. + + Tries to finds the transaction's input by looking for a `PTxInInfo` in the inputs + coresponding to the `PTxOutRef` which the script purpose is spending -} findOwnInput :: Term s (PScriptContext :--> PMaybe PTxInInfo) findOwnInput = phoistAcyclic $ @@ -67,7 +67,7 @@ findOwnInput = phoistAcyclic $ pfield @"id" # outref #== pfield @"id" # (pfield @"outRef" # txininfo) --- | Looks up a datum by it's hash from the PTxInfo +-- | Find the data corresponding to a data hash, if there is one findDatum :: Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum) findDatum = phoistAcyclic $ plam $ \dh txinfo -> unTermCont $ do @@ -76,9 +76,15 @@ findDatum = phoistAcyclic $ pure $ pmatch maybeEnt $ \case PNothing -> pcon PNothing - PJust x -> pcon $ PJust $ pfield @"_1" # x + PJust x -> pcon $ PJust $ pdsnd # x where matches :: (PEq k, PIsData k) => Term s (k :--> PAsData (PTuple k v) :--> PBool) matches = phoistAcyclic $ - plam $ \dh dataTupe -> - dh #== pfield @"_0" # dataTupe + plam $ \a ab -> + a #== pdfst # ab + +pdfst :: PIsData k => Term s (PAsData (PTuple k v) :--> k) +pdfst = pfield @"_0" + +pdsnd :: PIsData v => Term s (PAsData (PTuple k v) :--> v) +pdsnd = pfield @"_1" From 5d9f621f052f196ce5a2b46478ab19028d98c556 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 11 Apr 2022 10:20:17 -0400 Subject: [PATCH 341/584] Prefix extra functions with p* --- plutarch-extra/Plutarch/Extra/Api.hs | 20 +++++++++---------- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 12 +++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 47a42849f..75a44e550 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -1,7 +1,7 @@ module Plutarch.Extra.Api ( - getContinuingOutputs, - findOwnInput, - findDatum, + pgetContinuingOutputs, + pfindOwnInput, + pfindDatum, ) where import GHC.Records (HasField (getField)) @@ -23,11 +23,11 @@ import Plutarch.Prelude import Plutarch.Extra.Monad (tmatch) -- | Find the output txns corresponding to the input being validated. -getContinuingOutputs :: Term s (PScriptContext :--> PBuiltinList PTxOut) -getContinuingOutputs = phoistAcyclic $ +pgetContinuingOutputs :: Term s (PScriptContext :--> PBuiltinList PTxOut) +pgetContinuingOutputs = phoistAcyclic $ plam $ \sc -> unTermCont $ do let txinfo = pfield @"txInfo" # sc - tmatch (findOwnInput # sc) >>= \case + tmatch (pfindOwnInput # sc) >>= \case PJust te -> do let outs = pfield @"outputs" # txinfo resolved = pfield @"resolved" # te @@ -46,8 +46,8 @@ getContinuingOutputs = phoistAcyclic $ Tries to finds the transaction's input by looking for a `PTxInInfo` in the inputs coresponding to the `PTxOutRef` which the script purpose is spending -} -findOwnInput :: Term s (PScriptContext :--> PMaybe PTxInInfo) -findOwnInput = phoistAcyclic $ +pfindOwnInput :: Term s (PScriptContext :--> PMaybe PTxInInfo) +pfindOwnInput = phoistAcyclic $ plam $ \sc -> unTermCont $ do ctx <- tcont $ pletFields @["txInfo", "purpose"] sc tmatch (getField @"purpose" ctx) >>= \case @@ -68,8 +68,8 @@ findOwnInput = phoistAcyclic $ #== pfield @"id" # (pfield @"outRef" # txininfo) -- | Find the data corresponding to a data hash, if there is one -findDatum :: Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum) -findDatum = phoistAcyclic $ +pfindDatum :: Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum) +pfindDatum = phoistAcyclic $ plam $ \dh txinfo -> unTermCont $ do let txInfoData = pfield @"data" # txinfo maybeEnt = pfind # (matches # dh) # txInfoData diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index 59b840bc6..d8a0a6512 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -12,12 +12,12 @@ spec = do describe "extra.api" $ do let ctx = validContext0 plutarchDevFlagDescribe . pgoldenSpec $ do - "findOwnInput" - @| findOwnInput # ctx @-> \res -> + "pfindOwnInput" + @| pfindOwnInput # ctx @-> \res -> passert $ res #== pcon (PJust $ pconstant inp) - "getContinuingOutputs" - @| getContinuingOutputs # ctx @-> \txOuts -> + "pgetContinuingOutputs" + @| pgetContinuingOutputs # ctx @-> \txOuts -> passert $ txOuts #== pconstant validOutputs0 - "findDatum" - @| findDatum # pconstant "d0" # (pfield @"txInfo" # ctx) @-> \res -> + "pfindDatum" + @| pfindDatum # pconstant "d0" # (pfield @"txInfo" # ctx) @-> \res -> passert $ res #== pcon (PJust $ pconstant d0Dat) From 2c6c942ac3230fd6346aadad956b3c5325c0eee2 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 11 Apr 2022 10:20:56 -0400 Subject: [PATCH 342/584] Fix build after #415 merge --- plutarch-extra/Plutarch/Extra/Api.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 75a44e550..6158bac32 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -4,8 +4,6 @@ module Plutarch.Extra.Api ( pfindDatum, ) where -import GHC.Records (HasField (getField)) - import Plutarch.Api.V1 ( PAddress, PDatum, @@ -71,7 +69,7 @@ pfindOwnInput = phoistAcyclic $ pfindDatum :: Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum) pfindDatum = phoistAcyclic $ plam $ \dh txinfo -> unTermCont $ do - let txInfoData = pfield @"data" # txinfo + let txInfoData = pfield @"datums" # txinfo maybeEnt = pfind # (matches # dh) # txInfoData pure $ pmatch maybeEnt $ \case From 4da8e0252424db70489cde04150b838c2f7f38f5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 11 Apr 2022 10:22:42 -0400 Subject: [PATCH 343/584] Use p* prefix for Plutarch.Extra.Monad as well --- plutarch-extra/Plutarch/Extra/Api.hs | 6 +++--- plutarch-extra/Plutarch/Extra/Monad.hs | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 6158bac32..1ed049bca 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -18,14 +18,14 @@ import Plutarch.Api.V1 ( ) import Plutarch.Prelude -import Plutarch.Extra.Monad (tmatch) +import Plutarch.Extra.Monad (pmatchC) -- | Find the output txns corresponding to the input being validated. pgetContinuingOutputs :: Term s (PScriptContext :--> PBuiltinList PTxOut) pgetContinuingOutputs = phoistAcyclic $ plam $ \sc -> unTermCont $ do let txinfo = pfield @"txInfo" # sc - tmatch (pfindOwnInput # sc) >>= \case + pmatchC (pfindOwnInput # sc) >>= \case PJust te -> do let outs = pfield @"outputs" # txinfo resolved = pfield @"resolved" # te @@ -48,7 +48,7 @@ pfindOwnInput :: Term s (PScriptContext :--> PMaybe PTxInInfo) pfindOwnInput = phoistAcyclic $ plam $ \sc -> unTermCont $ do ctx <- tcont $ pletFields @["txInfo", "purpose"] sc - tmatch (getField @"purpose" ctx) >>= \case + pmatchC (getField @"purpose" ctx) >>= \case PSpending outRef' -> do let outRef = pfield @"_0" # outRef' pure $ diff --git a/plutarch-extra/Plutarch/Extra/Monad.hs b/plutarch-extra/Plutarch/Extra/Monad.hs index bb879ca63..03d36d454 100644 --- a/plutarch-extra/Plutarch/Extra/Monad.hs +++ b/plutarch-extra/Plutarch/Extra/Monad.hs @@ -3,16 +3,16 @@ -- | TermCont-related adapters for Plutarch functions. module Plutarch.Extra.Monad ( - tlet, - tmatch, + pletC, + pmatchC, ) where import Plutarch.Prelude -- | Like `plet` but works in a `TermCont` monad -tlet :: Term s a -> TermCont s (Term s a) -tlet = tcont . plet +pletC :: Term s a -> TermCont s (Term s a) +pletC = tcont . plet -- | Like `pmatch` but works in a `TermCont` monad -tmatch :: PMatch a => Term s a -> TermCont s (a s) -tmatch = tcont . pmatch +pmatchC :: PMatch a => Term s a -> TermCont s (a s) +pmatchC = tcont . pmatch From 864e325a7bba687edf099f86cb5151f44dad5cac Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 11 Apr 2022 19:11:01 -0400 Subject: [PATCH 344/584] Reduce the scope of arguments to Plutarch.Extra.Api --- plutarch-extra/Plutarch/Extra/Api.hs | 99 +++++++++++-------- .../goldens/extra.api.dev=false.bench.golden | 6 +- .../extra.api.dev=false.uplc.eval.golden | 6 +- .../goldens/extra.api.dev=false.uplc.golden | 6 +- .../goldens/extra.api.dev=true.bench.golden | 6 +- .../extra.api.dev=true.uplc.eval.golden | 6 +- .../goldens/extra.api.dev=true.uplc.golden | 6 +- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 37 +++++-- 8 files changed, 108 insertions(+), 64 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 1ed049bca..a150f23d7 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -8,56 +8,69 @@ import Plutarch.Api.V1 ( PAddress, PDatum, PDatumHash, - PScriptContext, - PScriptPurpose (PSpending), PTuple, PTxInInfo, - PTxInfo, PTxOut, PTxOutRef, ) import Plutarch.Prelude -import Plutarch.Extra.Monad (pmatchC) +{- | Find the output txns corresponding to the input being validated. --- | Find the output txns corresponding to the input being validated. -pgetContinuingOutputs :: Term s (PScriptContext :--> PBuiltinList PTxOut) + Takes as arguments the inputs, outputs and the spending transaction referenced + from `PScriptPurpose`. + + __Example:__ + + @ + ctx <- tcont $ pletFields @["txInfo", "purpose"] sc + pmatchC (getField @"purpose" ctx) >>= \case + PSpending outRef' -> do + let outRef = pfield @"_0" # outRef' + inputs = pfield @"inputs" # (getField @"txInfo" ctx) + outputs = pfield @"outputs" # (getField @"txInfo" ctx) + pure $ pgetContinuingOutputs # inputs # outputs # outRef + _ -> + pure $ ptraceError "not a spending tx" + @ +-} +pgetContinuingOutputs :: Term s (PBuiltinList (PAsData PTxInInfo) :--> PBuiltinList (PAsData PTxOut) :--> PTxOutRef :--> PBuiltinList PTxOut) pgetContinuingOutputs = phoistAcyclic $ - plam $ \sc -> unTermCont $ do - let txinfo = pfield @"txInfo" # sc - pmatchC (pfindOwnInput # sc) >>= \case - PJust te -> do - let outs = pfield @"outputs" # txinfo - resolved = pfield @"resolved" # te - outAdr = pfield @"address" # resolved - pure $ pfilter # (matches # outAdr) #$ pmap # plam pfromData # outs + plam $ \inputs outputs outRef -> + pmatch (pfindOwnInput # inputs # outRef) $ \case + PJust tx -> do + let resolved = pfield @"resolved" # tx + outAddr = pfield @"address" # resolved + pfilter # (matches # outAddr) #$ pmap # plam pfromData # outputs PNothing -> - pure $ ptraceError "can't get any continuing outputs" + ptraceError "can't get any continuing outputs" where matches :: Term s (PAddress :--> PTxOut :--> PBool) matches = phoistAcyclic $ plam $ \adr txOut -> adr #== pfield @"address" # txOut -{- | Find the input currently being validated. +{- | Find the input being spent in the current transaction. + + Takes as arguments the inputs, as well as the spending transaction referenced from `PScriptPurpose`. + + __Example:__ - Tries to finds the transaction's input by looking for a `PTxInInfo` in the inputs - coresponding to the `PTxOutRef` which the script purpose is spending + @ + ctx <- tcont $ pletFields @["txInfo", "purpose"] sc + pmatchC (getField @"purpose" ctx) >>= \case + PSpending outRef' -> do + let outRef = pfield @"_0" # outRef' + inputs = pfield @"inputs" # (getField @"txInfo" ctx) + pure $ pfindOwnInput # inputs # outRef + _ -> + pure $ ptraceError "not a spending tx" + @ -} -pfindOwnInput :: Term s (PScriptContext :--> PMaybe PTxInInfo) +pfindOwnInput :: Term s (PBuiltinList (PAsData PTxInInfo) :--> PTxOutRef :--> PMaybe PTxInInfo) pfindOwnInput = phoistAcyclic $ - plam $ \sc -> unTermCont $ do - ctx <- tcont $ pletFields @["txInfo", "purpose"] sc - pmatchC (getField @"purpose" ctx) >>= \case - PSpending outRef' -> do - let outRef = pfield @"_0" # outRef' - pure $ - pfind # (matches # outRef) - #$ pmap # plam pfromData - #$ pfromData - $ pfield @"inputs" # (getField @"txInfo" ctx) - _ -> - pure $ pcon PNothing + plam $ \inputs outRef -> + pfind # (matches # outRef) #$ pmap # plam pfromData #$ inputs where matches :: Term s (PTxOutRef :--> PTxInInfo :--> PBool) matches = phoistAcyclic $ @@ -65,16 +78,22 @@ pfindOwnInput = phoistAcyclic $ pfield @"id" # outref #== pfield @"id" # (pfield @"outRef" # txininfo) --- | Find the data corresponding to a data hash, if there is one -pfindDatum :: Term s (PDatumHash :--> PTxInfo :--> PMaybe PDatum) +{- | Lookup up the datum given the datum hash. + + Takes as argument the datum assoc list from a `PTxInfo`. + + __Example:__ + + @ + pfindDatum # datumHash #$ pfield @"datums" # txinfo + @ +-} +pfindDatum :: Term s (PDatumHash :--> PBuiltinList (PAsData (PTuple PDatumHash PDatum)) :--> PMaybe PDatum) pfindDatum = phoistAcyclic $ - plam $ \dh txinfo -> unTermCont $ do - let txInfoData = pfield @"datums" # txinfo - maybeEnt = pfind # (matches # dh) # txInfoData - pure $ - pmatch maybeEnt $ \case - PNothing -> pcon PNothing - PJust x -> pcon $ PJust $ pdsnd # x + plam $ \dh datums -> + pmatch (pfind # (matches # dh) # datums) $ \case + PNothing -> pcon PNothing + PJust x -> pcon $ PJust $ pdsnd # x where matches :: (PEq k, PIsData k) => Term s (k :--> PAsData (PTuple k v) :--> PBool) matches = phoistAcyclic $ diff --git a/plutarch-test/goldens/extra.api.dev=false.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden index de39a38a6..2f21e2b27 100644 --- a/plutarch-test/goldens/extra.api.dev=false.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=false.bench.golden @@ -1,3 +1,3 @@ -findOwnInput {"exBudgetCPU":11307803,"exBudgetMemory":23132,"scriptSizeBytes":366} -getContinuingOutputs {"exBudgetCPU":22021723,"exBudgetMemory":44362,"scriptSizeBytes":461} -findDatum {"exBudgetCPU":7283374,"exBudgetMemory":13806,"scriptSizeBytes":322} \ No newline at end of file +pfindOwnInput {"exBudgetCPU":11307803,"exBudgetMemory":23132,"scriptSizeBytes":364} +pgetContinuingOutputs {"exBudgetCPU":21602631,"exBudgetMemory":43898,"scriptSizeBytes":459} +pfindDatum {"exBudgetCPU":7372693,"exBudgetMemory":14106,"scriptSizeBytes":325} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden index 3612e5306..dea206731 100644 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) -getContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) -findDatum (program 1.0.0 (\i0 -> \i0 -> i2 (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))))) \ No newline at end of file +pfindOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) +pgetContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) +pfindDatum (program 1.0.0 (\i0 -> \i0 -> i2 (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.golden index 5489d7aa9..33675c28f 100644 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=false.uplc.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i7 (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i12 i1)) (delay (\i0 -> \i0 -> i2 (i14 i3))) (delay (i3 i2 (i13 i1)))))))) ((\i0 -> \i0 -> equalsData (i11 (i13 i2)) ((\i0 -> i12 (i14 i1)) (i11 (i13 i1)))) (i9 i1)) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i10 (i12 i1)) (i9 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i16 i1)) (delay (\i0 -> \i0 -> i2 (i18 i3))) (delay (i3 i2 (i15 i1)))))))) ((\i0 -> \i0 -> equalsData (i15 (i16 i2)) ((\i0 -> i16 (i17 i1)) (i15 (i16 i1)))) (i13 i1)) (i7 (\i0 -> i1) (unListData ((\i0 -> i14 (i15 i1)) (i13 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i14 i2)) (force (force fstPair) i1)) (unConstrData (i10 (i9 i1)))) (i10 i1) (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i10) (delay ((\i0 -> force (i7 (i4 i1) (delay (i12 i1 (i3 (i13 i2)))) (delay (i3 (i13 i2))))) (i13 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i12 (i13 i1))) ((\i0 -> i11 (i12 i1)) (i10 (i9 (i11 i1))))) (i4 (\i0 -> i1) ((\i0 -> unListData (i11 (i10 (i12 i1)))) (i10 (i11 i2))))) (delay error)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1)))) (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i13 i1)) (delay (\i0 -> \i0 -> i2 (i15 i3))) (delay (i3 i2 (i14 i1)))))))) (\i0 -> equalsData (i11 (i13 i2)) ((\i0 -> i12 (i14 i1)) (i11 (i13 i1)))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay [ ]) (delay (force mkCons (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> i1) i2)) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> \i0 -> force (i14 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i11 (i2 (i17 i1)) (delay (\i0 -> \i0 -> i2 (i19 i3))) (delay (i3 i2 (i18 i1)))))))) (\i0 -> equalsData (i15 (i17 i2)) ((\i0 -> i16 (i18 i1)) (i15 (i17 i1)))) (i9 (\i0 -> i1) i3) (\i0 -> (\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i16) (delay ((\i0 -> force (i13 (i4 i1) (delay (i18 i1 (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i18 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i17 (i19 i1))) ((\i0 -> i16 (i18 i1)) (i15 (i16 (i17 i1))))) (i10 (\i0 -> i1) i3)) (delay error)) ((\i0 -> unListData (i12 (i14 i1))) (i11 i4)) ((\i0 -> unListData (i12 (i13 (i14 i1)))) (i11 i4)) (i11 i1))) (delay error))) (i13 i2)) (force (force fstPair) i1)) (unConstrData (i8 (i9 i1)))) (i9 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i8 i1)) (i2 (i9 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pfindDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i3 ((\i0 -> i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1)))))))) (i4 i1)))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden index aa4174a2c..0893e682c 100644 --- a/plutarch-test/goldens/extra.api.dev=true.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -1,3 +1,3 @@ -findOwnInput {"exBudgetCPU":11307803,"exBudgetMemory":23132,"scriptSizeBytes":366} -getContinuingOutputs {"exBudgetCPU":22021723,"exBudgetMemory":44362,"scriptSizeBytes":501} -findDatum {"exBudgetCPU":7283374,"exBudgetMemory":13806,"scriptSizeBytes":322} \ No newline at end of file +pfindOwnInput {"exBudgetCPU":11307803,"exBudgetMemory":23132,"scriptSizeBytes":364} +pgetContinuingOutputs {"exBudgetCPU":21602631,"exBudgetMemory":43898,"scriptSizeBytes":499} +pfindDatum {"exBudgetCPU":7372693,"exBudgetMemory":14106,"scriptSizeBytes":325} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden index 3612e5306..dea206731 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) -getContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) -findDatum (program 1.0.0 (\i0 -> \i0 -> i2 (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))))) \ No newline at end of file +pfindOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) +pgetContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) +pfindDatum (program 1.0.0 (\i0 -> \i0 -> i2 (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.golden index fa003aa75..00545d104 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.golden @@ -1,3 +1,3 @@ -findOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i7 (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i12 i1)) (delay (\i0 -> \i0 -> i2 (i14 i3))) (delay (i3 i2 (i13 i1)))))))) ((\i0 -> \i0 -> equalsData (i11 (i13 i2)) ((\i0 -> i12 (i14 i1)) (i11 (i13 i1)))) (i9 i1)) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> i1) (unListData ((\i0 -> i10 (i12 i1)) (i9 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -getContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 1 i2) (delay (i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i9 (i2 (i16 i1)) (delay (\i0 -> \i0 -> i2 (i18 i3))) (delay (i3 i2 (i15 i1)))))))) ((\i0 -> \i0 -> equalsData (i15 (i16 i2)) ((\i0 -> i16 (i17 i1)) (i15 (i16 i1)))) (i13 i1)) (i7 (\i0 -> i1) (unListData ((\i0 -> i14 (i15 i1)) (i13 i4)))))) (delay (\i0 -> \i0 -> force i1)))) (i14 i2)) (force (force fstPair) i1)) (unConstrData (i10 (i9 i1)))) (i10 i1) (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i10) (delay ((\i0 -> force (i7 (i4 i1) (delay (i12 i1 (i3 (i13 i2)))) (delay (i3 (i13 i2))))) (i13 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i12 (i13 i1))) ((\i0 -> i11 (i12 i1)) (i10 (i9 (i11 i1))))) (i4 (\i0 -> i1) ((\i0 -> unListData (i11 (i10 (i12 i1)))) (i10 (i11 i2))))) (delay (force (force trace "can't get any continuing outputs" (delay error))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i9 i1)) (i2 (i8 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -findDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) (unListData (i4 ((\i0 -> i4 (i4 (i4 (i4 (i4 (i4 (i4 (i4 i1)))))))) (i5 i1)))) (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i13 i1)) (delay (\i0 -> \i0 -> i2 (i15 i3))) (delay (i3 i2 (i14 i1)))))))) (\i0 -> equalsData (i11 (i13 i2)) ((\i0 -> i12 (i14 i1)) (i11 (i13 i1)))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay [ ]) (delay (force mkCons (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> i1) i2)) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> \i0 -> force (i14 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i11 (i2 (i17 i1)) (delay (\i0 -> \i0 -> i2 (i19 i3))) (delay (i3 i2 (i18 i1)))))))) (\i0 -> equalsData (i15 (i17 i2)) ((\i0 -> i16 (i18 i1)) (i15 (i17 i1)))) (i9 (\i0 -> i1) i3) (\i0 -> (\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i16) (delay ((\i0 -> force (i13 (i4 i1) (delay (i18 i1 (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i18 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i17 (i19 i1))) ((\i0 -> i16 (i18 i1)) (i15 (i16 (i17 i1))))) (i10 (\i0 -> i1) i3)) (delay (force (force trace "can't get any continuing outputs" (delay error))))) ((\i0 -> unListData (i12 (i14 i1))) (i11 i4)) ((\i0 -> unListData (i12 (i13 (i14 i1)))) (i11 i4)) (i11 i1))) (delay error))) (i13 i2)) (force (force fstPair) i1)) (unConstrData (i8 (i9 i1)))) (i9 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i8 i1)) (i2 (i9 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pfindDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i3 ((\i0 -> i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1)))))))) (i4 i1)))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index d8a0a6512..309669686 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -3,7 +3,9 @@ module Plutarch.Extra.ApiSpec (spec) where import Plutarch.Extra.Api import Plutarch.Prelude +import Plutarch.Api.V1 (PScriptPurpose (PSpending)) import Plutarch.ApiSpec (d0Dat, inp, validContext0, validOutputs0) +import Plutarch.Extra.Monad (pmatchC) import Plutarch.Test import Test.Hspec @@ -13,11 +15,34 @@ spec = do let ctx = validContext0 plutarchDevFlagDescribe . pgoldenSpec $ do "pfindOwnInput" - @| pfindOwnInput # ctx @-> \res -> - passert $ res #== pcon (PJust $ pconstant inp) + @| ( unTermCont $ do + ctxF <- tcont $ pletFields @["txInfo", "purpose"] ctx + pmatchC (getField @"purpose" ctxF) >>= \case + PSpending outRef' -> do + let outRef = pfield @"_0" # outRef' + inputs = pfield @"inputs" # (getField @"txInfo" ctxF) + pure $ pfindOwnInput # inputs # outRef + _ -> + pure perror + ) + @-> \res -> + passert $ res #== pcon (PJust $ pconstant inp) "pgetContinuingOutputs" - @| pgetContinuingOutputs # ctx @-> \txOuts -> - passert $ txOuts #== pconstant validOutputs0 + @| ( unTermCont $ do + ctxF <- tcont $ pletFields @["txInfo", "purpose"] ctx + pmatchC (getField @"purpose" ctxF) >>= \case + PSpending outRef' -> do + let outRef = pfield @"_0" # outRef' + inputs = pfield @"inputs" # (getField @"txInfo" ctxF) + outputs = pfield @"outputs" # (getField @"txInfo" ctxF) + pure $ pgetContinuingOutputs # inputs # outputs # outRef + _ -> + pure perror + ) + @-> \txOuts -> + passert $ txOuts #== pconstant validOutputs0 "pfindDatum" - @| pfindDatum # pconstant "d0" # (pfield @"txInfo" # ctx) @-> \res -> - passert $ res #== pcon (PJust $ pconstant d0Dat) + @| ( pfindDatum # pconstant "d0" # (pfield @"datums" #$ pfield @"txInfo" # ctx) + ) + @-> \res -> + passert $ res #== pcon (PJust $ pconstant d0Dat) From bbba37d19cc95ba97b227c34769438f3c46e2a42 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 13 Apr 2022 19:35:23 +0530 Subject: [PATCH 345/584] Force rational invariant in `PlutusType` instance --- Plutarch/Rational.hs | 55 +++++++++++-------- .../goldens/rational.dev=true.bench.golden | 42 +++++++------- .../goldens/rational.dev=true.uplc.golden | 42 +++++++------- .../goldens/show.dev=true.bench.golden | 2 +- .../goldens/show.dev=true.uplc.golden | 2 +- 5 files changed, 75 insertions(+), 68 deletions(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 6f570ba92..e8b40a8c7 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -11,7 +11,7 @@ module Plutarch.Rational ( import Data.Ratio (denominator, numerator) import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +import Generics.SOP (Generic) import Plutarch ( PlutusType (..), Term, @@ -40,12 +40,29 @@ import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) import Plutarch.Pair (PPair (..)) import Plutarch.Show (PShow (pshow'), pshow) import Plutarch.Trace (ptraceError) -import Plutarch.Unsafe (punsafeCoerce) +import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) +import Plutarch.Lift (pconstant) data PRational s = PRational (Term s PInteger) (Term s PInteger) deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving anyclass (Generic) + +instance PlutusType PRational where + type PInner PRational b = (PInteger :--> PInteger :--> b) :--> b + pcon' (PRational x y) = failOnZero # y #$ plam $ \f -> f # x # y + where + failOnZero = phoistAcyclic $ + plam $ \n x -> + pif + (n #== 0) + (ptraceError "pcon(PRational): division by 0") + x + pmatch' ratF f = ratF #$ plam $ \a b -> f $ PRational a b + +-- | 'PRational' builder that skips the "non-zero" check for denominator. +punsafeRat :: Term s PInteger -> Term s PInteger -> Term s PRational +punsafeRat x y = punsafeFrom $ plam $ \f -> f # x # y instance PShow PRational where pshow' _ x = @@ -111,7 +128,7 @@ instance Num (Term s PRational) where preduce #$ pmatch x $ \(PRational xn xd) -> pmatch y $ \(PRational yn yd) -> - pcon $ PRational (xn * yd + yn * xd) (xd * yd) + punsafeRat (xn * yd + yn * xd) (xd * yd) ) # x' # y' @@ -123,7 +140,7 @@ instance Num (Term s PRational) where #$ pmatch x $ \(PRational xn xd) -> pmatch y $ \(PRational yn yd) -> - pcon $ PRational (xn * yd - yn * xd) (xd * yd) + punsafeRat (xn * yd - yn * xd) (xd * yd) ) # x' # y' @@ -135,7 +152,7 @@ instance Num (Term s PRational) where #$ pmatch x $ \(PRational xn xd) -> pmatch y $ \(PRational yn yd) -> - pcon $ PRational (xn * yn) (xd * yd) + punsafeRat (xn * yn) (xd * yd) ) # x' # y' @@ -144,7 +161,7 @@ instance Num (Term s PRational) where phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - pcon $ PRational (negate xn) xd + punsafeRat (negate xn) xd ) # x' @@ -152,7 +169,7 @@ instance Num (Term s PRational) where phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - pcon $ PRational (abs xn) (abs xd) + punsafeRat (abs xn) (abs xd) ) # x' @@ -169,14 +186,14 @@ instance Num (Term s PRational) where ) # x'' - fromInteger n = pcon $ PRational (fromInteger n) 1 + fromInteger n = punsafeFrom $ plam $ \f -> f # pconstant n # 1 instance Fractional (Term s PRational) where recip x' = phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - pfailOnZero # xn # (pcon (PRational xd xn)) + pcon $ PRational xd xn ) # x' @@ -187,23 +204,13 @@ instance Fractional (Term s PRational) where #$ pmatch x $ \(PRational xn xd) -> pmatch y $ \(PRational yn yd) -> - plet (xd * yn) $ \den -> - pfailOnZero # den - #$ pcon (PRational (xn * yd) den) + plet (xd * yn) $ \den -> pcon $ PRational (xn * yd) den ) # x' # y' fromRational r = - pcon $ PRational (fromInteger $ numerator r) (fromInteger $ denominator r) - -pfailOnZero :: Term s (PInteger :--> a :--> a) -pfailOnZero = phoistAcyclic $ - plam $ \n x -> - pif - (n #== 0) - (ptraceError "pfailOnZero: division by 0") - x + punsafeRat (pconstant $ numerator r) (pconstant $ denominator r) preduce :: Term s (PRational :--> PRational) preduce = phoistAcyclic $ @@ -211,7 +218,7 @@ preduce = phoistAcyclic $ pmatch x $ \(PRational xn xd) -> plet (pgcd # xn # xd) $ \r -> plet (signum xd) $ \s -> - pcon $ PRational (s * pdiv # xn # r) (s * pdiv # xd # r) + punsafeRat (s * pdiv # xn # r) (s * pdiv # xd # r) pgcd :: Term s (PInteger :--> PInteger :--> PInteger) pgcd = phoistAcyclic $ @@ -245,7 +252,7 @@ pdenominator :: Term s (PRational :--> PInteger) pdenominator = phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational _ d) -> d pfromInteger :: Term s (PInteger :--> PRational) -pfromInteger = phoistAcyclic $ plam $ \n -> pcon $ PRational n 1 +pfromInteger = phoistAcyclic $ plam $ \n -> punsafeRat n 1 pround :: Term s (PRational :--> PInteger) pround = phoistAcyclic $ diff --git a/plutarch-test/goldens/rational.dev=true.bench.golden b/plutarch-test/goldens/rational.dev=true.bench.golden index 566a00d57..95e69f6d3 100644 --- a/plutarch-test/goldens/rational.dev=true.bench.golden +++ b/plutarch-test/goldens/rational.dev=true.bench.golden @@ -1,24 +1,24 @@ literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -ops.+ {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":369} -ops.- {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":369} -ops.* {"exBudgetCPU":55368332,"exBudgetMemory":128771,"scriptSizeBytes":413} -ops.harmonic-sum {"exBudgetCPU":82432803,"exBudgetMemory":190449,"scriptSizeBytes":412} -ops.multi-product {"exBudgetCPU":92424824,"exBudgetMemory":216583,"scriptSizeBytes":424} -compare {"exBudgetCPU":26964618,"exBudgetMemory":63677,"scriptSizeBytes":359} -round.5/3 {"exBudgetCPU":17444245,"exBudgetMemory":36449,"scriptSizeBytes":372} -round.4/3 {"exBudgetCPU":15957788,"exBudgetMemory":33346,"scriptSizeBytes":372} -round.-5/2 {"exBudgetCPU":17133763,"exBudgetMemory":35349,"scriptSizeBytes":387} -round.-1/4 {"exBudgetCPU":16184770,"exBudgetMemory":33448,"scriptSizeBytes":387} -truncate.5/4 {"exBudgetCPU":13389327,"exBudgetMemory":30239,"scriptSizeBytes":323} -truncate.7/4 {"exBudgetCPU":14875784,"exBudgetMemory":33342,"scriptSizeBytes":323} -truncate.1/4 {"exBudgetCPU":11902870,"exBudgetMemory":27136,"scriptSizeBytes":323} -truncate.-7/4 {"exBudgetCPU":16905524,"exBudgetMemory":36949,"scriptSizeBytes":337} -properFraction.-1/2 {"exBudgetCPU":40094468,"exBudgetMemory":92624,"scriptSizeBytes":483} -properFraction.-3/2 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":488} -properFraction.-4/3 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":488} +ops.+ {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":373} +ops.- {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":373} +ops.* {"exBudgetCPU":55368332,"exBudgetMemory":128771,"scriptSizeBytes":417} +ops.harmonic-sum {"exBudgetCPU":82432803,"exBudgetMemory":190449,"scriptSizeBytes":416} +ops.multi-product {"exBudgetCPU":92424824,"exBudgetMemory":216583,"scriptSizeBytes":428} +compare {"exBudgetCPU":26964618,"exBudgetMemory":63677,"scriptSizeBytes":363} +round.5/3 {"exBudgetCPU":17444245,"exBudgetMemory":36449,"scriptSizeBytes":376} +round.4/3 {"exBudgetCPU":15957788,"exBudgetMemory":33346,"scriptSizeBytes":376} +round.-5/2 {"exBudgetCPU":17133763,"exBudgetMemory":35349,"scriptSizeBytes":391} +round.-1/4 {"exBudgetCPU":16184770,"exBudgetMemory":33448,"scriptSizeBytes":391} +truncate.5/4 {"exBudgetCPU":13389327,"exBudgetMemory":30239,"scriptSizeBytes":327} +truncate.7/4 {"exBudgetCPU":14875784,"exBudgetMemory":33342,"scriptSizeBytes":327} +truncate.1/4 {"exBudgetCPU":11902870,"exBudgetMemory":27136,"scriptSizeBytes":327} +truncate.-7/4 {"exBudgetCPU":16905524,"exBudgetMemory":36949,"scriptSizeBytes":341} +properFraction.-1/2 {"exBudgetCPU":40094468,"exBudgetMemory":92624,"scriptSizeBytes":487} +properFraction.-3/2 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":492} +properFraction.-4/3 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":492} data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.11/3 {"exBudgetCPU":11885031,"exBudgetMemory":28633,"scriptSizeBytes":277} -div by 0.1/0 {"exBudgetCPU":371921,"exBudgetMemory":136,"scriptSizeBytes":277} -div by 0.recip 0 {"exBudgetCPU":287969,"exBudgetMemory":134,"scriptSizeBytes":71} -div by 0.1/(1-1) {"exBudgetCPU":9198111,"exBudgetMemory":20168,"scriptSizeBytes":346} \ No newline at end of file +data.id.11/3 {"exBudgetCPU":11885031,"exBudgetMemory":28633,"scriptSizeBytes":281} +div by 0.1/0 {"exBudgetCPU":371921,"exBudgetMemory":136,"scriptSizeBytes":281} +div by 0.recip 0 {"exBudgetCPU":287969,"exBudgetMemory":134,"scriptSizeBytes":75} +div by 0.1/(1-1) {"exBudgetCPU":9198111,"exBudgetMemory":20168,"scriptSizeBytes":350} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.uplc.golden b/plutarch-test/goldens/rational.dev=true.uplc.golden index 91818aea0..a4a732744 100644 --- a/plutarch-test/goldens/rational.dev=true.uplc.golden +++ b/plutarch-test/goldens/rational.dev=true.uplc.golden @@ -1,24 +1,24 @@ literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 i2 i3))) (\i0 -> i1 0 1))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 i2 i3))) (\i0 -> i1 0 1))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.bench.golden b/plutarch-test/goldens/show.dev=true.bench.golden index ce15d96c2..2dd42d980 100644 --- a/plutarch-test/goldens/show.dev=true.bench.golden +++ b/plutarch-test/goldens/show.dev=true.bench.golden @@ -1 +1 @@ -rational.1/2 {"exBudgetCPU":24171268,"exBudgetMemory":53478,"scriptSizeBytes":595} \ No newline at end of file +rational.1/2 {"exBudgetCPU":24171268,"exBudgetMemory":53478,"scriptSizeBytes":599} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.uplc.golden b/plutarch-test/goldens/show.dev=true.uplc.golden index 328405ea7..565beba4f 100644 --- a/plutarch-test/goldens/show.dev=true.uplc.golden +++ b/plutarch-test/goldens/show.dev=true.uplc.golden @@ -1 +1 @@ -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i24 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i24 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file From 77f56fe11ac0f7237c8145ca89f5dfa1eba41941 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 13 Apr 2022 19:38:00 +0530 Subject: [PATCH 346/584] Fix formatting --- Plutarch/Rational.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index e8b40a8c7..f65c65a96 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -36,12 +36,12 @@ import Plutarch.Builtin ( pforgetData, ) import Plutarch.Integer (PInteger, PIntegral (pdiv, pmod)) +import Plutarch.Lift (pconstant) import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) import Plutarch.Pair (PPair (..)) import Plutarch.Show (PShow (pshow'), pshow) import Plutarch.Trace (ptraceError) import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) -import Plutarch.Lift (pconstant) data PRational s = PRational (Term s PInteger) (Term s PInteger) From 88f7f079a0ad446fe5dc84cc17b37913fae200fe Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 13 Apr 2022 11:14:17 -0400 Subject: [PATCH 347/584] Accept *and* return PAsData, giving data-decoding control to the user --- plutarch-extra/Plutarch/Extra/Api.hs | 12 ++++++------ .../goldens/extra.api.dev=false.bench.golden | 4 ++-- .../goldens/extra.api.dev=false.uplc.golden | 4 ++-- .../goldens/extra.api.dev=true.bench.golden | 4 ++-- plutarch-test/goldens/extra.api.dev=true.uplc.golden | 4 ++-- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 5 +++-- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index a150f23d7..3754570cc 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -34,18 +34,18 @@ import Plutarch.Prelude pure $ ptraceError "not a spending tx" @ -} -pgetContinuingOutputs :: Term s (PBuiltinList (PAsData PTxInInfo) :--> PBuiltinList (PAsData PTxOut) :--> PTxOutRef :--> PBuiltinList PTxOut) +pgetContinuingOutputs :: Term s (PBuiltinList (PAsData PTxInInfo) :--> PBuiltinList (PAsData PTxOut) :--> PTxOutRef :--> PBuiltinList (PAsData PTxOut)) pgetContinuingOutputs = phoistAcyclic $ plam $ \inputs outputs outRef -> pmatch (pfindOwnInput # inputs # outRef) $ \case PJust tx -> do let resolved = pfield @"resolved" # tx outAddr = pfield @"address" # resolved - pfilter # (matches # outAddr) #$ pmap # plam pfromData # outputs + pfilter # (matches # outAddr) # outputs PNothing -> ptraceError "can't get any continuing outputs" where - matches :: Term s (PAddress :--> PTxOut :--> PBool) + matches :: Term s (PAddress :--> PAsData PTxOut :--> PBool) matches = phoistAcyclic $ plam $ \adr txOut -> adr #== pfield @"address" # txOut @@ -67,12 +67,12 @@ pgetContinuingOutputs = phoistAcyclic $ pure $ ptraceError "not a spending tx" @ -} -pfindOwnInput :: Term s (PBuiltinList (PAsData PTxInInfo) :--> PTxOutRef :--> PMaybe PTxInInfo) +pfindOwnInput :: Term s (PBuiltinList (PAsData PTxInInfo) :--> PTxOutRef :--> PMaybe (PAsData PTxInInfo)) pfindOwnInput = phoistAcyclic $ plam $ \inputs outRef -> - pfind # (matches # outRef) #$ pmap # plam pfromData #$ inputs + pfind # (matches # outRef) # inputs where - matches :: Term s (PTxOutRef :--> PTxInInfo :--> PBool) + matches :: Term s (PTxOutRef :--> PAsData PTxInInfo :--> PBool) matches = phoistAcyclic $ plam $ \outref txininfo -> pfield @"id" # outref diff --git a/plutarch-test/goldens/extra.api.dev=false.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden index 2f21e2b27..2d365ae59 100644 --- a/plutarch-test/goldens/extra.api.dev=false.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=false.bench.golden @@ -1,3 +1,3 @@ -pfindOwnInput {"exBudgetCPU":11307803,"exBudgetMemory":23132,"scriptSizeBytes":364} -pgetContinuingOutputs {"exBudgetCPU":21602631,"exBudgetMemory":43898,"scriptSizeBytes":459} +pfindOwnInput {"exBudgetCPU":8741650,"exBudgetMemory":16872,"scriptSizeBytes":329} +pgetContinuingOutputs {"exBudgetCPU":16619190,"exBudgetMemory":31878,"scriptSizeBytes":420} pfindDatum {"exBudgetCPU":7372693,"exBudgetMemory":14106,"scriptSizeBytes":325} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.golden index 33675c28f..961bdc1aa 100644 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=false.uplc.golden @@ -1,3 +1,3 @@ -pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i13 i1)) (delay (\i0 -> \i0 -> i2 (i15 i3))) (delay (i3 i2 (i14 i1)))))))) (\i0 -> equalsData (i11 (i13 i2)) ((\i0 -> i12 (i14 i1)) (i11 (i13 i1)))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay [ ]) (delay (force mkCons (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> i1) i2)) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> \i0 -> force (i14 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i11 (i2 (i17 i1)) (delay (\i0 -> \i0 -> i2 (i19 i3))) (delay (i3 i2 (i18 i1)))))))) (\i0 -> equalsData (i15 (i17 i2)) ((\i0 -> i16 (i18 i1)) (i15 (i17 i1)))) (i9 (\i0 -> i1) i3) (\i0 -> (\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i16) (delay ((\i0 -> force (i13 (i4 i1) (delay (i18 i1 (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i18 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i17 (i19 i1))) ((\i0 -> i16 (i18 i1)) (i15 (i16 (i17 i1))))) (i10 (\i0 -> i1) i3)) (delay error)) ((\i0 -> unListData (i12 (i14 i1))) (i11 i4)) ((\i0 -> unListData (i12 (i13 (i14 i1)))) (i11 i4)) (i11 i1))) (delay error))) (i13 i2)) (force (force fstPair) i1)) (unConstrData (i8 (i9 i1)))) (i9 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i8 i1)) (i2 (i9 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData (i9 (i11 i2)) ((\i0 -> i10 (i12 i1)) (i9 (i11 i1)))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> equalsData (i12 (i14 i2)) ((\i0 -> i13 (i15 i1)) (i12 (i14 i1)))) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i15 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i14 (i16 i1))) ((\i0 -> i13 (i15 i1)) (i12 (i13 (i14 i1))))) i3) (delay error)) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) ((\i0 -> unListData (i9 (i10 (i11 i1)))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) pfindDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i3 ((\i0 -> i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1)))))))) (i4 i1)))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden index 0893e682c..f1bc86f91 100644 --- a/plutarch-test/goldens/extra.api.dev=true.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -1,3 +1,3 @@ -pfindOwnInput {"exBudgetCPU":11307803,"exBudgetMemory":23132,"scriptSizeBytes":364} -pgetContinuingOutputs {"exBudgetCPU":21602631,"exBudgetMemory":43898,"scriptSizeBytes":499} +pfindOwnInput {"exBudgetCPU":8741650,"exBudgetMemory":16872,"scriptSizeBytes":329} +pgetContinuingOutputs {"exBudgetCPU":16619190,"exBudgetMemory":31878,"scriptSizeBytes":459} pfindDatum {"exBudgetCPU":7372693,"exBudgetMemory":14106,"scriptSizeBytes":325} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.golden index 00545d104..f7e5cfe5c 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.golden @@ -1,3 +1,3 @@ -pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i13 i1)) (delay (\i0 -> \i0 -> i2 (i15 i3))) (delay (i3 i2 (i14 i1)))))))) (\i0 -> equalsData (i11 (i13 i2)) ((\i0 -> i12 (i14 i1)) (i11 (i13 i1)))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay [ ]) (delay (force mkCons (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> i1) i2)) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> \i0 -> force (i14 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i11 (i2 (i17 i1)) (delay (\i0 -> \i0 -> i2 (i19 i3))) (delay (i3 i2 (i18 i1)))))))) (\i0 -> equalsData (i15 (i17 i2)) ((\i0 -> i16 (i18 i1)) (i15 (i17 i1)))) (i9 (\i0 -> i1) i3) (\i0 -> (\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i16) (delay ((\i0 -> force (i13 (i4 i1) (delay (i18 i1 (i3 (i20 i2)))) (delay (i3 (i20 i2))))) (i18 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i17 (i19 i1))) ((\i0 -> i16 (i18 i1)) (i15 (i16 (i17 i1))))) (i10 (\i0 -> i1) i3)) (delay (force (force trace "can't get any continuing outputs" (delay error))))) ((\i0 -> unListData (i12 (i14 i1))) (i11 i4)) ((\i0 -> unListData (i12 (i13 (i14 i1)))) (i11 i4)) (i11 i1))) (delay error))) (i13 i2)) (force (force fstPair) i1)) (unConstrData (i8 (i9 i1)))) (i9 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i6) (delay (i7 (i3 (i8 i1)) (i2 (i9 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData (i9 (i11 i2)) ((\i0 -> i10 (i12 i1)) (i9 (i11 i1)))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> equalsData (i12 (i14 i2)) ((\i0 -> i13 (i15 i1)) (i12 (i14 i1)))) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i15 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i14 (i16 i1))) ((\i0 -> i13 (i15 i1)) (i12 (i13 (i14 i1))))) i3) (delay (force (force trace "can't get any continuing outputs" (delay error))))) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) ((\i0 -> unListData (i9 (i10 (i11 i1)))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) pfindDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i3 ((\i0 -> i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1)))))))) (i4 i1)))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index 309669686..fe17b9ea0 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -6,6 +6,7 @@ import Plutarch.Prelude import Plutarch.Api.V1 (PScriptPurpose (PSpending)) import Plutarch.ApiSpec (d0Dat, inp, validContext0, validOutputs0) import Plutarch.Extra.Monad (pmatchC) +import Plutarch.Maybe (pfromJust) import Plutarch.Test import Test.Hspec @@ -26,7 +27,7 @@ spec = do pure perror ) @-> \res -> - passert $ res #== pcon (PJust $ pconstant inp) + passert $ (pfromData $ pfromJust # res) #== pconstant inp "pgetContinuingOutputs" @| ( unTermCont $ do ctxF <- tcont $ pletFields @["txInfo", "purpose"] ctx @@ -40,7 +41,7 @@ spec = do pure perror ) @-> \txOuts -> - passert $ txOuts #== pconstant validOutputs0 + passert $ (pmap # plam pfromData # txOuts) #== pconstant validOutputs0 "pfindDatum" @| ( pfindDatum # pconstant "d0" # (pfield @"datums" #$ pfield @"txInfo" # ctx) ) From 687cb48e9e0119f7c8190a4613d12323fb6a4a70 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 13 Apr 2022 11:41:22 -0400 Subject: [PATCH 348/584] Replace with pparseDatum, using PTryFrom to validate the datum --- plutarch-extra/Plutarch/Extra/Api.hs | 31 ++++++++++--------- .../goldens/extra.api.dev=false.bench.golden | 2 +- .../extra.api.dev=false.uplc.eval.golden | 2 +- .../goldens/extra.api.dev=false.uplc.golden | 2 +- .../goldens/extra.api.dev=true.bench.golden | 2 +- .../extra.api.dev=true.uplc.eval.golden | 2 +- .../goldens/extra.api.dev=true.uplc.golden | 2 +- .../plutarch-base/Plutarch/ApiSpec.hs | 7 ++++- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 17 +++++++--- 9 files changed, 42 insertions(+), 25 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 3754570cc..04f4f8444 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -1,7 +1,7 @@ module Plutarch.Extra.Api ( pgetContinuingOutputs, pfindOwnInput, - pfindDatum, + pparseDatum, ) where import Plutarch.Api.V1 ( @@ -14,6 +14,7 @@ import Plutarch.Api.V1 ( PTxOutRef, ) import Plutarch.Prelude +import Plutarch.TryFrom (PTryFrom, ptryFrom) {- | Find the output txns corresponding to the input being validated. @@ -80,28 +81,30 @@ pfindOwnInput = phoistAcyclic $ {- | Lookup up the datum given the datum hash. - Takes as argument the datum assoc list from a `PTxInfo`. + Takes as argument the datum assoc list from a `PTxInfo`. Validates the datum + using `PTryFrom`. __Example:__ @ - pfindDatum # datumHash #$ pfield @"datums" # txinfo + pparseDatum @MyType # datumHash #$ pfield @"datums" # txinfo @ -} -pfindDatum :: Term s (PDatumHash :--> PBuiltinList (PAsData (PTuple PDatumHash PDatum)) :--> PMaybe PDatum) -pfindDatum = phoistAcyclic $ +pparseDatum :: forall a s. PTryFrom PData (PAsData a) => Term s (PDatumHash :--> PBuiltinList (PAsData (PTuple PDatumHash PDatum)) :--> PMaybe (PAsData a)) +pparseDatum = phoistAcyclic $ plam $ \dh datums -> pmatch (pfind # (matches # dh) # datums) $ \case - PNothing -> pcon PNothing - PJust x -> pcon $ PJust $ pdsnd # x + PNothing -> + pcon PNothing + PJust datumTuple -> + let datum :: Term _ PData + datum = pto $ pfromData $ pfield @"_1" # pfromData datumTuple + in pcon $ PJust $ ptryFromData datum where - matches :: (PEq k, PIsData k) => Term s (k :--> PAsData (PTuple k v) :--> PBool) + matches :: forall k v s. (PEq k, PIsData k) => Term s (k :--> PAsData (PTuple k v) :--> PBool) matches = phoistAcyclic $ plam $ \a ab -> - a #== pdfst # ab - -pdfst :: PIsData k => Term s (PAsData (PTuple k v) :--> k) -pdfst = pfield @"_0" + a #== pfield @"_0" # ab -pdsnd :: PIsData v => Term s (PAsData (PTuple k v) :--> v) -pdsnd = pfield @"_1" +ptryFromData :: forall a s. PTryFrom PData (PAsData a) => Term s PData -> Term s (PAsData a) +ptryFromData x = unTermCont $ fst <$> tcont (ptryFrom @(PAsData a) x) diff --git a/plutarch-test/goldens/extra.api.dev=false.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden index 2d365ae59..4e68e39e8 100644 --- a/plutarch-test/goldens/extra.api.dev=false.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=false.bench.golden @@ -1,3 +1,3 @@ pfindOwnInput {"exBudgetCPU":8741650,"exBudgetMemory":16872,"scriptSizeBytes":329} pgetContinuingOutputs {"exBudgetCPU":16619190,"exBudgetMemory":31878,"scriptSizeBytes":420} -pfindDatum {"exBudgetCPU":7372693,"exBudgetMemory":14106,"scriptSizeBytes":325} \ No newline at end of file +pparseDatum {"exBudgetCPU":7551331,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden index dea206731..05021636d 100644 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden @@ -1,3 +1,3 @@ pfindOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) pgetContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) -pfindDatum (program 1.0.0 (\i0 -> \i0 -> i2 (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))))) \ No newline at end of file +pparseDatum (program 1.0.0 (\i0 -> \i0 -> i2 ((\i0 -> force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff)))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.golden index 961bdc1aa..088f4db00 100644 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=false.uplc.golden @@ -1,3 +1,3 @@ pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData (i9 (i11 i2)) ((\i0 -> i10 (i12 i1)) (i9 (i11 i1)))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> equalsData (i12 (i14 i2)) ((\i0 -> i13 (i15 i1)) (i12 (i14 i1)))) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i15 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i14 (i16 i1))) ((\i0 -> i13 (i15 i1)) (i12 (i13 (i14 i1))))) i3) (delay error)) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) ((\i0 -> unListData (i9 (i10 (i11 i1)))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pfindDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i3 ((\i0 -> i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1)))))))) (i4 i1)))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +pparseDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i9 i1)) (delay (\i0 -> \i0 -> i2 (i11 i3))) (delay (i3 i2 (i8 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i7 (i8 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 ((\i0 -> i10 (i9 (i11 i4))) ((\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i9 (i8 (i10 i3))))))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i5 ((\i0 -> i5 (i5 (i5 (i5 (i5 (i5 (i5 (i5 i1)))))))) (i6 i1)))) ((\i0 -> i5 (i6 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden index f1bc86f91..b9e4faafb 100644 --- a/plutarch-test/goldens/extra.api.dev=true.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -1,3 +1,3 @@ pfindOwnInput {"exBudgetCPU":8741650,"exBudgetMemory":16872,"scriptSizeBytes":329} pgetContinuingOutputs {"exBudgetCPU":16619190,"exBudgetMemory":31878,"scriptSizeBytes":459} -pfindDatum {"exBudgetCPU":7372693,"exBudgetMemory":14106,"scriptSizeBytes":325} \ No newline at end of file +pparseDatum {"exBudgetCPU":7551331,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden index dea206731..05021636d 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden @@ -1,3 +1,3 @@ pfindOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) pgetContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) -pfindDatum (program 1.0.0 (\i0 -> \i0 -> i2 (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))))) \ No newline at end of file +pparseDatum (program 1.0.0 (\i0 -> \i0 -> i2 ((\i0 -> force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff)))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.golden index f7e5cfe5c..8b5e84082 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.golden @@ -1,3 +1,3 @@ pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData (i9 (i11 i2)) ((\i0 -> i10 (i12 i1)) (i9 (i11 i1)))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> equalsData (i12 (i14 i2)) ((\i0 -> i13 (i15 i1)) (i12 (i14 i1)))) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i15 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i14 (i16 i1))) ((\i0 -> i13 (i15 i1)) (i12 (i13 (i14 i1))))) i3) (delay (force (force trace "can't get any continuing outputs" (delay error))))) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) ((\i0 -> unListData (i9 (i10 (i11 i1)))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pfindDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i6 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i5 (i6 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 (i7 (i6 (i8 i3)))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i3 ((\i0 -> i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1)))))))) (i4 i1)))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +pparseDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i9 i1)) (delay (\i0 -> \i0 -> i2 (i11 i3))) (delay (i3 i2 (i8 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i7 (i8 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 ((\i0 -> i10 (i9 (i11 i4))) ((\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i9 (i8 (i10 i3))))))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i5 ((\i0 -> i5 (i5 (i5 (i5 (i5 (i5 (i5 (i5 i1)))))))) (i6 i1)))) ((\i0 -> i5 (i6 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 415b252a5..7e9733821 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -8,6 +8,7 @@ module Plutarch.ApiSpec ( validOutputs0, invalidContext1, d0Dat, + d0DatValue, inp, ) where @@ -260,5 +261,9 @@ validDatums1 :: [(DatumHash, Datum)] validDatums1 = [("d0", d0Dat)] +-- | Mock datum that is a list of integers. d0Dat :: Datum -d0Dat = Datum $ toBuiltinData [(1 :: Integer) .. 10] +d0Dat = Datum $ toBuiltinData d0DatValue + +d0DatValue :: [Integer] +d0DatValue = [1 .. 10] diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index fe17b9ea0..bd0dbb1c2 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -4,7 +4,7 @@ import Plutarch.Extra.Api import Plutarch.Prelude import Plutarch.Api.V1 (PScriptPurpose (PSpending)) -import Plutarch.ApiSpec (d0Dat, inp, validContext0, validOutputs0) +import Plutarch.ApiSpec (d0DatValue, inp, validContext0, validOutputs0) import Plutarch.Extra.Monad (pmatchC) import Plutarch.Maybe (pfromJust) import Plutarch.Test @@ -42,8 +42,17 @@ spec = do ) @-> \txOuts -> passert $ (pmap # plam pfromData # txOuts) #== pconstant validOutputs0 - "pfindDatum" - @| ( pfindDatum # pconstant "d0" # (pfield @"datums" #$ pfield @"txInfo" # ctx) + "pparseDatum" + @| ( pparseDatum @(PBuiltinList (PAsData PInteger)) # pconstant "d0" # (pfield @"datums" #$ pfield @"txInfo" # ctx) ) @-> \res -> - passert $ res #== pcon (PJust $ pconstant d0Dat) + passert $ res #== pcon (PJust $ pdata $ d0DatTerm) + +-- | The Plutarch term we expect when decoding `d0Dat`. +d0DatTerm :: Term s (PBuiltinList (PAsData PInteger)) +d0DatTerm = liftList $ flip fmap d0DatValue $ \i -> pdata $ pconstant i + +liftList :: PLift a => [Term s a] -> Term s (PBuiltinList a) +liftList = \case + [] -> pnil + (x : xs) -> pcons # x # liftList xs From 99ff1e984dcd12e7ba367ef52e4015df41d1417e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 13 Apr 2022 11:51:03 -0400 Subject: [PATCH 349/584] Rename to Plutarch.Extra.TermCont --- plutarch-extra/Plutarch/Extra/{Monad.hs => TermCont.hs} | 7 +++++-- plutarch-extra/plutarch-extra.cabal | 2 +- plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) rename plutarch-extra/Plutarch/Extra/{Monad.hs => TermCont.hs} (69%) diff --git a/plutarch-extra/Plutarch/Extra/Monad.hs b/plutarch-extra/Plutarch/Extra/TermCont.hs similarity index 69% rename from plutarch-extra/Plutarch/Extra/Monad.hs rename to plutarch-extra/Plutarch/Extra/TermCont.hs index 03d36d454..efde31fc4 100644 --- a/plutarch-extra/Plutarch/Extra/Monad.hs +++ b/plutarch-extra/Plutarch/Extra/TermCont.hs @@ -1,8 +1,11 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-} --- | TermCont-related adapters for Plutarch functions. -module Plutarch.Extra.Monad ( +{- | TermCont-related adapters for Plutarch functions. + + TODO: More functions (pletFieldsC, ptraceC, ...) need to be added here. +-} +module Plutarch.Extra.TermCont ( pletC, pmatchC, ) where diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index 65e73a489..aa03fdb94 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -81,7 +81,7 @@ library exposed-modules: Plutarch.Extra Plutarch.Extra.Api - Plutarch.Extra.Monad + Plutarch.Extra.TermCont Plutarch.ListUtils -- other-modules: diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index bd0dbb1c2..bf014cf9f 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -5,7 +5,7 @@ import Plutarch.Prelude import Plutarch.Api.V1 (PScriptPurpose (PSpending)) import Plutarch.ApiSpec (d0DatValue, inp, validContext0, validOutputs0) -import Plutarch.Extra.Monad (pmatchC) +import Plutarch.Extra.TermCont (pmatchC) import Plutarch.Maybe (pfromJust) import Plutarch.Test import Test.Hspec From f7e1e0b259e5504a9439ef7ad93f038c30e46437 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 13 Apr 2022 12:01:02 -0400 Subject: [PATCH 350/584] Remove redundant pragmas --- plutarch-extra/Plutarch/Extra/TermCont.hs | 3 --- 1 file changed, 3 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/TermCont.hs b/plutarch-extra/Plutarch/Extra/TermCont.hs index efde31fc4..44467c314 100644 --- a/plutarch-extra/Plutarch/Extra/TermCont.hs +++ b/plutarch-extra/Plutarch/Extra/TermCont.hs @@ -1,6 +1,3 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE UndecidableInstances #-} - {- | TermCont-related adapters for Plutarch functions. TODO: More functions (pletFieldsC, ptraceC, ...) need to be added here. From b52e4e4646845f0ab8e1bae44b8e68e06cfacfa9 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 14 Apr 2022 18:50:44 +0530 Subject: [PATCH 351/584] Add `PNonZero` --- Plutarch/NonZero.hs | 44 ++++++++++++++++++++++++++++++++++++++++++++ plutarch.cabal | 1 + 2 files changed, 45 insertions(+) create mode 100644 Plutarch/NonZero.hs diff --git a/Plutarch/NonZero.hs b/Plutarch/NonZero.hs new file mode 100644 index 000000000..7f0403548 --- /dev/null +++ b/Plutarch/NonZero.hs @@ -0,0 +1,44 @@ +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.NonZero (PNonZero, pnonZero, pnonZero') where + +import qualified GHC.Generics as GHC +import Generics.SOP (Generic, HasDatatypeInfo, I (I)) +import Plutarch.Bool (PEq, POrd, pif, (#==)) +import Plutarch.Builtin (PIsData) +import Plutarch.Integer (PInteger, PIntegral) +import Plutarch.Internal.Other ( + DerivePNewtype (DerivePNewtype), + PlutusType, + Term, + pcon, + phoistAcyclic, + plam, + type (:-->), + ) +import Plutarch.Maybe (PMaybe (PJust, PNothing)) +import Plutarch.Show (PShow) +import Plutarch.Trace (ptraceError) + +newtype PNonZero s = PNonZero (Term s PInteger) + deriving stock (GHC.Generic) + deriving anyclass (Generic, HasDatatypeInfo, PShow) + deriving (PlutusType, PIsData, PEq, POrd, PIntegral) via (DerivePNewtype PNonZero PInteger) + +-- | Build a 'PNonZero' from a 'PInteger'. Yields 'PNothing' if argument is zero. +pnonZero :: Term s (PInteger :--> PMaybe PNonZero) +pnonZero = phoistAcyclic $ + plam $ \i -> + pif + (i #== 0) + (pcon PNothing) + $ pcon . PJust . pcon $ PNonZero i + +-- | Partial version of 'pnonZero'. Errors if argument is zero. +pnonZero' :: Term s (PInteger :--> PNonZero) +pnonZero' = phoistAcyclic $ + plam $ \i -> + pif + (i #== 0) + (ptraceError "pnonZero: building with 0") + $ pcon $ PNonZero i diff --git a/plutarch.cabal b/plutarch.cabal index e7e01c118..b8138eea7 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -116,6 +116,7 @@ library Plutarch.List Plutarch.Maybe Plutarch.Monadic + Plutarch.NonZero Plutarch.Pair Plutarch.Prelude Plutarch.Rational From 8002d2224871d8502ba9db9202f231323e549d2a Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 14 Apr 2022 18:51:11 +0530 Subject: [PATCH 352/584] Rework `PRational` to use `PNonZero` + optimizations --- Plutarch/Rational.hs | 233 +++++++++--------- .../goldens/rational.dev=false.bench.golden | 40 +-- .../goldens/rational.dev=false.uplc.golden | 42 ++-- .../goldens/rational.dev=true.bench.golden | 42 ++-- .../goldens/rational.dev=true.uplc.golden | 42 ++-- .../goldens/show.dev=false.bench.golden | 2 +- .../goldens/show.dev=false.uplc.golden | 2 +- .../goldens/show.dev=true.bench.golden | 2 +- .../goldens/show.dev=true.uplc.golden | 2 +- 9 files changed, 202 insertions(+), 205 deletions(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index f65c65a96..1a3c45fdd 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -7,11 +7,12 @@ module Plutarch.Rational ( pround, ptruncate, pproperFraction, + pratLazy, ) where import Data.Ratio (denominator, numerator) import qualified GHC.Generics as GHC -import Generics.SOP (Generic) +import Generics.SOP (Generic, I (I)) import Plutarch ( PlutusType (..), Term, @@ -21,48 +22,47 @@ import Plutarch ( plam, plet, pmatch, + pto, (#), (#$), type (:-->), ) -import Plutarch.Bool (PEq (..), POrd (..), pif) +import Plutarch.Bool (PEq, POrd, pif, (#<), (#<=), (#==)) import Plutarch.Builtin ( PAsData, PBuiltinList, - PData, - PIsData (..), + PIsData, pasInt, pasList, + pdata, pforgetData, + pfromData, ) -import Plutarch.Integer (PInteger, PIntegral (pdiv, pmod)) +import Plutarch.Integer (PInteger, pdiv, pmod) import Plutarch.Lift (pconstant) -import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) -import Plutarch.Pair (PPair (..)) -import Plutarch.Show (PShow (pshow'), pshow) -import Plutarch.Trace (ptraceError) +import Plutarch.List (pcons, phead, pnil, ptail) +import Plutarch.NonZero (PNonZero, pnonZero') +import Plutarch.Pair (PPair (PPair)) +import Plutarch.Show (PShow, pshow, pshow') +import Plutarch.TermCont (tcont, unTermCont) import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) data PRational s - = PRational (Term s PInteger) (Term s PInteger) + = PRational (Term s PInteger) (Term s PNonZero) deriving stock (GHC.Generic) - deriving anyclass (Generic) + deriving anyclass (Generic, PEq) instance PlutusType PRational where - type PInner PRational b = (PInteger :--> PInteger :--> b) :--> b - pcon' (PRational x y) = failOnZero # y #$ plam $ \f -> f # x # y - where - failOnZero = phoistAcyclic $ - plam $ \n x -> - pif - (n #== 0) - (ptraceError "pcon(PRational): division by 0") - x + type PInner PRational b = (PInteger :--> PNonZero :--> b) :--> b + pcon' (PRational x y') = plet y' $ \y -> plam $ \f -> f # x # y pmatch' ratF f = ratF #$ plam $ \a b -> f $ PRational a b --- | 'PRational' builder that skips the "non-zero" check for denominator. -punsafeRat :: Term s PInteger -> Term s PInteger -> Term s PRational -punsafeRat x y = punsafeFrom $ plam $ \f -> f # x # y +{- | Builds a rational with lazy non-zero denominator verification. + +i.e, if the denominator was zero, it'll error only after 'pmatch'ing on the resulting rational. +-} +pratLazy :: Term s PInteger -> Term s PNonZero -> Term s PRational +pratLazy numr denm = punsafeFrom $ plam $ \f -> f # numr # denm instance PShow PRational where pshow' _ x = @@ -70,53 +70,40 @@ instance PShow PRational where where pshowRat = phoistAcyclic $ plam $ \n -> pmatch n $ \(PRational x y) -> - pshow x <> "/" <> pshow y + pshow x <> "/" <> pshow (pto y) instance PIsData PRational where - pfromData x' = phoistAcyclic (plam $ \x -> pListToRat #$ pmap # pasInt #$ pasList # pforgetData x) # x' + pfromData x' = phoistAcyclic (plam $ \x -> plistToRat #$ pasList # pforgetData x) # x' + where + plistToRat = plam $ \x -> pratLazy (pasInt #$ phead # x) $ punsafeFrom $ pasInt #$ phead #$ ptail # x pdata x' = phoistAcyclic - ( plam $ \x -> - (punsafeCoerce :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) -> Term _ (PAsData PRational)) $ - pdata $ pRatToList # x + ( plam $ \x -> unTermCont $ do + PRational a b <- tcont $ pmatch x + let + res :: Term _ (PBuiltinList (PAsData PInteger)) + res = pcons # pdata a #$ pcons # pdata (pto b) #$ pnil + pure $ punsafeCoerce $ pdata res ) # x' -pRatToList :: Term s (PRational :--> PBuiltinList (PAsData PInteger)) -pRatToList = plam $ \x -> pmatch x $ \(PRational a b) -> - pcons # pdata a #$ pcons # pdata b #$ punsafeCoerce (pnil :: Term s (PBuiltinList PData)) - -pListToRat :: Term s (PBuiltinList PInteger :--> PRational) -pListToRat = plam $ \x -> pcon $ PRational (phead # x) (phead #$ ptail # x) - -instance PEq PRational where - l' #== r' = - phoistAcyclic - ( plam $ \l r -> - pmatch l $ \(PRational ln ld) -> - pmatch r $ \(PRational rn rd) -> - rd * ln #== rn * ld - ) - # l' - # r' - instance POrd PRational where l' #<= r' = phoistAcyclic - ( plam $ \l r -> - pmatch l $ \(PRational ln ld) -> - pmatch r $ \(PRational rn rd) -> - rd * ln #<= rn * ld + ( plam $ \l r -> unTermCont $ do + PRational ln ld <- tcont $ pmatch l + PRational rn rd <- tcont $ pmatch r + pure $ pto rd * ln #<= rn * pto ld ) # l' # r' l' #< r' = phoistAcyclic - ( plam $ \l r -> - pmatch l $ \(PRational ln ld) -> - pmatch r $ \(PRational rn rd) -> - rd * ln #< rn * ld + ( plam $ \l r -> unTermCont $ do + PRational ln ld <- tcont $ pmatch l + PRational rn rd <- tcont $ pmatch r + pure $ pto rd * ln #< rn * pto ld ) # l' # r' @@ -124,35 +111,43 @@ instance POrd PRational where instance Num (Term s PRational) where x' + y' = phoistAcyclic - ( plam $ \x y -> - preduce #$ pmatch x $ - \(PRational xn xd) -> - pmatch y $ \(PRational yn yd) -> - punsafeRat (xn * yd + yn * xd) (xd * yd) + ( plam $ \x y -> unTermCont $ do + PRational xn xd' <- tcont $ pmatch x + PRational yn yd' <- tcont $ pmatch y + xd <- tcont $ plet xd' + yd <- tcont $ plet yd' + pure $ + preduce + #$ pratLazy (xn * pto yd + yn * pto xd) + $ punsafeFrom $ pto xd * pto yd ) # x' # y' x' - y' = phoistAcyclic - ( plam $ \x y -> - preduce - #$ pmatch x - $ \(PRational xn xd) -> - pmatch y $ \(PRational yn yd) -> - punsafeRat (xn * yd - yn * xd) (xd * yd) + ( plam $ \x y -> unTermCont $ do + PRational xn xd' <- tcont $ pmatch x + PRational yn yd' <- tcont $ pmatch y + xd <- tcont $ plet xd' + yd <- tcont $ plet yd' + pure $ + preduce + #$ pratLazy (xn * pto yd - yn * pto xd) + $ punsafeFrom $ pto xd * pto yd ) # x' # y' x' * y' = phoistAcyclic - ( plam $ \x y -> - preduce - #$ pmatch x - $ \(PRational xn xd) -> - pmatch y $ \(PRational yn yd) -> - punsafeRat (xn * yn) (xd * yd) + ( plam $ \x y -> unTermCont $ do + PRational xn xd <- tcont $ pmatch x + PRational yn yd <- tcont $ pmatch y + pure $ + preduce + #$ pratLazy (xn * yn) + $ punsafeFrom $ pto xd * pto yd ) # x' # y' @@ -161,7 +156,7 @@ instance Num (Term s PRational) where phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - punsafeRat (negate xn) xd + pratLazy (negate xn) xd ) # x' @@ -169,13 +164,13 @@ instance Num (Term s PRational) where phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - punsafeRat (abs xn) (abs xd) + pratLazy (abs xn) $ punsafeFrom $ abs $ pto xd ) # x' - signum x'' = + signum x' = phoistAcyclic - ( plam $ \x' -> plet x' $ \x -> + ( plam $ \x -> pif (x #== 0) 0 @@ -184,50 +179,47 @@ instance Num (Term s PRational) where (-1) 1 ) - # x'' + # x' - fromInteger n = punsafeFrom $ plam $ \f -> f # pconstant n # 1 + fromInteger n = pratLazy (pconstant n) $ punsafeFrom 1 instance Fractional (Term s PRational) where recip x' = phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - pcon $ PRational xd xn + pcon . PRational (pto xd) $ pnonZero' # xn ) # x' x' / y' = phoistAcyclic - ( plam $ \x y -> - preduce - #$ pmatch x - $ \(PRational xn xd) -> - pmatch y $ \(PRational yn yd) -> - plet (xd * yn) $ \den -> pcon $ PRational (xn * yd) den + ( plam $ \x y -> unTermCont $ do + PRational xn xd <- tcont $ pmatch x + PRational yn yd <- tcont $ pmatch y + pure $ preduce #$ pcon . PRational (xn * pto yd) $ pnonZero' #$ pto xd * yn ) # x' # y' fromRational r = - punsafeRat (pconstant $ numerator r) (pconstant $ denominator r) + pratLazy (pconstant $ numerator r) $ punsafeFrom $ pconstant $ denominator r preduce :: Term s (PRational :--> PRational) preduce = phoistAcyclic $ - plam $ \x -> - pmatch x $ \(PRational xn xd) -> - plet (pgcd # xn # xd) $ \r -> - plet (signum xd) $ \s -> - punsafeRat (s * pdiv # xn # r) (s * pdiv # xd # r) + plam $ \x -> unTermCont $ do + PRational xn xd' <- tcont $ pmatch x + xd <- tcont . plet $ pto xd' + r <- tcont . plet $ pgcd # xn # xd + s <- tcont . plet . signum $ xd + pure . pratLazy (s * pdiv # xn # r) $ punsafeFrom $ s * pdiv # xd # r pgcd :: Term s (PInteger :--> PInteger :--> PInteger) pgcd = phoistAcyclic $ - plam $ \x' y' -> - plet (abs x') $ \x -> - plet (abs y') $ \y -> - plet (pmax # x # y) $ \a -> - plet (pmin # x # y) $ \b -> - pgcd' # a # b + plam $ \x' y' -> unTermCont $ do + x <- tcont . plet $ abs x' + y <- tcont . plet $ abs y' + pure $ pgcd' # (pmax # x # y) #$ pmin # x # y -- assumes inputs are non negative and a >= b pgcd' :: Term s (PInteger :--> PInteger :--> PInteger) @@ -248,37 +240,42 @@ pmax = phoistAcyclic $ plam $ \a b -> pif (a #<= b) b a pnumerator :: Term s (PRational :--> PInteger) pnumerator = phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational n _) -> n -pdenominator :: Term s (PRational :--> PInteger) +pdenominator :: Term s (PRational :--> PNonZero) pdenominator = phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational _ d) -> d pfromInteger :: Term s (PInteger :--> PRational) -pfromInteger = phoistAcyclic $ plam $ \n -> punsafeRat n 1 +pfromInteger = phoistAcyclic $ plam $ \n -> pratLazy n $ punsafeFrom 1 pround :: Term s (PRational :--> PInteger) pround = phoistAcyclic $ - plam $ \x -> - pmatch x $ \(PRational a b) -> - plet (pdiv # a # b) $ \base -> - plet (pmod # a # b) $ \rem -> - base - + pif - (pmod # b # 2 #== 1) - (pif (pdiv # b # 2 #< rem) 1 0) - ( pif - (pdiv # b # 2 #== rem) - (pmod # base # 2) - (pif (rem #< pdiv # b # 2) 0 1) - ) + plam $ \x -> unTermCont $ do + PRational a' b' <- tcont $ pmatch x + a <- tcont $ plet a' + b <- tcont $ plet b' + base <- tcont . plet $ pdiv # a # pto b + rem <- tcont . plet $ pmod # a # pto b + let result = + pif + (pmod # pto b # 2 #== 1) + (pif (pdiv # pto b # 2 #< rem) 1 0) + $ pif + (pdiv # pto b # 2 #== rem) + (pmod # base # 2) + (pif (rem #< pdiv # pto b # 2) 0 1) + pure $ base + result ptruncate :: Term s (PRational :--> PInteger) ptruncate = phoistAcyclic $ - plam $ \x -> - pmatch x $ \(PRational a b) -> - plet (pdiv # a # b) $ \q -> - pif - (0 #<= a) - q - (q + pif (pmod # a # b #== 0) 0 1) + plam $ \x -> unTermCont $ do + PRational a' b' <- tcont $ pmatch x + a <- tcont $ plet a' + b <- tcont $ plet b' + q <- tcont . plet $ pdiv # a # pto b + pure $ + pif + (0 #<= a) + q + (q + pif (pmod # a # pto b #== 0) 0 1) pproperFraction :: Term s (PRational :--> PPair PInteger PRational) pproperFraction = phoistAcyclic $ diff --git a/plutarch-test/goldens/rational.dev=false.bench.golden b/plutarch-test/goldens/rational.dev=false.bench.golden index 4a97891a0..a84106f76 100644 --- a/plutarch-test/goldens/rational.dev=false.bench.golden +++ b/plutarch-test/goldens/rational.dev=false.bench.golden @@ -1,24 +1,24 @@ literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -ops.+ {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} -ops.- {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} -ops.* {"exBudgetCPU":55159921,"exBudgetMemory":128071,"scriptSizeBytes":374} -ops.harmonic-sum {"exBudgetCPU":82224392,"exBudgetMemory":189749,"scriptSizeBytes":372} -ops.multi-product {"exBudgetCPU":92216413,"exBudgetMemory":215883,"scriptSizeBytes":385} -compare {"exBudgetCPU":26756207,"exBudgetMemory":62977,"scriptSizeBytes":320} -round.5/3 {"exBudgetCPU":17444245,"exBudgetMemory":36449,"scriptSizeBytes":338} -round.4/3 {"exBudgetCPU":15957788,"exBudgetMemory":33346,"scriptSizeBytes":338} -round.-5/2 {"exBudgetCPU":17133763,"exBudgetMemory":35349,"scriptSizeBytes":353} -round.-1/4 {"exBudgetCPU":16184770,"exBudgetMemory":33448,"scriptSizeBytes":353} -truncate.5/4 {"exBudgetCPU":13389327,"exBudgetMemory":30239,"scriptSizeBytes":289} -truncate.7/4 {"exBudgetCPU":14875784,"exBudgetMemory":33342,"scriptSizeBytes":289} -truncate.1/4 {"exBudgetCPU":11902870,"exBudgetMemory":27136,"scriptSizeBytes":289} -truncate.-7/4 {"exBudgetCPU":16905524,"exBudgetMemory":36949,"scriptSizeBytes":303} -properFraction.-1/2 {"exBudgetCPU":39886057,"exBudgetMemory":91924,"scriptSizeBytes":444} -properFraction.-3/2 {"exBudgetCPU":41688815,"exBudgetMemory":95429,"scriptSizeBytes":449} -properFraction.-4/3 {"exBudgetCPU":41688815,"exBudgetMemory":95429,"scriptSizeBytes":449} +ops.+ {"exBudgetCPU":30525493,"exBudgetMemory":72495,"scriptSizeBytes":322} +ops.- {"exBudgetCPU":30525493,"exBudgetMemory":72495,"scriptSizeBytes":322} +ops.* {"exBudgetCPU":54088093,"exBudgetMemory":124471,"scriptSizeBytes":366} +ops.harmonic-sum {"exBudgetCPU":80616650,"exBudgetMemory":184349,"scriptSizeBytes":365} +ops.multi-product {"exBudgetCPU":90162076,"exBudgetMemory":208983,"scriptSizeBytes":377} +compare {"exBudgetCPU":26220293,"exBudgetMemory":61177,"scriptSizeBytes":312} +round.5/3 {"exBudgetCPU":17265607,"exBudgetMemory":35849,"scriptSizeBytes":333} +round.4/3 {"exBudgetCPU":15779150,"exBudgetMemory":32746,"scriptSizeBytes":333} +round.-5/2 {"exBudgetCPU":16955125,"exBudgetMemory":34749,"scriptSizeBytes":348} +round.-1/4 {"exBudgetCPU":16006132,"exBudgetMemory":32848,"scriptSizeBytes":348} +truncate.5/4 {"exBudgetCPU":13210689,"exBudgetMemory":29639,"scriptSizeBytes":284} +truncate.7/4 {"exBudgetCPU":14697146,"exBudgetMemory":32742,"scriptSizeBytes":284} +truncate.1/4 {"exBudgetCPU":11724232,"exBudgetMemory":26536,"scriptSizeBytes":284} +truncate.-7/4 {"exBudgetCPU":16726886,"exBudgetMemory":36349,"scriptSizeBytes":298} +properFraction.-1/2 {"exBudgetCPU":39617838,"exBudgetMemory":91122,"scriptSizeBytes":443} +properFraction.-3/2 {"exBudgetCPU":41420596,"exBudgetMemory":94627,"scriptSizeBytes":448} +properFraction.-4/3 {"exBudgetCPU":41420596,"exBudgetMemory":94627,"scriptSizeBytes":448} data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.11/3 {"exBudgetCPU":11885031,"exBudgetMemory":28633,"scriptSizeBytes":242} -div by 0.1/0 {"exBudgetCPU":221921,"exBudgetMemory":104,"scriptSizeBytes":242} +data.id.11/3 {"exBudgetCPU":11706393,"exBudgetMemory":28033,"scriptSizeBytes":237} +div by 0.1/0 {"exBudgetCPU":221921,"exBudgetMemory":104,"scriptSizeBytes":237} div by 0.recip 0 {"exBudgetCPU":137969,"exBudgetMemory":102,"scriptSizeBytes":37} -div by 0.1/(1-1) {"exBudgetCPU":9048111,"exBudgetMemory":20136,"scriptSizeBytes":312} \ No newline at end of file +div by 0.1/(1-1) {"exBudgetCPU":9048111,"exBudgetMemory":20136,"scriptSizeBytes":307} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=false.uplc.golden b/plutarch-test/goldens/rational.dev=false.uplc.golden index d5e8b5d4c..b78485d21 100644 --- a/plutarch-test/goldens/rational.dev=false.uplc.golden +++ b/plutarch-test/goldens/rational.dev=false.uplc.golden @@ -1,24 +1,24 @@ literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay error) (delay i1))) (\i0 -> i1 i2 i3))) (\i0 -> i1 0 1))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (equalsInteger i2 0) (delay error) (delay i2))))) (\i0 -> i1 0 1))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i14 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.bench.golden b/plutarch-test/goldens/rational.dev=true.bench.golden index 95e69f6d3..7ff319cf3 100644 --- a/plutarch-test/goldens/rational.dev=true.bench.golden +++ b/plutarch-test/goldens/rational.dev=true.bench.golden @@ -1,24 +1,24 @@ literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -ops.+ {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":373} -ops.- {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":373} -ops.* {"exBudgetCPU":55368332,"exBudgetMemory":128771,"scriptSizeBytes":417} -ops.harmonic-sum {"exBudgetCPU":82432803,"exBudgetMemory":190449,"scriptSizeBytes":416} -ops.multi-product {"exBudgetCPU":92424824,"exBudgetMemory":216583,"scriptSizeBytes":428} -compare {"exBudgetCPU":26964618,"exBudgetMemory":63677,"scriptSizeBytes":363} -round.5/3 {"exBudgetCPU":17444245,"exBudgetMemory":36449,"scriptSizeBytes":376} -round.4/3 {"exBudgetCPU":15957788,"exBudgetMemory":33346,"scriptSizeBytes":376} -round.-5/2 {"exBudgetCPU":17133763,"exBudgetMemory":35349,"scriptSizeBytes":391} -round.-1/4 {"exBudgetCPU":16184770,"exBudgetMemory":33448,"scriptSizeBytes":391} -truncate.5/4 {"exBudgetCPU":13389327,"exBudgetMemory":30239,"scriptSizeBytes":327} -truncate.7/4 {"exBudgetCPU":14875784,"exBudgetMemory":33342,"scriptSizeBytes":327} -truncate.1/4 {"exBudgetCPU":11902870,"exBudgetMemory":27136,"scriptSizeBytes":327} -truncate.-7/4 {"exBudgetCPU":16905524,"exBudgetMemory":36949,"scriptSizeBytes":341} -properFraction.-1/2 {"exBudgetCPU":40094468,"exBudgetMemory":92624,"scriptSizeBytes":487} -properFraction.-3/2 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":492} -properFraction.-4/3 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":492} +ops.+ {"exBudgetCPU":30733904,"exBudgetMemory":73195,"scriptSizeBytes":361} +ops.- {"exBudgetCPU":30733904,"exBudgetMemory":73195,"scriptSizeBytes":361} +ops.* {"exBudgetCPU":54296504,"exBudgetMemory":125171,"scriptSizeBytes":404} +ops.harmonic-sum {"exBudgetCPU":80825061,"exBudgetMemory":185049,"scriptSizeBytes":403} +ops.multi-product {"exBudgetCPU":90370487,"exBudgetMemory":209683,"scriptSizeBytes":415} +compare {"exBudgetCPU":26428704,"exBudgetMemory":61877,"scriptSizeBytes":350} +round.5/3 {"exBudgetCPU":17265607,"exBudgetMemory":35849,"scriptSizeBytes":366} +round.4/3 {"exBudgetCPU":15779150,"exBudgetMemory":32746,"scriptSizeBytes":366} +round.-5/2 {"exBudgetCPU":16955125,"exBudgetMemory":34749,"scriptSizeBytes":380} +round.-1/4 {"exBudgetCPU":16006132,"exBudgetMemory":32848,"scriptSizeBytes":380} +truncate.5/4 {"exBudgetCPU":13210689,"exBudgetMemory":29639,"scriptSizeBytes":317} +truncate.7/4 {"exBudgetCPU":14697146,"exBudgetMemory":32742,"scriptSizeBytes":317} +truncate.1/4 {"exBudgetCPU":11724232,"exBudgetMemory":26536,"scriptSizeBytes":317} +truncate.-7/4 {"exBudgetCPU":16726886,"exBudgetMemory":36349,"scriptSizeBytes":331} +properFraction.-1/2 {"exBudgetCPU":39826249,"exBudgetMemory":91822,"scriptSizeBytes":481} +properFraction.-3/2 {"exBudgetCPU":41629007,"exBudgetMemory":95327,"scriptSizeBytes":486} +properFraction.-4/3 {"exBudgetCPU":41629007,"exBudgetMemory":95327,"scriptSizeBytes":486} data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.11/3 {"exBudgetCPU":11885031,"exBudgetMemory":28633,"scriptSizeBytes":281} -div by 0.1/0 {"exBudgetCPU":371921,"exBudgetMemory":136,"scriptSizeBytes":281} -div by 0.recip 0 {"exBudgetCPU":287969,"exBudgetMemory":134,"scriptSizeBytes":75} -div by 0.1/(1-1) {"exBudgetCPU":9198111,"exBudgetMemory":20168,"scriptSizeBytes":350} \ No newline at end of file +data.id.11/3 {"exBudgetCPU":11706393,"exBudgetMemory":28033,"scriptSizeBytes":271} +div by 0.1/0 {"exBudgetCPU":371921,"exBudgetMemory":136,"scriptSizeBytes":271} +div by 0.recip 0 {"exBudgetCPU":287969,"exBudgetMemory":134,"scriptSizeBytes":70} +div by 0.1/(1-1) {"exBudgetCPU":9198111,"exBudgetMemory":20168,"scriptSizeBytes":340} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.uplc.golden b/plutarch-test/goldens/rational.dev=true.uplc.golden index a4a732744..9ae21504f 100644 --- a/plutarch-test/goldens/rational.dev=true.uplc.golden +++ b/plutarch-test/goldens/rational.dev=true.uplc.golden @@ -1,24 +1,24 @@ literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pcon(PRational): division by 0")) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 i2 i3))) (\i0 -> i1 0 1))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (equalsInteger i2 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i2))))) (\i0 -> i1 0 1))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i14 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.bench.golden b/plutarch-test/goldens/show.dev=false.bench.golden index 5dff81677..5492f84b6 100644 --- a/plutarch-test/goldens/show.dev=false.bench.golden +++ b/plutarch-test/goldens/show.dev=false.bench.golden @@ -1 +1 @@ -rational.1/2 {"exBudgetCPU":24171268,"exBudgetMemory":53478,"scriptSizeBytes":562} \ No newline at end of file +rational.1/2 {"exBudgetCPU":23992630,"exBudgetMemory":52878,"scriptSizeBytes":557} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.uplc.golden b/plutarch-test/goldens/show.dev=false.uplc.golden index 3f77234a2..f086b8cb2 100644 --- a/plutarch-test/goldens/show.dev=false.uplc.golden +++ b/plutarch-test/goldens/show.dev=false.uplc.golden @@ -1 +1 @@ -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i24 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i26 (equalsInteger i2 0) (delay 0) (delay (force (i26 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> i26 (\i0 -> \i0 -> \i0 -> force (i30 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i27 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i27 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i26 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i25 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i23 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.bench.golden b/plutarch-test/goldens/show.dev=true.bench.golden index 2dd42d980..8f23f513e 100644 --- a/plutarch-test/goldens/show.dev=true.bench.golden +++ b/plutarch-test/goldens/show.dev=true.bench.golden @@ -1 +1 @@ -rational.1/2 {"exBudgetCPU":24171268,"exBudgetMemory":53478,"scriptSizeBytes":599} \ No newline at end of file +rational.1/2 {"exBudgetCPU":23992630,"exBudgetMemory":52878,"scriptSizeBytes":589} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.uplc.golden b/plutarch-test/goldens/show.dev=true.uplc.golden index 565beba4f..9f895c428 100644 --- a/plutarch-test/goldens/show.dev=true.uplc.golden +++ b/plutarch-test/goldens/show.dev=true.uplc.golden @@ -1 +1 @@ -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i24 (equalsInteger i2 0) (delay (force (force trace "pcon(PRational): division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i26 (equalsInteger i2 0) (delay 0) (delay (force (i26 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> i26 (\i0 -> \i0 -> \i0 -> force (i30 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i27 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i27 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i26 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i25 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i23 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file From 6108d7c3b38eee853b87c21e152ec9b8193dd250 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 14 Apr 2022 18:52:49 +0530 Subject: [PATCH 353/584] Fix formatting --- Plutarch/Rational.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 1a3c45fdd..8b6bf99b7 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -80,9 +80,8 @@ instance PIsData PRational where phoistAcyclic ( plam $ \x -> unTermCont $ do PRational a b <- tcont $ pmatch x - let - res :: Term _ (PBuiltinList (PAsData PInteger)) - res = pcons # pdata a #$ pcons # pdata (pto b) #$ pnil + let res :: Term _ (PBuiltinList (PAsData PInteger)) + res = pcons # pdata a #$ pcons # pdata (pto b) #$ pnil pure $ punsafeCoerce $ pdata res ) # x' From e94e51110808ccf6058ef0b566094c8ae5e1ffc0 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Thu, 14 Apr 2022 12:43:15 -0400 Subject: [PATCH 354/584] Add bin/ghcid (run ghcid on various packages/flags) --- bin/ghcid | 24 ++++++++++++++++++++++++ plutarch-test/README.md | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 bin/ghcid diff --git a/bin/ghcid b/bin/ghcid new file mode 100755 index 000000000..a8ce4a979 --- /dev/null +++ b/bin/ghcid @@ -0,0 +1,24 @@ +#!/bin/sh + +set -xe + +if [[ $1 == "" ]] +then + echo "Running ghcid on plutarch" + ghcid +elif [[ $1 == "extra" ]] +then + echo "Running ghcid on plutarch-extra" + ghcid -c 'cabal repl plutarch-extra:lib:plutarch-extra' +elif [[ $1 == "test:dev" ]] +then + echo "Running ghcid on plutarch-test in development mode" + ghcid -c 'cabal repl plutarch-test:exe:plutarch-test -f development --builddir=dist-ghc9-dev' -T Main.main +elif [[ $1 == "test" ]] +then + echo "Running ghcid on plutarch-test in non-development mode" + ghcid -c 'cabal repl plutarch-test:exe:plutarch-test' -T Main.main +else + echo "Invalid argument" + exit 2 +fi diff --git a/plutarch-test/README.md b/plutarch-test/README.md index 565d6feda..c49379849 100644 --- a/plutarch-test/README.md +++ b/plutarch-test/README.md @@ -13,13 +13,13 @@ $ nix run .#test-ghc810-nodev To run the tests using ghcid (fit for writing tests): ```sh-session -$ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test' -T Main.main +bin/ghcid test ``` To run ghcid with development flag set: ```sh-session -$ ghcid -c 'cabal repl plutarch-test:exe:plutarch-test -f development --builddir=dist-ghc9-dev' -T Main.main +bin/ghcid test:dev ``` Note: `cabal run` should be run inside `./plutarch-test` directory. From c5424bba98659557f2370680bb47503ea28221e8 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 15 Apr 2022 21:55:23 +0200 Subject: [PATCH 355/584] feat: added enough PTryFrom instances for PAddress - PMaybeData - PCredential - PPubKeyHash - PValidatorHash --- Plutarch/Api/V1/Address.hs | 16 ++++++++++++++++ Plutarch/Api/V1/Crypto.hs | 10 ++++++++++ Plutarch/Api/V1/Maybe.hs | 6 ++++++ Plutarch/Api/V1/Scripts.hs | 10 ++++++++++ Plutarch/TryFrom.hs | 1 + plutarch-extra/Plutarch/Extra/TermCont.hs | 12 ++++++++++++ 6 files changed, 55 insertions(+) diff --git a/Plutarch/Api/V1/Address.hs b/Plutarch/Api/V1/Address.hs index 7bbbebe91..fb2396452 100644 --- a/Plutarch/Api/V1/Address.hs +++ b/Plutarch/Api/V1/Address.hs @@ -26,6 +26,7 @@ import Plutarch.Lift ( PUnsafeLiftDecl, ) import Plutarch.Prelude +import Plutarch.TryFrom (PTryFrom) data PCredential (s :: S) = PPubKeyCredential (Term s (PDataRecord '["_0" ':= PPubKeyHash])) @@ -81,3 +82,18 @@ newtype PAddress (s :: S) instance PUnsafeLiftDecl PAddress where type PLifted PAddress = Plutus.Address deriving via (DerivePConstantViaData Plutus.Address PAddress) instance PConstantDecl Plutus.Address + +deriving via + PAsData (PIsDataReprInstances PAddress) + instance + PTryFrom PData (PAsData PAddress) + +deriving via + PAsData (PIsDataReprInstances PCredential) + instance + PTryFrom PData (PAsData PCredential) + +deriving via + PAsData (PIsDataReprInstances PStakingCredential) + instance + PTryFrom PData (PAsData PStakingCredential) diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index 3619b6b38..90d0d3e5f 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -14,6 +14,16 @@ import Plutarch.Lift ( PUnsafeLiftDecl, ) import Plutarch.Prelude +import Plutarch.TryFrom (Flip, PTryFrom (PTryFromExcess, ptryFrom'), ptryFrom) +import Plutarch.Unsafe (punsafeCoerce) + +instance PTryFrom PData (PAsData PPubKeyHash) where + type PTryFromExcess PData (PAsData PPubKeyHash) = Flip Term PPubKeyHash + ptryFrom' opq = runTermCont $ do + (wrapped :: Term _ (PAsData PByteString), unwrapped :: Term _ PByteString) <- + tcont $ ptryFrom @(PAsData PByteString) opq + tcont $ \f -> pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "a PubKeyHash should be 28 bytes long") + pure (punsafeCoerce wrapped, pcon . PPubKeyHash $ unwrapped) newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PPubKeyHash PByteString) diff --git a/Plutarch/Api/V1/Maybe.hs b/Plutarch/Api/V1/Maybe.hs index f2eb2de88..d727f9318 100644 --- a/Plutarch/Api/V1/Maybe.hs +++ b/Plutarch/Api/V1/Maybe.hs @@ -20,6 +20,7 @@ import Plutarch.Lift ( PUnsafeLiftDecl (..), ) import Plutarch.Prelude +import Plutarch.TryFrom (PTryFrom) import Plutarch.Unsafe (punsafeCoerce) -- | Data encoded Maybe type. Used in various ledger api types. @@ -82,3 +83,8 @@ _pmaybeLT whenBothNothing ltF = phoistAcyclic $ $ pconstant whenBothNothing ) $ pconstant True + +deriving via + PAsData (PIsDataReprInstances (PMaybeData a)) + instance + PTryFrom PData (PAsData a) => PTryFrom PData (PAsData (PMaybeData a)) diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index f4c291432..9bc570094 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -20,6 +20,8 @@ import Plutarch.Lift ( PUnsafeLiftDecl, ) import Plutarch.Prelude +import Plutarch.TryFrom (Flip, PTryFrom (PTryFromExcess, ptryFrom'), ptryFrom) +import Plutarch.Unsafe (punsafeCoerce) newtype PDatum (s :: S) = PDatum (Term s PData) deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PDatum PData) @@ -65,3 +67,11 @@ deriving via (DerivePConstantViaBuiltin Plutus.ValidatorHash PValidatorHash PByteString) instance PConstantDecl Plutus.ValidatorHash + +instance PTryFrom PData (PAsData PValidatorHash) where + type PTryFromExcess PData (PAsData PValidatorHash) = Flip Term PValidatorHash + ptryFrom' opq = runTermCont $ do + (wrapped :: Term _ (PAsData PByteString), unwrapped :: Term _ PByteString) <- + tcont $ ptryFrom @(PAsData PByteString) opq + tcont $ \f -> pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "a ValidatorHash should be 28 bytes long") + pure (punsafeCoerce wrapped, pcon . PValidatorHash $ unwrapped) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 1ef802ded..075b7187d 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -6,6 +6,7 @@ module Plutarch.TryFrom ( PTryFrom (..), HRecP (..), ptryFrom, + Flip, ) where import Data.Proxy (Proxy (Proxy)) diff --git a/plutarch-extra/Plutarch/Extra/TermCont.hs b/plutarch-extra/Plutarch/Extra/TermCont.hs index 44467c314..015a43210 100644 --- a/plutarch-extra/Plutarch/Extra/TermCont.hs +++ b/plutarch-extra/Plutarch/Extra/TermCont.hs @@ -5,9 +5,13 @@ module Plutarch.Extra.TermCont ( pletC, pmatchC, + ptryFromC, + ptryFromC', ) where import Plutarch.Prelude +import Plutarch.Reducible (Reducible (Reduce)) +import Plutarch.TryFrom (PTryFrom (PTryFromExcess), ptryFrom) -- | Like `plet` but works in a `TermCont` monad pletC :: Term s a -> TermCont s (Term s a) @@ -16,3 +20,11 @@ pletC = tcont . plet -- | Like `pmatch` but works in a `TermCont` monad pmatchC :: PMatch a => Term s a -> TermCont s (a s) pmatchC = tcont . pmatch + +-- | Like `ptryFrom` but works in a `TermCont` monad +ptryFromC :: forall b a s. PTryFrom a b => Term s a -> TermCont s (Term s b, Reduce (PTryFromExcess a b s)) +ptryFromC = tcont . ptryFrom + +-- | Like `ptryFom'` but works in a `TermCont` monad +ptryFromC' :: forall a b s. PTryFrom a b => Term s a -> TermCont s (Term s b, Reduce (PTryFromExcess a b s)) +ptryFromC' = tcont . ptryFrom From 87953031022befa77a190755254f4827e4d45da5 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sat, 16 Apr 2022 10:48:27 +0000 Subject: [PATCH 356/584] `instance PlutusType (PAsData a)` --- Plutarch/Builtin.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 01aaaa809..994ea457f 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -222,7 +222,12 @@ pdataLiteral :: Data -> Term s PData pdataLiteral = pconstant type role PAsData representational phantom -data PAsData (a :: PType) (s :: S) +data PAsData (a :: PType) (s :: S) = PAsData (Term s a) + +instance PIsData a => PlutusType (PAsData a) where + type PInner (PAsData a) _ = PData + pcon' (PAsData t) = pforgetData $ pdata t + pmatch' t f = f (PAsData $ pfromData $ punsafeCoerce t) type role PAsDataLifted representational data PAsDataLifted (a :: PType) From 69c46890518c3351f3fe56afae1b5bfbf45fa6ba Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sat, 16 Apr 2022 10:49:49 +0000 Subject: [PATCH 357/584] Add `FunctionalDependencies` and `QuantifiedConstraints` to `default-extensions` --- plutarch.cabal | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plutarch.cabal b/plutarch.cabal index e7e01c118..faceb4a1c 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -37,6 +37,7 @@ common c FlexibleContexts FlexibleInstances ForeignFunctionInterface + FunctionalDependencies GADTSyntax GeneralisedNewtypeDeriving HexFloatLiterals @@ -54,6 +55,7 @@ common c PatternGuards PolyKinds PostfixOperators + QuantifiedConstraints RankNTypes RelaxedPolyRec ScopedTypeVariables From f5af4693706af703de3344b7dddef41b4d4ff78b Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sat, 16 Apr 2022 10:53:04 +0000 Subject: [PATCH 358/584] Add subtyping constraint to `PTryFrom` --- Plutarch/TryFrom.hs | 83 +++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 45 deletions(-) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 1ef802ded..b781456bd 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -1,17 +1,20 @@ {-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.TryFrom ( PTryFrom (..), HRecP (..), ptryFrom, + PSubtype, ) where import Data.Proxy (Proxy (Proxy)) import GHC.TypeLits (KnownNat, Nat, Symbol, natVal, type (+)) +import Data.Coerce (Coercible) +import Data.Kind (Constraint) + import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) import Plutarch.Bool (pif, (#==)) @@ -87,30 +90,38 @@ import Data.Coerce (coerce) ----------------------- The class PTryFrom ---------------------------------------------- +class PSubtypeDecl (a :: PType) (b :: PType) + +-- Not `OVERLAPPABLE` or `OVERLAPPING` on purpose +instance {-# OVERLAPS #-} PSubtypeDecl a a + +-- FIXME: Relax subtyping constraint to a @c@ rather than all @c@. +-- This is currently not really possible because a type must have +-- exactly one super type and no more. +instance {-# OVERLAPS #-} (PSubtypeDecl a b, PInner c POpaque ~ b) => PSubtypeDecl a c + +{- | @PSubtype a b@ constitutes a subtyping relation between @a@ and @b@. + This concretely means that `\(x :: Term s b) -> punsafeCoerce x :: Term s a` + is legal and sound. + + You can not make an instance for this yourself. + You must use the 'PInner' type family of 'PlutusType' to get this instance. + + Caveat: Only @PInner a POpaque@ is considered unfortunately, as otherwise + getting GHC to figure out the relation with multiple supertypes is quite hard. + + Subtyping is transitive. +-} +type PSubtype :: PType -> PType -> Constraint +type PSubtype = PSubtypeDecl + {- | - This checks the data structure for validity. - If you don't care about parts of the structure - don't verify those parts, just put a `PData` at - the places you don't care about. - Be aware this might get really expensive, so only - use it if you cannot establish trust otherwise - (e.g. via only checking a part of your Data with - PTryFrom) - Laws: - - the operation `ptryFrom` mustn't change the representation of the underlying data - - the operation `ptryFrom` must always prove the integrity of the whole target type - - example: - `ptryFrom PData (PAsData (PBuiltinList PData))` must only succeed if the underlying - representation is a `BuiltinList` containing any `PData` - - all conversions are fallible, this happens if the representation doesn't match - the expected type. - - the operation `ptryFrom @b @a` proves equality between the less expressive `PType` `a` and - the more expressive `PType` `b`, hence the first element of the resulting Tuple - must always be wrapped in `PAsData` if the origin type was `PData` (see law 1) - - the result type `b` must always be safe than the origin type `a`, i.e. it must carry - more information +@PTryFrom a b@ represents a subtyping relationship between @a@ and @b@, +and a way to go from @a@ to @b@. +Laws: +- @(punsafeCoerce . fst) <$> tcont (pdowncast x) ≡ pure x@ -} -class PTryFrom (a :: PType) (b :: PType) where +class PSubtype a b => PTryFrom (a :: PType) (b :: PType) where type PTryFromExcess a b :: PType ptryFrom' :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r @@ -283,6 +294,9 @@ instance r <- tcont $ ptryFrom @(PDataRecord as) l pure (punsafeCoerce opq, r) +class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where + validateSum :: Term s PInteger -> Term s (PBuiltinList PData) -> Term s POpaque + instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where type PTryFromExcess PData (PAsData (PDataSum ys)) = Const () ptryFrom' opq = runTermCont $ do @@ -292,9 +306,6 @@ instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom PData (PAsData (PDat _ <- tcont $ plet $ validateSum @0 @ys constr fields pure (punsafeCoerce opq, ()) -class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where - validateSum :: Term s PInteger -> Term s (PBuiltinList PData) -> Term s POpaque - instance {-# OVERLAPPABLE #-} forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). @@ -318,25 +329,6 @@ instance {-# OVERLAPPING #-} SumValidation n '[] where ----------------------- other utility functions ----------------------------------------- -{- | if there is an instance to recover something that is unwrapped from something that is - unwrapped, then there is also the possibility to recover the whole thing but wrapped --} -instance - ( PTryFrom a b - , PIsData a - , PIsData b - ) => - PTryFrom (PAsData a) (PAsData b) - where - type PTryFromExcess (PAsData a) (PAsData b) = PTryFromExcess a b - ptryFrom' opq = runTermCont $ do - ver' <- snd <$> TermCont (ptryFrom @b @a (pfromData opq)) - pure $ (punsafeCoerce opq, ver') - -instance PTryFrom PData PData where - type PTryFromExcess PData PData = Const () - ptryFrom' opq = runTermCont $ pure $ (opq, ()) - instance PTryFrom PData (PAsData PData) where type PTryFromExcess PData (PAsData PData) = Const () ptryFrom' opq = runTermCont $ pure (pdata opq, ()) @@ -361,6 +353,7 @@ instance instance ( PTryFrom a b + , (forall s. Coercible (c s) (Term s b)) ) => PTryFrom a (DerivePNewtype c b) where From bcb71c208d9ec10e4deb03355e4d3126af4ce50d Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sat, 16 Apr 2022 13:50:11 +0000 Subject: [PATCH 359/584] Move `PTryFrom` instances out of `Plutarch.TryFrom` --- Plutarch/Builtin.hs | 108 +++++++++++++ Plutarch/DataRepr/Internal.hs | 144 ++++++++++++++++- Plutarch/TryFrom.hs | 293 +--------------------------------- 3 files changed, 251 insertions(+), 294 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 994ea457f..2b91003e3 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -76,8 +76,11 @@ import Plutarch.List ( pnull, ptail ), + phead, plistEquals, + pmap, pshowList, + ptail, ) import Plutarch.Show (PShow (pshow')) import Plutarch.Unit (PUnit) @@ -86,6 +89,14 @@ import qualified PlutusCore as PLC import PlutusTx (Data (Constr), ToData) import qualified PlutusTx +import Plutarch.TermCont (TermCont (runTermCont), tcont, unTermCont) + +import Plutarch.Reducible (Reducible (Reduce)) + +import Data.Functor.Const (Const) + +import Plutarch.TryFrom (PTryFrom, PTryFromExcess, ptryFrom, ptryFrom') + -- | Plutus 'BuiltinPair' data PBuiltinPair (a :: PType) (b :: PType) (s :: S) @@ -381,3 +392,100 @@ Example: -} pconstantData :: forall p h s. (ToData h, PLifted p ~ h, PConstanted h ~ p) => h -> Term s (PAsData p) pconstantData x = punsafeCoerce $ pconstant $ PlutusTx.toData x + +newtype Flip f a b = Flip (f b a) + +instance Reducible (f x y) => Reducible (Flip f y x) where + type Reduce (Flip f y x) = Reduce (f x y) + +instance PTryFrom PData (PAsData PInteger) where + type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger + ptryFrom' opq = runTermCont $ do + ver <- tcont $ plet (pasInt # opq) + pure $ (punsafeCoerce opq, ver) + +instance PTryFrom PData (PAsData PByteString) where + type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString + ptryFrom' opq = runTermCont $ do + ver <- tcont $ plet (pasByteStr # opq) + pure $ (punsafeCoerce opq, ver) + +instance + ( PTryFrom PData (PAsData a) + , PTryFrom PData (PAsData b) + ) => + PTryFrom PData (PAsData (PBuiltinMap a b)) + where + type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = Flip Term (PBuiltinMap a b) + ptryFrom' opq = runTermCont $ do + verMap <- tcont $ plet (pasMap # opq) + let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) + verifyPair = plam $ \tup -> unTermCont $ do + (verfst, _) <- tcont $ ptryFrom @(PAsData a) $ pfstBuiltin # tup + (versnd, _) <- tcont $ ptryFrom @(PAsData b) $ psndBuiltin # tup + pure $ ppairDataBuiltin # verfst # versnd + ver <- tcont $ plet $ pmap # verifyPair # verMap + pure (punsafeCoerce opq, ver) + +{- | + This verifies a list to be indeed a list but doesn't recover the inner data + use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData a)))` + as this is O(1) instead of O(n) +-} + +-- TODO: add the excess inner type list +instance PTryFrom PData (PAsData (PBuiltinList PData)) where + type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) + ptryFrom' opq = runTermCont $ do + ver <- tcont $ plet (pasList # opq) + pure $ (punsafeCoerce opq, ver) + +{- | + Recover a `PBuiltinList (PAsData a)` +-} +instance + ( PTryFrom PData (PAsData a) + , PIsData a + ) => + PTryFrom PData (PAsData (PBuiltinList (PAsData a))) + where + type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = Flip Term (PBuiltinList (PAsData a)) + ptryFrom' opq = runTermCont $ do + let lst :: Term _ (PBuiltinList PData) + lst = pasList # opq + verify :: Term _ (PData :--> PAsData a) + verify = plam $ \e -> + unTermCont $ do + (wrapped, _) <- tcont $ ptryFrom @(PAsData a) $ e + pure wrapped + ver <- tcont $ plet $ pmap # verify # lst + pure $ (punsafeCoerce opq, ver) + +{- | + Recover a `PAsData (PBuiltinPair a b)` +-} +instance + ( PTryFrom PData a + , a ~ PAsData a' + , PIsData a' + , PTryFrom PData b + , b ~ PAsData b' + , PIsData b' + ) => + PTryFrom PData (PAsData (PBuiltinPair a b)) + where + type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = Flip Term (PBuiltinPair a b) + ptryFrom' opq = runTermCont $ do + tup <- tcont $ plet (pfromData $ punsafeCoerce opq) + let fst' :: Term _ a + fst' = unTermCont $ fst <$> tcont (ptryFrom @a $ pforgetData $ pfstBuiltin # tup) + snd' :: Term _ b + snd' = unTermCont $ fst <$> tcont (ptryFrom @b $ pforgetData $ psndBuiltin # tup) + ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' + pure $ (punsafeCoerce opq, ver) + +----------------------- other utility functions ----------------------------------------- + +instance PTryFrom PData (PAsData PData) where + type PTryFromExcess PData (PAsData PData) = Const () + ptryFrom' opq = runTermCont $ pure (pdata opq, ()) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 0630d4383..7e8d04f01 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -27,6 +27,7 @@ module Plutarch.DataRepr.Internal ( DualReprHandler (..), ) where +import Data.Coerce (coerce) import qualified Data.Functor.Compose as F import Data.Functor.Const (Const (Const)) import Data.Kind (Constraint, Type) @@ -61,17 +62,22 @@ import Generics.SOP ( import Plutarch ( Dig, PInner, + POpaque, PType, PlutusType, S, Term, + pcon, pcon', + pdelay, perror, + pforce, phoistAcyclic, plam, plet, pmatch, pmatch', + popaque, pto, (#), (#$), @@ -85,6 +91,7 @@ import Plutarch.Builtin ( PData, PIsData, pasConstr, + pchooseListBuiltin, pconstrBuiltin, pdata, pforgetData, @@ -92,9 +99,15 @@ import Plutarch.Builtin ( pfstBuiltin, psndBuiltin, ) -import Plutarch.DataRepr.Internal.HList (type Drop, type IndexList) +import Plutarch.DataRepr.Internal.HList ( + HRec (HCons, HNil), + HRecGeneric (HRecGeneric), + Labeled (Labeled), + type Drop, + type IndexList, + ) import Plutarch.Integer (PInteger) -import Plutarch.Internal (S (SI), punsafeCoerce) +import Plutarch.Internal (S (SI)) import Plutarch.Internal.Generic (MkNS, PCode, PGeneric, gpfrom, gpto, mkNS, mkSum) import Plutarch.Lift ( PConstant, @@ -108,9 +121,15 @@ import Plutarch.Lift ( pconstantToRepr, ) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) -import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont, tcont, unTermCont) +import Plutarch.TermCont (TermCont (TermCont), hashOpenTerm, runTermCont, tcont, unTermCont) +import Plutarch.Trace (ptraceError) +import Plutarch.TryFrom (PTryFrom, PTryFromExcess, ptryFrom, ptryFrom') +import Plutarch.Unit (PUnit (PUnit)) +import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) import qualified Plutus.V1.Ledger.Api as Ledger +import Plutarch.Reducible (Reduce, Reducible) + {- | A "record" of `exists a. PAsData a`. The underlying representation is `PBuiltinList PData`. -} @@ -627,3 +646,122 @@ class IsBuiltinList a where instance IsBuiltinList (PDataRecord l) where dataListFrom = punsafeCoerce + +----------------------- HRecP and friends ----------------------------------------------- + +type HRecPApply :: [(Symbol, PType)] -> S -> [(Symbol, Type)] +type family HRecPApply as s where + HRecPApply ('(name, ty) ': rest) s = '(name, Reduce (ty s)) ': HRecPApply rest s + HRecPApply '[] s = '[] + +newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (HRecGeneric (HRecPApply as s)) + +instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecGeneric (HRecPApply as s) + +newtype Flip f a b = Flip (f b a) + +instance Reducible (f x y) => Reducible (Flip f y x) where + type Reduce (Flip f y x) = Reduce (f x y) + +-- We could have a more advanced instance but it's not needed really. +newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) + +instance Reducible (PTryFromExcess PData (PAsData a) s) => Reducible (ExcessForField a s) where + type Reduce (ExcessForField a s) = (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) + +-- FIXME: Should we always succede? If we always succede, performance would increase a lot. +instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where + type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] + ptryFrom' opq = runTermCont $ do + _ <- + tcont . plet . pforce $ + pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") + pure (pdnil, HRecGeneric HNil) + +type family UnHRecP (x :: PType) :: [(Symbol, PType)] where + UnHRecP (HRecP as) = as + +instance + ( PTryFrom PData (PAsData pty) + , PTryFrom (PBuiltinList PData) (PDataRecord as) + , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase + ) => + PTryFrom (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) + where + type + PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) = + HRecP + ( '(name, ExcessForField pty) + ': UnHRecP (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) + ) + ptryFrom' opq = runTermCont $ do + h <- tcont $ plet $ phead # opq + hv <- tcont $ ptryFrom @(PAsData pty) @PData h + t <- tcont $ plet $ ptail # opq + tv <- tcont $ ptryFrom @(PDataRecord as) @(PBuiltinList PData) t + pure (punsafeCoerce opq, HRecGeneric (HCons (Labeled hv) (coerce $ snd tv))) + +newtype Helper a b s = Helper (a s, b s) + +instance (Reducible (a s), Reducible (b s)) => Reducible (Helper a b s) where + type Reduce (Helper a b s) = (Reduce (a s), Reduce (b s)) + +instance + ( PTryFrom (PBuiltinList PData) (PDataRecord as) + , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase + ) => + PTryFrom PData (PAsData (PDataRecord as)) + where + type + PTryFromExcess PData (PAsData (PDataRecord as)) = + Helper (Flip Term (PDataRecord as)) (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) + ptryFrom' opq = runTermCont $ do + l <- snd <$> (tcont $ ptryFrom @(PAsData (PBuiltinList PData)) opq) + r <- tcont $ ptryFrom @(PDataRecord as) l + pure (punsafeCoerce opq, r) + +class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where + validateSum :: Term s PInteger -> Term s (PBuiltinList PData) -> Term s POpaque + +instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where + type PTryFromExcess PData (PAsData (PDataSum ys)) = Const () + ptryFrom' opq = runTermCont $ do + x <- tcont $ plet $ pasConstr # opq + constr <- tcont $ plet $ pfstBuiltin # x + fields <- tcont $ plet $ psndBuiltin # x + _ <- tcont $ plet $ validateSum @0 @ys constr fields + pure (punsafeCoerce opq, ()) + +instance + {-# OVERLAPPABLE #-} + forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). + ( PTryFrom (PBuiltinList PData) (PDataRecord x) + , SumValidation (n + 1) xs + , KnownNat n + ) => + SumValidation n (x ': xs) + where + validateSum constr fields = + pif + (fromInteger (natVal $ Proxy @n) #== constr) + ( unTermCont $ do + _ <- tcont $ ptryFrom @(PDataRecord x) fields + pure $ popaque $ pcon PUnit + ) + (validateSum @(n + 1) @xs constr fields) + +instance {-# OVERLAPPING #-} SumValidation n '[] where + validateSum _ _ = ptraceError "reached end of sum while still not having found the constructor" + +instance + ( PIsDataRepr a + , SumValidation 0 (PIsDataReprRepr a) + , PInner a b ~ PDataSum (PIsDataReprRepr a) + ) => + PTryFrom PData (PAsData (PIsDataReprInstances a)) + where + type PTryFromExcess PData (PAsData (PIsDataReprInstances a)) = Const () + ptryFrom' opq = runTermCont $ do + let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) + reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) + pure $ (pdata $ punsafeFrom reprsum, ()) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index b781456bd..053462ac9 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -3,93 +3,27 @@ module Plutarch.TryFrom ( PTryFrom (..), - HRecP (..), ptryFrom, PSubtype, ) where -import Data.Proxy (Proxy (Proxy)) - -import GHC.TypeLits (KnownNat, Nat, Symbol, natVal, type (+)) - import Data.Coerce (Coercible) import Data.Kind (Constraint) -import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) - -import Plutarch.Bool (pif, (#==)) -import Plutarch.ByteString (PByteString) -import Plutarch.Integer (PInteger) -import Plutarch.Unit (PUnit (PUnit)) +import Plutarch.Unsafe (punsafeFrom) import Plutarch.Internal.Other ( DerivePNewtype, PInner, POpaque, PType, - S, Term, - pcon, - pdelay, - pforce, - plam, - plet, - popaque, - (#), - type (:-->), - ) - -import Plutarch.Trace (ptraceError) - -import Plutarch.DataRepr.Internal.HList (HRec (HCons, HNil), HRecGeneric (HRecGeneric), Labeled (Labeled)) - -import Plutarch.DataRepr.Internal ( - PDataRecord, - PDataSum, - PLabeledType ((:=)), - pdnil, - ) - -import Plutarch.List ( - phead, - pmap, - ptail, - ) - -import Plutarch.Builtin ( - PAsData, - PBuiltinList, - PBuiltinMap, - PBuiltinPair, - PData, - PIsData (pfromData), - pasByteStr, - pasConstr, - pasInt, - pasList, - pasMap, - pchooseListBuiltin, - pdata, - pforgetData, - pfstBuiltin, - ppairDataBuiltin, - psndBuiltin, ) -import Plutarch.TermCont (TermCont (TermCont, runTermCont), tcont, unTermCont) - -import Plutarch.DataRepr.Internal (PIsDataRepr (PIsDataReprRepr), PIsDataReprInstances) +import Plutarch.TermCont (TermCont (runTermCont), tcont) import Plutarch.Reducible (Reducible (Reduce)) -import Data.Functor.Const (Const) - -import Data.Kind (Type) - -import Data.Coerce (coerce) - ------------------------ The class PTryFrom ---------------------------------------------- - class PSubtypeDecl (a :: PType) (b :: PType) -- Not `OVERLAPPABLE` or `OVERLAPPING` on purpose @@ -128,229 +62,6 @@ class PSubtype a b => PTryFrom (a :: PType) (b :: PType) where ptryFrom :: forall b a s r. PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r ptryFrom = ptryFrom' ------------------------ Reducible and Flip ---------------------------------------------- - -instance Reducible (f x y) => Reducible (Flip f y x) where - type Reduce (Flip f y x) = Reduce (f x y) - -newtype Flip f a b = Flip (f b a) - ------------------------ HRecP and friends ----------------------------------------------- - -type HRecPApply :: [(Symbol, PType)] -> S -> [(Symbol, Type)] -type family HRecPApply as s where - HRecPApply ('(name, ty) ': rest) s = '(name, Reduce (ty s)) ': HRecPApply rest s - HRecPApply '[] s = '[] - -newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (HRecGeneric (HRecPApply as s)) - -instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecGeneric (HRecPApply as s) - ------------------------ PData instances ------------------------------------------------- - -instance PTryFrom PData (PAsData PInteger) where - type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger - ptryFrom' opq = runTermCont $ do - ver <- tcont $ plet (pasInt # opq) - pure $ (punsafeCoerce opq, ver) - -instance PTryFrom PData (PAsData PByteString) where - type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString - ptryFrom' opq = runTermCont $ do - ver <- tcont $ plet (pasByteStr # opq) - pure $ (punsafeCoerce opq, ver) - -instance - ( PTryFrom PData (PAsData a) - , PTryFrom PData (PAsData b) - ) => - PTryFrom PData (PAsData (PBuiltinMap a b)) - where - type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = Flip Term (PBuiltinMap a b) - ptryFrom' opq = runTermCont $ do - verMap <- tcont $ plet (pasMap # opq) - let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) - verifyPair = plam $ \tup -> unTermCont $ do - (verfst, _) <- tcont $ ptryFrom @(PAsData a) $ pfstBuiltin # tup - (versnd, _) <- tcont $ ptryFrom @(PAsData b) $ psndBuiltin # tup - pure $ ppairDataBuiltin # verfst # versnd - ver <- tcont $ plet $ pmap # verifyPair # verMap - pure (punsafeCoerce opq, ver) - -{- | - This verifies a list to be indeed a list but doesn't recover the inner data - use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData a)))` - as this is O(1) instead of O(n) --} - --- TODO: add the excess inner type list -instance PTryFrom PData (PAsData (PBuiltinList PData)) where - type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) - ptryFrom' opq = runTermCont $ do - ver <- tcont $ plet (pasList # opq) - pure $ (punsafeCoerce opq, ver) - -{- | - Recover a `PBuiltinList (PAsData a)` --} -instance - ( PTryFrom PData (PAsData a) - , PIsData a - ) => - PTryFrom PData (PAsData (PBuiltinList (PAsData a))) - where - type PTryFromExcess PData (PAsData (PBuiltinList (PAsData a))) = Flip Term (PBuiltinList (PAsData a)) - ptryFrom' opq = runTermCont $ do - let lst :: Term _ (PBuiltinList PData) - lst = pasList # opq - verify :: Term _ (PData :--> PAsData a) - verify = plam $ \e -> - unTermCont $ do - (wrapped, _) <- tcont $ ptryFrom @(PAsData a) $ e - pure wrapped - ver <- tcont $ plet $ pmap # verify # lst - pure $ (punsafeCoerce opq, ver) - -{- | - Recover a `PAsData (PBuiltinPair a b)` --} -instance - ( PTryFrom PData a - , a ~ PAsData a' - , PIsData a' - , PTryFrom PData b - , b ~ PAsData b' - , PIsData b' - ) => - PTryFrom PData (PAsData (PBuiltinPair a b)) - where - type PTryFromExcess PData (PAsData (PBuiltinPair a b)) = Flip Term (PBuiltinPair a b) - ptryFrom' opq = runTermCont $ do - tup <- tcont $ plet (pfromData $ punsafeCoerce opq) - let fst' :: Term _ a - fst' = unTermCont $ fst <$> tcont (ptryFrom @a $ pforgetData $ pfstBuiltin # tup) - snd' :: Term _ b - snd' = unTermCont $ fst <$> tcont (ptryFrom @b $ pforgetData $ psndBuiltin # tup) - ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' - pure $ (punsafeCoerce opq, ver) - ------------------------ PDataRecord instances ------------------------------------------- - --- We could have a more advanced instance but it's not needed really. - -newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) - -instance Reducible (PTryFromExcess PData (PAsData a) s) => Reducible (ExcessForField a s) where - type Reduce (ExcessForField a s) = (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) - --- FIXME: Should we always succede? If we always succede, performance would increase a lot. -instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where - type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] - ptryFrom' opq = runTermCont $ do - _ :: Term _ PUnit <- - tcont . plet . pforce $ - pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") - pure (pdnil, HRecGeneric HNil) - -type family UnHRecP (x :: PType) :: [(Symbol, PType)] where - UnHRecP (HRecP as) = as - -instance - ( PTryFrom PData (PAsData pty) - , PTryFrom (PBuiltinList PData) (PDataRecord as) - , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase - ) => - PTryFrom (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) - where - type - PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) = - HRecP - ( '(name, ExcessForField pty) - ': UnHRecP (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) - ) - ptryFrom' opq = runTermCont $ do - h <- tcont $ plet $ phead # opq - hv <- tcont $ ptryFrom @(PAsData pty) @PData h - t <- tcont $ plet $ ptail # opq - tv <- tcont $ ptryFrom @(PDataRecord as) @(PBuiltinList PData) t - pure (punsafeCoerce opq, HRecGeneric (HCons (Labeled hv) (coerce $ snd tv))) - -newtype Helper a b s = Helper (a s, b s) - -instance (Reducible (a s), Reducible (b s)) => Reducible (Helper a b s) where - type Reduce (Helper a b s) = (Reduce (a s), Reduce (b s)) - -instance - ( PTryFrom (PBuiltinList PData) (PDataRecord as) - , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase - ) => - PTryFrom PData (PAsData (PDataRecord as)) - where - type - PTryFromExcess PData (PAsData (PDataRecord as)) = - Helper (Flip Term (PDataRecord as)) (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) - ptryFrom' opq = runTermCont $ do - l <- snd <$> (tcont $ ptryFrom @(PAsData (PBuiltinList PData)) opq) - r <- tcont $ ptryFrom @(PDataRecord as) l - pure (punsafeCoerce opq, r) - -class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where - validateSum :: Term s PInteger -> Term s (PBuiltinList PData) -> Term s POpaque - -instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where - type PTryFromExcess PData (PAsData (PDataSum ys)) = Const () - ptryFrom' opq = runTermCont $ do - x <- tcont $ plet $ pasConstr # opq - constr <- tcont $ plet $ pfstBuiltin # x - fields <- tcont $ plet $ psndBuiltin # x - _ <- tcont $ plet $ validateSum @0 @ys constr fields - pure (punsafeCoerce opq, ()) - -instance - {-# OVERLAPPABLE #-} - forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). - ( PTryFrom (PBuiltinList PData) (PDataRecord x) - , SumValidation (n + 1) xs - , KnownNat n - ) => - SumValidation n (x ': xs) - where - validateSum constr fields = - pif - (fromInteger (natVal $ Proxy @n) #== constr) - ( unTermCont $ do - _ <- tcont $ ptryFrom @(PDataRecord x) fields - pure $ popaque $ pcon PUnit - ) - (validateSum @(n + 1) @xs constr fields) - -instance {-# OVERLAPPING #-} SumValidation n '[] where - validateSum _ _ = ptraceError "reached end of sum while still not having found the constructor" - ------------------------ other utility functions ----------------------------------------- - -instance PTryFrom PData (PAsData PData) where - type PTryFromExcess PData (PAsData PData) = Const () - ptryFrom' opq = runTermCont $ pure (pdata opq, ()) - ------------------------ PIsDataReprInstances instance ----------------------------------- - --- | you can instantiate `PTryFrom` for your own datatype as demonstrated in the spec -instance - ( PIsDataRepr a - , SumValidation 0 (PIsDataReprRepr a) - , PInner a b ~ PDataSum (PIsDataReprRepr a) - ) => - PTryFrom PData (PAsData (PIsDataReprInstances a)) - where - type PTryFromExcess PData (PAsData (PIsDataReprInstances a)) = Const () - ptryFrom' opq = runTermCont $ do - let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) - reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) - pure $ (pdata $ punsafeFrom reprsum, ()) - ------------------------ DerivePNewtype insatace ----------------------------------------- - instance ( PTryFrom a b , (forall s. Coercible (c s) (Term s b)) From f35f39115a3b97cc9a04f4180144dbe478b3bafd Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sat, 16 Apr 2022 14:21:21 +0000 Subject: [PATCH 360/584] Add `pupcastF`, `pupcast`, and rename `punsafeFrom` to `punsafeDowncast` I haven't renamed `pto`, but we probably should. --- Plutarch/Builtin.hs | 4 ++-- Plutarch/DataRepr/Internal.hs | 4 ++-- Plutarch/Integer.hs | 10 ++++----- Plutarch/Internal/Other.hs | 22 +++++++++---------- Plutarch/TryFrom.hs | 16 +++++++++----- Plutarch/Unsafe.hs | 13 +++-------- .../plutarch-base/Plutarch/RecSpec.hs | 8 +++---- 7 files changed, 38 insertions(+), 39 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 2b91003e3..da8e10a58 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -84,7 +84,7 @@ import Plutarch.List ( ) import Plutarch.Show (PShow (pshow')) import Plutarch.Unit (PUnit) -import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce, punsafeFrom) +import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce, punsafeDowncast) import qualified PlutusCore as PLC import PlutusTx (Data (Constr), ToData) import qualified PlutusTx @@ -371,7 +371,7 @@ instance PEq (PAsData a) where x #== y = punsafeBuiltin PLC.EqualsData # x # y instance (forall (s :: S). Coercible (a s) (Term s b), PIsData b) => PIsData (DerivePNewtype a b) where - pfromData x = punsafeFrom target + pfromData x = punsafeDowncast target where target :: Term _ b target = pfromData $ pinnerData x diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 7e8d04f01..56175f009 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -125,7 +125,7 @@ import Plutarch.TermCont (TermCont (TermCont), hashOpenTerm, runTermCont, tcont, import Plutarch.Trace (ptraceError) import Plutarch.TryFrom (PTryFrom, PTryFromExcess, ptryFrom, ptryFrom') import Plutarch.Unit (PUnit (PUnit)) -import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) +import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import qualified Plutus.V1.Ledger.Api as Ledger import Plutarch.Reducible (Reduce, Reducible) @@ -764,4 +764,4 @@ instance ptryFrom' opq = runTermCont $ do let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) - pure $ (pdata $ punsafeFrom reprsum, ()) + pure $ (pdata $ punsafeDowncast reprsum, ()) diff --git a/Plutarch/Integer.hs b/Plutarch/Integer.hs index dec79bb0e..454bacce3 100644 --- a/Plutarch/Integer.hs +++ b/Plutarch/Integer.hs @@ -21,7 +21,7 @@ import Plutarch.Lift ( PUnsafeLiftDecl, pconstant, ) -import Plutarch.Unsafe (punsafeBuiltin, punsafeFrom) +import Plutarch.Unsafe (punsafeBuiltin, punsafeDowncast) import qualified PlutusCore as PLC -- | Plutus BuiltinInteger @@ -66,7 +66,7 @@ instance Num (Term s PInteger) where fromInteger = pconstant instance PIntegral b => PIntegral (DerivePNewtype a b) where - pdiv = phoistAcyclic $ plam $ \x y -> punsafeFrom $ pdiv # pto x # pto y - pmod = phoistAcyclic $ plam $ \x y -> punsafeFrom $ pmod # pto x # pto y - pquot = phoistAcyclic $ plam $ \x y -> punsafeFrom $ pquot # pto x # pto y - prem = phoistAcyclic $ plam $ \x y -> punsafeFrom $ prem # pto x # pto y + pdiv = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ pdiv # pto x # pto y + pmod = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ pmod # pto x # pto y + pquot = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ pquot # pto x # pto y + prem = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ prem # pto x # pto y diff --git a/Plutarch/Internal/Other.hs b/Plutarch/Internal/Other.hs index 66cccc4e2..b922d1981 100644 --- a/Plutarch/Internal/Other.hs +++ b/Plutarch/Internal/Other.hs @@ -122,19 +122,19 @@ instance (forall (s :: PI.S). Coercible (a s) (Term s b)) => PlutusType (DeriveP pmatch' x f = f . DerivePNewtype $ ptypeOuter x instance Semigroup (Term s b) => Semigroup (Term s (DerivePNewtype a b)) where - x <> y = punsafeFrom $ pto x <> pto y + x <> y = punsafeDowncast $ pto x <> pto y instance Monoid (Term s b) => Monoid (Term s (DerivePNewtype a b)) where - mempty = punsafeFrom $ mempty @(Term s b) + mempty = punsafeDowncast $ mempty @(Term s b) instance Num (Term s b) => Num (Term s (DerivePNewtype a b)) where - x + y = punsafeFrom $ pto x + pto y - x - y = punsafeFrom $ pto x - pto y - x * y = punsafeFrom $ pto x * pto y - abs x = punsafeFrom $ abs $ pto x - negate x = punsafeFrom $ negate $ pto x - signum x = punsafeFrom $ signum $ pto x - fromInteger x = punsafeFrom $ fromInteger @(Term s b) x + x + y = punsafeDowncast $ pto x + pto y + x - y = punsafeDowncast $ pto x - pto y + x * y = punsafeDowncast $ pto x * pto y + abs x = punsafeDowncast $ abs $ pto x + negate x = punsafeDowncast $ negate $ pto x + signum x = punsafeDowncast $ signum $ pto x + fromInteger x = punsafeDowncast $ fromInteger @(Term s b) x ptypeInner :: forall (x :: PType) y s. Coercible (x s) (Term s y) => x s -> Term s y ptypeInner = coerce @@ -142,5 +142,5 @@ ptypeInner = coerce ptypeOuter :: forall (x :: PType) y s. Coercible (x s) (Term s y) => Term s y -> x s ptypeOuter = coerce -punsafeFrom :: (forall b. Term s (PInner a b)) -> Term s a -punsafeFrom x = PI.punsafeCoerce x +punsafeDowncast :: (forall b. Term s (PInner a b)) -> Term s a +punsafeDowncast x = PI.punsafeCoerce x diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 053462ac9..7a660e684 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -5,13 +5,15 @@ module Plutarch.TryFrom ( PTryFrom (..), ptryFrom, PSubtype, + pupcast, + pupcastF, ) where import Data.Coerce (Coercible) import Data.Kind (Constraint) +import Data.Proxy (Proxy) -import Plutarch.Unsafe (punsafeFrom) - +import Plutarch.Internal (punsafeCoerce) import Plutarch.Internal.Other ( DerivePNewtype, PInner, @@ -20,8 +22,6 @@ import Plutarch.Internal.Other ( Term, ) -import Plutarch.TermCont (TermCont (runTermCont), tcont) - import Plutarch.Reducible (Reducible (Reduce)) class PSubtypeDecl (a :: PType) (b :: PType) @@ -69,4 +69,10 @@ instance PTryFrom a (DerivePNewtype c b) where type PTryFromExcess a (DerivePNewtype c b) = PTryFromExcess a b - ptryFrom' opq = runTermCont $ (\(inn, exc) -> (punsafeFrom inn, exc)) <$> tcont (ptryFrom @b @a opq) + ptryFrom' opq f = ptryFrom @b @a opq $ \(inn, exc) -> f (punsafeCoerce inn, exc) + +pupcast :: PSubtype a b => Term s b -> Term s a +pupcast = punsafeCoerce + +pupcastF :: forall a b (p :: PType -> PType) s. PSubtype a b => Proxy p -> Term s (p b) -> Term s (p a) +pupcastF _ = punsafeCoerce diff --git a/Plutarch/Unsafe.hs b/Plutarch/Unsafe.hs index e59a399b6..89fd7c65a 100644 --- a/Plutarch/Unsafe.hs +++ b/Plutarch/Unsafe.hs @@ -4,22 +4,15 @@ module Plutarch.Unsafe ( PI.punsafeBuiltin, PI.punsafeCoerce, PI.punsafeConstant, - punsafeFrom, - punsafeFromOpaque, + punsafeDowncast, ) where import qualified Plutarch.Internal as PI import Plutarch.Internal.Other (PInner, POpaque, Term) -{- | - Unsafely coerce from an Opaque term to another type. --} -punsafeFromOpaque :: Term s POpaque -> Term s a -punsafeFromOpaque = PI.punsafeCoerce - {- | Unsafely coerce from the 'PInner' representation of a Term, assuming that the value is a safe construction of the Term. -} -punsafeFrom :: (forall b. Term s (PInner a b)) -> Term s a -punsafeFrom x = PI.punsafeCoerce x +punsafeDowncast :: PInner b POpaque ~ a => Term s a -> Term s b +punsafeDowncast x = PI.punsafeCoerce x diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index 2380aa772..1025f248a 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -26,7 +26,7 @@ import Plutarch.Rec ( ) import Plutarch.Rec.TH (deriveAll) import Plutarch.Test -import Plutarch.Unsafe (punsafeCoerce, punsafeFrom) +import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import Test.Hspec data FlatOuterRecord f = FlatOuterRecord @@ -198,13 +198,13 @@ evenOdd = letrec evenOddRecursion } sampleData :: Term s (PAsData (PRecord SampleRecord)) -sampleData = pdata (punsafeFrom sampleRecord) +sampleData = pdata (punsafeDowncast sampleRecord) flatOuterData :: Term s (PAsData (PRecord FlatOuterRecord)) -flatOuterData = pdata (punsafeFrom sampleFlatOuter) +flatOuterData = pdata (punsafeDowncast sampleFlatOuter) shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) -shallowOuterData = pdata (punsafeFrom sampleShallowOuter) +shallowOuterData = pdata (punsafeDowncast sampleShallowOuter) spec :: Spec spec = do From 117760b486f4502526a18587cc1a9aaddce1d42b Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sat, 16 Apr 2022 14:36:20 +0000 Subject: [PATCH 361/584] Make use of `PSubtype` in `Plutarch.Builtin` --- Plutarch/Builtin.hs | 20 ++++++++++++++------ Plutarch/TryFrom.hs | 1 - 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index da8e10a58..39817087b 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -22,6 +22,9 @@ module Plutarch.Builtin ( PIsData (..), PAsData, pforgetData, + pforgetData', + prememberData, + prememberData', ppairDataBuiltin, pchooseListBuiltin, type PBuiltinMap, @@ -95,7 +98,7 @@ import Plutarch.Reducible (Reducible (Reduce)) import Data.Functor.Const (Const) -import Plutarch.TryFrom (PTryFrom, PTryFromExcess, ptryFrom, ptryFrom') +import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast, pupcastF) -- | Plutus 'BuiltinPair' data PBuiltinPair (a :: PType) (b :: PType) (s :: S) @@ -251,19 +254,24 @@ instance PConstantDecl (PAsDataLifted a) where instance PUnsafeLiftDecl (PAsData a) where type PLifted (PAsData a) = PAsDataLifted a -newtype Helper1 (a :: PType) (s :: S) = Helper1 (a s) - pforgetData :: forall s a. Term s (PAsData a) -> Term s PData -pforgetData x = coerce $ pforgetData' Proxy (coerce x :: Term s (Helper1 (PAsData a))) +pforgetData = pupcast --- | Like 'pforgetData', except it works for complex types. +{- | Like 'pforgetData', except it works for complex types. + Equivalent to 'pupcastF'. +-} pforgetData' :: forall a (p :: PType -> PType) s. Proxy p -> Term s (p (PAsData a)) -> Term s (p PData) -pforgetData' Proxy = punsafeCoerce +pforgetData' = pupcastF -- | Inverse of 'pforgetData''. prememberData :: forall (p :: PType -> PType) s. Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) prememberData Proxy = punsafeCoerce +-- | Like 'prememberData' but generalised. +prememberData' :: forall a (p :: PType -> PType) s. PSubtype PData a => Proxy p -> Term s (p a) -> Term s (p (PAsData a)) +prememberData' Proxy = punsafeCoerce + +-- | Law: If @PSubtype PData a@, then @pdata a@ must be a no-op. class PIsData a where pfromData :: Term s (PAsData a) -> Term s a pdata :: Term s a -> Term s (PAsData a) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 7a660e684..aa7eb960f 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.TryFrom ( From ab236c5d2953f977d62fd54ec7d558357ca8ac98 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sat, 16 Apr 2022 14:48:09 +0000 Subject: [PATCH 362/584] Fix examples --- plutarch-test/conditional/Plutarch/TryFromSpec.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 16a73a10f..9e29f135a 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -3,6 +3,8 @@ module Plutarch.TryFromSpec (spec) where +import Data.Coerce (coerce) + -- Haskell imports import qualified GHC.Generics as GHC @@ -487,7 +489,9 @@ theField = unTermCont $ do ------------------- Sample usage DerivePNewType ------------------------------------ -newtype PWrapInt (s :: S) = PMkWrapInt (Term s PInteger) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PWrapInt PInteger) +newtype PWrapInt (s :: S) = PWrapInt (PInteger s) + deriving newtype (PIsData, PEq, POrd) -deriving via DerivePNewtype (PAsData PWrapInt) (PAsData PInteger) instance PTryFrom PData (PAsData PWrapInt) +instance PTryFrom PData (PAsData PWrapInt) where + type PTryFromExcess PData (PAsData PWrapInt) = PTryFromExcess PData (PAsData PInteger) + ptryFrom' t f = ptryFrom' t $ \(t', exc) -> f (coerce (t' :: Term _ (PAsData PInteger)), exc) From 7f8974efc297c7db6ace9a070319cda1814040cc Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sat, 16 Apr 2022 21:39:35 +0000 Subject: [PATCH 363/584] Fix comment --- Plutarch/TryFrom.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index aa7eb960f..bfd65a4a1 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -52,7 +52,7 @@ type PSubtype = PSubtypeDecl @PTryFrom a b@ represents a subtyping relationship between @a@ and @b@, and a way to go from @a@ to @b@. Laws: -- @(punsafeCoerce . fst) <$> tcont (pdowncast x) ≡ pure x@ +- @(punsafeCoerce . fst) <$> tcont (ptryFrom x) ≡ pure x@ -} class PSubtype a b => PTryFrom (a :: PType) (b :: PType) where type PTryFromExcess a b :: PType From 02b817aea88bffc828c374bd7518339f9674adef Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sun, 17 Apr 2022 19:18:14 +0200 Subject: [PATCH 364/584] feat: added enough PTryFrom instances for PValue - recovering PValue - recovering all the types that belong to PValue - test all the recoveries succeed with the correct values with property tests - new module Extra.ByteSTring that exports convenience functions --- Plutarch/Api/V1/AssocMap.hs | 9 ++ Plutarch/Api/V1/Time.hs | 10 ++ Plutarch/Api/V1/Value.hs | 47 +++++++++ Plutarch/Lift.hs | 22 +++-- plutarch-extra/Plutarch/Extra/ByteString.hs | 25 +++++ plutarch-extra/plutarch-extra.cabal | 1 + .../common/Plutarch/Test/Property/Gen.hs | 98 +++++++++++++++++++ .../plutarch-base/Plutarch/ApiSpec.hs | 61 ++++++++++++ 8 files changed, 264 insertions(+), 9 deletions(-) create mode 100644 plutarch-extra/Plutarch/Extra/ByteString.hs diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 7853d5489..c532108a4 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -19,6 +19,7 @@ import Plutarch.Lift ( pconstantToRepr, ) import Plutarch.Prelude +import Plutarch.TryFrom (PTryFrom) newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) deriving (PlutusType, PIsData) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) @@ -47,3 +48,11 @@ instance x' <- Plutus.fromData x y' <- Plutus.fromData y Just (x', y') + +deriving via + DerivePNewtype (PAsData (PMap k v)) (PAsData (PBuiltinMap k v)) + instance + ( PTryFrom PData (PAsData k) + , PTryFrom PData (PAsData v) + ) => + PTryFrom PData (PAsData (PMap k v)) diff --git a/Plutarch/Api/V1/Time.hs b/Plutarch/Api/V1/Time.hs index 8bfa28d98..6c1529eec 100644 --- a/Plutarch/Api/V1/Time.hs +++ b/Plutarch/Api/V1/Time.hs @@ -16,6 +16,8 @@ import Plutarch.Lift ( PUnsafeLiftDecl, ) import Plutarch.Prelude +import Plutarch.TryFrom (Flip, PTryFrom (PTryFromExcess, ptryFrom'), ptryFrom) +import Plutarch.Unsafe (punsafeCoerce) newtype PPOSIXTime (s :: S) = PPOSIXTime (Term s PInteger) @@ -30,3 +32,11 @@ deriving via PConstantDecl Plutus.POSIXTime type PPOSIXTimeRange = PInterval PPOSIXTime + +instance PTryFrom PData (PAsData PPOSIXTime) where + type PTryFromExcess PData (PAsData PPOSIXTime) = Flip Term PPOSIXTime + ptryFrom' opq = runTermCont $ do + (wrapped :: Term _ (PAsData PInteger), unwrapped :: Term _ PInteger) <- + tcont $ ptryFrom @(PAsData PInteger) opq + tcont $ \f -> pif (0 #<= unwrapped) (f ()) (ptraceError "POSIXTime must always be positive") + pure (punsafeCoerce wrapped, pcon $ PPOSIXTime unwrapped) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 4281dcc2c..54467762b 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -19,6 +20,8 @@ import Plutarch.Lift ( ) import Plutarch.Prelude +import Plutarch.TryFrom (Flip, PTryFrom (PTryFromExcess, ptryFrom'), ptryFrom) +import Plutarch.Unsafe (punsafeCoerce) newtype PTokenName (s :: S) = PTokenName (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PTokenName PByteString) @@ -48,3 +51,47 @@ deriving via (DerivePConstantViaNewtype Plutus.Value PValue (PMap PCurrencySymbol (PMap PTokenName PInteger))) instance PConstantDecl Plutus.Value + +instance PTryFrom PData (PAsData PTokenName) where + type PTryFromExcess PData (PAsData PTokenName) = Flip Term PTokenName + ptryFrom' opq = runTermCont $ do + (wrapped :: Term _ (PAsData PByteString), unwrapped :: Term _ PByteString) <- + tcont $ ptryFrom @(PAsData PByteString) opq + tcont $ \f -> pif (pallBS # pisHexDigit # unwrapped) (f ()) (ptraceError "a TokenName must be hex-encoded") + tcont $ \f -> pif (plengthBS # unwrapped #<= 32) (f ()) (ptraceError "a TokenName must be at most 32 Bytes long") + pure (punsafeFromLifted wrapped, pcon . PTokenName $ unwrapped) + where + punsafeFromLifted :: PInner a b ~ c => Term s (PAsData c) -> Term s (PAsData a) + punsafeFromLifted = punsafeCoerce + + pallBS :: Term s ((PInteger :--> PBool) :--> PByteString :--> PBool) + pallBS = phoistAcyclic $ + plam $ \f str -> plet (plengthBS # str) $ \ln -> + let helper :: Term _ (PInteger :--> PBool) + helper = pfix #$ plam $ \self i -> + pif + (i #< ln) + ( pif + (f #$ pindexBS # str # i) + (self # (i + 1)) + (pcon PFalse) + ) + (pcon PTrue) + in helper # 0 + + pisHexDigit :: Term s (PInteger :--> PBool) + pisHexDigit = phoistAcyclic $ + plam $ \chr -> + (chr #<= 57 #&& 48 #<= chr) + #|| (chr #<= 70 #&& 65 #<= chr) + #|| (chr #<= 102 #&& 97 #<= chr) + +deriving via + DerivePNewtype (PAsData PCurrencySymbol) (PAsData PByteString) + instance + PTryFrom PData (PAsData PCurrencySymbol) + +deriving via + DerivePNewtype (PAsData PValue) (PAsData (PMap PCurrencySymbol (PMap PTokenName PInteger))) + instance + PTryFrom PData (PAsData PValue) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 30ddad496..4ffb62a13 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -34,11 +34,13 @@ import Control.Lens ((^?)) import Data.Coerce (Coercible, coerce) import Data.Kind (Constraint, Type) import GHC.Stack (HasCallStack) -import Plutarch.Evaluate (EvalError, evalScript) +import Plutarch.Evaluate (EvalError, evalScript') import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInternal) import qualified Plutus.V1.Ledger.Scripts as Scripts import qualified PlutusCore as PLC import PlutusCore.Builtin (ReadKnownError, readKnownConstant) +import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) +import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) import PlutusCore.Evaluation.Machine.Exception (ErrorWithCause (ErrorWithCause), MachineError, _UnliftingErrorE) import PlutusTx (BuiltinData, Data, builtinDataToData, dataToBuiltinData) import PlutusTx.Builtins.Class (FromBuiltin, ToBuiltin, fromBuiltin, toBuiltin) @@ -105,14 +107,16 @@ data LiftError This will fully evaluate the arbitrary closed expression, and convert the resulting value. -} plift' :: forall p. PUnsafeLiftDecl p => ClosedTerm p -> Either LiftError (PLifted p) -plift' prog = case evalScript (compile prog) of - (Right (Scripts.unScript -> UPLC.Program _ _ term), _, _) -> - case readKnownConstant @_ @(PConstantRepr (PLifted p)) @(MachineError PLC.DefaultFun) Nothing term of - Right r -> case pconstantFromRepr r of - Just h -> Right h - Nothing -> Left LiftError_FromRepr - Left e -> Left $ LiftError_ReadKnownError e - (Left e, _, _) -> Left $ LiftError_EvalError e +plift' prog = + let maxBudget = ExBudget (ExCPU maxBound) (ExMemory maxBound) + in case evalScript' maxBudget (compile prog) of + (Right (Scripts.unScript -> UPLC.Program _ _ term), _, _) -> + case readKnownConstant @_ @(PConstantRepr (PLifted p)) @(MachineError PLC.DefaultFun) Nothing term of + Right r -> case pconstantFromRepr r of + Just h -> Right h + Nothing -> Left LiftError_FromRepr + Left e -> Left $ LiftError_ReadKnownError e + (Left e, _, _) -> Left $ LiftError_EvalError e -- | Like `plift'` but throws on failure. plift :: forall p. (HasCallStack, PLift p) => ClosedTerm p -> PLifted p diff --git a/plutarch-extra/Plutarch/Extra/ByteString.hs b/plutarch-extra/Plutarch/Extra/ByteString.hs new file mode 100644 index 000000000..3f6e7579d --- /dev/null +++ b/plutarch-extra/Plutarch/Extra/ByteString.hs @@ -0,0 +1,25 @@ +module Plutarch.Extra.ByteString (pallBS, pisHexDigit) where + +import Plutarch.Prelude + +pallBS :: Term s ((PInteger :--> PBool) :--> PByteString :--> PBool) +pallBS = phoistAcyclic $ + plam $ \f str -> plet (plengthBS # str) $ \ln -> + let helper :: Term _ (PInteger :--> PBool) + helper = pfix #$ plam $ \self i -> + pif + (i #< ln) + ( pif + (f #$ pindexBS # str # i) + (self # (i + 1)) + (pcon PFalse) + ) + (pcon PTrue) + in helper # 0 + +pisHexDigit :: Term s (PInteger :--> PBool) +pisHexDigit = phoistAcyclic $ + plam $ \chr -> + (chr #<= 57 #&& 48 #<= chr) + #|| (chr #<= 70 #&& 65 #<= chr) + #|| (chr #<= 102 #&& 97 #<= chr) diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index aa03fdb94..3ad1d8d38 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -81,6 +81,7 @@ library exposed-modules: Plutarch.Extra Plutarch.Extra.Api + Plutarch.Extra.ByteString Plutarch.Extra.TermCont Plutarch.ListUtils diff --git a/plutarch-test/common/Plutarch/Test/Property/Gen.hs b/plutarch-test/common/Plutarch/Test/Property/Gen.hs index 88c34dd06..59dfaced6 100644 --- a/plutarch-test/common/Plutarch/Test/Property/Gen.hs +++ b/plutarch-test/common/Plutarch/Test/Property/Gen.hs @@ -1,17 +1,42 @@ +{-# OPTIONS_GHC -Wno-orphans #-} + -- | Generator helpers module Plutarch.Test.Property.Gen ( genRational, genInteger, genList, + bsOfLength, ) where import Control.Monad (MonadPlus, liftM2, mfilter) +import Data.List (nub, sortOn) import Data.Ratio ((%)) import Hedgehog (MonadGen) import qualified Hedgehog.Gen as Gen import qualified Hedgehog.Range as Range +import Test.Tasty.QuickCheck ( + Arbitrary, + Gen, + Negative (getNegative), + Positive (getPositive), + arbitrary, + choose, + listOf1, + oneof, + vectorOf, + ) + +import Plutus.V1.Ledger.Api + +import Data.ByteString (ByteString) +import qualified Data.ByteString as BS +import Data.ByteString.Internal (c2w) +import Test.QuickCheck.Instances () + +import qualified PlutusTx.AssocMap as PlutusMap + genInteger :: MonadGen g => g Integer genInteger = Gen.integral (Range.linear (-1_000_000_000) 1_000_000_000) @@ -20,3 +45,76 @@ genRational = liftM2 (%) genInteger (mfilter (/= 0) genInteger) genList :: MonadGen g => g a -> g [a] genList = Gen.list (Range.linear 0 100) + +------------------- Arbitrary instances for several ApiTypes ----------------------- + +bsOfLength :: Int -> Gen ByteString +bsOfLength n = + BS.pack <$> vectorOf n (c2w <$> choose (minBound :: Char, maxBound)) + +instance Arbitrary BuiltinByteString where + arbitrary = toBuiltin @ByteString <$> arbitrary + +instance Arbitrary CurrencySymbol where + arbitrary = CurrencySymbol <$> arbitrary + +instance Arbitrary Value where + arbitrary = + (\a -> Value . PlutusMap.fromList . sortOn fst . zip a) + <$> currSyms + <*> listOf1 arbitraryTokMap + where + -- List of unique token names. + tokNames = nub <$> listOf1 (arbitrary @TokenName) + -- List of unique currency symbols. + currSyms = nub <$> listOf1 (arbitrary @CurrencySymbol) + arbitraryTokMap = + (\a -> PlutusMap.fromList . sortOn fst . zip a) + <$> tokNames + <*> listOf1 (oneof [getPositive @Integer <$> arbitrary, getNegative @Integer <$> arbitrary]) + +instance Arbitrary TokenName where + arbitrary = do + ln <- choose (0, 32) + str <- + BS.pack + <$> vectorOf + ln + ( oneof $ + map + (fmap c2w) + [ choose ('a', 'f') + , choose ('A', 'F') + , choose ('0', '9') + ] + ) + pure . TokenName . toBuiltin @ByteString $ str + +instance Arbitrary PubKeyHash where + arbitrary = + let arbitrary' = + toBuiltin @ByteString <$> bsOfLength 28 + in PubKeyHash <$> arbitrary' + +instance Arbitrary ValidatorHash where + arbitrary = + let arbitrary' = + toBuiltin @ByteString <$> bsOfLength 28 + in ValidatorHash <$> arbitrary' + +instance Arbitrary Credential where + arbitrary = + oneof + [ PubKeyCredential <$> arbitrary + , ScriptCredential <$> arbitrary + ] + +instance Arbitrary StakingCredential where + arbitrary = + oneof + [ StakingHash <$> arbitrary + , StakingPtr <$> arbitrary <*> arbitrary <*> arbitrary + ] + +instance Arbitrary Address where + arbitrary = Address <$> arbitrary <*> arbitrary diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 7e9733821..32c24569e 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE AllowAmbiguousTypes #-} + -- NOTE: This module also contains ScriptContext mocks, which should ideally -- moved to a module of its own after cleaning up to expose a easy to reason -- about API. @@ -22,9 +24,11 @@ import qualified Plutus.V1.Ledger.Value as Value import Plutarch.Api.V1 ( PCredential, PCurrencySymbol, + PMaybeData, PPubKeyHash, PScriptContext, PScriptPurpose (PMinting, PSpending), + PStakingCredential, PTxInInfo, PTxInfo, PValue, @@ -32,7 +36,13 @@ import Plutarch.Api.V1 ( import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude import Plutarch.Test +import Plutarch.Test.Property.Gen () +import Plutarch.TryFrom (PTryFrom, ptryFrom) + import Test.Hspec +import Test.Tasty.QuickCheck (Property, property, (===)) + +import Plutarch.Lift (PConstanted, PLifted, PUnsafeLiftDecl (PLifted)) spec :: Spec spec = do @@ -70,6 +80,26 @@ spec = do "fails" @| checkSignatoryTermCont # pconstant "41" # ctx @-> pfails describe "getFields" . pgoldenSpec $ do "0" @| getFields + describe "data recovery" $ do + describe "succeding property tests" $ do + it "recovering PAddress succeeds" $ + property (propPlutarchtypeCanBeRecovered @Address) + it "recovering PTokenName succeeds" $ + property (propPlutarchtypeCanBeRecovered @TokenName) + it "recovering PCredential succeeds" $ + property (propPlutarchtypeCanBeRecovered @Credential) + it "recovering PStakingCredential succeeds" $ + property (propPlutarchtypeCanBeRecovered @StakingCredential) + it "recovering PPubKeyHash succeeds" $ + property (propPlutarchtypeCanBeRecovered @PubKeyHash) + it "recovering PValidatorHash succeeds" $ + property (propPlutarchtypeCanBeRecovered @ValidatorHash) + it "recovering PValue succeeds" $ + property (propPlutarchtypeCanBeRecovered @Value) + it "recovering PCurrencySymbol succeeds" $ + property (propPlutarchtypeCanBeRecovered @CurrencySymbol) + it "recovering PMaybeData succeeds" $ + property prop_pmaybedata_can_be_recovered -------------------------------------------------------------------------------- @@ -267,3 +297,34 @@ d0Dat = Datum $ toBuiltinData d0DatValue d0DatValue :: [Integer] d0DatValue = [1 .. 10] + +------------------- Property tests ------------------------------------------------- + +propPlutarchtypeCanBeRecovered :: + forall a. + ( Eq a + , Show a + , PConstant a + , PIsData (PConstanted a) + , PTryFrom PData (PAsData (PConstanted a)) + , PLifted (PConstanted a) ~ a + , ToData a + ) => + a -> + Property +propPlutarchtypeCanBeRecovered addr = + addr + === plift + ( unTermCont $ + pfromData . fst <$> tcont (ptryFrom @(PAsData (PConstanted a)) $ pforgetData $ pconstantData addr) + ) + +prop_pmaybedata_can_be_recovered :: Maybe StakingCredential -> Property +prop_pmaybedata_can_be_recovered addr = + addr + === plift + ( unTermCont $ + pfromData . fst + <$> tcont + (ptryFrom @(PAsData (PMaybeData PStakingCredential)) $ pforgetData $ pconstantData addr) + ) From 728edc78f28bb978a27d145f0b0f53ecc13f336c Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sun, 17 Apr 2022 19:20:51 +0200 Subject: [PATCH 365/584] added tests for bytestring extra utility functions --- plutarch-extra/Plutarch/Extra/TermCont.hs | 5 ----- .../goldens/extra.bytestring.bench.golden | 6 +++++ .../goldens/extra.bytestring.uplc.eval.golden | 6 +++++ .../goldens/extra.bytestring.uplc.golden | 6 +++++ .../Plutarch/Extra/ByteStringSpec.hs | 22 +++++++++++++++++++ plutarch-test/plutarch-test.cabal | 1 + 6 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 plutarch-test/goldens/extra.bytestring.bench.golden create mode 100644 plutarch-test/goldens/extra.bytestring.uplc.eval.golden create mode 100644 plutarch-test/goldens/extra.bytestring.uplc.golden create mode 100644 plutarch-test/plutarch-extra/Plutarch/Extra/ByteStringSpec.hs diff --git a/plutarch-extra/Plutarch/Extra/TermCont.hs b/plutarch-extra/Plutarch/Extra/TermCont.hs index 015a43210..41edff74c 100644 --- a/plutarch-extra/Plutarch/Extra/TermCont.hs +++ b/plutarch-extra/Plutarch/Extra/TermCont.hs @@ -6,7 +6,6 @@ module Plutarch.Extra.TermCont ( pletC, pmatchC, ptryFromC, - ptryFromC', ) where import Plutarch.Prelude @@ -24,7 +23,3 @@ pmatchC = tcont . pmatch -- | Like `ptryFrom` but works in a `TermCont` monad ptryFromC :: forall b a s. PTryFrom a b => Term s a -> TermCont s (Term s b, Reduce (PTryFromExcess a b s)) ptryFromC = tcont . ptryFrom - --- | Like `ptryFom'` but works in a `TermCont` monad -ptryFromC' :: forall a b s. PTryFrom a b => Term s a -> TermCont s (Term s b, Reduce (PTryFromExcess a b s)) -ptryFromC' = tcont . ptryFrom diff --git a/plutarch-test/goldens/extra.bytestring.bench.golden b/plutarch-test/goldens/extra.bytestring.bench.golden new file mode 100644 index 000000000..bcbfe58a6 --- /dev/null +++ b/plutarch-test/goldens/extra.bytestring.bench.golden @@ -0,0 +1,6 @@ +allandhexdigit.allas {"exBudgetCPU":28360969,"exBudgetMemory":65297,"scriptSizeBytes":94} +allandhexdigit.not all as {"exBudgetCPU":14762346,"exBudgetMemory":34251,"scriptSizeBytes":93} +allandhexdigit.allhex {"exBudgetCPU":75395450,"exBudgetMemory":190441,"scriptSizeBytes":175} +allandhexdigit.notallhex {"exBudgetCPU":53725465,"exBudgetMemory":136871,"scriptSizeBytes":175} +allandhexdigit.pisHexDigit {"exBudgetCPU":75581389,"exBudgetMemory":209278,"scriptSizeBytes":187} +allandhexdigit.pisNoneHexDigit {"exBudgetCPU":212115335,"exBudgetMemory":586255,"scriptSizeBytes":235} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.bytestring.uplc.eval.golden b/plutarch-test/goldens/extra.bytestring.uplc.eval.golden new file mode 100644 index 000000000..a4391afb5 --- /dev/null +++ b/plutarch-test/goldens/extra.bytestring.uplc.eval.golden @@ -0,0 +1,6 @@ +allandhexdigit.allas (program 1.0.0 True) +allandhexdigit.not all as (program 1.0.0 False) +allandhexdigit.allhex (program 1.0.0 True) +allandhexdigit.notallhex (program 1.0.0 False) +allandhexdigit.pisHexDigit (program 1.0.0 True) +allandhexdigit.pisNoneHexDigit (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.bytestring.uplc.golden b/plutarch-test/goldens/extra.bytestring.uplc.golden new file mode 100644 index 000000000..197b5f203 --- /dev/null +++ b/plutarch-test/goldens/extra.bytestring.uplc.golden @@ -0,0 +1,6 @@ +allandhexdigit.allas (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i6 (lessThanInteger i1 i3) (delay (force (i6 (i5 (indexByteString i4 i1)) (delay (i2 (addInteger i1 1))) (delay False)))) (delay True))) 0) (lengthOfByteString i1)) (\i0 -> equalsInteger i1 97) #61616161616161616161616161) (force ifThenElse))) +allandhexdigit.not all as (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i6 (lessThanInteger i1 i3) (delay (force (i6 (i5 (indexByteString i4 i1)) (delay (i2 (addInteger i1 1))) (delay False)))) (delay True))) 0) (lengthOfByteString i1)) (\i0 -> equalsInteger i1 97) #616161616161626161616161) (force ifThenElse))) +allandhexdigit.allhex (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 (lessThanInteger i1 i3) (delay (force (i9 (i5 (indexByteString i4 i1)) (delay (i2 (addInteger i1 1))) (delay False)))) (delay True))) 0) (lengthOfByteString i1)) (\i0 -> force (i2 (force (i4 (lessThanEqualsInteger i1 57) (delay (lessThanEqualsInteger 48 i1)))) (delay (force (i2 (force (i4 (lessThanEqualsInteger i1 70) (delay (lessThanEqualsInteger 65 i1)))) (delay (force (i4 (lessThanEqualsInteger i1 102) (delay (lessThanEqualsInteger 97 i1)))))))))) #3561376331386561653837373864313533343466) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) +allandhexdigit.notallhex (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 (lessThanInteger i1 i3) (delay (force (i9 (i5 (indexByteString i4 i1)) (delay (i2 (addInteger i1 1))) (delay False)))) (delay True))) 0) (lengthOfByteString i1)) (\i0 -> force (i2 (force (i4 (lessThanEqualsInteger i1 57) (delay (lessThanEqualsInteger 48 i1)))) (delay (force (i2 (force (i4 (lessThanEqualsInteger i1 70) (delay (lessThanEqualsInteger 65 i1)))) (delay (force (i4 (lessThanEqualsInteger i1 102) (delay (lessThanEqualsInteger 97 i1)))))))))) #3561376331386561653837373867313533343466) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False))) +allandhexdigit.pisHexDigit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 (i5 i2) (delay (i4 i1)))) (delay True))) (\i0 -> force (i2 (force (i4 (lessThanEqualsInteger i1 57) (delay (lessThanEqualsInteger 48 i1)))) (delay (force (i2 (force (i4 (lessThanEqualsInteger i1 70) (delay (lessThanEqualsInteger 65 i1)))) (delay (force (i4 (lessThanEqualsInteger i1 102) (delay (lessThanEqualsInteger 97 i1)))))))))) (i6 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [49,50,51,52,53,54,55,56,57,48,97,98,99,100,101,102])) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +allandhexdigit.pisNoneHexDigit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i4 i1)))) (delay False))) (\i0 -> force (i2 (force (i4 (lessThanEqualsInteger i1 57) (delay (lessThanEqualsInteger 48 i1)))) (delay (force (i2 (force (i4 (lessThanEqualsInteger i1 70) (delay (lessThanEqualsInteger 65 i1)))) (delay (force (i4 (lessThanEqualsInteger i1 102) (delay (lessThanEqualsInteger 97 i1)))))))))) (i6 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [103,104,105,107,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,33,64,35,36,37,94,38,42,40,41,91,93,123,125,96,126])) (\i0 -> i4 i1 i2)) (delay True)) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ByteStringSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ByteStringSpec.hs new file mode 100644 index 000000000..8870240f3 --- /dev/null +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ByteStringSpec.hs @@ -0,0 +1,22 @@ +module Plutarch.Extra.ByteStringSpec (spec) where + +import Data.Char (ord) + +import Plutarch.Extra.ByteString (pallBS, pisHexDigit) + +import Plutarch.Prelude + +import Plutarch.ListSpec (integerList) + +import Plutarch.Test +import Test.Hspec + +spec :: Spec +spec = describe "extra.bytestring" . pgoldenSpec $ do + "allandhexdigit" @\ do + "allas" @| pallBS # plam (#== pconstant (toInteger $ ord 'a')) # pconstant "aaaaaaaaaaaaa" @-> passert + "not all as" @| pallBS # plam (#== pconstant (toInteger $ ord 'a')) # pconstant "aaaaaabaaaaa" @-> passertNot + "allhex" @| pallBS # pisHexDigit # pconstant "5a7c18eae8778d15344f" @-> passert + "notallhex" @| pallBS # pisHexDigit # pconstant "5a7c18eae8778g15344f" @-> passertNot + "pisHexDigit" @| pall @PList # pisHexDigit # integerList (toInteger . ord <$> "1234567890abcdef") @-> passert + "pisNoneHexDigit" @| pany @PList # pisHexDigit # integerList (toInteger . ord <$> "ghikjklmnopqrstuvwxyz !@#$%^&*()[]{}`~") @-> passertNot diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 778edf040..a56d4679c 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -155,6 +155,7 @@ executable plutarch-test Plutarch.ByteStringSpec Plutarch.EitherSpec Plutarch.Extra.ApiSpec + Plutarch.Extra.ByteStringSpec Plutarch.IntegerSpec Plutarch.LiftSpec Plutarch.ListSpec From f59fe88d270bacea39d1be0b13b0977267c140f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 19 Apr 2022 16:08:14 -0400 Subject: [PATCH 366/584] Added a couple missing instances --- Plutarch/Builtin.hs | 13 +++++++++++-- Plutarch/Show.hs | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 01aaaa809..9c8b4a16d 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -50,7 +50,7 @@ import Plutarch ( (#$), type (:-->), ) -import Plutarch.Bool (PBool (..), PEq, pif', (#==)) +import Plutarch.Bool (PBool (..), PEq, pif', (#&&), (#==)) import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) import Plutarch.Lift ( @@ -79,7 +79,7 @@ import Plutarch.List ( plistEquals, pshowList, ) -import Plutarch.Show (PShow (pshow')) +import Plutarch.Show (PShow (pshow'), pshow) import Plutarch.Unit (PUnit) import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce, punsafeFrom) import qualified PlutusCore as PLC @@ -342,6 +342,12 @@ instance PIsData (PBuiltinPair PData PData) where (coerce (pforgetData' @PData (Proxy @(Helper3 PBuiltinPair PData))) :: Term s (PAsData (PBuiltinPair (PAsData PData) PData)) -> Term s (PAsData (PBuiltinPair PData PData))) . coerce (pforgetData' @PData (Proxy @(Helper2 (PBuiltinPair (PAsData PData))))) +instance (PShow a, PShow b) => PShow (PBuiltinPair a b) where + pshow' _ pair = "(" <> pshow (pfstBuiltin # pair) <> "," <> pshow (psndBuiltin # pair) <> ")" + +instance (PEq a, PEq b) => PEq (PBuiltinPair a b) where + p1 #== p2 = pfstBuiltin # p1 #== pfstBuiltin # p2 #&& psndBuiltin # p1 #== psndBuiltin # p2 + instance PIsData PUnit where pfromData _ = pconstant () pdata _ = punsafeCoerce $ pconstant (Constr 0 []) @@ -361,6 +367,9 @@ instance (forall (s :: S). Coercible (a s) (Term s b), PIsData b) => PIsData (De target = pfromData $ pinnerData x pdata x = pouterData . pdata $ pto x +instance (PIsData a, PShow a) => PShow (PAsData a) where + pshow' w x = pshow' w (pfromData x) + pinnerData :: Term s (PAsData a) -> Term s (PAsData (PInner a b)) pinnerData = punsafeCoerce diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs index 9ae075a6d..4a6d10ac8 100644 --- a/Plutarch/Show.hs +++ b/Plutarch/Show.hs @@ -36,6 +36,7 @@ import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) import Plutarch.Internal.Other ( + DerivePNewtype, PlutusType, Term, perror, @@ -44,6 +45,7 @@ import Plutarch.Internal.Other ( plam, plet, pmatch, + pto, (#), (#$), type (:-->), @@ -147,6 +149,9 @@ instance PShow PByteString where , pconstant @PString $ T.pack $ intToDigit x : [] ) +instance PShow b => PShow (DerivePNewtype a b) where + pshow' w x = pshow' w (pto x) + -- | Case matching on bytestring, as if a list. pelimBS :: Term From a003107be9498a073b3269d9429faad8685bb333 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 19 Apr 2022 23:26:05 +0000 Subject: [PATCH 367/584] Remove some unsound `PIsData` behavior This also makes `PIsData` implementations require less `punsafeCoerce`. This doesn't fix all the issues unfortunately. We still have the issue that `Coercible a b => Coercible (Term s (PAsData a)) (Term s (PAsData b))`. This is obviously very unsound. --- Plutarch/Builtin.hs | 96 +++++++++++++++----------- Plutarch/DataRepr/Internal.hs | 16 +++-- Plutarch/DataRepr/Internal/Field.hs | 3 +- Plutarch/DataRepr/Internal/FromData.hs | 2 +- Plutarch/Internal/Other.hs | 5 +- Plutarch/Prelude.hs | 4 +- Plutarch/Rational.hs | 12 ++-- Plutarch/TryFrom.hs | 24 ++++++- plutarch.cabal | 2 + 9 files changed, 103 insertions(+), 61 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 39817087b..eb5fba4f5 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -20,9 +20,10 @@ module Plutarch.Builtin ( PBuiltinList (..), pdataLiteral, PIsData (..), + pdata, + pfromData, PAsData, pforgetData, - pforgetData', prememberData, prememberData', ppairDataBuiltin, @@ -35,6 +36,7 @@ import Data.Proxy (Proxy (Proxy)) import Plutarch ( DerivePNewtype, PInner, + POpaque, PType, PlutusType, S, @@ -98,7 +100,7 @@ import Plutarch.Reducible (Reducible (Reduce)) import Data.Functor.Const (Const) -import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast, pupcastF) +import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) -- | Plutus 'BuiltinPair' data PBuiltinPair (a :: PType) (b :: PType) (s :: S) @@ -243,7 +245,7 @@ instance PIsData a => PlutusType (PAsData a) where pcon' (PAsData t) = pforgetData $ pdata t pmatch' t f = f (PAsData $ pfromData $ punsafeCoerce t) -type role PAsDataLifted representational +type role PAsDataLifted nominal data PAsDataLifted (a :: PType) instance PConstantDecl (PAsDataLifted a) where @@ -257,11 +259,13 @@ instance PUnsafeLiftDecl (PAsData a) where type PLifted (PAsData a) = PAsDataLif pforgetData :: forall s a. Term s (PAsData a) -> Term s PData pforgetData = pupcast +-- FIXME: remove, broken + {- | Like 'pforgetData', except it works for complex types. Equivalent to 'pupcastF'. -} pforgetData' :: forall a (p :: PType -> PType) s. Proxy p -> Term s (p (PAsData a)) -> Term s (p PData) -pforgetData' = pupcastF +pforgetData' _ = punsafeCoerce -- | Inverse of 'pforgetData''. prememberData :: forall (p :: PType -> PType) s. Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) @@ -271,36 +275,47 @@ prememberData Proxy = punsafeCoerce prememberData' :: forall a (p :: PType -> PType) s. PSubtype PData a => Proxy p -> Term s (p a) -> Term s (p (PAsData a)) prememberData' Proxy = punsafeCoerce --- | Law: If @PSubtype PData a@, then @pdata a@ must be a no-op. +{- | Laws: + - If @PSubtype PData a@, then @pdataImpl a@ must be `pupcast`. + - pdataImpl . pupcast . pfromDataImpl ≡ id + - pfromDataImpl . punsafeDowncast . pdataImpl ≡ id +-} class PIsData a where - pfromData :: Term s (PAsData a) -> Term s a - pdata :: Term s a -> Term s (PAsData a) + pfromDataImpl :: Term s (PAsData a) -> Term s a + pdataImpl :: Term s a -> Term s PData + +pfromData :: PIsData a => Term s (PAsData a) -> Term s a +pfromData = pfromDataImpl +pdata :: PIsData a => Term s a -> Term s (PAsData a) +pdata = punsafeCoerce . pdataImpl instance PIsData PData where - pfromData = punsafeCoerce - pdata = punsafeCoerce + pfromDataImpl = pupcast + pdataImpl = id instance PIsData a => PIsData (PBuiltinList (PAsData a)) where - pfromData x = punsafeCoerce $ pasList # pforgetData x - pdata x = punsafeBuiltin PLC.ListData # x + pfromDataImpl x = punsafeCoerce $ pasList # pforgetData x + pdataImpl x = punsafeBuiltin PLC.ListData # x newtype Helper2 f a s = Helper2 (PAsData (f a) s) instance PIsData (PBuiltinList PData) where - pfromData = pforgetData' @PData (Proxy @PBuiltinList) . pfromData . coerce (prememberData (Proxy @(Helper2 PBuiltinList))) - pdata = coerce (pforgetData' @PData (Proxy @(Helper2 PBuiltinList))) . pdata . (prememberData (Proxy @PBuiltinList)) + pfromDataImpl = pforgetData' @PData (Proxy @PBuiltinList) . pfromData . coerce (prememberData (Proxy @(Helper2 PBuiltinList))) + + -- pdataImpl = coerce (pforgetData' @PData (Proxy @(Helper2 PBuiltinList))) . pdata . (prememberData (Proxy @PBuiltinList)) + pdataImpl = punsafeCoerce . pdata . (prememberData (Proxy @PBuiltinList)) -- FIXME instance PIsData (PBuiltinMap k v) where - pfromData x = punsafeCoerce $ pasMap # pforgetData x - pdata x = punsafeBuiltin PLC.MapData # x + pfromDataImpl x = punsafeCoerce $ pasMap # pforgetData x + pdataImpl x = punsafeBuiltin PLC.MapData # x instance PIsData PInteger where - pfromData x = pasInt # pforgetData x - pdata x = punsafeBuiltin PLC.IData # x + pfromDataImpl x = pasInt # pforgetData x + pdataImpl x = punsafeBuiltin PLC.IData # x instance PIsData PByteString where - pfromData x = pasByteStr # pforgetData x - pdata x = punsafeBuiltin PLC.BData # x + pfromDataImpl x = pasByteStr # pforgetData x + pdataImpl x = punsafeBuiltin PLC.BData # x {- | Instance for PBool following the Plutus IsData repr @@ -308,16 +323,16 @@ instance PIsData PByteString where which is used in 'TxInfo' via 'Closure'. -} instance PIsData PBool where - pfromData x = + pfromDataImpl x = (phoistAcyclic $ plam toBool) # pforgetData x where toBool :: Term s PData -> Term s PBool toBool d = pfstBuiltin # (pasConstr # d) #== 1 - pdata x = + pdataImpl x = (phoistAcyclic $ plam toData) # x where - toData :: Term s PBool -> Term s (PAsData PBool) + toData :: Term s PBool -> Term s PData toData b = punsafeBuiltin PLC.ConstrData # (pif' # b # 1 # (0 :: Term s PInteger)) @@ -328,12 +343,12 @@ instance PIsData PBool where -- | NB: `PAsData (PBuiltinPair (PAsData a) (PAsData b))` and `PAsData (PTuple a b)` have the same representation. instance PIsData (PBuiltinPair (PAsData a) (PAsData b)) where - pfromData x = f # x + pfromDataImpl x = f # x where f = phoistAcyclic $ plam $ \pairDat -> plet (psndBuiltin #$ pasConstr # pforgetData pairDat) $ \pd -> ppairDataBuiltin # punsafeCoerce (phead # pd) #$ punsafeCoerce (phead #$ ptail # pd) - pdata x = punsafeCoerce target + pdataImpl x = pupcast target where target :: Term _ (PAsData (PBuiltinPair PInteger (PBuiltinList PData))) target = f # punsafeCoerce x @@ -345,7 +360,7 @@ newtype Helper3 f b a s = Helper3 (PAsData (f a b) s) newtype Helper4 f b a s = Helper4 (f a b s) instance PIsData (PBuiltinPair PData PData) where - pfromData = f . pfromData . g + pfromDataImpl = f . pfromData . g where g :: Term s (PAsData (PBuiltinPair PData PData)) -> Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData))) g = @@ -356,7 +371,7 @@ instance PIsData (PBuiltinPair PData PData) where f = coerce (pforgetData' (Proxy @(Helper4 PBuiltinPair PData))) . (pforgetData' @PData (Proxy @(PBuiltinPair (PAsData PData)))) - pdata = f . pdata . g + pdataImpl = pupcast . f . pdata . g where g :: Term s (PBuiltinPair PData PData) -> Term s (PBuiltinPair (PAsData PData) (PAsData PData)) g = coerce (prememberData (Proxy @(Helper4 PBuiltinPair (PAsData PData)))) . prememberData (Proxy @(PBuiltinPair PData)) @@ -367,29 +382,26 @@ instance PIsData (PBuiltinPair PData PData) where . coerce (pforgetData' @PData (Proxy @(Helper2 (PBuiltinPair (PAsData PData))))) instance PIsData PUnit where - pfromData _ = pconstant () - pdata _ = punsafeCoerce $ pconstant (Constr 0 []) + pfromDataImpl _ = pconstant () + pdataImpl _ = pconstant (Constr 0 []) -- This instance is kind of useless. There's no safe way to use 'pdata'. instance PIsData (PBuiltinPair PInteger (PBuiltinList PData)) where - pfromData x = pasConstr # pforgetData x - pdata x' = plet x' $ \x -> pconstrBuiltin # (pfstBuiltin # x) #$ psndBuiltin # x + pfromDataImpl x = pasConstr # pupcast x + pdataImpl x' = pupcast $ plet x' $ \x -> pconstrBuiltin # (pfstBuiltin # x) #$ psndBuiltin # x instance PEq (PAsData a) where x #== y = punsafeBuiltin PLC.EqualsData # x # y -instance (forall (s :: S). Coercible (a s) (Term s b), PIsData b) => PIsData (DerivePNewtype a b) where - pfromData x = punsafeDowncast target - where - target :: Term _ b - target = pfromData $ pinnerData x - pdata x = pouterData . pdata $ pto x - -pinnerData :: Term s (PAsData a) -> Term s (PAsData (PInner a b)) -pinnerData = punsafeCoerce - -pouterData :: Term s (PAsData (PInner a b)) -> Term s (PAsData a) -pouterData = punsafeCoerce +instance + ( forall (s :: S). Coercible (a s) (Term s b) + , PInner a POpaque ~ b + , PIsData b + ) => + PIsData (DerivePNewtype a b) + where + pfromDataImpl x = punsafeDowncast $ (pfromDataImpl (punsafeCoerce x) :: Term _ b) + pdataImpl x = pdataImpl $ pto x pconstrBuiltin :: Term s (PInteger :--> PBuiltinList PData :--> PAsData (PBuiltinPair PInteger (PBuiltinList PData))) pconstrBuiltin = punsafeBuiltin $ PLC.ConstrData diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 56175f009..de6f92a5a 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -94,8 +94,10 @@ import Plutarch.Builtin ( pchooseListBuiltin, pconstrBuiltin, pdata, + pdataImpl, pforgetData, pfromData, + pfromDataImpl, pfstBuiltin, psndBuiltin, ) @@ -123,7 +125,7 @@ import Plutarch.Lift ( import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont (TermCont), hashOpenTerm, runTermCont, tcont, unTermCont) import Plutarch.Trace (ptraceError) -import Plutarch.TryFrom (PTryFrom, PTryFromExcess, ptryFrom, ptryFrom') +import Plutarch.TryFrom (PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) import Plutarch.Unit (PUnit (PUnit)) import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import qualified Plutus.V1.Ledger.Api as Ledger @@ -250,8 +252,8 @@ type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (name ':= a) = a instance {-# OVERLAPPABLE #-} PIsData (PDataRecord xs) where - pfromData x = punsafeCoerce $ (pfromData (punsafeCoerce x) :: Term _ (PBuiltinList PData)) - pdata x = punsafeCoerce $ pdata (punsafeCoerce x :: Term _ (PBuiltinList PData)) + pfromDataImpl x = punsafeCoerce $ (pfromData (punsafeCoerce x) :: Term _ (PBuiltinList PData)) + pdataImpl x = pupcast $ pdata (pupcast x :: Term _ (PBuiltinList PData)) {- | A sum of 'PDataRecord's. The underlying representation is the `Constr` constructor, where the integer is the index of the variant and the list is the record. @@ -277,8 +279,8 @@ instance target = punsafeCoerce d instance PIsData (PDataSum defs) where - pdata = punsafeCoerce - pfromData = punsafeCoerce + pfromDataImpl = punsafeCoerce + pdataImpl = punsafeCoerce instance PEq (PDataSum defs) where x #== y = pdata x #== pdata y @@ -538,8 +540,8 @@ mkLTEHandler = cana_NP (Proxy @(Compose POrd PDataRecord)) rer $ Const () newtype PIsDataReprInstances (a :: PType) (s :: S) = PIsDataReprInstances (a s) instance PIsDataRepr a => PIsData (PIsDataReprInstances a) where - pdata = punsafeCoerce - pfromData = punsafeCoerce + pfromDataImpl = punsafeCoerce + pdataImpl = punsafeCoerce instance PIsDataRepr a => PlutusType (PIsDataReprInstances a) where type PInner (PIsDataReprInstances a) _ = PDataSum (PIsDataReprRepr a) diff --git a/Plutarch/DataRepr/Internal/Field.hs b/Plutarch/DataRepr/Internal/Field.hs index 71a1eb523..ab9a6f4fa 100644 --- a/Plutarch/DataRepr/Internal/Field.hs +++ b/Plutarch/DataRepr/Internal/Field.hs @@ -38,7 +38,8 @@ import Plutarch ( import Plutarch.Builtin ( PAsData, - PIsData (pfromData), + PIsData, + pfromData, ) import Plutarch.DataRepr.Internal ( PDataRecord, diff --git a/Plutarch/DataRepr/Internal/FromData.hs b/Plutarch/DataRepr/Internal/FromData.hs index 77874b1d4..4d2b0e0a6 100644 --- a/Plutarch/DataRepr/Internal/FromData.hs +++ b/Plutarch/DataRepr/Internal/FromData.hs @@ -5,7 +5,7 @@ module Plutarch.DataRepr.Internal.FromData (PFromDataable, pmaybeFromAsData) whe import Plutarch.Internal.Other (PType, Term) -import Plutarch.Builtin (PAsData, PIsData (pfromData)) +import Plutarch.Builtin (PAsData, PIsData, pfromData) {- | removes the PAsData if the hole requires it but leaves it diff --git a/Plutarch/Internal/Other.hs b/Plutarch/Internal/Other.hs index b922d1981..8b8a77bcf 100644 --- a/Plutarch/Internal/Other.hs +++ b/Plutarch/Internal/Other.hs @@ -1,7 +1,4 @@ {-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE DefaultSignatures #-} -{-# LANGUAGE FunctionalDependencies #-} -{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.Internal.Other ( @@ -114,6 +111,8 @@ where 'PBar' has a 'PIsData' instance, you can derive 'PlutusType' and 'PIsData' This will make 'PFoo' simply be represnted as 'PBar' under the hood. -} +type role DerivePNewtype representational representational nominal + newtype DerivePNewtype (a :: PType) (b :: PType) (s :: PI.S) = DerivePNewtype (a s) instance (forall (s :: PI.S). Coercible (a s) (Term s b)) => PlutusType (DerivePNewtype a b) where diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 6a71a5119..694ae9ef9 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -107,7 +107,9 @@ module Plutarch.Prelude ( psndBuiltin, PBuiltinPair, PBuiltinList (..), - PIsData (pfromData, pdata), + PIsData, + pfromData, + pdata, PAsData, -- * DataRepr and related functions diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 6f570ba92..ed6140c97 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -30,10 +30,13 @@ import Plutarch.Builtin ( PAsData, PBuiltinList, PData, - PIsData (..), + PIsData, pasInt, pasList, + pdata, + pdataImpl, pforgetData, + pfromDataImpl, ) import Plutarch.Integer (PInteger, PIntegral (pdiv, pmod)) import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) @@ -56,12 +59,11 @@ instance PShow PRational where pshow x <> "/" <> pshow y instance PIsData PRational where - pfromData x' = phoistAcyclic (plam $ \x -> pListToRat #$ pmap # pasInt #$ pasList # pforgetData x) # x' - pdata x' = + pfromDataImpl x' = phoistAcyclic (plam $ \x -> pListToRat #$ pmap # pasInt #$ pasList # pforgetData x) # x' + pdataImpl x' = phoistAcyclic ( plam $ \x -> - (punsafeCoerce :: Term _ (PAsData (PBuiltinList (PAsData PInteger))) -> Term _ (PAsData PRational)) $ - pdata $ pRatToList # x + punsafeCoerce (pdata $ pRatToList # x :: Term _ (PAsData (PBuiltinList (PAsData PInteger)))) ) # x' diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index bfd65a4a1..b5f619641 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -6,6 +6,9 @@ module Plutarch.TryFrom ( PSubtype, pupcast, pupcastF, + pdowncastF, + POp (..), + POpArrow (..), ) where import Data.Coerce (Coercible) @@ -19,6 +22,7 @@ import Plutarch.Internal.Other ( POpaque, PType, Term, + (:-->), ) import Plutarch.Reducible (Reducible (Reduce)) @@ -73,5 +77,23 @@ instance pupcast :: PSubtype a b => Term s b -> Term s a pupcast = punsafeCoerce -pupcastF :: forall a b (p :: PType -> PType) s. PSubtype a b => Proxy p -> Term s (p b) -> Term s (p a) +-- FIXME: Add safe way of deriving using `PlutusType` +class PUnsafeContravariantDecl (a :: PType -> PType) +type PContravariant = PUnsafeContravariantDecl + +-- FIXME: Add safe way of deriving using `PlutusType` +class PUnsafeCovariantDecl (a :: PType -> PType) +type PCovariant = PUnsafeCovariantDecl -- Really just PFunctor + +newtype POpArrow b a s = POpArrow (Term s a -> Term s b) +newtype POp b a s = POp ((a :--> b) s) + +instance PUnsafeContravariantDecl (POpArrow b) +instance PUnsafeContravariantDecl (POp b) +instance PUnsafeCovariantDecl ((:-->) a) + +pupcastF :: forall a b (p :: PType -> PType) s. (PSubtype a b, PCovariant p) => Proxy p -> Term s (p b) -> Term s (p a) pupcastF _ = punsafeCoerce + +pdowncastF :: forall a b (p :: PType -> PType) s. (PSubtype a b, PContravariant p) => Proxy p -> Term s (p a) -> Term s (p b) +pdowncastF _ = punsafeCoerce diff --git a/plutarch.cabal b/plutarch.cabal index faceb4a1c..d314ef076 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -19,6 +19,7 @@ common c ConstrainedClassMethods ConstraintKinds DataKinds + DefaultSignatures DeriveAnyClass DeriveDataTypeable DeriveFoldable @@ -58,6 +59,7 @@ common c QuantifiedConstraints RankNTypes RelaxedPolyRec + RoleAnnotations ScopedTypeVariables StandaloneDeriving StandaloneKindSignatures From a4a2ce48da8a9adad40681e8934ca17ebacf1937 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 19 Apr 2022 23:44:11 +0000 Subject: [PATCH 368/584] Add `PTryFrom` to prelude and fix tests --- Plutarch/Prelude.hs | 5 +++++ plutarch-test/conditional/Plutarch/TryFromSpec.hs | 2 -- plutarch-test/plutarch-base/Plutarch/RecSpec.hs | 14 +++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 694ae9ef9..2b13ace67 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -152,6 +152,10 @@ module Plutarch.Prelude ( TermCont (TermCont, runTermCont), unTermCont, tcont, + pupcast, + ptryFrom, + PTryFrom, + PSubtype, ) where import Prelude () @@ -175,4 +179,5 @@ import Plutarch.Show import Plutarch.String import Plutarch.TermCont import Plutarch.Trace +import Plutarch.TryFrom import Plutarch.Unit diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 9e29f135a..a87f99d7d 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -57,9 +57,7 @@ import Plutarch.Builtin ( ) import Plutarch.TryFrom ( - PTryFrom, PTryFromExcess, - ptryFrom, ptryFrom', ) diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index 1025f248a..67024cb0b 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -7,7 +7,7 @@ import qualified Rank2.TH import Prelude hiding (even, odd) import Plutarch (pcon', pmatch') -import Plutarch.Builtin (pasConstr, pforgetData) +import Plutarch.Builtin (pasConstr, pdataImpl, pforgetData, pfromDataImpl) import Plutarch.Prelude import Plutarch.Rec ( DataReader (DataReader, readData), @@ -67,16 +67,16 @@ instance RecordFromData FlatOuterRecord instance RecordFromData ShallowOuterRecord instance PIsData (PRecord SampleRecord) where - pfromData = readData (recordFromFieldReaders sampleReader) - pdata = writeData (recordDataFromFieldWriters sampleWriter) + pfromDataImpl = readData (recordFromFieldReaders sampleReader) + pdataImpl = pupcast . writeData (recordDataFromFieldWriters sampleWriter) instance PIsData (PRecord FlatOuterRecord) where - pfromData = readData (recordFromFieldReaders flatOuterReader) - pdata = writeData (recordDataFromFieldWriters flatOuterWriter) + pfromDataImpl = readData (recordFromFieldReaders flatOuterReader) + pdataImpl = pupcast . writeData (recordDataFromFieldWriters flatOuterWriter) instance PIsData (PRecord ShallowOuterRecord) where - pfromData = readData (recordFromFieldReaders shallowOuterReader) - pdata = writeData (recordDataFromFieldWriters shallowOuterWriter) + pfromDataImpl = readData (recordFromFieldReaders shallowOuterReader) + pdataImpl = pupcast . writeData (recordDataFromFieldWriters shallowOuterWriter) sampleReader :: SampleRecord (DataReader s) sampleReader = From 94a441dceea6575e7896a40b3d582cfc8c992e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 20 Apr 2022 10:24:56 -0400 Subject: [PATCH 369/584] Refined the granularity of RecSpec goldens --- .../goldens/rec.Data.dev=false.bench.golden | 8 +++ .../rec.Data.dev=false.uplc.eval.golden | 22 +++++++ .../goldens/rec.Data.dev=false.uplc.golden | 8 +++ .../goldens/rec.Data.dev=true.bench.golden | 8 +++ .../rec.Data.dev=true.uplc.eval.golden | 22 +++++++ .../goldens/rec.Data.dev=true.uplc.golden | 8 +++ .../goldens/rec.LetRec.dev=false.bench.golden | 5 ++ .../rec.LetRec.dev=false.uplc.eval.golden | 5 ++ .../goldens/rec.LetRec.dev=false.uplc.golden | 5 ++ .../goldens/rec.LetRec.dev=true.bench.golden | 5 ++ .../rec.LetRec.dev=true.uplc.eval.golden | 5 ++ .../goldens/rec.LetRec.dev=true.uplc.golden | 5 ++ .../goldens/rec.dev=false.bench.golden | 45 -------------- .../goldens/rec.dev=false.uplc.eval.golden | 59 ------------------- .../goldens/rec.dev=false.uplc.golden | 45 -------------- .../goldens/rec.dev=true.bench.golden | 45 -------------- .../goldens/rec.dev=true.uplc.eval.golden | 59 ------------------- .../goldens/rec.dev=true.uplc.golden | 45 -------------- .../goldens/rec.nested.dev=false.bench.golden | 22 +++++++ .../rec.nested.dev=false.uplc.eval.golden | 22 +++++++ .../goldens/rec.nested.dev=false.uplc.golden | 22 +++++++ .../goldens/rec.nested.dev=true.bench.golden | 22 +++++++ .../rec.nested.dev=true.uplc.eval.golden | 22 +++++++ .../goldens/rec.nested.dev=true.uplc.golden | 22 +++++++ .../goldens/rec.simple.dev=false.bench.golden | 10 ++++ .../rec.simple.dev=false.uplc.eval.golden | 10 ++++ .../goldens/rec.simple.dev=false.uplc.golden | 10 ++++ .../goldens/rec.simple.dev=true.bench.golden | 10 ++++ .../rec.simple.dev=true.uplc.eval.golden | 10 ++++ .../goldens/rec.simple.dev=true.uplc.golden | 10 ++++ .../plutarch-base/Plutarch/RecSpec.hs | 10 ++-- 31 files changed, 303 insertions(+), 303 deletions(-) create mode 100644 plutarch-test/goldens/rec.Data.dev=false.bench.golden create mode 100644 plutarch-test/goldens/rec.Data.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.Data.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/rec.Data.dev=true.bench.golden create mode 100644 plutarch-test/goldens/rec.Data.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.Data.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/rec.LetRec.dev=false.bench.golden create mode 100644 plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/rec.LetRec.dev=true.bench.golden create mode 100644 plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/rec.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/rec.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/rec.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/rec.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/rec.nested.dev=false.bench.golden create mode 100644 plutarch-test/goldens/rec.nested.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.nested.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/rec.nested.dev=true.bench.golden create mode 100644 plutarch-test/goldens/rec.nested.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.nested.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/rec.simple.dev=false.bench.golden create mode 100644 plutarch-test/goldens/rec.simple.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.simple.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/rec.simple.dev=true.bench.golden create mode 100644 plutarch-test/goldens/rec.simple.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.simple.dev=true.uplc.golden diff --git a/plutarch-test/goldens/rec.Data.dev=false.bench.golden b/plutarch-test/goldens/rec.Data.dev=false.bench.golden new file mode 100644 index 000000000..eea3aeb86 --- /dev/null +++ b/plutarch-test/goldens/rec.Data.dev=false.bench.golden @@ -0,0 +1,8 @@ +pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} +pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} +pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} +pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} +fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":36} +fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":48} +fieldFromData.nested.shallow {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":115} +pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":83} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.Data.dev=false.uplc.eval.golden new file mode 100644 index 000000000..36500794c --- /dev/null +++ b/plutarch-test/goldens/rec.Data.dev=false.uplc.eval.golden @@ -0,0 +1,22 @@ +pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) +pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) +pdata.flat-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d87980 + , #06 + , #4d53616c75742c204d6f6e646521 + , #04 + , #d87980 + , #09 + , #4d53616c75742c204d6f6e646521 + , #4c486f6c612c204d756e646f21 ] )) +pdata.shallow-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d8799fd87980064d53616c75742c204d6f6e646521ff + , #04 + , #d8799fd87980094d53616c75742c204d6f6e646521ff + , #4c486f6c612c204d756e646f21 ] )) +fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) +fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1)))) +fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) +pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=false.uplc.golden b/plutarch-test/goldens/rec.Data.dev=false.uplc.golden new file mode 100644 index 000000000..2e016894d --- /dev/null +++ b/plutarch-test/goldens/rec.Data.dev=false.uplc.golden @@ -0,0 +1,8 @@ +pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) +pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) +pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) +pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) +fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) +fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1))) (force tailList))) +fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) +pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=true.bench.golden b/plutarch-test/goldens/rec.Data.dev=true.bench.golden new file mode 100644 index 000000000..431a50a72 --- /dev/null +++ b/plutarch-test/goldens/rec.Data.dev=true.bench.golden @@ -0,0 +1,8 @@ +pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} +pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} +pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} +pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} +fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":72} +fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":84} +fieldFromData.nested.shallow {"exBudgetCPU":893290,"exBudgetMemory":3100,"scriptSizeBytes":161} +pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":118} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.Data.dev=true.uplc.eval.golden new file mode 100644 index 000000000..54d6a5011 --- /dev/null +++ b/plutarch-test/goldens/rec.Data.dev=true.uplc.eval.golden @@ -0,0 +1,22 @@ +pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) +pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) +pdata.flat-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d87980 + , #06 + , #4d53616c75742c204d6f6e646521 + , #04 + , #d87980 + , #09 + , #4d53616c75742c204d6f6e646521 + , #4c486f6c612c204d756e646f21 ] )) +pdata.shallow-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d8799fd87980064d53616c75742c204d6f6e646521ff + , #04 + , #d8799fd87980094d53616c75742c204d6f6e646521ff + , #4c486f6c612c204d756e646f21 ] )) +fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) +pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=true.uplc.golden b/plutarch-test/goldens/rec.Data.dev=true.uplc.golden new file mode 100644 index 000000000..8c43e91d7 --- /dev/null +++ b/plutarch-test/goldens/rec.Data.dev=true.uplc.golden @@ -0,0 +1,8 @@ +pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) +pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) +pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) +pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) +fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1))) (force tailList))) +fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay (force (i9 i10 (delay error)))))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay (force (i8 i9 (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (force trace)) "verifySoleConstructor failed")) +pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden b/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden new file mode 100644 index 000000000..7f649ff41 --- /dev/null +++ b/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden @@ -0,0 +1,5 @@ +record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} +even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} +even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden new file mode 100644 index 000000000..4f913af0b --- /dev/null +++ b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden @@ -0,0 +1,5 @@ +record (program 1.0.0 12) +record-field (program 1.0.0 12) +even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) +even.4 (program 1.0.0 True) +even.5 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden new file mode 100644 index 000000000..3ff762cad --- /dev/null +++ b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden @@ -0,0 +1,5 @@ +record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) +even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) +even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden b/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden new file mode 100644 index 000000000..7f649ff41 --- /dev/null +++ b/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden @@ -0,0 +1,5 @@ +record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} +even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} +even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden new file mode 100644 index 000000000..4f913af0b --- /dev/null +++ b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden @@ -0,0 +1,5 @@ +record (program 1.0.0 12) +record-field (program 1.0.0 12) +even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) +even.4 (program 1.0.0 True) +even.5 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden new file mode 100644 index 000000000..3ff762cad --- /dev/null +++ b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden @@ -0,0 +1,5 @@ +record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) +even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) +even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=false.bench.golden b/plutarch-test/goldens/rec.dev=false.bench.golden deleted file mode 100644 index 2d9ec6b78..000000000 --- a/plutarch-test/goldens/rec.dev=false.bench.golden +++ /dev/null @@ -1,45 +0,0 @@ -simple.constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -simple.constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -simple.constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -simple.field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} -simple.reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} -LetRec.record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -LetRec.record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -LetRec.even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} -LetRec.even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} -LetRec.even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} -nested.flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} -nested.flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} -nested.flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} -nested.flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -nested.flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -nested.shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} -nested.shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} -nested.shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} -nested.shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} -nested.shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -Data.pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} -Data.pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} -Data.pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} -Data.pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} -Data.fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":36} -Data.fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":48} -Data.fieldFromData.nested.shallow {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":115} -Data.pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":83} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.dev=false.uplc.eval.golden deleted file mode 100644 index 756e9884a..000000000 --- a/plutarch-test/goldens/rec.dev=false.uplc.eval.golden +++ /dev/null @@ -1,59 +0,0 @@ -simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.field.access-term (program 1.0.0 6) -simple.field.value.direct-access (program 1.0.0 6) -simple.field.value.pmatch (program 1.0.0 "Salut, Monde!") -simple.field.value.pmatch' (program 1.0.0 "Salut, Monde!") -simple.field.value.rmatch (program 1.0.0 "Salut, Monde!") -simple.reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.reconstr.field-access (program 1.0.0 6) -LetRec.record (program 1.0.0 12) -LetRec.record-field (program 1.0.0 12) -LetRec.even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) -LetRec.even.4 (program 1.0.0 True) -LetRec.even.5 (program 1.0.0 False) -nested.flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -nested.flat.nested-field-access (program 1.0.0 9) -nested.flat.nested-field-value.direct-access (program 1.0.0 9) -nested.flat.nested-field-value.pmatch (program 1.0.0 9) -nested.flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -nested.flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -nested.flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -nested.flat.reconstr-nested-field-value (program 1.0.0 9) -nested.flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -nested.flat.nested-match-term (program 1.0.0 "Salut, Monde!") -nested.flat.nested-match-value (program 1.0.0 "Salut, Monde!") -nested.shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -nested.shallow.nested-field-access (program 1.0.0 9) -nested.shallow.nested-field-value.direct-access (program 1.0.0 9) -nested.shallow.nested-field-value.pmatch (program 1.0.0 9) -nested.shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -nested.shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -nested.shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -nested.shallow.reconstr-nested-field-value (program 1.0.0 9) -nested.shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -nested.shallow.nested-match-term (program 1.0.0 "Salut, Monde!") -nested.shallow.nested-match-value (program 1.0.0 "Salut, Monde!") -Data.pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) -Data.pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) -Data.pdata.flat-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d87980 - , #06 - , #4d53616c75742c204d6f6e646521 - , #04 - , #d87980 - , #09 - , #4d53616c75742c204d6f6e646521 - , #4c486f6c612c204d756e646f21 ] )) -Data.pdata.shallow-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d8799fd87980064d53616c75742c204d6f6e646521ff - , #04 - , #d8799fd87980094d53616c75742c204d6f6e646521ff - , #4c486f6c612c204d756e646f21 ] )) -Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) -Data.fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1)))) -Data.fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) -Data.pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=false.uplc.golden b/plutarch-test/goldens/rec.dev=false.uplc.golden deleted file mode 100644 index 6c7a400f5..000000000 --- a/plutarch-test/goldens/rec.dev=false.uplc.golden +++ /dev/null @@ -1,45 +0,0 @@ -simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -simple.field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -simple.field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -simple.field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -simple.field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -simple.reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) -simple.reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) -LetRec.record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -LetRec.record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -LetRec.even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) -LetRec.even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) -LetRec.even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) -nested.flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) -nested.flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) -nested.flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) -nested.flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) -nested.shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) -nested.shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) -nested.shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) -nested.shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -Data.pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) -Data.pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) -Data.pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) -Data.pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) -Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) -Data.fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1))) (force tailList))) -Data.fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) -Data.pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.bench.golden b/plutarch-test/goldens/rec.dev=true.bench.golden deleted file mode 100644 index c1d0f244d..000000000 --- a/plutarch-test/goldens/rec.dev=true.bench.golden +++ /dev/null @@ -1,45 +0,0 @@ -simple.constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -simple.constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -simple.constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -simple.field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} -simple.reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} -LetRec.record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -LetRec.record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -LetRec.even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} -LetRec.even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} -LetRec.even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} -nested.flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} -nested.flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} -nested.flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} -nested.flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -nested.flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -nested.shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} -nested.shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} -nested.shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} -nested.shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} -nested.shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -Data.pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} -Data.pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} -Data.pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} -Data.pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} -Data.fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":72} -Data.fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":84} -Data.fieldFromData.nested.shallow {"exBudgetCPU":893290,"exBudgetMemory":3100,"scriptSizeBytes":161} -Data.pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":118} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.dev=true.uplc.eval.golden deleted file mode 100644 index 16ab3b629..000000000 --- a/plutarch-test/goldens/rec.dev=true.uplc.eval.golden +++ /dev/null @@ -1,59 +0,0 @@ -simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.field.access-term (program 1.0.0 6) -simple.field.value.direct-access (program 1.0.0 6) -simple.field.value.pmatch (program 1.0.0 "Salut, Monde!") -simple.field.value.pmatch' (program 1.0.0 "Salut, Monde!") -simple.field.value.rmatch (program 1.0.0 "Salut, Monde!") -simple.reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.reconstr.field-access (program 1.0.0 6) -LetRec.record (program 1.0.0 12) -LetRec.record-field (program 1.0.0 12) -LetRec.even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) -LetRec.even.4 (program 1.0.0 True) -LetRec.even.5 (program 1.0.0 False) -nested.flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -nested.flat.nested-field-access (program 1.0.0 9) -nested.flat.nested-field-value.direct-access (program 1.0.0 9) -nested.flat.nested-field-value.pmatch (program 1.0.0 9) -nested.flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -nested.flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -nested.flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -nested.flat.reconstr-nested-field-value (program 1.0.0 9) -nested.flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -nested.flat.nested-match-term (program 1.0.0 "Salut, Monde!") -nested.flat.nested-match-value (program 1.0.0 "Salut, Monde!") -nested.shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -nested.shallow.nested-field-access (program 1.0.0 9) -nested.shallow.nested-field-value.direct-access (program 1.0.0 9) -nested.shallow.nested-field-value.pmatch (program 1.0.0 9) -nested.shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -nested.shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -nested.shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -nested.shallow.reconstr-nested-field-value (program 1.0.0 9) -nested.shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -nested.shallow.nested-match-term (program 1.0.0 "Salut, Monde!") -nested.shallow.nested-match-value (program 1.0.0 "Salut, Monde!") -Data.pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) -Data.pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) -Data.pdata.flat-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d87980 - , #06 - , #4d53616c75742c204d6f6e646521 - , #04 - , #d87980 - , #09 - , #4d53616c75742c204d6f6e646521 - , #4c486f6c612c204d756e646f21 ] )) -Data.pdata.shallow-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d8799fd87980064d53616c75742c204d6f6e646521ff - , #04 - , #d8799fd87980094d53616c75742c204d6f6e646521ff - , #4c486f6c612c204d756e646f21 ] )) -Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) -Data.fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) -Data.fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) -Data.pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.golden b/plutarch-test/goldens/rec.dev=true.uplc.golden deleted file mode 100644 index 772f9ecfb..000000000 --- a/plutarch-test/goldens/rec.dev=true.uplc.golden +++ /dev/null @@ -1,45 +0,0 @@ -simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -simple.field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -simple.field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -simple.field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -simple.field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -simple.reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) -simple.reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) -LetRec.record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -LetRec.record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -LetRec.even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) -LetRec.even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) -LetRec.even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) -nested.flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) -nested.flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) -nested.flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) -nested.flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) -nested.shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) -nested.shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) -nested.shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) -nested.shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -Data.pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) -Data.pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) -Data.pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) -Data.pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) -Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) -Data.fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1))) (force tailList))) -Data.fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay (force (i9 i10 (delay error)))))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay (force (i8 i9 (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (force trace)) "verifySoleConstructor failed")) -Data.pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=false.bench.golden b/plutarch-test/goldens/rec.nested.dev=false.bench.golden new file mode 100644 index 000000000..bdece172a --- /dev/null +++ b/plutarch-test/goldens/rec.nested.dev=false.bench.golden @@ -0,0 +1,22 @@ +flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} +flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} +flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} +flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} +shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} +shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} +shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} +shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.nested.dev=false.uplc.eval.golden new file mode 100644 index 000000000..5806523da --- /dev/null +++ b/plutarch-test/goldens/rec.nested.dev=false.uplc.eval.golden @@ -0,0 +1,22 @@ +flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +flat.nested-field-access (program 1.0.0 9) +flat.nested-field-value.direct-access (program 1.0.0 9) +flat.nested-field-value.pmatch (program 1.0.0 9) +flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +flat.reconstr-nested-field-value (program 1.0.0 9) +flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +flat.nested-match-term (program 1.0.0 "Salut, Monde!") +flat.nested-match-value (program 1.0.0 "Salut, Monde!") +shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +shallow.nested-field-access (program 1.0.0 9) +shallow.nested-field-value.direct-access (program 1.0.0 9) +shallow.nested-field-value.pmatch (program 1.0.0 9) +shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +shallow.reconstr-nested-field-value (program 1.0.0 9) +shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +shallow.nested-match-term (program 1.0.0 "Salut, Monde!") +shallow.nested-match-value (program 1.0.0 "Salut, Monde!") \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=false.uplc.golden b/plutarch-test/goldens/rec.nested.dev=false.uplc.golden new file mode 100644 index 000000000..b776b3b33 --- /dev/null +++ b/plutarch-test/goldens/rec.nested.dev=false.uplc.golden @@ -0,0 +1,22 @@ +flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) +flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) +flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) +flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) +shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) +shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) +shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) +shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=true.bench.golden b/plutarch-test/goldens/rec.nested.dev=true.bench.golden new file mode 100644 index 000000000..bdece172a --- /dev/null +++ b/plutarch-test/goldens/rec.nested.dev=true.bench.golden @@ -0,0 +1,22 @@ +flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} +flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} +flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} +flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} +shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} +shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} +shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} +shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.nested.dev=true.uplc.eval.golden new file mode 100644 index 000000000..5806523da --- /dev/null +++ b/plutarch-test/goldens/rec.nested.dev=true.uplc.eval.golden @@ -0,0 +1,22 @@ +flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +flat.nested-field-access (program 1.0.0 9) +flat.nested-field-value.direct-access (program 1.0.0 9) +flat.nested-field-value.pmatch (program 1.0.0 9) +flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +flat.reconstr-nested-field-value (program 1.0.0 9) +flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +flat.nested-match-term (program 1.0.0 "Salut, Monde!") +flat.nested-match-value (program 1.0.0 "Salut, Monde!") +shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +shallow.nested-field-access (program 1.0.0 9) +shallow.nested-field-value.direct-access (program 1.0.0 9) +shallow.nested-field-value.pmatch (program 1.0.0 9) +shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +shallow.reconstr-nested-field-value (program 1.0.0 9) +shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +shallow.nested-match-term (program 1.0.0 "Salut, Monde!") +shallow.nested-match-value (program 1.0.0 "Salut, Monde!") \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=true.uplc.golden b/plutarch-test/goldens/rec.nested.dev=true.uplc.golden new file mode 100644 index 000000000..b776b3b33 --- /dev/null +++ b/plutarch-test/goldens/rec.nested.dev=true.uplc.golden @@ -0,0 +1,22 @@ +flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) +flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) +flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) +flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) +shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) +shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) +shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) +shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=false.bench.golden b/plutarch-test/goldens/rec.simple.dev=false.bench.golden new file mode 100644 index 000000000..78a06fe15 --- /dev/null +++ b/plutarch-test/goldens/rec.simple.dev=false.bench.golden @@ -0,0 +1,10 @@ +constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} +reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.simple.dev=false.uplc.eval.golden new file mode 100644 index 000000000..29a355d8e --- /dev/null +++ b/plutarch-test/goldens/rec.simple.dev=false.uplc.eval.golden @@ -0,0 +1,10 @@ +constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +field.access-term (program 1.0.0 6) +field.value.direct-access (program 1.0.0 6) +field.value.pmatch (program 1.0.0 "Salut, Monde!") +field.value.pmatch' (program 1.0.0 "Salut, Monde!") +field.value.rmatch (program 1.0.0 "Salut, Monde!") +reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +reconstr.field-access (program 1.0.0 6) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=false.uplc.golden b/plutarch-test/goldens/rec.simple.dev=false.uplc.golden new file mode 100644 index 000000000..f609e3d38 --- /dev/null +++ b/plutarch-test/goldens/rec.simple.dev=false.uplc.golden @@ -0,0 +1,10 @@ +constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) +reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=true.bench.golden b/plutarch-test/goldens/rec.simple.dev=true.bench.golden new file mode 100644 index 000000000..78a06fe15 --- /dev/null +++ b/plutarch-test/goldens/rec.simple.dev=true.bench.golden @@ -0,0 +1,10 @@ +constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} +reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.simple.dev=true.uplc.eval.golden new file mode 100644 index 000000000..29a355d8e --- /dev/null +++ b/plutarch-test/goldens/rec.simple.dev=true.uplc.eval.golden @@ -0,0 +1,10 @@ +constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +field.access-term (program 1.0.0 6) +field.value.direct-access (program 1.0.0 6) +field.value.pmatch (program 1.0.0 "Salut, Monde!") +field.value.pmatch' (program 1.0.0 "Salut, Monde!") +field.value.rmatch (program 1.0.0 "Salut, Monde!") +reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +reconstr.field-access (program 1.0.0 6) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=true.uplc.golden b/plutarch-test/goldens/rec.simple.dev=true.uplc.golden new file mode 100644 index 000000000..f609e3d38 --- /dev/null +++ b/plutarch-test/goldens/rec.simple.dev=true.uplc.golden @@ -0,0 +1,10 @@ +constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) +reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index 2380aa772..e41371583 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -210,8 +210,8 @@ spec :: Spec spec = do -- Plutarch.Rec.verifySoleConstructor uses tracing, so we must create two sets -- of golden. - describe "rec" . plutarchDevFlagDescribe . pgoldenSpec $ do - "simple" @\ do + describe "rec" $ do + describe "simple" . plutarchDevFlagDescribe . pgoldenSpec $ do -- Record construction "constr" @\ do "pcon" @| sampleRecord'' @@ -229,13 +229,13 @@ spec = do "pcon" @| pmatch' sampleRecord' (pcon @(PRecord SampleRecord)) -- reconstructed field access "field-access" @| pto (pmatch' sampleRecord' (pcon @(PRecord SampleRecord))) # field sampleInt - "LetRec" @\ do + describe "LetRec" . plutarchDevFlagDescribe . pgoldenSpec $ do "record" @| sampleRecur # field sampleInt "record-field" @| sampleRecur # field sampleInt "even" @| evenOdd # field even "even.4" @| evenOdd # field even # (4 :: Term s PInteger) "even.5" @| evenOdd # field even # (5 :: Term s PInteger) - "nested" @\ do + describe "nested" . plutarchDevFlagDescribe . pgoldenSpec $ do "flat" @\ do "reconstr-with-rcon" @| sampleFlatOuter "nested-field-access" @| sampleFlatOuter # field (sampleInt . flatInner2) @@ -293,7 +293,7 @@ spec = do $ \(PRecord ShallowOuterRecord {shallowInner2}) -> pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> sampleString - "Data" @\ do + describe "Data" . plutarchDevFlagDescribe . pgoldenSpec $ do "pdata" @\ do "simple" @| sampleData "simple-value-deconstructed" @| pasConstr # pforgetData sampleData From e67048782ef521d43a84469e0d6944529656f185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 20 Apr 2022 17:47:36 -0400 Subject: [PATCH 370/584] Fix and test for open mutually-recursive functions --- Plutarch/Rec.hs | 10 +++++----- .../goldens/rec.LetRec.dev=false.bench.golden | 5 ++++- .../goldens/rec.LetRec.dev=false.uplc.eval.golden | 5 ++++- plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden | 5 ++++- plutarch-test/goldens/rec.LetRec.dev=true.bench.golden | 5 ++++- .../goldens/rec.LetRec.dev=true.uplc.eval.golden | 5 ++++- plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden | 5 ++++- plutarch-test/plutarch-base/Plutarch/RecSpec.hs | 10 ++++++++++ 8 files changed, 39 insertions(+), 11 deletions(-) diff --git a/Plutarch/Rec.hs b/Plutarch/Rec.hs index 03eb77638..d7f90bc31 100644 --- a/Plutarch/Rec.hs +++ b/Plutarch/Rec.hs @@ -95,12 +95,12 @@ letrec r = Term term where term n = TermResult {getTerm = RApply rfix [RLamAbs 1 $ RApply (RVar 0) $ rawTerms], getDeps = deps} where - (Dual rawTerms, deps) = Rank2.foldMap (rawResult . ($ n) . asRawTerm) (r selfReferring) + (Dual rawTerms, deps) = Rank2.foldMap (rawResult . ($ n+2) . asRawTerm) (r selfReferring) + selfReferring = Rank2.fmap fromRecord accessors + fromRecord :: ScottArgument r s a -> Term s a + fromRecord (ScottArgument (Term access)) = + Term $ \depth -> mapTerm (\field -> RApply (RVar $ depth - n - 1) [field]) (access 0) rawResult TermResult {getTerm, getDeps} = (Dual [getTerm], getDeps) - selfReferring = Rank2.fmap fromRecord accessors - fromRecord :: ScottArgument r s a -> Term s a - fromRecord (ScottArgument (Term access)) = - Term $ \depth -> mapTerm (\field -> RApply (RVar $ fieldCount (initial @r) + depth - 1) [field]) (access 0) -- | Converts a Haskell field function to a Scott-encoded record field accessor. field :: diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden b/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden index 7f649ff41..87f87948c 100644 --- a/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden +++ b/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden @@ -2,4 +2,7 @@ record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} -even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} \ No newline at end of file +even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} +knownEven {"exBudgetCPU":863517,"exBudgetMemory":3000,"scriptSizeBytes":85} +knownEven.6 {"exBudgetCPU":4589296,"exBudgetMemory":12810,"scriptSizeBytes":87} +knownEven.7 {"exBudgetCPU":6115294,"exBudgetMemory":16814,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden index 4f913af0b..1ccb10873 100644 --- a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden @@ -2,4 +2,7 @@ record (program 1.0.0 12) record-field (program 1.0.0 12) even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) even.4 (program 1.0.0 True) -even.5 (program 1.0.0 False) \ No newline at end of file +even.5 (program 1.0.0 False) +knownEven (program 1.0.0 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) +knownEven.6 (program 1.0.0 True) +knownEven.7 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden index 3ff762cad..aba7d8cf0 100644 --- a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden +++ b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden @@ -2,4 +2,7 @@ record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) -even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) \ No newline at end of file +even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) +knownEven (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) +knownEven.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2 6) (force ifThenElse)) (\i0 -> \i0 -> i2))) +knownEven.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2 7) (force ifThenElse)) (\i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden b/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden index 7f649ff41..87f87948c 100644 --- a/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden +++ b/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden @@ -2,4 +2,7 @@ record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} -even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} \ No newline at end of file +even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} +knownEven {"exBudgetCPU":863517,"exBudgetMemory":3000,"scriptSizeBytes":85} +knownEven.6 {"exBudgetCPU":4589296,"exBudgetMemory":12810,"scriptSizeBytes":87} +knownEven.7 {"exBudgetCPU":6115294,"exBudgetMemory":16814,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden index 4f913af0b..1ccb10873 100644 --- a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden @@ -2,4 +2,7 @@ record (program 1.0.0 12) record-field (program 1.0.0 12) even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) even.4 (program 1.0.0 True) -even.5 (program 1.0.0 False) \ No newline at end of file +even.5 (program 1.0.0 False) +knownEven (program 1.0.0 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) +knownEven.6 (program 1.0.0 True) +knownEven.7 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden index 3ff762cad..aba7d8cf0 100644 --- a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden +++ b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden @@ -2,4 +2,7 @@ record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) -even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) \ No newline at end of file +even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) +knownEven (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) +knownEven.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2 6) (force ifThenElse)) (\i0 -> \i0 -> i2))) +knownEven.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2 7) (force ifThenElse)) (\i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index e41371583..8956efb04 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -197,6 +197,13 @@ evenOdd = letrec evenOddRecursion , odd = plam $ \n -> pif (n #== 0) (pcon PFalse) (even #$ n - 1) } +knownEvenOdd :: Term (s :: S) ((PInteger :--> PBool) :--> ScottEncoding EvenOdd (t :: PType)) +knownEvenOdd = plam $ \knownEven -> letrec $ \ EvenOdd {even, odd}-> + EvenOdd + { even = plam $ \n -> pif (knownEven # n) (pcon PTrue) (odd #$ n - 1) + , odd = plam $ \n -> pif (knownEven # n) (pcon PFalse) (even #$ n - 1) + } + sampleData :: Term s (PAsData (PRecord SampleRecord)) sampleData = pdata (punsafeFrom sampleRecord) @@ -235,6 +242,9 @@ spec = do "even" @| evenOdd # field even "even.4" @| evenOdd # field even # (4 :: Term s PInteger) "even.5" @| evenOdd # field even # (5 :: Term s PInteger) + "knownEven" @| knownEvenOdd # plam (#== 4) # field even + "knownEven.6" @| knownEvenOdd # plam (#== 4) # field even # (6 :: Term s PInteger) + "knownEven.7" @| knownEvenOdd # plam (#== 4) # field even # (7 :: Term s PInteger) describe "nested" . plutarchDevFlagDescribe . pgoldenSpec $ do "flat" @\ do "reconstr-with-rcon" @| sampleFlatOuter From 40b7ae914894a79e5869435924181534d1ca1fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 20 Apr 2022 18:23:18 -0400 Subject: [PATCH 371/584] Generalized Plutarch.Rec.TH.deriveScottEncoded for types with multiple parameters --- Plutarch/Rec/TH.hs | 22 ++++++++++++++----- .../plutarch-base/Plutarch/RecSpec.hs | 6 +++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Plutarch/Rec/TH.hs b/Plutarch/Rec/TH.hs index 5d65f7ae7..0061035e4 100644 --- a/Plutarch/Rec/TH.hs +++ b/Plutarch/Rec/TH.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE CPP, TemplateHaskell #-} module Plutarch.Rec.TH (deriveAll, deriveScottEncoded) where @@ -15,10 +15,20 @@ deriveAll name = (<>) <$> deriveScottEncoded name <*> Rank2.TH.deriveAll name -- | Use as a TH splice for @type instance ScottEncoded@ declarations. deriveScottEncoded :: TH.Name -> Q [TH.Dec] deriveScottEncoded name = do - con <- reifyConstructor name + (con, tyVars) <- reifyConstructor name a <- TH.newName "a" let qa = pure (TH.VarT a) - [d|type instance ScottEncoded $(pure $ TH.ConT name) $qa = $(genScottEncoded con qa)|] + ty = foldl apply (TH.conT name) (init tyVars) + +#if MIN_VERSION_template_haskell(2,17,0) + apply t (TH.PlainTV name _) = TH.appT t (TH.varT name) + apply t (TH.KindedTV name _ _) = TH.appT t (TH.varT name) +#else + apply t (TH.PlainTV name) = TH.appT t (TH.varT name) + apply t (TH.KindedTV name _) = TH.appT t (TH.varT name) +#endif + + [d|type instance ScottEncoded $ty $qa = $(genScottEncoded con qa)|] genScottEncoded :: TH.Con -> Q TH.Type -> Q TH.Type genScottEncoded (TH.InfixC (_, left) _name (_, right)) result = argType left (argType right result) @@ -37,10 +47,10 @@ bare :: TH.Type -> Q TH.Type bare (TH.SigT t _) = bare t bare t = pure t -reifyConstructor :: TH.Name -> Q TH.Con +reifyConstructor :: TH.Name -> Q (TH.Con, [TH.TyVarBndr ()]) reifyConstructor ty = do (TH.TyConI tyCon) <- TH.reify ty case tyCon of - TH.DataD _ _nm _tyVars _kind [c] _ -> return c - TH.NewtypeD _ _nm _tyVars _kind c _ -> return c + TH.DataD _ _nm tyVars _kind [c] _ -> return (c, tyVars) + TH.NewtypeD _ _nm tyVars _kind c _ -> return (c, tyVars) _ -> fail "Expected a single-constructor data or newtype" diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index 8956efb04..165fee786 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -56,10 +56,16 @@ data EvenOdd f = EvenOdd , odd :: f (PInteger :--> PBool) } +data ParameterizedRecord p q f = ParameterizedRecord + { p1 :: f (PInteger :--> PBool) + , p2 :: f (PInteger :--> p :--> PBool) + } + type instance ScottEncoded EvenOdd a = (PInteger :--> PBool) :--> (PInteger :--> PBool) :--> a $(Rank2.TH.deriveAll ''EvenOdd) $(deriveAll ''SampleRecord) -- also autoderives the @type instance ScottEncoded@ +$(deriveAll ''ParameterizedRecord) $(deriveAll ''FlatOuterRecord) $(deriveAll ''ShallowOuterRecord) instance RecordFromData SampleRecord From 888a25299089fc4b4ee4c29b3be506c586754f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 20 Apr 2022 18:38:16 -0400 Subject: [PATCH 372/584] Fourmolu doesn't understand CPP directives --- Plutarch/Rec.hs | 2 +- Plutarch/Rec/TH.hs | 24 +++++++++++-------- .../plutarch-base/Plutarch/RecSpec.hs | 10 ++++---- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Plutarch/Rec.hs b/Plutarch/Rec.hs index d7f90bc31..6059c754d 100644 --- a/Plutarch/Rec.hs +++ b/Plutarch/Rec.hs @@ -95,7 +95,7 @@ letrec r = Term term where term n = TermResult {getTerm = RApply rfix [RLamAbs 1 $ RApply (RVar 0) $ rawTerms], getDeps = deps} where - (Dual rawTerms, deps) = Rank2.foldMap (rawResult . ($ n+2) . asRawTerm) (r selfReferring) + (Dual rawTerms, deps) = Rank2.foldMap (rawResult . ($ n + 2) . asRawTerm) (r selfReferring) selfReferring = Rank2.fmap fromRecord accessors fromRecord :: ScottArgument r s a -> Term s a fromRecord (ScottArgument (Term access)) = diff --git a/Plutarch/Rec/TH.hs b/Plutarch/Rec/TH.hs index 0061035e4..39ea487db 100644 --- a/Plutarch/Rec/TH.hs +++ b/Plutarch/Rec/TH.hs @@ -1,4 +1,5 @@ -{-# LANGUAGE CPP, TemplateHaskell #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE TemplateHaskell #-} module Plutarch.Rec.TH (deriveAll, deriveScottEncoded) where @@ -18,15 +19,8 @@ deriveScottEncoded name = do (con, tyVars) <- reifyConstructor name a <- TH.newName "a" let qa = pure (TH.VarT a) - ty = foldl apply (TH.conT name) (init tyVars) - -#if MIN_VERSION_template_haskell(2,17,0) - apply t (TH.PlainTV name _) = TH.appT t (TH.varT name) - apply t (TH.KindedTV name _ _) = TH.appT t (TH.varT name) -#else - apply t (TH.PlainTV name) = TH.appT t (TH.varT name) - apply t (TH.KindedTV name _) = TH.appT t (TH.varT name) -#endif + ty = foldl apply (TH.conT name) (init tyVars) + apply t tvb = TH.appT t (TH.varT $ bindingName tvb) [d|type instance ScottEncoded $ty $qa = $(genScottEncoded con qa)|] @@ -47,6 +41,16 @@ bare :: TH.Type -> Q TH.Type bare (TH.SigT t _) = bare t bare t = pure t +#if MIN_VERSION_template_haskell(2,17,0) +bindingName :: TH.TyVarBndr flag -> TH.Name +bindingName (TH.PlainTV name _) = name +bindingName (TH.KindedTV name _ _) = name +#else +bindingName :: TH.TyVarBndr -> TH.Name +bindingName (TH.PlainTV name) = name +bindingName (TH.KindedTV name _) = name +#endif + reifyConstructor :: TH.Name -> Q (TH.Con, [TH.TyVarBndr ()]) reifyConstructor ty = do (TH.TyConI tyCon) <- TH.reify ty diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs index 165fee786..765f9cb70 100644 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs @@ -204,11 +204,11 @@ evenOdd = letrec evenOddRecursion } knownEvenOdd :: Term (s :: S) ((PInteger :--> PBool) :--> ScottEncoding EvenOdd (t :: PType)) -knownEvenOdd = plam $ \knownEven -> letrec $ \ EvenOdd {even, odd}-> - EvenOdd - { even = plam $ \n -> pif (knownEven # n) (pcon PTrue) (odd #$ n - 1) - , odd = plam $ \n -> pif (knownEven # n) (pcon PFalse) (even #$ n - 1) - } +knownEvenOdd = plam $ \knownEven -> letrec $ \EvenOdd {even, odd} -> + EvenOdd + { even = plam $ \n -> pif (knownEven # n) (pcon PTrue) (odd #$ n - 1) + , odd = plam $ \n -> pif (knownEven # n) (pcon PFalse) (even #$ n - 1) + } sampleData :: Term s (PAsData (PRecord SampleRecord)) sampleData = pdata (punsafeFrom sampleRecord) From 65e31db0ac69e6a252fd53275bc554d730e515b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 20 Apr 2022 19:26:51 -0400 Subject: [PATCH 373/584] Fixed compilation with GHC 8.10 --- Plutarch/Rec/TH.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plutarch/Rec/TH.hs b/Plutarch/Rec/TH.hs index 39ea487db..bd7461ec4 100644 --- a/Plutarch/Rec/TH.hs +++ b/Plutarch/Rec/TH.hs @@ -20,7 +20,7 @@ deriveScottEncoded name = do a <- TH.newName "a" let qa = pure (TH.VarT a) ty = foldl apply (TH.conT name) (init tyVars) - apply t tvb = TH.appT t (TH.varT $ bindingName tvb) + apply t v = TH.appT t (TH.varT v) [d|type instance ScottEncoded $ty $qa = $(genScottEncoded con qa)|] @@ -51,10 +51,10 @@ bindingName (TH.PlainTV name) = name bindingName (TH.KindedTV name _) = name #endif -reifyConstructor :: TH.Name -> Q (TH.Con, [TH.TyVarBndr ()]) +reifyConstructor :: TH.Name -> Q (TH.Con, [TH.Name]) reifyConstructor ty = do (TH.TyConI tyCon) <- TH.reify ty case tyCon of - TH.DataD _ _nm tyVars _kind [c] _ -> return (c, tyVars) - TH.NewtypeD _ _nm tyVars _kind c _ -> return (c, tyVars) + TH.DataD _ _nm tyVars _kind [c] _ -> return (c, bindingName <$> tyVars) + TH.NewtypeD _ _nm tyVars _kind c _ -> return (c, bindingName <$> tyVars) _ -> fail "Expected a single-constructor data or newtype" From ae921a254ac6698c8dd6be961c82462ad384298a Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 22 Apr 2022 21:47:25 +0530 Subject: [PATCH 374/584] Modular goldens --- plutarch-test/common/Plutarch/Test/Golden.hs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 7b913d2a7..ee567d101 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -64,6 +64,15 @@ data GoldenValue = GoldenValue -- ^ User test's expectation function } +data GoldenConf = GoldenConf + { trackPreEval :: Bool + -- ^ Whether to track UPLC golden. + , trackPostEval :: Bool + -- ^ Whether to track evaluated UPLC golden. + , trackBench :: Bool + -- ^ Whether to track benchmark golden. + } + {- | Class of types that represent `GoldenValue` This class exists for syntatic sugar provided by (@->) (via `TermExpectation`). @@ -179,12 +188,18 @@ infixr 0 @| for 'qux' will be "bar.qux". -} pgoldenSpec :: HasCallStack => PlutarchGoldens -> Spec -pgoldenSpec map = do +pgoldenSpec = pgoldenSpec' $ GoldenConf True True True + +-- | Like 'pgoldenSpec' but takes a 'GoldenConf' to determine which goldens to track. +pgoldenSpec' :: HasCallStack => GoldenConf -> PlutarchGoldens -> Spec +pgoldenSpec' (GoldenConf {trackPreEval, trackPostEval, trackBench}) map = do base <- currentGoldenKey let bs = runListSyntax map + goldenKeys = [(trackPreEval, UPLCPreEval), (trackPostEval, UPLCPostEval), (trackBench, Bench)] + goldenTests = [t | (True, t) <- goldenKeys] -- Golden tests describe "golden" $ do - goldenTestSpec base bs `mapM_` [minBound .. maxBound] + goldenTestSpec base bs `mapM_` goldenTests -- Assertion tests (if any) let asserts = flip mapMaybe bs $ \(k, v) -> do (k,) . (\f -> f (goldenValueEvaluated v) $ goldenValueBenchVal v) <$> goldenValueExpectation v From 3f5ac2a14966b4c3d2e5b7627f58988d4ff7cf54 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 22 Apr 2022 22:03:16 +0530 Subject: [PATCH 375/584] Custom path option + fixes --- plutarch-test/common/Plutarch/Test.hs | 7 ++++ plutarch-test/common/Plutarch/Test/Golden.hs | 42 ++++++++++++++------ plutarch-test/common/Plutarch/Test/Run.hs | 35 ++++++++++------ plutarch-test/plutarch-test.cabal | 1 + 4 files changed, 61 insertions(+), 24 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index aa9e0bb67..8815951c7 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -25,7 +25,11 @@ module Plutarch.Test ( (@:->), (@==), pgoldenSpec, + pgoldenSpec', + noUnusedGoldens, + noUnusedGoldens', PlutarchGoldens, + GoldenConf (..), -- * Benchmark type for use in `(@:->)` Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), @@ -42,15 +46,18 @@ import Plutarch.Test.Benchmark ( ScriptSizeBytes, ) import Plutarch.Test.Golden ( + GoldenConf (GoldenConf, goldenBasePath, trackBench, trackPostEval, trackPreEval), PlutarchGoldens, TermExpectation, evalScriptAlwaysWithBenchmark, pgoldenSpec, + pgoldenSpec', (@->), (@:->), (@\), (@|), ) +import Plutarch.Test.Run (noUnusedGoldens, noUnusedGoldens') import qualified Plutus.V1.Ledger.Scripts as Scripts import Test.Hspec (Expectation, Spec, describe, expectationFailure, shouldBe, shouldSatisfy) import Test.Tasty.HUnit (assertFailure) diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index ee567d101..10fa602ad 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -3,6 +3,7 @@ module Plutarch.Test.Golden ( -- * DSL pgoldenSpec, + pgoldenSpec', (@|), (@\), (@->), @@ -18,6 +19,10 @@ module Plutarch.Test.Golden ( defaultGoldenBasePath, goldenTestPath, + -- * Golden config + GoldenConf (..), + goldenTestsFromConf, + -- * Evaluation evalScriptAlwaysWithBenchmark, compileD, @@ -25,6 +30,7 @@ module Plutarch.Test.Golden ( import Control.Monad (forM_, unless) import qualified Data.Aeson.Text as Aeson +import Data.Default (Default (def)) import Data.List.NonEmpty (nonEmpty) import Data.Maybe (mapMaybe) import Data.Semigroup (sconcat) @@ -71,7 +77,13 @@ data GoldenConf = GoldenConf -- ^ Whether to track evaluated UPLC golden. , trackBench :: Bool -- ^ Whether to track benchmark golden. + , goldenBasePath :: FilePath + -- ^ Directory to put the goldens in. } + deriving stock (Eq, Show) + +instance Default GoldenConf where + def = GoldenConf True True True defaultGoldenBasePath {- | Class of types that represent `GoldenValue` @@ -188,18 +200,19 @@ infixr 0 @| for 'qux' will be "bar.qux". -} pgoldenSpec :: HasCallStack => PlutarchGoldens -> Spec -pgoldenSpec = pgoldenSpec' $ GoldenConf True True True +pgoldenSpec = pgoldenSpec' def + +{- | Like 'pgoldenSpec' but takes a 'GoldenConf' to determine which goldens to track. --- | Like 'pgoldenSpec' but takes a 'GoldenConf' to determine which goldens to track. +> pgoldenSpec = pgoldenSpec' def +-} pgoldenSpec' :: HasCallStack => GoldenConf -> PlutarchGoldens -> Spec -pgoldenSpec' (GoldenConf {trackPreEval, trackPostEval, trackBench}) map = do +pgoldenSpec' conf@(GoldenConf {goldenBasePath}) map = do base <- currentGoldenKey let bs = runListSyntax map - goldenKeys = [(trackPreEval, UPLCPreEval), (trackPostEval, UPLCPostEval), (trackBench, Bench)] - goldenTests = [t | (True, t) <- goldenKeys] -- Golden tests describe "golden" $ do - goldenTestSpec base bs `mapM_` goldenTests + goldenTestSpec goldenBasePath base bs `mapM_` goldenTestsFromConf conf -- Assertion tests (if any) let asserts = flip mapMaybe bs $ \(k, v) -> do (k,) . (\f -> f (goldenValueEvaluated v) $ goldenValueBenchVal v) <$> goldenValueExpectation v @@ -216,6 +229,11 @@ data GoldenTest Bench deriving stock (Eq, Show, Ord, Enum, Bounded) +goldenTestsFromConf :: GoldenConf -> [GoldenTest] +goldenTestsFromConf (GoldenConf {trackPreEval, trackPostEval, trackBench}) = + let goldenKeys = [(trackPreEval, UPLCPreEval), (trackPostEval, UPLCPostEval), (trackBench, Bench)] + in [t | (True, t) <- goldenKeys] + goldenTestKey :: GoldenTest -> GoldenKey goldenTestKey = \case UPLCPreEval -> "uplc" @@ -225,9 +243,9 @@ goldenTestKey = \case defaultGoldenBasePath :: FilePath defaultGoldenBasePath = "goldens" -goldenTestPath :: GoldenKey -> GoldenTest -> FilePath -goldenTestPath base gt = - goldenPath defaultGoldenBasePath $ base <> goldenTestKey gt +goldenTestPath :: FilePath -> GoldenKey -> GoldenTest -> FilePath +goldenTestPath goldenBasePath base gt = + goldenPath goldenBasePath $ base <> goldenTestKey gt goldenTestVal :: GoldenTest -> GoldenValue -> Text goldenTestVal t v = case t of @@ -235,12 +253,12 @@ goldenTestVal t v = case t of UPLCPostEval -> goldenValueUplcPostEval v Bench -> goldenValueBench v -goldenTestSpec :: GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> Spec -goldenTestSpec base vals gt = do +goldenTestSpec :: FilePath -> GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> Spec +goldenTestSpec goldenBasePath base vals gt = do it (goldenKeyString $ goldenTestKey gt) $ do Golden { output = combineGoldens $ fmap (goldenTestVal gt) <$> vals - , goldenFile = goldenTestPath base gt + , goldenFile = goldenTestPath goldenBasePath base gt , actualFile = Nothing , encodePretty = show , writeToFile = TIO.writeFile diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index 546366576..3ac7c3971 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -1,10 +1,17 @@ -module Plutarch.Test.Run (noUnusedGoldens) where +module Plutarch.Test.Run (noUnusedGoldens, noUnusedGoldens') where import Control.Monad (forM_) +import Data.Default (def) import Data.Set (Set) import qualified Data.Set as Set import qualified Data.Text as T -import Plutarch.Test.Golden (GoldenKey, defaultGoldenBasePath, goldenTestPath, mkGoldenKeyFromSpecPath) +import Plutarch.Test.Golden ( + GoldenConf (GoldenConf, goldenBasePath), + GoldenKey, + goldenTestPath, + goldenTestsFromConf, + mkGoldenKeyFromSpecPath, + ) import System.Directory (listDirectory) import System.Exit (ExitCode (ExitFailure), exitWith) import System.FilePath (()) @@ -20,11 +27,15 @@ import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup), runSp untracked golden files. -} noUnusedGoldens :: Spec -> IO () -noUnusedGoldens spec = do +noUnusedGoldens = noUnusedGoldens' def + +-- | Like 'noUnusedGoldens' but takes a custom path to the golden storage. +noUnusedGoldens' :: GoldenConf -> Spec -> IO () +noUnusedGoldens' conf@(GoldenConf {goldenBasePath}) spec = do -- A second traversal here (`runSpecM`) can be obviated after -- https://github.com/hspec/hspec/issues/649 - usedGoldens <- goldenPathsUsedBy . snd <$> runSpecM spec - unusedGoldens usedGoldens >>= \case + usedGoldens <- goldenPathsUsedBy conf . snd <$> runSpecM spec + unusedGoldens goldenBasePath usedGoldens >>= \case [] -> pure () unused -> do putStrLn "ERROR: Unused golden files found lying around! Namely:" @@ -33,10 +44,10 @@ noUnusedGoldens spec = do exitWith (ExitFailure 1) -- | Given a list of "used" goldens, return any unused golden files on disk. -unusedGoldens :: [FilePath] -> IO [FilePath] -unusedGoldens usedGoldens' = do +unusedGoldens :: FilePath -> [FilePath] -> IO [FilePath] +unusedGoldens goldenBasePath usedGoldens' = do let usedGoldens = foldMap knownGoldens usedGoldens' - allGoldens <- Set.fromList . fmap (defaultGoldenBasePath ) <$> listDirectory defaultGoldenBasePath + allGoldens <- Set.fromList . fmap (goldenBasePath ) <$> listDirectory goldenBasePath pure $ Set.toList $ allGoldens `Set.difference` usedGoldens where knownGoldens :: FilePath -> Set FilePath @@ -50,11 +61,11 @@ unusedGoldens usedGoldens' = do ] replace a b = T.unpack . T.replace a b . T.pack -goldenPathsUsedBy :: [SpecTree a] -> [FilePath] -goldenPathsUsedBy trees = do +goldenPathsUsedBy :: GoldenConf -> [SpecTree a] -> [FilePath] +goldenPathsUsedBy conf@(GoldenConf {goldenBasePath}) trees = do flip foldMap (queryGoldens trees) $ \k -> - flip fmap [minBound .. maxBound] $ \t -> - goldenTestPath k t + flip fmap (goldenTestsFromConf conf) $ \t -> + goldenTestPath goldenBasePath k t -- | Retrieve all golden keys used by the given test tree. queryGoldens :: [SpecTree a] -> [GoldenKey] diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 778edf040..bca637217 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -78,6 +78,7 @@ common deps , base , bytestring , containers + , data-default , directory , filepath , generics-sop From cbfc500db35a8145ce42761191576d5dcdd4dc8f Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 25 Apr 2022 21:54:48 +0530 Subject: [PATCH 376/584] Use a single `Set GoldenTest` instead --- plutarch-test/common/Plutarch/Test.hs | 4 ++- plutarch-test/common/Plutarch/Test/Golden.hs | 38 ++++++++------------ plutarch-test/common/Plutarch/Test/Run.hs | 12 ++++--- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index 8815951c7..8ea891375 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -30,6 +30,7 @@ module Plutarch.Test ( noUnusedGoldens', PlutarchGoldens, GoldenConf (..), + GoldenTest (..), -- * Benchmark type for use in `(@:->)` Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), @@ -46,7 +47,8 @@ import Plutarch.Test.Benchmark ( ScriptSizeBytes, ) import Plutarch.Test.Golden ( - GoldenConf (GoldenConf, goldenBasePath, trackBench, trackPostEval, trackPreEval), + GoldenConf (GoldenConf, chosenTests, goldenBasePath), + GoldenTest (GoldenT'Bench, GoldenT'UPLCPostEval, GoldenT'UPLCPreEval), PlutarchGoldens, TermExpectation, evalScriptAlwaysWithBenchmark, diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 10fa602ad..a87e36b50 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -21,7 +21,7 @@ module Plutarch.Test.Golden ( -- * Golden config GoldenConf (..), - goldenTestsFromConf, + GoldenTest (..), -- * Evaluation evalScriptAlwaysWithBenchmark, @@ -44,6 +44,8 @@ import System.FilePath (()) import Test.Hspec.Golden import qualified Data.List.NonEmpty as NE +import Data.Set (Set) +import qualified Data.Set as S import Plutarch (compile, printScript) import Plutarch.Evaluate (evalScript) import Plutarch.Internal (punsafeAsClosedTerm) @@ -71,19 +73,14 @@ data GoldenValue = GoldenValue } data GoldenConf = GoldenConf - { trackPreEval :: Bool - -- ^ Whether to track UPLC golden. - , trackPostEval :: Bool - -- ^ Whether to track evaluated UPLC golden. - , trackBench :: Bool - -- ^ Whether to track benchmark golden. + { chosenTests :: Set GoldenTest , goldenBasePath :: FilePath -- ^ Directory to put the goldens in. } deriving stock (Eq, Show) instance Default GoldenConf where - def = GoldenConf True True True defaultGoldenBasePath + def = GoldenConf (S.fromList [minBound .. maxBound]) defaultGoldenBasePath {- | Class of types that represent `GoldenValue` @@ -212,7 +209,7 @@ pgoldenSpec' conf@(GoldenConf {goldenBasePath}) map = do let bs = runListSyntax map -- Golden tests describe "golden" $ do - goldenTestSpec goldenBasePath base bs `mapM_` goldenTestsFromConf conf + goldenTestSpec goldenBasePath base bs `mapM_` chosenTests conf -- Assertion tests (if any) let asserts = flip mapMaybe bs $ \(k, v) -> do (k,) . (\f -> f (goldenValueEvaluated v) $ goldenValueBenchVal v) <$> goldenValueExpectation v @@ -222,23 +219,18 @@ pgoldenSpec' conf@(GoldenConf {goldenBasePath}) map = do data GoldenTest = -- | The unevaluated UPLC (compiled target of Plutarch term) - UPLCPreEval + GoldenT'UPLCPreEval | -- | The evaluated UPLC (evaluated result of Plutarch term) - UPLCPostEval + GoldenT'UPLCPostEval | -- | Benchmark of Plutarch term (will never fail) - Bench + GoldenT'Bench deriving stock (Eq, Show, Ord, Enum, Bounded) -goldenTestsFromConf :: GoldenConf -> [GoldenTest] -goldenTestsFromConf (GoldenConf {trackPreEval, trackPostEval, trackBench}) = - let goldenKeys = [(trackPreEval, UPLCPreEval), (trackPostEval, UPLCPostEval), (trackBench, Bench)] - in [t | (True, t) <- goldenKeys] - goldenTestKey :: GoldenTest -> GoldenKey goldenTestKey = \case - UPLCPreEval -> "uplc" - UPLCPostEval -> "uplc.eval" - Bench -> "bench" + GoldenT'UPLCPreEval -> "uplc" + GoldenT'UPLCPostEval -> "uplc.eval" + GoldenT'Bench -> "bench" defaultGoldenBasePath :: FilePath defaultGoldenBasePath = "goldens" @@ -249,9 +241,9 @@ goldenTestPath goldenBasePath base gt = goldenTestVal :: GoldenTest -> GoldenValue -> Text goldenTestVal t v = case t of - UPLCPreEval -> goldenValueUplcPreEval v - UPLCPostEval -> goldenValueUplcPostEval v - Bench -> goldenValueBench v + GoldenT'UPLCPreEval -> goldenValueUplcPreEval v + GoldenT'UPLCPostEval -> goldenValueUplcPostEval v + GoldenT'Bench -> goldenValueBench v goldenTestSpec :: FilePath -> GoldenKey -> [(GoldenKey, GoldenValue)] -> GoldenTest -> Spec goldenTestSpec goldenBasePath base vals gt = do diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index 3ac7c3971..12a19e75a 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -6,10 +6,9 @@ import Data.Set (Set) import qualified Data.Set as Set import qualified Data.Text as T import Plutarch.Test.Golden ( - GoldenConf (GoldenConf, goldenBasePath), + GoldenConf (GoldenConf, chosenTests, goldenBasePath), GoldenKey, goldenTestPath, - goldenTestsFromConf, mkGoldenKeyFromSpecPath, ) import System.Directory (listDirectory) @@ -29,7 +28,10 @@ import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup), runSp noUnusedGoldens :: Spec -> IO () noUnusedGoldens = noUnusedGoldens' def --- | Like 'noUnusedGoldens' but takes a custom path to the golden storage. +{- | Like 'noUnusedGoldens' but takes a custom path to the golden storage. + +NOTE: This relies on the same 'GoldenConf' being used in all 'pgoldenSpec'' calls. +-} noUnusedGoldens' :: GoldenConf -> Spec -> IO () noUnusedGoldens' conf@(GoldenConf {goldenBasePath}) spec = do -- A second traversal here (`runSpecM`) can be obviated after @@ -62,9 +64,9 @@ unusedGoldens goldenBasePath usedGoldens' = do replace a b = T.unpack . T.replace a b . T.pack goldenPathsUsedBy :: GoldenConf -> [SpecTree a] -> [FilePath] -goldenPathsUsedBy conf@(GoldenConf {goldenBasePath}) trees = do +goldenPathsUsedBy (GoldenConf {chosenTests, goldenBasePath}) trees = do flip foldMap (queryGoldens trees) $ \k -> - flip fmap (goldenTestsFromConf conf) $ \t -> + flip fmap (Set.toList chosenTests) $ \t -> goldenTestPath goldenBasePath k t -- | Retrieve all golden keys used by the given test tree. From d643dd0ae2d5f6ff9c2c0a21785342668430c578 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 27 Apr 2022 12:12:05 +0530 Subject: [PATCH 377/584] Add data hashing functions --- Plutarch/Api/Internal/Scripts.hs | 12 ++++++++++++ Plutarch/Api/V1.hs | 18 +++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Plutarch/Api/Internal/Scripts.hs b/Plutarch/Api/Internal/Scripts.hs index 5f7d45c4c..f6a4c23f3 100644 --- a/Plutarch/Api/Internal/Scripts.hs +++ b/Plutarch/Api/Internal/Scripts.hs @@ -1,16 +1,19 @@ module Plutarch.Api.Internal.Scripts ( hashScriptWithPrefix, + hashData, ) where import Codec.Serialise (serialise) import Crypto.Hash (hashWith) import Crypto.Hash.Algorithms ( Blake2b_224 (Blake2b_224), + Blake2b_256 (Blake2b_256), ) import Data.ByteArray (convert) import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as Lazy +import qualified Plutus.V1.Ledger.Api as Plutus import qualified Plutus.V1.Ledger.Scripts as Plutus import qualified PlutusTx.Builtins as PlutusTx @@ -22,3 +25,12 @@ hashScriptWithPrefix prefix scr = convert @_ @ByteString $ hashWith Blake2b_224 $ prefix <> (Lazy.toStrict $ serialise scr) + +-- | Hash Plutus 'Data'. +hashData :: Plutus.Data -> PlutusTx.BuiltinByteString +hashData = + PlutusTx.toBuiltin + . convert @_ @ByteString + . hashWith Blake2b_256 + . Lazy.toStrict + . serialise diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index e72867eb3..077a99c21 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -17,6 +17,10 @@ module Plutarch.Api.V1 ( mintingPolicySymbol, stakeValidatorHash, scriptHash, + datumHash, + redeemerHash, + dataHash, + hashData, mkValidator, mkStakeValidator, mkMintingPolicy, @@ -97,7 +101,7 @@ import qualified Plutus.V1.Ledger.Api as Plutus import qualified Plutus.V1.Ledger.Scripts as Plutus import Plutarch (compile) -import Plutarch.Api.Internal.Scripts (hashScriptWithPrefix) +import Plutarch.Api.Internal.Scripts (hashData, hashScriptWithPrefix) import Plutarch.Api.V1.Contexts (PScriptContext) import Plutarch.Prelude @@ -139,3 +143,15 @@ mintingPolicySymbol = coerce scriptHash -- | Hash a StakeValidator, with the correct prefix for Plutus V1 stakeValidatorHash :: Plutus.StakeValidator -> Plutus.StakeValidatorHash stakeValidatorHash = coerce scriptHash + +-- | Hash a Datum. +datumHash :: Plutus.Datum -> Plutus.DatumHash +datumHash = coerce . dataHash + +-- | Hash a Redeemer. +redeemerHash :: Plutus.Redeemer -> Plutus.RedeemerHash +redeemerHash = coerce . dataHash + +-- | Hash the data encoded representation of given argument. +dataHash :: Plutus.ToData a => a -> Plutus.BuiltinByteString +dataHash = hashData . Plutus.toData From ab054d5e62c01a7ca2c0eff07b2bb736c4106521 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 27 Apr 2022 13:08:41 +0530 Subject: [PATCH 378/584] Pretty printer for Plutarch terms --- Plutarch.hs | 2 + Plutarch/Pretty.hs | 218 +++++++++++++++++++++++++++++++++++++++++++++ plutarch.cabal | 3 + 3 files changed, 223 insertions(+) create mode 100644 Plutarch/Pretty.hs diff --git a/Plutarch.hs b/Plutarch.hs index 1e8987687..de2967e9c 100644 --- a/Plutarch.hs +++ b/Plutarch.hs @@ -16,6 +16,7 @@ module Plutarch ( S, PType, PlutusType (..), + prettyTerm, printTerm, printScript, (#$), @@ -36,5 +37,6 @@ module Plutarch ( ) where import Plutarch.Internal.Other +import Plutarch.Pretty (prettyTerm) import qualified Plutarch.TermCont as PT import Prelude () diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs new file mode 100644 index 000000000..84b3a1d1a --- /dev/null +++ b/Plutarch/Pretty.hs @@ -0,0 +1,218 @@ +{-# LANGUAGE PatternSynonyms #-} + +module Plutarch.Pretty (prettyTerm) where + +import Data.Bifunctor (first) +import Data.List (foldl') +import Data.Map.Strict (Map) +import qualified Data.Map.Strict as Map +import Data.Set (Set) +import qualified Data.Set as Set +import Data.String (fromString) +import Data.Text (Text) +import qualified Data.Text as Txt + +import System.Random ( + Random (randomR), + RandomGen, + mkStdGen, + uniformR, + ) + +import Prettyprinter ((<+>)) +import qualified Prettyprinter as PP + +import Plutus.V1.Ledger.Scripts (Script (unScript)) +import qualified PlutusCore as PLC +import UntypedPlutusCore ( + DeBruijn (DeBruijn), + DefaultFun, + DefaultUni, + Index, + Program (_progTerm), + Term (Apply, Builtin, Constant, Delay, Error, Force, LamAbs, Var), + ) +import qualified UntypedPlutusCore as UPLC (Term) + +import Plutarch.Internal.Other (ClosedTerm, compile) + +prettyTerm :: ClosedTerm a -> PP.Doc () +prettyTerm x = prettyUPLC . _progTerm . unScript $ compile x + +{- This isn't suitable for pretty printing UPLC from any source. It's primarily suited for Plutarch output. + +Practically speaking though, it should work with any _idiomatic_ UPLC. +-} +prettyUPLC :: UPLC.Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () +prettyUPLC = go False mempty $ mkStdGen 42 + where + go :: RandomGen g => Bool -> Map Index Text -> g -> UPLC.Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () + go _ _ _ (Constant _ c) = PP.pretty c + go _ _ _ (Builtin _ b) = PP.pretty b + go _ _ _ (Error _) = "ERROR" + go _ nameMap _ (Var _ (DeBruijn x)) = case Map.lookup (x - 1) nameMap of + Just nm -> PP.pretty nm + Nothing -> error "impossible: free variable" + go _ nameMap g (Force _ t@Apply {}) = "!" <> PP.parens (go False nameMap g t) + go _ nameMap g (Force _ t@LamAbs {}) = "!" <> PP.parens (go False nameMap g t) + go _ nameMap g (Force _ t) = "!" <> go False nameMap g t + go _ nameMap g (Delay _ t@Apply {}) = "~" <> PP.parens (go False nameMap g t) + go _ nameMap g (Delay _ t@LamAbs {}) = "~" <> PP.parens (go False nameMap g t) + go _ nameMap g (Delay _ t) = "~" <> go False nameMap g t + go _ nameMap g (LamAbs _ _ t') = + PP.parens $ + let (depth, t) = unwrapLamAbs 0 t' + (names, _, finalG) = + foldl' + ( \(l, existingNames, g) _ -> + let (newName, newG) = freshVarName existingNames g + in (newName : l, Set.insert newName existingNames, newG) + ) + ([], Set.fromList $ Map.elems nameMap, g) + [0 .. depth] + in PP.hang indentWidth $ + PP.sep + [ "\\" <> PP.hsep (reverse $ map PP.pretty names) <+> "->" + , go False (Map.mapKeys (+ (depth + 1)) nameMap <> Map.fromList (zip [0 .. depth] names)) finalG t + ] + go _ nameMap g (Apply _ (LamAbs _ _ t) arg) = + let (l, ft) = unwrapBindings [] t + args = arg : reverse l + (names, _, finalG) = + foldr + ( \expr (l, existingNames, g) -> + let (newName, newG) = case expr of + Force _ (Force _ (Builtin _ b)) -> (fromString $ forcedPrefix <> show b, g) + Force _ (Builtin _ b) -> (fromString $ forcedPrefix <> show b, g) + PFixAst -> ("fix", g) + ComposeAST (Builtin () PLC.SndPair) (Builtin () PLC.UnConstrData) -> ("unDataSum", g) + ComposeAST (Var () (DeBruijn ix)) (Builtin () PLC.UnConstrData) + | ix == 2 -> ("unDataSum", g) + _ -> freshVarName existingNames g + in (newName : l, Set.insert newName existingNames, newG) + ) + ([], Set.fromList $ Map.elems nameMap, g) + args + bindings = zip names args + helper mp (name, expr) = + PP.hang indentWidth $ + PP.sep + [ PP.pretty name <+> "=" + , go False mp finalG expr + ] + (finalDoc, finalMap) = + foldl' + ( \(doc, mp) (name, expr) -> + let newDoc = doc <> PP.flatAlt PP.hardline "; " <> helper mp (name, expr) + in (newDoc, Map.mapKeys (+ 1) mp <> Map.singleton 0 name) + ) + (helper nameMap (head bindings), Map.mapKeys (+ 1) nameMap <> Map.singleton 0 (fst $ head bindings)) + $ tail bindings + in PP.align $ + PP.vsep + [ "let" <+> PP.align finalDoc + , "in" <+> go False finalMap finalG ft + ] + go fl nameMap g (Apply _ t arg) = + (if fl then PP.parens else id) $ + let (l, f) = unwrapApply [] t + args = l <> [arg] + in PP.hang indentWidth $ PP.sep $ go False nameMap g f : (go True nameMap g <$> args) + +forcedPrefix :: String +forcedPrefix = "fr" + +freshVarName :: RandomGen g => Set Text -> g -> (Text, g) +freshVarName s' g' = if Set.member res s then freshVarName s' finalG else r + where + r@(res, finalG) = + first Txt.pack $ + foldl' + ( \(l, g) _ -> + let (res, newG) = uniformR (1, Txt.length chars - 1) g + in (Txt.index chars res : l, newG) + ) + ([], g) + [1 .. nameLen] + (nameLen, g) = randomR (1 :: Int, 7) g' + chars :: Text + chars = "abcdefghijkmnprstuvwxyz" + s = Set.union s' keywords + +keywords :: Set Text +keywords = + Set.fromList $ + ["let", "in"] + <> map (fromString . show . PP.pretty) [(minBound @PLC.DefaultFun) .. maxBound] + +indentWidth :: Int +indentWidth = 2 + +unwrapLamAbs :: Index -> UPLC.Term name uni fun ann -> (Index, UPLC.Term name uni fun ann) +unwrapLamAbs d (LamAbs _ _ t) = unwrapLamAbs (d + 1) t +unwrapLamAbs d a = (d, a) + +unwrapBindings :: [UPLC.Term name uni fun ann] -> UPLC.Term name uni fun ann -> ([UPLC.Term name uni fun ann], UPLC.Term name uni fun ann) +unwrapBindings l (Apply _ (LamAbs _ _ t) arg) = unwrapBindings (arg : l) t +unwrapBindings l a = (l, a) + +unwrapApply :: + [UPLC.Term name uni fun ann] -> + UPLC.Term name uni fun ann -> + ([UPLC.Term name uni fun ann], UPLC.Term name uni fun ann) +unwrapApply l (Apply _ t arg) = unwrapApply (arg : l) t +unwrapApply l arg = (l, arg) + +pattern PFixAst :: UPLC.Term name uni fun () +pattern PFixAst <- + LamAbs + () + _ + ( Apply + () + ( LamAbs + () + _ + ( Apply + () + (Var () _) + ( LamAbs + () + _ + ( Apply + () + ( Apply + () + (Var () _) + (Var () _) + ) + (Var () _) + ) + ) + ) + ) + ( LamAbs + () + _ + ( Apply + () + (Var () _) + ( LamAbs + () + _ + ( Apply + () + ( Apply + () + (Var () _) + (Var () _) + ) + (Var () _) + ) + ) + ) + ) + ) + +pattern ComposeAST :: UPLC.Term DeBruijn uni fun () -> UPLC.Term DeBruijn uni fun () -> UPLC.Term DeBruijn uni fun () +pattern ComposeAST f g <- LamAbs () _ (Apply () f (Apply () g (Var () (DeBruijn 1)))) diff --git a/plutarch.cabal b/plutarch.cabal index d314ef076..c0ccec102 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -122,6 +122,7 @@ library Plutarch.Monadic Plutarch.Pair Plutarch.Prelude + Plutarch.Pretty Plutarch.Rational Plutarch.Rec Plutarch.Rec.TH @@ -149,6 +150,8 @@ library , plutus-core , plutus-ledger-api , plutus-tx + , prettyprinter + , random , rank2classes , serialise , sop-core From 5142cdab48a5505f4edabacc9564058162d3ef13 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 27 Apr 2022 13:14:24 +0530 Subject: [PATCH 379/584] Fix plutarch-extra build failure --- plutarch-extra/Plutarch/Extra/Api.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 04f4f8444..373752b82 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -14,7 +14,6 @@ import Plutarch.Api.V1 ( PTxOutRef, ) import Plutarch.Prelude -import Plutarch.TryFrom (PTryFrom, ptryFrom) {- | Find the output txns corresponding to the input being validated. From f454d2a0c35ca017f4e338c1f17e2803ec4f4638 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 27 Apr 2022 17:46:14 +0530 Subject: [PATCH 380/584] Rename Api.Internal.Scripts -> Api.Internal.Hashing --- Plutarch/Api/Internal/{Scripts.hs => Hashing.hs} | 0 plutarch.cabal | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename Plutarch/Api/Internal/{Scripts.hs => Hashing.hs} (100%) diff --git a/Plutarch/Api/Internal/Scripts.hs b/Plutarch/Api/Internal/Hashing.hs similarity index 100% rename from Plutarch/Api/Internal/Scripts.hs rename to Plutarch/Api/Internal/Hashing.hs diff --git a/plutarch.cabal b/plutarch.cabal index d314ef076..765e5081f 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -82,7 +82,7 @@ library import: c exposed-modules: Plutarch - Plutarch.Api.Internal.Scripts + Plutarch.Api.Internal.Hashing Plutarch.Api.V1 Plutarch.Api.V1.Address Plutarch.Api.V1.AssocMap From d8135a1511e9f0cce792cf134dde0e8d17ad60c3 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 27 Apr 2022 17:49:09 +0530 Subject: [PATCH 381/584] Add `pubKeyHash` --- Plutarch/Api/Internal/Hashing.hs | 32 ++++++++++++++++++++------------ Plutarch/Api/V1.hs | 4 ++-- Plutarch/Api/V1/Crypto.hs | 10 ++++++++++ 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/Plutarch/Api/Internal/Hashing.hs b/Plutarch/Api/Internal/Hashing.hs index f6a4c23f3..bacc42e06 100644 --- a/Plutarch/Api/Internal/Hashing.hs +++ b/Plutarch/Api/Internal/Hashing.hs @@ -1,6 +1,7 @@ -module Plutarch.Api.Internal.Scripts ( +module Plutarch.Api.Internal.Hashing ( hashScriptWithPrefix, hashData, + hashLedgerBytes, ) where import Codec.Serialise (serialise) @@ -8,6 +9,7 @@ import Crypto.Hash (hashWith) import Crypto.Hash.Algorithms ( Blake2b_224 (Blake2b_224), Blake2b_256 (Blake2b_256), + HashAlgorithm, ) import Data.ByteArray (convert) import Data.ByteString (ByteString) @@ -17,20 +19,26 @@ import qualified Plutus.V1.Ledger.Api as Plutus import qualified Plutus.V1.Ledger.Scripts as Plutus import qualified PlutusTx.Builtins as PlutusTx +_plutusHashWith :: HashAlgorithm alg => alg -> ByteString -> PlutusTx.BuiltinByteString +_plutusHashWith alg = PlutusTx.toBuiltin . convert @_ @ByteString . hashWith alg + +hashBlake2b_224 :: ByteString -> PlutusTx.BuiltinByteString +hashBlake2b_224 = _plutusHashWith Blake2b_224 + +hashBlake2b_256 :: ByteString -> PlutusTx.BuiltinByteString +hashBlake2b_256 = _plutusHashWith Blake2b_256 + -- | Hash a Script with the given version prefix hashScriptWithPrefix :: ByteString -> Plutus.Script -> Plutus.ScriptHash hashScriptWithPrefix prefix scr = - Plutus.ScriptHash $ - PlutusTx.toBuiltin $ - convert @_ @ByteString $ - hashWith Blake2b_224 $ - prefix <> (Lazy.toStrict $ serialise scr) + Plutus.ScriptHash + . hashBlake2b_224 + $ prefix <> Lazy.toStrict (serialise scr) -- | Hash Plutus 'Data'. hashData :: Plutus.Data -> PlutusTx.BuiltinByteString -hashData = - PlutusTx.toBuiltin - . convert @_ @ByteString - . hashWith Blake2b_256 - . Lazy.toStrict - . serialise +hashData = hashBlake2b_256 . Lazy.toStrict . serialise + +-- | Hash 'LedgerBytes'. +hashLedgerBytes :: Plutus.LedgerBytes -> PlutusTx.BuiltinByteString +hashLedgerBytes = hashBlake2b_224 . Plutus.fromBuiltin . Plutus.getLedgerBytes diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 077a99c21..0f9336f39 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -20,7 +20,6 @@ module Plutarch.Api.V1 ( datumHash, redeemerHash, dataHash, - hashData, mkValidator, mkStakeValidator, mkMintingPolicy, @@ -35,6 +34,7 @@ module Plutarch.Api.V1 ( -- ** Crypto Crypto.PPubKeyHash (PPubKeyHash), + Crypto.pubKeyHash, -- ** DCert DCert.PDCert ( @@ -101,7 +101,7 @@ import qualified Plutus.V1.Ledger.Api as Plutus import qualified Plutus.V1.Ledger.Scripts as Plutus import Plutarch (compile) -import Plutarch.Api.Internal.Scripts (hashData, hashScriptWithPrefix) +import Plutarch.Api.Internal.Hashing (hashData, hashScriptWithPrefix) import Plutarch.Api.V1.Contexts (PScriptContext) import Plutarch.Prelude diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index 3619b6b38..e3ef8fd76 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -3,10 +3,14 @@ module Plutarch.Api.V1.Crypto ( PPubKeyHash (PPubKeyHash), + PubKey (..), + pubKeyHash, ) where import qualified Plutus.V1.Ledger.Api as Plutus +import Data.Coerce (coerce) +import Plutarch.Api.Internal.Hashing (hashLedgerBytes) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), PConstantDecl, @@ -23,3 +27,9 @@ deriving via (DerivePConstantViaBuiltin Plutus.PubKeyHash PPubKeyHash PByteString) instance PConstantDecl Plutus.PubKeyHash + +newtype PubKey = PubKey {getPubKey :: Plutus.LedgerBytes} + deriving stock (Eq, Ord, Show) + +pubKeyHash :: PubKey -> Plutus.PubKeyHash +pubKeyHash = coerce hashLedgerBytes From 87d1dc317cb7f9fda52a85a4c1f22938ea7794ac Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 27 Apr 2022 18:11:05 +0530 Subject: [PATCH 382/584] Explicit export --- Plutarch/Api/V1/Crypto.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index e3ef8fd76..5ad4aed7d 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -3,7 +3,7 @@ module Plutarch.Api.V1.Crypto ( PPubKeyHash (PPubKeyHash), - PubKey (..), + PubKey (PubKey, getPubKey), pubKeyHash, ) where From 2bf864a3e6f9cffb93c8e99beef41f7bea75ef98 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 27 Apr 2022 11:47:51 -0400 Subject: [PATCH 383/584] test: Add hspecAndReturnForest, to avoid evaluating the test tree twice --- plutarch-test/Main.hs | 10 +++--- plutarch-test/common/Plutarch/Test.hs | 6 ++-- plutarch-test/common/Plutarch/Test/Run.hs | 40 +++++++++++++++++++---- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 206697b7c..8edbf31ae 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -8,24 +8,26 @@ import qualified ExtraSpec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) import qualified Plutarch.FieldSpec as FieldSpec import qualified Plutarch.MonadicSpec as MonadicSpec -import Plutarch.Test.Run (noUnusedGoldens) +import Plutarch.Test.Run (noUnusedGoldens, hspecAndReturnForest) +import Test.Hspec (Spec, describe) #else import qualified Plutarch.FFISpec as FFISpec +import Test.Hspec (Spec, describe, hspec) #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) -import Test.Hspec (Spec, describe, hspec) main :: IO () main = do setLocaleEncoding utf8 - hspec spec -- We test for unused goldens, but do so only in GHC 9. Because, under GHC 8 -- certain modules are disabled (see the CPP below) which leads to legitimately -- unused goldens detected leading to false positive in test failure. #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) - noUnusedGoldens spec + noUnusedGoldens =<< hspecAndReturnForest spec +#else + hspec spec #endif spec :: Spec diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index 8ea891375..37d4fed49 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -26,8 +26,6 @@ module Plutarch.Test ( (@==), pgoldenSpec, pgoldenSpec', - noUnusedGoldens, - noUnusedGoldens', PlutarchGoldens, GoldenConf (..), GoldenTest (..), @@ -35,6 +33,10 @@ module Plutarch.Test ( -- * Benchmark type for use in `(@:->)` Benchmark (Benchmark, exBudgetCPU, exBudgetMemory, scriptSizeBytes), ScriptSizeBytes, + + -- * Test runner related utilities + noUnusedGoldens, + noUnusedGoldens', ) where import Data.Text (Text) diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index 12a19e75a..5148255e9 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -1,4 +1,8 @@ -module Plutarch.Test.Run (noUnusedGoldens, noUnusedGoldens') where +module Plutarch.Test.Run ( + noUnusedGoldens, + noUnusedGoldens', + hspecAndReturnForest, +) where import Control.Monad (forM_) import Data.Default (def) @@ -12,10 +16,24 @@ import Plutarch.Test.Golden ( mkGoldenKeyFromSpecPath, ) import System.Directory (listDirectory) +import System.Environment (getArgs, withArgs) import System.Exit (ExitCode (ExitFailure), exitWith) import System.FilePath (()) import Test.Hspec (Spec) -import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup), runSpecM) +import Test.Hspec.Core.Runner (defaultConfig, evalSpec, evaluateSummary, readConfig, runSpecForest) +import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup)) + +{- | Like `hspec`, but returns the test forest after running the tests. + + Based on https://github.com/hspec/hspec/issues/649#issuecomment-1092423220 +-} +hspecAndReturnForest :: Spec -> IO [SpecTree ()] +hspecAndReturnForest spec0 = do + (config, spec) <- evalSpec defaultConfig spec0 + getArgs >>= readConfig config + >>= withArgs [] . runSpecForest spec + >>= evaluateSummary -- use evaluateResult instead, if you are on #656 + return spec {- | Ensures that there are no unused goldens left behind. @@ -24,19 +42,27 @@ import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup), runSp actual files existing on disk. If any golden file exists on disk, but is not tracked by the `SpecTree` this function will fail, reporting the list of untracked golden files. + + __Example:__ + + @ + noUnusedGoldens =<< hspecAndReturnForest spec + @ -} -noUnusedGoldens :: Spec -> IO () +noUnusedGoldens :: [SpecTree ()] -> IO () noUnusedGoldens = noUnusedGoldens' def {- | Like 'noUnusedGoldens' but takes a custom path to the golden storage. -NOTE: This relies on the same 'GoldenConf' being used in all 'pgoldenSpec'' calls. + NOTE: This relies on the assumption that the same 'GoldenConf' is used in all +'pgoldenSpec'' calls. This function will go away after +https://github.com/Plutonomicon/plutarch/issues/458 -} -noUnusedGoldens' :: GoldenConf -> Spec -> IO () -noUnusedGoldens' conf@(GoldenConf {goldenBasePath}) spec = do +noUnusedGoldens' :: GoldenConf -> [SpecTree ()] -> IO () +noUnusedGoldens' conf@(GoldenConf {goldenBasePath}) specForest = do -- A second traversal here (`runSpecM`) can be obviated after -- https://github.com/hspec/hspec/issues/649 - usedGoldens <- goldenPathsUsedBy conf . snd <$> runSpecM spec + let usedGoldens = goldenPathsUsedBy conf specForest unusedGoldens goldenBasePath usedGoldens >>= \case [] -> pure () unused -> do From 98a539b55bfe28870a6b9c67a657f7cfe60c829d Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 29 Apr 2022 20:41:09 +0530 Subject: [PATCH 384/584] Pretty constants --- Plutarch/Pretty.hs | 53 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index 84b3a1d1a..4085cd104 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -1,8 +1,11 @@ {-# LANGUAGE PatternSynonyms #-} -module Plutarch.Pretty (prettyTerm) where +module Plutarch.Pretty (prettyTerm, prettyScript, prettyConstant) where import Data.Bifunctor (first) +import Data.ByteString (ByteString) +import qualified Data.ByteString as LBS +import qualified Data.ByteString.Builder as BSB import Data.List (foldl') import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map @@ -11,6 +14,7 @@ import qualified Data.Set as Set import Data.String (fromString) import Data.Text (Text) import qualified Data.Text as Txt +import qualified Data.Text.Encoding as TxtEnc import System.Random ( Random (randomR), @@ -24,6 +28,7 @@ import qualified Prettyprinter as PP import Plutus.V1.Ledger.Scripts (Script (unScript)) import qualified PlutusCore as PLC +import qualified PlutusCore.Data as Plutus import UntypedPlutusCore ( DeBruijn (DeBruijn), DefaultFun, @@ -36,8 +41,11 @@ import qualified UntypedPlutusCore as UPLC (Term) import Plutarch.Internal.Other (ClosedTerm, compile) +prettyScript :: Script -> PP.Doc () +prettyScript = prettyUPLC . _progTerm . unScript + prettyTerm :: ClosedTerm a -> PP.Doc () -prettyTerm x = prettyUPLC . _progTerm . unScript $ compile x +prettyTerm x = prettyScript $ compile x {- This isn't suitable for pretty printing UPLC from any source. It's primarily suited for Plutarch output. @@ -47,7 +55,7 @@ prettyUPLC :: UPLC.Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () prettyUPLC = go False mempty $ mkStdGen 42 where go :: RandomGen g => Bool -> Map Index Text -> g -> UPLC.Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () - go _ _ _ (Constant _ c) = PP.pretty c + go _ _ _ (Constant _ c) = prettyConstant c go _ _ _ (Builtin _ b) = PP.pretty b go _ _ _ (Error _) = "ERROR" go _ nameMap _ (Var _ (DeBruijn x)) = case Map.lookup (x - 1) nameMap of @@ -119,6 +127,45 @@ prettyUPLC = go False mempty $ mkStdGen 42 args = l <> [arg] in PP.hang indentWidth $ PP.sep $ go False nameMap g f : (go True nameMap g <$> args) +prettyConstant :: PLC.Some (PLC.ValueOf DefaultUni) -> PP.Doc () +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniInteger n)) = PP.pretty n +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniByteString b)) = PP.pretty $ fromHex b +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniString s)) = PP.pretty s +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniUnit _)) = "()" +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniBool b)) = PP.pretty b +prettyConstant (PLC.Some (PLC.ValueOf (PLC.DefaultUniList a) l)) = + PP.list $ + map (prettyConstant . PLC.Some . PLC.ValueOf a) l +prettyConstant (PLC.Some (PLC.ValueOf (PLC.DefaultUniPair a b) ~(x, y))) = + PP.tupled + [prettyConstant . PLC.Some $ PLC.ValueOf a x, prettyConstant . PLC.Some $ PLC.ValueOf b y] +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.Constr ix dl))) = + "Σ" <> PP.pretty ix <> "." + <> PP.list (prettyConstant . PLC.Some . PLC.ValueOf PLC.DefaultUniData <$> dl) +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.Map ascList))) = + PP.group + . PP.encloseSep (PP.flatAlt "{ " "{") (PP.flatAlt " }" "}") ", " + $ map + ( \(a, b) -> + PP.hang indentWidth $ + PP.sep + [ prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData a)) <+> "=" + , prettyConstant $ PLC.Some $ PLC.ValueOf PLC.DefaultUniData b + ] + ) + ascList +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.List l))) = + "#" <> PP.list (prettyConstant . PLC.Some . PLC.ValueOf PLC.DefaultUniData <$> l) +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.B b))) = + "#" <> prettyConstant (PLC.Some $ PLC.ValueOf PLC.DefaultUniByteString b) +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.I i))) = + "#" <> prettyConstant (PLC.Some $ PLC.ValueOf PLC.DefaultUniInteger i) +prettyConstant (PLC.Some (PLC.ValueOf uni _)) = + error $ "prettyConstant(impossible): " <> show uni + +fromHex :: ByteString -> Text +fromHex = ("0x" <>) . TxtEnc.decodeUtf8 . LBS.toStrict . BSB.toLazyByteString . BSB.byteStringHex + forcedPrefix :: String forcedPrefix = "fr" From ef92bfafa694c0a11be714aeb516e81259d34f84 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sat, 30 Apr 2022 16:09:15 +0530 Subject: [PATCH 385/584] Fix build --- Plutarch/Pretty.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index 4085cd104..aa615d855 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -4,8 +4,8 @@ module Plutarch.Pretty (prettyTerm, prettyScript, prettyConstant) where import Data.Bifunctor (first) import Data.ByteString (ByteString) -import qualified Data.ByteString as LBS import qualified Data.ByteString.Builder as BSB +import qualified Data.ByteString.Lazy as LBS import Data.List (foldl') import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map @@ -26,6 +26,7 @@ import System.Random ( import Prettyprinter ((<+>)) import qualified Prettyprinter as PP +import Plutarch.Internal.Other (ClosedTerm, compile) import Plutus.V1.Ledger.Scripts (Script (unScript)) import qualified PlutusCore as PLC import qualified PlutusCore.Data as Plutus @@ -39,8 +40,6 @@ import UntypedPlutusCore ( ) import qualified UntypedPlutusCore as UPLC (Term) -import Plutarch.Internal.Other (ClosedTerm, compile) - prettyScript :: Script -> PP.Doc () prettyScript = prettyUPLC . _progTerm . unScript From 348ac390cbb104d6512c62319ab702330a4596f2 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 3 May 2022 18:47:34 +0530 Subject: [PATCH 386/584] Add some useful exports --- Plutarch/DataRepr/Internal/Field.hs | 1 + plutarch-test/common/Plutarch/Test.hs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Plutarch/DataRepr/Internal/Field.hs b/Plutarch/DataRepr/Internal/Field.hs index ab9a6f4fa..46571082c 100644 --- a/Plutarch/DataRepr/Internal/Field.hs +++ b/Plutarch/DataRepr/Internal/Field.hs @@ -9,6 +9,7 @@ module Plutarch.DataRepr.Internal.Field ( -- * BindFields class mechanism BindFields (..), + type Bindings, type BoundTerms, type Drop, diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index 37d4fed49..c30c573f6 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -37,6 +37,7 @@ module Plutarch.Test ( -- * Test runner related utilities noUnusedGoldens, noUnusedGoldens', + hspecAndReturnForest, ) where import Data.Text (Text) @@ -61,7 +62,7 @@ import Plutarch.Test.Golden ( (@\), (@|), ) -import Plutarch.Test.Run (noUnusedGoldens, noUnusedGoldens') +import Plutarch.Test.Run (hspecAndReturnForest, noUnusedGoldens, noUnusedGoldens') import qualified Plutus.V1.Ledger.Scripts as Scripts import Test.Hspec (Expectation, Spec, describe, expectationFailure, shouldBe, shouldSatisfy) import Test.Tasty.HUnit (assertFailure) From c2200798f8e6264afa0777e697c4a3646ebf77b5 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 3 May 2022 19:18:54 +0530 Subject: [PATCH 387/584] Add `HRecOf` --- Plutarch/DataRepr.hs | 1 + Plutarch/DataRepr/Internal/Field.hs | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Plutarch/DataRepr.hs b/Plutarch/DataRepr.hs index 284945fe9..7ce6cdc2f 100644 --- a/Plutarch/DataRepr.hs +++ b/Plutarch/DataRepr.hs @@ -23,6 +23,7 @@ module Plutarch.DataRepr ( F.pletFields, F.pfield, F.HRec, + F.HRecOf, ) where import qualified Plutarch.DataRepr.Internal as I diff --git a/Plutarch/DataRepr/Internal/Field.hs b/Plutarch/DataRepr/Internal/Field.hs index 46571082c..89fb47379 100644 --- a/Plutarch/DataRepr/Internal/Field.hs +++ b/Plutarch/DataRepr/Internal/Field.hs @@ -12,6 +12,7 @@ module Plutarch.DataRepr.Internal.Field ( type Bindings, type BoundTerms, type Drop, + type HRecOf, -- * Re-exports HRec (..), @@ -113,6 +114,15 @@ instance type PFields (PAsData a) = PFields a ptoFields = ptoFields . pfromData +-- | The 'HRec' yielded by 'pletFields @fs t'. +type HRecOf t fs s = + HRec + ( BoundTerms + (PFields t) + (Bindings (PFields t) fs) + s + ) + {- | Bind a HRec of named fields containing all the specified fields. @@ -125,7 +135,7 @@ pletFields :: , BindFields ps bs ) => Term s a -> - (HRec (BoundTerms ps bs s) -> Term s b) -> + (HRecOf a fs s -> Term s b) -> Term s b pletFields t = runTermCont $ From aae93b7d247c250d2e2da4d09d684dfcd41a1159 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 4 May 2022 19:20:08 +0530 Subject: [PATCH 388/584] Add `PMemberFields` --- Plutarch/DataRepr.hs | 2 ++ Plutarch/DataRepr/Internal.hs | 6 ++++ Plutarch/DataRepr/Internal/Field.hs | 43 ++++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/Plutarch/DataRepr.hs b/Plutarch/DataRepr.hs index 7ce6cdc2f..edd2c2a5b 100644 --- a/Plutarch/DataRepr.hs +++ b/Plutarch/DataRepr.hs @@ -24,6 +24,8 @@ module Plutarch.DataRepr ( F.pfield, F.HRec, F.HRecOf, + F.PMemberFields, + F.PMemberField, ) where import qualified Plutarch.DataRepr.Internal as I diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index de6f92a5a..059d1113a 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -18,6 +18,7 @@ module Plutarch.DataRepr.Internal ( PLabeledType (..), type PLabelIndex, type PUnLabel, + type PLookupLabel, PIsDataRepr (..), PIsDataReprInstances (..), pindexDataRecord, @@ -248,6 +249,11 @@ type family PLabelIndex (name :: Symbol) (as :: [PLabeledType]) :: Nat where PLabelIndex name ((name ':= a) ': as) = 0 PLabelIndex name (_ ': as) = (PLabelIndex name as) + 1 +type PLookupLabel :: Symbol -> [PLabeledType] -> PType +type family PLookupLabel name as where + PLookupLabel name ((name ':= a) ': as) = a + PLookupLabel name (_ ': as) = PLookupLabel name as + type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (name ':= a) = a diff --git a/Plutarch/DataRepr/Internal/Field.hs b/Plutarch/DataRepr/Internal/Field.hs index 89fb47379..488c08f38 100644 --- a/Plutarch/DataRepr/Internal/Field.hs +++ b/Plutarch/DataRepr/Internal/Field.hs @@ -13,6 +13,8 @@ module Plutarch.DataRepr.Internal.Field ( type BoundTerms, type Drop, type HRecOf, + type PMemberFields, + type PMemberField, -- * Re-exports HRec (..), @@ -26,7 +28,7 @@ import GHC.TypeLits ( Symbol, ) -import Data.Kind (Type) +import Data.Kind (Constraint, Type) import Plutarch ( PType, S, @@ -54,6 +56,7 @@ import Plutarch.DataRepr.Internal ( pindexDataRecord, punDataSum, type PLabelIndex, + type PLookupLabel, type PUnLabel, ) import Plutarch.DataRepr.Internal.FromData (PFromDataable, pmaybeFromAsData) @@ -62,6 +65,8 @@ import Plutarch.DataRepr.Internal.HList ( Labeled (Labeled, unLabeled), hrecField, type Drop, + type ElemOf, + type IndexLabel, type IndexList, type SingleItem, ) @@ -123,6 +128,42 @@ type HRecOf t fs s = s ) +{- | Constrain an 'HRec' to contain the specified fields from the given Plutarch type. + +=== Example === + +@ +import qualified GHC.Generics as GHC +import Generics.SOP + +import Plutarch.Prelude +import Plutarch.DataRepr + +newtype PFooType s = PFooType (Term s (PDataRecord '["frst" ':= PInteger, "scnd" ':= PBool, "thrd" ':= PString])) + deriving stock (GHC.Generic) + deriving anyclass (Generic) + deriving anyclass (PIsDataRepr) + deriving + (PlutusType, PIsData, PDataFields, PEq) + via PIsDataReprInstances PFooType + +foo :: PMemberFields PFooType '["scnd", "frst"] s as => HRec as -> Term s PInteger +foo h = pif (getField @"scnd" h) (getField @"frst" h) 0 +@ +-} +type PMemberFields :: PType -> [Symbol] -> S -> [(Symbol, Type)] -> Constraint +type family PMemberFields t fs s as where + PMemberFields _ '[] _ _ = () + PMemberFields t (name ': rest) s as = (PMemberField t name s as, PMemberFields t rest s as) + +-- | Single field version of 'PMemberFields'. +type PMemberField :: PType -> Symbol -> S -> [(Symbol, Type)] -> Constraint +type family PMemberField t name s as where + PMemberField t name s as = + ( IndexLabel name as ~ Term s (PAsData (PLookupLabel name (PFields t))) + , ElemOf name (Term s (PAsData (PLookupLabel name (PFields t)))) as + ) + {- | Bind a HRec of named fields containing all the specified fields. From d561deeaab246832365d00a0556ae0b76e09ef8a Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 4 May 2022 21:45:02 +0530 Subject: [PATCH 389/584] Move `Plutarch.ListUtils` -> `Plutarch.Extra.List` --- plutarch-extra/Plutarch/{ListUtils.hs => Extra/List.hs} | 2 +- plutarch-extra/plutarch-extra.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename plutarch-extra/Plutarch/{ListUtils.hs => Extra/List.hs} (90%) diff --git a/plutarch-extra/Plutarch/ListUtils.hs b/plutarch-extra/Plutarch/Extra/List.hs similarity index 90% rename from plutarch-extra/Plutarch/ListUtils.hs rename to plutarch-extra/Plutarch/Extra/List.hs index 24dd40e05..3e470edf1 100644 --- a/plutarch-extra/Plutarch/ListUtils.hs +++ b/plutarch-extra/Plutarch/Extra/List.hs @@ -1,4 +1,4 @@ -module Plutarch.ListUtils (preverse, pcheckSorted) where +module Plutarch.Extra.List (preverse, pcheckSorted) where import Plutarch.Prelude diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index aa03fdb94..99f6121aa 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -82,6 +82,6 @@ library Plutarch.Extra Plutarch.Extra.Api Plutarch.Extra.TermCont - Plutarch.ListUtils + Plutarch.Extra.List -- other-modules: From 3f7e5c1627232db140934f8e716e0a9e747b61e4 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 4 May 2022 21:57:39 +0530 Subject: [PATCH 390/584] Move `ListUtilsSpec` --- plutarch-extra/plutarch-extra.cabal | 2 +- .../Plutarch/{ListUtilsSpec.hs => Extra/ListSpec.hs} | 4 ++-- plutarch-test/plutarch-test.cabal | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename plutarch-test/plutarch-extra/Plutarch/{ListUtilsSpec.hs => Extra/ListSpec.hs} (92%) diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index 99f6121aa..2c372f042 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -81,7 +81,7 @@ library exposed-modules: Plutarch.Extra Plutarch.Extra.Api - Plutarch.Extra.TermCont Plutarch.Extra.List + Plutarch.Extra.TermCont -- other-modules: diff --git a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ListSpec.hs similarity index 92% rename from plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs rename to plutarch-test/plutarch-extra/Plutarch/Extra/ListSpec.hs index 2e5440097..78be1e786 100644 --- a/plutarch-test/plutarch-extra/Plutarch/ListUtilsSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ListSpec.hs @@ -1,6 +1,6 @@ -module Plutarch.ListUtilsSpec (spec) where +module Plutarch.Extra.ListSpec (spec) where -import Plutarch.ListUtils (pcheckSorted, preverse) +import Plutarch.Extra.List (pcheckSorted, preverse) import Plutarch.Prelude import Hedgehog (Property) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index bca637217..6cc361ff5 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -156,10 +156,10 @@ executable plutarch-test Plutarch.ByteStringSpec Plutarch.EitherSpec Plutarch.Extra.ApiSpec + Plutarch.Extra.ListSpec Plutarch.IntegerSpec Plutarch.LiftSpec Plutarch.ListSpec - Plutarch.ListUtilsSpec Plutarch.MaybeSpec Plutarch.PairSpec Plutarch.PIsDataSpec From 01bdff0fc4d78f80a80d013167ff72a5ced8b19b Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 4 May 2022 21:58:07 +0530 Subject: [PATCH 391/584] Add more `TermCont` utilities --- plutarch-extra/Plutarch/Extra/TermCont.hs | 72 ++++++++++++++++++++++- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/TermCont.hs b/plutarch-extra/Plutarch/Extra/TermCont.hs index 44467c314..cbb6b66dc 100644 --- a/plutarch-extra/Plutarch/Extra/TermCont.hs +++ b/plutarch-extra/Plutarch/Extra/TermCont.hs @@ -1,13 +1,21 @@ -{- | TermCont-related adapters for Plutarch functions. +{-# LANGUAGE AllowAmbiguousTypes #-} - TODO: More functions (pletFieldsC, ptraceC, ...) need to be added here. --} +-- | TermCont-related adapters for Plutarch functions. module Plutarch.Extra.TermCont ( pletC, pmatchC, + pletFieldsC, + ptraceC, + pguardC, + pguardC', + ptryFromC, ) where +import Plutarch.DataRepr +import Plutarch.DataRepr.Internal.Field import Plutarch.Prelude +import Plutarch.Reducible +import Plutarch.TryFrom -- | Like `plet` but works in a `TermCont` monad pletC :: Term s a -> TermCont s (Term s a) @@ -16,3 +24,61 @@ pletC = tcont . plet -- | Like `pmatch` but works in a `TermCont` monad pmatchC :: PMatch a => Term s a -> TermCont s (a s) pmatchC = tcont . pmatch + +-- | Like `pletFields` but works in a `TermCont` monad. +pletFieldsC :: + forall fs a s b ps bs. + ( PDataFields a + , ps ~ PFields a + , bs ~ Bindings ps fs + , BindFields ps bs + ) => + Term s a -> + TermCont @b s (HRec (BoundTerms ps bs s)) +pletFieldsC x = tcont $ pletFields @fs x + +{- | Like `ptrace` but works in a `TermCont` monad. + +=== Example === + +@ +foo :: Term s PUnit +foo = unTermCont $ do + ptraceC "returning unit!" + pure $ pconstant () +@ +-} +ptraceC :: Term s PString -> TermCont s () +ptraceC s = tcont $ \f -> ptrace s (f ()) + +{- | Trace a message and raise error if 'cond' is false. Otherwise, continue. + +=== Example === + +@ +onlyAllow42 :: Term s (PInteger :--> PUnit) +onlyAllow42 = plam $ \i -> unTermCont $ do + pguardC "expected 42" $ i #== 42 + pure $ pconstant () +@ +-} +pguardC :: Term s PString -> Term s PBool -> TermCont s () +pguardC s cond = tcont $ \f -> pif cond (f ()) $ ptraceError s + +{- | Stop computation and return given term if 'cond' is false. Otherwise, continue. + +=== Example === + +@ +is42 :: Term s (PInteger :--> PBool) +is42 = plam $ \i -> unTermCont $ do + pguardC "expected 42" (pconstant False) $ i #== 42 + pure $ pconstant True +@ +-} +pguardC' :: Term s a -> Term s PBool -> TermCont @a s () +pguardC' r cond = tcont $ \f -> pif cond (f ()) r + +-- | 'TermCont' producing version of 'ptryFrom'. +ptryFromC :: forall b r a s. PTryFrom a b => Term s a -> TermCont @r s (Term s b, Reduce (PTryFromExcess a b s)) +ptryFromC = tcont . ptryFrom From 6ec4d1990cffab228454bfda62303a0ab11ca947 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 4 May 2022 21:58:32 +0530 Subject: [PATCH 392/584] Add docs on `HRecOf` and `PMemberFields` --- docs/README.md | 1 + docs/Tricks.md | 1 + docs/Tricks/Working with bound fields.md | 77 ++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 docs/Tricks/Working with bound fields.md diff --git a/docs/README.md b/docs/README.md index b3ab4ce53..03eec8fc4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -139,6 +139,7 @@ Outside of the fundamental user guide, there are rules of thumb and general guid - [Prefer statically building constants whenever possible](./Tricks/Prefer%20statically%20building%20constants.md) - [Figuring out the representation of a Plutarch type](./Tricks/Representation%20of%20Plutarch%20type.md) - [Prefer pattern matching on the result of `pmatch` immediately](./Tricks/Prefer%20matching%20on%20pmatch%20result%20immediately.md) +- [Working with bound fields yielded by `pletFields`](./Tricks/Working%20with%20bound%20fields.md) # Common Issues and Troubleshooting diff --git a/docs/Tricks.md b/docs/Tricks.md index 89af470f2..2afabf2cd 100644 --- a/docs/Tricks.md +++ b/docs/Tricks.md @@ -13,3 +13,4 @@ This document discusses various rules of thumb and general trivia, aiming to mak - [Prefer statically building constants whenever possible](./Tricks/Prefer%20statically%20building%20constants.md) - [Figuring out the representation of a Plutarch type](./Tricks/Representation%20of%20Plutarch%20type.md) - [Prefer pattern matching on the result of `pmatch` immediately](./Tricks/Prefer%20matching%20on%20pmatch%20result%20immediately.md) +- [Working with bound fields yielded by `pletFields`](./Tricks/Working%20with%20bound%20fields.md) diff --git a/docs/Tricks/Working with bound fields.md b/docs/Tricks/Working with bound fields.md new file mode 100644 index 000000000..99f2b1f12 --- /dev/null +++ b/docs/Tricks/Working with bound fields.md @@ -0,0 +1,77 @@ +# Working with bound fields yielded by `pletFields` + +You may have noticed that `pletFields` actually returns a Haskell level heterogenous list, with all the interesting fields "bound" to it. Only the fields you actually use from these bindings are extracted and put into the resulting script. Therefore, you _only pay for what you use_. + +```hs +pletFields :: + forall fs a s b ps bs. + ( PDataFields a + , ps ~ (PFields a) + , bs ~ (Bindings ps fs) + , BindFields ps bs + ) => + Term s a -> + (HRecOf a fs s -> Term s b) -> + Term s b +``` + +The real juice of that massive type is the `HRecOf`, which is a utility type alias you can use in functions that operate on the return value of `pletFields`: + +```hs +import qualified GHC.Generics as GHC +import Generics.SOP + +import Plutarch.Prelude +import Plutarch.DataRepr + +newtype PFooType s = PFooType (Term s (PDataRecord '["frst" ':= PInteger, "scnd" ':= PBool, "thrd" ':= PString])) + deriving stock (GHC.Generic) + deriving anyclass (Generic) + deriving anyclass (PIsDataRepr) + deriving + (PlutusType, PIsData, PDataFields, PEq) + via PIsDataReprInstances PFooType + +foo :: HRecOf PFooType '["scnd", "frst"] s -> Term s PInteger +foo h = pif (getField @"scnd" h) (getField @"frst" h) 0 +``` + +This is very useful for single use functions that you use as "branches" in your validators - they work more like macros or templates rather than real functions. For example, you might have different branches for different constructors of a redeemer, but all branches end up needing to do common field extraction. You could abstract it out using: + +```hs +firstRedmCheck :: HRecOf PTxInfo '["inputs", "outputs", "mint", "datums"] s -> TermCont s (Term s PUnit) +firstRedmCheck info = do + -- Do checks with info fields here. + pure $ pconstant () + +secondRedmCheck : HRecOf PTxInfo '["inputs", "outputs", "mint", "datums"] s -> TermCont s (Term s PUnit) +secondRedmCheck info = do + -- Do checks with info fields here. + pure $ pconstant () + +coreValidator = plam $ \_ redm ctx' -> unTermCont $ do + ctx <- tcont $ pletFields @'["txInfo", "purpose"] ctx' + info <- tcont $ pletFields @'["inputs", "outputs", "mint", "datums"] $ getField @"txInfo" ctx + pmatchC redm >>= \case + FirstRedm _ -> firstRedmCheck info + SecondRedm _ -> secondRedmCheck info +``` + +Without it, you may have to fallback to deconstructing `info` with `pletFields` in every single branch. + +However, this is rather _nominal_. What if you don't need the exact same fields in all branches? Let's go back to the example with `foo` and `FooType`. What if someone has: + +```hs +fooTypeHrec <- tcont $ pletFields @'["frst", "scnd", "thrd"] fooTypeValue +foo fooTypeHrec +-- uh oh +``` + +The type required by `foo` should _morally_ work just fine with `fooTypeHrec`, but it won't! What we really want, is some sort of row polymorphism. This is where the `PMemberFields` type from `Plutarch.DataRepr` comes in: + +```hs +foo :: PMemberFields PFooType '["scnd", "frst"] s as => HRec as -> Term s PInteger +foo h = pif (getField @"scnd" h) (getField @"frst" h) 0 +``` + +Now `foo` merely requires the `HRec` to have the `"scnd"` and `"frst"` fields from `PFooType`, more fields are allowed just fine! From b2b9e0586233cfe5977eb067d380f0838877b4d6 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 4 May 2022 22:02:20 +0530 Subject: [PATCH 393/584] Use explicit imports --- plutarch-extra/Plutarch/Extra/TermCont.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/TermCont.hs b/plutarch-extra/Plutarch/Extra/TermCont.hs index cbb6b66dc..63ae2527c 100644 --- a/plutarch-extra/Plutarch/Extra/TermCont.hs +++ b/plutarch-extra/Plutarch/Extra/TermCont.hs @@ -11,11 +11,15 @@ module Plutarch.Extra.TermCont ( ptryFromC, ) where -import Plutarch.DataRepr -import Plutarch.DataRepr.Internal.Field +import Plutarch.DataRepr (HRec, PDataFields, PFields) +import Plutarch.DataRepr.Internal.Field ( + BindFields, + Bindings, + BoundTerms, + ) import Plutarch.Prelude -import Plutarch.Reducible -import Plutarch.TryFrom +import Plutarch.Reducible (Reduce) +import Plutarch.TryFrom (PTryFromExcess) -- | Like `plet` but works in a `TermCont` monad pletC :: Term s a -> TermCont s (Term s a) From 6a932876e9856c13aa2796eaf608f699758560e3 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 4 May 2022 22:05:51 +0530 Subject: [PATCH 394/584] Update CHANGELOG --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e07760238..4f1237617 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -153,6 +153,22 @@ Added by: [#345](https://github.com/Plutonomicon/plutarch/pull/345) +- Add `HRecOf`, `PMemberFields`, and `PMemberField` utility types. + + Module: `Plutarch.DataRepr`. + + Added by: [#466](https://github.com/Plutonomicon/plutarch/pull/466) + +- Move `Plutarch.ListUtils` to `Plutarch.Extra.List`. + + Added by: [#466](https://github.com/Plutonomicon/plutarch/pull/466) + +- Add various `TermCont` utilities: `ptraceC`, `pletFieldsC`, `ptryFromC`, `pguardC`, and `pguardC'`. + + Module: `Plutarch.Extra.TermCont`. + + Added by: [#466](https://github.com/Plutonomicon/plutarch/pull/466) + # 1.1.0 - General repository changes. From 0399120f05083cd1d6dbff442cad3606c4eaad5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 23 Mar 2022 17:15:56 -0400 Subject: [PATCH 395/584] Added AssocMap.singleton and Value.singleton --- Plutarch/Api/V1/AssocMap.hs | 8 +++++++- Plutarch/Api/V1/Value.hs | 10 ++++++++++ plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 7853d5489..c8be483ec 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -3,12 +3,13 @@ module Plutarch.Api.V1.AssocMap ( PMap (PMap), + singleton, ) where import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap -import Plutarch.Builtin (PBuiltinMap) +import Plutarch.Builtin (PBuiltinMap, ppairDataBuiltin) import Plutarch.Lift ( PConstantDecl, PConstantRepr, @@ -19,6 +20,7 @@ import Plutarch.Lift ( pconstantToRepr, ) import Plutarch.Prelude +import Plutarch.Unsafe (punsafeFrom) newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) deriving (PlutusType, PIsData) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) @@ -47,3 +49,7 @@ instance x' <- Plutus.fromData x y' <- Plutus.fromData y Just (x', y') + +-- | Construct a singleton 'PMap' with the given key and value +singleton :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v) +singleton = plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # pdata key # pdata value) # pnil) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 4281dcc2c..c9cdd027e 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -5,11 +5,13 @@ module Plutarch.Api.V1.Value ( PValue (PValue), PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), + singleton, ) where import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Api.V1.AssocMap (PMap) +import qualified Plutarch.Api.V1.AssocMap as AssocMap import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), @@ -17,6 +19,7 @@ import Plutarch.Lift ( PLifted, PUnsafeLiftDecl, ) +import Plutarch.Unsafe (punsafeFrom) import Plutarch.Prelude @@ -48,3 +51,10 @@ deriving via (DerivePConstantViaNewtype Plutus.Value PValue (PMap PCurrencySymbol (PMap PTokenName PInteger))) instance PConstantDecl Plutus.Value + +-- | Construct a singleton 'PValue' containing only the given quantity of the given currency. +singleton :: Term (s :: S) (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue) +singleton = + plam $ + \symbol token amount -> + punsafeFrom (AssocMap.singleton # symbol #$ AssocMap.singleton # token # amount) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 7e9733821..ed773953d 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -29,6 +29,7 @@ import Plutarch.Api.V1 ( PTxInfo, PValue, ) +import qualified Plutarch.Api.V1.Value as PValue import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude import Plutarch.Test @@ -56,6 +57,10 @@ spec = do $ \case PMinting c -> popaque c _ -> perror + describe "value" $ do + pgoldenSpec $ do + "singleton" @| PValue.singleton # pconstant "c0" # pconstant "sometoken" # 1 @-> \p -> + plift p @?= mint describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. From 03ff1c5e1b017d692661f85a9db2ddab8968da01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 24 Mar 2022 08:39:53 -0400 Subject: [PATCH 396/584] Added valueOf, lookup, lookupData, and pmaybe --- Plutarch/Api/V1/AssocMap.hs | 39 +++++++++++++++++++++++++++++++++++-- Plutarch/Api/V1/Value.hs | 18 +++++++++++++---- Plutarch/Maybe.hs | 9 +++++++++ 3 files changed, 60 insertions(+), 6 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index c8be483ec..410020e59 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -3,6 +3,8 @@ module Plutarch.Api.V1.AssocMap ( PMap (PMap), + lookup, + lookupData, singleton, ) where @@ -19,9 +21,12 @@ import Plutarch.Lift ( pconstantFromRepr, pconstantToRepr, ) +import Plutarch.Maybe (pmaybe) import Plutarch.Prelude import Plutarch.Unsafe (punsafeFrom) +import Prelude hiding (lookup) + newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) deriving (PlutusType, PIsData) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) @@ -50,6 +55,36 @@ instance y' <- Plutus.fromData y Just (x', y') --- | Construct a singleton 'PMap' with the given key and value +-- | Look up the given key in a 'PMap'. +lookup :: (PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMaybe v) +lookup = phoistAcyclic $ + plam $ \key -> + lookupDataWith + # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ pfromData $ psndBuiltin # pair) + # pdata key + +-- | Look up the given key data in a 'PMap'. +lookupData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) +lookupData = lookupDataWith # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) + +-- | Look up the given key data in a 'PMap', applying the given function to the found key-value pair. +lookupDataWith :: + (PIsData k, PIsData v) => + Term + (s :: S) + ( (PBuiltinPair (PAsData k) (PAsData v) :--> PMaybe x) + :--> PAsData k + :--> PMap k v + :--> PMaybe x + ) +lookupDataWith = phoistAcyclic $ + plam $ \unwrap key map -> + pmaybe # pcon PNothing # unwrap + #$ plet (plam $ \pair -> pfstBuiltin # pair #== key) + $ \predicate -> + pfind # predicate # pto map + +-- | Construct a singleton 'PMap' with the given key and value. singleton :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v) -singleton = plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # pdata key # pdata value) # pnil) +singleton = + plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # pdata key # pdata value) # pnil) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index c9cdd027e..41ca53a67 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -6,6 +6,7 @@ module Plutarch.Api.V1.Value ( PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), singleton, + valueOf, ) where import qualified Plutus.V1.Ledger.Api as Plutus @@ -54,7 +55,16 @@ deriving via -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. singleton :: Term (s :: S) (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue) -singleton = - plam $ - \symbol token amount -> - punsafeFrom (AssocMap.singleton # symbol #$ AssocMap.singleton # token # amount) +singleton = phoistAcyclic $ + plam $ \symbol token amount -> + punsafeFrom (AssocMap.singleton # symbol #$ AssocMap.singleton # token # amount) + +-- | Get the quantity of the given currency in the 'PValue'. +valueOf :: Term (s :: S) (PValue :--> PCurrencySymbol :--> PTokenName :--> PInteger) +valueOf = phoistAcyclic $ + plam $ \value symbol token -> + pmatch (AssocMap.lookup # symbol # pto value) $ \case + PNothing -> 0 + PJust submap -> pmatch (AssocMap.lookup # token # submap) $ \case + PNothing -> 0 + PJust amount -> amount diff --git a/Plutarch/Maybe.hs b/Plutarch/Maybe.hs index de30f94f4..5c4a92469 100644 --- a/Plutarch/Maybe.hs +++ b/Plutarch/Maybe.hs @@ -1,6 +1,7 @@ module Plutarch.Maybe ( PMaybe (PJust, PNothing), pfromJust, + pmaybe, ) where import qualified GHC.Generics as GHC @@ -14,6 +15,7 @@ import Plutarch ( phoistAcyclic, plam, pmatch, + (#), type (:-->), ) import Plutarch.Bool (PEq) @@ -34,3 +36,10 @@ pfromJust = phoistAcyclic $ plam $ \maybe -> pmatch maybe $ \case PNothing -> perror PJust a -> a + +-- | 'PMaybe' destructor equivalent to 'maybe' +pmaybe :: Term (s :: S) (b :--> (a :--> b) :--> PMaybe a :--> b) +pmaybe = phoistAcyclic $ + plam $ \nothing just maybe -> pmatch maybe $ \case + PNothing -> nothing + PJust a -> just # a From ac58aee69dbbadf60f2db4edae27c698932b1718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 24 Mar 2022 18:01:06 -0400 Subject: [PATCH 397/584] Added AssocMap.singletonData --- Plutarch/Api/V1/AssocMap.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 410020e59..37c24005f 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -6,6 +6,7 @@ module Plutarch.Api.V1.AssocMap ( lookup, lookupData, singleton, + singletonData, ) where import qualified Plutus.V1.Ledger.Api as Plutus @@ -86,5 +87,9 @@ lookupDataWith = phoistAcyclic $ -- | Construct a singleton 'PMap' with the given key and value. singleton :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v) -singleton = - plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # pdata key # pdata value) # pnil) +singleton = phoistAcyclic $ plam $ \key value -> singletonData # pdata key # pdata value + +-- | Construct a singleton 'PMap' with the given data-encoded key and value. +singletonData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v) +singletonData = phoistAcyclic $ + plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # key # value) # pnil) From 5e08c0f5668b2f4d0a7d31197de2b97df6898282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 24 Mar 2022 18:11:48 -0400 Subject: [PATCH 398/584] More tests --- plutarch-test/goldens/api.value.bench.golden | 2 ++ plutarch-test/goldens/api.value.uplc.eval.golden | 2 ++ plutarch-test/goldens/api.value.uplc.golden | 2 ++ plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 5 ++++- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 plutarch-test/goldens/api.value.bench.golden create mode 100644 plutarch-test/goldens/api.value.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.value.uplc.golden diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden new file mode 100644 index 000000000..194a57a31 --- /dev/null +++ b/plutarch-test/goldens/api.value.bench.golden @@ -0,0 +1,2 @@ +singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} +valueOf {"exBudgetCPU":12106088,"exBudgetMemory":29008,"scriptSizeBytes":229} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden new file mode 100644 index 000000000..86342992b --- /dev/null +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -0,0 +1,2 @@ +singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +valueOf (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden new file mode 100644 index 000000000..3977d338e --- /dev/null +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -0,0 +1,2 @@ +singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i16 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i17 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i13 (bData i16) (mapData i1)) (i12 (bData i16) (iData i1))) 1) i14 i15) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force i1) i3 ((\i0 -> i6 i1 i2) (\i0 -> equalsData (i12 i1) i3)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (i1 (\i0 -> \i0 -> \i0 -> force (i5 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i6 (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i8 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force headList)) (force tailList)) (force (force fstPair))) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index ed773953d..c74d7e955 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -59,8 +59,11 @@ spec = do _ -> perror describe "value" $ do pgoldenSpec $ do - "singleton" @| PValue.singleton # pconstant "c0" # pconstant "sometoken" # 1 @-> \p -> + let pmint = PValue.singleton # pconstant "c0" # pconstant "sometoken" # 1 + "singleton" @| pmint @-> \p -> plift p @?= mint + "valueOf" @| PValue.valueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> + plift p @?= 1 describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. From 3141d18376076c775917bd3e594dae960db6d1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 24 Mar 2022 18:37:22 -0400 Subject: [PATCH 399/584] Optimized lookup using precList --- Plutarch/Api/V1/AssocMap.hs | 19 ++++++++++++------- plutarch-test/goldens/api.value.bench.golden | 2 +- plutarch-test/goldens/api.value.uplc.golden | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 37c24005f..8cdede54d 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -22,7 +22,6 @@ import Plutarch.Lift ( pconstantFromRepr, pconstantToRepr, ) -import Plutarch.Maybe (pmaybe) import Plutarch.Prelude import Plutarch.Unsafe (punsafeFrom) @@ -65,7 +64,7 @@ lookup = phoistAcyclic $ # pdata key -- | Look up the given key data in a 'PMap'. -lookupData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) +lookupData :: (PIsData k, PIsData v, POrd k) => Term (s :: S) (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) lookupData = lookupDataWith # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) -- | Look up the given key data in a 'PMap', applying the given function to the found key-value pair. @@ -79,11 +78,17 @@ lookupDataWith :: :--> PMaybe x ) lookupDataWith = phoistAcyclic $ - plam $ \unwrap key map -> - pmaybe # pcon PNothing # unwrap - #$ plet (plam $ \pair -> pfstBuiltin # pair #== key) - $ \predicate -> - pfind # predicate # pto map + phoistAcyclic $ + plam $ \unwrap key map -> + precList + ( \self x xs -> + pif + (pfstBuiltin # x #== key) + (unwrap # x) + (self # xs) + ) + (const $ pcon PNothing) + # pto map -- | Construct a singleton 'PMap' with the given key and value. singleton :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v) diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index 194a57a31..5ede2ca38 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -1,2 +1,2 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -valueOf {"exBudgetCPU":12106088,"exBudgetMemory":29008,"scriptSizeBytes":229} \ No newline at end of file +valueOf {"exBudgetCPU":10676984,"exBudgetMemory":24208,"scriptSizeBytes":200} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index 3977d338e..c7c6e6d2a 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -1,2 +1,2 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i16 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i17 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i13 (bData i16) (mapData i1)) (i12 (bData i16) (iData i1))) 1) i14 i15) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force i1) i3 ((\i0 -> i6 i1 i2) (\i0 -> equalsData (i12 i1) i3)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (i1 (\i0 -> \i0 -> \i0 -> force (i5 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i6 (i2 (i7 i1)) (delay (\i0 -> \i0 -> i2 (i9 i3))) (delay (i3 i2 (i8 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force headList)) (force tailList)) (force (force fstPair))) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) \ No newline at end of file +valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i15 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i16 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) \ No newline at end of file From 98eec12290a30259b62c9fd0b24027a29125ba15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 1 Apr 2022 16:43:29 -0400 Subject: [PATCH 400/584] Added tests for pmaybe and pfromJust --- plutarch-test/goldens/maybe.bench.golden | 6 +++++- plutarch-test/goldens/maybe.uplc.eval.golden | 6 +++++- plutarch-test/goldens/maybe.uplc.golden | 6 +++++- plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs | 11 ++++++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/plutarch-test/goldens/maybe.bench.golden b/plutarch-test/goldens/maybe.bench.golden index 5187c86d7..1d17219a3 100644 --- a/plutarch-test/goldens/maybe.bench.golden +++ b/plutarch-test/goldens/maybe.bench.golden @@ -1,4 +1,8 @@ eq.true.nothing {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":34} eq.true.just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} eq.false.nothing-just {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":36} -eq.false.just-just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} \ No newline at end of file +eq.false.just-just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} +pfromJust.nothing {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":14} +pfromJust.just {"exBudgetCPU":644109,"exBudgetMemory":1801,"scriptSizeBytes":21} +pmaybe.nothing {"exBudgetCPU":792974,"exBudgetMemory":2301,"scriptSizeBytes":34} +pmaybe.just {"exBudgetCPU":1228367,"exBudgetMemory":3103,"scriptSizeBytes":36} \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.eval.golden b/plutarch-test/goldens/maybe.uplc.eval.golden index 4a70ad9fd..fb26d5a65 100644 --- a/plutarch-test/goldens/maybe.uplc.eval.golden +++ b/plutarch-test/goldens/maybe.uplc.eval.golden @@ -1,4 +1,8 @@ eq.true.nothing (program 1.0.0 True) eq.true.just (program 1.0.0 True) eq.false.nothing-just (program 1.0.0 False) -eq.false.just-just (program 1.0.0 False) \ No newline at end of file +eq.false.just-just (program 1.0.0 False) +pfromJust.nothing (program 1.0.0 error) +pfromJust.just (program 1.0.0 True) +pmaybe.nothing (program 1.0.0 True) +pmaybe.just (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.golden b/plutarch-test/goldens/maybe.uplc.golden index 2fde37e08..d4a5771f3 100644 --- a/plutarch-test/goldens/maybe.uplc.golden +++ b/plutarch-test/goldens/maybe.uplc.golden @@ -1,4 +1,8 @@ eq.true.nothing (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> force i1))) eq.true.just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42))) eq.false.nothing-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> i2 42))) -eq.false.just-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) \ No newline at end of file +eq.false.just-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) +pfromJust.nothing (program 1.0.0 ((\i0 -> i1 (\i0 -> i1) (delay error)) (\i0 -> \i0 -> force i1))) +pfromJust.just (program 1.0.0 (equalsInteger ((\i0 -> i1 (\i0 -> i1) (delay error)) (\i0 -> \i0 -> i2 42)) 42)) +pmaybe.nothing (program 1.0.0 (equalsInteger ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) 0 (\i0 -> addInteger i1 1) (\i0 -> \i0 -> force i1)) 0)) +pmaybe.just (program 1.0.0 (equalsInteger ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) 0 (\i0 -> addInteger i1 1) (\i0 -> \i0 -> i2 41)) 42)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs index 150bd0a0d..a21b855c5 100644 --- a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs @@ -3,7 +3,7 @@ module Plutarch.MaybeSpec (spec) where import Plutarch import Plutarch.Bool (PEq ((#==))) import Plutarch.Integer (PInteger) -import Plutarch.Maybe (PMaybe (PJust, PNothing)) +import Plutarch.Maybe (PMaybe (PJust, PNothing), pfromJust, pmaybe) import Plutarch.Test import Test.Hspec @@ -17,3 +17,12 @@ spec = do "false" @\ do "nothing-just" @| pcon @(PMaybe PInteger) PNothing #== pcon (PJust 42) @-> passertNot "just-just" @| pcon @(PMaybe PInteger) (PJust 24) #== pcon (PJust 42) @-> passertNot + "pfromJust" @\ do + "nothing" @| pfromJust # pcon PNothing @-> pfails + "just" @| pfromJust # pcon (PJust 42) #== (42 :: Term _ PInteger) @-> passert + "pmaybe" @\ do + "nothing" @| pmaybe # 0 # psucc # pcon PNothing #== (0 :: Term _ PInteger) @-> passert + "just" @| pmaybe # 0 # psucc # pcon (PJust 41) #== 42 @-> passert + +psucc :: ClosedTerm (PInteger :--> PInteger) +psucc = phoistAcyclic (plam (+1)) From 6f4276887e4e5dbe27fa3bfc5e6966ea6df1439e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 1 Apr 2022 17:33:54 -0400 Subject: [PATCH 401/584] Added AssocMap tests --- plutarch-test/goldens/api.map.bench.golden | 4 ++++ plutarch-test/goldens/api.map.uplc.eval.golden | 4 ++++ plutarch-test/goldens/api.map.uplc.golden | 4 ++++ plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 15 +++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 plutarch-test/goldens/api.map.bench.golden create mode 100644 plutarch-test/goldens/api.map.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.map.uplc.golden diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden new file mode 100644 index 000000000..60a5934b5 --- /dev/null +++ b/plutarch-test/goldens/api.map.bench.golden @@ -0,0 +1,4 @@ +lookup {"exBudgetCPU":5590502,"exBudgetMemory":12555,"scriptSizeBytes":143} +lookupData {"exBudgetCPU":5652634,"exBudgetMemory":12555,"scriptSizeBytes":143} +singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} +singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.eval.golden b/plutarch-test/goldens/api.map.uplc.eval.golden new file mode 100644 index 000000000..c6d38aee9 --- /dev/null +++ b/plutarch-test/goldens/api.map.uplc.eval.golden @@ -0,0 +1,4 @@ +lookup (program 1.0.0 True) +lookupData (program 1.0.0 True) +singleton (program 1.0.0 [(#436b6579, #182a)]) +singletonData (program 1.0.0 [(#436b6579, #182a)]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden new file mode 100644 index 000000000..035224b69 --- /dev/null +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -0,0 +1,4 @@ +lookup (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (\i0 -> \i0 -> i2 42)) (force headList)) #6b6579)) +lookupData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsData i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (\i0 -> \i0 -> i2 (iData 42))) (force headList)) #6b6579)) +singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) +singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index c74d7e955..6a9758591 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -29,6 +29,7 @@ import Plutarch.Api.V1 ( PTxInfo, PValue, ) +import qualified Plutarch.Api.V1.AssocMap as AssocMap import qualified Plutarch.Api.V1.Value as PValue import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude @@ -64,6 +65,17 @@ spec = do plift p @?= mint "valueOf" @| PValue.valueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> plift p @?= 1 + describe "map" $ do + pgoldenSpec $ do + let pmap, pdmap :: Term _ (AssocMap.PMap PByteString PInteger) + pmap = AssocMap.singleton # pconstant "key" # 42 + pdmap = AssocMap.singletonData # pdata (pconstant "key") # pdata 42 + "lookup" @| AssocMap.lookup # pconstant "key" # pmap #== pcon (PJust 42) @-> passert + "lookupData" + @| AssocMap.lookupData # pdata (pconstant "key") # pmap #== pcon (PJust $ pdata 42) + @-> passert + "singleton" @| pmap @-> pshouldReallyBe pdmap + "singletonData" @| pdmap @-> pshouldReallyBe pmap describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. @@ -275,3 +287,6 @@ d0Dat = Datum $ toBuiltinData d0DatValue d0DatValue :: [Integer] d0DatValue = [1 .. 10] + +pshouldReallyBe :: ClosedTerm a -> ClosedTerm a -> Expectation +pshouldReallyBe = pshouldBe From 5837ce189fe9bc0b842348b1cfebef769ea239c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 5 Apr 2022 17:43:32 -0400 Subject: [PATCH 402/584] Added Value.unionWith and everything it depends on --- Plutarch/Api/V1/AssocMap.hs | 122 +++++++++++++++++- Plutarch/Api/V1/Value.hs | 14 ++ Plutarch/Either.hs | 21 ++- ...pi.example.signatory.dev=true.bench.golden | 4 - ...xample.signatory.dev=true.uplc.eval.golden | 4 - ...api.example.signatory.dev=true.uplc.golden | 4 - plutarch-test/goldens/api.map.bench.golden | 10 +- .../goldens/api.map.uplc.eval.golden | 10 +- plutarch-test/goldens/api.map.uplc.golden | 10 +- plutarch-test/goldens/api.value.bench.golden | 6 +- .../goldens/api.value.uplc.eval.golden | 7 +- plutarch-test/goldens/api.value.uplc.golden | 6 +- .../goldens/list.dev=true.bench.golden | 25 ---- .../goldens/list.dev=true.uplc.eval.golden | 25 ---- .../goldens/list.dev=true.uplc.golden | 25 ---- ...pi.example.signatory.dev=true.bench.golden | 2 - ...xample.signatory.dev=true.uplc.eval.golden | 2 - .../goldens/trace.dev=true.bench.golden | 10 -- .../goldens/trace.dev=true.uplc.eval.golden | 10 -- .../goldens/trace.dev=true.uplc.golden | 10 -- .../plutarch-base/Plutarch/ApiSpec.hs | 40 +++++- .../plutarch-base/Plutarch/MaybeSpec.hs | 2 +- 22 files changed, 234 insertions(+), 135 deletions(-) delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/list.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/list.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=true.uplc.golden diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 8cdede54d..76a75f41f 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -3,16 +3,31 @@ module Plutarch.Api.V1.AssocMap ( PMap (PMap), - lookup, - lookupData, + + -- * Creation + empty, singleton, singletonData, + + -- * Lookups + lookup, + lookupData, + + -- * Traversals + mapEitherWithKey, + mapEitherWithKeyData, + + -- * Combining + difference, + unionWith, + unionWithData, ) where import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap import Plutarch.Builtin (PBuiltinMap, ppairDataBuiltin) +import Plutarch.Either (peither) import Plutarch.Lift ( PConstantDecl, PConstantRepr, @@ -22,6 +37,7 @@ import Plutarch.Lift ( pconstantFromRepr, pconstantToRepr, ) +import Plutarch.Maybe (pmaybe) import Plutarch.Prelude import Plutarch.Unsafe (punsafeFrom) @@ -64,7 +80,7 @@ lookup = phoistAcyclic $ # pdata key -- | Look up the given key data in a 'PMap'. -lookupData :: (PIsData k, PIsData v, POrd k) => Term (s :: S) (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) +lookupData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) lookupData = lookupDataWith # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) -- | Look up the given key data in a 'PMap', applying the given function to the found key-value pair. @@ -90,6 +106,10 @@ lookupDataWith = phoistAcyclic $ (const $ pcon PNothing) # pto map +-- | Construct an empty 'PMap'. +empty :: Term (s :: S) (PMap k v) +empty = punsafeFrom pnil + -- | Construct a singleton 'PMap' with the given key and value. singleton :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v) singleton = phoistAcyclic $ plam $ \key value -> singletonData # pdata key # pdata value @@ -98,3 +118,99 @@ singleton = phoistAcyclic $ plam $ \key value -> singletonData # pdata key # pda singletonData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v) singletonData = phoistAcyclic $ plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # key # value) # pnil) + +{- | Combine two 'PMap's applying the given function to any two values that + share the same key. +-} +unionWith :: + (PIsData k, PIsData v) => + Term (s :: S) ((v :--> v :--> v) :--> PMap k v :--> PMap k v :--> PMap k v) +unionWith = phoistAcyclic $ + plam $ + \merge -> unionWithData #$ plam $ + \x y -> pdata (merge # pfromData x # pfromData y) + +{- | Combine two 'PMap's applying the given function to any two data-encoded + values that share the same key. +-} +unionWithData :: + (PIsData k, PIsData v) => + Term + (s :: S) + ( (PAsData v :--> PAsData v :--> PAsData v) + :--> PMap k v + :--> PMap k v + :--> PMap k v + ) +unionWithData = phoistAcyclic $ + plam $ \merge x y -> + plet + ( plam $ \k x' -> + pmaybe + # pcon (PLeft x') + # plam (pcon . PRight . (merge # x' #)) + # (lookupData # k # y) + ) + $ \leftOrBoth -> + pmatch (mapEitherWithKeyData # leftOrBoth # x) $ \(PPair x' xy) -> + pcon . PMap $ + pconcat # pto xy #$ pconcat # pto x' # pto (difference # y # xy) + +-- | Difference of two maps. Return elements of the first map not existing in the second map. +difference :: + (PIsData k, PIsData a, PIsData b) => + Term (s :: S) (PMap k a :--> PMap k b :--> PMap k a) +difference = phoistAcyclic $ + plam $ \left right -> + pcon . PMap $ + precList + ( \self x xs -> + plet (self # xs) $ \xs' -> + pmaybe + # (pcons # x # xs') + # (plam $ const xs') + # (lookupData # (pfstBuiltin # x) # right) + ) + (const pnil) + # pto left + +-- | Map keys/values and separate the @Left@ and @Right@ results. +mapEitherWithKey :: + (PIsData k, PIsData a, PIsData b, PIsData c) => + Term (s :: S) ((k :--> a :--> PEither b c) :--> PMap k a :--> PPair (PMap k b) (PMap k c)) +mapEitherWithKey = phoistAcyclic $ + plam $ \f -> + mapEitherWithKeyData #$ plam $ \k v -> + bidata #$ f # pfromData k # pfromData v + +bidata :: + forall (s :: S) (a :: PType) (b :: PType). + (PIsData a, PIsData b) => + Term s (PEither a b :--> PEither (PAsData a) (PAsData b)) +bidata = peither # plam (pcon . PLeft . pdata) # plam (pcon . PRight . pdata) + +-- | Map data-encoded keys/values and separate the @Left@ and @Right@ results. +mapEitherWithKeyData :: + (PIsData k, PIsData a, PIsData b, PIsData c) => + Term + (s :: S) + ( (PAsData k :--> PAsData a :--> PEither (PAsData b) (PAsData c)) + :--> PMap k a + :--> PPair (PMap k b) (PMap k c) + ) +mapEitherWithKeyData = phoistAcyclic $ + plam $ \f map -> + ( flip pmatch $ \(PPair lefts rights) -> + pcon $ PPair (pcon $ PMap lefts) (pcon $ PMap rights) + ) + $ precList + ( \self x xs -> + pmatch (self # xs) $ \(PPair lefts rights) -> + plet (pfstBuiltin # x) $ \key -> + peither + # (plam $ \l -> pcon $ PPair (pcons # (ppairDataBuiltin # key # l) # lefts) rights) + # (plam $ \r -> pcon $ PPair lefts (pcons # (ppairDataBuiltin # key # r) # rights)) + # (f # key #$ psndBuiltin # x) + ) + (const $ pcon $ PPair pnil pnil) + # pto map diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 41ca53a67..ab3b47e70 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -6,6 +6,7 @@ module Plutarch.Api.V1.Value ( PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), singleton, + unionWith, valueOf, ) where @@ -68,3 +69,16 @@ valueOf = phoistAcyclic $ PJust submap -> pmatch (AssocMap.lookup # token # submap) $ \case PNothing -> 0 PJust amount -> amount + +{- | Combine two 'PValue's applying the given function to any pair of + quantities with the same asset class. Note that the result is _not_ + normalized and may contain zero quantities. +-} +unionWith :: Term (s :: S) ((PInteger :--> PInteger :--> PInteger) :--> PValue :--> PValue :--> PValue) +unionWith = phoistAcyclic $ + plam $ \combine x y -> + pcon . PValue $ + AssocMap.unionWith + # (plam $ \x y -> AssocMap.unionWith # combine # x # y) + # pto x + # pto y diff --git a/Plutarch/Either.hs b/Plutarch/Either.hs index d7cb4ffc8..7356a8ff2 100644 --- a/Plutarch/Either.hs +++ b/Plutarch/Either.hs @@ -1,8 +1,18 @@ -module Plutarch.Either (PEither (..)) where +module Plutarch.Either (PEither (..), peither) where import qualified GHC.Generics as GHC import Generics.SOP (Generic, HasDatatypeInfo, I (I)) -import Plutarch (PType, PlutusType, S, Term) +import Plutarch ( + PType, + PlutusType, + S, + Term, + phoistAcyclic, + plam, + pmatch, + (#), + type (:-->), + ) import Plutarch.Bool (PEq) import Plutarch.Show (PShow) @@ -11,3 +21,10 @@ data PEither (a :: PType) (b :: PType) (s :: S) | PRight (Term s b) deriving stock (GHC.Generic) deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) + +-- | 'PEither' destructor equivalent to 'either' +peither :: Term (s :: S) ((a :--> c) :--> (b :--> c) :--> PEither a b :--> c) +peither = phoistAcyclic $ + plam $ \left right either -> pmatch either $ \case + PLeft x -> left # x + PRight x -> right # x diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden deleted file mode 100644 index 6759b8694..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} -cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} -termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} -termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden deleted file mode 100644 index 0070757cf..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -cont.succeeds (program 1.0.0 ()) -cont.fails (program 1.0.0 error) -termcont.succeeds (program 1.0.0 ()) -termcont.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden deleted file mode 100644 index 0be2377ab..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index 60a5934b5..f8a8b9331 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -1,4 +1,12 @@ lookup {"exBudgetCPU":5590502,"exBudgetMemory":12555,"scriptSizeBytes":143} lookupData {"exBudgetCPU":5652634,"exBudgetMemory":12555,"scriptSizeBytes":143} singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} -singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} \ No newline at end of file +singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} +difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":173} +difference.emptyRight {"exBudgetCPU":6563780,"exBudgetMemory":16484,"scriptSizeBytes":176} +difference.emptyResult {"exBudgetCPU":9839480,"exBudgetMemory":23042,"scriptSizeBytes":190} +unionWith.const {"exBudgetCPU":22897749,"exBudgetMemory":55380,"scriptSizeBytes":372} +unionWith.(+) {"exBudgetCPU":22946093,"exBudgetMemory":54882,"scriptSizeBytes":369} +unionWithData.const {"exBudgetCPU":22001154,"exBudgetMemory":53784,"scriptSizeBytes":359} +unionWithData.emptyLeft {"exBudgetCPU":10586540,"exBudgetMemory":28580,"scriptSizeBytes":346} +unionWithData.emptyRight {"exBudgetCPU":13570650,"exBudgetMemory":35772,"scriptSizeBytes":347} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.eval.golden b/plutarch-test/goldens/api.map.uplc.eval.golden index c6d38aee9..77719e0ff 100644 --- a/plutarch-test/goldens/api.map.uplc.eval.golden +++ b/plutarch-test/goldens/api.map.uplc.eval.golden @@ -1,4 +1,12 @@ lookup (program 1.0.0 True) lookupData (program 1.0.0 True) singleton (program 1.0.0 [(#436b6579, #182a)]) -singletonData (program 1.0.0 [(#436b6579, #182a)]) \ No newline at end of file +singletonData (program 1.0.0 [(#436b6579, #182a)]) +difference.emptyLeft (program 1.0.0 []) +difference.emptyRight (program 1.0.0 [(#436b6579, #182a)]) +difference.emptyResult (program 1.0.0 []) +unionWith.const (program 1.0.0 [(#436b6579, #182a)]) +unionWith.(+) (program 1.0.0 [(#436b6579, #1854)]) +unionWithData.const (program 1.0.0 [(#436b6579, #182a)]) +unionWithData.emptyLeft (program 1.0.0 [(#436b6579, #182a)]) +unionWithData.emptyRight (program 1.0.0 [(#436b6579, #182a)]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index 035224b69..80e87588c 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -1,4 +1,12 @@ lookup (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (\i0 -> \i0 -> i2 42)) (force headList)) #6b6579)) lookupData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsData i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (\i0 -> \i0 -> i2 (iData 42))) (force headList)) #6b6579)) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) -singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) \ No newline at end of file +singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) +difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i10 (i8 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i12 (i13 i1)) i4) (delay (i5 (i13 i1))) (delay (i2 (i14 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i7 (i8 i2)) i4)) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) +difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i11 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) +difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i13 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i6 i1 (i22 (i19 i4)))) (i17 (i18 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i8 i1 (i8 i2 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i25) (delay ((\i0 -> i12 (i25 (i19 i2) i1) (\i0 -> i2) (i13 i21 (i18 (i19 i2)) i4)) (i2 (i19 i1)))))) i4)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i9 i17 i2 i3))) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i13 i17 42) (i13 i17 42)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i24) (delay ((\i0 -> i11 (i24 (i18 i2) i1) (\i0 -> i2) (i12 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i16 i2 i3))) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i13 i17 42) (i13 i17 42)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i24) (delay ((\i0 -> i11 (i24 (i18 i2) i1) (\i0 -> i2) (i12 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i16 i2 i3))) (\i0 -> \i0 -> i2) (i13 i17 42) (i13 i17 42)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i21 i21)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i24 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i24 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i22) (delay ((\i0 -> i11 (i22 (i18 i2) i1) (\i0 -> i2) (i12 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i16 i2 i3))) (\i0 -> \i0 -> i2) i14 ((\i0 -> \i0 -> (\i0 -> \i0 -> i17 (mkPairData i2 i1) i18) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i16 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (force mkCons)) [ ])) +unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i21 i21)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i24 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i24 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i22) (delay ((\i0 -> i11 (i22 (i18 i2) i1) (\i0 -> i2) (i12 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i16 i2 i3))) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i17 (mkPairData i2 i1) i18) (bData i2) (iData i1)) #6b6579 42) i14) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i16 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index 5ede2ca38..b20f2f419 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -1,2 +1,6 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -valueOf {"exBudgetCPU":10676984,"exBudgetMemory":24208,"scriptSizeBytes":200} \ No newline at end of file +valueOf {"exBudgetCPU":10676984,"exBudgetMemory":24208,"scriptSizeBytes":200} +unionWith.const {"exBudgetCPU":46023809,"exBudgetMemory":111360,"scriptSizeBytes":457} +unionWith.(+) {"exBudgetCPU":46072153,"exBudgetMemory":110862,"scriptSizeBytes":453} +unionWith.tokens {"exBudgetCPU":43572888,"exBudgetMemory":107134,"scriptSizeBytes":463} +unionWith.symbols {"exBudgetCPU":24872312,"exBudgetMemory":62210,"scriptSizeBytes":454} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index 86342992b..6369b5564 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -1,2 +1,7 @@ singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -valueOf (program 1.0.0 1) \ No newline at end of file +valueOf (program 1.0.0 1) +unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +unionWith.(+) (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) +unionWith.tokens (program 1.0.0 [(#41c0, #a249736f6d65746f6b656e014a6f74686572746f6b656e01)]) +unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) + , (#41c2, #a149736f6d65746f6b656e01) ]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index c7c6e6d2a..3a2fed235 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -1,2 +1,6 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i15 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i16 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) \ No newline at end of file +valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i15 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i16 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i17 i23 i24 1) (i17 i23 i24 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i19 i2 i3)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i21 (i13 i1) (i2 (i14 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i13 i2) i1) (\i0 -> i2) (i7 i15 (i12 (i13 i2)) i4)) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i19 i2 i3)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i21 (i13 i1) (i2 (i14 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i13 i2) i1) (\i0 -> i2) (i7 i15 (i12 (i13 i2)) i4)) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 #736f6d65746f6b656e 1) (i17 i23 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i19 i2 i3)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i21 (i13 i1) (i2 (i14 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i13 i2) i1) (\i0 -> i2) (i7 i15 (i12 (i13 i2)) i4)) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 i23 1) (i17 #c2 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i19 i2 i3)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i21 (i13 i1) (i2 (i14 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i13 i2) i1) (\i0 -> i2) (i7 i15 (i12 (i13 i2)) i4)) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.bench.golden b/plutarch-test/goldens/list.dev=true.bench.golden deleted file mode 100644 index 64e96914d..000000000 --- a/plutarch-test/goldens/list.dev=true.bench.golden +++ /dev/null @@ -1,25 +0,0 @@ -pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} -phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} -ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} -pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} -pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} -pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} -pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} -pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} -pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} -pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} -pfoldl.nonempty {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.nonempty-primed {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.empty {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} -pfoldl.empty-primed {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} -elemAt.elemAt_3_[1..10] {"exBudgetCPU":22527179,"exBudgetMemory":56708,"scriptSizeBytes":157} -elemAt.elemAt_0_[1..10] {"exBudgetCPU":17681228,"exBudgetMemory":43796,"scriptSizeBytes":157} -elemAt.elemAt_9_[1..10] {"exBudgetCPU":32219081,"exBudgetMemory":82532,"scriptSizeBytes":157} -find.find_(==3)_[1..4] {"exBudgetCPU":11027650,"exBudgetMemory":29622,"scriptSizeBytes":100} -find.find_(==5)_[1..4] {"exBudgetCPU":13130537,"exBudgetMemory":36224,"scriptSizeBytes":100} -x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} -x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} -uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} -uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} -uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.uplc.eval.golden b/plutarch-test/goldens/list.dev=true.uplc.eval.golden deleted file mode 100644 index 24db9cb06..000000000 --- a/plutarch-test/goldens/list.dev=true.uplc.eval.golden +++ /dev/null @@ -1,25 +0,0 @@ -pmatch (program 1.0.0 error) -phead (program 1.0.0 True) -ptail (program 1.0.0 True) -pnull.empty (program 1.0.0 True) -pnull.nonempty (program 1.0.0 True) -pconcat.identity (program 1.0.0 True) -pmap.eg (program 1.0.0 True) -pmap.identity (program 1.0.0 True) -pfilter.evens (program 1.0.0 True) -pfilter.gt5 (program 1.0.0 True) -pzipWith.double (program 1.0.0 True) -pfoldl.nonempty (program 1.0.0 True) -pfoldl.nonempty-primed (program 1.0.0 True) -pfoldl.empty (program 1.0.0 True) -pfoldl.empty-primed (program 1.0.0 True) -elemAt.elemAt_3_[1..10] (program 1.0.0 4) -elemAt.elemAt_0_[1..10] (program 1.0.0 1) -elemAt.elemAt_9_[1..10] (program 1.0.0 10) -find.find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) -find.find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) -x1+x2.builtin (program 1.0.0 3) -x1+x2.pmatch (program 1.0.0 3) -uncons.ChooseList (program 1.0.0 [2,3,4,5]) -uncons.head-and-tail (program 1.0.0 [2,3,4,5]) -uncons.head-and-tail-and-null (program 1.0.0 [2,3,4,5]) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.uplc.golden b/plutarch-test/goldens/list.dev=true.uplc.golden deleted file mode 100644 index 7027f46c2..000000000 --- a/plutarch-test/goldens/list.dev=true.uplc.golden +++ /dev/null @@ -1,25 +0,0 @@ -pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) -phead (program 1.0.0 (equalsInteger 1 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) -ptail (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [2,3,4,5,6,7,8,9,10]) ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (i1 [1,2,3,4,5,6,7,8,9,10]))) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) -pnull.nonempty (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) -pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i4 i2 i1 (delay False)) (i1 (i3 (i4 i10) (\i0 -> \i0 -> force i1)) (i3 (\i0 -> \i0 -> force i1) (i4 i10))) (delay (i1 (i3 (\i0 -> \i0 -> force i1) (i4 i10)) (i4 i10))))) (i4 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))))) (force ifThenElse)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i10 i2 (i4 i1)) (delay i3)) i2)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) -pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i3 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i9 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 [1,2,3,4,5,6,7,8,9,10])) (i1 [2,4,6,8,10,12,14,16,18,20])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pmap.identity (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> force i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfilter.evens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [2,4,6,8,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pfilter.gt5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [6,7,8,9,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pzipWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i2 i1) (i2 i1)) (i2 [2,4,6,8,10,12,14,16,18,20])) [1,2,3,4,5,6,7,8,9,10]) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pfoldl.nonempty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.nonempty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.empty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.empty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -elemAt.elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -elemAt.elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -elemAt.elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -find.find_(==3)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -find.find_(==5)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -x1+x2.builtin (program 1.0.0 ((\i0 -> (\i0 -> addInteger (i1 (force tailList i2)) (i1 i2)) (force headList)) [1,2,3,4,5])) -x1+x2.pmatch (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i1 i3 (delay error) (delay ((\i0 -> force (i2 i1 (delay error) (delay (addInteger (i3 i4) (i3 i1))))) (force tailList i3))))) (force (force chooseList))) (force headList)) [1,2,3,4,5])) -uncons.ChooseList (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay error) (delay (force tailList i1)))) [1,2,3,4,5])) -uncons.head-and-tail (program 1.0.0 ((\i0 -> (\i0 -> force tailList i2) (force headList i1)) [1,2,3,4,5])) -uncons.head-and-tail-and-null (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse i1 (delay error) (delay ((\i0 -> force tailList i3) (force headList i2))))) (force nullList i1)) [1,2,3,4,5])) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden deleted file mode 100644 index 332672742..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":390} -do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":386} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden deleted file mode 100644 index a9c117adc..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -do.succeeds (program 1.0.0 ()) -do.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.bench.golden b/plutarch-test/goldens/trace.dev=true.bench.golden deleted file mode 100644 index 98057425d..000000000 --- a/plutarch-test/goldens/trace.dev=true.bench.golden +++ /dev/null @@ -1,10 +0,0 @@ -ptrace.one {"exBudgetCPU":388284,"exBudgetMemory":932,"scriptSizeBytes":16} -ptrace.two {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":30} -ptraceShowId.right-42 {"exBudgetCPU":16124851,"exBudgetMemory":35093,"scriptSizeBytes":379} -ptraceIfTrue.true {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} -ptraceIfTrue.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} -ptraceIfFalse.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} -ptraceIfFalse.false {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} -chained.false.true.false {"exBudgetCPU":1192157,"exBudgetMemory":3634,"scriptSizeBytes":51} -chained.ptrace.true.false {"exBudgetCPU":834880,"exBudgetMemory":2433,"scriptSizeBytes":40} -chained.ptrace.true.true {"exBudgetCPU":1103972,"exBudgetMemory":2865,"scriptSizeBytes":40} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.uplc.eval.golden deleted file mode 100644 index 51bcda305..000000000 --- a/plutarch-test/goldens/trace.dev=true.uplc.eval.golden +++ /dev/null @@ -1,10 +0,0 @@ -ptrace.one (program 1.0.0 ()) -ptrace.two (program 1.0.0 ()) -ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) -ptraceIfTrue.true (program 1.0.0 True) -ptraceIfTrue.false (program 1.0.0 False) -ptraceIfFalse.true (program 1.0.0 True) -ptraceIfFalse.false (program 1.0.0 False) -chained.false.true.false (program 1.0.0 False) -chained.ptrace.true.false (program 1.0.0 False) -chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.uplc.golden b/plutarch-test/goldens/trace.dev=true.uplc.golden deleted file mode 100644 index 5a77c4925..000000000 --- a/plutarch-test/goldens/trace.dev=true.uplc.golden +++ /dev/null @@ -1,10 +0,0 @@ -ptrace.one (program 1.0.0 (force (force trace "foo" (delay ())))) -ptrace.two (program 1.0.0 ((\i0 -> force (i1 "foo" (delay (force (i1 "bar" (delay ())))))) (force trace))) -ptraceShowId.right-42 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force trace ((\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) (delay (\i0 -> \i0 -> i1 42)))) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -ptraceIfTrue.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) True)) -ptraceIfTrue.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) False)) -ptraceIfFalse.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) True)) -ptraceIfFalse.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) False)) -chained.false.true.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i2 i1 (delay i1) (delay (i3 "foo" i1)))) ((\i0 -> force (i2 i1 (delay (i3 "bar" i1)) (delay i1))) False)) (force ifThenElse)) (force trace))) -chained.ptrace.true.false (program 1.0.0 ((\i0 -> force (i1 "foo" (delay ((\i0 -> force (force ifThenElse i1 (delay (i2 "bar" i1)) (delay i1))) False)))) (force trace))) -chained.ptrace.true.true (program 1.0.0 ((\i0 -> force (i1 "foo" (delay ((\i0 -> force (force ifThenElse i1 (delay (i2 "bar" i1)) (delay i1))) True)))) (force trace))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 6a9758591..29d9efac9 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -61,21 +61,51 @@ spec = do describe "value" $ do pgoldenSpec $ do let pmint = PValue.singleton # pconstant "c0" # pconstant "sometoken" # 1 + pmintOtherToken = PValue.singleton # pconstant "c0" # pconstant "othertoken" # 1 + pmintOtherSymbol = PValue.singleton # pconstant "c2" # pconstant "sometoken" # 1 "singleton" @| pmint @-> \p -> plift p @?= mint "valueOf" @| PValue.valueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> plift p @?= 1 + "unionWith" @\ do + "const" @| PValue.unionWith # plam const # pmint # pmint @-> \p -> + plift p @?= mint + "(+)" @| PValue.unionWith # plam (+) # pmint # pmint @-> \p -> + plift p @?= mint <> mint + "tokens" @| PValue.unionWith # plam (+) # pmint # pmintOtherToken @-> \p -> + plift p @?= mint <> mintOtherToken + "symbols" @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> + plift p @?= mint <> mintOtherSymbol describe "map" $ do pgoldenSpec $ do - let pmap, pdmap :: Term _ (AssocMap.PMap PByteString PInteger) + let pmap, pdmap, emptyMap, doubleMap :: Term _ (AssocMap.PMap PByteString PInteger) pmap = AssocMap.singleton # pconstant "key" # 42 pdmap = AssocMap.singletonData # pdata (pconstant "key") # pdata 42 + emptyMap = AssocMap.empty + doubleMap = AssocMap.singleton # pconstant "key" # 84 "lookup" @| AssocMap.lookup # pconstant "key" # pmap #== pcon (PJust 42) @-> passert "lookupData" @| AssocMap.lookupData # pdata (pconstant "key") # pmap #== pcon (PJust $ pdata 42) @-> passert "singleton" @| pmap @-> pshouldReallyBe pdmap "singletonData" @| pdmap @-> pshouldReallyBe pmap + "difference" @\ do + "emptyLeft" @| AssocMap.difference # emptyMap # pmap @-> pshouldReallyBe emptyMap + "emptyRight" @| AssocMap.difference # pmap # emptyMap @-> pshouldReallyBe pmap + "emptyResult" @| AssocMap.difference # pmap # doubleMap @-> pshouldReallyBe emptyMap + "unionWith" @\ do + "const" @| AssocMap.unionWith # plam const # pmap # pmap @-> pshouldReallyBe pmap + "(+)" @| AssocMap.unionWith # plam (+) # pmap # pmap @-> pshouldReallyBe doubleMap + "unionWithData" @\ do + "const" @| AssocMap.unionWithData # plam const # pmap # pmap @-> pshouldReallyBe pmap + "emptyLeft" @| AssocMap.unionWithData # plam const # emptyMap # pmap @-> pshouldReallyBe pmap + "emptyRight" @| AssocMap.unionWithData # plam const # pmap # emptyMap @-> pshouldReallyBe pmap + + {- TODO: fails due to incomplete normalization + "mapEitherWithKey" @\ do + "const" @| AssocMap.mapEitherWithKey # plam (const $ pcon . PRight) # pmap + @-> pshouldReallyBe (pcon $ PPair emptyMap pmap) + -} describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. @@ -136,6 +166,12 @@ inp = mint :: Value mint = Value.singleton sym "sometoken" 1 +mintOtherToken :: Value +mintOtherToken = Value.singleton sym "othertoken" 1 + +mintOtherSymbol :: Value +mintOtherSymbol = Value.singleton "c2" "sometoken" 1 + ref :: TxOutRef ref = TxOutRef "a0" 0 @@ -289,4 +325,4 @@ d0DatValue :: [Integer] d0DatValue = [1 .. 10] pshouldReallyBe :: ClosedTerm a -> ClosedTerm a -> Expectation -pshouldReallyBe = pshouldBe +pshouldReallyBe a b = pshouldBe b a diff --git a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs index a21b855c5..32416a540 100644 --- a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs @@ -25,4 +25,4 @@ spec = do "just" @| pmaybe # 0 # psucc # pcon (PJust 41) #== 42 @-> passert psucc :: ClosedTerm (PInteger :--> PInteger) -psucc = phoistAcyclic (plam (+1)) +psucc = phoistAcyclic (plam (+ 1)) From 76a686c9857d3bf2e25c683648c09eae5e28d52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 7 Apr 2022 13:05:51 -0400 Subject: [PATCH 403/584] Added insert & insertData --- Plutarch/Api/V1/AssocMap.hs | 78 ++++++++++++++++--- plutarch-test/goldens/api.map.bench.golden | 12 +-- .../goldens/api.map.uplc.eval.golden | 2 + plutarch-test/goldens/api.map.uplc.golden | 12 +-- plutarch-test/goldens/api.value.bench.golden | 10 +-- plutarch-test/goldens/api.value.uplc.golden | 10 +-- .../plutarch-base/Plutarch/ApiSpec.hs | 3 + 7 files changed, 95 insertions(+), 32 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 76a75f41f..cf1370cf7 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -8,6 +8,8 @@ module Plutarch.Api.V1.AssocMap ( empty, singleton, singletonData, + insert, + insertData, -- * Lookups lookup, @@ -38,7 +40,37 @@ import Plutarch.Lift ( pconstantToRepr, ) import Plutarch.Maybe (pmaybe) -import Plutarch.Prelude +import Plutarch.Prelude ( + DerivePNewtype (..), + PAsData, + PBuiltinPair, + PCon (pcon), + PConstant, + PEither (..), + PEq ((#==)), + PIsData (..), + PLift, + PListLike (pcons, pnil), + PMatch (pmatch), + PMaybe (..), + PPair (..), + PType, + PlutusType, + S, + Term, + pconcat, + pfstBuiltin, + phoistAcyclic, + pif, + plam, + plet, + precList, + psndBuiltin, + pto, + (#), + (#$), + type (:-->), + ) import Plutarch.Unsafe (punsafeFrom) import Prelude hiding (lookup) @@ -94,17 +126,39 @@ lookupDataWith :: :--> PMaybe x ) lookupDataWith = phoistAcyclic $ - phoistAcyclic $ - plam $ \unwrap key map -> - precList - ( \self x xs -> - pif - (pfstBuiltin # x #== key) - (unwrap # x) - (self # xs) - ) - (const $ pcon PNothing) - # pto map + plam $ \unwrap key map -> + precList + ( \self x xs -> + pif + (pfstBuiltin # x #== key) + (unwrap # x) + (self # xs) + ) + (const $ pcon PNothing) + # pto map + +-- | Insert a new key/value pair into the map, overiding the previous if any. +insert :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v :--> PMap k v) +insert = phoistAcyclic $ + plam $ \k v -> insertData # pdata k # pdata v + +-- | Insert a new data-encoded key/value pair into the map, overiding the previous if any. +insertData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v :--> PMap k v) +insertData = phoistAcyclic $ + plam $ \key val map -> + plet (plam (pcons # (ppairDataBuiltin # key # val) #)) $ \addPair -> + punsafeFrom $ + precList + ( \self x xs -> + plam $ \prefix -> + pif + (pfstBuiltin # x #== key) + (prefix #$ addPair # xs) + (self # xs #$ plam $ \suffix -> prefix #$ pcons # x # suffix) + ) + (const $ plam (#$ addPair # pnil)) + # pto map + # plam id -- | Construct an empty 'PMap'. empty :: Term (s :: S) (PMap k v) diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index f8a8b9331..e15089bb1 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -2,11 +2,13 @@ lookup {"exBudgetCPU":5590502,"exBudgetMemory":12555,"scriptSizeBytes":143} lookupData {"exBudgetCPU":5652634,"exBudgetMemory":12555,"scriptSizeBytes":143} singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} +insert.empty {"exBudgetCPU":3042621,"exBudgetMemory":7960,"scriptSizeBytes":129} +insert.replace {"exBudgetCPU":5543088,"exBudgetMemory":12386,"scriptSizeBytes":151} difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":173} difference.emptyRight {"exBudgetCPU":6563780,"exBudgetMemory":16484,"scriptSizeBytes":176} difference.emptyResult {"exBudgetCPU":9839480,"exBudgetMemory":23042,"scriptSizeBytes":190} -unionWith.const {"exBudgetCPU":22897749,"exBudgetMemory":55380,"scriptSizeBytes":372} -unionWith.(+) {"exBudgetCPU":22946093,"exBudgetMemory":54882,"scriptSizeBytes":369} -unionWithData.const {"exBudgetCPU":22001154,"exBudgetMemory":53784,"scriptSizeBytes":359} -unionWithData.emptyLeft {"exBudgetCPU":10586540,"exBudgetMemory":28580,"scriptSizeBytes":346} -unionWithData.emptyRight {"exBudgetCPU":13570650,"exBudgetMemory":35772,"scriptSizeBytes":347} \ No newline at end of file +unionWith.const {"exBudgetCPU":22808430,"exBudgetMemory":55080,"scriptSizeBytes":370} +unionWith.(+) {"exBudgetCPU":22856774,"exBudgetMemory":54582,"scriptSizeBytes":366} +unionWithData.const {"exBudgetCPU":21911835,"exBudgetMemory":53484,"scriptSizeBytes":357} +unionWithData.emptyLeft {"exBudgetCPU":10497221,"exBudgetMemory":28280,"scriptSizeBytes":344} +unionWithData.emptyRight {"exBudgetCPU":13481331,"exBudgetMemory":35472,"scriptSizeBytes":344} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.eval.golden b/plutarch-test/goldens/api.map.uplc.eval.golden index 77719e0ff..242b88321 100644 --- a/plutarch-test/goldens/api.map.uplc.eval.golden +++ b/plutarch-test/goldens/api.map.uplc.eval.golden @@ -2,6 +2,8 @@ lookup (program 1.0.0 True) lookupData (program 1.0.0 True) singleton (program 1.0.0 [(#436b6579, #182a)]) singletonData (program 1.0.0 [(#436b6579, #182a)]) +insert.empty (program 1.0.0 [(#436b6579, #182a)]) +insert.replace (program 1.0.0 [(#436b6579, #1854)]) difference.emptyLeft (program 1.0.0 []) difference.emptyRight (program 1.0.0 [(#436b6579, #182a)]) difference.emptyResult (program 1.0.0 []) diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index 80e87588c..c2a1050f2 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -2,11 +2,13 @@ lookup (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equa lookupData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsData i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (\i0 -> \i0 -> i2 (iData 42))) (force headList)) #6b6579)) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) +insert.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i4 i13))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i11 i2)) i7) (delay (i1 (i4 (i10 i2)))) (delay (i3 (i10 i2) (\i0 -> i2 (i13 (i12 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i9 (mkPairData i4 i3) i1)) (bData i2) (iData i1)) #6b6579 42 i4) (force tailList)) (force headList)) (force mkCons)) [ ])) +insert.replace (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i4 i12))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i10 i2)) i7) (delay (i1 (i4 (i9 i2)))) (delay (i3 (i9 i2) (\i0 -> i2 (i12 (i11 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i8 (mkPairData i4 i3) i1)) (bData i6) (iData i1)) 84 ((\i0 -> (\i0 -> \i0 -> i6 (mkPairData i2 i1) i7) (bData i6) (iData i1)) 42)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i10 (i8 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i12 (i13 i1)) i4) (delay (i5 (i13 i1))) (delay (i2 (i14 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i7 (i8 i2)) i4)) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i11 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i13 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i6 i1 (i22 (i19 i4)))) (i17 (i18 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i8 i1 (i8 i2 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i25) (delay ((\i0 -> i12 (i25 (i19 i2) i1) (\i0 -> i2) (i13 i21 (i18 (i19 i2)) i4)) (i2 (i19 i1)))))) i4)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i9 i17 i2 i3))) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i13 i17 42) (i13 i17 42)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i24) (delay ((\i0 -> i11 (i24 (i18 i2) i1) (\i0 -> i2) (i12 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i16 i2 i3))) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i13 i17 42) (i13 i17 42)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i24) (delay ((\i0 -> i11 (i24 (i18 i2) i1) (\i0 -> i2) (i12 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i16 i2 i3))) (\i0 -> \i0 -> i2) (i13 i17 42) (i13 i17 42)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i21 i21)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i24 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i24 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i22) (delay ((\i0 -> i11 (i22 (i18 i2) i1) (\i0 -> i2) (i12 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i16 i2 i3))) (\i0 -> \i0 -> i2) i14 ((\i0 -> \i0 -> (\i0 -> \i0 -> i17 (mkPairData i2 i1) i18) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i16 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (force mkCons)) [ ])) -unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i21 i21)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i24 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i24 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i22) (delay ((\i0 -> i11 (i22 (i18 i2) i1) (\i0 -> i2) (i12 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i16 i2 i3))) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i17 (mkPairData i2 i1) i18) (bData i2) (iData i1)) #6b6579 42) i14) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i16 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (force mkCons)) [ ])) \ No newline at end of file +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i8 i1 (i8 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i24) (delay ((\i0 -> i12 (i24 (i18 i2) i1) (\i0 -> i2) (i13 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i9 i16 i2 i3))) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i12 i16 42) (i12 i16 42)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i17 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i6 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i23) (delay ((\i0 -> i11 (i23 (i17 i2) i1) (\i0 -> i2) (i12 i19 (i16 (i17 i2)) i4)) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i15 i2 i3))) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i12 i16 42) (i12 i16 42)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i17 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i6 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i23) (delay ((\i0 -> i11 (i23 (i17 i2) i1) (\i0 -> i2) (i12 i19 (i16 (i17 i2)) i4)) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i15 i2 i3))) (\i0 -> \i0 -> i2) (i12 i16 42) (i12 i16 42)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i17 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i21) (delay ((\i0 -> i11 (i21 (i17 i2) i1) (\i0 -> i2) (i12 i19 (i16 (i17 i2)) i4)) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i15 i2 i3))) (\i0 -> \i0 -> i2) i13 ((\i0 -> \i0 -> (\i0 -> \i0 -> i16 (mkPairData i2 i1) i17) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (force mkCons)) [ ])) +unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i21) (delay ((\i0 -> i11 (i21 (i17 i2) i1) (\i0 -> i2) (i12 i19 (i16 (i17 i2)) i4)) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i15 i2 i3))) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i16 (mkPairData i2 i1) i17) (bData i2) (iData i1)) #6b6579 42) i13) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index b20f2f419..01c17ff7a 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -1,6 +1,6 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -valueOf {"exBudgetCPU":10676984,"exBudgetMemory":24208,"scriptSizeBytes":200} -unionWith.const {"exBudgetCPU":46023809,"exBudgetMemory":111360,"scriptSizeBytes":457} -unionWith.(+) {"exBudgetCPU":46072153,"exBudgetMemory":110862,"scriptSizeBytes":453} -unionWith.tokens {"exBudgetCPU":43572888,"exBudgetMemory":107134,"scriptSizeBytes":463} -unionWith.symbols {"exBudgetCPU":24872312,"exBudgetMemory":62210,"scriptSizeBytes":454} \ No newline at end of file +valueOf {"exBudgetCPU":10587665,"exBudgetMemory":23908,"scriptSizeBytes":198} +unionWith.const {"exBudgetCPU":45934490,"exBudgetMemory":111060,"scriptSizeBytes":454} +unionWith.(+) {"exBudgetCPU":45982834,"exBudgetMemory":110562,"scriptSizeBytes":451} +unionWith.tokens {"exBudgetCPU":43483569,"exBudgetMemory":106834,"scriptSizeBytes":460} +unionWith.symbols {"exBudgetCPU":24782993,"exBudgetMemory":61910,"scriptSizeBytes":452} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index 3a2fed235..00fb8927d 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -1,6 +1,6 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i15 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i16 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i17 i23 i24 1) (i17 i23 i24 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i19 i2 i3)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i21 (i13 i1) (i2 (i14 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i13 i2) i1) (\i0 -> i2) (i7 i15 (i12 (i13 i2)) i4)) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i19 i2 i3)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i21 (i13 i1) (i2 (i14 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i13 i2) i1) (\i0 -> i2) (i7 i15 (i12 (i13 i2)) i4)) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 #736f6d65746f6b656e 1) (i17 i23 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i19 i2 i3)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i21 (i13 i1) (i2 (i14 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i13 i2) i1) (\i0 -> i2) (i7 i15 (i12 (i13 i2)) i4)) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 i23 1) (i17 #c2 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i19 i2 i3)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i21 (i13 i1) (i2 (i14 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i13 i2) i1) (\i0 -> i2) (i7 i15 (i12 (i13 i2)) i4)) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) i1) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) \ No newline at end of file +valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i14 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i15 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i11 (bData i14) (mapData i1)) (i10 (bData i14) (iData i1))) 1) i12 i13) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 #736f6d65746f6b656e 1) (i16 i22 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 #c0 i22 1) (i16 #c2 i22 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 29d9efac9..4e82b1aa3 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -89,6 +89,9 @@ spec = do @-> passert "singleton" @| pmap @-> pshouldReallyBe pdmap "singletonData" @| pdmap @-> pshouldReallyBe pmap + "insert" @\ do + "empty" @| AssocMap.insert # pconstant "key" # 42 # emptyMap @-> pshouldReallyBe pmap + "replace" @| AssocMap.insert # pconstant "key" # 84 # pmap @-> pshouldReallyBe doubleMap "difference" @\ do "emptyLeft" @| AssocMap.difference # emptyMap # pmap @-> pshouldReallyBe emptyMap "emptyRight" @| AssocMap.difference # pmap # emptyMap @-> pshouldReallyBe pmap From 99a40149ad3722cb83be9022e3a47d2cb585d37a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 7 Apr 2022 13:31:45 -0400 Subject: [PATCH 404/584] Added delete & deleteData --- Plutarch/Api/V1/AssocMap.hs | 27 ++++++++++++++++++- plutarch-test/goldens/api.map.bench.golden | 5 ++++ .../goldens/api.map.uplc.eval.golden | 5 ++++ plutarch-test/goldens/api.map.uplc.golden | 5 ++++ .../plutarch-base/Plutarch/ApiSpec.hs | 13 ++++++++- 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index cf1370cf7..ad60f0008 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -10,6 +10,8 @@ module Plutarch.Api.V1.AssocMap ( singletonData, insert, insertData, + delete, + deleteData, -- * Lookups lookup, @@ -143,7 +145,9 @@ insert = phoistAcyclic $ plam $ \k v -> insertData # pdata k # pdata v -- | Insert a new data-encoded key/value pair into the map, overiding the previous if any. -insertData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v :--> PMap k v) +insertData :: + (PIsData k, PIsData v) => + Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v :--> PMap k v) insertData = phoistAcyclic $ plam $ \key val map -> plet (plam (pcons # (ppairDataBuiltin # key # val) #)) $ \addPair -> @@ -160,6 +164,27 @@ insertData = phoistAcyclic $ # pto map # plam id +-- | Delete a key from the map. +delete :: (PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMap k v) +delete = phoistAcyclic $ plam $ \key -> deleteData # pdata key + +-- | Delete a data-encoded key from the map. +deleteData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PMap k v :--> PMap k v) +deleteData = phoistAcyclic $ + plam $ \key map -> + punsafeFrom $ + precList + ( \self x xs -> + plam $ \prefix -> + pif + (pfstBuiltin # x #== key) + (prefix #$ xs) + (self # xs #$ plam $ \suffix -> prefix #$ pcons # x # suffix) + ) + (const $ plam (# pnil)) + # pto map + # plam id + -- | Construct an empty 'PMap'. empty :: Term (s :: S) (PMap k v) empty = punsafeFrom pnil diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index e15089bb1..6c5ad55f9 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -4,6 +4,11 @@ singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} insert.empty {"exBudgetCPU":3042621,"exBudgetMemory":7960,"scriptSizeBytes":129} insert.replace {"exBudgetCPU":5543088,"exBudgetMemory":12386,"scriptSizeBytes":151} +delete.empty {"exBudgetCPU":1818523,"exBudgetMemory":5264,"scriptSizeBytes":105} +delete.only {"exBudgetCPU":4438082,"exBudgetMemory":10090,"scriptSizeBytes":127} +delete.miss {"exBudgetCPU":5989683,"exBudgetMemory":13886,"scriptSizeBytes":137} +delete.new {"exBudgetCPU":12479267,"exBudgetMemory":27738,"scriptSizeBytes":229} +delete.old {"exBudgetCPU":9890616,"exBudgetMemory":22544,"scriptSizeBytes":230} difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":173} difference.emptyRight {"exBudgetCPU":6563780,"exBudgetMemory":16484,"scriptSizeBytes":176} difference.emptyResult {"exBudgetCPU":9839480,"exBudgetMemory":23042,"scriptSizeBytes":190} diff --git a/plutarch-test/goldens/api.map.uplc.eval.golden b/plutarch-test/goldens/api.map.uplc.eval.golden index 242b88321..868ef50ec 100644 --- a/plutarch-test/goldens/api.map.uplc.eval.golden +++ b/plutarch-test/goldens/api.map.uplc.eval.golden @@ -4,6 +4,11 @@ singleton (program 1.0.0 [(#436b6579, #182a)]) singletonData (program 1.0.0 [(#436b6579, #182a)]) insert.empty (program 1.0.0 [(#436b6579, #182a)]) insert.replace (program 1.0.0 [(#436b6579, #1854)]) +delete.empty (program 1.0.0 []) +delete.only (program 1.0.0 []) +delete.miss (program 1.0.0 [(#436b6579, #182a)]) +delete.new (program 1.0.0 [(#436b6579, #182a)]) +delete.old (program 1.0.0 [(#466e65776b6579, #06)]) difference.emptyLeft (program 1.0.0 []) difference.emptyRight (program 1.0.0 [(#436b6579, #182a)]) difference.emptyResult (program 1.0.0 []) diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index c2a1050f2..38482adef 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -4,6 +4,11 @@ singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) insert.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i4 i13))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i11 i2)) i7) (delay (i1 (i4 (i10 i2)))) (delay (i3 (i10 i2) (\i0 -> i2 (i13 (i12 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i9 (mkPairData i4 i3) i1)) (bData i2) (iData i1)) #6b6579 42 i4) (force tailList)) (force headList)) (force mkCons)) [ ])) insert.replace (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i4 i12))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i10 i2)) i7) (delay (i1 (i4 (i9 i2)))) (delay (i3 (i9 i2) (\i0 -> i2 (i12 (i11 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i8 (mkPairData i4 i3) i1)) (bData i6) (iData i1)) 84 ((\i0 -> (\i0 -> \i0 -> i6 (mkPairData i2 i1) i7) (bData i6) (iData i1)) 42)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) +delete.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 i9)) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i8 i2)) i5) (delay (i1 (i7 i2))) (delay (i3 (i7 i2) (\i0 -> i2 (force mkCons (i9 i3) i1))))))))) i1 (\i0 -> i1)) (bData i1)) #6b6579 i3) (force tailList)) (force headList)) [ ])) +delete.only (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 i9)) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i7 i2)) i5) (delay (i1 (i6 i2))) (delay (i3 (i6 i2) (\i0 -> i2 (i9 (i8 i3) i1))))))))) i1 (\i0 -> i1)) (bData i5) ((\i0 -> (\i0 -> \i0 -> i6 (mkPairData i2 i1) i7) (bData i6) (iData i1)) 42)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) +delete.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 i10)) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i8 i2)) i5) (delay (i1 (i7 i2))) (delay (i3 (i7 i2) (\i0 -> i2 (i10 (i9 i3) i1))))))))) i1 (\i0 -> i1)) (bData i1)) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> i7 (mkPairData i2 i1) i8) (bData i2) (iData i1)) #6b6579 42)) (force tailList)) (force headList)) (force mkCons)) [ ])) +delete.new (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i1 i14)) (delay (\i0 -> force (i8 (equalsData (i9 (i11 i2)) i5) (delay (i1 (i10 i2))) (delay (i3 (i10 i2) (\i0 -> i2 (i14 (i12 i3) i1))))))))) i1 (\i0 -> i1)) (bData i7) ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i1 (i4 i17))) (delay (\i0 -> force (i11 (equalsData (i12 (i14 i2)) i7) (delay (i1 (i4 (i13 i2)))) (delay (i3 (i13 i2) (\i0 -> i2 (i17 (i15 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i13 (mkPairData i4 i3) i1)) (bData i8) (iData i1)) 6 ((\i0 -> \i0 -> (\i0 -> \i0 -> i12 (mkPairData i2 i1) i13) (bData i2) (iData i1)) #6b6579 42))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) #6e65776b6579) (force mkCons)) [ ])) +delete.old (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i1 i13)) (delay (\i0 -> force (i8 (equalsData (i9 (i11 i2)) i5) (delay (i1 (i10 i2))) (delay (i3 (i10 i2) (\i0 -> i2 (i13 (i12 i3) i1))))))))) i1 (\i0 -> i1)) (bData i9) ((\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 (i4 i17))) (delay (\i0 -> force (i12 (equalsData (i13 (i15 i2)) i7) (delay (i1 (i4 (i14 i2)))) (delay (i3 (i14 i2) (\i0 -> i2 (i17 (i16 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i13 (mkPairData i4 i3) i1)) (bData i2) (iData i1)) #6e65776b6579 6 ((\i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i10) (iData i1)) 42))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i10 (i8 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i12 (i13 i1)) i4) (delay (i5 (i13 i1))) (delay (i2 (i14 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i7 (i8 i2)) i4)) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i11 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i13 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 4e82b1aa3..c96f62580 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -78,11 +78,12 @@ spec = do plift p @?= mint <> mintOtherSymbol describe "map" $ do pgoldenSpec $ do - let pmap, pdmap, emptyMap, doubleMap :: Term _ (AssocMap.PMap PByteString PInteger) + let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap PByteString PInteger) pmap = AssocMap.singleton # pconstant "key" # 42 pdmap = AssocMap.singletonData # pdata (pconstant "key") # pdata 42 emptyMap = AssocMap.empty doubleMap = AssocMap.singleton # pconstant "key" # 84 + otherMap = AssocMap.singleton # pconstant "newkey" # 6 "lookup" @| AssocMap.lookup # pconstant "key" # pmap #== pcon (PJust 42) @-> passert "lookupData" @| AssocMap.lookupData # pdata (pconstant "key") # pmap #== pcon (PJust $ pdata 42) @@ -92,6 +93,16 @@ spec = do "insert" @\ do "empty" @| AssocMap.insert # pconstant "key" # 42 # emptyMap @-> pshouldReallyBe pmap "replace" @| AssocMap.insert # pconstant "key" # 84 # pmap @-> pshouldReallyBe doubleMap + "delete" @\ do + "empty" @| AssocMap.delete # pconstant "key" # emptyMap @-> pshouldReallyBe emptyMap + "only" @| AssocMap.delete # pconstant "key" # pmap @-> pshouldReallyBe emptyMap + "miss" @| AssocMap.delete # pconstant "nokey" # pmap @-> pshouldReallyBe pmap + "new" @| + AssocMap.delete # pconstant "newkey" # (AssocMap.insert # pconstant "newkey" # 6 # pmap) + @-> pshouldReallyBe pmap + "old" @| + AssocMap.delete # pconstant "key" # (AssocMap.insert # pconstant "newkey" # 6 # pmap) + @-> pshouldReallyBe otherMap "difference" @\ do "emptyLeft" @| AssocMap.difference # emptyMap # pmap @-> pshouldReallyBe emptyMap "emptyRight" @| AssocMap.difference # pmap # emptyMap @-> pshouldReallyBe pmap From 192bbd560d965b9a67d7b05319b0783c80bf760c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 7 Apr 2022 13:59:02 -0400 Subject: [PATCH 405/584] Factored out the common logic of insert & delete --- Plutarch/Api/V1/AssocMap.hs | 38 ++++++++++--------- plutarch-test/goldens/api.map.bench.golden | 14 +++---- plutarch-test/goldens/api.map.uplc.golden | 14 +++---- .../plutarch-base/Plutarch/ApiSpec.hs | 8 ++-- 4 files changed, 38 insertions(+), 36 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index ad60f0008..1e6528429 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -45,6 +45,7 @@ import Plutarch.Maybe (pmaybe) import Plutarch.Prelude ( DerivePNewtype (..), PAsData, + PBuiltinList, PBuiltinPair, PCon (pcon), PConstant, @@ -149,20 +150,8 @@ insertData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v :--> PMap k v) insertData = phoistAcyclic $ - plam $ \key val map -> - plet (plam (pcons # (ppairDataBuiltin # key # val) #)) $ \addPair -> - punsafeFrom $ - precList - ( \self x xs -> - plam $ \prefix -> - pif - (pfstBuiltin # x #== key) - (prefix #$ addPair # xs) - (self # xs #$ plam $ \suffix -> prefix #$ pcons # x # suffix) - ) - (const $ plam (#$ addPair # pnil)) - # pto map - # plam id + plam $ \key val -> + rebuildAtKey # (plam (pcons # (ppairDataBuiltin # key # val) #)) # key -- | Delete a key from the map. delete :: (PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMap k v) @@ -170,18 +159,31 @@ delete = phoistAcyclic $ plam $ \key -> deleteData # pdata key -- | Delete a data-encoded key from the map. deleteData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PMap k v :--> PMap k v) -deleteData = phoistAcyclic $ - plam $ \key map -> +deleteData = rebuildAtKey # plam id + +-- | Rebuild the map at the given key. +rebuildAtKey :: + Term + s + ( ( PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)) + :--> PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)) + ) + :--> PAsData k + :--> PMap k v + :--> PMap k v + ) +rebuildAtKey = phoistAcyclic $ + plam $ \handler key map -> punsafeFrom $ precList ( \self x xs -> plam $ \prefix -> pif (pfstBuiltin # x #== key) - (prefix #$ xs) + (prefix #$ handler # xs) (self # xs #$ plam $ \suffix -> prefix #$ pcons # x # suffix) ) - (const $ plam (# pnil)) + (const $ plam (#$ handler # pnil)) # pto map # plam id diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index 6c5ad55f9..404cfc3b0 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -2,13 +2,13 @@ lookup {"exBudgetCPU":5590502,"exBudgetMemory":12555,"scriptSizeBytes":143} lookupData {"exBudgetCPU":5652634,"exBudgetMemory":12555,"scriptSizeBytes":143} singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} -insert.empty {"exBudgetCPU":3042621,"exBudgetMemory":7960,"scriptSizeBytes":129} -insert.replace {"exBudgetCPU":5543088,"exBudgetMemory":12386,"scriptSizeBytes":151} -delete.empty {"exBudgetCPU":1818523,"exBudgetMemory":5264,"scriptSizeBytes":105} -delete.only {"exBudgetCPU":4438082,"exBudgetMemory":10090,"scriptSizeBytes":127} -delete.miss {"exBudgetCPU":5989683,"exBudgetMemory":13886,"scriptSizeBytes":137} -delete.new {"exBudgetCPU":12479267,"exBudgetMemory":27738,"scriptSizeBytes":229} -delete.old {"exBudgetCPU":9890616,"exBudgetMemory":22544,"scriptSizeBytes":230} +insert.empty {"exBudgetCPU":3131940,"exBudgetMemory":8260,"scriptSizeBytes":132} +insert.replace {"exBudgetCPU":5632407,"exBudgetMemory":12686,"scriptSizeBytes":153} +delete.empty {"exBudgetCPU":1997161,"exBudgetMemory":5864,"scriptSizeBytes":112} +delete.only {"exBudgetCPU":4616720,"exBudgetMemory":10690,"scriptSizeBytes":134} +delete.miss {"exBudgetCPU":6168321,"exBudgetMemory":14486,"scriptSizeBytes":144} +delete.new {"exBudgetCPU":12836543,"exBudgetMemory":28938,"scriptSizeBytes":184} +delete.old {"exBudgetCPU":10247892,"exBudgetMemory":23744,"scriptSizeBytes":184} difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":173} difference.emptyRight {"exBudgetCPU":6563780,"exBudgetMemory":16484,"scriptSizeBytes":176} difference.emptyResult {"exBudgetCPU":9839480,"exBudgetMemory":23042,"scriptSizeBytes":190} diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index 38482adef..b0b833b83 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -2,13 +2,13 @@ lookup (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equa lookupData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsData i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (\i0 -> \i0 -> i2 (iData 42))) (force headList)) #6b6579)) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) -insert.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i4 i13))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i11 i2)) i7) (delay (i1 (i4 (i10 i2)))) (delay (i3 (i10 i2) (\i0 -> i2 (i13 (i12 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i9 (mkPairData i4 i3) i1)) (bData i2) (iData i1)) #6b6579 42 i4) (force tailList)) (force headList)) (force mkCons)) [ ])) -insert.replace (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i4 i12))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i10 i2)) i7) (delay (i1 (i4 (i9 i2)))) (delay (i3 (i9 i2) (\i0 -> i2 (i12 (i11 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i8 (mkPairData i4 i3) i1)) (bData i6) (iData i1)) 84 ((\i0 -> (\i0 -> \i0 -> i6 (mkPairData i2 i1) i7) (bData i6) (iData i1)) 42)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) -delete.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 i9)) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i8 i2)) i5) (delay (i1 (i7 i2))) (delay (i3 (i7 i2) (\i0 -> i2 (force mkCons (i9 i3) i1))))))))) i1 (\i0 -> i1)) (bData i1)) #6b6579 i3) (force tailList)) (force headList)) [ ])) -delete.only (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 i9)) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i7 i2)) i5) (delay (i1 (i6 i2))) (delay (i3 (i6 i2) (\i0 -> i2 (i9 (i8 i3) i1))))))))) i1 (\i0 -> i1)) (bData i5) ((\i0 -> (\i0 -> \i0 -> i6 (mkPairData i2 i1) i7) (bData i6) (iData i1)) 42)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) -delete.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 i10)) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i8 i2)) i5) (delay (i1 (i7 i2))) (delay (i3 (i7 i2) (\i0 -> i2 (i10 (i9 i3) i1))))))))) i1 (\i0 -> i1)) (bData i1)) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> i7 (mkPairData i2 i1) i8) (bData i2) (iData i1)) #6b6579 42)) (force tailList)) (force headList)) (force mkCons)) [ ])) -delete.new (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i1 i14)) (delay (\i0 -> force (i8 (equalsData (i9 (i11 i2)) i5) (delay (i1 (i10 i2))) (delay (i3 (i10 i2) (\i0 -> i2 (i14 (i12 i3) i1))))))))) i1 (\i0 -> i1)) (bData i7) ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i1 (i4 i17))) (delay (\i0 -> force (i11 (equalsData (i12 (i14 i2)) i7) (delay (i1 (i4 (i13 i2)))) (delay (i3 (i13 i2) (\i0 -> i2 (i17 (i15 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i13 (mkPairData i4 i3) i1)) (bData i8) (iData i1)) 6 ((\i0 -> \i0 -> (\i0 -> \i0 -> i12 (mkPairData i2 i1) i13) (bData i2) (iData i1)) #6b6579 42))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) #6e65776b6579) (force mkCons)) [ ])) -delete.old (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i1 i13)) (delay (\i0 -> force (i8 (equalsData (i9 (i11 i2)) i5) (delay (i1 (i10 i2))) (delay (i3 (i10 i2) (\i0 -> i2 (i13 (i12 i3) i1))))))))) i1 (\i0 -> i1)) (bData i9) ((\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 (i4 i17))) (delay (\i0 -> force (i12 (equalsData (i13 (i15 i2)) i7) (delay (i1 (i4 (i14 i2)))) (delay (i3 (i14 i2) (\i0 -> i2 (i17 (i16 i3) i1))))))))) i2 (\i0 -> i1)) (\i0 -> i13 (mkPairData i4 i3) i1)) (bData i2) (iData i1)) #6e65776b6579 6 ((\i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i10) (iData i1)) 42))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) +insert.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i14))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i14 (i13 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i8 (mkPairData i3 i2) i1) i2) (bData i2) (iData i1)) #6b6579 42 i4) (force tailList)) (force headList)) (force mkCons)) [ ])) +insert.replace (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i13))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i11 i2)) i5) (delay (i1 (i6 (i10 i2)))) (delay (i3 (i10 i2) (\i0 -> i2 (i13 (i12 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i7 (mkPairData i3 i2) i1) i2) (bData i6) (iData i1)) 84 ((\i0 -> (\i0 -> \i0 -> i6 (mkPairData i2 i1) i7) (bData i6) (iData i1)) 42)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) +delete.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i10))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i9 i2)) i5) (delay (i1 (i6 (i8 i2)))) (delay (i3 (i8 i2) (\i0 -> i2 (force mkCons (i10 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i1) (bData i1)) #6b6579 i3) (force tailList)) (force headList)) [ ])) +delete.only (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i10))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i8 i2)) i5) (delay (i1 (i6 (i7 i2)))) (delay (i3 (i7 i2) (\i0 -> i2 (i10 (i9 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i1) (bData i5) ((\i0 -> (\i0 -> \i0 -> i6 (mkPairData i2 i1) i7) (bData i6) (iData i1)) 42)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) +delete.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i11))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i9 i2)) i5) (delay (i1 (i6 (i8 i2)))) (delay (i3 (i8 i2) (\i0 -> i2 (i11 (i10 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i1) (bData i1)) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> i7 (mkPairData i2 i1) i8) (bData i2) (iData i1)) #6b6579 42)) (force tailList)) (force headList)) (force mkCons)) [ ])) +delete.new (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i1) (bData i8) ((\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i13 (mkPairData i3 i2) i1) i2) (bData i9) (iData i1)) 6 ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i1 (i6 i15))) (delay (\i0 -> force (i9 (equalsData (i10 (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i15 (i13 i3) i1))))))))) i1 (\i0 -> i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) #6e65776b6579) (force mkCons)) [ ])) +delete.old (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i1) (bData i10) ((\i0 -> \i0 -> (\i0 -> \i0 -> i5 (\i0 -> i13 (mkPairData i3 i2) i1) i2) (bData i2) (iData i1)) #6e65776b6579 6 ((\i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i11) (iData i1)) 42))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i1 (i6 i14))) (delay (\i0 -> force (i9 (equalsData (i10 (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i14 (i13 i3) i1))))))))) i1 (\i0 -> i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i10 (i8 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i12 (i13 i1)) i4) (delay (i5 (i13 i1))) (delay (i2 (i14 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i7 (i8 i2)) i4)) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i11 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i13 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index c96f62580..a2817d94f 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -97,11 +97,11 @@ spec = do "empty" @| AssocMap.delete # pconstant "key" # emptyMap @-> pshouldReallyBe emptyMap "only" @| AssocMap.delete # pconstant "key" # pmap @-> pshouldReallyBe emptyMap "miss" @| AssocMap.delete # pconstant "nokey" # pmap @-> pshouldReallyBe pmap - "new" @| - AssocMap.delete # pconstant "newkey" # (AssocMap.insert # pconstant "newkey" # 6 # pmap) + "new" + @| AssocMap.delete # pconstant "newkey" # (AssocMap.insert # pconstant "newkey" # 6 # pmap) @-> pshouldReallyBe pmap - "old" @| - AssocMap.delete # pconstant "key" # (AssocMap.insert # pconstant "newkey" # 6 # pmap) + "old" + @| AssocMap.delete # pconstant "key" # (AssocMap.insert # pconstant "newkey" # 6 # pmap) @-> pshouldReallyBe otherMap "difference" @\ do "emptyLeft" @| AssocMap.difference # emptyMap # pmap @-> pshouldReallyBe emptyMap From 2c77a22276a2ed7d99cfc9963aab91747ae30d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 7 Apr 2022 14:33:18 -0400 Subject: [PATCH 406/584] Restored the deleted golden files --- ...pi.example.signatory.dev=true.bench.golden | 4 ++ ...xample.signatory.dev=true.uplc.eval.golden | 4 ++ ...api.example.signatory.dev=true.uplc.golden | 4 ++ .../goldens/list.dev=true.bench.golden | 25 ++++++++ .../goldens/list.dev=true.uplc.eval.golden | 25 ++++++++ .../goldens/list.dev=true.uplc.golden | 25 ++++++++ ...pi.example.signatory.dev=true.bench.golden | 2 + ...xample.signatory.dev=true.uplc.eval.golden | 2 + .../goldens/rec.dev=true.bench.golden | 45 ++++++++++++++ .../goldens/rec.dev=true.uplc.eval.golden | 59 +++++++++++++++++++ .../goldens/rec.dev=true.uplc.golden | 45 ++++++++++++++ .../goldens/trace.dev=true.bench.golden | 10 ++++ .../goldens/trace.dev=true.uplc.eval.golden | 10 ++++ .../goldens/trace.dev=true.uplc.golden | 10 ++++ 14 files changed, 270 insertions(+) create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.bench.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/list.dev=true.bench.golden create mode 100644 plutarch-test/goldens/list.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/list.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.dev=true.bench.golden create mode 100644 plutarch-test/goldens/rec.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/rec.dev=true.uplc.golden create mode 100644 plutarch-test/goldens/trace.dev=true.bench.golden create mode 100644 plutarch-test/goldens/trace.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/trace.dev=true.uplc.golden diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden new file mode 100644 index 000000000..6759b8694 --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden @@ -0,0 +1,4 @@ +cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} +cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} +termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} +termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden new file mode 100644 index 000000000..0070757cf --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ()) +cont.fails (program 1.0.0 error) +termcont.succeeds (program 1.0.0 ()) +termcont.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden new file mode 100644 index 000000000..0be2377ab --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.bench.golden b/plutarch-test/goldens/list.dev=true.bench.golden new file mode 100644 index 000000000..64e96914d --- /dev/null +++ b/plutarch-test/goldens/list.dev=true.bench.golden @@ -0,0 +1,25 @@ +pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} +phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} +ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} +pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} +pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} +pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} +pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} +pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} +pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} +pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} +pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} +pfoldl.nonempty {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.nonempty-primed {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.empty {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +pfoldl.empty-primed {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} +elemAt.elemAt_3_[1..10] {"exBudgetCPU":22527179,"exBudgetMemory":56708,"scriptSizeBytes":157} +elemAt.elemAt_0_[1..10] {"exBudgetCPU":17681228,"exBudgetMemory":43796,"scriptSizeBytes":157} +elemAt.elemAt_9_[1..10] {"exBudgetCPU":32219081,"exBudgetMemory":82532,"scriptSizeBytes":157} +find.find_(==3)_[1..4] {"exBudgetCPU":11027650,"exBudgetMemory":29622,"scriptSizeBytes":100} +find.find_(==5)_[1..4] {"exBudgetCPU":13130537,"exBudgetMemory":36224,"scriptSizeBytes":100} +x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} +x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} +uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} +uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} +uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.uplc.eval.golden b/plutarch-test/goldens/list.dev=true.uplc.eval.golden new file mode 100644 index 000000000..24db9cb06 --- /dev/null +++ b/plutarch-test/goldens/list.dev=true.uplc.eval.golden @@ -0,0 +1,25 @@ +pmatch (program 1.0.0 error) +phead (program 1.0.0 True) +ptail (program 1.0.0 True) +pnull.empty (program 1.0.0 True) +pnull.nonempty (program 1.0.0 True) +pconcat.identity (program 1.0.0 True) +pmap.eg (program 1.0.0 True) +pmap.identity (program 1.0.0 True) +pfilter.evens (program 1.0.0 True) +pfilter.gt5 (program 1.0.0 True) +pzipWith.double (program 1.0.0 True) +pfoldl.nonempty (program 1.0.0 True) +pfoldl.nonempty-primed (program 1.0.0 True) +pfoldl.empty (program 1.0.0 True) +pfoldl.empty-primed (program 1.0.0 True) +elemAt.elemAt_3_[1..10] (program 1.0.0 4) +elemAt.elemAt_0_[1..10] (program 1.0.0 1) +elemAt.elemAt_9_[1..10] (program 1.0.0 10) +find.find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) +find.find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) +x1+x2.builtin (program 1.0.0 3) +x1+x2.pmatch (program 1.0.0 3) +uncons.ChooseList (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail (program 1.0.0 [2,3,4,5]) +uncons.head-and-tail-and-null (program 1.0.0 [2,3,4,5]) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.uplc.golden b/plutarch-test/goldens/list.dev=true.uplc.golden new file mode 100644 index 000000000..7027f46c2 --- /dev/null +++ b/plutarch-test/goldens/list.dev=true.uplc.golden @@ -0,0 +1,25 @@ +pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) +phead (program 1.0.0 (equalsInteger 1 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +ptail (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [2,3,4,5,6,7,8,9,10]) ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (i1 [1,2,3,4,5,6,7,8,9,10]))) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) +pnull.nonempty (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) +pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i4 i2 i1 (delay False)) (i1 (i3 (i4 i10) (\i0 -> \i0 -> force i1)) (i3 (\i0 -> \i0 -> force i1) (i4 i10))) (delay (i1 (i3 (\i0 -> \i0 -> force i1) (i4 i10)) (i4 i10))))) (i4 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))))) (force ifThenElse)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i10 i2 (i4 i1)) (delay i3)) i2)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) +pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i3 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i9 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 [1,2,3,4,5,6,7,8,9,10])) (i1 [2,4,6,8,10,12,14,16,18,20])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pmap.identity (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> force i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfilter.evens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [2,4,6,8,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfilter.gt5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [6,7,8,9,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pzipWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i2 i1) (i2 i1)) (i2 [2,4,6,8,10,12,14,16,18,20])) [1,2,3,4,5,6,7,8,9,10]) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) +pfoldl.nonempty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.nonempty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +pfoldl.empty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +elemAt.elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay (force (force trace "pelemAt: negative index" (delay error)))) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==3)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +find.find_(==5)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +x1+x2.builtin (program 1.0.0 ((\i0 -> (\i0 -> addInteger (i1 (force tailList i2)) (i1 i2)) (force headList)) [1,2,3,4,5])) +x1+x2.pmatch (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i1 i3 (delay error) (delay ((\i0 -> force (i2 i1 (delay error) (delay (addInteger (i3 i4) (i3 i1))))) (force tailList i3))))) (force (force chooseList))) (force headList)) [1,2,3,4,5])) +uncons.ChooseList (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay error) (delay (force tailList i1)))) [1,2,3,4,5])) +uncons.head-and-tail (program 1.0.0 ((\i0 -> (\i0 -> force tailList i2) (force headList i1)) [1,2,3,4,5])) +uncons.head-and-tail-and-null (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse i1 (delay error) (delay ((\i0 -> force tailList i3) (force headList i2))))) (force nullList i1)) [1,2,3,4,5])) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden new file mode 100644 index 000000000..332672742 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -0,0 +1,2 @@ +do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":390} +do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":386} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden new file mode 100644 index 000000000..a9c117adc --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ()) +do.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.bench.golden b/plutarch-test/goldens/rec.dev=true.bench.golden new file mode 100644 index 000000000..c1d0f244d --- /dev/null +++ b/plutarch-test/goldens/rec.dev=true.bench.golden @@ -0,0 +1,45 @@ +simple.constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} +simple.field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} +simple.reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} +simple.reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} +LetRec.record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} +LetRec.even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} +LetRec.even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} +LetRec.even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} +nested.flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} +nested.flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} +nested.flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} +nested.flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} +nested.flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} +nested.shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} +nested.shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} +nested.shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} +nested.shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} +nested.shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +nested.shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} +Data.pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} +Data.pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} +Data.pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} +Data.pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} +Data.fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":72} +Data.fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":84} +Data.fieldFromData.nested.shallow {"exBudgetCPU":893290,"exBudgetMemory":3100,"scriptSizeBytes":161} +Data.pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":118} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.dev=true.uplc.eval.golden new file mode 100644 index 000000000..16ab3b629 --- /dev/null +++ b/plutarch-test/goldens/rec.dev=true.uplc.eval.golden @@ -0,0 +1,59 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 6) +simple.field.value.direct-access (program 1.0.0 6) +simple.field.value.pmatch (program 1.0.0 "Salut, Monde!") +simple.field.value.pmatch' (program 1.0.0 "Salut, Monde!") +simple.field.value.rmatch (program 1.0.0 "Salut, Monde!") +simple.reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.reconstr.field-access (program 1.0.0 6) +LetRec.record (program 1.0.0 12) +LetRec.record-field (program 1.0.0 12) +LetRec.even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) +LetRec.even.4 (program 1.0.0 True) +LetRec.even.5 (program 1.0.0 False) +nested.flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.nested-field-access (program 1.0.0 9) +nested.flat.nested-field-value.direct-access (program 1.0.0 9) +nested.flat.nested-field-value.pmatch (program 1.0.0 9) +nested.flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 9) +nested.flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.flat.nested-match-value (program 1.0.0 "Salut, Monde!") +nested.shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.nested-field-access (program 1.0.0 9) +nested.shallow.nested-field-value.direct-access (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch (program 1.0.0 9) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") +nested.shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 9) +nested.shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 "Salut, Monde!") +nested.shallow.nested-match-value (program 1.0.0 "Salut, Monde!") +Data.pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) +Data.pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) +Data.pdata.flat-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d87980 + , #06 + , #4d53616c75742c204d6f6e646521 + , #04 + , #d87980 + , #09 + , #4d53616c75742c204d6f6e646521 + , #4c486f6c612c204d756e646f21 ] )) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ( 0 +, [ #d87980 + , #d8799fd87980064d53616c75742c204d6f6e646521ff + , #04 + , #d8799fd87980094d53616c75742c204d6f6e646521ff + , #4c486f6c612c204d756e646f21 ] )) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +Data.fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) +Data.pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.golden b/plutarch-test/goldens/rec.dev=true.uplc.golden new file mode 100644 index 000000000..772f9ecfb --- /dev/null +++ b/plutarch-test/goldens/rec.dev=true.uplc.golden @@ -0,0 +1,45 @@ +simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) +simple.field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) +simple.field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) +simple.reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) +simple.reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) +LetRec.even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) +LetRec.even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) +nested.flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) +nested.flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) +nested.flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) +nested.flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) +nested.shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) +nested.shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) +nested.shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) +nested.shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) +nested.shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +nested.shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) +Data.pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) +Data.pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) +Data.pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) +Data.pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) +Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) +Data.fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1))) (force tailList))) +Data.fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay (force (i9 i10 (delay error)))))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay (force (i8 i9 (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (force trace)) "verifySoleConstructor failed")) +Data.pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.bench.golden b/plutarch-test/goldens/trace.dev=true.bench.golden new file mode 100644 index 000000000..98057425d --- /dev/null +++ b/plutarch-test/goldens/trace.dev=true.bench.golden @@ -0,0 +1,10 @@ +ptrace.one {"exBudgetCPU":388284,"exBudgetMemory":932,"scriptSizeBytes":16} +ptrace.two {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":30} +ptraceShowId.right-42 {"exBudgetCPU":16124851,"exBudgetMemory":35093,"scriptSizeBytes":379} +ptraceIfTrue.true {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} +ptraceIfTrue.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} +ptraceIfFalse.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} +ptraceIfFalse.false {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} +chained.false.true.false {"exBudgetCPU":1192157,"exBudgetMemory":3634,"scriptSizeBytes":51} +chained.ptrace.true.false {"exBudgetCPU":834880,"exBudgetMemory":2433,"scriptSizeBytes":40} +chained.ptrace.true.true {"exBudgetCPU":1103972,"exBudgetMemory":2865,"scriptSizeBytes":40} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.uplc.eval.golden b/plutarch-test/goldens/trace.dev=true.uplc.eval.golden new file mode 100644 index 000000000..51bcda305 --- /dev/null +++ b/plutarch-test/goldens/trace.dev=true.uplc.eval.golden @@ -0,0 +1,10 @@ +ptrace.one (program 1.0.0 ()) +ptrace.two (program 1.0.0 ()) +ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) +ptraceIfTrue.true (program 1.0.0 True) +ptraceIfTrue.false (program 1.0.0 False) +ptraceIfFalse.true (program 1.0.0 True) +ptraceIfFalse.false (program 1.0.0 False) +chained.false.true.false (program 1.0.0 False) +chained.ptrace.true.false (program 1.0.0 False) +chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.uplc.golden b/plutarch-test/goldens/trace.dev=true.uplc.golden new file mode 100644 index 000000000..5a77c4925 --- /dev/null +++ b/plutarch-test/goldens/trace.dev=true.uplc.golden @@ -0,0 +1,10 @@ +ptrace.one (program 1.0.0 (force (force trace "foo" (delay ())))) +ptrace.two (program 1.0.0 ((\i0 -> force (i1 "foo" (delay (force (i1 "bar" (delay ())))))) (force trace))) +ptraceShowId.right-42 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force trace ((\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) (delay (\i0 -> \i0 -> i1 42)))) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +ptraceIfTrue.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) True)) +ptraceIfTrue.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) False)) +ptraceIfFalse.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) True)) +ptraceIfFalse.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) False)) +chained.false.true.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i2 i1 (delay i1) (delay (i3 "foo" i1)))) ((\i0 -> force (i2 i1 (delay (i3 "bar" i1)) (delay i1))) False)) (force ifThenElse)) (force trace))) +chained.ptrace.true.false (program 1.0.0 ((\i0 -> force (i1 "foo" (delay ((\i0 -> force (force ifThenElse i1 (delay (i2 "bar" i1)) (delay i1))) False)))) (force trace))) +chained.ptrace.true.true (program 1.0.0 ((\i0 -> force (i1 "foo" (delay ((\i0 -> force (force ifThenElse i1 (delay (i2 "bar" i1)) (delay i1))) True)))) (force trace))) \ No newline at end of file From 1c506d0a28174ea7ed78174fa85451804e689383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 7 Apr 2022 18:28:57 -0400 Subject: [PATCH 407/584] Applied testing suggestions --- plutarch-test/goldens/api.map.bench.golden | 6 ++++-- plutarch-test/goldens/api.map.uplc.eval.golden | 7 +++++-- plutarch-test/goldens/api.map.uplc.golden | 6 ++++-- plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 14 ++++++++++---- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index 404cfc3b0..708541b76 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -1,5 +1,7 @@ -lookup {"exBudgetCPU":5590502,"exBudgetMemory":12555,"scriptSizeBytes":143} -lookupData {"exBudgetCPU":5652634,"exBudgetMemory":12555,"scriptSizeBytes":143} +lookup.hit {"exBudgetCPU":4140352,"exBudgetMemory":9090,"scriptSizeBytes":116} +lookup.miss {"exBudgetCPU":4975131,"exBudgetMemory":11422,"scriptSizeBytes":126} +lookupData.hit {"exBudgetCPU":4140352,"exBudgetMemory":9090,"scriptSizeBytes":114} +lookupData.miss {"exBudgetCPU":4885812,"exBudgetMemory":11122,"scriptSizeBytes":121} singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} insert.empty {"exBudgetCPU":3131940,"exBudgetMemory":8260,"scriptSizeBytes":132} diff --git a/plutarch-test/goldens/api.map.uplc.eval.golden b/plutarch-test/goldens/api.map.uplc.eval.golden index 868ef50ec..3490ddefc 100644 --- a/plutarch-test/goldens/api.map.uplc.eval.golden +++ b/plutarch-test/goldens/api.map.uplc.eval.golden @@ -1,5 +1,8 @@ -lookup (program 1.0.0 True) -lookupData (program 1.0.0 True) +lookup.hit (program 1.0.0 (\i0 -> \i0 -> i2 (unIData (force (force sndPair) ( #436b6579 +, #182a ))))) +lookup.miss (program 1.0.0 (\i0 -> \i0 -> force i1)) +lookupData.hit (program 1.0.0 (\i0 -> \i0 -> i2 (force (force sndPair) (#436b6579, #182a)))) +lookupData.miss (program 1.0.0 (\i0 -> \i0 -> force i1)) singleton (program 1.0.0 [(#436b6579, #182a)]) singletonData (program 1.0.0 [(#436b6579, #182a)]) insert.empty (program 1.0.0 [(#436b6579, #182a)]) diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index b0b833b83..29de8e975 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -1,5 +1,7 @@ -lookup (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (\i0 -> \i0 -> i2 42)) (force headList)) #6b6579)) -lookupData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsData i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (\i0 -> \i0 -> i2 (iData 42))) (force headList)) #6b6579)) +lookup.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) +lookup.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i7 i1)) i4) (delay (i5 (i7 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i1)) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) +lookupData.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) +lookupData.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData #6e6f6b6579) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) insert.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i14))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i14 (i13 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i8 (mkPairData i3 i2) i1) i2) (bData i2) (iData i1)) #6b6579 42 i4) (force tailList)) (force headList)) (force mkCons)) [ ])) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index a2817d94f..1f93c275f 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -84,10 +84,16 @@ spec = do emptyMap = AssocMap.empty doubleMap = AssocMap.singleton # pconstant "key" # 84 otherMap = AssocMap.singleton # pconstant "newkey" # 6 - "lookup" @| AssocMap.lookup # pconstant "key" # pmap #== pcon (PJust 42) @-> passert - "lookupData" - @| AssocMap.lookupData # pdata (pconstant "key") # pmap #== pcon (PJust $ pdata 42) - @-> passert + "lookup" @\ do + "hit" @| AssocMap.lookup # pconstant "key" # pmap + @-> \result -> passert $ result #== pcon (PJust 42) + "miss" @| AssocMap.lookup # pconstant "nokey" # pmap + @-> \result -> passert $ result #== pcon PNothing + "lookupData" @\ do + "hit" @| AssocMap.lookupData # pdata (pconstant "key") # pmap + @-> \result -> passert $ result #== pcon (PJust $ pdata 42) + "miss" @| AssocMap.lookupData # pdata (pconstant "nokey") # pmap + @-> \result -> passert $ result #== pcon PNothing "singleton" @| pmap @-> pshouldReallyBe pdmap "singletonData" @| pdmap @-> pshouldReallyBe pmap "insert" @\ do From 5df4ff0c16092fa95ec4a0f0b3a0ba87923bc3b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 8 Apr 2022 13:35:25 -0400 Subject: [PATCH 408/584] Added PValue equality and its dependencies --- Plutarch/Api/V1/AssocMap.hs | 16 +++++++++++++--- Plutarch/Api/V1/Value.hs | 9 +++++++++ plutarch-test/goldens/api.value.bench.golden | 8 +++++++- .../goldens/api.value.uplc.eval.golden | 8 +++++++- plutarch-test/goldens/api.value.uplc.golden | 8 +++++++- .../plutarch-base/Plutarch/ApiSpec.hs | 18 +++++++++++++++++- 6 files changed, 60 insertions(+), 7 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 1e6528429..9dd8e2fa3 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -17,6 +17,9 @@ module Plutarch.Api.V1.AssocMap ( lookup, lookupData, + -- * Folds + all, + -- * Traversals mapEitherWithKey, mapEitherWithKeyData, @@ -45,6 +48,7 @@ import Plutarch.Maybe (pmaybe) import Plutarch.Prelude ( DerivePNewtype (..), PAsData, + PBool, PBuiltinList, PBuiltinPair, PCon (pcon), @@ -61,6 +65,7 @@ import Plutarch.Prelude ( PlutusType, S, Term, + pall, pconcat, pfstBuiltin, phoistAcyclic, @@ -76,9 +81,9 @@ import Plutarch.Prelude ( ) import Plutarch.Unsafe (punsafeFrom) -import Prelude hiding (lookup) +import Prelude hiding (all, lookup) -newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) +newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term (s :: S) (PBuiltinMap k v)) deriving (PlutusType, PIsData) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) instance @@ -255,6 +260,11 @@ difference = phoistAcyclic $ (const pnil) # pto left +all :: PIsData v => Term (s :: S) ((v :--> PBool) :--> PMap k v :--> PBool) +all = phoistAcyclic $ + plam $ \pred map -> + pall # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map + -- | Map keys/values and separate the @Left@ and @Right@ results. mapEitherWithKey :: (PIsData k, PIsData a, PIsData b, PIsData c) => @@ -267,7 +277,7 @@ mapEitherWithKey = phoistAcyclic $ bidata :: forall (s :: S) (a :: PType) (b :: PType). (PIsData a, PIsData b) => - Term s (PEither a b :--> PEither (PAsData a) (PAsData b)) + Term (s :: S) (PEither a b :--> PEither (PAsData a) (PAsData b)) bidata = peither # plam (pcon . PLeft . pdata) # plam (pcon . PRight . pdata) -- | Map data-encoded keys/values and separate the @Left@ and @Right@ results. diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index ab3b47e70..9093a22c8 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -5,6 +5,7 @@ module Plutarch.Api.V1.Value ( PValue (PValue), PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), + isZero, singleton, unionWith, valueOf, @@ -54,6 +55,9 @@ deriving via instance PConstantDecl Plutus.Value +instance PEq PValue where + a #== b = isZero #$ unionWith # plam (-) # a # b + -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. singleton :: Term (s :: S) (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue) singleton = phoistAcyclic $ @@ -70,6 +74,11 @@ valueOf = phoistAcyclic $ PNothing -> 0 PJust amount -> amount +-- | Check if the value is zero. +isZero :: Term (s :: S) (PValue :--> PBool) +isZero = phoistAcyclic $ + plam $ \value -> AssocMap.all # (AssocMap.all # plam (#== 0)) # pto value + {- | Combine two 'PValue's applying the given function to any pair of quantities with the same asset class. Note that the result is _not_ normalized and may contain zero quantities. diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index 01c17ff7a..4a5fddae0 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -3,4 +3,10 @@ valueOf {"exBudgetCPU":10587665,"exBudgetMemory":23908,"scriptSizeBytes":198} unionWith.const {"exBudgetCPU":45934490,"exBudgetMemory":111060,"scriptSizeBytes":454} unionWith.(+) {"exBudgetCPU":45982834,"exBudgetMemory":110562,"scriptSizeBytes":451} unionWith.tokens {"exBudgetCPU":43483569,"exBudgetMemory":106834,"scriptSizeBytes":460} -unionWith.symbols {"exBudgetCPU":24782993,"exBudgetMemory":61910,"scriptSizeBytes":452} \ No newline at end of file +unionWith.symbols {"exBudgetCPU":24782993,"exBudgetMemory":61910,"scriptSizeBytes":452} +isZero.true {"exBudgetCPU":52892795,"exBudgetMemory":127649,"scriptSizeBytes":526} +isZero.false {"exBudgetCPU":8700981,"exBudgetMemory":21315,"scriptSizeBytes":178} +equality.triviallyTrue {"exBudgetCPU":52892795,"exBudgetMemory":127649,"scriptSizeBytes":526} +equality.triviallyFalse {"exBudgetCPU":48483518,"exBudgetMemory":119393,"scriptSizeBytes":536} +equality.swappedTokensTrue {"exBudgetCPU":150951231,"exBudgetMemory":361225,"scriptSizeBytes":579} +equality.swappedSymbolsTrue {"exBudgetCPU":135145220,"exBudgetMemory":323294,"scriptSizeBytes":570} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index 6369b5564..18b2b5c86 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -4,4 +4,10 @@ unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) unionWith.(+) (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) unionWith.tokens (program 1.0.0 [(#41c0, #a249736f6d65746f6b656e014a6f74686572746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) - , (#41c2, #a149736f6d65746f6b656e01) ]) \ No newline at end of file + , (#41c2, #a149736f6d65746f6b656e01) ]) +isZero.true (program 1.0.0 True) +isZero.false (program 1.0.0 False) +equality.triviallyTrue (program 1.0.0 True) +equality.triviallyFalse (program 1.0.0 False) +equality.swappedTokensTrue (program 1.0.0 True) +equality.swappedSymbolsTrue (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index 00fb8927d..bad493c4c 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -3,4 +3,10 @@ valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 #736f6d65746f6b656e 1) (i16 i22 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 #c0 i22 1) (i16 #c2 i22 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) \ No newline at end of file +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 #c0 i22 1) (i16 #c2 i22 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 i26 1) (i19 i25 i26 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 i26 1) (i19 i25 i26 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 #736f6d65746f6b656e 1) (i19 i25 #6f74686572746f6b656e 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i25 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i25 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i23 i29 i30 1) (i23 i29 i22 1)) (i4 addInteger (i23 i29 i22 1) (i23 i29 i30 1)))) (\i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i16 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i21 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i25 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i25 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i23 i29 i30 1) (i23 i22 i30 1)) (i4 addInteger (i23 i22 i30 1) (i23 i29 i30 1)))) (\i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i16 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i21 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 1f93c275f..797b1a826 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -76,6 +76,20 @@ spec = do plift p @?= mint <> mintOtherToken "symbols" @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> plift p @?= mint <> mintOtherSymbol + "isZero" @\ do + "true" @| PValue.isZero # (PValue.unionWith # plam (-) # pmint # pmint) @-> passert + "false" @| PValue.isZero # pmint @-> passertNot + "equality" @\ do + "triviallyTrue" @| pmint #== pmint @-> passert + "triviallyFalse" @| pmint #== pmintOtherToken @-> passertNot + "swappedTokensTrue" + @| PValue.unionWith # plam (+) # pmint # pmintOtherToken + #== PValue.unionWith # plam (+) # pmintOtherToken # pmint + @-> passert + "swappedSymbolsTrue" + @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol + #== PValue.unionWith # plam (+) # pmintOtherSymbol # pmint + @-> passert describe "map" $ do pgoldenSpec $ do let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap PByteString PInteger) @@ -120,11 +134,13 @@ spec = do "const" @| AssocMap.unionWithData # plam const # pmap # pmap @-> pshouldReallyBe pmap "emptyLeft" @| AssocMap.unionWithData # plam const # emptyMap # pmap @-> pshouldReallyBe pmap "emptyRight" @| AssocMap.unionWithData # plam const # pmap # emptyMap @-> pshouldReallyBe pmap - {- TODO: fails due to incomplete normalization "mapEitherWithKey" @\ do "const" @| AssocMap.mapEitherWithKey # plam (const $ pcon . PRight) # pmap @-> pshouldReallyBe (pcon $ PPair emptyMap pmap) + "mapEitherWithKey" @\ do + "const" @| AssocMap.mapEitherWithKey # plam (const $ pcon . PRight) # pmap + @-> \result-> passert $ result #== pcon (PPair emptyMap pmap) -} describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to From 0b84e4350c297f9b98245d89ea673f905188d23c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 8 Apr 2022 15:48:08 -0400 Subject: [PATCH 409/584] Fixed the merge --- Plutarch/Api/V1/AssocMap.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 9dd8e2fa3..8190ed05b 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -52,11 +52,11 @@ import Plutarch.Prelude ( PBuiltinList, PBuiltinPair, PCon (pcon), - PConstant, + PConstantData, PEither (..), PEq ((#==)), PIsData (..), - PLift, + PLiftData, PListLike (pcons, pnil), PMatch (pmatch), PMaybe (..), From 4cb0ea8cac7d258aa27d5510e90c19cfc281b79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 15 Apr 2022 17:44:05 -0400 Subject: [PATCH 410/584] Added some FFI benchmarks --- flake.nix | 2 +- plutarch-test/conditional/Plutarch/FFISpec.hs | 7 +++++++ plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden | 1 + plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden | 1 + plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden create mode 100644 plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden create mode 100644 plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden diff --git a/flake.nix b/flake.nix index 6d261720e..31ed6df4d 100644 --- a/flake.nix +++ b/flake.nix @@ -615,7 +615,7 @@ type = "app"; program = checkedShellScript system "plutarch-test-${name}" '' - cd ${self}/plutarch-test + { touch ./plutarch-test/.crumb 2> /dev/null && cd ./plutarch-test && rm .crumb ; } || cd ${self}/plutarch-test ${flake.packages."plutarch-test:exe:plutarch-test"}/bin/plutarch-test; ''; }; diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index 6b7673db6..faf5d83ee 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -22,6 +22,7 @@ import Plutarch.List (pconvertLists) import Plutarch.Prelude import Plutarch.Rec qualified as Rec import Plutarch.Rec.TH (deriveAll) +import Plutarch.Test import Plutus.V1.Ledger.Api ( Address (Address), Credential (ScriptCredential), @@ -385,6 +386,12 @@ spec = describe "FFI" $ do it "evaluate a Data -> PubKeyHash -> Bool function to False" $ printEvaluatedTerm (importedTxSignedBy' # pconstantData info # pconstant "0123") @?= Right "(program 1.0.0 False)" + + describe "Benchmarks" $ do + pgoldenSpec $ do + "Value.isZero" + @| (foreignImport $$(PlutusTx.compile [||toBuiltin . Value.isZero||]) :: Term _ (PSValue :--> PBool)) + @-> \isZero -> passertNot (isZero # foreignImport (PlutusTx.liftCode val)) where sampleScottEncoding = "(program 1.0.0 (delay (\\i0 -> i1 False 6 \"Hello\")))" sampleScottField = "(program 1.0.0 (\\i0 -> force i1 (\\i0 -> \\i0 -> \\i0 -> i2)))" diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden new file mode 100644 index 000000000..587cf5f10 --- /dev/null +++ b/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden @@ -0,0 +1 @@ +Value.isZero {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":154} \ No newline at end of file diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden new file mode 100644 index 000000000..5a03c190a --- /dev/null +++ b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden @@ -0,0 +1 @@ +Value.isZero (program 1.0.0 (\i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1)))) i1)) i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden new file mode 100644 index 000000000..9462cc501 --- /dev/null +++ b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden @@ -0,0 +1 @@ +Value.isZero (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force (i6 (delay (\i0 -> i1)))) (force i5 (force i2)) (\i0 -> force i1 (\i0 -> \i0 -> force (force (i9 (delay (\i0 -> i1)))) (force i8 (force i5)) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) i10 i9)) i1)) i1)) (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay i4))) i3)))) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1))))) ((\i0 -> i1) ((\i0 -> i1 i1) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))))) \ No newline at end of file From 26452fc5c457bc836ff2d98b02024e5e7bc0e35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 18 Apr 2022 10:18:16 -0400 Subject: [PATCH 411/584] Made fourmolu ignore the tmp/ directory --- bin/format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/format b/bin/format index 94c92da65..f65deafe2 100755 --- a/bin/format +++ b/bin/format @@ -2,6 +2,6 @@ set -xe -find -type f -name '*.hs' ! -path '*/dist-newstyle/*' | xargs fourmolu -o-XTypeApplications -o-XQualifiedDo -o-XOverloadedRecordDot -m inplace +find -type f -name '*.hs' ! -path '*/dist-newstyle/*' ! -path '*/tmp/*' | xargs fourmolu -o-XTypeApplications -o-XQualifiedDo -o-XOverloadedRecordDot -m inplace find -type f -name '*.cabal' | xargs cabal-fmt -i nixpkgs-fmt *.nix From 38707e4b011b35aa2c4b7f5a3a83af5bd76b3ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 18 Apr 2022 10:37:06 -0400 Subject: [PATCH 412/584] More benchmarks, native Plutarch vs FFI for Value operations --- plutarch-test/conditional/Plutarch/FFISpec.hs | 10 ++++++++++ plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden | 4 +++- .../goldens/FFI.Data.Benchmarks.uplc.eval.golden | 4 +++- plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden | 4 +++- plutarch-test/goldens/api.value.bench.golden | 5 ++++- plutarch-test/goldens/api.value.uplc.eval.golden | 5 ++++- plutarch-test/goldens/api.value.uplc.golden | 5 ++++- plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 9 +++++++-- 8 files changed, 38 insertions(+), 8 deletions(-) diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index faf5d83ee..738306717 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -392,6 +392,16 @@ spec = describe "FFI" $ do "Value.isZero" @| (foreignImport $$(PlutusTx.compile [||toBuiltin . Value.isZero||]) :: Term _ (PSValue :--> PBool)) @-> \isZero -> passertNot (isZero # foreignImport (PlutusTx.liftCode val)) + "mappend @Value" + @| (foreignImport $$(PlutusTx.compile [||mappend @Value||]) :: Term _ (PSValue :--> PSValue :--> PSValue)) + @-> \plus -> + (plus # foreignImport (PlutusTx.liftCode val) # foreignImport (PlutusTx.liftCode val)) + #@?= (foreignImport (PlutusTx.liftCode $ val <> val) :: Term _ PSValue) + "(==) @Value" + @| (foreignImport $$(PlutusTx.compile [||\a (b :: Value) -> toBuiltin (a == b)||]) + :: Term _ (PSValue :--> PSValue :--> PBool)) + @-> \eq -> + passert (eq # foreignImport (PlutusTx.liftCode val) # foreignImport (PlutusTx.liftCode val)) where sampleScottEncoding = "(program 1.0.0 (delay (\\i0 -> i1 False 6 \"Hello\")))" sampleScottField = "(program 1.0.0 (\\i0 -> force i1 (\\i0 -> \\i0 -> \\i0 -> i2)))" diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden index 587cf5f10..4c7b1216a 100644 --- a/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden +++ b/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden @@ -1 +1,3 @@ -Value.isZero {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":154} \ No newline at end of file +Value.isZero {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":154} +mappend @Value {"exBudgetCPU":3662179,"exBudgetMemory":12400,"scriptSizeBytes":529} +(==) @Value {"exBudgetCPU":2977400,"exBudgetMemory":10100,"scriptSizeBytes":565} \ No newline at end of file diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden index 5a03c190a..787bcf8c6 100644 --- a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden +++ b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden @@ -1 +1,3 @@ -Value.isZero (program 1.0.0 (\i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1)))) i1)) i1))) \ No newline at end of file +Value.isZero (program 1.0.0 (\i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1)))) i1)) i1))) +mappend @Value (program 1.0.0 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force i1 (\i0 -> (\i0 -> \i0 -> addInteger i2 i1) 0 i1) (\i0 -> \i0 -> (\i0 -> \i0 -> addInteger i2 i1) i2 i1) (\i0 -> (\i0 -> \i0 -> addInteger i2 i1) i1 0)))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force i1 (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) i1) (\i0 -> \i0 -> force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1) (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i1))) i1)))) (force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1)))) +(==) @Value (program 1.0.0 (\i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force i1 (\i0 -> (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) 0 i1) (\i0 -> \i0 -> (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1) (\i0 -> (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i1 0))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force i1 (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) i1) (\i0 -> \i0 -> force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1) (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i1))) i1)))) (force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden index 9462cc501..d0724131e 100644 --- a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden +++ b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden @@ -1 +1,3 @@ -Value.isZero (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force (i6 (delay (\i0 -> i1)))) (force i5 (force i2)) (\i0 -> force i1 (\i0 -> \i0 -> force (force (i9 (delay (\i0 -> i1)))) (force i8 (force i5)) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) i10 i9)) i1)) i1)) (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay i4))) i3)))) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1))))) ((\i0 -> i1) ((\i0 -> i1 i1) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))))) \ No newline at end of file +Value.isZero (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force (i6 (delay (\i0 -> i1)))) (force i5 (force i2)) (\i0 -> force i1 (\i0 -> \i0 -> force (force (i9 (delay (\i0 -> i1)))) (force i8 (force i5)) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) i10 i9)) i1)) i1)) (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay i4))) i3)))) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1))))) ((\i0 -> i1) ((\i0 -> i1 i1) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))))) +mappend @Value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force i10 (force i11 (\i0 -> \i0 -> force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force (force (i11 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i13) i2 (force i1 (\i0 -> i24 0 i1) (\i0 -> \i0 -> i25 i2 i1) (\i0 -> i24 i1 0)))) i1))) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force i1 (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i13) i1))) i1) (\i0 -> \i0 -> force (force (force i8)) i19 i2 i1) (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i12) i1))) i1)))) (force (force (force i3)) i14 i2 i1))) (force i9))) (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force (i4 (delay (\i0 -> i1)))) (force i10) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force (force i9) i1))) (force (force (i4 (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force (i13 (delay (\i0 -> i1)))) ((\i0 -> force i18 (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i23) (delay i1))) i20))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force i14 i4 i3))))) (force i11) i1)) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force i11) i3 (i1 i5)) ((\i0 -> i1) (force (force i21) (\i0 -> \i0 -> force (force i1 (delay (force (force i10) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2)))))) ((\i0 -> i1) (force (force i14) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4)))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) ((\i0 -> i1) (force (force i10) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force i7)) (\i0 -> \i0 -> delay (force i8 (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1)))))))))) ((\i0 -> i1) (force (force i9) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i10 i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> \i0 -> i2))) (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (delay (\i0 -> force i1 (\i0 -> \i0 -> i2)))) (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2)))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) i4 i3)) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> addInteger i2 i1)) (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1)))))) +(==) @Value (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force (i9 (delay (\i0 -> i1)))) (force i14 (force i13)) (\i0 -> force i1 (\i0 -> \i0 -> force (force (i12 (delay (\i0 -> i1)))) (force i17 (force i16)) (\i0 -> force i1 (\i0 -> \i0 -> force i1 (\i0 -> i23 0 i1) (\i0 -> \i0 -> i24 i2 i1) (\i0 -> i23 i1 0))) i1)) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force i1 (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i13) i1))) i1) (\i0 -> \i0 -> force (force (force i8)) i17 i2 i1) (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i12) i1))) i1)))) (force (force (force i3)) i12 i2 i1)))) (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force (i4 (delay (\i0 -> i1)))) (force i10) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force (force i9) i1))) (force (force (i4 (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force (i13 (delay (\i0 -> i1)))) ((\i0 -> force i20 (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i25) (delay i1))) i22))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force i14 i4 i3))))) (force i11) i1)) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force i11) i3 (i1 i5)) ((\i0 -> i1) (force (force i22) (\i0 -> \i0 -> force (force i1 (delay (force (force i10) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2)))))) ((\i0 -> i1) (force (force i15) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4)))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) ((\i0 -> i1) (force (force i11) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force i7)) (\i0 -> \i0 -> delay (force i8 (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1)))))))))) ((\i0 -> i1) (force (force i10) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> \i0 -> i2))) (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) i8 i7)) (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay i7))) i6)))) (delay (\i0 -> force i2 (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2)))) (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) i4 i3)) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1)))))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index 4a5fddae0..d84d09f3d 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -1,11 +1,14 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} valueOf {"exBudgetCPU":10587665,"exBudgetMemory":23908,"scriptSizeBytes":198} unionWith.const {"exBudgetCPU":45934490,"exBudgetMemory":111060,"scriptSizeBytes":454} -unionWith.(+) {"exBudgetCPU":45982834,"exBudgetMemory":110562,"scriptSizeBytes":451} +unionWith.(+).itself {"exBudgetCPU":1846026,"exBudgetMemory":6300,"scriptSizeBytes":367} +unionWith.(+).applied {"exBudgetCPU":45982834,"exBudgetMemory":110562,"scriptSizeBytes":451} unionWith.tokens {"exBudgetCPU":43483569,"exBudgetMemory":106834,"scriptSizeBytes":460} unionWith.symbols {"exBudgetCPU":24782993,"exBudgetMemory":61910,"scriptSizeBytes":452} +isZero.itself {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":115} isZero.true {"exBudgetCPU":52892795,"exBudgetMemory":127649,"scriptSizeBytes":526} isZero.false {"exBudgetCPU":8700981,"exBudgetMemory":21315,"scriptSizeBytes":178} +equality.itself {"exBudgetCPU":2113983,"exBudgetMemory":7200,"scriptSizeBytes":442} equality.triviallyTrue {"exBudgetCPU":52892795,"exBudgetMemory":127649,"scriptSizeBytes":526} equality.triviallyFalse {"exBudgetCPU":48483518,"exBudgetMemory":119393,"scriptSizeBytes":536} equality.swappedTokensTrue {"exBudgetCPU":150951231,"exBudgetMemory":361225,"scriptSizeBytes":579} diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index 18b2b5c86..081da6f62 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -1,12 +1,15 @@ singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) valueOf (program 1.0.0 1) unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -unionWith.(+) (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) +unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) +unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) unionWith.tokens (program 1.0.0 [(#41c0, #a249736f6d65746f6b656e014a6f74686572746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) , (#41c2, #a149736f6d65746f6b656e01) ]) +isZero.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1)) isZero.true (program 1.0.0 True) isZero.false (program 1.0.0 False) +equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1))) equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) equality.swappedTokensTrue (program 1.0.0 True) diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index bad493c4c..6993d1835 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -1,11 +1,14 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i14 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i15 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i11 (bData i14) (mapData i1)) (i10 (bData i14) (iData i1))) 1) i12 i13) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i13 i20 i2 i3)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i22 (i19 i4)))) (i17 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i5) (delay ((\i0 -> i8 (i7 (i14 i2) i1) (\i0 -> i2) (i9 i16 (i13 (i14 i2)) i4)) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair)))) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 #736f6d65746f6b656e 1) (i16 i22 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 #c0 i22 1) (i16 #c2 i22 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +isZero.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair)))) isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 i26 1) (i19 i25 i26 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i6 (\i0 -> i3 (unMapData (i26 i1))) i1) ((\i0 -> \i0 -> i6 (\i0 -> i3 (unIData (i26 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i19 i1)) (delay (i2 (i20 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i13 i20 i2 i3)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i22 (i19 i4)))) (i17 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i5) (delay ((\i0 -> i8 (i7 (i14 i2) i1) (\i0 -> i2) (i9 i16 (i13 (i14 i2)) i4)) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair)))) equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 i26 1) (i19 i25 i26 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 #736f6d65746f6b656e 1) (i19 i25 #6f74686572746f6b656e 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i25 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i25 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i23 i29 i30 1) (i23 i29 i22 1)) (i4 addInteger (i23 i29 i22 1) (i23 i29 i30 1)))) (\i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i16 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i21 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 797b1a826..01e2a6ba8 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -70,16 +70,21 @@ spec = do "unionWith" @\ do "const" @| PValue.unionWith # plam const # pmint # pmint @-> \p -> plift p @?= mint - "(+)" @| PValue.unionWith # plam (+) # pmint # pmint @-> \p -> - plift p @?= mint <> mint + "(+)" @\ do + "itself" @| PValue.unionWith # plam (+) @-> \plus -> + plift (plus # pmint # pmint) @?= mint <> mint + "applied" @| PValue.unionWith # plam (+) # pmint # pmint @-> \p -> + plift p @?= mint <> mint "tokens" @| PValue.unionWith # plam (+) # pmint # pmintOtherToken @-> \p -> plift p @?= mint <> mintOtherToken "symbols" @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> plift p @?= mint <> mintOtherSymbol "isZero" @\ do + "itself" @| PValue.isZero @-> \z -> passertNot (z # pmint) "true" @| PValue.isZero # (PValue.unionWith # plam (-) # pmint # pmint) @-> passert "false" @| PValue.isZero # pmint @-> passertNot "equality" @\ do + "itself" @| plam ((#==) @PValue) @-> \eq -> passert (eq # pmint # pmint) "triviallyTrue" @| pmint #== pmint @-> passert "triviallyFalse" @| pmint #== pmintOtherToken @-> passertNot "swappedTokensTrue" From 814bd6fa489425df5481ec7e4e3c9fa2b85d237c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 18 Apr 2022 10:59:46 -0400 Subject: [PATCH 413/584] Added Value.unionWithData --- Plutarch/Api/V1/Value.hs | 21 +++++++++++++++++++ plutarch-test/goldens/api.value.bench.golden | 2 ++ .../goldens/api.value.uplc.eval.golden | 2 ++ plutarch-test/goldens/api.value.uplc.golden | 2 ++ .../plutarch-base/Plutarch/ApiSpec.hs | 5 +++++ 5 files changed, 32 insertions(+) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 9093a22c8..352c6832d 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -8,6 +8,7 @@ module Plutarch.Api.V1.Value ( isZero, singleton, unionWith, + unionWithData, valueOf, ) where @@ -91,3 +92,23 @@ unionWith = phoistAcyclic $ # (plam $ \x y -> AssocMap.unionWith # combine # x # y) # pto x # pto y + +{- | Combine two 'PValue's applying the given function to any pair of + data-encoded quantities with the same asset class. Note that the result is + _not_ normalized and may contain zero quantities. +-} +unionWithData :: + Term + (s :: S) + ( (PAsData PInteger :--> PAsData PInteger :--> PAsData PInteger) + :--> PValue + :--> PValue + :--> PValue + ) +unionWithData = phoistAcyclic $ + plam $ \combine x y -> + pcon . PValue $ + AssocMap.unionWith + # (plam $ \x y -> AssocMap.unionWithData # combine # x # y) + # pto x + # pto y diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index d84d09f3d..237e359a1 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -5,6 +5,8 @@ unionWith.(+).itself {"exBudgetCPU":1846026,"exBudgetMemory":6300,"scriptSizeByt unionWith.(+).applied {"exBudgetCPU":45982834,"exBudgetMemory":110562,"scriptSizeBytes":451} unionWith.tokens {"exBudgetCPU":43483569,"exBudgetMemory":106834,"scriptSizeBytes":460} unionWith.symbols {"exBudgetCPU":24782993,"exBudgetMemory":61910,"scriptSizeBytes":452} +unionWithData const.itself {"exBudgetCPU":1846026,"exBudgetMemory":6300,"scriptSizeBytes":357} +unionWithData const.applied {"exBudgetCPU":45127214,"exBudgetMemory":109764,"scriptSizeBytes":444} isZero.itself {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":115} isZero.true {"exBudgetCPU":52892795,"exBudgetMemory":127649,"scriptSizeBytes":526} isZero.false {"exBudgetCPU":8700981,"exBudgetMemory":21315,"scriptSizeBytes":178} diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index 081da6f62..3e8a15d32 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -6,6 +6,8 @@ unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) unionWith.tokens (program 1.0.0 [(#41c0, #a249736f6d65746f6b656e014a6f74686572746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) , (#41c2, #a149736f6d65746f6b656e01) ]) +unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) i5 i2 i1) i2 i1)) +unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) isZero.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1)) isZero.true (program 1.0.0 True) isZero.false (program 1.0.0 False) diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index 6993d1835..91cc7f38c 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -5,6 +5,8 @@ unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 #736f6d65746f6b656e 1) (i16 i22 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 #c0 i22 1) (i16 #c2 i22 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i13 i20 i2 i3)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i22 (i19 i4)))) (i17 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i5) (delay ((\i0 -> i8 (i7 (i14 i2) i1) (\i0 -> i2) (i9 i16 (i13 (i14 i2)) i4)) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair)))) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) isZero.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair)))) isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 i26 1) (i19 i25 i26 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 01e2a6ba8..02fffdf2b 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -79,6 +79,11 @@ spec = do plift p @?= mint <> mintOtherToken "symbols" @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> plift p @?= mint <> mintOtherSymbol + "unionWithData const" @\ do + "itself" @| PValue.unionWithData @-> \u -> + plift (u # plam const # pmint # pmint) @?= mint + "applied" @| PValue.unionWithData # plam const # pmint # pmint @-> \p -> + plift p @?= mint "isZero" @\ do "itself" @| PValue.isZero @-> \z -> passertNot (z # pmint) "true" @| PValue.isZero # (PValue.unionWith # plam (-) # pmint # pmint) @-> passert From 7518cfac40caf0c354c2511ef81b0a60fb7fb38a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 18 Apr 2022 11:22:35 -0400 Subject: [PATCH 414/584] Benchmarks for valueOf --- plutarch-test/common/Plutarch/Test/Golden.hs | 4 ++-- plutarch-test/conditional/Plutarch/FFISpec.hs | 16 ++++++++++++++-- .../goldens/FFI.Data.Benchmarks.bench.golden | 1 + .../goldens/FFI.Data.Benchmarks.uplc.eval.golden | 1 + .../goldens/FFI.Data.Benchmarks.uplc.golden | 1 + plutarch-test/goldens/api.value.bench.golden | 3 ++- plutarch-test/goldens/api.value.uplc.eval.golden | 3 ++- plutarch-test/goldens/api.value.uplc.golden | 3 ++- plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 6 ++++-- 9 files changed, 29 insertions(+), 9 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index a87e36b50..104afcefa 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -275,8 +275,8 @@ evalScriptAlwaysWithBenchmark script = let (res, exbudget, _traces) = evalScript script bench = mkBenchmark exbudget (scriptSize script) in ( case res of - Left _ -> compile perror - Right x -> x + Left _ -> compile perror + Right x -> x , bench ) diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index 738306717..f7f41f97c 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -392,14 +392,26 @@ spec = describe "FFI" $ do "Value.isZero" @| (foreignImport $$(PlutusTx.compile [||toBuiltin . Value.isZero||]) :: Term _ (PSValue :--> PBool)) @-> \isZero -> passertNot (isZero # foreignImport (PlutusTx.liftCode val)) + "Value.valueOf" + @| ( foreignImport $$(PlutusTx.compile [||Value.valueOf||]) :: + Term _ (PSValue :--> PCurrencySymbol :--> PTokenName :--> PInteger) + ) + @-> \valueOf -> + ( valueOf + # foreignImport (PlutusTx.liftCode val) + # foreignImport (PlutusTx.liftCode adaSymbol) + # foreignImport (PlutusTx.liftCode adaToken) + ) + #@?= (2 :: Term _ PInteger) "mappend @Value" @| (foreignImport $$(PlutusTx.compile [||mappend @Value||]) :: Term _ (PSValue :--> PSValue :--> PSValue)) @-> \plus -> (plus # foreignImport (PlutusTx.liftCode val) # foreignImport (PlutusTx.liftCode val)) #@?= (foreignImport (PlutusTx.liftCode $ val <> val) :: Term _ PSValue) "(==) @Value" - @| (foreignImport $$(PlutusTx.compile [||\a (b :: Value) -> toBuiltin (a == b)||]) - :: Term _ (PSValue :--> PSValue :--> PBool)) + @| ( foreignImport $$(PlutusTx.compile [||\a (b :: Value) -> toBuiltin (a == b)||]) :: + Term _ (PSValue :--> PSValue :--> PBool) + ) @-> \eq -> passert (eq # foreignImport (PlutusTx.liftCode val) # foreignImport (PlutusTx.liftCode val)) where diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden index 4c7b1216a..f183bc134 100644 --- a/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden +++ b/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden @@ -1,3 +1,4 @@ Value.isZero {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":154} +Value.valueOf {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":110} mappend @Value {"exBudgetCPU":3662179,"exBudgetMemory":12400,"scriptSizeBytes":529} (==) @Value {"exBudgetCPU":2977400,"exBudgetMemory":10100,"scriptSizeBytes":565} \ No newline at end of file diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden index 787bcf8c6..424411047 100644 --- a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden +++ b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden @@ -1,3 +1,4 @@ Value.isZero (program 1.0.0 (\i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1)))) i1)) i1))) +Value.valueOf (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i1 i5) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force i1 0 (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force ifThenElse (equalsByteString i2 i9) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (i7 i1)) (delay (i6 i3))))))))) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force i1 0 (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force ifThenElse (equalsByteString i2 i7) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay i1) (delay (i6 i3)))))))))) mappend @Value (program 1.0.0 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force i1 (\i0 -> (\i0 -> \i0 -> addInteger i2 i1) 0 i1) (\i0 -> \i0 -> (\i0 -> \i0 -> addInteger i2 i1) i2 i1) (\i0 -> (\i0 -> \i0 -> addInteger i2 i1) i1 0)))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force i1 (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) i1) (\i0 -> \i0 -> force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1) (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i1))) i1)))) (force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1)))) (==) @Value (program 1.0.0 (\i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force i1 (\i0 -> (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) 0 i1) (\i0 -> \i0 -> (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1) (\i0 -> (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i1 0))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force i1 (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) i1) (\i0 -> \i0 -> force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1) (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i1))) i1)))) (force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden index d0724131e..b25a3fce0 100644 --- a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden +++ b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden @@ -1,3 +1,4 @@ Value.isZero (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force (i6 (delay (\i0 -> i1)))) (force i5 (force i2)) (\i0 -> force i1 (\i0 -> \i0 -> force (force (i9 (delay (\i0 -> i1)))) (force i8 (force i5)) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) i10 i9)) i1)) i1)) (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay i4))) i3)))) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1))))) ((\i0 -> i1) ((\i0 -> i1 i1) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))))) +Value.valueOf (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i1 i5) ((\i0 -> i1) (force (force i7) (\i0 -> \i0 -> force i1 0 (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force ifThenElse (equalsByteString i2 i9) i12 i11) (delay (i7 i1)) (delay (i6 i3))))))))) ((\i0 -> i1) (force (force i6) (\i0 -> \i0 -> force i1 0 (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force ifThenElse (equalsByteString i2 i7) i11 i10) (delay i1) (delay (i6 i3))))))))) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1)))))) mappend @Value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force i10 (force i11 (\i0 -> \i0 -> force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force (force (i11 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i13) i2 (force i1 (\i0 -> i24 0 i1) (\i0 -> \i0 -> i25 i2 i1) (\i0 -> i24 i1 0)))) i1))) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force i1 (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i13) i1))) i1) (\i0 -> \i0 -> force (force (force i8)) i19 i2 i1) (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i12) i1))) i1)))) (force (force (force i3)) i14 i2 i1))) (force i9))) (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force (i4 (delay (\i0 -> i1)))) (force i10) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force (force i9) i1))) (force (force (i4 (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force (i13 (delay (\i0 -> i1)))) ((\i0 -> force i18 (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i23) (delay i1))) i20))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force i14 i4 i3))))) (force i11) i1)) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force i11) i3 (i1 i5)) ((\i0 -> i1) (force (force i21) (\i0 -> \i0 -> force (force i1 (delay (force (force i10) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2)))))) ((\i0 -> i1) (force (force i14) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4)))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) ((\i0 -> i1) (force (force i10) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force i7)) (\i0 -> \i0 -> delay (force i8 (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1)))))))))) ((\i0 -> i1) (force (force i9) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i10 i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> \i0 -> i2))) (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (delay (\i0 -> force i1 (\i0 -> \i0 -> i2)))) (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2)))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) i4 i3)) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> addInteger i2 i1)) (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1)))))) (==) @Value (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force (i9 (delay (\i0 -> i1)))) (force i14 (force i13)) (\i0 -> force i1 (\i0 -> \i0 -> force (force (i12 (delay (\i0 -> i1)))) (force i17 (force i16)) (\i0 -> force i1 (\i0 -> \i0 -> force i1 (\i0 -> i23 0 i1) (\i0 -> \i0 -> i24 i2 i1) (\i0 -> i23 i1 0))) i1)) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force i1 (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i13) i1))) i1) (\i0 -> \i0 -> force (force (force i8)) i17 i2 i1) (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i12) i1))) i1)))) (force (force (force i3)) i12 i2 i1)))) (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force (i4 (delay (\i0 -> i1)))) (force i10) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force (force i9) i1))) (force (force (i4 (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force (i13 (delay (\i0 -> i1)))) ((\i0 -> force i20 (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i25) (delay i1))) i22))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force i14 i4 i3))))) (force i11) i1)) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force i11) i3 (i1 i5)) ((\i0 -> i1) (force (force i22) (\i0 -> \i0 -> force (force i1 (delay (force (force i10) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2)))))) ((\i0 -> i1) (force (force i15) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4)))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) ((\i0 -> i1) (force (force i11) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force i7)) (\i0 -> \i0 -> delay (force i8 (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1)))))))))) ((\i0 -> i1) (force (force i10) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> \i0 -> i2))) (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) i8 i7)) (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay i7))) i6)))) (delay (\i0 -> force i2 (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2)))) (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) i4 i3)) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1)))))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index 237e359a1..78af631e8 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -1,5 +1,6 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -valueOf {"exBudgetCPU":10587665,"exBudgetMemory":23908,"scriptSizeBytes":198} +valueOf.itself {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":130} +valueOf.applied {"exBudgetCPU":10587665,"exBudgetMemory":23908,"scriptSizeBytes":198} unionWith.const {"exBudgetCPU":45934490,"exBudgetMemory":111060,"scriptSizeBytes":454} unionWith.(+).itself {"exBudgetCPU":1846026,"exBudgetMemory":6300,"scriptSizeBytes":367} unionWith.(+).applied {"exBudgetCPU":45982834,"exBudgetMemory":110562,"scriptSizeBytes":451} diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index 3e8a15d32..c74e6698b 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -1,5 +1,6 @@ singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -valueOf (program 1.0.0 1) +valueOf.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unMapData (force (force sndPair) i3))) (bData i2) i3 (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0))) +valueOf.applied (program 1.0.0 1) unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index 91cc7f38c..ad3d67010 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -1,5 +1,6 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i14 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i15 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i11 (bData i14) (mapData i1)) (i10 (bData i14) (iData i1))) 1) i12 i13) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i14 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i15 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) +valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i14 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i15 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i11 (bData i14) (mapData i1)) (i10 (bData i14) (iData i1))) 1) i12 i13) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i13 i20 i2 i3)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i22 (i19 i4)))) (i17 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i5) (delay ((\i0 -> i8 (i7 (i14 i2) i1) (\i0 -> i2) (i9 i16 (i13 (i14 i2)) i4)) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair)))) unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 02fffdf2b..92b7a60e8 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -65,8 +65,10 @@ spec = do pmintOtherSymbol = PValue.singleton # pconstant "c2" # pconstant "sometoken" # 1 "singleton" @| pmint @-> \p -> plift p @?= mint - "valueOf" @| PValue.valueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> - plift p @?= 1 + "valueOf" @\ do + "itself" @| PValue.valueOf @-> \v -> plift (v # pmint # pconstant "c0" # pconstant "sometoken") @?= 1 + "applied" @| PValue.valueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> + plift p @?= 1 "unionWith" @\ do "const" @| PValue.unionWith # plam const # pmint # pmint @-> \p -> plift p @?= mint From 2bb4c57208946c6a367eca419b23a509f25d7383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 18 Apr 2022 13:14:03 -0400 Subject: [PATCH 415/584] Introduced AssocMap.foldAt & findWithDefault to optimize valueOf --- Plutarch/Api/V1/AssocMap.hs | 43 ++++++++++++++++--- Plutarch/Api/V1/Value.hs | 10 ++--- plutarch-test/common/Plutarch/Test/Golden.hs | 4 +- plutarch-test/goldens/api.map.bench.golden | 20 +++++---- .../goldens/api.map.uplc.eval.golden | 4 ++ plutarch-test/goldens/api.map.uplc.golden | 20 +++++---- plutarch-test/goldens/api.value.bench.golden | 30 ++++++------- .../goldens/api.value.uplc.eval.golden | 8 ++-- plutarch-test/goldens/api.value.uplc.golden | 30 ++++++------- .../plutarch-base/Plutarch/ApiSpec.hs | 9 ++++ 10 files changed, 116 insertions(+), 62 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 8190ed05b..dbc8063c1 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -16,6 +16,9 @@ module Plutarch.Api.V1.AssocMap ( -- * Lookups lookup, lookupData, + findWithDefault, + foldAt, + foldAtData, -- * Folds all, @@ -44,7 +47,6 @@ import Plutarch.Lift ( pconstantFromRepr, pconstantToRepr, ) -import Plutarch.Maybe (pmaybe) import Plutarch.Prelude ( DerivePNewtype (..), PAsData, @@ -145,6 +147,35 @@ lookupDataWith = phoistAcyclic $ (const $ pcon PNothing) # pto map +-- | Look up the given key in a 'PMap', returning the default value if the key is absent. +findWithDefault :: (PIsData k, PIsData v) => Term (s :: S) (v :--> k :--> PMap k v :--> v) +findWithDefault = phoistAcyclic $ plam $ \def key -> foldAtData # pdata key # def # plam pfromData + +{- | Look up the given key in a 'PMap'; return the default if the key is + absent or apply the argument function to the value data if present. +-} +foldAt :: (PIsData k, PIsData v) => Term (s :: S) (k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) +foldAt = phoistAcyclic $ + plam $ \key -> foldAtData # pdata key + +{- | Look up the given key data in a 'PMap'; return the default if the key is + absent or apply the argument function to the value data if present. +-} +foldAtData :: + (PIsData k, PIsData v) => + Term (s :: S) (PAsData k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) +foldAtData = phoistAcyclic $ + plam $ \key def apply map -> + precList + ( \self x xs -> + pif + (pfstBuiltin # x #== key) + (apply #$ psndBuiltin # x) + (self # xs) + ) + (const def) + # pto map + -- | Insert a new key/value pair into the map, overiding the previous if any. insert :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v :--> PMap k v) insert = phoistAcyclic $ @@ -232,10 +263,11 @@ unionWithData = phoistAcyclic $ plam $ \merge x y -> plet ( plam $ \k x' -> - pmaybe + foldAtData + # k # pcon (PLeft x') # plam (pcon . PRight . (merge # x' #)) - # (lookupData # k # y) + # y ) $ \leftOrBoth -> pmatch (mapEitherWithKeyData # leftOrBoth # x) $ \(PPair x' xy) -> @@ -252,10 +284,11 @@ difference = phoistAcyclic $ precList ( \self x xs -> plet (self # xs) $ \xs' -> - pmaybe + foldAtData + # (pfstBuiltin # x) # (pcons # x # xs') # (plam $ const xs') - # (lookupData # (pfstBuiltin # x) # right) + # right ) (const pnil) # pto left diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 352c6832d..b317a68e8 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -69,11 +69,11 @@ singleton = phoistAcyclic $ valueOf :: Term (s :: S) (PValue :--> PCurrencySymbol :--> PTokenName :--> PInteger) valueOf = phoistAcyclic $ plam $ \value symbol token -> - pmatch (AssocMap.lookup # symbol # pto value) $ \case - PNothing -> 0 - PJust submap -> pmatch (AssocMap.lookup # token # submap) $ \case - PNothing -> 0 - PJust amount -> amount + AssocMap.foldAt + # symbol + # 0 + # plam (\map -> AssocMap.foldAt # token # 0 # plam pfromData # pfromData map) + # pto value -- | Check if the value is zero. isZero :: Term (s :: S) (PValue :--> PBool) diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 104afcefa..a87e36b50 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -275,8 +275,8 @@ evalScriptAlwaysWithBenchmark script = let (res, exbudget, _traces) = evalScript script bench = mkBenchmark exbudget (scriptSize script) in ( case res of - Left _ -> compile perror - Right x -> x + Left _ -> compile perror + Right x -> x , bench ) diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index 708541b76..c220a0ddd 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -1,7 +1,11 @@ +lookup.itself {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":82} lookup.hit {"exBudgetCPU":4140352,"exBudgetMemory":9090,"scriptSizeBytes":116} lookup.miss {"exBudgetCPU":4975131,"exBudgetMemory":11422,"scriptSizeBytes":126} lookupData.hit {"exBudgetCPU":4140352,"exBudgetMemory":9090,"scriptSizeBytes":114} lookupData.miss {"exBudgetCPU":4885812,"exBudgetMemory":11122,"scriptSizeBytes":121} +findWithDefault.itself {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":78} +findWithDefault.hit {"exBudgetCPU":4797628,"exBudgetMemory":10354,"scriptSizeBytes":117} +findWithDefault.miss {"exBudgetCPU":5153769,"exBudgetMemory":12022,"scriptSizeBytes":125} singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} insert.empty {"exBudgetCPU":3131940,"exBudgetMemory":8260,"scriptSizeBytes":132} @@ -11,11 +15,11 @@ delete.only {"exBudgetCPU":4616720,"exBudgetMemory":10690,"scriptSizeBytes":134} delete.miss {"exBudgetCPU":6168321,"exBudgetMemory":14486,"scriptSizeBytes":144} delete.new {"exBudgetCPU":12836543,"exBudgetMemory":28938,"scriptSizeBytes":184} delete.old {"exBudgetCPU":10247892,"exBudgetMemory":23744,"scriptSizeBytes":184} -difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":173} -difference.emptyRight {"exBudgetCPU":6563780,"exBudgetMemory":16484,"scriptSizeBytes":176} -difference.emptyResult {"exBudgetCPU":9839480,"exBudgetMemory":23042,"scriptSizeBytes":190} -unionWith.const {"exBudgetCPU":22808430,"exBudgetMemory":55080,"scriptSizeBytes":370} -unionWith.(+) {"exBudgetCPU":22856774,"exBudgetMemory":54582,"scriptSizeBytes":366} -unionWithData.const {"exBudgetCPU":21911835,"exBudgetMemory":53484,"scriptSizeBytes":357} -unionWithData.emptyLeft {"exBudgetCPU":10497221,"exBudgetMemory":28280,"scriptSizeBytes":344} -unionWithData.emptyRight {"exBudgetCPU":13481331,"exBudgetMemory":35472,"scriptSizeBytes":344} \ No newline at end of file +difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":156} +difference.emptyRight {"exBudgetCPU":6146958,"exBudgetMemory":15084,"scriptSizeBytes":159} +difference.emptyResult {"exBudgetCPU":9303566,"exBudgetMemory":21242,"scriptSizeBytes":173} +unionWith.const {"exBudgetCPU":21557964,"exBudgetMemory":50880,"scriptSizeBytes":344} +unionWith.(+) {"exBudgetCPU":21606308,"exBudgetMemory":50382,"scriptSizeBytes":340} +unionWithData.const {"exBudgetCPU":20661369,"exBudgetMemory":49284,"scriptSizeBytes":331} +unionWithData.emptyLeft {"exBudgetCPU":9901761,"exBudgetMemory":26280,"scriptSizeBytes":318} +unionWithData.emptyRight {"exBudgetCPU":12885871,"exBudgetMemory":33472,"scriptSizeBytes":318} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.eval.golden b/plutarch-test/goldens/api.map.uplc.eval.golden index 3490ddefc..3362959b8 100644 --- a/plutarch-test/goldens/api.map.uplc.eval.golden +++ b/plutarch-test/goldens/api.map.uplc.eval.golden @@ -1,8 +1,12 @@ +lookup.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i1))) lookup.hit (program 1.0.0 (\i0 -> \i0 -> i2 (unIData (force (force sndPair) ( #436b6579 , #182a ))))) lookup.miss (program 1.0.0 (\i0 -> \i0 -> force i1)) lookupData.hit (program 1.0.0 (\i0 -> \i0 -> i2 (force (force sndPair) (#436b6579, #182a)))) lookupData.miss (program 1.0.0 (\i0 -> \i0 -> force i1)) +findWithDefault.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData)) +findWithDefault.hit (program 1.0.0 42) +findWithDefault.miss (program 1.0.0 12) singleton (program 1.0.0 [(#436b6579, #182a)]) singletonData (program 1.0.0 [(#436b6579, #182a)]) insert.empty (program 1.0.0 [(#436b6579, #182a)]) diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index 29de8e975..fb67bff18 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -1,7 +1,11 @@ +lookup.itself (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i7 i1)) i4) (delay (i5 (i7 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i1)) (force headList))) lookup.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) lookup.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i7 i1)) i4) (delay (i5 (i7 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i1)) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) lookupData.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) lookupData.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData #6e6f6b6579) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) +findWithDefault.itself (program 1.0.0 ((\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) (force headList))) +findWithDefault.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 i2 ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) +findWithDefault.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) insert.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i14))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i14 (i13 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i8 (mkPairData i3 i2) i1) i2) (bData i2) (iData i1)) #6b6579 42 i4) (force tailList)) (force headList)) (force mkCons)) [ ])) @@ -11,11 +15,11 @@ delete.only (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 delete.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i11))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i9 i2)) i5) (delay (i1 (i6 (i8 i2)))) (delay (i3 (i8 i2) (\i0 -> i2 (i11 (i10 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i1) (bData i1)) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> i7 (mkPairData i2 i1) i8) (bData i2) (iData i1)) #6b6579 42)) (force tailList)) (force headList)) (force mkCons)) [ ])) delete.new (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i1) (bData i8) ((\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i13 (mkPairData i3 i2) i1) i2) (bData i9) (iData i1)) 6 ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i1 (i6 i15))) (delay (\i0 -> force (i9 (equalsData (i10 (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i15 (i13 i3) i1))))))))) i1 (\i0 -> i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) #6e65776b6579) (force mkCons)) [ ])) delete.old (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i1) (bData i10) ((\i0 -> \i0 -> (\i0 -> \i0 -> i5 (\i0 -> i13 (mkPairData i3 i2) i1) i2) (bData i2) (iData i1)) #6e65776b6579 6 ((\i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i11) (iData i1)) 42))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i1 (i6 i14))) (delay (\i0 -> force (i9 (equalsData (i10 (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i14 (i13 i3) i1))))))))) i1 (\i0 -> i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) -difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i10 (i8 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i12 (i13 i1)) i4) (delay (i5 (i13 i1))) (delay (i2 (i14 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i7 (i8 i2)) i4)) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) -difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i11 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) -difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (i13 (i9 i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i4) (delay (i5 (i14 i1))) (delay (i2 (i15 i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (i8 (i9 i2)) i4)) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i6 i1 (i21 (i18 i4)))) (i16 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i8 i1 (i8 i2 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i24) (delay ((\i0 -> i12 (i24 (i18 i2) i1) (\i0 -> i2) (i13 i20 (i17 (i18 i2)) i4)) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i9 i16 i2 i3))) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i12 i16 42) (i12 i16 42)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i17 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i6 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i23) (delay ((\i0 -> i11 (i23 (i17 i2) i1) (\i0 -> i2) (i12 i19 (i16 (i17 i2)) i4)) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i15 i2 i3))) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i12 i16 42) (i12 i16 42)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i17 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i6 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i23) (delay ((\i0 -> i11 (i23 (i17 i2) i1) (\i0 -> i2) (i12 i19 (i16 (i17 i2)) i4)) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i15 i2 i3))) (\i0 -> \i0 -> i2) (i12 i16 42) (i12 i16 42)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i17 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i21) (delay ((\i0 -> i11 (i21 (i17 i2) i1) (\i0 -> i2) (i12 i19 (i16 (i17 i2)) i4)) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i15 i2 i3))) (\i0 -> \i0 -> i2) i13 ((\i0 -> \i0 -> (\i0 -> \i0 -> i16 (mkPairData i2 i1) i17) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (force mkCons)) [ ])) -unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i21) (delay ((\i0 -> i11 (i21 (i17 i2) i1) (\i0 -> i2) (i12 i19 (i16 (i17 i2)) i4)) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i8 i15 i2 i3))) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i16 (mkPairData i2 i1) i17) (bData i2) (iData i1)) #6b6579 42) i13) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (force mkCons)) [ ])) \ No newline at end of file +difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i6) (delay (i4 (force (force sndPair) (i14 i1)))) (delay (i2 (i15 i1)))))))) i1) (i7 (i8 i2)) (i10 (i8 i2) i1) (\i0 -> i2) i4) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) +difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (i8 (i9 i2)) (i11 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) +difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (i8 (i9 i2)) (i13 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i21 i21)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i24 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i24 (mkPairData i3 i2) i4)) (i6 i1 (i17 (i18 i4)))) (i15 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i8 i1 (i8 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i22) (delay ((\i0 -> i12 (i16 (i18 i2)) (i22 (i18 i2) i1) (\i0 -> i2) i4) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i8 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i21) (delay ((\i0 -> i11 (i15 (i17 i2)) (i21 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i21) (delay ((\i0 -> i11 (i15 (i17 i2)) (i21 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> i2) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i18 i18)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i21 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i21 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i19) (delay ((\i0 -> i11 (i15 (i17 i2)) (i19 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> i2) i11 ((\i0 -> \i0 -> (\i0 -> \i0 -> i14 (mkPairData i2 i1) i15) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i13 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) +unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i18 i18)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i21 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i21 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i19) (delay ((\i0 -> i11 (i15 (i17 i2)) (i19 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i14 (mkPairData i2 i1) i15) (bData i2) (iData i1)) #6b6579 42) i11) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i13 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index 78af631e8..857001c45 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -1,18 +1,18 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -valueOf.itself {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":130} -valueOf.applied {"exBudgetCPU":10587665,"exBudgetMemory":23908,"scriptSizeBytes":198} -unionWith.const {"exBudgetCPU":45934490,"exBudgetMemory":111060,"scriptSizeBytes":454} -unionWith.(+).itself {"exBudgetCPU":1846026,"exBudgetMemory":6300,"scriptSizeBytes":367} -unionWith.(+).applied {"exBudgetCPU":45982834,"exBudgetMemory":110562,"scriptSizeBytes":451} -unionWith.tokens {"exBudgetCPU":43483569,"exBudgetMemory":106834,"scriptSizeBytes":460} -unionWith.symbols {"exBudgetCPU":24782993,"exBudgetMemory":61910,"scriptSizeBytes":452} -unionWithData const.itself {"exBudgetCPU":1846026,"exBudgetMemory":6300,"scriptSizeBytes":357} -unionWithData const.applied {"exBudgetCPU":45127214,"exBudgetMemory":109764,"scriptSizeBytes":444} +valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} +valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} +unionWith.const {"exBudgetCPU":43612196,"exBudgetMemory":103260,"scriptSizeBytes":428} +unionWith.(+).itself {"exBudgetCPU":1667388,"exBudgetMemory":5700,"scriptSizeBytes":341} +unionWith.(+).applied {"exBudgetCPU":43660540,"exBudgetMemory":102762,"scriptSizeBytes":425} +unionWith.tokens {"exBudgetCPU":41399459,"exBudgetMemory":99834,"scriptSizeBytes":434} +unionWith.symbols {"exBudgetCPU":23770711,"exBudgetMemory":58510,"scriptSizeBytes":426} +unionWithData const.itself {"exBudgetCPU":1667388,"exBudgetMemory":5700,"scriptSizeBytes":331} +unionWithData const.applied {"exBudgetCPU":42804920,"exBudgetMemory":101964,"scriptSizeBytes":418} isZero.itself {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":115} -isZero.true {"exBudgetCPU":52892795,"exBudgetMemory":127649,"scriptSizeBytes":526} +isZero.true {"exBudgetCPU":50570501,"exBudgetMemory":119849,"scriptSizeBytes":500} isZero.false {"exBudgetCPU":8700981,"exBudgetMemory":21315,"scriptSizeBytes":178} -equality.itself {"exBudgetCPU":2113983,"exBudgetMemory":7200,"scriptSizeBytes":442} -equality.triviallyTrue {"exBudgetCPU":52892795,"exBudgetMemory":127649,"scriptSizeBytes":526} -equality.triviallyFalse {"exBudgetCPU":48483518,"exBudgetMemory":119393,"scriptSizeBytes":536} -equality.swappedTokensTrue {"exBudgetCPU":150951231,"exBudgetMemory":361225,"scriptSizeBytes":579} -equality.swappedSymbolsTrue {"exBudgetCPU":135145220,"exBudgetMemory":323294,"scriptSizeBytes":570} \ No newline at end of file +equality.itself {"exBudgetCPU":1935345,"exBudgetMemory":6600,"scriptSizeBytes":416} +equality.triviallyTrue {"exBudgetCPU":50570501,"exBudgetMemory":119849,"scriptSizeBytes":500} +equality.triviallyFalse {"exBudgetCPU":46399408,"exBudgetMemory":112393,"scriptSizeBytes":510} +equality.swappedTokensTrue {"exBudgetCPU":143746165,"exBudgetMemory":337025,"scriptSizeBytes":553} +equality.swappedSymbolsTrue {"exBudgetCPU":129011982,"exBudgetMemory":302694,"scriptSizeBytes":544} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index c74e6698b..e6106bc76 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -1,18 +1,18 @@ singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -valueOf.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unMapData (force (force sndPair) i3))) (bData i2) i3 (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0))) +valueOf.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 unIData (unMapData i1)) i3)) valueOf.applied (program 1.0.0 1) unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) +unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) unionWith.tokens (program 1.0.0 [(#41c0, #a249736f6d65746f6b656e014a6f74686572746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) , (#41c2, #a149736f6d65746f6b656e01) ]) -unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) i5 i2 i1) i2 i1)) +unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) isZero.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1)) isZero.true (program 1.0.0 True) isZero.false (program 1.0.0 False) -equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (force mkCons (force headList i2) i1) (\i0 -> i2) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (force (force fstPair) (force headList i2)) i4)) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) ((\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) i2 i3))) (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1))) +equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1))) equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) equality.swappedTokensTrue (program 1.0.0 True) diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index ad3d67010..12ee85e2c 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -1,18 +1,18 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i14 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i15 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) -valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> \i0 -> i2 (unMapData (i14 i3))) (bData i2) i3 (\i0 -> i5 (\i0 -> \i0 -> \i0 -> i2 (unIData (i15 i3))) (bData i2) i1 (\i0 -> i1) (delay 0)) (delay 0)) ((\i0 -> (\i0 -> i11 (bData i14) (mapData i1)) (i10 (bData i14) (iData i1))) 1) i12 i13) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i13 i20 i2 i3)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i22 (i19 i4)))) (i17 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i5) (delay ((\i0 -> i8 (i7 (i14 i2) i1) (\i0 -> i2) (i9 i16 (i13 (i14 i2)) i4)) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair)))) -unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 i22 #736f6d65746f6b656e 1) (i16 i22 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 #c0 i22 1) (i16 #c2 i22 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i13 i20 i2 i3)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i22 (i19 i4)))) (i17 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i5) (delay ((\i0 -> i8 (i7 (i14 i2) i1) (\i0 -> i2) (i9 i16 (i13 (i14 i2)) i4)) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair)))) -unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i16 i22 i23 1) (i16 i22 i23 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) +valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i14 i20 i21 1) (i14 i20 i21 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i18 (i19 i4)))) (i16 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay ((\i0 -> i8 (i12 (i14 i2)) (i7 (i14 i2) i1) (\i0 -> i2) i4) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 #736f6d65746f6b656e 1) (i14 i20 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 #c0 i20 1) (i14 #c2 i20 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i18 (i19 i4)))) (i16 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay ((\i0 -> i8 (i12 (i14 i2)) (i7 (i14 i2) i1) (\i0 -> i2) i4) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i14 i20 i21 1) (i14 i20 i21 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) isZero.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair)))) -isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 i26 1) (i19 i25 i26 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i6 (\i0 -> i3 (unMapData (i26 i1))) i1) ((\i0 -> \i0 -> i6 (\i0 -> i3 (unIData (i26 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i19 i1)) (delay (i2 (i20 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i13 i20 i2 i3)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i22 (i19 i4)))) (i17 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i5) (delay ((\i0 -> i8 (i7 (i14 i2) i1) (\i0 -> i2) (i9 i16 (i13 (i14 i2)) i4)) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair)))) -equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 i26 1) (i19 i25 i26 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i19 i25 #736f6d65746f6b656e 1) (i19 i25 #6f74686572746f6b656e 1))) (\i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i20) (delay ((\i0 -> i6 (i20 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i25 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i25 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i23 i29 i30 1) (i23 i29 i22 1)) (i4 addInteger (i23 i29 i22 1) (i23 i29 i30 1)))) (\i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i16 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i21 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i25 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i25 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i23 i29 i30 1) (i23 i22 i30 1)) (i4 addInteger (i23 i22 i30 1) (i23 i29 i30 1)))) (\i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i16 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) (i11 i18 i2 i3)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i20 (i17 i4)))) (i15 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i3) (delay (i21 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i21) (delay ((\i0 -> i6 (i21 (i12 i2) i1) (\i0 -> i2) (i7 i14 (i11 (i12 i2)) i4)) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i8 (equalsData (i9 (i10 i1)) i4) (delay (i5 (i10 i1))) (delay (i2 (i11 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i2 (i4 i3))) (force (force sndPair))) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) \ No newline at end of file +equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i6 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i6 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) (\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay True) (delay (force (i4 (i3 (i19 i1)) (delay (i2 (i20 i1)))))))))) (\i0 -> \i0 -> i14 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i18 (i19 i4)))) (i16 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay ((\i0 -> i8 (i12 (i14 i2)) (i7 (i14 i2) i1) (\i0 -> i2) i4) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) +equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 #736f6d65746f6b656e 1) (i17 i23 #6f74686572746f6b656e 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i21 i27 i28 1) (i21 i27 i20 1)) (i4 addInteger (i21 i27 i20 1) (i21 i27 i28 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i21 i27 i28 1) (i21 i20 i28 1)) (i4 addInteger (i21 i20 i28 1) (i21 i27 i28 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 92b7a60e8..dc40b701a 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -111,6 +111,8 @@ spec = do doubleMap = AssocMap.singleton # pconstant "key" # 84 otherMap = AssocMap.singleton # pconstant "newkey" # 6 "lookup" @\ do + "itself" @| AssocMap.lookup + @-> \lookup -> passert $ lookup # pconstant "key" # pmap #== pcon (PJust 42) "hit" @| AssocMap.lookup # pconstant "key" # pmap @-> \result -> passert $ result #== pcon (PJust 42) "miss" @| AssocMap.lookup # pconstant "nokey" # pmap @@ -120,6 +122,13 @@ spec = do @-> \result -> passert $ result #== pcon (PJust $ pdata 42) "miss" @| AssocMap.lookupData # pdata (pconstant "nokey") # pmap @-> \result -> passert $ result #== pcon PNothing + "findWithDefault" @\ do + "itself" @| AssocMap.findWithDefault + @-> \find -> (find # 12 # pconstant "key" # pmap) #@?= (42 :: Term _ PInteger) + "hit" @| AssocMap.findWithDefault # 12 # pconstant "key" # pmap + @-> \result -> passert $ result #== 42 + "miss" @| AssocMap.findWithDefault # 12 # pconstant "nokey" # pmap + @-> \result -> passert $ result #== 12 "singleton" @| pmap @-> pshouldReallyBe pdmap "singletonData" @| pdmap @-> pshouldReallyBe pmap "insert" @\ do From 41e35815c87424f46fbc95ddca5f91abec709968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 21 Apr 2022 10:23:37 -0400 Subject: [PATCH 416/584] Reverted a stupid kind annotation --- Plutarch/Api/V1/AssocMap.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index dbc8063c1..d2282d61a 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -85,7 +85,7 @@ import Plutarch.Unsafe (punsafeFrom) import Prelude hiding (all, lookup) -newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term (s :: S) (PBuiltinMap k v)) +newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) deriving (PlutusType, PIsData) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) instance From ad0e5b92d3ec5304df82381cd16db628800cd5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 21 Apr 2022 13:16:10 -0400 Subject: [PATCH 417/584] More tests --- Plutarch/Api/V1/AssocMap.hs | 3 +- plutarch-test/goldens/api.map.bench.golden | 3 +- .../goldens/api.map.uplc.eval.golden | 3 +- plutarch-test/goldens/api.map.uplc.golden | 3 +- plutarch-test/goldens/api.value.bench.golden | 53 ++++- .../goldens/api.value.uplc.eval.golden | 183 +++++++++++++++++- plutarch-test/goldens/api.value.uplc.golden | 55 +++++- .../plutarch-base/Plutarch/ApiSpec.hs | 33 +++- 8 files changed, 324 insertions(+), 12 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index d2282d61a..7a943c29e 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -81,12 +81,13 @@ import Plutarch.Prelude ( (#$), type (:-->), ) +import Plutarch.Show (PShow) import Plutarch.Unsafe (punsafeFrom) import Prelude hiding (all, lookup) newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) - deriving (PlutusType, PIsData) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) + deriving (PlutusType, PIsData, PEq, PShow) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) instance ( PLiftData k diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index c220a0ddd..a8ecdd344 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -5,6 +5,7 @@ lookupData.hit {"exBudgetCPU":4140352,"exBudgetMemory":9090,"scriptSizeBytes":11 lookupData.miss {"exBudgetCPU":4885812,"exBudgetMemory":11122,"scriptSizeBytes":121} findWithDefault.itself {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":78} findWithDefault.hit {"exBudgetCPU":4797628,"exBudgetMemory":10354,"scriptSizeBytes":117} +findWithDefault.hit2 {"exBudgetCPU":24561167,"exBudgetMemory":58410,"scriptSizeBytes":368} findWithDefault.miss {"exBudgetCPU":5153769,"exBudgetMemory":12022,"scriptSizeBytes":125} singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} @@ -19,7 +20,7 @@ difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeByt difference.emptyRight {"exBudgetCPU":6146958,"exBudgetMemory":15084,"scriptSizeBytes":159} difference.emptyResult {"exBudgetCPU":9303566,"exBudgetMemory":21242,"scriptSizeBytes":173} unionWith.const {"exBudgetCPU":21557964,"exBudgetMemory":50880,"scriptSizeBytes":344} -unionWith.(+) {"exBudgetCPU":21606308,"exBudgetMemory":50382,"scriptSizeBytes":340} +unionWith.double {"exBudgetCPU":21606308,"exBudgetMemory":50382,"scriptSizeBytes":340} unionWithData.const {"exBudgetCPU":20661369,"exBudgetMemory":49284,"scriptSizeBytes":331} unionWithData.emptyLeft {"exBudgetCPU":9901761,"exBudgetMemory":26280,"scriptSizeBytes":318} unionWithData.emptyRight {"exBudgetCPU":12885871,"exBudgetMemory":33472,"scriptSizeBytes":318} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.eval.golden b/plutarch-test/goldens/api.map.uplc.eval.golden index 3362959b8..0afa41904 100644 --- a/plutarch-test/goldens/api.map.uplc.eval.golden +++ b/plutarch-test/goldens/api.map.uplc.eval.golden @@ -6,6 +6,7 @@ lookupData.hit (program 1.0.0 (\i0 -> \i0 -> i2 (force (force sndPair) (#436b657 lookupData.miss (program 1.0.0 (\i0 -> \i0 -> force i1)) findWithDefault.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData)) findWithDefault.hit (program 1.0.0 42) +findWithDefault.hit2 (program 1.0.0 6) findWithDefault.miss (program 1.0.0 12) singleton (program 1.0.0 [(#436b6579, #182a)]) singletonData (program 1.0.0 [(#436b6579, #182a)]) @@ -20,7 +21,7 @@ difference.emptyLeft (program 1.0.0 []) difference.emptyRight (program 1.0.0 [(#436b6579, #182a)]) difference.emptyResult (program 1.0.0 []) unionWith.const (program 1.0.0 [(#436b6579, #182a)]) -unionWith.(+) (program 1.0.0 [(#436b6579, #1854)]) +unionWith.double (program 1.0.0 [(#436b6579, #1854)]) unionWithData.const (program 1.0.0 [(#436b6579, #182a)]) unionWithData.emptyLeft (program 1.0.0 [(#436b6579, #182a)]) unionWithData.emptyRight (program 1.0.0 [(#436b6579, #182a)]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index fb67bff18..2e8b2dccd 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -5,6 +5,7 @@ lookupData.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i lookupData.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData #6e6f6b6579) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) findWithDefault.itself (program 1.0.0 ((\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) (force headList))) findWithDefault.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 i2 ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) +findWithDefault.hit2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (bData i1) i2 unIData) 12 i14 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i21 i21)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i24 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i24 (mkPairData i3 i2) i4)) (i6 i1 (i17 (i18 i4)))) (i15 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i8 i1 (i8 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i22) (delay ((\i0 -> i12 (i16 (i18 i2)) (i22 (i18 i2) i1) (\i0 -> i2) i4) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i8 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i10 #6b6579 42) (i10 i14 6))) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6e65776b6579)) findWithDefault.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) @@ -19,7 +20,7 @@ difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (i8 (i9 i2)) (i11 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (i8 (i9 i2)) (i13 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i21 i21)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i24 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i24 (mkPairData i3 i2) i4)) (i6 i1 (i17 (i18 i4)))) (i15 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i8 i1 (i8 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i22) (delay ((\i0 -> i12 (i16 (i18 i2)) (i22 (i18 i2) i1) (\i0 -> i2) i4) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i8 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i21) (delay ((\i0 -> i11 (i15 (i17 i2)) (i21 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i21) (delay ((\i0 -> i11 (i15 (i17 i2)) (i21 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i21) (delay ((\i0 -> i11 (i15 (i17 i2)) (i21 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> i2) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i18 i18)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i21 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i21 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i19) (delay ((\i0 -> i11 (i15 (i17 i2)) (i19 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> i2) i11 ((\i0 -> \i0 -> (\i0 -> \i0 -> i14 (mkPairData i2 i1) i15) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i13 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i18 i18)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i21 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i21 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i19) (delay ((\i0 -> i11 (i15 (i17 i2)) (i19 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i14 (mkPairData i2 i1) i15) (bData i2) (iData i1)) #6b6579 42) i11) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i13 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index 857001c45..cf4485b48 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -1,11 +1,45 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} +valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":194} +valueOf.growing.2 {"exBudgetCPU":45169030,"exBudgetMemory":109028,"scriptSizeBytes":469} +valueOf.growing.3 {"exBudgetCPU":66395986,"exBudgetMemory":160112,"scriptSizeBytes":498} +valueOf.growing.4 {"exBudgetCPU":95136623,"exBudgetMemory":227742,"scriptSizeBytes":515} +valueOf.growing.5 {"exBudgetCPU":131837536,"exBudgetMemory":313418,"scriptSizeBytes":531} +valueOf.growing.6 {"exBudgetCPU":176498725,"exBudgetMemory":417140,"scriptSizeBytes":547} +valueOf.growing.7 {"exBudgetCPU":229120190,"exBudgetMemory":538908,"scriptSizeBytes":564} +valueOf.growing.8 {"exBudgetCPU":289701931,"exBudgetMemory":678722,"scriptSizeBytes":580} +valueOf.growing.9 {"exBudgetCPU":361102826,"exBudgetMemory":841740,"scriptSizeBytes":595} +valueOf.growing.10 {"exBudgetCPU":435673744,"exBudgetMemory":1013716,"scriptSizeBytes":611} +valueOf.growing.11 {"exBudgetCPU":518204938,"exBudgetMemory":1203738,"scriptSizeBytes":627} +valueOf.growing.12 {"exBudgetCPU":608696408,"exBudgetMemory":1411806,"scriptSizeBytes":644} +valueOf.growing.13 {"exBudgetCPU":707148154,"exBudgetMemory":1637920,"scriptSizeBytes":660} +valueOf.growing.14 {"exBudgetCPU":813560176,"exBudgetMemory":1882080,"scriptSizeBytes":676} +valueOf.growing.15 {"exBudgetCPU":927932474,"exBudgetMemory":2144286,"scriptSizeBytes":693} +valueOf.growing.16 {"exBudgetCPU":1050265048,"exBudgetMemory":2424538,"scriptSizeBytes":709} +valueOf.growing.17 {"exBudgetCPU":1180557898,"exBudgetMemory":2722836,"scriptSizeBytes":726} unionWith.const {"exBudgetCPU":43612196,"exBudgetMemory":103260,"scriptSizeBytes":428} unionWith.(+).itself {"exBudgetCPU":1667388,"exBudgetMemory":5700,"scriptSizeBytes":341} unionWith.(+).applied {"exBudgetCPU":43660540,"exBudgetMemory":102762,"scriptSizeBytes":425} unionWith.tokens {"exBudgetCPU":41399459,"exBudgetMemory":99834,"scriptSizeBytes":434} unionWith.symbols {"exBudgetCPU":23770711,"exBudgetMemory":58510,"scriptSizeBytes":426} +unionWith.growing.1 {"exBudgetCPU":23860030,"exBudgetMemory":58810,"scriptSizeBytes":430} +unionWith.growing.2 {"exBudgetCPU":60774359,"exBudgetMemory":147288,"scriptSizeBytes":461} +unionWith.growing.3 {"exBudgetCPU":87672940,"exBudgetMemory":211288,"scriptSizeBytes":481} +unionWith.growing.4 {"exBudgetCPU":122442478,"exBudgetMemory":293034,"scriptSizeBytes":497} +unionWith.growing.5 {"exBudgetCPU":165172292,"exBudgetMemory":392826,"scriptSizeBytes":513} +unionWith.growing.6 {"exBudgetCPU":215862382,"exBudgetMemory":510664,"scriptSizeBytes":530} +unionWith.growing.7 {"exBudgetCPU":274512748,"exBudgetMemory":646548,"scriptSizeBytes":546} +unionWith.growing.8 {"exBudgetCPU":341123390,"exBudgetMemory":800478,"scriptSizeBytes":562} +unionWith.growing.9 {"exBudgetCPU":433491694,"exBudgetMemory":1014378,"scriptSizeBytes":578} +unionWith.growing.10 {"exBudgetCPU":516022888,"exBudgetMemory":1204400,"scriptSizeBytes":593} +unionWith.growing.11 {"exBudgetCPU":606514358,"exBudgetMemory":1412468,"scriptSizeBytes":610} +unionWith.growing.12 {"exBudgetCPU":704966104,"exBudgetMemory":1638582,"scriptSizeBytes":626} +unionWith.growing.13 {"exBudgetCPU":811378126,"exBudgetMemory":1882742,"scriptSizeBytes":642} +unionWith.growing.14 {"exBudgetCPU":925750424,"exBudgetMemory":2144948,"scriptSizeBytes":659} +unionWith.growing.15 {"exBudgetCPU":1048082998,"exBudgetMemory":2425200,"scriptSizeBytes":675} +unionWith.growing.16 {"exBudgetCPU":1178375848,"exBudgetMemory":2723498,"scriptSizeBytes":691} +unionWith.growing.17 {"exBudgetCPU":1316628974,"exBudgetMemory":3039842,"scriptSizeBytes":708} unionWithData const.itself {"exBudgetCPU":1667388,"exBudgetMemory":5700,"scriptSizeBytes":331} unionWithData const.applied {"exBudgetCPU":42804920,"exBudgetMemory":101964,"scriptSizeBytes":418} isZero.itself {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":115} @@ -15,4 +49,21 @@ equality.itself {"exBudgetCPU":1935345,"exBudgetMemory":6600,"scriptSizeBytes":4 equality.triviallyTrue {"exBudgetCPU":50570501,"exBudgetMemory":119849,"scriptSizeBytes":500} equality.triviallyFalse {"exBudgetCPU":46399408,"exBudgetMemory":112393,"scriptSizeBytes":510} equality.swappedTokensTrue {"exBudgetCPU":143746165,"exBudgetMemory":337025,"scriptSizeBytes":553} -equality.swappedSymbolsTrue {"exBudgetCPU":129011982,"exBudgetMemory":302694,"scriptSizeBytes":544} \ No newline at end of file +equality.swappedSymbolsTrue {"exBudgetCPU":129011982,"exBudgetMemory":302694,"scriptSizeBytes":544} +equality.growing.1 {"exBudgetCPU":50570501,"exBudgetMemory":119849,"scriptSizeBytes":500} +equality.growing.2 {"exBudgetCPU":143686165,"exBudgetMemory":337025,"scriptSizeBytes":548} +equality.growing.3 {"exBudgetCPU":221661051,"exBudgetMemory":518370,"scriptSizeBytes":579} +equality.growing.4 {"exBudgetCPU":319419239,"exBudgetMemory":743667,"scriptSizeBytes":610} +equality.growing.5 {"exBudgetCPU":436960729,"exBudgetMemory":1012916,"scriptSizeBytes":641} +equality.growing.6 {"exBudgetCPU":574285521,"exBudgetMemory":1326117,"scriptSizeBytes":673} +equality.growing.7 {"exBudgetCPU":731393615,"exBudgetMemory":1683270,"scriptSizeBytes":704} +equality.growing.8 {"exBudgetCPU":908285011,"exBudgetMemory":2084375,"scriptSizeBytes":735} +equality.growing.9 {"exBudgetCPU":1104959709,"exBudgetMemory":2529432,"scriptSizeBytes":766} +equality.growing.10 {"exBudgetCPU":1321417709,"exBudgetMemory":3018441,"scriptSizeBytes":798} +equality.growing.11 {"exBudgetCPU":1557659011,"exBudgetMemory":3551402,"scriptSizeBytes":829} +equality.growing.12 {"exBudgetCPU":1813683615,"exBudgetMemory":4128315,"scriptSizeBytes":860} +equality.growing.13 {"exBudgetCPU":2089491521,"exBudgetMemory":4749180,"scriptSizeBytes":891} +equality.growing.14 {"exBudgetCPU":2385082729,"exBudgetMemory":5413997,"scriptSizeBytes":923} +equality.growing.15 {"exBudgetCPU":2700457239,"exBudgetMemory":6122766,"scriptSizeBytes":954} +equality.growing.16 {"exBudgetCPU":3035615051,"exBudgetMemory":6875487,"scriptSizeBytes":985} +equality.growing.17 {"exBudgetCPU":3390556165,"exBudgetMemory":7672160,"scriptSizeBytes":1016} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index e6106bc76..43ee240bf 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -1,12 +1,174 @@ singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) valueOf.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 unIData (unMapData i1)) i3)) valueOf.applied (program 1.0.0 1) +valueOf.growing.1 (program 1.0.0 0) +valueOf.growing.2 (program 1.0.0 0) +valueOf.growing.3 (program 1.0.0 0) +valueOf.growing.4 (program 1.0.0 0) +valueOf.growing.5 (program 1.0.0 0) +valueOf.growing.6 (program 1.0.0 0) +valueOf.growing.7 (program 1.0.0 0) +valueOf.growing.8 (program 1.0.0 0) +valueOf.growing.9 (program 1.0.0 1) +valueOf.growing.10 (program 1.0.0 1) +valueOf.growing.11 (program 1.0.0 1) +valueOf.growing.12 (program 1.0.0 1) +valueOf.growing.13 (program 1.0.0 1) +valueOf.growing.14 (program 1.0.0 1) +valueOf.growing.15 (program 1.0.0 1) +valueOf.growing.16 (program 1.0.0 1) +valueOf.growing.17 (program 1.0.0 1) unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) unionWith.tokens (program 1.0.0 [(#41c0, #a249736f6d65746f6b656e014a6f74686572746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) - , (#41c2, #a149736f6d65746f6b656e01) ]) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.1 (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.2 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.3 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.4 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.5 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.6 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.7 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.8 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.9 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) + , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) ]) +unionWith.growing.10 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) + , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c8, #a145746f6b656e01) ]) +unionWith.growing.11 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) + , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) ]) +unionWith.growing.12 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) + , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) ]) +unionWith.growing.13 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) + , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) ]) +unionWith.growing.14 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) + , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) + , (#41cc, #a145746f6b656e01) ]) +unionWith.growing.15 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) + , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) + , (#41cc, #a145746f6b656e01) + , (#41cd, #a145746f6b656e01) ]) +unionWith.growing.16 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) + , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) + , (#41cc, #a145746f6b656e01) + , (#41cd, #a145746f6b656e01) + , (#41ce, #a145746f6b656e01) ]) +unionWith.growing.17 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) + , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) + , (#41cc, #a145746f6b656e01) + , (#41cd, #a145746f6b656e01) + , (#41ce, #a145746f6b656e01) + , (#41cf, #a145746f6b656e01) ]) unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) isZero.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1)) @@ -16,4 +178,21 @@ equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) equality.swappedTokensTrue (program 1.0.0 True) -equality.swappedSymbolsTrue (program 1.0.0 True) \ No newline at end of file +equality.swappedSymbolsTrue (program 1.0.0 True) +equality.growing.1 (program 1.0.0 True) +equality.growing.2 (program 1.0.0 True) +equality.growing.3 (program 1.0.0 True) +equality.growing.4 (program 1.0.0 True) +equality.growing.5 (program 1.0.0 True) +equality.growing.6 (program 1.0.0 True) +equality.growing.7 (program 1.0.0 True) +equality.growing.8 (program 1.0.0 True) +equality.growing.9 (program 1.0.0 True) +equality.growing.10 (program 1.0.0 True) +equality.growing.11 (program 1.0.0 True) +equality.growing.12 (program 1.0.0 True) +equality.growing.13 (program 1.0.0 True) +equality.growing.14 (program 1.0.0 True) +equality.growing.15 (program 1.0.0 True) +equality.growing.16 (program 1.0.0 True) +equality.growing.17 (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index 12ee85e2c..fe01e6e3f 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -1,11 +1,45 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i21 #736f6d65746f6b656e 1) (i15 i21 i22 1)) #c7 i22) (\i0 -> i7 (bData i1))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) +valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) (i19 #c3 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) (i19 #c3 i25 1)) (i19 #c4 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) (i19 #c3 i25 1)) (i19 #c4 i25 1)) (i19 #c5 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) (i19 #c3 i25 1)) (i19 #c4 i25 1)) (i19 #c5 i25 1)) (i19 #c6 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) (i19 #cc i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) (i19 #cc i26 1)) (i19 #cd i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) (i19 #cc i26 1)) (i19 #cd i26 1)) (i19 #ce i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) (i19 #cc i26 1)) (i19 #cd i26 1)) (i19 #ce i26 1)) (i19 #cf i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i14 i20 i21 1) (i14 i20 i21 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i18 (i19 i4)))) (i16 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay ((\i0 -> i8 (i12 (i14 i2)) (i7 (i14 i2) i1) (\i0 -> i2) i4) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 #736f6d65746f6b656e 1) (i14 i20 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 #c0 i20 1) (i14 #c2 i20 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 #c0 i20 1) (i14 #c7 i20 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i14 #c0 i20 1) (i14 #c7 i20 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i18 i17 i24 1) (i18 i17 #746f6b656e 1)) (i18 #c7 i24 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 #cc i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 #cc i18 1)) (i19 #cd i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 #cc i18 1)) (i19 #cd i18 1)) (i19 #ce i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 #cc i18 1)) (i19 #cd i18 1)) (i19 #ce i18 1)) (i19 #cf i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i18 (i19 i4)))) (i16 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay ((\i0 -> i8 (i12 (i14 i2)) (i7 (i14 i2) i1) (\i0 -> i2) i4) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i14 i20 i21 1) (i14 i20 i21 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) isZero.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair)))) @@ -15,4 +49,21 @@ equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 #736f6d65746f6b656e 1) (i17 i23 #6f74686572746f6b656e 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i21 i27 i28 1) (i21 i27 i20 1)) (i4 addInteger (i21 i27 i20 1) (i21 i27 i28 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i21 i27 i28 1) (i21 i20 i28 1)) (i4 addInteger (i21 i20 i28 1) (i21 i27 i28 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) \ No newline at end of file +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i21 i27 i28 1) (i21 i20 i28 1)) (i4 addInteger (i21 i20 i28 1) (i21 i27 i28 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i21 i27 i20 1) (i21 i27 i28 1)) (i4 addInteger (i21 i27 i20 1) (i21 i27 i28 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i22 i21 i20 1) (i22 i21 i29 1)) (i22 i28 i29 1)) (i4 addInteger (i4 addInteger (i22 i21 i20 1) (i22 i21 i29 1)) (i22 i28 i29 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c1) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i23 i21 i20 1) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i23 i21 i20 1) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i21 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i21) (delay ((\i0 -> i6 (i10 (i12 i2)) (i21 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c2) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i24 i21 i20 1) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i24 i21 i20 1) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i26 i26)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i29 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i29 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i22 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i22) (delay ((\i0 -> i6 (i10 (i12 i2)) (i22 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c3) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i25 i21 i20 1) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i25 i21 i20 1) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i27 i27)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i30 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i30 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i23 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i23) (delay ((\i0 -> i6 (i10 (i12 i2)) (i23 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c4) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i26 i21 i20 1) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i26 i21 i20 1) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i28 i28)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i31 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i31 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i24 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i24) (delay ((\i0 -> i6 (i10 (i12 i2)) (i24 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c5) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i27 i21 i20 1) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i27 i21 i20 1) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i29 i29)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i32 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i32 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i25 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i25) (delay ((\i0 -> i6 (i10 (i12 i2)) (i25 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c6) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i28 i21 i20 1) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i28 i21 i20 1) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i30 i30)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i33 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i33 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i26 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i26) (delay ((\i0 -> i6 (i10 (i12 i2)) (i26 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i29 i21 i20 1) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i29 i21 i20 1) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i31 i31)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i34 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i34 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i27 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i27) (delay ((\i0 -> i6 (i10 (i12 i2)) (i27 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c8) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i30 i21 i20 1) (i30 i21 i37 1)) (i30 i22 i37 1)) (i30 i23 i37 1)) (i30 i24 i37 1)) (i30 i25 i37 1)) (i30 i26 i37 1)) (i30 i27 i37 1)) (i30 i28 i37 1)) (i30 i29 i37 1)) (i30 i36 i37 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i30 i21 i20 1) (i30 i21 i37 1)) (i30 i22 i37 1)) (i30 i23 i37 1)) (i30 i24 i37 1)) (i30 i25 i37 1)) (i30 i26 i37 1)) (i30 i27 i37 1)) (i30 i28 i37 1)) (i30 i29 i37 1)) (i30 i36 i37 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i32 i32)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i35 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i35 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i28 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i28) (delay ((\i0 -> i6 (i10 (i12 i2)) (i28 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c9) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i31 i21 i20 1) (i31 i21 i38 1)) (i31 i22 i38 1)) (i31 i23 i38 1)) (i31 i24 i38 1)) (i31 i25 i38 1)) (i31 i26 i38 1)) (i31 i27 i38 1)) (i31 i28 i38 1)) (i31 i29 i38 1)) (i31 i30 i38 1)) (i31 i37 i38 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i31 i21 i20 1) (i31 i21 i38 1)) (i31 i22 i38 1)) (i31 i23 i38 1)) (i31 i24 i38 1)) (i31 i25 i38 1)) (i31 i26 i38 1)) (i31 i27 i38 1)) (i31 i28 i38 1)) (i31 i29 i38 1)) (i31 i30 i38 1)) (i31 i37 i38 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i33 i33)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i36 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i36 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i29 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i29) (delay ((\i0 -> i6 (i10 (i12 i2)) (i29 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ca) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i32 i21 i20 1) (i32 i21 i39 1)) (i32 i22 i39 1)) (i32 i23 i39 1)) (i32 i24 i39 1)) (i32 i25 i39 1)) (i32 i26 i39 1)) (i32 i27 i39 1)) (i32 i28 i39 1)) (i32 i29 i39 1)) (i32 i30 i39 1)) (i32 i31 i39 1)) (i32 i38 i39 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i32 i21 i20 1) (i32 i21 i39 1)) (i32 i22 i39 1)) (i32 i23 i39 1)) (i32 i24 i39 1)) (i32 i25 i39 1)) (i32 i26 i39 1)) (i32 i27 i39 1)) (i32 i28 i39 1)) (i32 i29 i39 1)) (i32 i30 i39 1)) (i32 i31 i39 1)) (i32 i38 i39 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i34 i34)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i37 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i37 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i30 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i30) (delay ((\i0 -> i6 (i10 (i12 i2)) (i30 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cb) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i33 i21 i20 1) (i33 i21 i40 1)) (i33 i22 i40 1)) (i33 i23 i40 1)) (i33 i24 i40 1)) (i33 i25 i40 1)) (i33 i26 i40 1)) (i33 i27 i40 1)) (i33 i28 i40 1)) (i33 i29 i40 1)) (i33 i30 i40 1)) (i33 i31 i40 1)) (i33 i32 i40 1)) (i33 i39 i40 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i33 i21 i20 1) (i33 i21 i40 1)) (i33 i22 i40 1)) (i33 i23 i40 1)) (i33 i24 i40 1)) (i33 i25 i40 1)) (i33 i26 i40 1)) (i33 i27 i40 1)) (i33 i28 i40 1)) (i33 i29 i40 1)) (i33 i30 i40 1)) (i33 i31 i40 1)) (i33 i32 i40 1)) (i33 i39 i40 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i35 i35)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i38 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i38 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i31 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i31) (delay ((\i0 -> i6 (i10 (i12 i2)) (i31 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cc) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i34 i21 i20 1) (i34 i21 i41 1)) (i34 i22 i41 1)) (i34 i23 i41 1)) (i34 i24 i41 1)) (i34 i25 i41 1)) (i34 i26 i41 1)) (i34 i27 i41 1)) (i34 i28 i41 1)) (i34 i29 i41 1)) (i34 i30 i41 1)) (i34 i31 i41 1)) (i34 i32 i41 1)) (i34 i33 i41 1)) (i34 i40 i41 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i34 i21 i20 1) (i34 i21 i41 1)) (i34 i22 i41 1)) (i34 i23 i41 1)) (i34 i24 i41 1)) (i34 i25 i41 1)) (i34 i26 i41 1)) (i34 i27 i41 1)) (i34 i28 i41 1)) (i34 i29 i41 1)) (i34 i30 i41 1)) (i34 i31 i41 1)) (i34 i32 i41 1)) (i34 i33 i41 1)) (i34 i40 i41 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i36 i36)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i39 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i39 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i32 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i32) (delay ((\i0 -> i6 (i10 (i12 i2)) (i32 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i35 i21 i20 1) (i35 i21 i42 1)) (i35 i22 i42 1)) (i35 i23 i42 1)) (i35 i24 i42 1)) (i35 i25 i42 1)) (i35 i26 i42 1)) (i35 i27 i42 1)) (i35 i28 i42 1)) (i35 i29 i42 1)) (i35 i30 i42 1)) (i35 i31 i42 1)) (i35 i32 i42 1)) (i35 i33 i42 1)) (i35 i34 i42 1)) (i35 i41 i42 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i35 i21 i20 1) (i35 i21 i42 1)) (i35 i22 i42 1)) (i35 i23 i42 1)) (i35 i24 i42 1)) (i35 i25 i42 1)) (i35 i26 i42 1)) (i35 i27 i42 1)) (i35 i28 i42 1)) (i35 i29 i42 1)) (i35 i30 i42 1)) (i35 i31 i42 1)) (i35 i32 i42 1)) (i35 i33 i42 1)) (i35 i34 i42 1)) (i35 i41 i42 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i37 i37)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i40 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i40 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i33 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i33) (delay ((\i0 -> i6 (i10 (i12 i2)) (i33 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i36 i21 i20 1) (i36 i21 i43 1)) (i36 i22 i43 1)) (i36 i23 i43 1)) (i36 i24 i43 1)) (i36 i25 i43 1)) (i36 i26 i43 1)) (i36 i27 i43 1)) (i36 i28 i43 1)) (i36 i29 i43 1)) (i36 i30 i43 1)) (i36 i31 i43 1)) (i36 i32 i43 1)) (i36 i33 i43 1)) (i36 i34 i43 1)) (i36 i35 i43 1)) (i36 i42 i43 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i36 i21 i20 1) (i36 i21 i43 1)) (i36 i22 i43 1)) (i36 i23 i43 1)) (i36 i24 i43 1)) (i36 i25 i43 1)) (i36 i26 i43 1)) (i36 i27 i43 1)) (i36 i28 i43 1)) (i36 i29 i43 1)) (i36 i30 i43 1)) (i36 i31 i43 1)) (i36 i32 i43 1)) (i36 i33 i43 1)) (i36 i34 i43 1)) (i36 i35 i43 1)) (i36 i42 i43 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i38 i38)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i41 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i41 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i34 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i34) (delay ((\i0 -> i6 (i10 (i12 i2)) (i34 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index dc40b701a..d9ba7d6f3 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE ImpredicativeTypes #-} + -- NOTE: This module also contains ScriptContext mocks, which should ideally -- moved to a module of its own after cleaning up to expose a easy to reason -- about API. @@ -14,7 +16,10 @@ module Plutarch.ApiSpec ( import Test.Tasty.HUnit +import Control.Monad (forM_) import Control.Monad.Trans.Cont (cont, runCont) +import Data.String (fromString) +import Numeric (showHex) import Plutus.V1.Ledger.Api import qualified Plutus.V1.Ledger.Interval as Interval import qualified Plutus.V1.Ledger.Value as Value @@ -62,13 +67,24 @@ spec = do pgoldenSpec $ do let pmint = PValue.singleton # pconstant "c0" # pconstant "sometoken" # 1 pmintOtherToken = PValue.singleton # pconstant "c0" # pconstant "othertoken" # 1 - pmintOtherSymbol = PValue.singleton # pconstant "c2" # pconstant "sometoken" # 1 + pmintOtherSymbol = PValue.singleton # pconstant "c7" # pconstant "sometoken" # 1 + growingSymbols, symbols :: [ClosedTerm PValue] + growingSymbols = scanl (\s v -> PValue.unionWith # plam (+) # s # v) pmint symbols + symbols = toSymbolicValue <$> [0..15] + toSymbolicValue :: Integer -> ClosedTerm PValue + toSymbolicValue n = + PValue.singleton # pconstant (fromString $ "c" <> showHex n "") # pconstant "token" # 1 "singleton" @| pmint @-> \p -> plift p @?= mint "valueOf" @\ do "itself" @| PValue.valueOf @-> \v -> plift (v # pmint # pconstant "c0" # pconstant "sometoken") @?= 1 "applied" @| PValue.valueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> plift p @?= 1 + "growing" @\ + forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) + (\(size, v) -> + fromString (show size) + @| PValue.valueOf # v # pconstant "c7" # pconstant "token" @-> \p -> plift p @?= if size < 9 then 0 else 1) "unionWith" @\ do "const" @| PValue.unionWith # plam const # pmint # pmint @-> \p -> plift p @?= mint @@ -81,6 +97,11 @@ spec = do plift p @?= mint <> mintOtherToken "symbols" @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> plift p @?= mint <> mintOtherSymbol + "growing" @\ + forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) + (\(size, v) -> + fromString (show size) @| PValue.unionWith # plam const # v # pmintOtherSymbol + @-> \v' -> passert (v' #== PValue.unionWith # plam const # pmintOtherSymbol # v)) "unionWithData const" @\ do "itself" @| PValue.unionWithData @-> \u -> plift (u # plam const # pmint # pmint) @?= mint @@ -102,6 +123,9 @@ spec = do @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol #== PValue.unionWith # plam (+) # pmintOtherSymbol # pmint @-> passert + "growing" @\ + forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) + (\(size, v) -> fromString (show size) @| v #== v @-> passert) describe "map" $ do pgoldenSpec $ do let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap PByteString PInteger) @@ -127,6 +151,9 @@ spec = do @-> \find -> (find # 12 # pconstant "key" # pmap) #@?= (42 :: Term _ PInteger) "hit" @| AssocMap.findWithDefault # 12 # pconstant "key" # pmap @-> \result -> passert $ result #== 42 + "hit2" + @| AssocMap.findWithDefault # 12 # pconstant "newkey" # (AssocMap.unionWith # plam const # pmap # otherMap) + @-> \result -> passert $ result #== 6 "miss" @| AssocMap.findWithDefault # 12 # pconstant "nokey" # pmap @-> \result -> passert $ result #== 12 "singleton" @| pmap @-> pshouldReallyBe pdmap @@ -150,7 +177,7 @@ spec = do "emptyResult" @| AssocMap.difference # pmap # doubleMap @-> pshouldReallyBe emptyMap "unionWith" @\ do "const" @| AssocMap.unionWith # plam const # pmap # pmap @-> pshouldReallyBe pmap - "(+)" @| AssocMap.unionWith # plam (+) # pmap # pmap @-> pshouldReallyBe doubleMap + "double" @| AssocMap.unionWith # plam (+) # pmap # pmap @-> pshouldReallyBe doubleMap "unionWithData" @\ do "const" @| AssocMap.unionWithData # plam const # pmap # pmap @-> pshouldReallyBe pmap "emptyLeft" @| AssocMap.unionWithData # plam const # emptyMap # pmap @-> pshouldReallyBe pmap @@ -227,7 +254,7 @@ mintOtherToken :: Value mintOtherToken = Value.singleton sym "othertoken" 1 mintOtherSymbol :: Value -mintOtherSymbol = Value.singleton "c2" "sometoken" 1 +mintOtherSymbol = Value.singleton "c7" "sometoken" 1 ref :: TxOutRef ref = TxOutRef "a0" 0 From 2e0208ea24d603a96058794a4656a2b6277dea39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 21 Apr 2022 14:39:49 -0400 Subject: [PATCH 418/584] Keep the AssocMap sorted by key data --- Plutarch/Api/V1/AssocMap.hs | 123 +++++++++++------ ...pi.example.signatory.dev=true.bench.golden | 4 - ...xample.signatory.dev=true.uplc.eval.golden | 4 - ...api.example.signatory.dev=true.uplc.golden | 4 - plutarch-test/goldens/api.map.bench.golden | 34 ++--- .../goldens/api.map.uplc.eval.golden | 2 + plutarch-test/goldens/api.map.uplc.golden | 34 ++--- plutarch-test/goldens/api.value.bench.golden | 126 +++++++++--------- .../goldens/api.value.uplc.eval.golden | 46 +++---- plutarch-test/goldens/api.value.uplc.golden | 126 +++++++++--------- .../plutarch-base/Plutarch/ApiSpec.hs | 39 ++++-- 11 files changed, 294 insertions(+), 248 deletions(-) delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 7a943c29e..2057af423 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -11,14 +12,12 @@ module Plutarch.Api.V1.AssocMap ( insert, insertData, delete, - deleteData, -- * Lookups lookup, lookupData, findWithDefault, foldAt, - foldAtData, -- * Folds all, @@ -36,7 +35,7 @@ module Plutarch.Api.V1.AssocMap ( import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap -import Plutarch.Builtin (PBuiltinMap, ppairDataBuiltin) +import Plutarch.Builtin (PBuiltinList (PCons, PNil), PBuiltinMap, ppairDataBuiltin) import Plutarch.Either (peither) import Plutarch.Lift ( PConstantDecl, @@ -51,7 +50,6 @@ import Plutarch.Prelude ( DerivePNewtype (..), PAsData, PBool, - PBuiltinList, PBuiltinPair, PCon (pcon), PConstantData, @@ -62,13 +60,13 @@ import Plutarch.Prelude ( PListLike (pcons, pnil), PMatch (pmatch), PMaybe (..), + POrd ((#<)), PPair (..), PType, PlutusType, S, Term, pall, - pconcat, pfstBuiltin, phoistAcyclic, pif, @@ -81,9 +79,12 @@ import Plutarch.Prelude ( (#$), type (:-->), ) +import Plutarch.Rec (ScottEncoded, ScottEncoding, field, letrec) import Plutarch.Show (PShow) import Plutarch.Unsafe (punsafeFrom) +import qualified Rank2.TH + import Prelude hiding (all, lookup) newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) @@ -178,34 +179,32 @@ foldAtData = phoistAcyclic $ # pto map -- | Insert a new key/value pair into the map, overiding the previous if any. -insert :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v :--> PMap k v) +insert :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v :--> PMap k v) insert = phoistAcyclic $ - plam $ \k v -> insertData # pdata k # pdata v + plam $ \key val -> + rebuildAtKey # (plam (pcons # (ppairDataBuiltin # pdata key # pdata val) #)) # key -- | Insert a new data-encoded key/value pair into the map, overiding the previous if any. insertData :: - (PIsData k, PIsData v) => + (POrd k, PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v :--> PMap k v) insertData = phoistAcyclic $ plam $ \key val -> - rebuildAtKey # (plam (pcons # (ppairDataBuiltin # key # val) #)) # key + rebuildAtKey # (plam (pcons # (ppairDataBuiltin # key # val) #)) # pfromData key -- | Delete a key from the map. -delete :: (PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMap k v) -delete = phoistAcyclic $ plam $ \key -> deleteData # pdata key - --- | Delete a data-encoded key from the map. -deleteData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PMap k v :--> PMap k v) -deleteData = rebuildAtKey # plam id +delete :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMap k v) +delete = rebuildAtKey # plam id -- | Rebuild the map at the given key. rebuildAtKey :: + (POrd k, PIsData k) => Term s ( ( PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)) :--> PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)) ) - :--> PAsData k + :--> k :--> PMap k v :--> PMap k v ) @@ -214,11 +213,16 @@ rebuildAtKey = phoistAcyclic $ punsafeFrom $ precList ( \self x xs -> - plam $ \prefix -> - pif - (pfstBuiltin # x #== key) - (prefix #$ handler # xs) - (self # xs #$ plam $ \suffix -> prefix #$ pcons # x # suffix) + plet (pfromData $ pfstBuiltin # x) $ \k -> + plam $ \prefix -> + pif + (k #< key) + (self # xs #$ plam $ \suffix -> prefix #$ pcons # x # suffix) + ( pif + (k #== key) + (prefix #$ handler # xs) + (prefix #$ handler #$ pcons # x # xs) + ) ) (const $ plam (#$ handler # pnil)) # pto map @@ -237,22 +241,35 @@ singletonData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData singletonData = phoistAcyclic $ plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # key # value) # pnil) +data MapUnion k v f = MapUnion + { merge :: f (PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) + , mergeInsert :: f (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) + } + +type instance + ScottEncoded (MapUnion k v) a = + (PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) + :--> (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) + :--> a + +$(Rank2.TH.deriveAll ''MapUnion) + {- | Combine two 'PMap's applying the given function to any two values that share the same key. -} unionWith :: - (PIsData k, PIsData v) => + (POrd k, PIsData k, PIsData v) => Term (s :: S) ((v :--> v :--> v) :--> PMap k v :--> PMap k v :--> PMap k v) unionWith = phoistAcyclic $ plam $ - \merge -> unionWithData #$ plam $ - \x y -> pdata (merge # pfromData x # pfromData y) + \combine -> unionWithData #$ plam $ + \x y -> pdata (combine # pfromData x # pfromData y) {- | Combine two 'PMap's applying the given function to any two data-encoded values that share the same key. -} unionWithData :: - (PIsData k, PIsData v) => + (POrd k, PIsData k, PIsData v) => Term (s :: S) ( (PAsData v :--> PAsData v :--> PAsData v) @@ -261,23 +278,47 @@ unionWithData :: :--> PMap k v ) unionWithData = phoistAcyclic $ - plam $ \merge x y -> - plet - ( plam $ \k x' -> - foldAtData - # k - # pcon (PLeft x') - # plam (pcon . PRight . (merge # x' #)) - # y - ) - $ \leftOrBoth -> - pmatch (mapEitherWithKeyData # leftOrBoth # x) $ \(PPair x' xy) -> - pcon . PMap $ - pconcat # pto xy #$ pconcat # pto x' # pto (difference # y # xy) + plam $ \combine x y -> + pcon $ PMap $ mapUnion # combine # field merge # pto x # pto y + +mapUnion :: + (POrd k, PIsData k, PIsData v) => + Term (s :: S) ((PAsData v :--> PAsData v :--> PAsData v) :--> ScottEncoding (MapUnion k v) (a :: PType)) +mapUnion = plam $ \combine -> + letrec $ \MapUnion {merge, mergeInsert} -> + MapUnion + { merge = plam $ \xs ys -> pmatch xs $ \case + PNil -> ys + PCons x xs' -> mergeInsert # x # xs' # ys + , mergeInsert = plam $ \x xs ys -> pmatch ys $ \case + PNil -> pcons # x # xs + PCons y ys' -> + plet (pfstBuiltin # x) $ \xk -> + plet (pfstBuiltin # y) $ \yk -> + pif + (xk #== yk) + ( pcons + # (ppairDataBuiltin # xk #$ combine # (psndBuiltin # x) # (psndBuiltin # y)) + #$ merge + # xs + # ys' + ) + ( pif + (pfromData xk #< pfromData yk) + ( pcons + # x + # (mergeInsert # y # ys' # xs) + ) + ( pcons + # y + # (mergeInsert # x # xs # ys') + ) + ) + } -- | Difference of two maps. Return elements of the first map not existing in the second map. difference :: - (PIsData k, PIsData a, PIsData b) => + (POrd k, PIsData k, PIsData a, PIsData b) => Term (s :: S) (PMap k a :--> PMap k b :--> PMap k a) difference = phoistAcyclic $ plam $ \left right -> @@ -285,8 +326,8 @@ difference = phoistAcyclic $ precList ( \self x xs -> plet (self # xs) $ \xs' -> - foldAtData - # (pfstBuiltin # x) + foldAt + # (pfromData $ pfstBuiltin # x) # (pcons # x # xs') # (plam $ const xs') # right diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden deleted file mode 100644 index 6759b8694..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} -cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} -termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} -termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden deleted file mode 100644 index 0070757cf..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -cont.succeeds (program 1.0.0 ()) -cont.fails (program 1.0.0 error) -termcont.succeeds (program 1.0.0 ()) -termcont.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden deleted file mode 100644 index 0be2377ab..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index a8ecdd344..a6603eee1 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -5,22 +5,24 @@ lookupData.hit {"exBudgetCPU":4140352,"exBudgetMemory":9090,"scriptSizeBytes":11 lookupData.miss {"exBudgetCPU":4885812,"exBudgetMemory":11122,"scriptSizeBytes":121} findWithDefault.itself {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":78} findWithDefault.hit {"exBudgetCPU":4797628,"exBudgetMemory":10354,"scriptSizeBytes":117} -findWithDefault.hit2 {"exBudgetCPU":24561167,"exBudgetMemory":58410,"scriptSizeBytes":368} +findWithDefault.hit2 {"exBudgetCPU":16610415,"exBudgetMemory":37964,"scriptSizeBytes":344} findWithDefault.miss {"exBudgetCPU":5153769,"exBudgetMemory":12022,"scriptSizeBytes":125} singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} -insert.empty {"exBudgetCPU":3131940,"exBudgetMemory":8260,"scriptSizeBytes":132} -insert.replace {"exBudgetCPU":5632407,"exBudgetMemory":12686,"scriptSizeBytes":153} -delete.empty {"exBudgetCPU":1997161,"exBudgetMemory":5864,"scriptSizeBytes":112} -delete.only {"exBudgetCPU":4616720,"exBudgetMemory":10690,"scriptSizeBytes":134} -delete.miss {"exBudgetCPU":6168321,"exBudgetMemory":14486,"scriptSizeBytes":144} -delete.new {"exBudgetCPU":12836543,"exBudgetMemory":28938,"scriptSizeBytes":184} -delete.old {"exBudgetCPU":10247892,"exBudgetMemory":23744,"scriptSizeBytes":184} -difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":156} -difference.emptyRight {"exBudgetCPU":6146958,"exBudgetMemory":15084,"scriptSizeBytes":159} -difference.emptyResult {"exBudgetCPU":9303566,"exBudgetMemory":21242,"scriptSizeBytes":173} -unionWith.const {"exBudgetCPU":21557964,"exBudgetMemory":50880,"scriptSizeBytes":344} -unionWith.double {"exBudgetCPU":21606308,"exBudgetMemory":50382,"scriptSizeBytes":340} -unionWithData.const {"exBudgetCPU":20661369,"exBudgetMemory":49284,"scriptSizeBytes":331} -unionWithData.emptyLeft {"exBudgetCPU":9901761,"exBudgetMemory":26280,"scriptSizeBytes":318} -unionWithData.emptyRight {"exBudgetCPU":12885871,"exBudgetMemory":33472,"scriptSizeBytes":318} \ No newline at end of file +insert.empty {"exBudgetCPU":3072394,"exBudgetMemory":8060,"scriptSizeBytes":157} +insert.replace {"exBudgetCPU":6215860,"exBudgetMemory":14120,"scriptSizeBytes":179} +delete.empty {"exBudgetCPU":1936480,"exBudgetMemory":6132,"scriptSizeBytes":140} +delete.only {"exBudgetCPU":5169265,"exBudgetMemory":12492,"scriptSizeBytes":163} +delete.miss {"exBudgetCPU":6161487,"exBudgetMemory":14786,"scriptSizeBytes":169} +delete.new {"exBudgetCPU":13526555,"exBudgetMemory":30904,"scriptSizeBytes":205} +delete.old {"exBudgetCPU":10735192,"exBudgetMemory":25178,"scriptSizeBytes":204} +difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":162} +difference.emptyRight {"exBudgetCPU":6655369,"exBudgetMemory":15848,"scriptSizeBytes":165} +difference.emptyResult {"exBudgetCPU":9811977,"exBudgetMemory":22006,"scriptSizeBytes":179} +unionWith.const {"exBudgetCPU":12018584,"exBudgetMemory":28002,"scriptSizeBytes":263} +unionWith.double {"exBudgetCPU":12066928,"exBudgetMemory":27504,"scriptSizeBytes":260} +unionWith.(+) {"exBudgetCPU":11404475,"exBudgetMemory":27008,"scriptSizeBytes":265} +unionWith.flip (+) {"exBudgetCPU":11404475,"exBudgetMemory":27008,"scriptSizeBytes":265} +unionWithData.const {"exBudgetCPU":11121989,"exBudgetMemory":26406,"scriptSizeBytes":249} +unionWithData.emptyLeft {"exBudgetCPU":3906038,"exBudgetMemory":10860,"scriptSizeBytes":237} +unionWithData.emptyRight {"exBudgetCPU":5786277,"exBudgetMemory":15288,"scriptSizeBytes":236} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.eval.golden b/plutarch-test/goldens/api.map.uplc.eval.golden index 0afa41904..1277a37b0 100644 --- a/plutarch-test/goldens/api.map.uplc.eval.golden +++ b/plutarch-test/goldens/api.map.uplc.eval.golden @@ -22,6 +22,8 @@ difference.emptyRight (program 1.0.0 [(#436b6579, #182a)]) difference.emptyResult (program 1.0.0 []) unionWith.const (program 1.0.0 [(#436b6579, #182a)]) unionWith.double (program 1.0.0 [(#436b6579, #1854)]) +unionWith.(+) (program 1.0.0 [(#436b6579, #182a), (#466e65776b6579, #06)]) +unionWith.flip (+) (program 1.0.0 [(#436b6579, #182a), (#466e65776b6579, #06)]) unionWithData.const (program 1.0.0 [(#436b6579, #182a)]) unionWithData.emptyLeft (program 1.0.0 [(#436b6579, #182a)]) unionWithData.emptyRight (program 1.0.0 [(#436b6579, #182a)]) \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index 2e8b2dccd..bd4e599b9 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -5,22 +5,24 @@ lookupData.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i lookupData.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData #6e6f6b6579) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) findWithDefault.itself (program 1.0.0 ((\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) (force headList))) findWithDefault.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 i2 ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) -findWithDefault.hit2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (bData i1) i2 unIData) 12 i14 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i21 i21)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i24 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i24 (mkPairData i3 i2) i4)) (i6 i1 (i17 (i18 i4)))) (i15 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i8 i1 (i8 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i22) (delay ((\i0 -> i12 (i16 (i18 i2)) (i22 (i18 i2) i1) (\i0 -> i2) i4) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i8 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i10 #6b6579 42) (i10 i14 6))) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6e65776b6579)) +findWithDefault.hit2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1) (bData i1) i2 unIData) 12 i13 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i13 i5) (i13 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i22 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i9 #6b6579 42) (i9 i13 6))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6e65776b6579)) findWithDefault.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) -insert.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i14))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i14 (i13 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i8 (mkPairData i3 i2) i1) i2) (bData i2) (iData i1)) #6b6579 42 i4) (force tailList)) (force headList)) (force mkCons)) [ ])) -insert.replace (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i13))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i11 i2)) i5) (delay (i1 (i6 (i10 i2)))) (delay (i3 (i10 i2) (\i0 -> i2 (i13 (i12 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i7 (mkPairData i3 i2) i1) i2) (bData i6) (iData i1)) 84 ((\i0 -> (\i0 -> \i0 -> i6 (mkPairData i2 i1) i7) (bData i6) (iData i1)) 42)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) -delete.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i10))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i9 i2)) i5) (delay (i1 (i6 (i8 i2)))) (delay (i3 (i8 i2) (\i0 -> i2 (force mkCons (i10 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i1) (bData i1)) #6b6579 i3) (force tailList)) (force headList)) [ ])) -delete.only (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i10))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i8 i2)) i5) (delay (i1 (i6 (i7 i2)))) (delay (i3 (i7 i2) (\i0 -> i2 (i10 (i9 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i1) (bData i5) ((\i0 -> (\i0 -> \i0 -> i6 (mkPairData i2 i1) i7) (bData i6) (iData i1)) 42)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) -delete.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i11))) (delay (\i0 -> force (force ifThenElse (equalsData (force (force fstPair) (i9 i2)) i5) (delay (i1 (i6 (i8 i2)))) (delay (i3 (i8 i2) (\i0 -> i2 (i11 (i10 i3) i1))))))))) i1 (\i0 -> i1)) (\i0 -> i1) (bData i1)) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> i7 (mkPairData i2 i1) i8) (bData i2) (iData i1)) #6b6579 42)) (force tailList)) (force headList)) (force mkCons)) [ ])) -delete.new (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i1) (bData i8) ((\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i13 (mkPairData i3 i2) i1) i2) (bData i9) (iData i1)) 6 ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i1 (i6 i15))) (delay (\i0 -> force (i9 (equalsData (i10 (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i15 (i13 i3) i1))))))))) i1 (\i0 -> i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) #6e65776b6579) (force mkCons)) [ ])) -delete.old (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i1) (bData i10) ((\i0 -> \i0 -> (\i0 -> \i0 -> i5 (\i0 -> i13 (mkPairData i3 i2) i1) i2) (bData i2) (iData i1)) #6e65776b6579 6 ((\i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i11) (iData i1)) 42))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i1 (i6 i14))) (delay (\i0 -> force (i9 (equalsData (i10 (i12 i2)) i5) (delay (i1 (i6 (i11 i2)))) (delay (i3 (i11 i2) (\i0 -> i2 (i14 (i13 i3) i1))))))))) i1 (\i0 -> i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) -difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i13 (i14 i1)) i6) (delay (i4 (force (force sndPair) (i14 i1)))) (delay (i2 (i15 i1)))))))) i1) (i7 (i8 i2)) (i10 (i8 i2) i1) (\i0 -> i2) i4) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) -difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (i8 (i9 i2)) (i11 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) -difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (i8 (i9 i2)) (i13 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i1 i21 i21)) (delay (i2 (i16 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i24 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i24 (mkPairData i3 i2) i4)) (i6 i1 (i17 (i18 i4)))) (i15 (i17 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i8 i1 (i8 i2 (i10 (\i0 -> \i0 -> force (i13 i1 (delay i22) (delay ((\i0 -> i12 (i16 (i18 i2)) (i22 (i18 i2) i1) (\i0 -> i2) i4) (i2 (i18 i1)))))) i4)))) (\i0 -> \i0 -> i8 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i21) (delay ((\i0 -> i11 (i15 (i17 i2)) (i21 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i20 i20)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i23 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i23 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i21) (delay ((\i0 -> i11 (i15 (i17 i2)) (i21 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> i2) (i10 i14 42) (i10 i14 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i15 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i18 i18)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i21 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i21 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i19) (delay ((\i0 -> i11 (i15 (i17 i2)) (i19 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> i2) i11 ((\i0 -> \i0 -> (\i0 -> \i0 -> i14 (mkPairData i2 i1) i15) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i13 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) -unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i18 i18)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (i21 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i21 (mkPairData i3 i2) i4)) (i6 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i3 (\i0 -> \i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> i7 i1 (i7 i2 (i9 (\i0 -> \i0 -> force (i12 i1 (delay i19) (delay ((\i0 -> i11 (i15 (i17 i2)) (i19 (i17 i2) i1) (\i0 -> i2) i4) (i2 (i17 i1)))))) i4)))) (\i0 -> \i0 -> i7 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i14 (mkPairData i2 i1) i15) (bData i2) (iData i1)) #6b6579 42) i11) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i3) (delay (i13 (i11 i1) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) \ No newline at end of file +insert.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i13))) (delay ((\i0 -> \i0 -> force (i10 (lessThanByteString i2 i6) (delay (i4 (i11 i3) (\i0 -> i2 (i14 (i13 i4) i1)))) (delay (force (i10 (equalsByteString i2 i6) (delay (i1 (i7 (i11 i3)))) (delay (i1 (i7 (i13 (i12 i3) (i11 i3)))))))))) (unBData (force (force fstPair) (i10 i1))))))) i1 (\i0 -> i1)) (\i0 -> i7 (mkPairData (bData i3) (iData i2)) i1) i2) #6b6579 42 i5) (force ifThenElse)) (force tailList)) (force headList)) (force mkCons)) [ ])) +insert.replace (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i12))) (delay ((\i0 -> \i0 -> force (i9 (lessThanByteString i2 i6) (delay (i4 (i10 i3) (\i0 -> i2 (i13 (i12 i4) i1)))) (delay (force (i9 (equalsByteString i2 i6) (delay (i1 (i7 (i10 i3)))) (delay (i1 (i7 (i12 (i11 i3) (i10 i3)))))))))) (unBData (force (force fstPair) (i9 i1))))))) i1 (\i0 -> i1)) (\i0 -> i6 (mkPairData (bData i8) (iData i2)) i1) i7) 84 ((\i0 -> (\i0 -> \i0 -> i7 (mkPairData i2 i1) i8) (bData i7) (iData i1)) 42)) (force ifThenElse)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) +delete.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i11))) (delay ((\i0 -> \i0 -> force (i8 (lessThanByteString i2 i6) (delay (i4 (i10 i3) (\i0 -> i2 (i10 (i12 i4) i1)))) (delay (force (i8 (equalsByteString i2 i6) (delay (i1 (i7 (i10 i3)))) (delay (i1 (i7 (i9 (i11 i3) (i10 i3)))))))))) (unBData (force (force fstPair) (i9 i1))))))) i1 (\i0 -> i1)) (\i0 -> i1) #6b6579 i5) (force ifThenElse)) (force mkCons)) (force tailList)) (force headList)) [ ])) +delete.only (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i11))) (delay ((\i0 -> \i0 -> force (i8 (lessThanByteString i2 i6) (delay (i4 (i9 i3) (\i0 -> i2 (i12 (i11 i4) i1)))) (delay (force (i8 (equalsByteString i2 i6) (delay (i1 (i7 (i9 i3)))) (delay (i1 (i7 (i11 (i10 i3) (i9 i3)))))))))) (unBData (force (force fstPair) (i8 i1))))))) i1 (\i0 -> i1)) (\i0 -> i1) i6 ((\i0 -> (\i0 -> \i0 -> i7 (mkPairData i2 i1) i8) (bData i7) (iData i1)) 42)) (force ifThenElse)) (force tailList)) (force headList)) (force mkCons)) [ ]) #6b6579)) +delete.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 (i6 i11))) (delay ((\i0 -> \i0 -> force (i8 (lessThanByteString i2 i6) (delay (i4 (i9 i3) (\i0 -> i2 (i12 (i11 i4) i1)))) (delay (force (i8 (equalsByteString i2 i6) (delay (i1 (i7 (i9 i3)))) (delay (i1 (i7 (i11 (i10 i3) (i9 i3)))))))))) (unBData (force (force fstPair) (i8 i1))))))) i1 (\i0 -> i1)) (\i0 -> i1) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> i8 (mkPairData i2 i1) i9) (bData i2) (iData i1)) #6b6579 42)) (force ifThenElse)) (force tailList)) (force headList)) (force mkCons)) [ ])) +delete.new (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i1) i8 ((\i0 -> i2 (\i0 -> i11 (mkPairData (bData i10) (iData i2)) i1) i9) 6 ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i1 (i6 i15))) (delay ((\i0 -> \i0 -> force (i10 (lessThanByteString i2 i6) (delay (i4 (i11 i3) (\i0 -> i2 (i16 (i14 i4) i1)))) (delay (force (i10 (equalsByteString i2 i6) (delay (i1 (i7 (i11 i3)))) (delay (i1 (i7 (i15 (i13 i3) (i11 i3)))))))))) (unBData (i10 (i11 i1))))))) i1 (\i0 -> i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #6e65776b6579) (force mkCons)) [ ])) +delete.old (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> i1) i10 ((\i0 -> \i0 -> i3 (\i0 -> i11 (mkPairData (bData i3) (iData i2)) i1) i2) #6e65776b6579 6 ((\i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i11) (iData i1)) 42))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i1 (i6 i14))) (delay ((\i0 -> \i0 -> force (i10 (lessThanByteString i2 i6) (delay (i4 (i11 i3) (\i0 -> i2 (i15 (i14 i4) i1)))) (delay (force (i10 (equalsByteString i2 i6) (delay (i1 (i7 (i11 i3)))) (delay (i1 (i7 (i14 (i13 i3) (i11 i3)))))))))) (unBData (i10 (i11 i1))))))) i1 (\i0 -> i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (force mkCons)) [ ]) #6b6579)) +difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (bData i1)) (unBData (i7 (i8 i2))) (i10 (i8 i2) i1) (\i0 -> i2) i4) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) +difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i15 (i16 i1)) i6) (delay (i4 (force (force sndPair) (i16 i1)))) (delay (i2 (i17 i1)))))))) i1) (bData i1)) (unBData (i8 (i9 i2))) (i11 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) +difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i15 (i16 i1)) i6) (delay (i4 (force (force sndPair) (i16 i1)))) (delay (i2 (i17 i1)))))))) i1) (bData i1)) (unBData (i8 (i9 i2))) (i13 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i13 i5) (i13 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i22 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i21 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i21 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 #6b6579 42) (i9 #6e65776b6579 6)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.flip (+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i21 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 #6e65776b6579 6) (i9 #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i21 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> i2) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i19 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> i2) i10 ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (force mkCons)) [ ])) +unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i19 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42) i10) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index cf4485b48..2164f6700 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -2,68 +2,68 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":194} -valueOf.growing.2 {"exBudgetCPU":45169030,"exBudgetMemory":109028,"scriptSizeBytes":469} -valueOf.growing.3 {"exBudgetCPU":66395986,"exBudgetMemory":160112,"scriptSizeBytes":498} -valueOf.growing.4 {"exBudgetCPU":95136623,"exBudgetMemory":227742,"scriptSizeBytes":515} -valueOf.growing.5 {"exBudgetCPU":131837536,"exBudgetMemory":313418,"scriptSizeBytes":531} -valueOf.growing.6 {"exBudgetCPU":176498725,"exBudgetMemory":417140,"scriptSizeBytes":547} -valueOf.growing.7 {"exBudgetCPU":229120190,"exBudgetMemory":538908,"scriptSizeBytes":564} -valueOf.growing.8 {"exBudgetCPU":289701931,"exBudgetMemory":678722,"scriptSizeBytes":580} -valueOf.growing.9 {"exBudgetCPU":361102826,"exBudgetMemory":841740,"scriptSizeBytes":595} -valueOf.growing.10 {"exBudgetCPU":435673744,"exBudgetMemory":1013716,"scriptSizeBytes":611} -valueOf.growing.11 {"exBudgetCPU":518204938,"exBudgetMemory":1203738,"scriptSizeBytes":627} -valueOf.growing.12 {"exBudgetCPU":608696408,"exBudgetMemory":1411806,"scriptSizeBytes":644} -valueOf.growing.13 {"exBudgetCPU":707148154,"exBudgetMemory":1637920,"scriptSizeBytes":660} -valueOf.growing.14 {"exBudgetCPU":813560176,"exBudgetMemory":1882080,"scriptSizeBytes":676} -valueOf.growing.15 {"exBudgetCPU":927932474,"exBudgetMemory":2144286,"scriptSizeBytes":693} -valueOf.growing.16 {"exBudgetCPU":1050265048,"exBudgetMemory":2424538,"scriptSizeBytes":709} -valueOf.growing.17 {"exBudgetCPU":1180557898,"exBudgetMemory":2722836,"scriptSizeBytes":726} -unionWith.const {"exBudgetCPU":43612196,"exBudgetMemory":103260,"scriptSizeBytes":428} -unionWith.(+).itself {"exBudgetCPU":1667388,"exBudgetMemory":5700,"scriptSizeBytes":341} -unionWith.(+).applied {"exBudgetCPU":43660540,"exBudgetMemory":102762,"scriptSizeBytes":425} -unionWith.tokens {"exBudgetCPU":41399459,"exBudgetMemory":99834,"scriptSizeBytes":434} -unionWith.symbols {"exBudgetCPU":23770711,"exBudgetMemory":58510,"scriptSizeBytes":426} -unionWith.growing.1 {"exBudgetCPU":23860030,"exBudgetMemory":58810,"scriptSizeBytes":430} -unionWith.growing.2 {"exBudgetCPU":60774359,"exBudgetMemory":147288,"scriptSizeBytes":461} -unionWith.growing.3 {"exBudgetCPU":87672940,"exBudgetMemory":211288,"scriptSizeBytes":481} -unionWith.growing.4 {"exBudgetCPU":122442478,"exBudgetMemory":293034,"scriptSizeBytes":497} -unionWith.growing.5 {"exBudgetCPU":165172292,"exBudgetMemory":392826,"scriptSizeBytes":513} -unionWith.growing.6 {"exBudgetCPU":215862382,"exBudgetMemory":510664,"scriptSizeBytes":530} -unionWith.growing.7 {"exBudgetCPU":274512748,"exBudgetMemory":646548,"scriptSizeBytes":546} -unionWith.growing.8 {"exBudgetCPU":341123390,"exBudgetMemory":800478,"scriptSizeBytes":562} -unionWith.growing.9 {"exBudgetCPU":433491694,"exBudgetMemory":1014378,"scriptSizeBytes":578} -unionWith.growing.10 {"exBudgetCPU":516022888,"exBudgetMemory":1204400,"scriptSizeBytes":593} -unionWith.growing.11 {"exBudgetCPU":606514358,"exBudgetMemory":1412468,"scriptSizeBytes":610} -unionWith.growing.12 {"exBudgetCPU":704966104,"exBudgetMemory":1638582,"scriptSizeBytes":626} -unionWith.growing.13 {"exBudgetCPU":811378126,"exBudgetMemory":1882742,"scriptSizeBytes":642} -unionWith.growing.14 {"exBudgetCPU":925750424,"exBudgetMemory":2144948,"scriptSizeBytes":659} -unionWith.growing.15 {"exBudgetCPU":1048082998,"exBudgetMemory":2425200,"scriptSizeBytes":675} -unionWith.growing.16 {"exBudgetCPU":1178375848,"exBudgetMemory":2723498,"scriptSizeBytes":691} -unionWith.growing.17 {"exBudgetCPU":1316628974,"exBudgetMemory":3039842,"scriptSizeBytes":708} -unionWithData const.itself {"exBudgetCPU":1667388,"exBudgetMemory":5700,"scriptSizeBytes":331} -unionWithData const.applied {"exBudgetCPU":42804920,"exBudgetMemory":101964,"scriptSizeBytes":418} +valueOf.growing.2 {"exBudgetCPU":26964346,"exBudgetMemory":63304,"scriptSizeBytes":433} +valueOf.growing.3 {"exBudgetCPU":39972593,"exBudgetMemory":93042,"scriptSizeBytes":461} +valueOf.growing.4 {"exBudgetCPU":56659253,"exBudgetMemory":129872,"scriptSizeBytes":478} +valueOf.growing.5 {"exBudgetCPU":77470921,"exBudgetMemory":175294,"scriptSizeBytes":494} +valueOf.growing.6 {"exBudgetCPU":102407597,"exBudgetMemory":229308,"scriptSizeBytes":510} +valueOf.growing.7 {"exBudgetCPU":131469281,"exBudgetMemory":291914,"scriptSizeBytes":527} +valueOf.growing.8 {"exBudgetCPU":164655973,"exBudgetMemory":363112,"scriptSizeBytes":543} +valueOf.growing.9 {"exBudgetCPU":204826551,"exBudgetMemory":448060,"scriptSizeBytes":558} +valueOf.growing.10 {"exBudgetCPU":244331884,"exBudgetMemory":532512,"scriptSizeBytes":574} +valueOf.growing.11 {"exBudgetCPU":287962225,"exBudgetMemory":625556,"scriptSizeBytes":590} +valueOf.growing.12 {"exBudgetCPU":335717574,"exBudgetMemory":727192,"scriptSizeBytes":607} +valueOf.growing.13 {"exBudgetCPU":387597931,"exBudgetMemory":837420,"scriptSizeBytes":623} +valueOf.growing.14 {"exBudgetCPU":443603296,"exBudgetMemory":956240,"scriptSizeBytes":639} +valueOf.growing.15 {"exBudgetCPU":503733669,"exBudgetMemory":1083652,"scriptSizeBytes":656} +valueOf.growing.16 {"exBudgetCPU":567989050,"exBudgetMemory":1219656,"scriptSizeBytes":672} +valueOf.growing.17 {"exBudgetCPU":636369439,"exBudgetMemory":1364252,"scriptSizeBytes":689} +unionWith.const {"exBudgetCPU":23630246,"exBudgetMemory":54504,"scriptSizeBytes":330} +unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":236} +unionWith.(+).applied {"exBudgetCPU":23678590,"exBudgetMemory":54006,"scriptSizeBytes":326} +unionWith.tokens {"exBudgetCPU":23016385,"exBudgetMemory":53510,"scriptSizeBytes":336} +unionWith.symbols {"exBudgetCPU":15194726,"exBudgetMemory":35964,"scriptSizeBytes":328} +unionWith.growing.1 {"exBudgetCPU":15284045,"exBudgetMemory":36264,"scriptSizeBytes":332} +unionWith.growing.2 {"exBudgetCPU":34172328,"exBudgetMemory":79618,"scriptSizeBytes":363} +unionWith.growing.3 {"exBudgetCPU":49016932,"exBudgetMemory":112818,"scriptSizeBytes":383} +unionWith.growing.4 {"exBudgetCPU":67897225,"exBudgetMemory":154310,"scriptSizeBytes":399} +unionWith.growing.5 {"exBudgetCPU":90902526,"exBudgetMemory":204394,"scriptSizeBytes":415} +unionWith.growing.6 {"exBudgetCPU":118032835,"exBudgetMemory":263070,"scriptSizeBytes":432} +unionWith.growing.7 {"exBudgetCPU":149288152,"exBudgetMemory":330338,"scriptSizeBytes":448} +unionWith.growing.8 {"exBudgetCPU":184668477,"exBudgetMemory":406198,"scriptSizeBytes":464} +unionWith.growing.9 {"exBudgetCPU":232163859,"exBudgetMemory":508796,"scriptSizeBytes":479} +unionWith.growing.10 {"exBudgetCPU":271669192,"exBudgetMemory":593248,"scriptSizeBytes":495} +unionWith.growing.11 {"exBudgetCPU":315299533,"exBudgetMemory":686292,"scriptSizeBytes":512} +unionWith.growing.12 {"exBudgetCPU":363054882,"exBudgetMemory":787928,"scriptSizeBytes":528} +unionWith.growing.13 {"exBudgetCPU":414935239,"exBudgetMemory":898156,"scriptSizeBytes":544} +unionWith.growing.14 {"exBudgetCPU":470940604,"exBudgetMemory":1016976,"scriptSizeBytes":561} +unionWith.growing.15 {"exBudgetCPU":531070977,"exBudgetMemory":1144388,"scriptSizeBytes":577} +unionWith.growing.16 {"exBudgetCPU":595326358,"exBudgetMemory":1280392,"scriptSizeBytes":593} +unionWith.growing.17 {"exBudgetCPU":663706747,"exBudgetMemory":1424988,"scriptSizeBytes":610} +unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":226} +unionWithData const.applied {"exBudgetCPU":22822970,"exBudgetMemory":53208,"scriptSizeBytes":319} isZero.itself {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":115} -isZero.true {"exBudgetCPU":50570501,"exBudgetMemory":119849,"scriptSizeBytes":500} +isZero.true {"exBudgetCPU":30677870,"exBudgetMemory":71393,"scriptSizeBytes":421} isZero.false {"exBudgetCPU":8700981,"exBudgetMemory":21315,"scriptSizeBytes":178} -equality.itself {"exBudgetCPU":1935345,"exBudgetMemory":6600,"scriptSizeBytes":416} -equality.triviallyTrue {"exBudgetCPU":50570501,"exBudgetMemory":119849,"scriptSizeBytes":500} -equality.triviallyFalse {"exBudgetCPU":46399408,"exBudgetMemory":112393,"scriptSizeBytes":510} -equality.swappedTokensTrue {"exBudgetCPU":143746165,"exBudgetMemory":337025,"scriptSizeBytes":553} -equality.swappedSymbolsTrue {"exBudgetCPU":129011982,"exBudgetMemory":302694,"scriptSizeBytes":544} -equality.growing.1 {"exBudgetCPU":50570501,"exBudgetMemory":119849,"scriptSizeBytes":500} -equality.growing.2 {"exBudgetCPU":143686165,"exBudgetMemory":337025,"scriptSizeBytes":548} -equality.growing.3 {"exBudgetCPU":221661051,"exBudgetMemory":518370,"scriptSizeBytes":579} -equality.growing.4 {"exBudgetCPU":319419239,"exBudgetMemory":743667,"scriptSizeBytes":610} -equality.growing.5 {"exBudgetCPU":436960729,"exBudgetMemory":1012916,"scriptSizeBytes":641} -equality.growing.6 {"exBudgetCPU":574285521,"exBudgetMemory":1326117,"scriptSizeBytes":673} -equality.growing.7 {"exBudgetCPU":731393615,"exBudgetMemory":1683270,"scriptSizeBytes":704} -equality.growing.8 {"exBudgetCPU":908285011,"exBudgetMemory":2084375,"scriptSizeBytes":735} -equality.growing.9 {"exBudgetCPU":1104959709,"exBudgetMemory":2529432,"scriptSizeBytes":766} -equality.growing.10 {"exBudgetCPU":1321417709,"exBudgetMemory":3018441,"scriptSizeBytes":798} -equality.growing.11 {"exBudgetCPU":1557659011,"exBudgetMemory":3551402,"scriptSizeBytes":829} -equality.growing.12 {"exBudgetCPU":1813683615,"exBudgetMemory":4128315,"scriptSizeBytes":860} -equality.growing.13 {"exBudgetCPU":2089491521,"exBudgetMemory":4749180,"scriptSizeBytes":891} -equality.growing.14 {"exBudgetCPU":2385082729,"exBudgetMemory":5413997,"scriptSizeBytes":923} -equality.growing.15 {"exBudgetCPU":2700457239,"exBudgetMemory":6122766,"scriptSizeBytes":954} -equality.growing.16 {"exBudgetCPU":3035615051,"exBudgetMemory":6875487,"scriptSizeBytes":985} -equality.growing.17 {"exBudgetCPU":3390556165,"exBudgetMemory":7672160,"scriptSizeBytes":1016} \ No newline at end of file +equality.itself {"exBudgetCPU":1578069,"exBudgetMemory":5400,"scriptSizeBytes":331} +equality.triviallyTrue {"exBudgetCPU":30677870,"exBudgetMemory":71393,"scriptSizeBytes":421} +equality.triviallyFalse {"exBudgetCPU":28105653,"exBudgetMemory":66369,"scriptSizeBytes":431} +equality.swappedTokensTrue {"exBudgetCPU":77320740,"exBudgetMemory":176079,"scriptSizeBytes":473} +equality.swappedSymbolsTrue {"exBudgetCPU":72413398,"exBudgetMemory":165526,"scriptSizeBytes":464} +equality.growing.1 {"exBudgetCPU":30677870,"exBudgetMemory":71393,"scriptSizeBytes":421} +equality.growing.2 {"exBudgetCPU":77290244,"exBudgetMemory":176079,"scriptSizeBytes":468} +equality.growing.3 {"exBudgetCPU":118569177,"exBudgetMemory":268712,"scriptSizeBytes":500} +equality.growing.4 {"exBudgetCPU":168098126,"exBudgetMemory":378529,"scriptSizeBytes":531} +equality.growing.5 {"exBudgetCPU":225877091,"exBudgetMemory":505530,"scriptSizeBytes":562} +equality.growing.6 {"exBudgetCPU":291906072,"exBudgetMemory":649715,"scriptSizeBytes":593} +equality.growing.7 {"exBudgetCPU":366185069,"exBudgetMemory":811084,"scriptSizeBytes":625} +equality.growing.8 {"exBudgetCPU":448714082,"exBudgetMemory":989637,"scriptSizeBytes":656} +equality.growing.9 {"exBudgetCPU":539493111,"exBudgetMemory":1185374,"scriptSizeBytes":687} +equality.growing.10 {"exBudgetCPU":638522156,"exBudgetMemory":1398295,"scriptSizeBytes":718} +equality.growing.11 {"exBudgetCPU":745801217,"exBudgetMemory":1628400,"scriptSizeBytes":750} +equality.growing.12 {"exBudgetCPU":861330294,"exBudgetMemory":1875689,"scriptSizeBytes":781} +equality.growing.13 {"exBudgetCPU":985109387,"exBudgetMemory":2140162,"scriptSizeBytes":812} +equality.growing.14 {"exBudgetCPU":1117138496,"exBudgetMemory":2421819,"scriptSizeBytes":843} +equality.growing.15 {"exBudgetCPU":1257417621,"exBudgetMemory":2720660,"scriptSizeBytes":875} +equality.growing.16 {"exBudgetCPU":1405946762,"exBudgetMemory":3036685,"scriptSizeBytes":906} +equality.growing.17 {"exBudgetCPU":1562725919,"exBudgetMemory":3369894,"scriptSizeBytes":937} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index 43ee240bf..c1105bd22 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -19,9 +19,9 @@ valueOf.growing.15 (program 1.0.0 1) valueOf.growing.16 (program 1.0.0 1) valueOf.growing.17 (program 1.0.0 1) unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) +unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) -unionWith.tokens (program 1.0.0 [(#41c0, #a249736f6d65746f6b656e014a6f74686572746f6b656e01)]) +unionWith.tokens (program 1.0.0 [(#41c0, #a24a6f74686572746f6b656e0149736f6d65746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) , (#41c7, #a149736f6d65746f6b656e01) ]) unionWith.growing.1 (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) @@ -61,91 +61,91 @@ unionWith.growing.8 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b65 , (#41c5, #a145746f6b656e01) , (#41c6, #a145746f6b656e01) , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.9 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) - , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) +unionWith.growing.9 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c1, #a145746f6b656e01) , (#41c2, #a145746f6b656e01) , (#41c3, #a145746f6b656e01) , (#41c4, #a145746f6b656e01) , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) ]) -unionWith.growing.10 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) - , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) ]) +unionWith.growing.10 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c1, #a145746f6b656e01) , (#41c2, #a145746f6b656e01) , (#41c3, #a145746f6b656e01) , (#41c4, #a145746f6b656e01) , (#41c5, #a145746f6b656e01) , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c8, #a145746f6b656e01) ]) -unionWith.growing.11 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) - , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) +unionWith.growing.11 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c1, #a145746f6b656e01) , (#41c2, #a145746f6b656e01) , (#41c3, #a145746f6b656e01) , (#41c4, #a145746f6b656e01) , (#41c5, #a145746f6b656e01) , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c8, #a145746f6b656e01) , (#41c9, #a145746f6b656e01) ]) -unionWith.growing.12 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) - , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) +unionWith.growing.12 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c1, #a145746f6b656e01) , (#41c2, #a145746f6b656e01) , (#41c3, #a145746f6b656e01) , (#41c4, #a145746f6b656e01) , (#41c5, #a145746f6b656e01) , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c8, #a145746f6b656e01) , (#41c9, #a145746f6b656e01) , (#41ca, #a145746f6b656e01) ]) -unionWith.growing.13 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) - , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) +unionWith.growing.13 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c1, #a145746f6b656e01) , (#41c2, #a145746f6b656e01) , (#41c3, #a145746f6b656e01) , (#41c4, #a145746f6b656e01) , (#41c5, #a145746f6b656e01) , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c8, #a145746f6b656e01) , (#41c9, #a145746f6b656e01) , (#41ca, #a145746f6b656e01) , (#41cb, #a145746f6b656e01) ]) -unionWith.growing.14 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) - , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) +unionWith.growing.14 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c1, #a145746f6b656e01) , (#41c2, #a145746f6b656e01) , (#41c3, #a145746f6b656e01) , (#41c4, #a145746f6b656e01) , (#41c5, #a145746f6b656e01) , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c8, #a145746f6b656e01) , (#41c9, #a145746f6b656e01) , (#41ca, #a145746f6b656e01) , (#41cb, #a145746f6b656e01) , (#41cc, #a145746f6b656e01) ]) -unionWith.growing.15 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) - , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) +unionWith.growing.15 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c1, #a145746f6b656e01) , (#41c2, #a145746f6b656e01) , (#41c3, #a145746f6b656e01) , (#41c4, #a145746f6b656e01) , (#41c5, #a145746f6b656e01) , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c8, #a145746f6b656e01) , (#41c9, #a145746f6b656e01) , (#41ca, #a145746f6b656e01) , (#41cb, #a145746f6b656e01) , (#41cc, #a145746f6b656e01) , (#41cd, #a145746f6b656e01) ]) -unionWith.growing.16 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) - , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) +unionWith.growing.16 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c1, #a145746f6b656e01) , (#41c2, #a145746f6b656e01) , (#41c3, #a145746f6b656e01) , (#41c4, #a145746f6b656e01) , (#41c5, #a145746f6b656e01) , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c8, #a145746f6b656e01) , (#41c9, #a145746f6b656e01) , (#41ca, #a145746f6b656e01) @@ -153,14 +153,14 @@ unionWith.growing.16 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b6 , (#41cc, #a145746f6b656e01) , (#41cd, #a145746f6b656e01) , (#41ce, #a145746f6b656e01) ]) -unionWith.growing.17 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b656e01) - , (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) +unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c1, #a145746f6b656e01) , (#41c2, #a145746f6b656e01) , (#41c3, #a145746f6b656e01) , (#41c4, #a145746f6b656e01) , (#41c5, #a145746f6b656e01) , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) , (#41c8, #a145746f6b656e01) , (#41c9, #a145746f6b656e01) , (#41ca, #a145746f6b656e01) @@ -169,12 +169,12 @@ unionWith.growing.17 (program 1.0.0 [ (#41c7, #a245746f6b656e0149736f6d65746f6b6 , (#41cd, #a145746f6b656e01) , (#41ce, #a145746f6b656e01) , (#41cf, #a145746f6b656e01) ]) -unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) i5 i2 i1) i2 i1)) +unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) isZero.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1)) isZero.true (program 1.0.0 True) isZero.false (program 1.0.0 False) -equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> i1 [ ] [ ])) (delay (i2 (force tailList i1) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1)) (\i0 -> \i0 -> i1 (force mkCons (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (force mkCons (mkPairData i3 i2) i4)) (i7 i1 (force (force sndPair) (force headList i4)))) (force (force fstPair) (force headList i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2)) i1 i3 (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i1 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i3) (delay (force mkCons (force headList i1) (i2 (force tailList i1)))))) i2) i2 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (force (force fstPair) (force headList i2)) (force mkCons (force headList i2) i1) (\i0 -> i2) i4) (i2 (force tailList i1)))))) i2) i4 i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3)) (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1))) +equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1))) equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) equality.swappedTokensTrue (program 1.0.0 True) diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index fe01e6e3f..1f2e89a64 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -2,68 +2,68 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i21 #736f6d65746f6b656e 1) (i15 i21 i22 1)) #c7 i22) (\i0 -> i7 (bData i1))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) -valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) (i19 #c3 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) (i19 #c3 i25 1)) (i19 #c4 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) (i19 #c3 i25 1)) (i19 #c4 i25 1)) (i19 #c5 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i25 1)) (i19 #c1 i25 1)) (i19 #c2 i25 1)) (i19 #c3 i25 1)) (i19 #c4 i25 1)) (i19 #c5 i25 1)) (i19 #c6 i25 1)) #c7 i25) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) (i19 #cc i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) (i19 #cc i26 1)) (i19 #cd i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) (i19 #cc i26 1)) (i19 #cd i26 1)) (i19 #ce i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i2 addInteger (i19 i18 #736f6d65746f6b656e 1) (i19 i18 i26 1)) (i19 #c1 i26 1)) (i19 #c2 i26 1)) (i19 #c3 i26 1)) (i19 #c4 i26 1)) (i19 #c5 i26 1)) (i19 #c6 i26 1)) (i19 i25 i26 1)) (i19 #c8 i26 1)) (i19 #c9 i26 1)) (i19 #ca i26 1)) (i19 #cb i26 1)) (i19 #cc i26 1)) (i19 #cd i26 1)) (i19 #ce i26 1)) (i19 #cf i26 1)) i25 i26) (\i0 -> i10 (bData i1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i14 i20 i21 1) (i14 i20 i21 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i18 (i19 i4)))) (i16 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay ((\i0 -> i8 (i12 (i14 i2)) (i7 (i14 i2) i1) (\i0 -> i2) i4) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 #736f6d65746f6b656e 1) (i14 i20 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 #c0 i20 1) (i14 #c7 i20 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i14 #c0 i20 1) (i14 #c7 i20 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i18 i17 i24 1) (i18 i17 #746f6b656e 1)) (i18 #c7 i24 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i25 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 #c7 i25 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 #cc i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 #cc i18 1)) (i19 #cd i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 #cc i18 1)) (i19 #cd i18 1)) (i19 #ce i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i17 i26 1) (i19 i17 i18 1)) (i19 #c1 i18 1)) (i19 #c2 i18 1)) (i19 #c3 i18 1)) (i19 #c4 i18 1)) (i19 #c5 i18 1)) (i19 #c6 i18 1)) (i19 i25 i18 1)) (i19 #c8 i18 1)) (i19 #c9 i18 1)) (i19 #ca i18 1)) (i19 #cb i18 1)) (i19 #cc i18 1)) (i19 #cd i18 1)) (i19 #ce i18 1)) (i19 #cf i18 1)) (i19 i25 i26 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i18 (i19 i4)))) (i16 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay ((\i0 -> i8 (i12 (i14 i2)) (i7 (i14 i2) i1) (\i0 -> i2) i4) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i14 i20 i21 1) (i14 i20 i21 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i19 #736f6d65746f6b656e 1) (i13 i19 i20 1)) #c7 i20) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) +valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) (i17 #c5 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) (i17 #c5 i23 1)) (i17 #c6 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) (i17 #ce i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) (i17 #ce i24 1)) (i17 #cf i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i16 #736f6d65746f6b656e 1) (i10 i16 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 i16 1) (i10 #c7 i16 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 i16 1) (i10 #c7 i16 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 i20 1) (i14 i13 #746f6b656e 1)) (i14 #c7 i20 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 #cf i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) isZero.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair)))) -isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i6 (\i0 -> i3 (unMapData (i22 i1))) i1) ((\i0 -> \i0 -> i6 (\i0 -> i3 (unIData (i22 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) (\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay True) (delay (force (i4 (i3 (i19 i1)) (delay (i2 (i20 i1)))))))))) (\i0 -> \i0 -> i14 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i12 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay (\i0 -> i1 i9 i9)) (delay (i2 (i17 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i14 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i14 (mkPairData i3 i2) i4)) (i7 i1 (i18 (i19 i4)))) (i16 (i18 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i3) (delay (i7 (i14 i1) (i2 (i15 i1)))))) i2)) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay ((\i0 -> i8 (i12 (i14 i2)) (i7 (i14 i2) i1) (\i0 -> i2) i4) (i2 (i14 i1)))))) i2)) [ ]) (force mkCons)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 #736f6d65746f6b656e 1) (i17 i23 #6f74686572746f6b656e 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i21 i27 i28 1) (i21 i27 i20 1)) (i4 addInteger (i21 i27 i20 1) (i21 i27 i28 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i21 i27 i28 1) (i21 i20 i28 1)) (i4 addInteger (i21 i20 i28 1) (i21 i27 i28 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i18 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i18 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay True) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> \i0 -> i12 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i22 i22)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i25 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i25 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i18 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i18) (delay ((\i0 -> i6 (i10 (i12 i2)) (i18 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i21 i27 i20 1) (i21 i27 i28 1)) (i4 addInteger (i21 i27 i20 1) (i21 i27 i28 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i23 i23)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i26 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i26 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i19 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i6 (i10 (i12 i2)) (i19 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i22 i21 i20 1) (i22 i21 i29 1)) (i22 i28 i29 1)) (i4 addInteger (i4 addInteger (i22 i21 i20 1) (i22 i21 i29 1)) (i22 i28 i29 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i24 i24)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i27 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i27 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i20 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i6 (i10 (i12 i2)) (i20 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c1) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i23 i21 i20 1) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i23 i21 i20 1) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i25 i25)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i28 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i28 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i21 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i21) (delay ((\i0 -> i6 (i10 (i12 i2)) (i21 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c2) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i24 i21 i20 1) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i24 i21 i20 1) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i26 i26)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i29 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i29 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i22 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i22) (delay ((\i0 -> i6 (i10 (i12 i2)) (i22 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c3) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i25 i21 i20 1) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i25 i21 i20 1) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i27 i27)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i30 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i30 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i23 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i23) (delay ((\i0 -> i6 (i10 (i12 i2)) (i23 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c4) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i26 i21 i20 1) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i26 i21 i20 1) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i28 i28)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i31 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i31 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i24 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i24) (delay ((\i0 -> i6 (i10 (i12 i2)) (i24 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c5) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i27 i21 i20 1) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i27 i21 i20 1) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i29 i29)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i32 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i32 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i25 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i25) (delay ((\i0 -> i6 (i10 (i12 i2)) (i25 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c6) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i28 i21 i20 1) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i28 i21 i20 1) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i30 i30)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i33 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i33 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i26 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i26) (delay ((\i0 -> i6 (i10 (i12 i2)) (i26 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i29 i21 i20 1) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i29 i21 i20 1) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i31 i31)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i34 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i34 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i27 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i27) (delay ((\i0 -> i6 (i10 (i12 i2)) (i27 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c8) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i30 i21 i20 1) (i30 i21 i37 1)) (i30 i22 i37 1)) (i30 i23 i37 1)) (i30 i24 i37 1)) (i30 i25 i37 1)) (i30 i26 i37 1)) (i30 i27 i37 1)) (i30 i28 i37 1)) (i30 i29 i37 1)) (i30 i36 i37 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i30 i21 i20 1) (i30 i21 i37 1)) (i30 i22 i37 1)) (i30 i23 i37 1)) (i30 i24 i37 1)) (i30 i25 i37 1)) (i30 i26 i37 1)) (i30 i27 i37 1)) (i30 i28 i37 1)) (i30 i29 i37 1)) (i30 i36 i37 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i32 i32)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i35 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i35 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i28 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i28) (delay ((\i0 -> i6 (i10 (i12 i2)) (i28 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c9) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i31 i21 i20 1) (i31 i21 i38 1)) (i31 i22 i38 1)) (i31 i23 i38 1)) (i31 i24 i38 1)) (i31 i25 i38 1)) (i31 i26 i38 1)) (i31 i27 i38 1)) (i31 i28 i38 1)) (i31 i29 i38 1)) (i31 i30 i38 1)) (i31 i37 i38 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i31 i21 i20 1) (i31 i21 i38 1)) (i31 i22 i38 1)) (i31 i23 i38 1)) (i31 i24 i38 1)) (i31 i25 i38 1)) (i31 i26 i38 1)) (i31 i27 i38 1)) (i31 i28 i38 1)) (i31 i29 i38 1)) (i31 i30 i38 1)) (i31 i37 i38 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i33 i33)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i36 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i36 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i29 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i29) (delay ((\i0 -> i6 (i10 (i12 i2)) (i29 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ca) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i32 i21 i20 1) (i32 i21 i39 1)) (i32 i22 i39 1)) (i32 i23 i39 1)) (i32 i24 i39 1)) (i32 i25 i39 1)) (i32 i26 i39 1)) (i32 i27 i39 1)) (i32 i28 i39 1)) (i32 i29 i39 1)) (i32 i30 i39 1)) (i32 i31 i39 1)) (i32 i38 i39 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i32 i21 i20 1) (i32 i21 i39 1)) (i32 i22 i39 1)) (i32 i23 i39 1)) (i32 i24 i39 1)) (i32 i25 i39 1)) (i32 i26 i39 1)) (i32 i27 i39 1)) (i32 i28 i39 1)) (i32 i29 i39 1)) (i32 i30 i39 1)) (i32 i31 i39 1)) (i32 i38 i39 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i34 i34)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i37 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i37 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i30 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i30) (delay ((\i0 -> i6 (i10 (i12 i2)) (i30 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cb) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i33 i21 i20 1) (i33 i21 i40 1)) (i33 i22 i40 1)) (i33 i23 i40 1)) (i33 i24 i40 1)) (i33 i25 i40 1)) (i33 i26 i40 1)) (i33 i27 i40 1)) (i33 i28 i40 1)) (i33 i29 i40 1)) (i33 i30 i40 1)) (i33 i31 i40 1)) (i33 i32 i40 1)) (i33 i39 i40 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i33 i21 i20 1) (i33 i21 i40 1)) (i33 i22 i40 1)) (i33 i23 i40 1)) (i33 i24 i40 1)) (i33 i25 i40 1)) (i33 i26 i40 1)) (i33 i27 i40 1)) (i33 i28 i40 1)) (i33 i29 i40 1)) (i33 i30 i40 1)) (i33 i31 i40 1)) (i33 i32 i40 1)) (i33 i39 i40 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i35 i35)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i38 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i38 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i31 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i31) (delay ((\i0 -> i6 (i10 (i12 i2)) (i31 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cc) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i34 i21 i20 1) (i34 i21 i41 1)) (i34 i22 i41 1)) (i34 i23 i41 1)) (i34 i24 i41 1)) (i34 i25 i41 1)) (i34 i26 i41 1)) (i34 i27 i41 1)) (i34 i28 i41 1)) (i34 i29 i41 1)) (i34 i30 i41 1)) (i34 i31 i41 1)) (i34 i32 i41 1)) (i34 i33 i41 1)) (i34 i40 i41 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i34 i21 i20 1) (i34 i21 i41 1)) (i34 i22 i41 1)) (i34 i23 i41 1)) (i34 i24 i41 1)) (i34 i25 i41 1)) (i34 i26 i41 1)) (i34 i27 i41 1)) (i34 i28 i41 1)) (i34 i29 i41 1)) (i34 i30 i41 1)) (i34 i31 i41 1)) (i34 i32 i41 1)) (i34 i33 i41 1)) (i34 i40 i41 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i36 i36)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i39 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i39 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i32 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i32) (delay ((\i0 -> i6 (i10 (i12 i2)) (i32 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i35 i21 i20 1) (i35 i21 i42 1)) (i35 i22 i42 1)) (i35 i23 i42 1)) (i35 i24 i42 1)) (i35 i25 i42 1)) (i35 i26 i42 1)) (i35 i27 i42 1)) (i35 i28 i42 1)) (i35 i29 i42 1)) (i35 i30 i42 1)) (i35 i31 i42 1)) (i35 i32 i42 1)) (i35 i33 i42 1)) (i35 i34 i42 1)) (i35 i41 i42 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i35 i21 i20 1) (i35 i21 i42 1)) (i35 i22 i42 1)) (i35 i23 i42 1)) (i35 i24 i42 1)) (i35 i25 i42 1)) (i35 i26 i42 1)) (i35 i27 i42 1)) (i35 i28 i42 1)) (i35 i29 i42 1)) (i35 i30 i42 1)) (i35 i31 i42 1)) (i35 i32 i42 1)) (i35 i33 i42 1)) (i35 i34 i42 1)) (i35 i41 i42 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i37 i37)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i40 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i40 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i33 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i33) (delay ((\i0 -> i6 (i10 (i12 i2)) (i33 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i21 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i21 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i4 subtractInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i36 i21 i20 1) (i36 i21 i43 1)) (i36 i22 i43 1)) (i36 i23 i43 1)) (i36 i24 i43 1)) (i36 i25 i43 1)) (i36 i26 i43 1)) (i36 i27 i43 1)) (i36 i28 i43 1)) (i36 i29 i43 1)) (i36 i30 i43 1)) (i36 i31 i43 1)) (i36 i32 i43 1)) (i36 i33 i43 1)) (i36 i34 i43 1)) (i36 i35 i43 1)) (i36 i42 i43 1)) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i36 i21 i20 1) (i36 i21 i43 1)) (i36 i22 i43 1)) (i36 i23 i43 1)) (i36 i24 i43 1)) (i36 i25 i43 1)) (i36 i26 i43 1)) (i36 i27 i43 1)) (i36 i28 i43 1)) (i36 i29 i43 1)) (i36 i30 i43 1)) (i36 i31 i43 1)) (i36 i32 i43 1)) (i36 i33 i43 1)) (i36 i34 i43 1)) (i36 i35 i43 1)) (i36 i42 i43 1)))) (\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay True) (delay (force (i4 (i3 (i20 i1)) (delay (i2 (i21 i1)))))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> i5 i1 i3 (\i0 -> \i0 -> i9 i1 (i9 i2 (i10 i4 i1)))) (\i0 -> \i0 -> i10 i2 (\i0 -> \i0 -> i2 i3) (\i0 -> \i0 -> \i0 -> i1 (i8 i4 i3)) i3))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i1 i38 i38)) (delay (i2 (i15 i1) (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> i1 (i41 (mkPairData i3 i2) i5) i4) (\i0 -> \i0 -> i1 i5 (i41 (mkPairData i3 i2) i4)) (i7 i1 (i16 (i17 i4)))) (i14 (i16 i3))))))) i1 (\i0 -> \i0 -> \i0 -> i1 i3 i2))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> i4 i1) (\i0 -> i3 i1))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i3) (delay (i34 (i12 i1) (i2 (i13 i1)))))) i2)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay i34) (delay ((\i0 -> i6 (i10 (i12 i2)) (i34 (i12 i2) i1) (\i0 -> i2) i4) (i2 (i12 i1)))))) i2)) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) \ No newline at end of file +equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i6 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i6 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) +equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 #736f6d65746f6b656e 1) (i14 i20 #6f74686572746f6b656e 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i18 i24 i25 1) (i18 i24 i17 1)) (i5 addInteger (i18 i24 i17 1) (i18 i24 i25 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i18 i24 i25 1) (i18 i17 i25 1)) (i5 addInteger (i18 i17 i25 1) (i18 i24 i25 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i18 i24 i17 1) (i18 i24 i25 1)) (i5 addInteger (i18 i24 i17 1) (i18 i24 i25 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i19 i18 i17 1) (i19 i18 i26 1)) (i19 i25 i26 1)) (i5 addInteger (i5 addInteger (i19 i18 i17 1) (i19 i18 i26 1)) (i19 i25 i26 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c1) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i20 i18 i17 1) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i20 i18 i17 1) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c2) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i21 i18 i17 1) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i21 i18 i17 1) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c3) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i22 i18 i17 1) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i22 i18 i17 1) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c4) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i23 i18 i17 1) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i23 i18 i17 1) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c5) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i24 i18 i17 1) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i24 i18 i17 1) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c6) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i25 i18 i17 1) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i25 i18 i17 1) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i26 i18 i17 1) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i26 i18 i17 1) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c8) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i27 i18 i17 1) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i27 i18 i17 1) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c9) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i28 i18 i17 1) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i28 i18 i17 1) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ca) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i29 i18 i17 1) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i29 i18 i17 1) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cb) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i30 i18 i17 1) (i30 i18 i37 1)) (i30 i19 i37 1)) (i30 i20 i37 1)) (i30 i21 i37 1)) (i30 i22 i37 1)) (i30 i23 i37 1)) (i30 i24 i37 1)) (i30 i25 i37 1)) (i30 i26 i37 1)) (i30 i27 i37 1)) (i30 i28 i37 1)) (i30 i29 i37 1)) (i30 i36 i37 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i30 i18 i17 1) (i30 i18 i37 1)) (i30 i19 i37 1)) (i30 i20 i37 1)) (i30 i21 i37 1)) (i30 i22 i37 1)) (i30 i23 i37 1)) (i30 i24 i37 1)) (i30 i25 i37 1)) (i30 i26 i37 1)) (i30 i27 i37 1)) (i30 i28 i37 1)) (i30 i29 i37 1)) (i30 i36 i37 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cc) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i31 i18 i17 1) (i31 i18 i38 1)) (i31 i19 i38 1)) (i31 i20 i38 1)) (i31 i21 i38 1)) (i31 i22 i38 1)) (i31 i23 i38 1)) (i31 i24 i38 1)) (i31 i25 i38 1)) (i31 i26 i38 1)) (i31 i27 i38 1)) (i31 i28 i38 1)) (i31 i29 i38 1)) (i31 i30 i38 1)) (i31 i37 i38 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i31 i18 i17 1) (i31 i18 i38 1)) (i31 i19 i38 1)) (i31 i20 i38 1)) (i31 i21 i38 1)) (i31 i22 i38 1)) (i31 i23 i38 1)) (i31 i24 i38 1)) (i31 i25 i38 1)) (i31 i26 i38 1)) (i31 i27 i38 1)) (i31 i28 i38 1)) (i31 i29 i38 1)) (i31 i30 i38 1)) (i31 i37 i38 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i32 i18 i17 1) (i32 i18 i39 1)) (i32 i19 i39 1)) (i32 i20 i39 1)) (i32 i21 i39 1)) (i32 i22 i39 1)) (i32 i23 i39 1)) (i32 i24 i39 1)) (i32 i25 i39 1)) (i32 i26 i39 1)) (i32 i27 i39 1)) (i32 i28 i39 1)) (i32 i29 i39 1)) (i32 i30 i39 1)) (i32 i31 i39 1)) (i32 i38 i39 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i32 i18 i17 1) (i32 i18 i39 1)) (i32 i19 i39 1)) (i32 i20 i39 1)) (i32 i21 i39 1)) (i32 i22 i39 1)) (i32 i23 i39 1)) (i32 i24 i39 1)) (i32 i25 i39 1)) (i32 i26 i39 1)) (i32 i27 i39 1)) (i32 i28 i39 1)) (i32 i29 i39 1)) (i32 i30 i39 1)) (i32 i31 i39 1)) (i32 i38 i39 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i33 i18 i17 1) (i33 i18 i40 1)) (i33 i19 i40 1)) (i33 i20 i40 1)) (i33 i21 i40 1)) (i33 i22 i40 1)) (i33 i23 i40 1)) (i33 i24 i40 1)) (i33 i25 i40 1)) (i33 i26 i40 1)) (i33 i27 i40 1)) (i33 i28 i40 1)) (i33 i29 i40 1)) (i33 i30 i40 1)) (i33 i31 i40 1)) (i33 i32 i40 1)) (i33 i39 i40 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i33 i18 i17 1) (i33 i18 i40 1)) (i33 i19 i40 1)) (i33 i20 i40 1)) (i33 i21 i40 1)) (i33 i22 i40 1)) (i33 i23 i40 1)) (i33 i24 i40 1)) (i33 i25 i40 1)) (i33 i26 i40 1)) (i33 i27 i40 1)) (i33 i28 i40 1)) (i33 i29 i40 1)) (i33 i30 i40 1)) (i33 i31 i40 1)) (i33 i32 i40 1)) (i33 i39 i40 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index d9ba7d6f3..8c5b7fde3 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -70,7 +70,7 @@ spec = do pmintOtherSymbol = PValue.singleton # pconstant "c7" # pconstant "sometoken" # 1 growingSymbols, symbols :: [ClosedTerm PValue] growingSymbols = scanl (\s v -> PValue.unionWith # plam (+) # s # v) pmint symbols - symbols = toSymbolicValue <$> [0..15] + symbols = toSymbolicValue <$> [0 .. 15] toSymbolicValue :: Integer -> ClosedTerm PValue toSymbolicValue n = PValue.singleton # pconstant (fromString $ "c" <> showHex n "") # pconstant "token" # 1 @@ -80,11 +80,13 @@ spec = do "itself" @| PValue.valueOf @-> \v -> plift (v # pmint # pconstant "c0" # pconstant "sometoken") @?= 1 "applied" @| PValue.valueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> plift p @?= 1 - "growing" @\ - forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) - (\(size, v) -> - fromString (show size) - @| PValue.valueOf # v # pconstant "c7" # pconstant "token" @-> \p -> plift p @?= if size < 9 then 0 else 1) + "growing" + @\ forM_ + (zip [1 :: Int .. length growingSymbols] growingSymbols) + ( \(size, v) -> + fromString (show size) + @| PValue.valueOf # v # pconstant "c7" # pconstant "token" @-> \p -> plift p @?= if size < 9 then 0 else 1 + ) "unionWith" @\ do "const" @| PValue.unionWith # plam const # pmint # pmint @-> \p -> plift p @?= mint @@ -97,11 +99,13 @@ spec = do plift p @?= mint <> mintOtherToken "symbols" @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> plift p @?= mint <> mintOtherSymbol - "growing" @\ - forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) - (\(size, v) -> - fromString (show size) @| PValue.unionWith # plam const # v # pmintOtherSymbol - @-> \v' -> passert (v' #== PValue.unionWith # plam const # pmintOtherSymbol # v)) + "growing" + @\ forM_ + (zip [1 :: Int .. length growingSymbols] growingSymbols) + ( \(size, v) -> + fromString (show size) @| PValue.unionWith # plam const # v # pmintOtherSymbol + @-> \v' -> passert (v' #== PValue.unionWith # plam const # pmintOtherSymbol # v) + ) "unionWithData const" @\ do "itself" @| PValue.unionWithData @-> \u -> plift (u # plam const # pmint # pmint) @?= mint @@ -123,9 +127,10 @@ spec = do @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol #== PValue.unionWith # plam (+) # pmintOtherSymbol # pmint @-> passert - "growing" @\ - forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) - (\(size, v) -> fromString (show size) @| v #== v @-> passert) + "growing" + @\ forM_ + (zip [1 :: Int .. length growingSymbols] growingSymbols) + (\(size, v) -> fromString (show size) @| v #== v @-> passert) describe "map" $ do pgoldenSpec $ do let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap PByteString PInteger) @@ -178,6 +183,12 @@ spec = do "unionWith" @\ do "const" @| AssocMap.unionWith # plam const # pmap # pmap @-> pshouldReallyBe pmap "double" @| AssocMap.unionWith # plam (+) # pmap # pmap @-> pshouldReallyBe doubleMap + "(+)" + @| AssocMap.unionWith # plam (+) # pmap # otherMap + @-> \p -> passert (p #== AssocMap.unionWith # plam (+) # otherMap # pmap) + "flip (+)" + @| AssocMap.unionWith # plam (+) # otherMap # pmap + @-> \p -> passert (p #== AssocMap.unionWith # plam (+) # pmap # otherMap) "unionWithData" @\ do "const" @| AssocMap.unionWithData # plam const # pmap # pmap @-> pshouldReallyBe pmap "emptyLeft" @| AssocMap.unionWithData # plam const # emptyMap # pmap @-> pshouldReallyBe pmap From fd1677b22a1fafb3140b8452723daf384948101c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 21 Apr 2022 15:46:59 -0400 Subject: [PATCH 419/584] Added Value.normalize and AssocMap.filter/mapMaybe/null --- Plutarch/Api/V1/AssocMap.hs | 42 +++++++++++++++++++++++++++++++++++-- Plutarch/Api/V1/Value.hs | 24 +++++++++++++++++++-- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 2057af423..0652b98ed 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -18,11 +18,15 @@ module Plutarch.Api.V1.AssocMap ( lookupData, findWithDefault, foldAt, + null, -- * Folds all, - -- * Traversals + -- * Filters and traversals + filter, + mapMaybe, + mapMaybeData, mapEitherWithKey, mapEitherWithKeyData, @@ -72,6 +76,7 @@ import Plutarch.Prelude ( pif, plam, plet, + pnull, precList, psndBuiltin, pto, @@ -85,7 +90,7 @@ import Plutarch.Unsafe (punsafeFrom) import qualified Rank2.TH -import Prelude hiding (all, lookup) +import Prelude hiding (all, filter, lookup, null) newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) deriving (PlutusType, PIsData, PEq, PShow) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) @@ -115,6 +120,9 @@ instance y' <- Plutus.fromData y Just (x', y') +null :: Term s (PMap k v :--> PBool) +null = plam (\map -> pnull # pto map) + -- | Look up the given key in a 'PMap'. lookup :: (PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMaybe v) lookup = phoistAcyclic $ @@ -340,6 +348,36 @@ all = phoistAcyclic $ plam $ \pred map -> pall # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map +filter :: (PIsData k, PIsData a) => Term (s :: S) ((a :--> PBool) :--> PMap k a :--> PMap k a) +filter = phoistAcyclic $ + plam $ \pred -> + mapMaybe #$ plam $ \v -> pif (pred # v) (pcon $ PJust v) (pcon PNothing) + +mapMaybe :: + (PIsData k, PIsData a, PIsData b) => + Term (s :: S) ((a :--> PMaybe b) :--> PMap k a :--> PMap k b) +mapMaybe = phoistAcyclic $ + plam $ \f -> mapMaybeData #$ plam $ \v -> pmatch (f # pfromData v) $ \case + PNothing -> pcon PNothing + PJust v' -> pcon $ PJust (pdata v') + +mapMaybeData :: + forall s k a b. + (PIsData k, PIsData a, PIsData b) => + Term (s :: S) ((PAsData a :--> PMaybe (PAsData b)) :--> PMap k a :--> PMap k b) +mapMaybeData = phoistAcyclic $ + plam $ \f map -> + pcon . PMap $ + precList + ( \self x xs -> + plet (self # xs) $ \xs' -> + pmatch (f #$ psndBuiltin # x) $ \case + PNothing -> xs' + PJust v -> pcons # (ppairDataBuiltin # (pfstBuiltin # x) # v) # xs' + ) + (const pnil) + # pto map + -- | Map keys/values and separate the @Left@ and @Right@ results. mapEitherWithKey :: (PIsData k, PIsData a, PIsData b, PIsData c) => diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index b317a68e8..388d15ba3 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -10,6 +10,7 @@ module Plutarch.Api.V1.Value ( unionWith, unionWithData, valueOf, + normalize, ) where import qualified Plutus.V1.Ledger.Api as Plutus @@ -82,7 +83,7 @@ isZero = phoistAcyclic $ {- | Combine two 'PValue's applying the given function to any pair of quantities with the same asset class. Note that the result is _not_ - normalized and may contain zero quantities. + 'normalize'd and may contain zero quantities. -} unionWith :: Term (s :: S) ((PInteger :--> PInteger :--> PInteger) :--> PValue :--> PValue :--> PValue) unionWith = phoistAcyclic $ @@ -95,7 +96,7 @@ unionWith = phoistAcyclic $ {- | Combine two 'PValue's applying the given function to any pair of data-encoded quantities with the same asset class. Note that the result is - _not_ normalized and may contain zero quantities. + _not_ 'normalize'd and may contain zero quantities. -} unionWithData :: Term @@ -112,3 +113,22 @@ unionWithData = phoistAcyclic $ # (plam $ \x y -> AssocMap.unionWithData # combine # x # y) # pto x # pto y + +-- | Normalize the argument to contain no zero quantity nor empty token map. +normalize :: Term s (PValue :--> PValue) +normalize = phoistAcyclic $ + plam $ \value -> + pcon . PValue $ + AssocMap.mapMaybe # plam normalizeTokenMap # pto value + where + normalizeTokenMap tokenMap = + plet (AssocMap.mapMaybeData # plam nonZero # tokenMap) $ \normalMap -> + pif + (AssocMap.null # normalMap) + (pcon PNothing) + (pcon $ PJust normalMap) + nonZero intData = + pif (intData #== zeroData) (pcon PNothing) (pcon $ PJust intData) + +zeroData :: ClosedTerm (PAsData PInteger) +zeroData = pdata 0 From a2a59539a1a931d8c1852f32476b82127a5d75c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 21 Apr 2022 15:54:32 -0400 Subject: [PATCH 420/584] Switched the equality to the quicker implementation --- Plutarch/Api/V1/Value.hs | 3 +- plutarch-test/goldens/api.value.bench.golden | 44 +++++++++---------- .../goldens/api.value.uplc.eval.golden | 2 +- plutarch-test/goldens/api.value.uplc.golden | 44 +++++++++---------- 4 files changed, 47 insertions(+), 46 deletions(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 388d15ba3..fd2a30b37 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -57,8 +57,9 @@ deriving via instance PConstantDecl Plutus.Value +-- | Works correctly only on 'normalize'd values! instance PEq PValue where - a #== b = isZero #$ unionWith # plam (-) # a # b + a #== b = pto a #== pto b -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. singleton :: Term (s :: S) (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue) diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index 2164f6700..2c1422500 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -45,25 +45,25 @@ unionWithData const.applied {"exBudgetCPU":22822970,"exBudgetMemory":53208,"scri isZero.itself {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":115} isZero.true {"exBudgetCPU":30677870,"exBudgetMemory":71393,"scriptSizeBytes":421} isZero.false {"exBudgetCPU":8700981,"exBudgetMemory":21315,"scriptSizeBytes":178} -equality.itself {"exBudgetCPU":1578069,"exBudgetMemory":5400,"scriptSizeBytes":331} -equality.triviallyTrue {"exBudgetCPU":30677870,"exBudgetMemory":71393,"scriptSizeBytes":421} -equality.triviallyFalse {"exBudgetCPU":28105653,"exBudgetMemory":66369,"scriptSizeBytes":431} -equality.swappedTokensTrue {"exBudgetCPU":77320740,"exBudgetMemory":176079,"scriptSizeBytes":473} -equality.swappedSymbolsTrue {"exBudgetCPU":72413398,"exBudgetMemory":165526,"scriptSizeBytes":464} -equality.growing.1 {"exBudgetCPU":30677870,"exBudgetMemory":71393,"scriptSizeBytes":421} -equality.growing.2 {"exBudgetCPU":77290244,"exBudgetMemory":176079,"scriptSizeBytes":468} -equality.growing.3 {"exBudgetCPU":118569177,"exBudgetMemory":268712,"scriptSizeBytes":500} -equality.growing.4 {"exBudgetCPU":168098126,"exBudgetMemory":378529,"scriptSizeBytes":531} -equality.growing.5 {"exBudgetCPU":225877091,"exBudgetMemory":505530,"scriptSizeBytes":562} -equality.growing.6 {"exBudgetCPU":291906072,"exBudgetMemory":649715,"scriptSizeBytes":593} -equality.growing.7 {"exBudgetCPU":366185069,"exBudgetMemory":811084,"scriptSizeBytes":625} -equality.growing.8 {"exBudgetCPU":448714082,"exBudgetMemory":989637,"scriptSizeBytes":656} -equality.growing.9 {"exBudgetCPU":539493111,"exBudgetMemory":1185374,"scriptSizeBytes":687} -equality.growing.10 {"exBudgetCPU":638522156,"exBudgetMemory":1398295,"scriptSizeBytes":718} -equality.growing.11 {"exBudgetCPU":745801217,"exBudgetMemory":1628400,"scriptSizeBytes":750} -equality.growing.12 {"exBudgetCPU":861330294,"exBudgetMemory":1875689,"scriptSizeBytes":781} -equality.growing.13 {"exBudgetCPU":985109387,"exBudgetMemory":2140162,"scriptSizeBytes":812} -equality.growing.14 {"exBudgetCPU":1117138496,"exBudgetMemory":2421819,"scriptSizeBytes":843} -equality.growing.15 {"exBudgetCPU":1257417621,"exBudgetMemory":2720660,"scriptSizeBytes":875} -equality.growing.16 {"exBudgetCPU":1405946762,"exBudgetMemory":3036685,"scriptSizeBytes":906} -equality.growing.17 {"exBudgetCPU":1562725919,"exBudgetMemory":3369894,"scriptSizeBytes":937} \ No newline at end of file +equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} +equality.triviallyTrue {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} +equality.triviallyFalse {"exBudgetCPU":11575395,"exBudgetMemory":25036,"scriptSizeBytes":222} +equality.swappedTokensTrue {"exBudgetCPU":51124512,"exBudgetMemory":115372,"scriptSizeBytes":471} +equality.swappedSymbolsTrue {"exBudgetCPU":39904171,"exBudgetMemory":88168,"scriptSizeBytes":462} +equality.growing.1 {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} +equality.growing.2 {"exBudgetCPU":51094016,"exBudgetMemory":115372,"scriptSizeBytes":466} +equality.growing.3 {"exBudgetCPU":77145504,"exBudgetMemory":172776,"scriptSizeBytes":497} +equality.growing.4 {"exBudgetCPU":111447008,"exBudgetMemory":247364,"scriptSizeBytes":529} +equality.growing.5 {"exBudgetCPU":153998528,"exBudgetMemory":339136,"scriptSizeBytes":560} +equality.growing.6 {"exBudgetCPU":204800064,"exBudgetMemory":448092,"scriptSizeBytes":591} +equality.growing.7 {"exBudgetCPU":263851616,"exBudgetMemory":574232,"scriptSizeBytes":622} +equality.growing.8 {"exBudgetCPU":331153184,"exBudgetMemory":717556,"scriptSizeBytes":654} +equality.growing.9 {"exBudgetCPU":406704768,"exBudgetMemory":878064,"scriptSizeBytes":685} +equality.growing.10 {"exBudgetCPU":490506368,"exBudgetMemory":1055756,"scriptSizeBytes":716} +equality.growing.11 {"exBudgetCPU":582557984,"exBudgetMemory":1250632,"scriptSizeBytes":747} +equality.growing.12 {"exBudgetCPU":682859616,"exBudgetMemory":1462692,"scriptSizeBytes":779} +equality.growing.13 {"exBudgetCPU":791411264,"exBudgetMemory":1691936,"scriptSizeBytes":810} +equality.growing.14 {"exBudgetCPU":908212928,"exBudgetMemory":1938364,"scriptSizeBytes":841} +equality.growing.15 {"exBudgetCPU":1033264608,"exBudgetMemory":2201976,"scriptSizeBytes":872} +equality.growing.16 {"exBudgetCPU":1166566304,"exBudgetMemory":2482772,"scriptSizeBytes":904} +equality.growing.17 {"exBudgetCPU":1308118016,"exBudgetMemory":2780752,"scriptSizeBytes":935} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index c1105bd22..a636249f2 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -174,7 +174,7 @@ unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) isZero.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1)) isZero.true (program 1.0.0 True) isZero.false (program 1.0.0 False) -equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1))) +equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) equality.swappedTokensTrue (program 1.0.0 True) diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index 1f2e89a64..a2fd3aac2 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -45,25 +45,25 @@ unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 isZero.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair)))) isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i6 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i6 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) -equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 #736f6d65746f6b656e 1) (i14 i20 #6f74686572746f6b656e 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i18 i24 i25 1) (i18 i24 i17 1)) (i5 addInteger (i18 i24 i17 1) (i18 i24 i25 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i18 i24 i25 1) (i18 i17 i25 1)) (i5 addInteger (i18 i17 i25 1) (i18 i24 i25 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i18 i24 i17 1) (i18 i24 i25 1)) (i5 addInteger (i18 i24 i17 1) (i18 i24 i25 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i19 i18 i17 1) (i19 i18 i26 1)) (i19 i25 i26 1)) (i5 addInteger (i5 addInteger (i19 i18 i17 1) (i19 i18 i26 1)) (i19 i25 i26 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c1) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i20 i18 i17 1) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i20 i18 i17 1) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c2) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i21 i18 i17 1) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i21 i18 i17 1) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c3) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i22 i18 i17 1) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i22 i18 i17 1) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c4) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i23 i18 i17 1) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i23 i18 i17 1) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c5) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i24 i18 i17 1) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i24 i18 i17 1) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c6) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i25 i18 i17 1) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i25 i18 i17 1) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i26 i18 i17 1) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i26 i18 i17 1) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c8) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i27 i18 i17 1) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i27 i18 i17 1) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c9) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i28 i18 i17 1) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i28 i18 i17 1) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ca) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i29 i18 i17 1) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i29 i18 i17 1) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cb) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i30 i18 i17 1) (i30 i18 i37 1)) (i30 i19 i37 1)) (i30 i20 i37 1)) (i30 i21 i37 1)) (i30 i22 i37 1)) (i30 i23 i37 1)) (i30 i24 i37 1)) (i30 i25 i37 1)) (i30 i26 i37 1)) (i30 i27 i37 1)) (i30 i28 i37 1)) (i30 i29 i37 1)) (i30 i36 i37 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i30 i18 i17 1) (i30 i18 i37 1)) (i30 i19 i37 1)) (i30 i20 i37 1)) (i30 i21 i37 1)) (i30 i22 i37 1)) (i30 i23 i37 1)) (i30 i24 i37 1)) (i30 i25 i37 1)) (i30 i26 i37 1)) (i30 i27 i37 1)) (i30 i28 i37 1)) (i30 i29 i37 1)) (i30 i36 i37 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cc) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i31 i18 i17 1) (i31 i18 i38 1)) (i31 i19 i38 1)) (i31 i20 i38 1)) (i31 i21 i38 1)) (i31 i22 i38 1)) (i31 i23 i38 1)) (i31 i24 i38 1)) (i31 i25 i38 1)) (i31 i26 i38 1)) (i31 i27 i38 1)) (i31 i28 i38 1)) (i31 i29 i38 1)) (i31 i30 i38 1)) (i31 i37 i38 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i31 i18 i17 1) (i31 i18 i38 1)) (i31 i19 i38 1)) (i31 i20 i38 1)) (i31 i21 i38 1)) (i31 i22 i38 1)) (i31 i23 i38 1)) (i31 i24 i38 1)) (i31 i25 i38 1)) (i31 i26 i38 1)) (i31 i27 i38 1)) (i31 i28 i38 1)) (i31 i29 i38 1)) (i31 i30 i38 1)) (i31 i37 i38 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i32 i18 i17 1) (i32 i18 i39 1)) (i32 i19 i39 1)) (i32 i20 i39 1)) (i32 i21 i39 1)) (i32 i22 i39 1)) (i32 i23 i39 1)) (i32 i24 i39 1)) (i32 i25 i39 1)) (i32 i26 i39 1)) (i32 i27 i39 1)) (i32 i28 i39 1)) (i32 i29 i39 1)) (i32 i30 i39 1)) (i32 i31 i39 1)) (i32 i38 i39 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i32 i18 i17 1) (i32 i18 i39 1)) (i32 i19 i39 1)) (i32 i20 i39 1)) (i32 i21 i39 1)) (i32 i22 i39 1)) (i32 i23 i39 1)) (i32 i24 i39 1)) (i32 i25 i39 1)) (i32 i26 i39 1)) (i32 i27 i39 1)) (i32 i28 i39 1)) (i32 i29 i39 1)) (i32 i30 i39 1)) (i32 i31 i39 1)) (i32 i38 i39 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (i5 subtractInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i33 i18 i17 1) (i33 i18 i40 1)) (i33 i19 i40 1)) (i33 i20 i40 1)) (i33 i21 i40 1)) (i33 i22 i40 1)) (i33 i23 i40 1)) (i33 i24 i40 1)) (i33 i25 i40 1)) (i33 i26 i40 1)) (i33 i27 i40 1)) (i33 i28 i40 1)) (i33 i29 i40 1)) (i33 i30 i40 1)) (i33 i31 i40 1)) (i33 i32 i40 1)) (i33 i39 i40 1)) (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i5 addInteger (i33 i18 i17 1) (i33 i18 i40 1)) (i33 i19 i40 1)) (i33 i20 i40 1)) (i33 i21 i40 1)) (i33 i22 i40 1)) (i33 i23 i40 1)) (i33 i24 i40 1)) (i33 i25 i40 1)) (i33 i26 i40 1)) (i33 i27 i40 1)) (i33 i28 i40 1)) (i33 i29 i40 1)) (i33 i30 i40 1)) (i33 i31 i40 1)) (i33 i32 i40 1)) (i33 i39 i40 1)))) (\i0 -> i2 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i5 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) \ No newline at end of file +equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) +equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 #736f6d65746f6b656e 1) (i7 i13 #6f74686572746f6b656e 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i21 1) (i14 i20 i13 1)) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i21 1) (i14 i13 i21 1)) (i1 addInteger (i14 i13 i21 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1)) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 i13 1) (i15 i14 i22 1)) (i15 i21 i22 1)) (i1 addInteger (i1 addInteger (i15 i14 i13 1) (i15 i14 i22 1)) (i15 i21 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c1) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 i13 1) (i16 i14 i23 1)) (i16 i15 i23 1)) (i16 i22 i23 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 i13 1) (i16 i14 i23 1)) (i16 i15 i23 1)) (i16 i22 i23 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c2) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 i13 1) (i17 i14 i24 1)) (i17 i15 i24 1)) (i17 i16 i24 1)) (i17 i23 i24 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 i13 1) (i17 i14 i24 1)) (i17 i15 i24 1)) (i17 i16 i24 1)) (i17 i23 i24 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c3) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 i13 1) (i18 i14 i25 1)) (i18 i15 i25 1)) (i18 i16 i25 1)) (i18 i17 i25 1)) (i18 i24 i25 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 i13 1) (i18 i14 i25 1)) (i18 i15 i25 1)) (i18 i16 i25 1)) (i18 i17 i25 1)) (i18 i24 i25 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c4) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 i13 1) (i19 i14 i26 1)) (i19 i15 i26 1)) (i19 i16 i26 1)) (i19 i17 i26 1)) (i19 i18 i26 1)) (i19 i25 i26 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 i13 1) (i19 i14 i26 1)) (i19 i15 i26 1)) (i19 i16 i26 1)) (i19 i17 i26 1)) (i19 i18 i26 1)) (i19 i25 i26 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c5) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 i13 1) (i20 i14 i27 1)) (i20 i15 i27 1)) (i20 i16 i27 1)) (i20 i17 i27 1)) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 i13 1) (i20 i14 i27 1)) (i20 i15 i27 1)) (i20 i16 i27 1)) (i20 i17 i27 1)) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c6) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 i13 1) (i21 i14 i28 1)) (i21 i15 i28 1)) (i21 i16 i28 1)) (i21 i17 i28 1)) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 i13 1) (i21 i14 i28 1)) (i21 i15 i28 1)) (i21 i16 i28 1)) (i21 i17 i28 1)) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 i13 1) (i22 i14 i29 1)) (i22 i15 i29 1)) (i22 i16 i29 1)) (i22 i17 i29 1)) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 i13 1) (i22 i14 i29 1)) (i22 i15 i29 1)) (i22 i16 i29 1)) (i22 i17 i29 1)) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c8) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 i13 1) (i23 i14 i30 1)) (i23 i15 i30 1)) (i23 i16 i30 1)) (i23 i17 i30 1)) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 i13 1) (i23 i14 i30 1)) (i23 i15 i30 1)) (i23 i16 i30 1)) (i23 i17 i30 1)) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c9) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 i13 1) (i24 i14 i31 1)) (i24 i15 i31 1)) (i24 i16 i31 1)) (i24 i17 i31 1)) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 i13 1) (i24 i14 i31 1)) (i24 i15 i31 1)) (i24 i16 i31 1)) (i24 i17 i31 1)) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ca) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 i13 1) (i25 i14 i32 1)) (i25 i15 i32 1)) (i25 i16 i32 1)) (i25 i17 i32 1)) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 i13 1) (i25 i14 i32 1)) (i25 i15 i32 1)) (i25 i16 i32 1)) (i25 i17 i32 1)) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cb) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cc) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) \ No newline at end of file From 68bfa7173bdde26d472f6d8db2d3fd8007859f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 21 Apr 2022 16:02:00 -0400 Subject: [PATCH 421/584] Added Semigroup instances --- Plutarch/Api/V1/AssocMap.hs | 3 +++ Plutarch/Api/V1/Value.hs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 0652b98ed..863866705 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -262,6 +262,9 @@ type instance $(Rank2.TH.deriveAll ''MapUnion) +instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap k v)) where + a <> b = unionWith # plam (<>) # a # b + {- | Combine two 'PMap's applying the given function to any two values that share the same key. -} diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index fd2a30b37..87f9e47a0 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -61,6 +61,9 @@ deriving via instance PEq PValue where a #== b = pto a #== pto b +instance Semigroup (Term s PValue) where + a <> b = unionWith # plam (+) # a # b + -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. singleton :: Term (s :: S) (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue) singleton = phoistAcyclic $ From 97799687c1970f3d18d2c754c7a71bd77d76c504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 21 Apr 2022 16:36:28 -0400 Subject: [PATCH 422/584] Fixed tests with GHC 8.10 --- Plutarch/Api/V1/AssocMap.hs | 4 +++ Plutarch/Api/V1/Value.hs | 2 +- .../plutarch-base/Plutarch/ApiSpec.hs | 26 ++++++++++++------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 863866705..9736a26e8 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -120,6 +120,7 @@ instance y' <- Plutus.fromData y Just (x', y') +-- | Tests whether the map is empty. null :: Term s (PMap k v :--> PBool) null = plam (\map -> pnull # pto map) @@ -346,16 +347,19 @@ difference = phoistAcyclic $ (const pnil) # pto left +-- | Tests if all values in the map satisfy the given predicate. all :: PIsData v => Term (s :: S) ((v :--> PBool) :--> PMap k v :--> PBool) all = phoistAcyclic $ plam $ \pred map -> pall # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map +-- | Filters the map so it contains only the values that satisfy the given predicate. filter :: (PIsData k, PIsData a) => Term (s :: S) ((a :--> PBool) :--> PMap k a :--> PMap k a) filter = phoistAcyclic $ plam $ \pred -> mapMaybe #$ plam $ \v -> pif (pred # v) (pcon $ PJust v) (pcon PNothing) +-- | Maps and filters the map, much like 'Data.List.mapMaybe'. mapMaybe :: (PIsData k, PIsData a, PIsData b) => Term (s :: S) ((a :--> PMaybe b) :--> PMap k a :--> PMap k b) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 87f9e47a0..6667240e3 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -57,7 +57,7 @@ deriving via instance PConstantDecl Plutus.Value --- | Works correctly only on 'normalize'd values! +-- | Works correctly only on 'normalize'd and sorted values! instance PEq PValue where a #== b = pto a #== pto b diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 8c5b7fde3..07a27087a 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE ImpredicativeTypes #-} - -- NOTE: This module also contains ScriptContext mocks, which should ideally -- moved to a module of its own after cleaning up to expose a easy to reason -- about API. @@ -41,6 +39,8 @@ import Plutarch.Prelude import Plutarch.Test import Test.Hspec +newtype EnclosedTerm (p :: PType) = EnclosedTerm {getEnclosedTerm :: ClosedTerm p} + spec :: Spec spec = do describe "api" $ do @@ -68,9 +68,13 @@ spec = do let pmint = PValue.singleton # pconstant "c0" # pconstant "sometoken" # 1 pmintOtherToken = PValue.singleton # pconstant "c0" # pconstant "othertoken" # 1 pmintOtherSymbol = PValue.singleton # pconstant "c7" # pconstant "sometoken" # 1 - growingSymbols, symbols :: [ClosedTerm PValue] - growingSymbols = scanl (\s v -> PValue.unionWith # plam (+) # s # v) pmint symbols - symbols = toSymbolicValue <$> [0 .. 15] + growingSymbols, symbols :: [EnclosedTerm PValue] + growingSymbols = + scanl + (\s v -> EnclosedTerm $ PValue.unionWith # plam (+) # getEnclosedTerm s # getEnclosedTerm v) + (EnclosedTerm pmint) + symbols + symbols = (\n -> EnclosedTerm (toSymbolicValue n)) <$> [0 .. 15] toSymbolicValue :: Integer -> ClosedTerm PValue toSymbolicValue n = PValue.singleton # pconstant (fromString $ "c" <> showHex n "") # pconstant "token" # 1 @@ -85,7 +89,8 @@ spec = do (zip [1 :: Int .. length growingSymbols] growingSymbols) ( \(size, v) -> fromString (show size) - @| PValue.valueOf # v # pconstant "c7" # pconstant "token" @-> \p -> plift p @?= if size < 9 then 0 else 1 + @| PValue.valueOf # getEnclosedTerm v # pconstant "c7" # pconstant "token" + @-> \p -> plift p @?= if size < 9 then 0 else 1 ) "unionWith" @\ do "const" @| PValue.unionWith # plam const # pmint # pmint @-> \p -> @@ -103,8 +108,8 @@ spec = do @\ forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) ( \(size, v) -> - fromString (show size) @| PValue.unionWith # plam const # v # pmintOtherSymbol - @-> \v' -> passert (v' #== PValue.unionWith # plam const # pmintOtherSymbol # v) + fromString (show size) @| PValue.unionWith # plam const # getEnclosedTerm v # pmintOtherSymbol + @-> \v' -> passert (v' #== PValue.unionWith # plam const # pmintOtherSymbol # getEnclosedTerm v) ) "unionWithData const" @\ do "itself" @| PValue.unionWithData @-> \u -> @@ -130,7 +135,10 @@ spec = do "growing" @\ forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) - (\(size, v) -> fromString (show size) @| v #== v @-> passert) + ( \(size, v) -> + fromString (show size) + @| getEnclosedTerm v #== getEnclosedTerm v @-> passert + ) describe "map" $ do pgoldenSpec $ do let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap PByteString PInteger) From afe5a92cb979ed252dfa64ccc90b2b353b5a1df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 21 Apr 2022 16:45:34 -0400 Subject: [PATCH 423/584] Added goldens that were missing for some reason --- .../goldens/api.example.signatory.dev=true.bench.golden | 4 ++++ .../goldens/api.example.signatory.dev=true.uplc.eval.golden | 4 ++++ .../goldens/api.example.signatory.dev=true.uplc.golden | 4 ++++ 3 files changed, 12 insertions(+) create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.bench.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden new file mode 100644 index 000000000..6759b8694 --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden @@ -0,0 +1,4 @@ +cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} +cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} +termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} +termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden new file mode 100644 index 000000000..0070757cf --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ()) +cont.fails (program 1.0.0 error) +termcont.succeeds (program 1.0.0 ()) +termcont.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden new file mode 100644 index 000000000..0be2377ab --- /dev/null +++ b/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden @@ -0,0 +1,4 @@ +cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "checkSignatoryCont: not a spending tx" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file From fc1ed5f1f9d91cdbc83c47bdd1b916b868a22cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 22 Apr 2022 13:03:28 -0400 Subject: [PATCH 424/584] Added Monoid instances --- Plutarch/Api/V1/AssocMap.hs | 3 +++ Plutarch/Api/V1/Value.hs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 9736a26e8..8332d9735 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -266,6 +266,9 @@ $(Rank2.TH.deriveAll ''MapUnion) instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap k v)) where a <> b = unionWith # plam (<>) # a # b +instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Monoid (Term s (PMap k v)) where + mempty = empty + {- | Combine two 'PMap's applying the given function to any two values that share the same key. -} diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 6667240e3..a6f826c67 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -64,6 +64,9 @@ instance PEq PValue where instance Semigroup (Term s PValue) where a <> b = unionWith # plam (+) # a # b +instance Monoid (Term s PValue) where + mempty = pcon (PValue AssocMap.empty) + -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. singleton :: Term (s :: S) (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue) singleton = phoistAcyclic $ From de3d78ef116f1ea7bc88874d221e3a9cd3668a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 22 Apr 2022 13:32:11 -0400 Subject: [PATCH 425/584] Fix for the unsused goldens CI failure --- plutarch-test/common/Plutarch/Test/Run.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index 5148255e9..ed67d93c2 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -6,6 +6,7 @@ module Plutarch.Test.Run ( import Control.Monad (forM_) import Data.Default (def) +import Data.List (isPrefixOf) import Data.Set (Set) import qualified Data.Set as Set import qualified Data.Text as T @@ -76,7 +77,10 @@ unusedGoldens :: FilePath -> [FilePath] -> IO [FilePath] unusedGoldens goldenBasePath usedGoldens' = do let usedGoldens = foldMap knownGoldens usedGoldens' allGoldens <- Set.fromList . fmap (goldenBasePath ) <$> listDirectory goldenBasePath - pure $ Set.toList $ allGoldens `Set.difference` usedGoldens + pure $ + Set.toList $ + Set.filter (not . isPrefixOf (goldenBasePath "FFI.")) $ + allGoldens `Set.difference` usedGoldens where knownGoldens :: FilePath -> Set FilePath knownGoldens fp = From fad3e152e89ceef3b44f47397132b838a6844e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 22 Apr 2022 13:44:45 -0400 Subject: [PATCH 426/584] Formatting --- plutarch-test/common/Plutarch/Test/Run.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index ed67d93c2..1677f6c68 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -79,8 +79,8 @@ unusedGoldens goldenBasePath usedGoldens' = do allGoldens <- Set.fromList . fmap (goldenBasePath ) <$> listDirectory goldenBasePath pure $ Set.toList $ - Set.filter (not . isPrefixOf (goldenBasePath "FFI.")) $ - allGoldens `Set.difference` usedGoldens + Set.filter (not . isPrefixOf (goldenBasePath "FFI.")) $ + allGoldens `Set.difference` usedGoldens where knownGoldens :: FilePath -> Set FilePath knownGoldens fp = From 0062b515639f9dfbedbdad3d0510ea248c7b7924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 22 Apr 2022 16:47:03 -0400 Subject: [PATCH 427/584] Added asertSorted --- Plutarch/Api/V1/AssocMap.hs | 37 +++++++++++++++++++++++++++++++++++-- Plutarch/Api/V1/Value.hs | 17 +++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 8332d9735..6fb0ff8d0 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -12,6 +12,8 @@ module Plutarch.Api.V1.AssocMap ( insert, insertData, delete, + fromAscList, + assertSorted, -- * Lookups lookup, @@ -22,9 +24,11 @@ module Plutarch.Api.V1.AssocMap ( -- * Folds all, + any, -- * Filters and traversals filter, + map, mapMaybe, mapMaybeData, mapEitherWithKey, @@ -53,7 +57,7 @@ import Plutarch.Lift ( import Plutarch.Prelude ( DerivePNewtype (..), PAsData, - PBool, + PBool (PFalse), PBuiltinPair, PCon (pcon), PConstantData, @@ -71,6 +75,7 @@ import Plutarch.Prelude ( S, Term, pall, + pany, pfstBuiltin, phoistAcyclic, pif, @@ -80,6 +85,7 @@ import Plutarch.Prelude ( precList, psndBuiltin, pto, + ptraceError, (#), (#$), type (:-->), @@ -90,7 +96,7 @@ import Plutarch.Unsafe (punsafeFrom) import qualified Rank2.TH -import Prelude hiding (all, filter, lookup, null) +import Prelude hiding (all, any, filter, lookup, null) newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) deriving (PlutusType, PIsData, PEq, PShow) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) @@ -250,6 +256,27 @@ singletonData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData singletonData = phoistAcyclic $ plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # key # value) # pnil) +-- | Construct a 'PMap' from a list of key-value pairs, sorted by ascending key data. +fromAscList :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PBuiltinMap k v :--> PMap k v) +fromAscList = plam $ (assertSorted #) . pcon . PMap + +-- | Assert the map is properly sorted +assertSorted :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PMap k v :--> PMap k v) +assertSorted = phoistAcyclic $ + plam $ \map -> + precList + ( \self x xs -> + plet (pfromData $ pfstBuiltin # x) $ \k -> + plam $ \badKey -> + pif + (badKey # k) + (ptraceError "unsorted map") + (self # xs # plam (#< k)) + ) + (const $ plam $ const map) + # pto map + # plam (const $ pcon PFalse) + data MapUnion k v f = MapUnion { merge :: f (PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) , mergeInsert :: f (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) @@ -356,6 +383,12 @@ all = phoistAcyclic $ plam $ \pred map -> pall # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map +-- | Tests if anu value in the map satisfies the given predicate. +any :: PIsData v => Term (s :: S) ((v :--> PBool) :--> PMap k v :--> PBool) +any = phoistAcyclic $ + plam $ \pred map -> + pany # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map + -- | Filters the map so it contains only the values that satisfy the given predicate. filter :: (PIsData k, PIsData a) => Term (s :: S) ((a :--> PBool) :--> PMap k a :--> PMap k a) filter = phoistAcyclic $ diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index a6f826c67..38777a96e 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -5,6 +5,7 @@ module Plutarch.Api.V1.Value ( PValue (PValue), PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), + assertSorted, isZero, singleton, unionWith, @@ -137,5 +138,21 @@ normalize = phoistAcyclic $ nonZero intData = pif (intData #== zeroData) (pcon PNothing) (pcon $ PJust intData) +-- | Assert the value is properly sorted and normalized. +assertSorted :: Term s (PValue :--> PValue) +assertSorted = phoistAcyclic $ + plam $ \value -> + pif + ( AssocMap.any + # ( plam $ + \submap -> + AssocMap.null # (AssocMap.assertSorted # submap) + #|| AssocMap.any # plam (#== 0) # submap + ) + # pto value + ) + (ptraceError "Abnormal Value") + (pcon $ PValue $ AssocMap.assertSorted # pto value) + zeroData :: ClosedTerm (PAsData PInteger) zeroData = pdata 0 From 97a5626b2cc69af4fc399aaaa33fb0bbe08d743a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 22 Apr 2022 17:06:26 -0400 Subject: [PATCH 428/584] assertSorted tests --- plutarch-test/goldens/api.value.bench.golden | 6 +++++- .../goldens/api.value.uplc.eval.golden | 7 ++++++- plutarch-test/goldens/api.value.uplc.golden | 6 +++++- .../plutarch-base/Plutarch/ApiSpec.hs | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index 2c1422500..8e2ad7258 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -66,4 +66,8 @@ equality.growing.13 {"exBudgetCPU":791411264,"exBudgetMemory":1691936,"scriptSiz equality.growing.14 {"exBudgetCPU":908212928,"exBudgetMemory":1938364,"scriptSizeBytes":841} equality.growing.15 {"exBudgetCPU":1033264608,"exBudgetMemory":2201976,"scriptSizeBytes":872} equality.growing.16 {"exBudgetCPU":1166566304,"exBudgetMemory":2482772,"scriptSizeBytes":904} -equality.growing.17 {"exBudgetCPU":1308118016,"exBudgetMemory":2780752,"scriptSizeBytes":935} \ No newline at end of file +equality.growing.17 {"exBudgetCPU":1308118016,"exBudgetMemory":2780752,"scriptSizeBytes":935} +assertSorted.succeeds {"exBudgetCPU":40370163,"exBudgetMemory":96614,"scriptSizeBytes":486} +assertSorted.fails on malsorted symbols {"exBudgetCPU":28293494,"exBudgetMemory":62258,"scriptSizeBytes":303} +assertSorted.fails on zero quantities {"exBudgetCPU":28358984,"exBudgetMemory":62192,"scriptSizeBytes":485} +assertSorted.fails on empty token map {"exBudgetCPU":1500103,"exBudgetMemory":423,"scriptSizeBytes":215} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index a636249f2..df407e8c0 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -195,4 +195,9 @@ equality.growing.13 (program 1.0.0 True) equality.growing.14 (program 1.0.0 True) equality.growing.15 (program 1.0.0 True) equality.growing.16 (program 1.0.0 True) -equality.growing.17 (program 1.0.0 True) \ No newline at end of file +equality.growing.17 (program 1.0.0 True) +assertSorted.succeeds (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +assertSorted.fails on malsorted symbols (program 1.0.0 error) +assertSorted.fails on zero quantities (program 1.0.0 error) +assertSorted.fails on empty token map (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index a2fd3aac2..a4ae295aa 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -66,4 +66,8 @@ equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cc) #746f6b656e)) equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) \ No newline at end of file +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) +assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 i21 1) (i15 #c7 i21 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i3) (delay (i20 (i14 i1) (i2 (i15 i1)))))) i2) (i12 #c7 i18 1) (i12 #c0 i18 1))) (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i12 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay error) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i5 (i8 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i21 i22 1) (i15 i21 i22 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i16) (bData i2) (mapData i1)) #c0 i12)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i13 i1)) (delay (i2 (i11 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay error) (delay (i4 (i9 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i8 (i9 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) [ ])) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 07a27087a..2df4b9edf 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -139,6 +139,24 @@ spec = do fromString (show size) @| getEnclosedTerm v #== getEnclosedTerm v @-> passert ) + "assertSorted" @\ do + "succeeds" @| PValue.assertSorted # (pmint <> pmintOtherSymbol) @-> psucceeds + "fails on malsorted symbols" + @| PValue.assertSorted + # ( pcon $ + PValue.PValue $ + pcon $ + AssocMap.PMap $ + pconcat # pto (pto pmintOtherSymbol) # pto (pto pmint) + ) + @-> pfails + "fails on zero quantities" + @| PValue.assertSorted # (PValue.unionWith # plam (-) # pmint # pmint) + @-> pfails + "fails on empty token map" + @| PValue.assertSorted + # (pcon $ PValue.PValue $ AssocMap.singleton # pconstant "c0" # AssocMap.empty) + @-> pfails describe "map" $ do pgoldenSpec $ do let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap PByteString PInteger) From ee824e34d92d05352af524197bc586e1822ad4f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 25 Apr 2022 12:19:04 -0400 Subject: [PATCH 429/584] Split the dev/nodev Value API goldens --- ...olden => api.value.dev=false.bench.golden} | 0 ...n => api.value.dev=false.uplc.eval.golden} | 0 ...golden => api.value.dev=false.uplc.golden} | 0 .../goldens/api.value.dev=true.bench.golden | 73 +++++++ .../api.value.dev=true.uplc.eval.golden | 203 ++++++++++++++++++ .../goldens/api.value.dev=true.uplc.golden | 73 +++++++ .../plutarch-base/Plutarch/ApiSpec.hs | 2 +- 7 files changed, 350 insertions(+), 1 deletion(-) rename plutarch-test/goldens/{api.value.bench.golden => api.value.dev=false.bench.golden} (100%) rename plutarch-test/goldens/{api.value.uplc.eval.golden => api.value.dev=false.uplc.eval.golden} (100%) rename plutarch-test/goldens/{api.value.uplc.golden => api.value.dev=false.uplc.golden} (100%) create mode 100644 plutarch-test/goldens/api.value.dev=true.bench.golden create mode 100644 plutarch-test/goldens/api.value.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/api.value.dev=true.uplc.golden diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden similarity index 100% rename from plutarch-test/goldens/api.value.bench.golden rename to plutarch-test/goldens/api.value.dev=false.bench.golden diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/api.value.uplc.eval.golden rename to plutarch-test/goldens/api.value.dev=false.uplc.eval.golden diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden similarity index 100% rename from plutarch-test/goldens/api.value.uplc.golden rename to plutarch-test/goldens/api.value.dev=false.uplc.golden diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden new file mode 100644 index 000000000..4f7663671 --- /dev/null +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -0,0 +1,73 @@ +singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} +valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} +valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} +valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":194} +valueOf.growing.2 {"exBudgetCPU":26964346,"exBudgetMemory":63304,"scriptSizeBytes":433} +valueOf.growing.3 {"exBudgetCPU":39972593,"exBudgetMemory":93042,"scriptSizeBytes":461} +valueOf.growing.4 {"exBudgetCPU":56659253,"exBudgetMemory":129872,"scriptSizeBytes":478} +valueOf.growing.5 {"exBudgetCPU":77470921,"exBudgetMemory":175294,"scriptSizeBytes":494} +valueOf.growing.6 {"exBudgetCPU":102407597,"exBudgetMemory":229308,"scriptSizeBytes":510} +valueOf.growing.7 {"exBudgetCPU":131469281,"exBudgetMemory":291914,"scriptSizeBytes":527} +valueOf.growing.8 {"exBudgetCPU":164655973,"exBudgetMemory":363112,"scriptSizeBytes":543} +valueOf.growing.9 {"exBudgetCPU":204826551,"exBudgetMemory":448060,"scriptSizeBytes":558} +valueOf.growing.10 {"exBudgetCPU":244331884,"exBudgetMemory":532512,"scriptSizeBytes":574} +valueOf.growing.11 {"exBudgetCPU":287962225,"exBudgetMemory":625556,"scriptSizeBytes":590} +valueOf.growing.12 {"exBudgetCPU":335717574,"exBudgetMemory":727192,"scriptSizeBytes":607} +valueOf.growing.13 {"exBudgetCPU":387597931,"exBudgetMemory":837420,"scriptSizeBytes":623} +valueOf.growing.14 {"exBudgetCPU":443603296,"exBudgetMemory":956240,"scriptSizeBytes":639} +valueOf.growing.15 {"exBudgetCPU":503733669,"exBudgetMemory":1083652,"scriptSizeBytes":656} +valueOf.growing.16 {"exBudgetCPU":567989050,"exBudgetMemory":1219656,"scriptSizeBytes":672} +valueOf.growing.17 {"exBudgetCPU":636369439,"exBudgetMemory":1364252,"scriptSizeBytes":689} +unionWith.const {"exBudgetCPU":23630246,"exBudgetMemory":54504,"scriptSizeBytes":330} +unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":236} +unionWith.(+).applied {"exBudgetCPU":23678590,"exBudgetMemory":54006,"scriptSizeBytes":326} +unionWith.tokens {"exBudgetCPU":23016385,"exBudgetMemory":53510,"scriptSizeBytes":336} +unionWith.symbols {"exBudgetCPU":15194726,"exBudgetMemory":35964,"scriptSizeBytes":328} +unionWith.growing.1 {"exBudgetCPU":15284045,"exBudgetMemory":36264,"scriptSizeBytes":332} +unionWith.growing.2 {"exBudgetCPU":34172328,"exBudgetMemory":79618,"scriptSizeBytes":363} +unionWith.growing.3 {"exBudgetCPU":49016932,"exBudgetMemory":112818,"scriptSizeBytes":383} +unionWith.growing.4 {"exBudgetCPU":67897225,"exBudgetMemory":154310,"scriptSizeBytes":399} +unionWith.growing.5 {"exBudgetCPU":90902526,"exBudgetMemory":204394,"scriptSizeBytes":415} +unionWith.growing.6 {"exBudgetCPU":118032835,"exBudgetMemory":263070,"scriptSizeBytes":432} +unionWith.growing.7 {"exBudgetCPU":149288152,"exBudgetMemory":330338,"scriptSizeBytes":448} +unionWith.growing.8 {"exBudgetCPU":184668477,"exBudgetMemory":406198,"scriptSizeBytes":464} +unionWith.growing.9 {"exBudgetCPU":232163859,"exBudgetMemory":508796,"scriptSizeBytes":479} +unionWith.growing.10 {"exBudgetCPU":271669192,"exBudgetMemory":593248,"scriptSizeBytes":495} +unionWith.growing.11 {"exBudgetCPU":315299533,"exBudgetMemory":686292,"scriptSizeBytes":512} +unionWith.growing.12 {"exBudgetCPU":363054882,"exBudgetMemory":787928,"scriptSizeBytes":528} +unionWith.growing.13 {"exBudgetCPU":414935239,"exBudgetMemory":898156,"scriptSizeBytes":544} +unionWith.growing.14 {"exBudgetCPU":470940604,"exBudgetMemory":1016976,"scriptSizeBytes":561} +unionWith.growing.15 {"exBudgetCPU":531070977,"exBudgetMemory":1144388,"scriptSizeBytes":577} +unionWith.growing.16 {"exBudgetCPU":595326358,"exBudgetMemory":1280392,"scriptSizeBytes":593} +unionWith.growing.17 {"exBudgetCPU":663706747,"exBudgetMemory":1424988,"scriptSizeBytes":610} +unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":226} +unionWithData const.applied {"exBudgetCPU":22822970,"exBudgetMemory":53208,"scriptSizeBytes":319} +isZero.itself {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":115} +isZero.true {"exBudgetCPU":30677870,"exBudgetMemory":71393,"scriptSizeBytes":421} +isZero.false {"exBudgetCPU":8700981,"exBudgetMemory":21315,"scriptSizeBytes":178} +equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} +equality.triviallyTrue {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} +equality.triviallyFalse {"exBudgetCPU":11575395,"exBudgetMemory":25036,"scriptSizeBytes":222} +equality.swappedTokensTrue {"exBudgetCPU":51124512,"exBudgetMemory":115372,"scriptSizeBytes":471} +equality.swappedSymbolsTrue {"exBudgetCPU":39904171,"exBudgetMemory":88168,"scriptSizeBytes":462} +equality.growing.1 {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} +equality.growing.2 {"exBudgetCPU":51094016,"exBudgetMemory":115372,"scriptSizeBytes":466} +equality.growing.3 {"exBudgetCPU":77145504,"exBudgetMemory":172776,"scriptSizeBytes":497} +equality.growing.4 {"exBudgetCPU":111447008,"exBudgetMemory":247364,"scriptSizeBytes":529} +equality.growing.5 {"exBudgetCPU":153998528,"exBudgetMemory":339136,"scriptSizeBytes":560} +equality.growing.6 {"exBudgetCPU":204800064,"exBudgetMemory":448092,"scriptSizeBytes":591} +equality.growing.7 {"exBudgetCPU":263851616,"exBudgetMemory":574232,"scriptSizeBytes":622} +equality.growing.8 {"exBudgetCPU":331153184,"exBudgetMemory":717556,"scriptSizeBytes":654} +equality.growing.9 {"exBudgetCPU":406704768,"exBudgetMemory":878064,"scriptSizeBytes":685} +equality.growing.10 {"exBudgetCPU":490506368,"exBudgetMemory":1055756,"scriptSizeBytes":716} +equality.growing.11 {"exBudgetCPU":582557984,"exBudgetMemory":1250632,"scriptSizeBytes":747} +equality.growing.12 {"exBudgetCPU":682859616,"exBudgetMemory":1462692,"scriptSizeBytes":779} +equality.growing.13 {"exBudgetCPU":791411264,"exBudgetMemory":1691936,"scriptSizeBytes":810} +equality.growing.14 {"exBudgetCPU":908212928,"exBudgetMemory":1938364,"scriptSizeBytes":841} +equality.growing.15 {"exBudgetCPU":1033264608,"exBudgetMemory":2201976,"scriptSizeBytes":872} +equality.growing.16 {"exBudgetCPU":1166566304,"exBudgetMemory":2482772,"scriptSizeBytes":904} +equality.growing.17 {"exBudgetCPU":1308118016,"exBudgetMemory":2780752,"scriptSizeBytes":935} +assertSorted.succeeds {"exBudgetCPU":40578574,"exBudgetMemory":97314,"scriptSizeBytes":532} +assertSorted.fails on malsorted symbols {"exBudgetCPU":28443494,"exBudgetMemory":62290,"scriptSizeBytes":348} +assertSorted.fails on zero quantities {"exBudgetCPU":28508984,"exBudgetMemory":62224,"scriptSizeBytes":531} +assertSorted.fails on empty token map {"exBudgetCPU":1650103,"exBudgetMemory":455,"scriptSizeBytes":262} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden new file mode 100644 index 000000000..df407e8c0 --- /dev/null +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -0,0 +1,203 @@ +singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +valueOf.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 unIData (unMapData i1)) i3)) +valueOf.applied (program 1.0.0 1) +valueOf.growing.1 (program 1.0.0 0) +valueOf.growing.2 (program 1.0.0 0) +valueOf.growing.3 (program 1.0.0 0) +valueOf.growing.4 (program 1.0.0 0) +valueOf.growing.5 (program 1.0.0 0) +valueOf.growing.6 (program 1.0.0 0) +valueOf.growing.7 (program 1.0.0 0) +valueOf.growing.8 (program 1.0.0 0) +valueOf.growing.9 (program 1.0.0 1) +valueOf.growing.10 (program 1.0.0 1) +valueOf.growing.11 (program 1.0.0 1) +valueOf.growing.12 (program 1.0.0 1) +valueOf.growing.13 (program 1.0.0 1) +valueOf.growing.14 (program 1.0.0 1) +valueOf.growing.15 (program 1.0.0 1) +valueOf.growing.16 (program 1.0.0 1) +valueOf.growing.17 (program 1.0.0 1) +unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) +unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) +unionWith.tokens (program 1.0.0 [(#41c0, #a24a6f74686572746f6b656e0149736f6d65746f6b656e01)]) +unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.1 (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.2 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.3 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.4 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.5 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.6 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.7 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.8 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +unionWith.growing.9 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) ]) +unionWith.growing.10 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c8, #a145746f6b656e01) ]) +unionWith.growing.11 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) ]) +unionWith.growing.12 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) ]) +unionWith.growing.13 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) ]) +unionWith.growing.14 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) + , (#41cc, #a145746f6b656e01) ]) +unionWith.growing.15 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) + , (#41cc, #a145746f6b656e01) + , (#41cd, #a145746f6b656e01) ]) +unionWith.growing.16 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) + , (#41cc, #a145746f6b656e01) + , (#41cd, #a145746f6b656e01) + , (#41ce, #a145746f6b656e01) ]) +unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c1, #a145746f6b656e01) + , (#41c2, #a145746f6b656e01) + , (#41c3, #a145746f6b656e01) + , (#41c4, #a145746f6b656e01) + , (#41c5, #a145746f6b656e01) + , (#41c6, #a145746f6b656e01) + , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) + , (#41c8, #a145746f6b656e01) + , (#41c9, #a145746f6b656e01) + , (#41ca, #a145746f6b656e01) + , (#41cb, #a145746f6b656e01) + , (#41cc, #a145746f6b656e01) + , (#41cd, #a145746f6b656e01) + , (#41ce, #a145746f6b656e01) + , (#41cf, #a145746f6b656e01) ]) +unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) +unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +isZero.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1)) +isZero.true (program 1.0.0 True) +isZero.false (program 1.0.0 False) +equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) +equality.triviallyTrue (program 1.0.0 True) +equality.triviallyFalse (program 1.0.0 False) +equality.swappedTokensTrue (program 1.0.0 True) +equality.swappedSymbolsTrue (program 1.0.0 True) +equality.growing.1 (program 1.0.0 True) +equality.growing.2 (program 1.0.0 True) +equality.growing.3 (program 1.0.0 True) +equality.growing.4 (program 1.0.0 True) +equality.growing.5 (program 1.0.0 True) +equality.growing.6 (program 1.0.0 True) +equality.growing.7 (program 1.0.0 True) +equality.growing.8 (program 1.0.0 True) +equality.growing.9 (program 1.0.0 True) +equality.growing.10 (program 1.0.0 True) +equality.growing.11 (program 1.0.0 True) +equality.growing.12 (program 1.0.0 True) +equality.growing.13 (program 1.0.0 True) +equality.growing.14 (program 1.0.0 True) +equality.growing.15 (program 1.0.0 True) +equality.growing.16 (program 1.0.0 True) +equality.growing.17 (program 1.0.0 True) +assertSorted.succeeds (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +assertSorted.fails on malsorted symbols (program 1.0.0 error) +assertSorted.fails on zero quantities (program 1.0.0 error) +assertSorted.fails on empty token map (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden new file mode 100644 index 000000000..b88b721a6 --- /dev/null +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -0,0 +1,73 @@ +singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) +valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i19 #736f6d65746f6b656e 1) (i13 i19 i20 1)) #c7 i20) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) +valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) (i17 #c5 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) (i17 #c5 i23 1)) (i17 #c6 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) (i17 #ce i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) (i17 #ce i24 1)) (i17 #cf i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i16 #736f6d65746f6b656e 1) (i10 i16 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 i16 1) (i10 #c7 i16 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 i16 1) (i10 #c7 i16 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 i20 1) (i14 i13 #746f6b656e 1)) (i14 #c7 i20 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 #cf i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +isZero.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair)))) +isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) +equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 #736f6d65746f6b656e 1) (i7 i13 #6f74686572746f6b656e 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i21 1) (i14 i20 i13 1)) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i21 1) (i14 i13 i21 1)) (i1 addInteger (i14 i13 i21 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1)) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 i13 1) (i15 i14 i22 1)) (i15 i21 i22 1)) (i1 addInteger (i1 addInteger (i15 i14 i13 1) (i15 i14 i22 1)) (i15 i21 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c1) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 i13 1) (i16 i14 i23 1)) (i16 i15 i23 1)) (i16 i22 i23 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 i13 1) (i16 i14 i23 1)) (i16 i15 i23 1)) (i16 i22 i23 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c2) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 i13 1) (i17 i14 i24 1)) (i17 i15 i24 1)) (i17 i16 i24 1)) (i17 i23 i24 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 i13 1) (i17 i14 i24 1)) (i17 i15 i24 1)) (i17 i16 i24 1)) (i17 i23 i24 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c3) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 i13 1) (i18 i14 i25 1)) (i18 i15 i25 1)) (i18 i16 i25 1)) (i18 i17 i25 1)) (i18 i24 i25 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 i13 1) (i18 i14 i25 1)) (i18 i15 i25 1)) (i18 i16 i25 1)) (i18 i17 i25 1)) (i18 i24 i25 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c4) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 i13 1) (i19 i14 i26 1)) (i19 i15 i26 1)) (i19 i16 i26 1)) (i19 i17 i26 1)) (i19 i18 i26 1)) (i19 i25 i26 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 i13 1) (i19 i14 i26 1)) (i19 i15 i26 1)) (i19 i16 i26 1)) (i19 i17 i26 1)) (i19 i18 i26 1)) (i19 i25 i26 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c5) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 i13 1) (i20 i14 i27 1)) (i20 i15 i27 1)) (i20 i16 i27 1)) (i20 i17 i27 1)) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 i13 1) (i20 i14 i27 1)) (i20 i15 i27 1)) (i20 i16 i27 1)) (i20 i17 i27 1)) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c6) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 i13 1) (i21 i14 i28 1)) (i21 i15 i28 1)) (i21 i16 i28 1)) (i21 i17 i28 1)) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 i13 1) (i21 i14 i28 1)) (i21 i15 i28 1)) (i21 i16 i28 1)) (i21 i17 i28 1)) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 i13 1) (i22 i14 i29 1)) (i22 i15 i29 1)) (i22 i16 i29 1)) (i22 i17 i29 1)) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 i13 1) (i22 i14 i29 1)) (i22 i15 i29 1)) (i22 i16 i29 1)) (i22 i17 i29 1)) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c8) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 i13 1) (i23 i14 i30 1)) (i23 i15 i30 1)) (i23 i16 i30 1)) (i23 i17 i30 1)) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 i13 1) (i23 i14 i30 1)) (i23 i15 i30 1)) (i23 i16 i30 1)) (i23 i17 i30 1)) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c9) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 i13 1) (i24 i14 i31 1)) (i24 i15 i31 1)) (i24 i16 i31 1)) (i24 i17 i31 1)) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 i13 1) (i24 i14 i31 1)) (i24 i15 i31 1)) (i24 i16 i31 1)) (i24 i17 i31 1)) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ca) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 i13 1) (i25 i14 i32 1)) (i25 i15 i32 1)) (i25 i16 i32 1)) (i25 i17 i32 1)) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 i13 1) (i25 i14 i32 1)) (i25 i15 i32 1)) (i25 i16 i32 1)) (i25 i17 i32 1)) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cb) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cc) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) +assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 i23 1) (i17 #c7 i23 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i8 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i22 (i16 i1) (i2 (i17 i1)))))) i2) (i14 #c7 i20 1) (i14 #c0 i20 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i13 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i7 (i10 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force trace)) "unsorted map") (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i10 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i18) (bData i2) (mapData i1)) #c0 i14)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay (force (i9 i10 (delay error)))) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i10 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force trace)) "unsorted map") (force tailList)) (force (force fstPair))) (force headList)) [ ])) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 2df4b9edf..4fea06b27 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -64,7 +64,7 @@ spec = do PMinting c -> popaque c _ -> perror describe "value" $ do - pgoldenSpec $ do + plutarchDevFlagDescribe . pgoldenSpec $ do let pmint = PValue.singleton # pconstant "c0" # pconstant "sometoken" # 1 pmintOtherToken = PValue.singleton # pconstant "c0" # pconstant "othertoken" # 1 pmintOtherSymbol = PValue.singleton # pconstant "c7" # pconstant "sometoken" # 1 From 0343b2f74b4f7297eab946c860a92aed9457fcc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 25 Apr 2022 15:26:53 -0400 Subject: [PATCH 430/584] Added Value.normalize tests --- plutarch-test/goldens/api.value.dev=false.bench.golden | 2 ++ plutarch-test/goldens/api.value.dev=false.uplc.eval.golden | 3 +++ plutarch-test/goldens/api.value.dev=false.uplc.golden | 2 ++ plutarch-test/goldens/api.value.dev=true.bench.golden | 2 ++ plutarch-test/goldens/api.value.dev=true.uplc.eval.golden | 3 +++ plutarch-test/goldens/api.value.dev=true.uplc.golden | 2 ++ plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 7 +++++++ 7 files changed, 21 insertions(+) diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index 8e2ad7258..03f12ef6b 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -67,6 +67,8 @@ equality.growing.14 {"exBudgetCPU":908212928,"exBudgetMemory":1938364,"scriptSiz equality.growing.15 {"exBudgetCPU":1033264608,"exBudgetMemory":2201976,"scriptSizeBytes":872} equality.growing.16 {"exBudgetCPU":1166566304,"exBudgetMemory":2482772,"scriptSizeBytes":904} equality.growing.17 {"exBudgetCPU":1308118016,"exBudgetMemory":2780752,"scriptSizeBytes":935} +normalize.identity {"exBudgetCPU":33656200,"exBudgetMemory":76346,"scriptSizeBytes":457} +normalize.empty {"exBudgetCPU":31336597,"exBudgetMemory":72925,"scriptSizeBytes":456} assertSorted.succeeds {"exBudgetCPU":40370163,"exBudgetMemory":96614,"scriptSizeBytes":486} assertSorted.fails on malsorted symbols {"exBudgetCPU":28293494,"exBudgetMemory":62258,"scriptSizeBytes":303} assertSorted.fails on zero quantities {"exBudgetCPU":28358984,"exBudgetMemory":62192,"scriptSizeBytes":485} diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden index df407e8c0..8d11a62c8 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden @@ -196,6 +196,9 @@ equality.growing.14 (program 1.0.0 True) equality.growing.15 (program 1.0.0 True) equality.growing.16 (program 1.0.0 True) equality.growing.17 (program 1.0.0 True) +normalize.identity (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +normalize.empty (program 1.0.0 []) assertSorted.succeeds (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) , (#41c7, #a149736f6d65746f6b656e01) ]) assertSorted.fails on malsorted symbols (program 1.0.0 error) diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden index a4ae295aa..29049cbdd 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.golden @@ -67,6 +67,8 @@ equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 #c0 i18 1) (i12 #c7 i18 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i18 i19 1) (i12 i18 i19 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 i21 1) (i15 #c7 i21 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i3) (delay (i20 (i14 i1) (i2 (i15 i1)))))) i2) (i12 #c7 i18 1) (i12 #c0 i18 1))) (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i12 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay error) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i5 (i8 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i21 i22 1) (i15 i21 i22 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index 4f7663671..8c3a81218 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -67,6 +67,8 @@ equality.growing.14 {"exBudgetCPU":908212928,"exBudgetMemory":1938364,"scriptSiz equality.growing.15 {"exBudgetCPU":1033264608,"exBudgetMemory":2201976,"scriptSizeBytes":872} equality.growing.16 {"exBudgetCPU":1166566304,"exBudgetMemory":2482772,"scriptSizeBytes":904} equality.growing.17 {"exBudgetCPU":1308118016,"exBudgetMemory":2780752,"scriptSizeBytes":935} +normalize.identity {"exBudgetCPU":33656200,"exBudgetMemory":76346,"scriptSizeBytes":457} +normalize.empty {"exBudgetCPU":31336597,"exBudgetMemory":72925,"scriptSizeBytes":456} assertSorted.succeeds {"exBudgetCPU":40578574,"exBudgetMemory":97314,"scriptSizeBytes":532} assertSorted.fails on malsorted symbols {"exBudgetCPU":28443494,"exBudgetMemory":62290,"scriptSizeBytes":348} assertSorted.fails on zero quantities {"exBudgetCPU":28508984,"exBudgetMemory":62224,"scriptSizeBytes":531} diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index df407e8c0..8d11a62c8 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -196,6 +196,9 @@ equality.growing.14 (program 1.0.0 True) equality.growing.15 (program 1.0.0 True) equality.growing.16 (program 1.0.0 True) equality.growing.17 (program 1.0.0 True) +normalize.identity (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) + , (#41c7, #a149736f6d65746f6b656e01) ]) +normalize.empty (program 1.0.0 []) assertSorted.succeeds (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) , (#41c7, #a149736f6d65746f6b656e01) ]) assertSorted.fails on malsorted symbols (program 1.0.0 error) diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index b88b721a6..81555d638 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -67,6 +67,8 @@ equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 #c0 i18 1) (i12 #c7 i18 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i18 i19 1) (i12 i18 i19 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 i23 1) (i17 #c7 i23 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i8 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i22 (i16 i1) (i2 (i17 i1)))))) i2) (i14 #c7 i20 1) (i14 #c0 i20 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i13 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i7 (i10 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force trace)) "unsorted map") (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 4fea06b27..228984592 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -139,6 +139,13 @@ spec = do fromString (show size) @| getEnclosedTerm v #== getEnclosedTerm v @-> passert ) + "normalize" @\ do + "identity" + @| PValue.normalize # (pmint <> pmintOtherSymbol) + @-> \v -> passert (v #== pmint <> pmintOtherSymbol) + "empty" + @| PValue.normalize # (PValue.unionWith # plam (-) # pmint # pmint) + @-> \v -> passert (v #== mempty) "assertSorted" @\ do "succeeds" @| PValue.assertSorted # (pmint <> pmintOtherSymbol) @-> psucceeds "fails on malsorted symbols" From 01156f646fc4aa7919f821e763b318b0de46b9af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 26 Apr 2022 12:31:59 -0400 Subject: [PATCH 431/584] Added Value.singletonData --- Plutarch/Api/V1/Value.hs | 16 ++++++++++++++++ .../goldens/api.value.dev=false.bench.golden | 1 + .../goldens/api.value.dev=false.uplc.eval.golden | 1 + .../goldens/api.value.dev=false.uplc.golden | 1 + .../goldens/api.value.dev=true.bench.golden | 1 + .../goldens/api.value.dev=true.uplc.eval.golden | 1 + .../goldens/api.value.dev=true.uplc.golden | 1 + plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 3 +++ 8 files changed, 25 insertions(+) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 38777a96e..ca5d819b6 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -8,6 +8,7 @@ module Plutarch.Api.V1.Value ( assertSorted, isZero, singleton, + singletonData, unionWith, unionWithData, valueOf, @@ -74,6 +75,21 @@ singleton = phoistAcyclic $ plam $ \symbol token amount -> punsafeFrom (AssocMap.singleton # symbol #$ AssocMap.singleton # token # amount) +{- | Construct a singleton 'PValue' containing only the given quantity of the + given currency, taking data-encoded parameters. +-} +singletonData :: + Term + (s :: S) + (PAsData PCurrencySymbol :--> PAsData PTokenName :--> PAsData PInteger :--> PValue) +singletonData = phoistAcyclic $ + plam $ \symbol token amount -> + punsafeFrom + ( AssocMap.singletonData # symbol + #$ pdata + $ AssocMap.singletonData # token # amount + ) + -- | Get the quantity of the given currency in the 'PValue'. valueOf :: Term (s :: S) (PValue :--> PCurrencySymbol :--> PTokenName :--> PInteger) valueOf = phoistAcyclic $ diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index 03f12ef6b..88f61ac7d 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -1,4 +1,5 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} +singletonData {"exBudgetCPU":2867388,"exBudgetMemory":5956,"scriptSizeBytes":66} valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":194} diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden index 8d11a62c8..bf0125667 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden @@ -1,4 +1,5 @@ singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +singletonData (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) valueOf.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 unIData (unMapData i1)) i3)) valueOf.applied (program 1.0.0 1) valueOf.growing.1 (program 1.0.0 0) diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden index 29049cbdd..2f2ad4871 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.golden @@ -1,4 +1,5 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i3 (mapData (i4 i2 i1))) (bData #c0) (bData #736f6d65746f6b656e) (iData 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index 8c3a81218..a6de57836 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -1,4 +1,5 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} +singletonData {"exBudgetCPU":2867388,"exBudgetMemory":5956,"scriptSizeBytes":66} valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":194} diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index 8d11a62c8..bf0125667 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -1,4 +1,5 @@ singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +singletonData (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) valueOf.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 unIData (unMapData i1)) i3)) valueOf.applied (program 1.0.0 1) valueOf.growing.1 (program 1.0.0 0) diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index 81555d638..0d973edb0 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -1,4 +1,5 @@ singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i3 (mapData (i4 i2 i1))) (bData #c0) (bData #736f6d65746f6b656e) (iData 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 228984592..dfd391bb0 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -80,6 +80,9 @@ spec = do PValue.singleton # pconstant (fromString $ "c" <> showHex n "") # pconstant "token" # 1 "singleton" @| pmint @-> \p -> plift p @?= mint + "singletonData" + @| PValue.singletonData # pdata (pconstant "c0") # pdata (pconstant "sometoken") # pdata 1 + @-> \p -> plift p @?= mint "valueOf" @\ do "itself" @| PValue.valueOf @-> \v -> plift (v # pmint # pconstant "c0" # pconstant "sometoken") @?= 1 "applied" @| PValue.valueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> From f9f97ac2765a889810f48f9e0cbadb30da270fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 27 Apr 2022 09:31:40 -0400 Subject: [PATCH 432/584] Added a nominal ValueState parameter to PValue --- Plutarch/Api/V1.hs | 2 + Plutarch/Api/V1/Contexts.hs | 6 +- Plutarch/Api/V1/Tx.hs | 4 +- Plutarch/Api/V1/Value.hs | 66 +++++++++++++------ .../goldens/api.value.dev=false.bench.golden | 6 +- .../api.value.dev=false.uplc.eval.golden | 2 +- .../goldens/api.value.dev=false.uplc.golden | 6 +- .../goldens/api.value.dev=true.bench.golden | 6 +- .../api.value.dev=true.uplc.eval.golden | 2 +- .../goldens/api.value.dev=true.uplc.golden | 6 +- .../plutarch-base/Plutarch/ApiSpec.hs | 38 ++++++----- 11 files changed, 86 insertions(+), 58 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 0f9336f39..cd0f28fb9 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -31,6 +31,8 @@ module Plutarch.Api.V1 ( Value.PValue (PValue), Value.PCurrencySymbol (PCurrencySymbol), Value.PTokenName (PTokenName), + Value.ValueState (Sorted, Unverified), + Value.ValueNormalization (Normalized, NotNormalized), -- ** Crypto Crypto.PPubKeyHash (PPubKeyHash), diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index b934aceee..9af55d037 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -22,7 +22,7 @@ import Plutarch.Api.V1.Scripts (PDatum, PDatumHash) import Plutarch.Api.V1.Time (PPOSIXTimeRange) import Plutarch.Api.V1.Tuple (PTuple) import Plutarch.Api.V1.Tx (PTxId, PTxInInfo, PTxOut, PTxOutRef) -import Plutarch.Api.V1.Value (PCurrencySymbol, PValue) +import Plutarch.Api.V1.Value (PCurrencySymbol, PValue, ValueNormalization (Normalized), ValueState (Sorted)) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, @@ -43,8 +43,8 @@ newtype PTxInfo (s :: S) ( PDataRecord '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- Transaction inputs , "outputs" ':= PBuiltinList (PAsData PTxOut) -- Transaction outputs - , "fee" ':= PValue -- The fee paid by this transaction. - , "mint" ':= PValue -- The value minted by the transaction. + , "fee" ':= PValue ( 'Sorted 'Normalized) -- The fee paid by this transaction. + , "mint" ':= PValue ( 'Sorted 'Normalized) -- The value minted by the transaction. , "dcert" ':= PBuiltinList (PAsData PDCert) -- Digests of the certificates included in this transaction. , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- Staking withdrawals , "validRange" ':= PPOSIXTimeRange -- The valid range for the transaction. diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 4f06e6054..94ba7da12 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -16,7 +16,7 @@ import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Api.V1.Address (PAddress) import Plutarch.Api.V1.Maybe (PMaybeData) import Plutarch.Api.V1.Scripts (PDatumHash) -import Plutarch.Api.V1.Value (PValue) +import Plutarch.Api.V1.Value (PValue, ValueNormalization (Normalized), ValueState (Sorted)) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, @@ -90,7 +90,7 @@ newtype PTxOut (s :: S) s ( PDataRecord '[ "address" ':= PAddress - , "value" ':= PValue + , "value" ':= PValue ( 'Sorted 'Normalized) , "datumHash" ':= PMaybeData PDatumHash ] ) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index ca5d819b6..57b1b257f 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE RoleAnnotations #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -5,6 +6,8 @@ module Plutarch.Api.V1.Value ( PValue (PValue), PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), + ValueState (Sorted, Unverified), + ValueNormalization (Normalized, NotNormalized), assertSorted, isZero, singleton, @@ -48,29 +51,44 @@ deriving via instance PConstantDecl Plutus.CurrencySymbol -newtype PValue (s :: S) = PValue (Term s (PMap PCurrencySymbol (PMap PTokenName PInteger))) +data ValueState = Sorted ValueNormalization | Unverified +data ValueNormalization = Normalized | NotNormalized + +newtype PValue (state :: ValueState) (s :: S) + = PValue (Term s (PMap PCurrencySymbol (PMap PTokenName PInteger))) deriving (PlutusType, PIsData) - via (DerivePNewtype PValue (PMap PCurrencySymbol (PMap PTokenName PInteger))) + via (DerivePNewtype (PValue state) (PMap PCurrencySymbol (PMap PTokenName PInteger))) +type role PValue nominal phantom -instance PUnsafeLiftDecl PValue where type PLifted PValue = Plutus.Value +instance PUnsafeLiftDecl (PValue ( 'Sorted 'Normalized)) where + type PLifted (PValue ( 'Sorted 'Normalized)) = Plutus.Value deriving via - (DerivePConstantViaNewtype Plutus.Value PValue (PMap PCurrencySymbol (PMap PTokenName PInteger))) + ( DerivePConstantViaNewtype + Plutus.Value + (PValue ( 'Sorted 'Normalized)) + (PMap PCurrencySymbol (PMap PTokenName PInteger)) + ) instance PConstantDecl Plutus.Value --- | Works correctly only on 'normalize'd and sorted values! -instance PEq PValue where +instance PEq (PValue ( 'Sorted 'Normalized)) where a #== b = pto a #== pto b -instance Semigroup (Term s PValue) where - a <> b = unionWith # plam (+) # a # b +instance PEq (PValue ( 'Sorted 'NotNormalized)) where + a #== b = AssocMap.all # (AssocMap.all # plam (#== 0)) # pto (unionWith # plam (-) # a # b) + +instance Semigroup (Term s (PValue ( 'Sorted normalization))) where + a <> b = pcon (PValue $ pto $ unionWith # plam (+) # a # b) -instance Monoid (Term s PValue) where +instance Monoid (Term s (PValue ( 'Sorted normalization))) where mempty = pcon (PValue AssocMap.empty) -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. -singleton :: Term (s :: S) (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue) +singleton :: + Term + (s :: S) + (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue ( 'Sorted 'Normalized)) singleton = phoistAcyclic $ plam $ \symbol token amount -> punsafeFrom (AssocMap.singleton # symbol #$ AssocMap.singleton # token # amount) @@ -81,7 +99,9 @@ singleton = phoistAcyclic $ singletonData :: Term (s :: S) - (PAsData PCurrencySymbol :--> PAsData PTokenName :--> PAsData PInteger :--> PValue) + ( PAsData PCurrencySymbol :--> PAsData PTokenName :--> PAsData PInteger + :--> PValue ( 'Sorted 'Normalized) + ) singletonData = phoistAcyclic $ plam $ \symbol token amount -> punsafeFrom @@ -91,7 +111,7 @@ singletonData = phoistAcyclic $ ) -- | Get the quantity of the given currency in the 'PValue'. -valueOf :: Term (s :: S) (PValue :--> PCurrencySymbol :--> PTokenName :--> PInteger) +valueOf :: Term (s :: S) (PValue _ :--> PCurrencySymbol :--> PTokenName :--> PInteger) valueOf = phoistAcyclic $ plam $ \value symbol token -> AssocMap.foldAt @@ -101,15 +121,19 @@ valueOf = phoistAcyclic $ # pto value -- | Check if the value is zero. -isZero :: Term (s :: S) (PValue :--> PBool) -isZero = phoistAcyclic $ - plam $ \value -> AssocMap.all # (AssocMap.all # plam (#== 0)) # pto value +isZero :: Term (s :: S) (PValue ( 'Sorted 'Normalized) :--> PBool) +isZero = plam (\v -> AssocMap.null # pto v) {- | Combine two 'PValue's applying the given function to any pair of quantities with the same asset class. Note that the result is _not_ 'normalize'd and may contain zero quantities. -} -unionWith :: Term (s :: S) ((PInteger :--> PInteger :--> PInteger) :--> PValue :--> PValue :--> PValue) +unionWith :: + Term + (s :: S) + ( (PInteger :--> PInteger :--> PInteger) :--> PValue ( 'Sorted _) :--> PValue ( 'Sorted _) + :--> PValue ( 'Sorted 'NotNormalized) + ) unionWith = phoistAcyclic $ plam $ \combine x y -> pcon . PValue $ @@ -126,9 +150,9 @@ unionWithData :: Term (s :: S) ( (PAsData PInteger :--> PAsData PInteger :--> PAsData PInteger) - :--> PValue - :--> PValue - :--> PValue + :--> PValue ( 'Sorted _) + :--> PValue ( 'Sorted _) + :--> PValue ( 'Sorted 'NotNormalized) ) unionWithData = phoistAcyclic $ plam $ \combine x y -> @@ -139,7 +163,7 @@ unionWithData = phoistAcyclic $ # pto y -- | Normalize the argument to contain no zero quantity nor empty token map. -normalize :: Term s (PValue :--> PValue) +normalize :: Term s (PValue ( 'Sorted _) :--> PValue ( 'Sorted 'Normalized)) normalize = phoistAcyclic $ plam $ \value -> pcon . PValue $ @@ -155,7 +179,7 @@ normalize = phoistAcyclic $ pif (intData #== zeroData) (pcon PNothing) (pcon $ PJust intData) -- | Assert the value is properly sorted and normalized. -assertSorted :: Term s (PValue :--> PValue) +assertSorted :: Term s (PValue _ :--> PValue ( 'Sorted 'Normalized)) assertSorted = phoistAcyclic $ plam $ \value -> pif diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index 88f61ac7d..2dab02058 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -43,9 +43,9 @@ unionWith.growing.16 {"exBudgetCPU":595326358,"exBudgetMemory":1280392,"scriptSi unionWith.growing.17 {"exBudgetCPU":663706747,"exBudgetMemory":1424988,"scriptSizeBytes":610} unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":226} unionWithData const.applied {"exBudgetCPU":22822970,"exBudgetMemory":53208,"scriptSizeBytes":319} -isZero.itself {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":115} -isZero.true {"exBudgetCPU":30677870,"exBudgetMemory":71393,"scriptSizeBytes":421} -isZero.false {"exBudgetCPU":8700981,"exBudgetMemory":21315,"scriptSizeBytes":178} +isZero.itself {"exBudgetCPU":59646,"exBudgetMemory":300,"scriptSizeBytes":6} +isZero.true {"exBudgetCPU":31635462,"exBudgetMemory":73457,"scriptSizeBytes":460} +isZero.false {"exBudgetCPU":3196026,"exBudgetMemory":6588,"scriptSizeBytes":71} equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} equality.triviallyTrue {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} equality.triviallyFalse {"exBudgetCPU":11575395,"exBudgetMemory":25036,"scriptSizeBytes":222} diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden index bf0125667..25c72fd4d 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden @@ -172,7 +172,7 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cf, #a145746f6b656e01) ]) unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -isZero.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1)) +isZero.itself (program 1.0.0 (force nullList)) isZero.true (program 1.0.0 True) isZero.false (program 1.0.0 False) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden index 2f2ad4871..7b494d2a9 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.golden @@ -43,9 +43,9 @@ unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 #cf i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -isZero.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair)))) -isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +isZero.itself (program 1.0.0 (force nullList)) +isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> (\i0 -> i4 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i10 (i4 i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i4 (\i0 -> force (i10 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i19 i20 1) (i13 i19 i20 1)))) (force nullList)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force nullList ((\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 #736f6d65746f6b656e 1) (i7 i13 #6f74686572746f6b656e 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index a6de57836..e79e9be4d 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -43,9 +43,9 @@ unionWith.growing.16 {"exBudgetCPU":595326358,"exBudgetMemory":1280392,"scriptSi unionWith.growing.17 {"exBudgetCPU":663706747,"exBudgetMemory":1424988,"scriptSizeBytes":610} unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":226} unionWithData const.applied {"exBudgetCPU":22822970,"exBudgetMemory":53208,"scriptSizeBytes":319} -isZero.itself {"exBudgetCPU":1042155,"exBudgetMemory":3600,"scriptSizeBytes":115} -isZero.true {"exBudgetCPU":30677870,"exBudgetMemory":71393,"scriptSizeBytes":421} -isZero.false {"exBudgetCPU":8700981,"exBudgetMemory":21315,"scriptSizeBytes":178} +isZero.itself {"exBudgetCPU":59646,"exBudgetMemory":300,"scriptSizeBytes":6} +isZero.true {"exBudgetCPU":31635462,"exBudgetMemory":73457,"scriptSizeBytes":460} +isZero.false {"exBudgetCPU":3196026,"exBudgetMemory":6588,"scriptSizeBytes":71} equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} equality.triviallyTrue {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} equality.triviallyFalse {"exBudgetCPU":11575395,"exBudgetMemory":25036,"scriptSizeBytes":222} diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index bf0125667..25c72fd4d 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -172,7 +172,7 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cf, #a145746f6b656e01) ]) unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -isZero.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unMapData (force (force sndPair) i1))) i1) ((\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (i3 (force headList i1)) (delay (i2 (force tailList i1))))))))) (\i0 -> i3 (unIData (force (force sndPair) i1))) i1) (\i0 -> equalsInteger i1 0)) i1)) +isZero.itself (program 1.0.0 (force nullList)) isZero.true (program 1.0.0 True) isZero.false (program 1.0.0 False) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index 0d973edb0..7cd3892f4 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -43,9 +43,9 @@ unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 #cf i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -isZero.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair)))) -isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i11 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i11 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i14 i20 i21 1) (i14 i20 i21 1))) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay True) (delay (force (i5 (i3 (i13 i1)) (delay (i2 (i12 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> i7 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) ((\i0 -> \i0 -> i4 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0)) i1) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay True) (delay (force (i6 (i3 (i9 i1)) (delay (i2 (i10 i1)))))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> i3 i2 i1 i4)) (force ifThenElse)) (delay False)) (force headList)) (force tailList)) (force (force sndPair))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +isZero.itself (program 1.0.0 (force nullList)) +isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> (\i0 -> i4 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i10 (i4 i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i4 (\i0 -> force (i10 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i19 i20 1) (i13 i19 i20 1)))) (force nullList)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force nullList ((\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 #736f6d65746f6b656e 1) (i7 i13 #6f74686572746f6b656e 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index dfd391bb0..dafecd960 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -31,6 +31,8 @@ import Plutarch.Api.V1 ( PTxInInfo, PTxInfo, PValue, + ValueNormalization (Normalized), + ValueState (Sorted), ) import qualified Plutarch.Api.V1.AssocMap as AssocMap import qualified Plutarch.Api.V1.Value as PValue @@ -68,14 +70,14 @@ spec = do let pmint = PValue.singleton # pconstant "c0" # pconstant "sometoken" # 1 pmintOtherToken = PValue.singleton # pconstant "c0" # pconstant "othertoken" # 1 pmintOtherSymbol = PValue.singleton # pconstant "c7" # pconstant "sometoken" # 1 - growingSymbols, symbols :: [EnclosedTerm PValue] + growingSymbols, symbols :: [EnclosedTerm (PValue ( 'Sorted 'Normalized))] growingSymbols = scanl - (\s v -> EnclosedTerm $ PValue.unionWith # plam (+) # getEnclosedTerm s # getEnclosedTerm v) + (\s v -> EnclosedTerm $ getEnclosedTerm s <> getEnclosedTerm v) (EnclosedTerm pmint) symbols symbols = (\n -> EnclosedTerm (toSymbolicValue n)) <$> [0 .. 15] - toSymbolicValue :: Integer -> ClosedTerm PValue + toSymbolicValue :: Integer -> ClosedTerm (PValue ( 'Sorted 'Normalized)) toSymbolicValue n = PValue.singleton # pconstant (fromString $ "c" <> showHex n "") # pconstant "token" # 1 "singleton" @| pmint @-> \p -> @@ -97,16 +99,16 @@ spec = do ) "unionWith" @\ do "const" @| PValue.unionWith # plam const # pmint # pmint @-> \p -> - plift p @?= mint + plift (PValue.normalize # p) @?= mint "(+)" @\ do "itself" @| PValue.unionWith # plam (+) @-> \plus -> - plift (plus # pmint # pmint) @?= mint <> mint + plift (PValue.normalize #$ plus # pmint # pmint) @?= mint <> mint "applied" @| PValue.unionWith # plam (+) # pmint # pmint @-> \p -> - plift p @?= mint <> mint + plift (PValue.normalize # p) @?= mint <> mint "tokens" @| PValue.unionWith # plam (+) # pmint # pmintOtherToken @-> \p -> - plift p @?= mint <> mintOtherToken + plift (PValue.normalize # p) @?= mint <> mintOtherToken "symbols" @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> - plift p @?= mint <> mintOtherSymbol + plift (PValue.normalize # p) @?= mint <> mintOtherSymbol "growing" @\ forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) @@ -116,24 +118,24 @@ spec = do ) "unionWithData const" @\ do "itself" @| PValue.unionWithData @-> \u -> - plift (u # plam const # pmint # pmint) @?= mint + plift (PValue.normalize #$ u # plam const # pmint # pmint) @?= mint "applied" @| PValue.unionWithData # plam const # pmint # pmint @-> \p -> - plift p @?= mint + plift (PValue.normalize # p) @?= mint "isZero" @\ do "itself" @| PValue.isZero @-> \z -> passertNot (z # pmint) - "true" @| PValue.isZero # (PValue.unionWith # plam (-) # pmint # pmint) @-> passert + "true" @| PValue.isZero # (PValue.normalize #$ PValue.unionWith # plam (-) # pmint # pmint) @-> passert "false" @| PValue.isZero # pmint @-> passertNot "equality" @\ do - "itself" @| plam ((#==) @PValue) @-> \eq -> passert (eq # pmint # pmint) + "itself" @| plam ((#==) @(PValue ( 'Sorted 'Normalized))) @-> \eq -> passert (eq # pmint # pmint) "triviallyTrue" @| pmint #== pmint @-> passert "triviallyFalse" @| pmint #== pmintOtherToken @-> passertNot "swappedTokensTrue" - @| PValue.unionWith # plam (+) # pmint # pmintOtherToken - #== PValue.unionWith # plam (+) # pmintOtherToken # pmint + @| pto (PValue.unionWith # plam (+) # pmint # pmintOtherToken) + #== pto (PValue.unionWith # plam (+) # pmintOtherToken # pmint) @-> passert "swappedSymbolsTrue" - @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol - #== PValue.unionWith # plam (+) # pmintOtherSymbol # pmint + @| pto (PValue.unionWith # plam (+) # pmint # pmintOtherSymbol) + #== pto (PValue.unionWith # plam (+) # pmintOtherSymbol # pmint) @-> passert "growing" @\ forM_ @@ -328,7 +330,7 @@ getTxInfo = plam $ \ctx -> pfield @"txInfo" # ctx -getMint :: Term s (PAsData PTxInfo :--> PAsData PValue) +getMint :: Term s (PAsData PTxInfo :--> PAsData (PValue ( 'Sorted 'Normalized))) getMint = plam $ \info -> pfield @"mint" # info @@ -355,7 +357,7 @@ inputCredentialHash = in phead #$ psndBuiltin #$ pasConstr # pforgetData credential -- | Get first CurrencySymbol from Value -getSym :: Term s (PValue :--> PAsData PCurrencySymbol) +getSym :: Term s (PValue ( 'Sorted 'Normalized) :--> PAsData PCurrencySymbol) getSym = plam $ \v -> pfstBuiltin #$ phead # pto (pto v) From cdcdca5dd07372ce8112e06489ec8b377059a970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 27 Apr 2022 13:13:09 -0400 Subject: [PATCH 433/584] p all over the API --- Plutarch/Api/V1/AssocMap.hs | 167 +++++++++--------- Plutarch/Api/V1/Value.hs | 88 ++++----- .../plutarch-base/Plutarch/ApiSpec.hs | 146 +++++++-------- 3 files changed, 199 insertions(+), 202 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 6fb0ff8d0..e00b613ba 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -6,38 +6,37 @@ module Plutarch.Api.V1.AssocMap ( PMap (PMap), -- * Creation - empty, - singleton, - singletonData, - insert, - insertData, - delete, - fromAscList, - assertSorted, + pempty, + psingleton, + psingletonData, + pinsert, + pinsertData, + pdelete, + pfromAscList, + passertSorted, -- * Lookups - lookup, - lookupData, - findWithDefault, - foldAt, - null, + plookup, + plookupData, + pfindWithDefault, + pfoldAt, + pnull, -- * Folds - all, - any, + pall, + pany, -- * Filters and traversals - filter, - map, - mapMaybe, - mapMaybeData, - mapEitherWithKey, - mapEitherWithKeyData, + pfilter, + pmapMaybe, + pmapMaybeData, + pmapEitherWithKey, + pmapEitherWithKeyData, -- * Combining - difference, - unionWith, - unionWithData, + pdifference, + punionWith, + punionWithData, ) where import qualified Plutus.V1.Ledger.Api as Plutus @@ -54,6 +53,7 @@ import Plutarch.Lift ( pconstantFromRepr, pconstantToRepr, ) +import qualified Plutarch.List as List import Plutarch.Prelude ( DerivePNewtype (..), PAsData, @@ -74,14 +74,11 @@ import Plutarch.Prelude ( PlutusType, S, Term, - pall, - pany, pfstBuiltin, phoistAcyclic, pif, plam, plet, - pnull, precList, psndBuiltin, pto, @@ -127,23 +124,23 @@ instance Just (x', y') -- | Tests whether the map is empty. -null :: Term s (PMap k v :--> PBool) -null = plam (\map -> pnull # pto map) +pnull :: Term s (PMap k v :--> PBool) +pnull = plam (\map -> List.pnull # pto map) -- | Look up the given key in a 'PMap'. -lookup :: (PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMaybe v) -lookup = phoistAcyclic $ +plookup :: (PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMaybe v) +plookup = phoistAcyclic $ plam $ \key -> - lookupDataWith + plookupDataWith # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ pfromData $ psndBuiltin # pair) # pdata key -- | Look up the given key data in a 'PMap'. -lookupData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) -lookupData = lookupDataWith # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) +plookupData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) +plookupData = plookupDataWith # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) -- | Look up the given key data in a 'PMap', applying the given function to the found key-value pair. -lookupDataWith :: +plookupDataWith :: (PIsData k, PIsData v) => Term (s :: S) @@ -152,7 +149,7 @@ lookupDataWith :: :--> PMap k v :--> PMaybe x ) -lookupDataWith = phoistAcyclic $ +plookupDataWith = phoistAcyclic $ plam $ \unwrap key map -> precList ( \self x xs -> @@ -165,14 +162,14 @@ lookupDataWith = phoistAcyclic $ # pto map -- | Look up the given key in a 'PMap', returning the default value if the key is absent. -findWithDefault :: (PIsData k, PIsData v) => Term (s :: S) (v :--> k :--> PMap k v :--> v) -findWithDefault = phoistAcyclic $ plam $ \def key -> foldAtData # pdata key # def # plam pfromData +pfindWithDefault :: (PIsData k, PIsData v) => Term (s :: S) (v :--> k :--> PMap k v :--> v) +pfindWithDefault = phoistAcyclic $ plam $ \def key -> foldAtData # pdata key # def # plam pfromData {- | Look up the given key in a 'PMap'; return the default if the key is absent or apply the argument function to the value data if present. -} -foldAt :: (PIsData k, PIsData v) => Term (s :: S) (k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) -foldAt = phoistAcyclic $ +pfoldAt :: (PIsData k, PIsData v) => Term (s :: S) (k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) +pfoldAt = phoistAcyclic $ plam $ \key -> foldAtData # pdata key {- | Look up the given key data in a 'PMap'; return the default if the key is @@ -194,22 +191,22 @@ foldAtData = phoistAcyclic $ # pto map -- | Insert a new key/value pair into the map, overiding the previous if any. -insert :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v :--> PMap k v) -insert = phoistAcyclic $ +pinsert :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v :--> PMap k v) +pinsert = phoistAcyclic $ plam $ \key val -> rebuildAtKey # (plam (pcons # (ppairDataBuiltin # pdata key # pdata val) #)) # key -- | Insert a new data-encoded key/value pair into the map, overiding the previous if any. -insertData :: +pinsertData :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v :--> PMap k v) -insertData = phoistAcyclic $ +pinsertData = phoistAcyclic $ plam $ \key val -> rebuildAtKey # (plam (pcons # (ppairDataBuiltin # key # val) #)) # pfromData key -- | Delete a key from the map. -delete :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMap k v) -delete = rebuildAtKey # plam id +pdelete :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMap k v) +pdelete = rebuildAtKey # plam id -- | Rebuild the map at the given key. rebuildAtKey :: @@ -244,25 +241,25 @@ rebuildAtKey = phoistAcyclic $ # plam id -- | Construct an empty 'PMap'. -empty :: Term (s :: S) (PMap k v) -empty = punsafeFrom pnil +pempty :: Term (s :: S) (PMap k v) +pempty = punsafeFrom pnil -- | Construct a singleton 'PMap' with the given key and value. -singleton :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v) -singleton = phoistAcyclic $ plam $ \key value -> singletonData # pdata key # pdata value +psingleton :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v) +psingleton = phoistAcyclic $ plam $ \key value -> psingletonData # pdata key # pdata value -- | Construct a singleton 'PMap' with the given data-encoded key and value. -singletonData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v) -singletonData = phoistAcyclic $ +psingletonData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v) +psingletonData = phoistAcyclic $ plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # key # value) # pnil) -- | Construct a 'PMap' from a list of key-value pairs, sorted by ascending key data. -fromAscList :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PBuiltinMap k v :--> PMap k v) -fromAscList = plam $ (assertSorted #) . pcon . PMap +pfromAscList :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PBuiltinMap k v :--> PMap k v) +pfromAscList = plam $ (passertSorted #) . pcon . PMap -- | Assert the map is properly sorted -assertSorted :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PMap k v :--> PMap k v) -assertSorted = phoistAcyclic $ +passertSorted :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PMap k v :--> PMap k v) +passertSorted = phoistAcyclic $ plam $ \map -> precList ( \self x xs -> @@ -291,26 +288,26 @@ type instance $(Rank2.TH.deriveAll ''MapUnion) instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap k v)) where - a <> b = unionWith # plam (<>) # a # b + a <> b = punionWith # plam (<>) # a # b instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Monoid (Term s (PMap k v)) where - mempty = empty + mempty = pempty {- | Combine two 'PMap's applying the given function to any two values that share the same key. -} -unionWith :: +punionWith :: (POrd k, PIsData k, PIsData v) => Term (s :: S) ((v :--> v :--> v) :--> PMap k v :--> PMap k v :--> PMap k v) -unionWith = phoistAcyclic $ +punionWith = phoistAcyclic $ plam $ - \combine -> unionWithData #$ plam $ + \combine -> punionWithData #$ plam $ \x y -> pdata (combine # pfromData x # pfromData y) {- | Combine two 'PMap's applying the given function to any two data-encoded values that share the same key. -} -unionWithData :: +punionWithData :: (POrd k, PIsData k, PIsData v) => Term (s :: S) @@ -319,7 +316,7 @@ unionWithData :: :--> PMap k v :--> PMap k v ) -unionWithData = phoistAcyclic $ +punionWithData = phoistAcyclic $ plam $ \combine x y -> pcon $ PMap $ mapUnion # combine # field merge # pto x # pto y @@ -359,16 +356,16 @@ mapUnion = plam $ \combine -> } -- | Difference of two maps. Return elements of the first map not existing in the second map. -difference :: +pdifference :: (POrd k, PIsData k, PIsData a, PIsData b) => Term (s :: S) (PMap k a :--> PMap k b :--> PMap k a) -difference = phoistAcyclic $ +pdifference = phoistAcyclic $ plam $ \left right -> pcon . PMap $ precList ( \self x xs -> plet (self # xs) $ \xs' -> - foldAt + pfoldAt # (pfromData $ pfstBuiltin # x) # (pcons # x # xs') # (plam $ const xs') @@ -378,37 +375,37 @@ difference = phoistAcyclic $ # pto left -- | Tests if all values in the map satisfy the given predicate. -all :: PIsData v => Term (s :: S) ((v :--> PBool) :--> PMap k v :--> PBool) -all = phoistAcyclic $ +pall :: PIsData v => Term (s :: S) ((v :--> PBool) :--> PMap k v :--> PBool) +pall = phoistAcyclic $ plam $ \pred map -> - pall # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map + List.pall # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map -- | Tests if anu value in the map satisfies the given predicate. -any :: PIsData v => Term (s :: S) ((v :--> PBool) :--> PMap k v :--> PBool) -any = phoistAcyclic $ +pany :: PIsData v => Term (s :: S) ((v :--> PBool) :--> PMap k v :--> PBool) +pany = phoistAcyclic $ plam $ \pred map -> - pany # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map + List.pany # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map -- | Filters the map so it contains only the values that satisfy the given predicate. -filter :: (PIsData k, PIsData a) => Term (s :: S) ((a :--> PBool) :--> PMap k a :--> PMap k a) -filter = phoistAcyclic $ +pfilter :: (PIsData k, PIsData a) => Term (s :: S) ((a :--> PBool) :--> PMap k a :--> PMap k a) +pfilter = phoistAcyclic $ plam $ \pred -> - mapMaybe #$ plam $ \v -> pif (pred # v) (pcon $ PJust v) (pcon PNothing) + pmapMaybe #$ plam $ \v -> pif (pred # v) (pcon $ PJust v) (pcon PNothing) -- | Maps and filters the map, much like 'Data.List.mapMaybe'. -mapMaybe :: +pmapMaybe :: (PIsData k, PIsData a, PIsData b) => Term (s :: S) ((a :--> PMaybe b) :--> PMap k a :--> PMap k b) -mapMaybe = phoistAcyclic $ - plam $ \f -> mapMaybeData #$ plam $ \v -> pmatch (f # pfromData v) $ \case +pmapMaybe = phoistAcyclic $ + plam $ \f -> pmapMaybeData #$ plam $ \v -> pmatch (f # pfromData v) $ \case PNothing -> pcon PNothing PJust v' -> pcon $ PJust (pdata v') -mapMaybeData :: +pmapMaybeData :: forall s k a b. (PIsData k, PIsData a, PIsData b) => Term (s :: S) ((PAsData a :--> PMaybe (PAsData b)) :--> PMap k a :--> PMap k b) -mapMaybeData = phoistAcyclic $ +pmapMaybeData = phoistAcyclic $ plam $ \f map -> pcon . PMap $ precList @@ -422,12 +419,12 @@ mapMaybeData = phoistAcyclic $ # pto map -- | Map keys/values and separate the @Left@ and @Right@ results. -mapEitherWithKey :: +pmapEitherWithKey :: (PIsData k, PIsData a, PIsData b, PIsData c) => Term (s :: S) ((k :--> a :--> PEither b c) :--> PMap k a :--> PPair (PMap k b) (PMap k c)) -mapEitherWithKey = phoistAcyclic $ +pmapEitherWithKey = phoistAcyclic $ plam $ \f -> - mapEitherWithKeyData #$ plam $ \k v -> + pmapEitherWithKeyData #$ plam $ \k v -> bidata #$ f # pfromData k # pfromData v bidata :: @@ -437,7 +434,7 @@ bidata :: bidata = peither # plam (pcon . PLeft . pdata) # plam (pcon . PRight . pdata) -- | Map data-encoded keys/values and separate the @Left@ and @Right@ results. -mapEitherWithKeyData :: +pmapEitherWithKeyData :: (PIsData k, PIsData a, PIsData b, PIsData c) => Term (s :: S) @@ -445,7 +442,7 @@ mapEitherWithKeyData :: :--> PMap k a :--> PPair (PMap k b) (PMap k c) ) -mapEitherWithKeyData = phoistAcyclic $ +pmapEitherWithKeyData = phoistAcyclic $ plam $ \f map -> ( flip pmatch $ \(PPair lefts rights) -> pcon $ PPair (pcon $ PMap lefts) (pcon $ PMap rights) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 57b1b257f..7e946d5ce 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -8,14 +8,14 @@ module Plutarch.Api.V1.Value ( PTokenName (PTokenName), ValueState (Sorted, Unverified), ValueNormalization (Normalized, NotNormalized), - assertSorted, - isZero, - singleton, - singletonData, - unionWith, - unionWithData, - valueOf, - normalize, + passertSorted, + pnormalize, + pisZero, + psingleton, + psingletonData, + punionWith, + punionWithData, + pvalueOf, ) where import qualified Plutus.V1.Ledger.Api as Plutus @@ -31,7 +31,7 @@ import Plutarch.Lift ( ) import Plutarch.Unsafe (punsafeFrom) -import Plutarch.Prelude +import Plutarch.Prelude hiding (psingleton) newtype PTokenName (s :: S) = PTokenName (Term s PByteString) deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PTokenName PByteString) @@ -76,69 +76,69 @@ instance PEq (PValue ( 'Sorted 'Normalized)) where a #== b = pto a #== pto b instance PEq (PValue ( 'Sorted 'NotNormalized)) where - a #== b = AssocMap.all # (AssocMap.all # plam (#== 0)) # pto (unionWith # plam (-) # a # b) + a #== b = AssocMap.pall # (AssocMap.pall # plam (#== 0)) # pto (punionWith # plam (-) # a # b) instance Semigroup (Term s (PValue ( 'Sorted normalization))) where - a <> b = pcon (PValue $ pto $ unionWith # plam (+) # a # b) + a <> b = pcon (PValue $ pto $ punionWith # plam (+) # a # b) instance Monoid (Term s (PValue ( 'Sorted normalization))) where - mempty = pcon (PValue AssocMap.empty) + mempty = pcon (PValue AssocMap.pempty) -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. -singleton :: +psingleton :: Term (s :: S) (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue ( 'Sorted 'Normalized)) -singleton = phoistAcyclic $ +psingleton = phoistAcyclic $ plam $ \symbol token amount -> - punsafeFrom (AssocMap.singleton # symbol #$ AssocMap.singleton # token # amount) + punsafeFrom (AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) {- | Construct a singleton 'PValue' containing only the given quantity of the given currency, taking data-encoded parameters. -} -singletonData :: +psingletonData :: Term (s :: S) ( PAsData PCurrencySymbol :--> PAsData PTokenName :--> PAsData PInteger :--> PValue ( 'Sorted 'Normalized) ) -singletonData = phoistAcyclic $ +psingletonData = phoistAcyclic $ plam $ \symbol token amount -> punsafeFrom - ( AssocMap.singletonData # symbol + ( AssocMap.psingletonData # symbol #$ pdata - $ AssocMap.singletonData # token # amount + $ AssocMap.psingletonData # token # amount ) -- | Get the quantity of the given currency in the 'PValue'. -valueOf :: Term (s :: S) (PValue _ :--> PCurrencySymbol :--> PTokenName :--> PInteger) -valueOf = phoistAcyclic $ +pvalueOf :: Term (s :: S) (PValue _ :--> PCurrencySymbol :--> PTokenName :--> PInteger) +pvalueOf = phoistAcyclic $ plam $ \value symbol token -> - AssocMap.foldAt + AssocMap.pfoldAt # symbol # 0 - # plam (\map -> AssocMap.foldAt # token # 0 # plam pfromData # pfromData map) + # plam (\map -> AssocMap.pfoldAt # token # 0 # plam pfromData # pfromData map) # pto value -- | Check if the value is zero. -isZero :: Term (s :: S) (PValue ( 'Sorted 'Normalized) :--> PBool) -isZero = plam (\v -> AssocMap.null # pto v) +pisZero :: Term (s :: S) (PValue ( 'Sorted 'Normalized) :--> PBool) +pisZero = plam (\v -> AssocMap.pnull # pto v) {- | Combine two 'PValue's applying the given function to any pair of quantities with the same asset class. Note that the result is _not_ 'normalize'd and may contain zero quantities. -} -unionWith :: +punionWith :: Term (s :: S) ( (PInteger :--> PInteger :--> PInteger) :--> PValue ( 'Sorted _) :--> PValue ( 'Sorted _) :--> PValue ( 'Sorted 'NotNormalized) ) -unionWith = phoistAcyclic $ +punionWith = phoistAcyclic $ plam $ \combine x y -> pcon . PValue $ - AssocMap.unionWith - # (plam $ \x y -> AssocMap.unionWith # combine # x # y) + AssocMap.punionWith + # (plam $ \x y -> AssocMap.punionWith # combine # x # y) # pto x # pto y @@ -146,7 +146,7 @@ unionWith = phoistAcyclic $ data-encoded quantities with the same asset class. Note that the result is _not_ 'normalize'd and may contain zero quantities. -} -unionWithData :: +punionWithData :: Term (s :: S) ( (PAsData PInteger :--> PAsData PInteger :--> PAsData PInteger) @@ -154,45 +154,45 @@ unionWithData :: :--> PValue ( 'Sorted _) :--> PValue ( 'Sorted 'NotNormalized) ) -unionWithData = phoistAcyclic $ +punionWithData = phoistAcyclic $ plam $ \combine x y -> pcon . PValue $ - AssocMap.unionWith - # (plam $ \x y -> AssocMap.unionWithData # combine # x # y) + AssocMap.punionWith + # (plam $ \x y -> AssocMap.punionWithData # combine # x # y) # pto x # pto y -- | Normalize the argument to contain no zero quantity nor empty token map. -normalize :: Term s (PValue ( 'Sorted _) :--> PValue ( 'Sorted 'Normalized)) -normalize = phoistAcyclic $ +pnormalize :: Term s (PValue ( 'Sorted _) :--> PValue ( 'Sorted 'Normalized)) +pnormalize = phoistAcyclic $ plam $ \value -> pcon . PValue $ - AssocMap.mapMaybe # plam normalizeTokenMap # pto value + AssocMap.pmapMaybe # plam normalizeTokenMap # pto value where normalizeTokenMap tokenMap = - plet (AssocMap.mapMaybeData # plam nonZero # tokenMap) $ \normalMap -> + plet (AssocMap.pmapMaybeData # plam nonZero # tokenMap) $ \normalMap -> pif - (AssocMap.null # normalMap) + (AssocMap.pnull # normalMap) (pcon PNothing) (pcon $ PJust normalMap) nonZero intData = pif (intData #== zeroData) (pcon PNothing) (pcon $ PJust intData) -- | Assert the value is properly sorted and normalized. -assertSorted :: Term s (PValue _ :--> PValue ( 'Sorted 'Normalized)) -assertSorted = phoistAcyclic $ +passertSorted :: Term s (PValue _ :--> PValue ( 'Sorted 'Normalized)) +passertSorted = phoistAcyclic $ plam $ \value -> pif - ( AssocMap.any + ( AssocMap.pany # ( plam $ \submap -> - AssocMap.null # (AssocMap.assertSorted # submap) - #|| AssocMap.any # plam (#== 0) # submap + AssocMap.pnull # (AssocMap.passertSorted # submap) + #|| AssocMap.pany # plam (#== 0) # submap ) # pto value ) (ptraceError "Abnormal Value") - (pcon $ PValue $ AssocMap.assertSorted # pto value) + (pcon $ PValue $ AssocMap.passertSorted # pto value) zeroData :: ClosedTerm (PAsData PInteger) zeroData = pdata 0 diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index dafecd960..07f8943c1 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -67,9 +67,9 @@ spec = do _ -> perror describe "value" $ do plutarchDevFlagDescribe . pgoldenSpec $ do - let pmint = PValue.singleton # pconstant "c0" # pconstant "sometoken" # 1 - pmintOtherToken = PValue.singleton # pconstant "c0" # pconstant "othertoken" # 1 - pmintOtherSymbol = PValue.singleton # pconstant "c7" # pconstant "sometoken" # 1 + let pmint = PValue.psingleton # pconstant "c0" # pconstant "sometoken" # 1 + pmintOtherToken = PValue.psingleton # pconstant "c0" # pconstant "othertoken" # 1 + pmintOtherSymbol = PValue.psingleton # pconstant "c7" # pconstant "sometoken" # 1 growingSymbols, symbols :: [EnclosedTerm (PValue ( 'Sorted 'Normalized))] growingSymbols = scanl @@ -79,63 +79,63 @@ spec = do symbols = (\n -> EnclosedTerm (toSymbolicValue n)) <$> [0 .. 15] toSymbolicValue :: Integer -> ClosedTerm (PValue ( 'Sorted 'Normalized)) toSymbolicValue n = - PValue.singleton # pconstant (fromString $ "c" <> showHex n "") # pconstant "token" # 1 + PValue.psingleton # pconstant (fromString $ "c" <> showHex n "") # pconstant "token" # 1 "singleton" @| pmint @-> \p -> plift p @?= mint "singletonData" - @| PValue.singletonData # pdata (pconstant "c0") # pdata (pconstant "sometoken") # pdata 1 + @| PValue.psingletonData # pdata (pconstant "c0") # pdata (pconstant "sometoken") # pdata 1 @-> \p -> plift p @?= mint "valueOf" @\ do - "itself" @| PValue.valueOf @-> \v -> plift (v # pmint # pconstant "c0" # pconstant "sometoken") @?= 1 - "applied" @| PValue.valueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> + "itself" @| PValue.pvalueOf @-> \v -> plift (v # pmint # pconstant "c0" # pconstant "sometoken") @?= 1 + "applied" @| PValue.pvalueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> plift p @?= 1 "growing" @\ forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) ( \(size, v) -> fromString (show size) - @| PValue.valueOf # getEnclosedTerm v # pconstant "c7" # pconstant "token" + @| PValue.pvalueOf # getEnclosedTerm v # pconstant "c7" # pconstant "token" @-> \p -> plift p @?= if size < 9 then 0 else 1 ) "unionWith" @\ do - "const" @| PValue.unionWith # plam const # pmint # pmint @-> \p -> - plift (PValue.normalize # p) @?= mint + "const" @| PValue.punionWith # plam const # pmint # pmint @-> \p -> + plift (PValue.pnormalize # p) @?= mint "(+)" @\ do - "itself" @| PValue.unionWith # plam (+) @-> \plus -> - plift (PValue.normalize #$ plus # pmint # pmint) @?= mint <> mint - "applied" @| PValue.unionWith # plam (+) # pmint # pmint @-> \p -> - plift (PValue.normalize # p) @?= mint <> mint - "tokens" @| PValue.unionWith # plam (+) # pmint # pmintOtherToken @-> \p -> - plift (PValue.normalize # p) @?= mint <> mintOtherToken - "symbols" @| PValue.unionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> - plift (PValue.normalize # p) @?= mint <> mintOtherSymbol + "itself" @| PValue.punionWith # plam (+) @-> \plus -> + plift (PValue.pnormalize #$ plus # pmint # pmint) @?= mint <> mint + "applied" @| PValue.punionWith # plam (+) # pmint # pmint @-> \p -> + plift (PValue.pnormalize # p) @?= mint <> mint + "tokens" @| PValue.punionWith # plam (+) # pmint # pmintOtherToken @-> \p -> + plift (PValue.pnormalize # p) @?= mint <> mintOtherToken + "symbols" @| PValue.punionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> + plift (PValue.pnormalize # p) @?= mint <> mintOtherSymbol "growing" @\ forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) ( \(size, v) -> - fromString (show size) @| PValue.unionWith # plam const # getEnclosedTerm v # pmintOtherSymbol - @-> \v' -> passert (v' #== PValue.unionWith # plam const # pmintOtherSymbol # getEnclosedTerm v) + fromString (show size) @| PValue.punionWith # plam const # getEnclosedTerm v # pmintOtherSymbol + @-> \v' -> passert (v' #== PValue.punionWith # plam const # pmintOtherSymbol # getEnclosedTerm v) ) "unionWithData const" @\ do - "itself" @| PValue.unionWithData @-> \u -> - plift (PValue.normalize #$ u # plam const # pmint # pmint) @?= mint - "applied" @| PValue.unionWithData # plam const # pmint # pmint @-> \p -> - plift (PValue.normalize # p) @?= mint + "itself" @| PValue.punionWithData @-> \u -> + plift (PValue.pnormalize #$ u # plam const # pmint # pmint) @?= mint + "applied" @| PValue.punionWithData # plam const # pmint # pmint @-> \p -> + plift (PValue.pnormalize # p) @?= mint "isZero" @\ do - "itself" @| PValue.isZero @-> \z -> passertNot (z # pmint) - "true" @| PValue.isZero # (PValue.normalize #$ PValue.unionWith # plam (-) # pmint # pmint) @-> passert - "false" @| PValue.isZero # pmint @-> passertNot + "itself" @| PValue.pisZero @-> \z -> passertNot (z # pmint) + "true" @| PValue.pisZero # (PValue.pnormalize #$ PValue.punionWith # plam (-) # pmint # pmint) @-> passert + "false" @| PValue.pisZero # pmint @-> passertNot "equality" @\ do "itself" @| plam ((#==) @(PValue ( 'Sorted 'Normalized))) @-> \eq -> passert (eq # pmint # pmint) "triviallyTrue" @| pmint #== pmint @-> passert "triviallyFalse" @| pmint #== pmintOtherToken @-> passertNot "swappedTokensTrue" - @| pto (PValue.unionWith # plam (+) # pmint # pmintOtherToken) - #== pto (PValue.unionWith # plam (+) # pmintOtherToken # pmint) + @| pto (PValue.punionWith # plam (+) # pmint # pmintOtherToken) + #== pto (PValue.punionWith # plam (+) # pmintOtherToken # pmint) @-> passert "swappedSymbolsTrue" - @| pto (PValue.unionWith # plam (+) # pmint # pmintOtherSymbol) - #== pto (PValue.unionWith # plam (+) # pmintOtherSymbol # pmint) + @| pto (PValue.punionWith # plam (+) # pmint # pmintOtherSymbol) + #== pto (PValue.punionWith # plam (+) # pmintOtherSymbol # pmint) @-> passert "growing" @\ forM_ @@ -146,15 +146,15 @@ spec = do ) "normalize" @\ do "identity" - @| PValue.normalize # (pmint <> pmintOtherSymbol) + @| PValue.pnormalize # (pmint <> pmintOtherSymbol) @-> \v -> passert (v #== pmint <> pmintOtherSymbol) "empty" - @| PValue.normalize # (PValue.unionWith # plam (-) # pmint # pmint) + @| PValue.pnormalize # (PValue.punionWith # plam (-) # pmint # pmint) @-> \v -> passert (v #== mempty) "assertSorted" @\ do - "succeeds" @| PValue.assertSorted # (pmint <> pmintOtherSymbol) @-> psucceeds + "succeeds" @| PValue.passertSorted # (pmint <> pmintOtherSymbol) @-> psucceeds "fails on malsorted symbols" - @| PValue.assertSorted + @| PValue.passertSorted # ( pcon $ PValue.PValue $ pcon $ @@ -163,80 +163,80 @@ spec = do ) @-> pfails "fails on zero quantities" - @| PValue.assertSorted # (PValue.unionWith # plam (-) # pmint # pmint) + @| PValue.passertSorted # (PValue.punionWith # plam (-) # pmint # pmint) @-> pfails "fails on empty token map" - @| PValue.assertSorted - # (pcon $ PValue.PValue $ AssocMap.singleton # pconstant "c0" # AssocMap.empty) + @| PValue.passertSorted + # (pcon $ PValue.PValue $ AssocMap.psingleton # pconstant "c0" # AssocMap.pempty) @-> pfails describe "map" $ do pgoldenSpec $ do let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap PByteString PInteger) - pmap = AssocMap.singleton # pconstant "key" # 42 - pdmap = AssocMap.singletonData # pdata (pconstant "key") # pdata 42 - emptyMap = AssocMap.empty - doubleMap = AssocMap.singleton # pconstant "key" # 84 - otherMap = AssocMap.singleton # pconstant "newkey" # 6 + pmap = AssocMap.psingleton # pconstant "key" # 42 + pdmap = AssocMap.psingletonData # pdata (pconstant "key") # pdata 42 + emptyMap = AssocMap.pempty + doubleMap = AssocMap.psingleton # pconstant "key" # 84 + otherMap = AssocMap.psingleton # pconstant "newkey" # 6 "lookup" @\ do - "itself" @| AssocMap.lookup + "itself" @| AssocMap.plookup @-> \lookup -> passert $ lookup # pconstant "key" # pmap #== pcon (PJust 42) - "hit" @| AssocMap.lookup # pconstant "key" # pmap + "hit" @| AssocMap.plookup # pconstant "key" # pmap @-> \result -> passert $ result #== pcon (PJust 42) - "miss" @| AssocMap.lookup # pconstant "nokey" # pmap + "miss" @| AssocMap.plookup # pconstant "nokey" # pmap @-> \result -> passert $ result #== pcon PNothing "lookupData" @\ do - "hit" @| AssocMap.lookupData # pdata (pconstant "key") # pmap + "hit" @| AssocMap.plookupData # pdata (pconstant "key") # pmap @-> \result -> passert $ result #== pcon (PJust $ pdata 42) - "miss" @| AssocMap.lookupData # pdata (pconstant "nokey") # pmap + "miss" @| AssocMap.plookupData # pdata (pconstant "nokey") # pmap @-> \result -> passert $ result #== pcon PNothing "findWithDefault" @\ do - "itself" @| AssocMap.findWithDefault + "itself" @| AssocMap.pfindWithDefault @-> \find -> (find # 12 # pconstant "key" # pmap) #@?= (42 :: Term _ PInteger) - "hit" @| AssocMap.findWithDefault # 12 # pconstant "key" # pmap + "hit" @| AssocMap.pfindWithDefault # 12 # pconstant "key" # pmap @-> \result -> passert $ result #== 42 "hit2" - @| AssocMap.findWithDefault # 12 # pconstant "newkey" # (AssocMap.unionWith # plam const # pmap # otherMap) + @| AssocMap.pfindWithDefault # 12 # pconstant "newkey" # (AssocMap.punionWith # plam const # pmap # otherMap) @-> \result -> passert $ result #== 6 - "miss" @| AssocMap.findWithDefault # 12 # pconstant "nokey" # pmap + "miss" @| AssocMap.pfindWithDefault # 12 # pconstant "nokey" # pmap @-> \result -> passert $ result #== 12 "singleton" @| pmap @-> pshouldReallyBe pdmap "singletonData" @| pdmap @-> pshouldReallyBe pmap "insert" @\ do - "empty" @| AssocMap.insert # pconstant "key" # 42 # emptyMap @-> pshouldReallyBe pmap - "replace" @| AssocMap.insert # pconstant "key" # 84 # pmap @-> pshouldReallyBe doubleMap + "empty" @| AssocMap.pinsert # pconstant "key" # 42 # emptyMap @-> pshouldReallyBe pmap + "replace" @| AssocMap.pinsert # pconstant "key" # 84 # pmap @-> pshouldReallyBe doubleMap "delete" @\ do - "empty" @| AssocMap.delete # pconstant "key" # emptyMap @-> pshouldReallyBe emptyMap - "only" @| AssocMap.delete # pconstant "key" # pmap @-> pshouldReallyBe emptyMap - "miss" @| AssocMap.delete # pconstant "nokey" # pmap @-> pshouldReallyBe pmap + "empty" @| AssocMap.pdelete # pconstant "key" # emptyMap @-> pshouldReallyBe emptyMap + "only" @| AssocMap.pdelete # pconstant "key" # pmap @-> pshouldReallyBe emptyMap + "miss" @| AssocMap.pdelete # pconstant "nokey" # pmap @-> pshouldReallyBe pmap "new" - @| AssocMap.delete # pconstant "newkey" # (AssocMap.insert # pconstant "newkey" # 6 # pmap) + @| AssocMap.pdelete # pconstant "newkey" # (AssocMap.pinsert # pconstant "newkey" # 6 # pmap) @-> pshouldReallyBe pmap "old" - @| AssocMap.delete # pconstant "key" # (AssocMap.insert # pconstant "newkey" # 6 # pmap) + @| AssocMap.pdelete # pconstant "key" # (AssocMap.pinsert # pconstant "newkey" # 6 # pmap) @-> pshouldReallyBe otherMap "difference" @\ do - "emptyLeft" @| AssocMap.difference # emptyMap # pmap @-> pshouldReallyBe emptyMap - "emptyRight" @| AssocMap.difference # pmap # emptyMap @-> pshouldReallyBe pmap - "emptyResult" @| AssocMap.difference # pmap # doubleMap @-> pshouldReallyBe emptyMap + "emptyLeft" @| AssocMap.pdifference # emptyMap # pmap @-> pshouldReallyBe emptyMap + "emptyRight" @| AssocMap.pdifference # pmap # emptyMap @-> pshouldReallyBe pmap + "emptyResult" @| AssocMap.pdifference # pmap # doubleMap @-> pshouldReallyBe emptyMap "unionWith" @\ do - "const" @| AssocMap.unionWith # plam const # pmap # pmap @-> pshouldReallyBe pmap - "double" @| AssocMap.unionWith # plam (+) # pmap # pmap @-> pshouldReallyBe doubleMap + "const" @| AssocMap.punionWith # plam const # pmap # pmap @-> pshouldReallyBe pmap + "double" @| AssocMap.punionWith # plam (+) # pmap # pmap @-> pshouldReallyBe doubleMap "(+)" - @| AssocMap.unionWith # plam (+) # pmap # otherMap - @-> \p -> passert (p #== AssocMap.unionWith # plam (+) # otherMap # pmap) + @| AssocMap.punionWith # plam (+) # pmap # otherMap + @-> \p -> passert (p #== AssocMap.punionWith # plam (+) # otherMap # pmap) "flip (+)" - @| AssocMap.unionWith # plam (+) # otherMap # pmap - @-> \p -> passert (p #== AssocMap.unionWith # plam (+) # pmap # otherMap) + @| AssocMap.punionWith # plam (+) # otherMap # pmap + @-> \p -> passert (p #== AssocMap.punionWith # plam (+) # pmap # otherMap) "unionWithData" @\ do - "const" @| AssocMap.unionWithData # plam const # pmap # pmap @-> pshouldReallyBe pmap - "emptyLeft" @| AssocMap.unionWithData # plam const # emptyMap # pmap @-> pshouldReallyBe pmap - "emptyRight" @| AssocMap.unionWithData # plam const # pmap # emptyMap @-> pshouldReallyBe pmap + "const" @| AssocMap.punionWithData # plam const # pmap # pmap @-> pshouldReallyBe pmap + "emptyLeft" @| AssocMap.punionWithData # plam const # emptyMap # pmap @-> pshouldReallyBe pmap + "emptyRight" @| AssocMap.punionWithData # plam const # pmap # emptyMap @-> pshouldReallyBe pmap {- TODO: fails due to incomplete normalization "mapEitherWithKey" @\ do - "const" @| AssocMap.mapEitherWithKey # plam (const $ pcon . PRight) # pmap + "const" @| AssocMap.pmapEitherWithKey # plam (const $ pcon . PRight) # pmap @-> pshouldReallyBe (pcon $ PPair emptyMap pmap) "mapEitherWithKey" @\ do - "const" @| AssocMap.mapEitherWithKey # plam (const $ pcon . PRight) # pmap + "const" @| AssocMap.pmapEitherWithKey # plam (const $ pcon . PRight) # pmap @-> \result-> passert $ result #== pcon (PPair emptyMap pmap) -} describe "example" $ do From 4b18c4693fe68fa28d465b3ef939604e459ca96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 27 Apr 2022 15:28:58 -0400 Subject: [PATCH 434/584] Added the Positive values --- Plutarch/Api/V1.hs | 4 +- Plutarch/Api/V1/Contexts.hs | 6 +- Plutarch/Api/V1/Tx.hs | 4 +- Plutarch/Api/V1/Value.hs | 125 +++++++++++----- .../goldens/api.value.dev=false.bench.golden | 135 +++++++++-------- .../api.value.dev=false.uplc.eval.golden | 3 - .../goldens/api.value.dev=false.uplc.golden | 139 +++++++++--------- .../goldens/api.value.dev=true.bench.golden | 135 +++++++++-------- .../api.value.dev=true.uplc.eval.golden | 3 - .../goldens/api.value.dev=true.uplc.golden | 139 +++++++++--------- .../plutarch-base/Plutarch/ApiSpec.hs | 30 ++-- 11 files changed, 378 insertions(+), 345 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index cd0f28fb9..52a6f914c 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -31,8 +31,8 @@ module Plutarch.Api.V1 ( Value.PValue (PValue), Value.PCurrencySymbol (PCurrencySymbol), Value.PTokenName (PTokenName), - Value.ValueState (Sorted, Unverified), - Value.ValueNormalization (Normalized, NotNormalized), + Value.ValueKeyGuarantees (Unsorted, Sorted), + Value.ValueAmountGuarantees (NoGuarantees, NonZero, Positive), -- ** Crypto Crypto.PPubKeyHash (PPubKeyHash), diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 9af55d037..0cb23a9ea 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -22,7 +22,7 @@ import Plutarch.Api.V1.Scripts (PDatum, PDatumHash) import Plutarch.Api.V1.Time (PPOSIXTimeRange) import Plutarch.Api.V1.Tuple (PTuple) import Plutarch.Api.V1.Tx (PTxId, PTxInInfo, PTxOut, PTxOutRef) -import Plutarch.Api.V1.Value (PCurrencySymbol, PValue, ValueNormalization (Normalized), ValueState (Sorted)) +import Plutarch.Api.V1.Value (PCurrencySymbol, PValue, ValueAmountGuarantees (NonZero), ValueKeyGuarantees (Sorted)) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, @@ -43,8 +43,8 @@ newtype PTxInfo (s :: S) ( PDataRecord '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- Transaction inputs , "outputs" ':= PBuiltinList (PAsData PTxOut) -- Transaction outputs - , "fee" ':= PValue ( 'Sorted 'Normalized) -- The fee paid by this transaction. - , "mint" ':= PValue ( 'Sorted 'Normalized) -- The value minted by the transaction. + , "fee" ':= PValue 'Sorted 'NonZero -- The fee paid by this transaction. + , "mint" ':= PValue 'Sorted 'NonZero -- The value minted by the transaction. , "dcert" ':= PBuiltinList (PAsData PDCert) -- Digests of the certificates included in this transaction. , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- Staking withdrawals , "validRange" ':= PPOSIXTimeRange -- The valid range for the transaction. diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 94ba7da12..07e1ce431 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -16,7 +16,7 @@ import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Api.V1.Address (PAddress) import Plutarch.Api.V1.Maybe (PMaybeData) import Plutarch.Api.V1.Scripts (PDatumHash) -import Plutarch.Api.V1.Value (PValue, ValueNormalization (Normalized), ValueState (Sorted)) +import Plutarch.Api.V1.Value (PValue, ValueAmountGuarantees (NonZero), ValueKeyGuarantees (Sorted)) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, @@ -90,7 +90,7 @@ newtype PTxOut (s :: S) s ( PDataRecord '[ "address" ':= PAddress - , "value" ':= PValue ( 'Sorted 'Normalized) + , "value" ':= PValue 'Sorted 'NonZero , "datumHash" ':= PMaybeData PDatumHash ] ) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 7e946d5ce..53eea8d40 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -6,13 +6,16 @@ module Plutarch.Api.V1.Value ( PValue (PValue), PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), - ValueState (Sorted, Unverified), - ValueNormalization (Normalized, NotNormalized), + ValueKeyGuarantees (Unsorted, Sorted), + ValueAmountGuarantees (NoGuarantees, NonZero, Positive), passertSorted, + passertPositive, + pforgetPositive, pnormalize, - pisZero, psingleton, psingletonData, + pconstantSingleton, + pconstantPositiveSingleton, punionWith, punionWithData, pvalueOf, @@ -51,47 +54,83 @@ deriving via instance PConstantDecl Plutus.CurrencySymbol -data ValueState = Sorted ValueNormalization | Unverified -data ValueNormalization = Normalized | NotNormalized +data ValueKeyGuarantees = Sorted | Unsorted +data ValueAmountGuarantees = NoGuarantees | NonZero | Positive -newtype PValue (state :: ValueState) (s :: S) +newtype PValue (keys :: ValueKeyGuarantees) (amounts :: ValueAmountGuarantees) (s :: S) = PValue (Term s (PMap PCurrencySymbol (PMap PTokenName PInteger))) deriving (PlutusType, PIsData) - via (DerivePNewtype (PValue state) (PMap PCurrencySymbol (PMap PTokenName PInteger))) -type role PValue nominal phantom + via (DerivePNewtype (PValue keys amounts) (PMap PCurrencySymbol (PMap PTokenName PInteger))) +type role PValue nominal nominal phantom -instance PUnsafeLiftDecl (PValue ( 'Sorted 'Normalized)) where - type PLifted (PValue ( 'Sorted 'Normalized)) = Plutus.Value +instance PUnsafeLiftDecl (PValue 'Sorted 'NonZero) where + type PLifted (PValue 'Sorted 'NonZero) = Plutus.Value deriving via ( DerivePConstantViaNewtype Plutus.Value - (PValue ( 'Sorted 'Normalized)) + (PValue 'Sorted 'NonZero) (PMap PCurrencySymbol (PMap PTokenName PInteger)) ) instance PConstantDecl Plutus.Value -instance PEq (PValue ( 'Sorted 'Normalized)) where +instance PEq (PValue 'Sorted 'Positive) where a #== b = pto a #== pto b -instance PEq (PValue ( 'Sorted 'NotNormalized)) where +instance PEq (PValue 'Sorted 'NonZero) where + a #== b = pto a #== pto b + +instance PEq (PValue 'Sorted 'NoGuarantees) where a #== b = AssocMap.pall # (AssocMap.pall # plam (#== 0)) # pto (punionWith # plam (-) # a # b) -instance Semigroup (Term s (PValue ( 'Sorted normalization))) where - a <> b = pcon (PValue $ pto $ punionWith # plam (+) # a # b) +instance Semigroup (Term s (PValue 'Sorted 'Positive)) where + a <> b = punsafeFrom (pto $ punionWith # plam (+) # a # b) + +instance Semigroup (Term s (PValue 'Sorted 'NonZero)) where + a <> b = pnormalize #$ punionWith # plam (+) # a # b + +instance Semigroup (Term s (PValue 'Sorted 'NoGuarantees)) where + a <> b = punionWith # plam (+) # a # b -instance Monoid (Term s (PValue ( 'Sorted normalization))) where +instance + Semigroup (Term s (PValue 'Sorted normalization)) => + Monoid (Term s (PValue 'Sorted normalization)) + where mempty = pcon (PValue AssocMap.pempty) +-- | Construct a constant singleton 'PValue' containing only the given quantity of the given currency. +pconstantSingleton :: + ClosedTerm PCurrencySymbol -> + ClosedTerm PTokenName -> + ClosedTerm PInteger -> + ClosedTerm (PValue 'Sorted 'NonZero) +pconstantSingleton symbol token amount + | plift amount == 0 = mempty + | otherwise = punsafeFrom (AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) + +-- | Construct a constant singleton 'PValue' containing only the given positive quantity of the given currency. +pconstantPositiveSingleton :: + ClosedTerm PCurrencySymbol -> + ClosedTerm PTokenName -> + ClosedTerm PInteger -> + ClosedTerm (PValue 'Sorted 'Positive) +pconstantPositiveSingleton symbol token amount + | plift amount == 0 = mempty + | plift amount < 0 = error "Negative amount" + | otherwise = punsafeFrom (AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) + -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. psingleton :: Term (s :: S) - (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue ( 'Sorted 'Normalized)) + (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue 'Sorted 'NonZero) psingleton = phoistAcyclic $ plam $ \symbol token amount -> - punsafeFrom (AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) + pif + (amount #== 0) + mempty + (punsafeFrom $ AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) {- | Construct a singleton 'PValue' containing only the given quantity of the given currency, taking data-encoded parameters. @@ -100,18 +139,22 @@ psingletonData :: Term (s :: S) ( PAsData PCurrencySymbol :--> PAsData PTokenName :--> PAsData PInteger - :--> PValue ( 'Sorted 'Normalized) + :--> PValue 'Sorted 'NonZero ) psingletonData = phoistAcyclic $ plam $ \symbol token amount -> - punsafeFrom - ( AssocMap.psingletonData # symbol - #$ pdata - $ AssocMap.psingletonData # token # amount + pif + (amount #== zeroData) + mempty + ( punsafeFrom + ( AssocMap.psingletonData # symbol + #$ pdata + $ AssocMap.psingletonData # token # amount + ) ) -- | Get the quantity of the given currency in the 'PValue'. -pvalueOf :: Term (s :: S) (PValue _ :--> PCurrencySymbol :--> PTokenName :--> PInteger) +pvalueOf :: Term (s :: S) (PValue _ _ :--> PCurrencySymbol :--> PTokenName :--> PInteger) pvalueOf = phoistAcyclic $ plam $ \value symbol token -> AssocMap.pfoldAt @@ -120,10 +163,6 @@ pvalueOf = phoistAcyclic $ # plam (\map -> AssocMap.pfoldAt # token # 0 # plam pfromData # pfromData map) # pto value --- | Check if the value is zero. -pisZero :: Term (s :: S) (PValue ( 'Sorted 'Normalized) :--> PBool) -pisZero = plam (\v -> AssocMap.pnull # pto v) - {- | Combine two 'PValue's applying the given function to any pair of quantities with the same asset class. Note that the result is _not_ 'normalize'd and may contain zero quantities. @@ -131,8 +170,8 @@ pisZero = plam (\v -> AssocMap.pnull # pto v) punionWith :: Term (s :: S) - ( (PInteger :--> PInteger :--> PInteger) :--> PValue ( 'Sorted _) :--> PValue ( 'Sorted _) - :--> PValue ( 'Sorted 'NotNormalized) + ( (PInteger :--> PInteger :--> PInteger) :--> PValue 'Sorted _ :--> PValue 'Sorted _ + :--> PValue 'Sorted 'NoGuarantees ) punionWith = phoistAcyclic $ plam $ \combine x y -> @@ -150,9 +189,9 @@ punionWithData :: Term (s :: S) ( (PAsData PInteger :--> PAsData PInteger :--> PAsData PInteger) - :--> PValue ( 'Sorted _) - :--> PValue ( 'Sorted _) - :--> PValue ( 'Sorted 'NotNormalized) + :--> PValue 'Sorted _ + :--> PValue 'Sorted _ + :--> PValue 'Sorted 'NoGuarantees ) punionWithData = phoistAcyclic $ plam $ \combine x y -> @@ -163,7 +202,7 @@ punionWithData = phoistAcyclic $ # pto y -- | Normalize the argument to contain no zero quantity nor empty token map. -pnormalize :: Term s (PValue ( 'Sorted _) :--> PValue ( 'Sorted 'Normalized)) +pnormalize :: Term s (PValue 'Sorted _ :--> PValue 'Sorted 'NonZero) pnormalize = phoistAcyclic $ plam $ \value -> pcon . PValue $ @@ -179,7 +218,7 @@ pnormalize = phoistAcyclic $ pif (intData #== zeroData) (pcon PNothing) (pcon $ PJust intData) -- | Assert the value is properly sorted and normalized. -passertSorted :: Term s (PValue _ :--> PValue ( 'Sorted 'Normalized)) +passertSorted :: Term s (PValue _ _ :--> PValue 'Sorted 'NonZero) passertSorted = phoistAcyclic $ plam $ \value -> pif @@ -194,5 +233,21 @@ passertSorted = phoistAcyclic $ (ptraceError "Abnormal Value") (pcon $ PValue $ AssocMap.passertSorted # pto value) +-- | Assert all amounts in the value are positive. +passertPositive :: Term s (PValue 'Sorted 'NonZero :--> PValue 'Sorted 'Positive) +passertPositive = phoistAcyclic $ + plam $ \value -> + pif + ( AssocMap.pall + # (plam $ \submap -> AssocMap.pall # plam (0 #<) # submap) + # pto value + ) + (pcon $ PValue $ AssocMap.passertSorted # pto value) + (ptraceError "Negative Value") + +-- | Forget the knowledge of value's positivity. +pforgetPositive :: Term s (PValue 'Sorted 'Positive) -> Term s (PValue 'Sorted 'NonZero) +pforgetPositive v = punsafeFrom (pto v) + zeroData :: ClosedTerm (PAsData PInteger) zeroData = pdata 0 diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index 2dab02058..c02d34f24 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -1,76 +1,73 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -singletonData {"exBudgetCPU":2867388,"exBudgetMemory":5956,"scriptSizeBytes":66} +singletonData {"exBudgetCPU":3663984,"exBudgetMemory":7490,"scriptSizeBytes":80} valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} -valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":194} -valueOf.growing.2 {"exBudgetCPU":26964346,"exBudgetMemory":63304,"scriptSizeBytes":433} -valueOf.growing.3 {"exBudgetCPU":39972593,"exBudgetMemory":93042,"scriptSizeBytes":461} -valueOf.growing.4 {"exBudgetCPU":56659253,"exBudgetMemory":129872,"scriptSizeBytes":478} -valueOf.growing.5 {"exBudgetCPU":77470921,"exBudgetMemory":175294,"scriptSizeBytes":494} -valueOf.growing.6 {"exBudgetCPU":102407597,"exBudgetMemory":229308,"scriptSizeBytes":510} -valueOf.growing.7 {"exBudgetCPU":131469281,"exBudgetMemory":291914,"scriptSizeBytes":527} -valueOf.growing.8 {"exBudgetCPU":164655973,"exBudgetMemory":363112,"scriptSizeBytes":543} -valueOf.growing.9 {"exBudgetCPU":204826551,"exBudgetMemory":448060,"scriptSizeBytes":558} -valueOf.growing.10 {"exBudgetCPU":244331884,"exBudgetMemory":532512,"scriptSizeBytes":574} -valueOf.growing.11 {"exBudgetCPU":287962225,"exBudgetMemory":625556,"scriptSizeBytes":590} -valueOf.growing.12 {"exBudgetCPU":335717574,"exBudgetMemory":727192,"scriptSizeBytes":607} -valueOf.growing.13 {"exBudgetCPU":387597931,"exBudgetMemory":837420,"scriptSizeBytes":623} -valueOf.growing.14 {"exBudgetCPU":443603296,"exBudgetMemory":956240,"scriptSizeBytes":639} -valueOf.growing.15 {"exBudgetCPU":503733669,"exBudgetMemory":1083652,"scriptSizeBytes":656} -valueOf.growing.16 {"exBudgetCPU":567989050,"exBudgetMemory":1219656,"scriptSizeBytes":672} -valueOf.growing.17 {"exBudgetCPU":636369439,"exBudgetMemory":1364252,"scriptSizeBytes":689} -unionWith.const {"exBudgetCPU":23630246,"exBudgetMemory":54504,"scriptSizeBytes":330} +valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":193} +valueOf.growing.2 {"exBudgetCPU":26339113,"exBudgetMemory":61204,"scriptSizeBytes":424} +valueOf.growing.3 {"exBudgetCPU":39079403,"exBudgetMemory":90042,"scriptSizeBytes":455} +valueOf.growing.4 {"exBudgetCPU":55498106,"exBudgetMemory":125972,"scriptSizeBytes":474} +valueOf.growing.5 {"exBudgetCPU":76041817,"exBudgetMemory":170494,"scriptSizeBytes":492} +valueOf.growing.6 {"exBudgetCPU":100710536,"exBudgetMemory":223608,"scriptSizeBytes":510} +valueOf.growing.7 {"exBudgetCPU":129504263,"exBudgetMemory":285314,"scriptSizeBytes":529} +valueOf.growing.8 {"exBudgetCPU":162422998,"exBudgetMemory":355612,"scriptSizeBytes":547} +valueOf.growing.9 {"exBudgetCPU":202325619,"exBudgetMemory":439660,"scriptSizeBytes":565} +valueOf.growing.10 {"exBudgetCPU":241562995,"exBudgetMemory":523212,"scriptSizeBytes":583} +valueOf.growing.11 {"exBudgetCPU":284925379,"exBudgetMemory":615356,"scriptSizeBytes":601} +valueOf.growing.12 {"exBudgetCPU":332412771,"exBudgetMemory":716092,"scriptSizeBytes":620} +valueOf.growing.13 {"exBudgetCPU":384025171,"exBudgetMemory":825420,"scriptSizeBytes":638} +valueOf.growing.14 {"exBudgetCPU":439762579,"exBudgetMemory":943340,"scriptSizeBytes":656} +valueOf.growing.15 {"exBudgetCPU":499624995,"exBudgetMemory":1069852,"scriptSizeBytes":675} +valueOf.growing.16 {"exBudgetCPU":563612419,"exBudgetMemory":1204956,"scriptSizeBytes":693} +valueOf.growing.17 {"exBudgetCPU":631724851,"exBudgetMemory":1348652,"scriptSizeBytes":712} +unionWith.const {"exBudgetCPU":23005013,"exBudgetMemory":52404,"scriptSizeBytes":321} unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":236} -unionWith.(+).applied {"exBudgetCPU":23678590,"exBudgetMemory":54006,"scriptSizeBytes":326} -unionWith.tokens {"exBudgetCPU":23016385,"exBudgetMemory":53510,"scriptSizeBytes":336} -unionWith.symbols {"exBudgetCPU":15194726,"exBudgetMemory":35964,"scriptSizeBytes":328} -unionWith.growing.1 {"exBudgetCPU":15284045,"exBudgetMemory":36264,"scriptSizeBytes":332} -unionWith.growing.2 {"exBudgetCPU":34172328,"exBudgetMemory":79618,"scriptSizeBytes":363} -unionWith.growing.3 {"exBudgetCPU":49016932,"exBudgetMemory":112818,"scriptSizeBytes":383} -unionWith.growing.4 {"exBudgetCPU":67897225,"exBudgetMemory":154310,"scriptSizeBytes":399} -unionWith.growing.5 {"exBudgetCPU":90902526,"exBudgetMemory":204394,"scriptSizeBytes":415} -unionWith.growing.6 {"exBudgetCPU":118032835,"exBudgetMemory":263070,"scriptSizeBytes":432} -unionWith.growing.7 {"exBudgetCPU":149288152,"exBudgetMemory":330338,"scriptSizeBytes":448} -unionWith.growing.8 {"exBudgetCPU":184668477,"exBudgetMemory":406198,"scriptSizeBytes":464} -unionWith.growing.9 {"exBudgetCPU":232163859,"exBudgetMemory":508796,"scriptSizeBytes":479} -unionWith.growing.10 {"exBudgetCPU":271669192,"exBudgetMemory":593248,"scriptSizeBytes":495} -unionWith.growing.11 {"exBudgetCPU":315299533,"exBudgetMemory":686292,"scriptSizeBytes":512} -unionWith.growing.12 {"exBudgetCPU":363054882,"exBudgetMemory":787928,"scriptSizeBytes":528} -unionWith.growing.13 {"exBudgetCPU":414935239,"exBudgetMemory":898156,"scriptSizeBytes":544} -unionWith.growing.14 {"exBudgetCPU":470940604,"exBudgetMemory":1016976,"scriptSizeBytes":561} -unionWith.growing.15 {"exBudgetCPU":531070977,"exBudgetMemory":1144388,"scriptSizeBytes":577} -unionWith.growing.16 {"exBudgetCPU":595326358,"exBudgetMemory":1280392,"scriptSizeBytes":593} -unionWith.growing.17 {"exBudgetCPU":663706747,"exBudgetMemory":1424988,"scriptSizeBytes":610} +unionWith.(+).applied {"exBudgetCPU":23053357,"exBudgetMemory":51906,"scriptSizeBytes":318} +unionWith.tokens {"exBudgetCPU":22391152,"exBudgetMemory":51410,"scriptSizeBytes":327} +unionWith.symbols {"exBudgetCPU":14569493,"exBudgetMemory":33864,"scriptSizeBytes":319} +unionWith.growing.1 {"exBudgetCPU":14658812,"exBudgetMemory":34164,"scriptSizeBytes":323} +unionWith.growing.2 {"exBudgetCPU":33279138,"exBudgetMemory":76618,"scriptSizeBytes":357} +unionWith.growing.3 {"exBudgetCPU":47855785,"exBudgetMemory":108918,"scriptSizeBytes":378} +unionWith.growing.4 {"exBudgetCPU":66468121,"exBudgetMemory":149510,"scriptSizeBytes":396} +unionWith.growing.5 {"exBudgetCPU":89205465,"exBudgetMemory":198694,"scriptSizeBytes":415} +unionWith.growing.6 {"exBudgetCPU":116067817,"exBudgetMemory":256470,"scriptSizeBytes":433} +unionWith.growing.7 {"exBudgetCPU":147055177,"exBudgetMemory":322838,"scriptSizeBytes":452} +unionWith.growing.8 {"exBudgetCPU":182167545,"exBudgetMemory":397798,"scriptSizeBytes":470} +unionWith.growing.9 {"exBudgetCPU":229394970,"exBudgetMemory":499496,"scriptSizeBytes":486} +unionWith.growing.10 {"exBudgetCPU":268632346,"exBudgetMemory":583048,"scriptSizeBytes":505} +unionWith.growing.11 {"exBudgetCPU":311994730,"exBudgetMemory":675192,"scriptSizeBytes":523} +unionWith.growing.12 {"exBudgetCPU":359482122,"exBudgetMemory":775928,"scriptSizeBytes":541} +unionWith.growing.13 {"exBudgetCPU":411094522,"exBudgetMemory":885256,"scriptSizeBytes":560} +unionWith.growing.14 {"exBudgetCPU":466831930,"exBudgetMemory":1003176,"scriptSizeBytes":578} +unionWith.growing.15 {"exBudgetCPU":526694346,"exBudgetMemory":1129688,"scriptSizeBytes":597} +unionWith.growing.16 {"exBudgetCPU":590681770,"exBudgetMemory":1264792,"scriptSizeBytes":615} +unionWith.growing.17 {"exBudgetCPU":658794202,"exBudgetMemory":1408488,"scriptSizeBytes":633} unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":226} -unionWithData const.applied {"exBudgetCPU":22822970,"exBudgetMemory":53208,"scriptSizeBytes":319} -isZero.itself {"exBudgetCPU":59646,"exBudgetMemory":300,"scriptSizeBytes":6} -isZero.true {"exBudgetCPU":31635462,"exBudgetMemory":73457,"scriptSizeBytes":460} -isZero.false {"exBudgetCPU":3196026,"exBudgetMemory":6588,"scriptSizeBytes":71} +unionWithData const.applied {"exBudgetCPU":22197737,"exBudgetMemory":51108,"scriptSizeBytes":311} equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} -equality.triviallyTrue {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} -equality.triviallyFalse {"exBudgetCPU":11575395,"exBudgetMemory":25036,"scriptSizeBytes":222} -equality.swappedTokensTrue {"exBudgetCPU":51124512,"exBudgetMemory":115372,"scriptSizeBytes":471} -equality.swappedSymbolsTrue {"exBudgetCPU":39904171,"exBudgetMemory":88168,"scriptSizeBytes":462} -equality.growing.1 {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} -equality.growing.2 {"exBudgetCPU":51094016,"exBudgetMemory":115372,"scriptSizeBytes":466} -equality.growing.3 {"exBudgetCPU":77145504,"exBudgetMemory":172776,"scriptSizeBytes":497} -equality.growing.4 {"exBudgetCPU":111447008,"exBudgetMemory":247364,"scriptSizeBytes":529} -equality.growing.5 {"exBudgetCPU":153998528,"exBudgetMemory":339136,"scriptSizeBytes":560} -equality.growing.6 {"exBudgetCPU":204800064,"exBudgetMemory":448092,"scriptSizeBytes":591} -equality.growing.7 {"exBudgetCPU":263851616,"exBudgetMemory":574232,"scriptSizeBytes":622} -equality.growing.8 {"exBudgetCPU":331153184,"exBudgetMemory":717556,"scriptSizeBytes":654} -equality.growing.9 {"exBudgetCPU":406704768,"exBudgetMemory":878064,"scriptSizeBytes":685} -equality.growing.10 {"exBudgetCPU":490506368,"exBudgetMemory":1055756,"scriptSizeBytes":716} -equality.growing.11 {"exBudgetCPU":582557984,"exBudgetMemory":1250632,"scriptSizeBytes":747} -equality.growing.12 {"exBudgetCPU":682859616,"exBudgetMemory":1462692,"scriptSizeBytes":779} -equality.growing.13 {"exBudgetCPU":791411264,"exBudgetMemory":1691936,"scriptSizeBytes":810} -equality.growing.14 {"exBudgetCPU":908212928,"exBudgetMemory":1938364,"scriptSizeBytes":841} -equality.growing.15 {"exBudgetCPU":1033264608,"exBudgetMemory":2201976,"scriptSizeBytes":872} -equality.growing.16 {"exBudgetCPU":1166566304,"exBudgetMemory":2482772,"scriptSizeBytes":904} -equality.growing.17 {"exBudgetCPU":1308118016,"exBudgetMemory":2780752,"scriptSizeBytes":935} -normalize.identity {"exBudgetCPU":33656200,"exBudgetMemory":76346,"scriptSizeBytes":457} -normalize.empty {"exBudgetCPU":31336597,"exBudgetMemory":72925,"scriptSizeBytes":456} -assertSorted.succeeds {"exBudgetCPU":40370163,"exBudgetMemory":96614,"scriptSizeBytes":486} -assertSorted.fails on malsorted symbols {"exBudgetCPU":28293494,"exBudgetMemory":62258,"scriptSizeBytes":303} -assertSorted.fails on zero quantities {"exBudgetCPU":28358984,"exBudgetMemory":62192,"scriptSizeBytes":485} +equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} +equality.swappedTokensTrue {"exBudgetCPU":49963365,"exBudgetMemory":111472,"scriptSizeBytes":466} +equality.swappedSymbolsTrue {"exBudgetCPU":38743024,"exBudgetMemory":84268,"scriptSizeBytes":457} +equality.growing.1 {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.growing.2 {"exBudgetCPU":49932869,"exBudgetMemory":111472,"scriptSizeBytes":461} +equality.growing.3 {"exBudgetCPU":75448443,"exBudgetMemory":167076,"scriptSizeBytes":496} +equality.growing.4 {"exBudgetCPU":109214033,"exBudgetMemory":239864,"scriptSizeBytes":532} +equality.growing.5 {"exBudgetCPU":151229639,"exBudgetMemory":329836,"scriptSizeBytes":567} +equality.growing.6 {"exBudgetCPU":201495261,"exBudgetMemory":436992,"scriptSizeBytes":602} +equality.growing.7 {"exBudgetCPU":260010899,"exBudgetMemory":561332,"scriptSizeBytes":637} +equality.growing.8 {"exBudgetCPU":326776553,"exBudgetMemory":702856,"scriptSizeBytes":673} +equality.growing.9 {"exBudgetCPU":401792223,"exBudgetMemory":861564,"scriptSizeBytes":708} +equality.growing.10 {"exBudgetCPU":485057909,"exBudgetMemory":1037456,"scriptSizeBytes":743} +equality.growing.11 {"exBudgetCPU":576573611,"exBudgetMemory":1230532,"scriptSizeBytes":778} +equality.growing.12 {"exBudgetCPU":676339329,"exBudgetMemory":1440792,"scriptSizeBytes":814} +equality.growing.13 {"exBudgetCPU":784355063,"exBudgetMemory":1668236,"scriptSizeBytes":849} +equality.growing.14 {"exBudgetCPU":900620813,"exBudgetMemory":1912864,"scriptSizeBytes":884} +equality.growing.15 {"exBudgetCPU":1025136579,"exBudgetMemory":2174676,"scriptSizeBytes":919} +equality.growing.16 {"exBudgetCPU":1157902361,"exBudgetMemory":2453672,"scriptSizeBytes":955} +equality.growing.17 {"exBudgetCPU":1298918159,"exBudgetMemory":2749852,"scriptSizeBytes":990} +normalize.identity {"exBudgetCPU":51218947,"exBudgetMemory":117744,"scriptSizeBytes":576} +normalize.empty {"exBudgetCPU":30711364,"exBudgetMemory":70825,"scriptSizeBytes":447} +assertSorted.succeeds {"exBudgetCPU":39744930,"exBudgetMemory":94514,"scriptSizeBytes":477} +assertSorted.fails on malsorted symbols {"exBudgetCPU":28293494,"exBudgetMemory":62258,"scriptSizeBytes":294} +assertSorted.fails on zero quantities {"exBudgetCPU":28358984,"exBudgetMemory":62192,"scriptSizeBytes":476} assertSorted.fails on empty token map {"exBudgetCPU":1500103,"exBudgetMemory":423,"scriptSizeBytes":215} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden index 25c72fd4d..09c783367 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden @@ -172,9 +172,6 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cf, #a145746f6b656e01) ]) unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -isZero.itself (program 1.0.0 (force nullList)) -isZero.true (program 1.0.0 True) -isZero.false (program 1.0.0 False) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden index 7b494d2a9..6c035b68c 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.golden @@ -1,76 +1,73 @@ -singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i3 (mapData (i4 i2 i1))) (bData #c0) (bData #736f6d65746f6b656e) (iData 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsData i1 (iData 0)) (delay i6) (delay (i4 i3 (mapData (i4 i2 i1)))))) (bData #c0) (bData #736f6d65746f6b656e) (iData 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i19 #736f6d65746f6b656e 1) (i13 i19 i20 1)) #c7 i20) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) -valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) (i17 #c5 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) (i17 #c5 i23 1)) (i17 #c6 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) (i17 #ce i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) (i17 #ce i24 1)) (i17 #cf i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> i11 (bData i14) (mapData i1)) ((\i0 -> i11 (bData i15) (iData i1)) 1)) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> i12 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i12 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) -unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i16 #736f6d65746f6b656e 1) (i10 i16 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 i16 1) (i10 #c7 i16 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 i16 1) (i10 #c7 i16 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 i20 1) (i14 i13 #746f6b656e 1)) (i14 #c7 i20 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 #cf i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 #736f6d65746f6b656e 1)) (i10 i11 (i12 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 (i15 i19 1)) (i14 i13 (i15 #746f6b656e 1))) (i14 #c7 (i15 i19 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c6 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) -unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -isZero.itself (program 1.0.0 (force nullList)) -isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> (\i0 -> i4 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i10 (i4 i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i4 (\i0 -> force (i10 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i19 i20 1) (i13 i19 i20 1)))) (force nullList)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force nullList ((\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 #736f6d65746f6b656e 1) (i7 i13 #6f74686572746f6b656e 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i21 1) (i14 i20 i13 1)) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i21 1) (i14 i13 i21 1)) (i1 addInteger (i14 i13 i21 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1)) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 i13 1) (i15 i14 i22 1)) (i15 i21 i22 1)) (i1 addInteger (i1 addInteger (i15 i14 i13 1) (i15 i14 i22 1)) (i15 i21 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c1) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 i13 1) (i16 i14 i23 1)) (i16 i15 i23 1)) (i16 i22 i23 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 i13 1) (i16 i14 i23 1)) (i16 i15 i23 1)) (i16 i22 i23 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c2) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 i13 1) (i17 i14 i24 1)) (i17 i15 i24 1)) (i17 i16 i24 1)) (i17 i23 i24 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 i13 1) (i17 i14 i24 1)) (i17 i15 i24 1)) (i17 i16 i24 1)) (i17 i23 i24 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c3) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 i13 1) (i18 i14 i25 1)) (i18 i15 i25 1)) (i18 i16 i25 1)) (i18 i17 i25 1)) (i18 i24 i25 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 i13 1) (i18 i14 i25 1)) (i18 i15 i25 1)) (i18 i16 i25 1)) (i18 i17 i25 1)) (i18 i24 i25 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c4) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 i13 1) (i19 i14 i26 1)) (i19 i15 i26 1)) (i19 i16 i26 1)) (i19 i17 i26 1)) (i19 i18 i26 1)) (i19 i25 i26 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 i13 1) (i19 i14 i26 1)) (i19 i15 i26 1)) (i19 i16 i26 1)) (i19 i17 i26 1)) (i19 i18 i26 1)) (i19 i25 i26 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c5) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 i13 1) (i20 i14 i27 1)) (i20 i15 i27 1)) (i20 i16 i27 1)) (i20 i17 i27 1)) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 i13 1) (i20 i14 i27 1)) (i20 i15 i27 1)) (i20 i16 i27 1)) (i20 i17 i27 1)) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c6) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 i13 1) (i21 i14 i28 1)) (i21 i15 i28 1)) (i21 i16 i28 1)) (i21 i17 i28 1)) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 i13 1) (i21 i14 i28 1)) (i21 i15 i28 1)) (i21 i16 i28 1)) (i21 i17 i28 1)) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 i13 1) (i22 i14 i29 1)) (i22 i15 i29 1)) (i22 i16 i29 1)) (i22 i17 i29 1)) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 i13 1) (i22 i14 i29 1)) (i22 i15 i29 1)) (i22 i16 i29 1)) (i22 i17 i29 1)) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c8) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 i13 1) (i23 i14 i30 1)) (i23 i15 i30 1)) (i23 i16 i30 1)) (i23 i17 i30 1)) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 i13 1) (i23 i14 i30 1)) (i23 i15 i30 1)) (i23 i16 i30 1)) (i23 i17 i30 1)) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c9) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 i13 1) (i24 i14 i31 1)) (i24 i15 i31 1)) (i24 i16 i31 1)) (i24 i17 i31 1)) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 i13 1) (i24 i14 i31 1)) (i24 i15 i31 1)) (i24 i16 i31 1)) (i24 i17 i31 1)) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ca) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 i13 1) (i25 i14 i32 1)) (i25 i15 i32 1)) (i25 i16 i32 1)) (i25 i17 i32 1)) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 i13 1) (i25 i14 i32 1)) (i25 i15 i32 1)) (i25 i16 i32 1)) (i25 i17 i32 1)) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cb) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cc) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) -normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 #c0 i18 1) (i12 #c7 i18 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i18 i19 1) (i12 i18 i19 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 i21 1) (i15 #c7 i21 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i3) (delay (i20 (i14 i1) (i2 (i15 i1)))))) i2) (i12 #c7 i18 1) (i12 #c0 i18 1))) (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i12 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay error) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i5 (i8 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i21 i22 1) (i15 i21 i22 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i15 (i16 i13 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i13 (i16 i20 1))) (i1 addInteger (i14 i13 (i16 i20 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay (i6 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i14 (i1 i2) (delay error) (delay (i4 (i16 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i16 (i15 i1))))))) i1 (\i0 -> False))) (delay error))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i20 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i3) (delay (i19 (i14 i1) (i2 (i15 i1)))))) i2) (i12 #c7 (i13 i17 1)) (i12 #c0 (i13 i17 1)))) (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i12 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay error) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i5 (i8 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i16 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i16) (bData i2) (mapData i1)) #c0 i12)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i13 i1)) (delay (i2 (i11 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay error) (delay (i4 (i9 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i8 (i9 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index e79e9be4d..5e7882676 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -1,76 +1,73 @@ singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -singletonData {"exBudgetCPU":2867388,"exBudgetMemory":5956,"scriptSizeBytes":66} +singletonData {"exBudgetCPU":3663984,"exBudgetMemory":7490,"scriptSizeBytes":80} valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} -valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":194} -valueOf.growing.2 {"exBudgetCPU":26964346,"exBudgetMemory":63304,"scriptSizeBytes":433} -valueOf.growing.3 {"exBudgetCPU":39972593,"exBudgetMemory":93042,"scriptSizeBytes":461} -valueOf.growing.4 {"exBudgetCPU":56659253,"exBudgetMemory":129872,"scriptSizeBytes":478} -valueOf.growing.5 {"exBudgetCPU":77470921,"exBudgetMemory":175294,"scriptSizeBytes":494} -valueOf.growing.6 {"exBudgetCPU":102407597,"exBudgetMemory":229308,"scriptSizeBytes":510} -valueOf.growing.7 {"exBudgetCPU":131469281,"exBudgetMemory":291914,"scriptSizeBytes":527} -valueOf.growing.8 {"exBudgetCPU":164655973,"exBudgetMemory":363112,"scriptSizeBytes":543} -valueOf.growing.9 {"exBudgetCPU":204826551,"exBudgetMemory":448060,"scriptSizeBytes":558} -valueOf.growing.10 {"exBudgetCPU":244331884,"exBudgetMemory":532512,"scriptSizeBytes":574} -valueOf.growing.11 {"exBudgetCPU":287962225,"exBudgetMemory":625556,"scriptSizeBytes":590} -valueOf.growing.12 {"exBudgetCPU":335717574,"exBudgetMemory":727192,"scriptSizeBytes":607} -valueOf.growing.13 {"exBudgetCPU":387597931,"exBudgetMemory":837420,"scriptSizeBytes":623} -valueOf.growing.14 {"exBudgetCPU":443603296,"exBudgetMemory":956240,"scriptSizeBytes":639} -valueOf.growing.15 {"exBudgetCPU":503733669,"exBudgetMemory":1083652,"scriptSizeBytes":656} -valueOf.growing.16 {"exBudgetCPU":567989050,"exBudgetMemory":1219656,"scriptSizeBytes":672} -valueOf.growing.17 {"exBudgetCPU":636369439,"exBudgetMemory":1364252,"scriptSizeBytes":689} -unionWith.const {"exBudgetCPU":23630246,"exBudgetMemory":54504,"scriptSizeBytes":330} +valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":193} +valueOf.growing.2 {"exBudgetCPU":26339113,"exBudgetMemory":61204,"scriptSizeBytes":424} +valueOf.growing.3 {"exBudgetCPU":39079403,"exBudgetMemory":90042,"scriptSizeBytes":455} +valueOf.growing.4 {"exBudgetCPU":55498106,"exBudgetMemory":125972,"scriptSizeBytes":474} +valueOf.growing.5 {"exBudgetCPU":76041817,"exBudgetMemory":170494,"scriptSizeBytes":492} +valueOf.growing.6 {"exBudgetCPU":100710536,"exBudgetMemory":223608,"scriptSizeBytes":510} +valueOf.growing.7 {"exBudgetCPU":129504263,"exBudgetMemory":285314,"scriptSizeBytes":529} +valueOf.growing.8 {"exBudgetCPU":162422998,"exBudgetMemory":355612,"scriptSizeBytes":547} +valueOf.growing.9 {"exBudgetCPU":202325619,"exBudgetMemory":439660,"scriptSizeBytes":565} +valueOf.growing.10 {"exBudgetCPU":241562995,"exBudgetMemory":523212,"scriptSizeBytes":583} +valueOf.growing.11 {"exBudgetCPU":284925379,"exBudgetMemory":615356,"scriptSizeBytes":601} +valueOf.growing.12 {"exBudgetCPU":332412771,"exBudgetMemory":716092,"scriptSizeBytes":620} +valueOf.growing.13 {"exBudgetCPU":384025171,"exBudgetMemory":825420,"scriptSizeBytes":638} +valueOf.growing.14 {"exBudgetCPU":439762579,"exBudgetMemory":943340,"scriptSizeBytes":656} +valueOf.growing.15 {"exBudgetCPU":499624995,"exBudgetMemory":1069852,"scriptSizeBytes":675} +valueOf.growing.16 {"exBudgetCPU":563612419,"exBudgetMemory":1204956,"scriptSizeBytes":693} +valueOf.growing.17 {"exBudgetCPU":631724851,"exBudgetMemory":1348652,"scriptSizeBytes":712} +unionWith.const {"exBudgetCPU":23005013,"exBudgetMemory":52404,"scriptSizeBytes":321} unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":236} -unionWith.(+).applied {"exBudgetCPU":23678590,"exBudgetMemory":54006,"scriptSizeBytes":326} -unionWith.tokens {"exBudgetCPU":23016385,"exBudgetMemory":53510,"scriptSizeBytes":336} -unionWith.symbols {"exBudgetCPU":15194726,"exBudgetMemory":35964,"scriptSizeBytes":328} -unionWith.growing.1 {"exBudgetCPU":15284045,"exBudgetMemory":36264,"scriptSizeBytes":332} -unionWith.growing.2 {"exBudgetCPU":34172328,"exBudgetMemory":79618,"scriptSizeBytes":363} -unionWith.growing.3 {"exBudgetCPU":49016932,"exBudgetMemory":112818,"scriptSizeBytes":383} -unionWith.growing.4 {"exBudgetCPU":67897225,"exBudgetMemory":154310,"scriptSizeBytes":399} -unionWith.growing.5 {"exBudgetCPU":90902526,"exBudgetMemory":204394,"scriptSizeBytes":415} -unionWith.growing.6 {"exBudgetCPU":118032835,"exBudgetMemory":263070,"scriptSizeBytes":432} -unionWith.growing.7 {"exBudgetCPU":149288152,"exBudgetMemory":330338,"scriptSizeBytes":448} -unionWith.growing.8 {"exBudgetCPU":184668477,"exBudgetMemory":406198,"scriptSizeBytes":464} -unionWith.growing.9 {"exBudgetCPU":232163859,"exBudgetMemory":508796,"scriptSizeBytes":479} -unionWith.growing.10 {"exBudgetCPU":271669192,"exBudgetMemory":593248,"scriptSizeBytes":495} -unionWith.growing.11 {"exBudgetCPU":315299533,"exBudgetMemory":686292,"scriptSizeBytes":512} -unionWith.growing.12 {"exBudgetCPU":363054882,"exBudgetMemory":787928,"scriptSizeBytes":528} -unionWith.growing.13 {"exBudgetCPU":414935239,"exBudgetMemory":898156,"scriptSizeBytes":544} -unionWith.growing.14 {"exBudgetCPU":470940604,"exBudgetMemory":1016976,"scriptSizeBytes":561} -unionWith.growing.15 {"exBudgetCPU":531070977,"exBudgetMemory":1144388,"scriptSizeBytes":577} -unionWith.growing.16 {"exBudgetCPU":595326358,"exBudgetMemory":1280392,"scriptSizeBytes":593} -unionWith.growing.17 {"exBudgetCPU":663706747,"exBudgetMemory":1424988,"scriptSizeBytes":610} +unionWith.(+).applied {"exBudgetCPU":23053357,"exBudgetMemory":51906,"scriptSizeBytes":318} +unionWith.tokens {"exBudgetCPU":22391152,"exBudgetMemory":51410,"scriptSizeBytes":327} +unionWith.symbols {"exBudgetCPU":14569493,"exBudgetMemory":33864,"scriptSizeBytes":319} +unionWith.growing.1 {"exBudgetCPU":14658812,"exBudgetMemory":34164,"scriptSizeBytes":323} +unionWith.growing.2 {"exBudgetCPU":33279138,"exBudgetMemory":76618,"scriptSizeBytes":357} +unionWith.growing.3 {"exBudgetCPU":47855785,"exBudgetMemory":108918,"scriptSizeBytes":378} +unionWith.growing.4 {"exBudgetCPU":66468121,"exBudgetMemory":149510,"scriptSizeBytes":396} +unionWith.growing.5 {"exBudgetCPU":89205465,"exBudgetMemory":198694,"scriptSizeBytes":415} +unionWith.growing.6 {"exBudgetCPU":116067817,"exBudgetMemory":256470,"scriptSizeBytes":433} +unionWith.growing.7 {"exBudgetCPU":147055177,"exBudgetMemory":322838,"scriptSizeBytes":452} +unionWith.growing.8 {"exBudgetCPU":182167545,"exBudgetMemory":397798,"scriptSizeBytes":470} +unionWith.growing.9 {"exBudgetCPU":229394970,"exBudgetMemory":499496,"scriptSizeBytes":486} +unionWith.growing.10 {"exBudgetCPU":268632346,"exBudgetMemory":583048,"scriptSizeBytes":505} +unionWith.growing.11 {"exBudgetCPU":311994730,"exBudgetMemory":675192,"scriptSizeBytes":523} +unionWith.growing.12 {"exBudgetCPU":359482122,"exBudgetMemory":775928,"scriptSizeBytes":541} +unionWith.growing.13 {"exBudgetCPU":411094522,"exBudgetMemory":885256,"scriptSizeBytes":560} +unionWith.growing.14 {"exBudgetCPU":466831930,"exBudgetMemory":1003176,"scriptSizeBytes":578} +unionWith.growing.15 {"exBudgetCPU":526694346,"exBudgetMemory":1129688,"scriptSizeBytes":597} +unionWith.growing.16 {"exBudgetCPU":590681770,"exBudgetMemory":1264792,"scriptSizeBytes":615} +unionWith.growing.17 {"exBudgetCPU":658794202,"exBudgetMemory":1408488,"scriptSizeBytes":633} unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":226} -unionWithData const.applied {"exBudgetCPU":22822970,"exBudgetMemory":53208,"scriptSizeBytes":319} -isZero.itself {"exBudgetCPU":59646,"exBudgetMemory":300,"scriptSizeBytes":6} -isZero.true {"exBudgetCPU":31635462,"exBudgetMemory":73457,"scriptSizeBytes":460} -isZero.false {"exBudgetCPU":3196026,"exBudgetMemory":6588,"scriptSizeBytes":71} +unionWithData const.applied {"exBudgetCPU":22197737,"exBudgetMemory":51108,"scriptSizeBytes":311} equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} -equality.triviallyTrue {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} -equality.triviallyFalse {"exBudgetCPU":11575395,"exBudgetMemory":25036,"scriptSizeBytes":222} -equality.swappedTokensTrue {"exBudgetCPU":51124512,"exBudgetMemory":115372,"scriptSizeBytes":471} -equality.swappedSymbolsTrue {"exBudgetCPU":39904171,"exBudgetMemory":88168,"scriptSizeBytes":462} -equality.growing.1 {"exBudgetCPU":13306769,"exBudgetMemory":28964,"scriptSizeBytes":212} -equality.growing.2 {"exBudgetCPU":51094016,"exBudgetMemory":115372,"scriptSizeBytes":466} -equality.growing.3 {"exBudgetCPU":77145504,"exBudgetMemory":172776,"scriptSizeBytes":497} -equality.growing.4 {"exBudgetCPU":111447008,"exBudgetMemory":247364,"scriptSizeBytes":529} -equality.growing.5 {"exBudgetCPU":153998528,"exBudgetMemory":339136,"scriptSizeBytes":560} -equality.growing.6 {"exBudgetCPU":204800064,"exBudgetMemory":448092,"scriptSizeBytes":591} -equality.growing.7 {"exBudgetCPU":263851616,"exBudgetMemory":574232,"scriptSizeBytes":622} -equality.growing.8 {"exBudgetCPU":331153184,"exBudgetMemory":717556,"scriptSizeBytes":654} -equality.growing.9 {"exBudgetCPU":406704768,"exBudgetMemory":878064,"scriptSizeBytes":685} -equality.growing.10 {"exBudgetCPU":490506368,"exBudgetMemory":1055756,"scriptSizeBytes":716} -equality.growing.11 {"exBudgetCPU":582557984,"exBudgetMemory":1250632,"scriptSizeBytes":747} -equality.growing.12 {"exBudgetCPU":682859616,"exBudgetMemory":1462692,"scriptSizeBytes":779} -equality.growing.13 {"exBudgetCPU":791411264,"exBudgetMemory":1691936,"scriptSizeBytes":810} -equality.growing.14 {"exBudgetCPU":908212928,"exBudgetMemory":1938364,"scriptSizeBytes":841} -equality.growing.15 {"exBudgetCPU":1033264608,"exBudgetMemory":2201976,"scriptSizeBytes":872} -equality.growing.16 {"exBudgetCPU":1166566304,"exBudgetMemory":2482772,"scriptSizeBytes":904} -equality.growing.17 {"exBudgetCPU":1308118016,"exBudgetMemory":2780752,"scriptSizeBytes":935} -normalize.identity {"exBudgetCPU":33656200,"exBudgetMemory":76346,"scriptSizeBytes":457} -normalize.empty {"exBudgetCPU":31336597,"exBudgetMemory":72925,"scriptSizeBytes":456} -assertSorted.succeeds {"exBudgetCPU":40578574,"exBudgetMemory":97314,"scriptSizeBytes":532} -assertSorted.fails on malsorted symbols {"exBudgetCPU":28443494,"exBudgetMemory":62290,"scriptSizeBytes":348} -assertSorted.fails on zero quantities {"exBudgetCPU":28508984,"exBudgetMemory":62224,"scriptSizeBytes":531} +equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} +equality.swappedTokensTrue {"exBudgetCPU":49963365,"exBudgetMemory":111472,"scriptSizeBytes":466} +equality.swappedSymbolsTrue {"exBudgetCPU":38743024,"exBudgetMemory":84268,"scriptSizeBytes":457} +equality.growing.1 {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.growing.2 {"exBudgetCPU":49932869,"exBudgetMemory":111472,"scriptSizeBytes":461} +equality.growing.3 {"exBudgetCPU":75448443,"exBudgetMemory":167076,"scriptSizeBytes":496} +equality.growing.4 {"exBudgetCPU":109214033,"exBudgetMemory":239864,"scriptSizeBytes":532} +equality.growing.5 {"exBudgetCPU":151229639,"exBudgetMemory":329836,"scriptSizeBytes":567} +equality.growing.6 {"exBudgetCPU":201495261,"exBudgetMemory":436992,"scriptSizeBytes":602} +equality.growing.7 {"exBudgetCPU":260010899,"exBudgetMemory":561332,"scriptSizeBytes":637} +equality.growing.8 {"exBudgetCPU":326776553,"exBudgetMemory":702856,"scriptSizeBytes":673} +equality.growing.9 {"exBudgetCPU":401792223,"exBudgetMemory":861564,"scriptSizeBytes":708} +equality.growing.10 {"exBudgetCPU":485057909,"exBudgetMemory":1037456,"scriptSizeBytes":743} +equality.growing.11 {"exBudgetCPU":576573611,"exBudgetMemory":1230532,"scriptSizeBytes":778} +equality.growing.12 {"exBudgetCPU":676339329,"exBudgetMemory":1440792,"scriptSizeBytes":814} +equality.growing.13 {"exBudgetCPU":784355063,"exBudgetMemory":1668236,"scriptSizeBytes":849} +equality.growing.14 {"exBudgetCPU":900620813,"exBudgetMemory":1912864,"scriptSizeBytes":884} +equality.growing.15 {"exBudgetCPU":1025136579,"exBudgetMemory":2174676,"scriptSizeBytes":919} +equality.growing.16 {"exBudgetCPU":1157902361,"exBudgetMemory":2453672,"scriptSizeBytes":955} +equality.growing.17 {"exBudgetCPU":1298918159,"exBudgetMemory":2749852,"scriptSizeBytes":990} +normalize.identity {"exBudgetCPU":51338039,"exBudgetMemory":118144,"scriptSizeBytes":620} +normalize.empty {"exBudgetCPU":30711364,"exBudgetMemory":70825,"scriptSizeBytes":447} +assertSorted.succeeds {"exBudgetCPU":39953341,"exBudgetMemory":95214,"scriptSizeBytes":523} +assertSorted.fails on malsorted symbols {"exBudgetCPU":28443494,"exBudgetMemory":62290,"scriptSizeBytes":340} +assertSorted.fails on zero quantities {"exBudgetCPU":28508984,"exBudgetMemory":62224,"scriptSizeBytes":522} assertSorted.fails on empty token map {"exBudgetCPU":1650103,"exBudgetMemory":455,"scriptSizeBytes":262} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index 25c72fd4d..09c783367 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -172,9 +172,6 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cf, #a145746f6b656e01) ]) unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -isZero.itself (program 1.0.0 (force nullList)) -isZero.true (program 1.0.0 True) -isZero.false (program 1.0.0 False) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index 7cd3892f4..de6a0e85f 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -1,76 +1,73 @@ -singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i3 (mapData (i4 i2 i1))) (bData #c0) (bData #736f6d65746f6b656e) (iData 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsData i1 (iData 0)) (delay i6) (delay (i4 i3 (mapData (i4 i2 i1)))))) (bData #c0) (bData #736f6d65746f6b656e) (iData 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> (\i0 -> i12 (bData i15) (mapData i1)) (i11 (bData i15) (iData i1))) 1) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> \i0 -> (\i0 -> i14 (bData i4) (mapData i1)) (i13 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i19 #736f6d65746f6b656e 1) (i13 i19 i20 1)) #c7 i20) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) -valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) (i17 #c5 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i23 1)) (i17 #c1 i23 1)) (i17 #c2 i23 1)) (i17 #c3 i23 1)) (i17 #c4 i23 1)) (i17 #c5 i23 1)) (i17 #c6 i23 1)) #c7 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) (i17 #ce i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 #736f6d65746f6b656e 1) (i17 i16 i24 1)) (i17 #c1 i24 1)) (i17 #c2 i24 1)) (i17 #c3 i24 1)) (i17 #c4 i24 1)) (i17 #c5 i24 1)) (i17 #c6 i24 1)) (i17 i23 i24 1)) (i17 #c8 i24 1)) (i17 #c9 i24 1)) (i17 #ca i24 1)) (i17 #cb i24 1)) (i17 #cc i24 1)) (i17 #cd i24 1)) (i17 #ce i24 1)) (i17 #cf i24 1)) i23 i24) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> i11 (bData i14) (mapData i1)) ((\i0 -> i11 (bData i15) (iData i1)) 1)) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> i12 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i12 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) -unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i16 #736f6d65746f6b656e 1) (i10 i16 #6f74686572746f6b656e 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 i16 1) (i10 #c7 i16 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 i16 1) (i10 #c7 i16 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 i20 1) (i14 i13 #746f6b656e 1)) (i14 #c7 i20 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i21 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 #c7 i21 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) -unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 i22 1) (i15 i13 i14 1)) (i15 #c1 i14 1)) (i15 #c2 i14 1)) (i15 #c3 i14 1)) (i15 #c4 i14 1)) (i15 #c5 i14 1)) (i15 #c6 i14 1)) (i15 i21 i14 1)) (i15 #c8 i14 1)) (i15 #c9 i14 1)) (i15 #ca i14 1)) (i15 #cb i14 1)) (i15 #cc i14 1)) (i15 #cd i14 1)) (i15 #ce i14 1)) (i15 #cf i14 1)) (i15 i21 i22 1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #736f6d65746f6b656e)) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 #736f6d65746f6b656e 1)) (i10 i11 (i12 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 (i15 i19 1)) (i14 i13 (i15 #746f6b656e 1))) (i14 #c7 (i15 i19 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c6 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) -unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i16 i17 1) (i10 i16 i17 1)) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -isZero.itself (program 1.0.0 (force nullList)) -isZero.true (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 ((\i0 -> (\i0 -> i4 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i10 (i4 i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i4 (\i0 -> force (i10 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i19 i20 1) (i13 i19 i20 1)))) (force nullList)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -isZero.false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force nullList ((\i0 -> \i0 -> \i0 -> (\i0 -> i5 (bData i4) (mapData i1)) (i4 (bData i2) (iData i1))) #c0 #736f6d65746f6b656e 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 #736f6d65746f6b656e 1) (i7 i13 #6f74686572746f6b656e 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0)) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i21 1) (i14 i20 i13 1)) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i21 1) (i14 i13 i21 1)) (i1 addInteger (i14 i13 i21 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i13 i14 1) (i7 i13 i14 1)) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1)) (i1 addInteger (i14 i20 i13 1) (i14 i20 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 i13 1) (i15 i14 i22 1)) (i15 i21 i22 1)) (i1 addInteger (i1 addInteger (i15 i14 i13 1) (i15 i14 i22 1)) (i15 i21 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c1) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 i13 1) (i16 i14 i23 1)) (i16 i15 i23 1)) (i16 i22 i23 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 i13 1) (i16 i14 i23 1)) (i16 i15 i23 1)) (i16 i22 i23 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c2) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 i13 1) (i17 i14 i24 1)) (i17 i15 i24 1)) (i17 i16 i24 1)) (i17 i23 i24 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 i13 1) (i17 i14 i24 1)) (i17 i15 i24 1)) (i17 i16 i24 1)) (i17 i23 i24 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c3) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 i13 1) (i18 i14 i25 1)) (i18 i15 i25 1)) (i18 i16 i25 1)) (i18 i17 i25 1)) (i18 i24 i25 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 i13 1) (i18 i14 i25 1)) (i18 i15 i25 1)) (i18 i16 i25 1)) (i18 i17 i25 1)) (i18 i24 i25 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c4) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 i13 1) (i19 i14 i26 1)) (i19 i15 i26 1)) (i19 i16 i26 1)) (i19 i17 i26 1)) (i19 i18 i26 1)) (i19 i25 i26 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 i13 1) (i19 i14 i26 1)) (i19 i15 i26 1)) (i19 i16 i26 1)) (i19 i17 i26 1)) (i19 i18 i26 1)) (i19 i25 i26 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c5) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 i13 1) (i20 i14 i27 1)) (i20 i15 i27 1)) (i20 i16 i27 1)) (i20 i17 i27 1)) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 i13 1) (i20 i14 i27 1)) (i20 i15 i27 1)) (i20 i16 i27 1)) (i20 i17 i27 1)) (i20 i18 i27 1)) (i20 i19 i27 1)) (i20 i26 i27 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c6) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 i13 1) (i21 i14 i28 1)) (i21 i15 i28 1)) (i21 i16 i28 1)) (i21 i17 i28 1)) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 i13 1) (i21 i14 i28 1)) (i21 i15 i28 1)) (i21 i16 i28 1)) (i21 i17 i28 1)) (i21 i18 i28 1)) (i21 i19 i28 1)) (i21 i20 i28 1)) (i21 i27 i28 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 i13 1) (i22 i14 i29 1)) (i22 i15 i29 1)) (i22 i16 i29 1)) (i22 i17 i29 1)) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 i13 1) (i22 i14 i29 1)) (i22 i15 i29 1)) (i22 i16 i29 1)) (i22 i17 i29 1)) (i22 i18 i29 1)) (i22 i19 i29 1)) (i22 i20 i29 1)) (i22 i21 i29 1)) (i22 i28 i29 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c8) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 i13 1) (i23 i14 i30 1)) (i23 i15 i30 1)) (i23 i16 i30 1)) (i23 i17 i30 1)) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 i13 1) (i23 i14 i30 1)) (i23 i15 i30 1)) (i23 i16 i30 1)) (i23 i17 i30 1)) (i23 i18 i30 1)) (i23 i19 i30 1)) (i23 i20 i30 1)) (i23 i21 i30 1)) (i23 i22 i30 1)) (i23 i29 i30 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c9) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 i13 1) (i24 i14 i31 1)) (i24 i15 i31 1)) (i24 i16 i31 1)) (i24 i17 i31 1)) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 i13 1) (i24 i14 i31 1)) (i24 i15 i31 1)) (i24 i16 i31 1)) (i24 i17 i31 1)) (i24 i18 i31 1)) (i24 i19 i31 1)) (i24 i20 i31 1)) (i24 i21 i31 1)) (i24 i22 i31 1)) (i24 i23 i31 1)) (i24 i30 i31 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ca) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 i13 1) (i25 i14 i32 1)) (i25 i15 i32 1)) (i25 i16 i32 1)) (i25 i17 i32 1)) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 i13 1) (i25 i14 i32 1)) (i25 i15 i32 1)) (i25 i16 i32 1)) (i25 i17 i32 1)) (i25 i18 i32 1)) (i25 i19 i32 1)) (i25 i20 i32 1)) (i25 i21 i32 1)) (i25 i22 i32 1)) (i25 i23 i32 1)) (i25 i24 i32 1)) (i25 i31 i32 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cb) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 i13 1) (i26 i14 i33 1)) (i26 i15 i33 1)) (i26 i16 i33 1)) (i26 i17 i33 1)) (i26 i18 i33 1)) (i26 i19 i33 1)) (i26 i20 i33 1)) (i26 i21 i33 1)) (i26 i22 i33 1)) (i26 i23 i33 1)) (i26 i24 i33 1)) (i26 i25 i33 1)) (i26 i32 i33 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cc) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 i13 1) (i27 i14 i34 1)) (i27 i15 i34 1)) (i27 i16 i34 1)) (i27 i17 i34 1)) (i27 i18 i34 1)) (i27 i19 i34 1)) (i27 i20 i34 1)) (i27 i21 i34 1)) (i27 i22 i34 1)) (i27 i23 i34 1)) (i27 i24 i34 1)) (i27 i25 i34 1)) (i27 i26 i34 1)) (i27 i33 i34 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cd) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 i13 1) (i28 i14 i35 1)) (i28 i15 i35 1)) (i28 i16 i35 1)) (i28 i17 i35 1)) (i28 i18 i35 1)) (i28 i19 i35 1)) (i28 i20 i35 1)) (i28 i21 i35 1)) (i28 i22 i35 1)) (i28 i23 i35 1)) (i28 i24 i35 1)) (i28 i25 i35 1)) (i28 i26 i35 1)) (i28 i27 i35 1)) (i28 i34 i35 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #ce) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 i13 1) (i29 i14 i36 1)) (i29 i15 i36 1)) (i29 i16 i36 1)) (i29 i17 i36 1)) (i29 i18 i36 1)) (i29 i19 i36 1)) (i29 i20 i36 1)) (i29 i21 i36 1)) (i29 i22 i36 1)) (i29 i23 i36 1)) (i29 i24 i36 1)) (i29 i25 i36 1)) (i29 i26 i36 1)) (i29 i27 i36 1)) (i29 i28 i36 1)) (i29 i35 i36 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #cf) #746f6b656e)) -normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 #c0 i18 1) (i12 #c7 i18 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i18 i19 1) (i12 i18 i19 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 i23 1) (i17 #c7 i23 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i8 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i22 (i16 i1) (i2 (i17 i1)))))) i2) (i14 #c7 i20 1) (i14 #c0 i20 1))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i13 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i7 (i10 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force trace)) "unsorted map") (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i23 i24 1) (i17 i23 i24 1))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> \i0 -> i4 i3 (i5 i2 i1))) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) +equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i15 (i16 i13 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i13 (i16 i20 1))) (i1 addInteger (i14 i13 (i16 i20 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay (i7 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i15 (i1 i2) (delay (force (i9 "unsorted map" (delay error)))) (delay (i4 (i17 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i17 (i16 i1))))))) i1 (\i0 -> False))) (delay (force (i5 "Negative Value" (delay error)))))) ((\i0 -> (\i0 -> i7 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i13 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i7 (\i0 -> force (i13 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i11 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 #c0 (i17 i21 1)) (i16 #c7 (i17 i21 1))))) (\i0 -> i6 (\i0 -> \i0 -> force (i10 i1 (delay True) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i14 i1)))))))))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (force trace)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i20 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i8 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i21 (i16 i1) (i2 (i17 i1)))))) i2) (i14 #c7 (i15 i19 1)) (i14 #c0 (i15 i19 1)))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i13 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i7 (i10 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force trace)) "unsorted map") (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i18 (i19 i23 1)) (i17 i18 (i19 i23 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i10 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i18) (bData i2) (mapData i1)) #c0 i14)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay (force (i9 i10 (delay error)))) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i10 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force trace)) "unsorted map") (force tailList)) (force (force fstPair))) (force headList)) [ ])) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 07f8943c1..9e4f55b47 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -31,8 +31,8 @@ import Plutarch.Api.V1 ( PTxInInfo, PTxInfo, PValue, - ValueNormalization (Normalized), - ValueState (Sorted), + ValueAmountGuarantees (NonZero, Positive), + ValueKeyGuarantees (Sorted), ) import qualified Plutarch.Api.V1.AssocMap as AssocMap import qualified Plutarch.Api.V1.Value as PValue @@ -67,21 +67,21 @@ spec = do _ -> perror describe "value" $ do plutarchDevFlagDescribe . pgoldenSpec $ do - let pmint = PValue.psingleton # pconstant "c0" # pconstant "sometoken" # 1 - pmintOtherToken = PValue.psingleton # pconstant "c0" # pconstant "othertoken" # 1 - pmintOtherSymbol = PValue.psingleton # pconstant "c7" # pconstant "sometoken" # 1 - growingSymbols, symbols :: [EnclosedTerm (PValue ( 'Sorted 'Normalized))] + let pmint = PValue.pconstantPositiveSingleton (pconstant "c0") (pconstant "sometoken") 1 + pmintOtherToken = PValue.pconstantPositiveSingleton (pconstant "c0") (pconstant "othertoken") 1 + pmintOtherSymbol = PValue.pconstantPositiveSingleton (pconstant "c7") (pconstant "sometoken") 1 + growingSymbols, symbols :: [EnclosedTerm (PValue 'Sorted 'Positive)] growingSymbols = scanl (\s v -> EnclosedTerm $ getEnclosedTerm s <> getEnclosedTerm v) (EnclosedTerm pmint) symbols symbols = (\n -> EnclosedTerm (toSymbolicValue n)) <$> [0 .. 15] - toSymbolicValue :: Integer -> ClosedTerm (PValue ( 'Sorted 'Normalized)) + toSymbolicValue :: Integer -> ClosedTerm (PValue 'Sorted 'Positive) toSymbolicValue n = - PValue.psingleton # pconstant (fromString $ "c" <> showHex n "") # pconstant "token" # 1 + PValue.pconstantPositiveSingleton (pconstant $ fromString $ "c" <> showHex n "") (pconstant "token") 1 "singleton" @| pmint @-> \p -> - plift p @?= mint + plift (PValue.pforgetPositive p) @?= mint "singletonData" @| PValue.psingletonData # pdata (pconstant "c0") # pdata (pconstant "sometoken") # pdata 1 @-> \p -> plift p @?= mint @@ -121,12 +121,8 @@ spec = do plift (PValue.pnormalize #$ u # plam const # pmint # pmint) @?= mint "applied" @| PValue.punionWithData # plam const # pmint # pmint @-> \p -> plift (PValue.pnormalize # p) @?= mint - "isZero" @\ do - "itself" @| PValue.pisZero @-> \z -> passertNot (z # pmint) - "true" @| PValue.pisZero # (PValue.pnormalize #$ PValue.punionWith # plam (-) # pmint # pmint) @-> passert - "false" @| PValue.pisZero # pmint @-> passertNot "equality" @\ do - "itself" @| plam ((#==) @(PValue ( 'Sorted 'Normalized))) @-> \eq -> passert (eq # pmint # pmint) + "itself" @| plam ((#==) @(PValue 'Sorted 'Positive)) @-> \eq -> passert (eq # pmint # pmint) "triviallyTrue" @| pmint #== pmint @-> passert "triviallyFalse" @| pmint #== pmintOtherToken @-> passertNot "swappedTokensTrue" @@ -146,7 +142,7 @@ spec = do ) "normalize" @\ do "identity" - @| PValue.pnormalize # (pmint <> pmintOtherSymbol) + @| PValue.passertPositive # (PValue.pnormalize # (pmint <> pmintOtherSymbol)) @-> \v -> passert (v #== pmint <> pmintOtherSymbol) "empty" @| PValue.pnormalize # (PValue.punionWith # plam (-) # pmint # pmint) @@ -330,7 +326,7 @@ getTxInfo = plam $ \ctx -> pfield @"txInfo" # ctx -getMint :: Term s (PAsData PTxInfo :--> PAsData (PValue ( 'Sorted 'Normalized))) +getMint :: Term s (PAsData PTxInfo :--> PAsData (PValue 'Sorted 'NonZero)) getMint = plam $ \info -> pfield @"mint" # info @@ -357,7 +353,7 @@ inputCredentialHash = in phead #$ psndBuiltin #$ pasConstr # pforgetData credential -- | Get first CurrencySymbol from Value -getSym :: Term s (PValue ( 'Sorted 'Normalized) :--> PAsData PCurrencySymbol) +getSym :: Term s (PValue 'Sorted 'NonZero :--> PAsData PCurrencySymbol) getSym = plam $ \v -> pfstBuiltin #$ phead # pto (pto v) From 343036492c4625b8c1d85c2776438162c95344e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 27 Apr 2022 16:01:28 -0400 Subject: [PATCH 435/584] No need to resort the currency symbols in passertPositive --- Plutarch/Api/V1/Value.hs | 4 ++-- plutarch-test/goldens/api.value.dev=false.bench.golden | 2 +- plutarch-test/goldens/api.value.dev=false.uplc.golden | 2 +- plutarch-test/goldens/api.value.dev=true.bench.golden | 2 +- plutarch-test/goldens/api.value.dev=true.uplc.golden | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 53eea8d40..ed6dea308 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -242,8 +242,8 @@ passertPositive = phoistAcyclic $ # (plam $ \submap -> AssocMap.pall # plam (0 #<) # submap) # pto value ) - (pcon $ PValue $ AssocMap.passertSorted # pto value) - (ptraceError "Negative Value") + (punsafeFrom $ pto value) + (ptraceError "Negative amount in Value") -- | Forget the knowledge of value's positivity. pforgetPositive :: Term s (PValue 'Sorted 'Positive) -> Term s (PValue 'Sorted 'NonZero) diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index c02d34f24..ea23e68d7 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -65,7 +65,7 @@ equality.growing.14 {"exBudgetCPU":900620813,"exBudgetMemory":1912864,"scriptSiz equality.growing.15 {"exBudgetCPU":1025136579,"exBudgetMemory":2174676,"scriptSizeBytes":919} equality.growing.16 {"exBudgetCPU":1157902361,"exBudgetMemory":2453672,"scriptSizeBytes":955} equality.growing.17 {"exBudgetCPU":1298918159,"exBudgetMemory":2749852,"scriptSizeBytes":990} -normalize.identity {"exBudgetCPU":51218947,"exBudgetMemory":117744,"scriptSizeBytes":576} +normalize.identity {"exBudgetCPU":45981657,"exBudgetMemory":105689,"scriptSizeBytes":533} normalize.empty {"exBudgetCPU":30711364,"exBudgetMemory":70825,"scriptSizeBytes":447} assertSorted.succeeds {"exBudgetCPU":39744930,"exBudgetMemory":94514,"scriptSizeBytes":477} assertSorted.fails on malsorted symbols {"exBudgetCPU":28293494,"exBudgetMemory":62258,"scriptSizeBytes":294} diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden index 6c035b68c..9e9d9f17b 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.golden @@ -65,7 +65,7 @@ equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay (i6 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i14 (i1 i2) (delay error) (delay (i4 (i16 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i16 (i15 i1))))))) i1 (\i0 -> False))) (delay error))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i20 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay error))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i20 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i3) (delay (i19 (i14 i1) (i2 (i15 i1)))))) i2) (i12 #c7 (i13 i17 1)) (i12 #c0 (i13 i17 1)))) (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i12 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay error) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i5 (i8 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index 5e7882676..0e8d3145a 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -65,7 +65,7 @@ equality.growing.14 {"exBudgetCPU":900620813,"exBudgetMemory":1912864,"scriptSiz equality.growing.15 {"exBudgetCPU":1025136579,"exBudgetMemory":2174676,"scriptSizeBytes":919} equality.growing.16 {"exBudgetCPU":1157902361,"exBudgetMemory":2453672,"scriptSizeBytes":955} equality.growing.17 {"exBudgetCPU":1298918159,"exBudgetMemory":2749852,"scriptSizeBytes":990} -normalize.identity {"exBudgetCPU":51338039,"exBudgetMemory":118144,"scriptSizeBytes":620} +normalize.identity {"exBudgetCPU":45981657,"exBudgetMemory":105689,"scriptSizeBytes":565} normalize.empty {"exBudgetCPU":30711364,"exBudgetMemory":70825,"scriptSizeBytes":447} assertSorted.succeeds {"exBudgetCPU":39953341,"exBudgetMemory":95214,"scriptSizeBytes":523} assertSorted.fails on malsorted symbols {"exBudgetCPU":28443494,"exBudgetMemory":62290,"scriptSizeBytes":340} diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index de6a0e85f..98aa4bc15 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -65,7 +65,7 @@ equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay (i7 (\i0 -> \i0 -> force (i11 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i15 (i1 i2) (delay (force (i9 "unsorted map" (delay error)))) (delay (i4 (i17 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i17 (i16 i1))))))) i1 (\i0 -> False))) (delay (force (i5 "Negative Value" (delay error)))))) ((\i0 -> (\i0 -> i7 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i13 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i7 (\i0 -> force (i13 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i11 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i16 #c0 (i17 i21 1)) (i16 #c7 (i17 i21 1))))) (\i0 -> i6 (\i0 -> \i0 -> force (i10 i1 (delay True) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i14 i1)))))))))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (force trace)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i20 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay (force (force trace "Negative amount in Value" (delay error)))))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i20 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i8 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i21 (i16 i1) (i2 (i17 i1)))))) i2) (i14 #c7 (i15 i19 1)) (i14 #c0 (i15 i19 1)))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i13 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i7 (i10 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force trace)) "unsorted map") (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) From 6dd6c3722e44ef66b9a35e97662650ee09356110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 3 May 2022 13:59:59 -0400 Subject: [PATCH 436/584] Rebase fixes --- Plutarch/Api/V1/AssocMap.hs | 12 +++++++----- Plutarch/Api/V1/Value.hs | 16 ++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index e00b613ba..6f35f56d0 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -63,7 +63,7 @@ import Plutarch.Prelude ( PConstantData, PEither (..), PEq ((#==)), - PIsData (..), + PIsData, PLiftData, PListLike (pcons, pnil), PMatch (pmatch), @@ -74,6 +74,8 @@ import Plutarch.Prelude ( PlutusType, S, Term, + pdata, + pfromData, pfstBuiltin, phoistAcyclic, pif, @@ -89,7 +91,7 @@ import Plutarch.Prelude ( ) import Plutarch.Rec (ScottEncoded, ScottEncoding, field, letrec) import Plutarch.Show (PShow) -import Plutarch.Unsafe (punsafeFrom) +import Plutarch.Unsafe (punsafeDowncast) import qualified Rank2.TH @@ -222,7 +224,7 @@ rebuildAtKey :: ) rebuildAtKey = phoistAcyclic $ plam $ \handler key map -> - punsafeFrom $ + punsafeDowncast $ precList ( \self x xs -> plet (pfromData $ pfstBuiltin # x) $ \k -> @@ -242,7 +244,7 @@ rebuildAtKey = phoistAcyclic $ -- | Construct an empty 'PMap'. pempty :: Term (s :: S) (PMap k v) -pempty = punsafeFrom pnil +pempty = punsafeDowncast pnil -- | Construct a singleton 'PMap' with the given key and value. psingleton :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v) @@ -251,7 +253,7 @@ psingleton = phoistAcyclic $ plam $ \key value -> psingletonData # pdata key # p -- | Construct a singleton 'PMap' with the given data-encoded key and value. psingletonData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v) psingletonData = phoistAcyclic $ - plam $ \key value -> punsafeFrom (pcons # (ppairDataBuiltin # key # value) # pnil) + plam $ \key value -> punsafeDowncast (pcons # (ppairDataBuiltin # key # value) # pnil) -- | Construct a 'PMap' from a list of key-value pairs, sorted by ascending key data. pfromAscList :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PBuiltinMap k v :--> PMap k v) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index ed6dea308..861a5d7a2 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -32,7 +32,7 @@ import Plutarch.Lift ( PLifted, PUnsafeLiftDecl, ) -import Plutarch.Unsafe (punsafeFrom) +import Plutarch.Unsafe (punsafeDowncast) import Plutarch.Prelude hiding (psingleton) @@ -85,7 +85,7 @@ instance PEq (PValue 'Sorted 'NoGuarantees) where a #== b = AssocMap.pall # (AssocMap.pall # plam (#== 0)) # pto (punionWith # plam (-) # a # b) instance Semigroup (Term s (PValue 'Sorted 'Positive)) where - a <> b = punsafeFrom (pto $ punionWith # plam (+) # a # b) + a <> b = punsafeDowncast (pto $ punionWith # plam (+) # a # b) instance Semigroup (Term s (PValue 'Sorted 'NonZero)) where a <> b = pnormalize #$ punionWith # plam (+) # a # b @@ -107,7 +107,7 @@ pconstantSingleton :: ClosedTerm (PValue 'Sorted 'NonZero) pconstantSingleton symbol token amount | plift amount == 0 = mempty - | otherwise = punsafeFrom (AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) + | otherwise = punsafeDowncast (AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) -- | Construct a constant singleton 'PValue' containing only the given positive quantity of the given currency. pconstantPositiveSingleton :: @@ -118,7 +118,7 @@ pconstantPositiveSingleton :: pconstantPositiveSingleton symbol token amount | plift amount == 0 = mempty | plift amount < 0 = error "Negative amount" - | otherwise = punsafeFrom (AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) + | otherwise = punsafeDowncast (AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. psingleton :: @@ -130,7 +130,7 @@ psingleton = phoistAcyclic $ pif (amount #== 0) mempty - (punsafeFrom $ AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) + (punsafeDowncast $ AssocMap.psingleton # symbol #$ AssocMap.psingleton # token # amount) {- | Construct a singleton 'PValue' containing only the given quantity of the given currency, taking data-encoded parameters. @@ -146,7 +146,7 @@ psingletonData = phoistAcyclic $ pif (amount #== zeroData) mempty - ( punsafeFrom + ( punsafeDowncast ( AssocMap.psingletonData # symbol #$ pdata $ AssocMap.psingletonData # token # amount @@ -242,12 +242,12 @@ passertPositive = phoistAcyclic $ # (plam $ \submap -> AssocMap.pall # plam (0 #<) # submap) # pto value ) - (punsafeFrom $ pto value) + (punsafeDowncast $ pto value) (ptraceError "Negative amount in Value") -- | Forget the knowledge of value's positivity. pforgetPositive :: Term s (PValue 'Sorted 'Positive) -> Term s (PValue 'Sorted 'NonZero) -pforgetPositive v = punsafeFrom (pto v) +pforgetPositive v = punsafeDowncast (pto v) zeroData :: ClosedTerm (PAsData PInteger) zeroData = pdata 0 From 5969e06adc91455af95308dd9c9f985ef5ac9faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 3 May 2022 14:01:42 -0400 Subject: [PATCH 437/584] Removed pmaybe, peither, pmapEitherWithKey[Data] of dubious efficiency --- Plutarch/Api/V1/AssocMap.hs | 48 +------------------ Plutarch/Either.hs | 21 +------- Plutarch/Maybe.hs | 9 ---- plutarch-test/goldens/maybe.bench.golden | 4 +- plutarch-test/goldens/maybe.uplc.eval.golden | 4 +- plutarch-test/goldens/maybe.uplc.golden | 4 +- .../plutarch-base/Plutarch/MaybeSpec.hs | 8 +--- 7 files changed, 7 insertions(+), 91 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 6f35f56d0..fd28cbb17 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -30,8 +30,6 @@ module Plutarch.Api.V1.AssocMap ( pfilter, pmapMaybe, pmapMaybeData, - pmapEitherWithKey, - pmapEitherWithKeyData, -- * Combining pdifference, @@ -43,7 +41,6 @@ import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap import Plutarch.Builtin (PBuiltinList (PCons, PNil), PBuiltinMap, ppairDataBuiltin) -import Plutarch.Either (peither) import Plutarch.Lift ( PConstantDecl, PConstantRepr, @@ -55,13 +52,12 @@ import Plutarch.Lift ( ) import qualified Plutarch.List as List import Plutarch.Prelude ( - DerivePNewtype (..), + DerivePNewtype (DerivePNewtype), PAsData, PBool (PFalse), PBuiltinPair, PCon (pcon), PConstantData, - PEither (..), PEq ((#==)), PIsData, PLiftData, @@ -69,7 +65,6 @@ import Plutarch.Prelude ( PMatch (pmatch), PMaybe (..), POrd ((#<)), - PPair (..), PType, PlutusType, S, @@ -419,44 +414,3 @@ pmapMaybeData = phoistAcyclic $ ) (const pnil) # pto map - --- | Map keys/values and separate the @Left@ and @Right@ results. -pmapEitherWithKey :: - (PIsData k, PIsData a, PIsData b, PIsData c) => - Term (s :: S) ((k :--> a :--> PEither b c) :--> PMap k a :--> PPair (PMap k b) (PMap k c)) -pmapEitherWithKey = phoistAcyclic $ - plam $ \f -> - pmapEitherWithKeyData #$ plam $ \k v -> - bidata #$ f # pfromData k # pfromData v - -bidata :: - forall (s :: S) (a :: PType) (b :: PType). - (PIsData a, PIsData b) => - Term (s :: S) (PEither a b :--> PEither (PAsData a) (PAsData b)) -bidata = peither # plam (pcon . PLeft . pdata) # plam (pcon . PRight . pdata) - --- | Map data-encoded keys/values and separate the @Left@ and @Right@ results. -pmapEitherWithKeyData :: - (PIsData k, PIsData a, PIsData b, PIsData c) => - Term - (s :: S) - ( (PAsData k :--> PAsData a :--> PEither (PAsData b) (PAsData c)) - :--> PMap k a - :--> PPair (PMap k b) (PMap k c) - ) -pmapEitherWithKeyData = phoistAcyclic $ - plam $ \f map -> - ( flip pmatch $ \(PPair lefts rights) -> - pcon $ PPair (pcon $ PMap lefts) (pcon $ PMap rights) - ) - $ precList - ( \self x xs -> - pmatch (self # xs) $ \(PPair lefts rights) -> - plet (pfstBuiltin # x) $ \key -> - peither - # (plam $ \l -> pcon $ PPair (pcons # (ppairDataBuiltin # key # l) # lefts) rights) - # (plam $ \r -> pcon $ PPair lefts (pcons # (ppairDataBuiltin # key # r) # rights)) - # (f # key #$ psndBuiltin # x) - ) - (const $ pcon $ PPair pnil pnil) - # pto map diff --git a/Plutarch/Either.hs b/Plutarch/Either.hs index 7356a8ff2..73ea08d61 100644 --- a/Plutarch/Either.hs +++ b/Plutarch/Either.hs @@ -1,18 +1,8 @@ -module Plutarch.Either (PEither (..), peither) where +module Plutarch.Either (PEither (PLeft, PRight)) where import qualified GHC.Generics as GHC import Generics.SOP (Generic, HasDatatypeInfo, I (I)) -import Plutarch ( - PType, - PlutusType, - S, - Term, - phoistAcyclic, - plam, - pmatch, - (#), - type (:-->), - ) +import Plutarch (PType, PlutusType, S, Term) import Plutarch.Bool (PEq) import Plutarch.Show (PShow) @@ -21,10 +11,3 @@ data PEither (a :: PType) (b :: PType) (s :: S) | PRight (Term s b) deriving stock (GHC.Generic) deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) - --- | 'PEither' destructor equivalent to 'either' -peither :: Term (s :: S) ((a :--> c) :--> (b :--> c) :--> PEither a b :--> c) -peither = phoistAcyclic $ - plam $ \left right either -> pmatch either $ \case - PLeft x -> left # x - PRight x -> right # x diff --git a/Plutarch/Maybe.hs b/Plutarch/Maybe.hs index 5c4a92469..de30f94f4 100644 --- a/Plutarch/Maybe.hs +++ b/Plutarch/Maybe.hs @@ -1,7 +1,6 @@ module Plutarch.Maybe ( PMaybe (PJust, PNothing), pfromJust, - pmaybe, ) where import qualified GHC.Generics as GHC @@ -15,7 +14,6 @@ import Plutarch ( phoistAcyclic, plam, pmatch, - (#), type (:-->), ) import Plutarch.Bool (PEq) @@ -36,10 +34,3 @@ pfromJust = phoistAcyclic $ plam $ \maybe -> pmatch maybe $ \case PNothing -> perror PJust a -> a - --- | 'PMaybe' destructor equivalent to 'maybe' -pmaybe :: Term (s :: S) (b :--> (a :--> b) :--> PMaybe a :--> b) -pmaybe = phoistAcyclic $ - plam $ \nothing just maybe -> pmatch maybe $ \case - PNothing -> nothing - PJust a -> just # a diff --git a/plutarch-test/goldens/maybe.bench.golden b/plutarch-test/goldens/maybe.bench.golden index 1d17219a3..6693b191c 100644 --- a/plutarch-test/goldens/maybe.bench.golden +++ b/plutarch-test/goldens/maybe.bench.golden @@ -3,6 +3,4 @@ eq.true.just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} eq.false.nothing-just {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":36} eq.false.just-just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} pfromJust.nothing {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":14} -pfromJust.just {"exBudgetCPU":644109,"exBudgetMemory":1801,"scriptSizeBytes":21} -pmaybe.nothing {"exBudgetCPU":792974,"exBudgetMemory":2301,"scriptSizeBytes":34} -pmaybe.just {"exBudgetCPU":1228367,"exBudgetMemory":3103,"scriptSizeBytes":36} \ No newline at end of file +pfromJust.just {"exBudgetCPU":644109,"exBudgetMemory":1801,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.eval.golden b/plutarch-test/goldens/maybe.uplc.eval.golden index fb26d5a65..cc715c6f3 100644 --- a/plutarch-test/goldens/maybe.uplc.eval.golden +++ b/plutarch-test/goldens/maybe.uplc.eval.golden @@ -3,6 +3,4 @@ eq.true.just (program 1.0.0 True) eq.false.nothing-just (program 1.0.0 False) eq.false.just-just (program 1.0.0 False) pfromJust.nothing (program 1.0.0 error) -pfromJust.just (program 1.0.0 True) -pmaybe.nothing (program 1.0.0 True) -pmaybe.just (program 1.0.0 True) \ No newline at end of file +pfromJust.just (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.golden b/plutarch-test/goldens/maybe.uplc.golden index d4a5771f3..f868bbed2 100644 --- a/plutarch-test/goldens/maybe.uplc.golden +++ b/plutarch-test/goldens/maybe.uplc.golden @@ -3,6 +3,4 @@ eq.true.just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger eq.false.nothing-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> i2 42))) eq.false.just-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) pfromJust.nothing (program 1.0.0 ((\i0 -> i1 (\i0 -> i1) (delay error)) (\i0 -> \i0 -> force i1))) -pfromJust.just (program 1.0.0 (equalsInteger ((\i0 -> i1 (\i0 -> i1) (delay error)) (\i0 -> \i0 -> i2 42)) 42)) -pmaybe.nothing (program 1.0.0 (equalsInteger ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) 0 (\i0 -> addInteger i1 1) (\i0 -> \i0 -> force i1)) 0)) -pmaybe.just (program 1.0.0 (equalsInteger ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> i3 i1) (delay i3)) 0 (\i0 -> addInteger i1 1) (\i0 -> \i0 -> i2 41)) 42)) \ No newline at end of file +pfromJust.just (program 1.0.0 (equalsInteger ((\i0 -> i1 (\i0 -> i1) (delay error)) (\i0 -> \i0 -> i2 42)) 42)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs index 32416a540..f5322526c 100644 --- a/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/MaybeSpec.hs @@ -3,7 +3,7 @@ module Plutarch.MaybeSpec (spec) where import Plutarch import Plutarch.Bool (PEq ((#==))) import Plutarch.Integer (PInteger) -import Plutarch.Maybe (PMaybe (PJust, PNothing), pfromJust, pmaybe) +import Plutarch.Maybe (PMaybe (PJust, PNothing), pfromJust) import Plutarch.Test import Test.Hspec @@ -20,9 +20,3 @@ spec = do "pfromJust" @\ do "nothing" @| pfromJust # pcon PNothing @-> pfails "just" @| pfromJust # pcon (PJust 42) #== (42 :: Term _ PInteger) @-> passert - "pmaybe" @\ do - "nothing" @| pmaybe # 0 # psucc # pcon PNothing #== (0 :: Term _ PInteger) @-> passert - "just" @| pmaybe # 0 # psucc # pcon (PJust 41) #== 42 @-> passert - -psucc :: ClosedTerm (PInteger :--> PInteger) -psucc = phoistAcyclic (plam (+ 1)) From 294609f2ce3724af3bb52ab46b484d8dba5b091b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 13:41:31 -0400 Subject: [PATCH 438/584] Removed a (..) import --- Plutarch/Api/V1/AssocMap.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index fd28cbb17..f1e23fcc9 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -63,7 +63,7 @@ import Plutarch.Prelude ( PLiftData, PListLike (pcons, pnil), PMatch (pmatch), - PMaybe (..), + PMaybe (PJust, PNothing), POrd ((#<)), PType, PlutusType, From a3c2ae987b7922561f146dadea3d41889b29167c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 13:48:40 -0400 Subject: [PATCH 439/584] Narrowed the type of fee and UTxO value to Positive --- Plutarch/Api/V1/Contexts.hs | 9 +++++++-- Plutarch/Api/V1/Tx.hs | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 0cb23a9ea..3bcd77908 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -22,7 +22,12 @@ import Plutarch.Api.V1.Scripts (PDatum, PDatumHash) import Plutarch.Api.V1.Time (PPOSIXTimeRange) import Plutarch.Api.V1.Tuple (PTuple) import Plutarch.Api.V1.Tx (PTxId, PTxInInfo, PTxOut, PTxOutRef) -import Plutarch.Api.V1.Value (PCurrencySymbol, PValue, ValueAmountGuarantees (NonZero), ValueKeyGuarantees (Sorted)) +import Plutarch.Api.V1.Value ( + PCurrencySymbol, + PValue, + ValueAmountGuarantees (NonZero, Positive), + ValueKeyGuarantees (Sorted), + ) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, @@ -43,7 +48,7 @@ newtype PTxInfo (s :: S) ( PDataRecord '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- Transaction inputs , "outputs" ':= PBuiltinList (PAsData PTxOut) -- Transaction outputs - , "fee" ':= PValue 'Sorted 'NonZero -- The fee paid by this transaction. + , "fee" ':= PValue 'Sorted 'Positive -- The fee paid by this transaction. , "mint" ':= PValue 'Sorted 'NonZero -- The value minted by the transaction. , "dcert" ':= PBuiltinList (PAsData PDCert) -- Digests of the certificates included in this transaction. , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- Staking withdrawals diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 07e1ce431..324f2631f 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -16,7 +16,11 @@ import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Api.V1.Address (PAddress) import Plutarch.Api.V1.Maybe (PMaybeData) import Plutarch.Api.V1.Scripts (PDatumHash) -import Plutarch.Api.V1.Value (PValue, ValueAmountGuarantees (NonZero), ValueKeyGuarantees (Sorted)) +import Plutarch.Api.V1.Value ( + PValue, + ValueAmountGuarantees (Positive), + ValueKeyGuarantees (Sorted), + ) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, @@ -90,7 +94,7 @@ newtype PTxOut (s :: S) s ( PDataRecord '[ "address" ':= PAddress - , "value" ':= PValue 'Sorted 'NonZero + , "value" ':= PValue 'Sorted 'Positive , "datumHash" ':= PMaybeData PDatumHash ] ) From 8c44bde357984e581167698766c6d62f4c1f3062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 13:49:48 -0400 Subject: [PATCH 440/584] Formatting --- Plutarch/Api/V1/Contexts.hs | 2 +- Plutarch/Api/V1/Tx.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 3bcd77908..18c9a9f7d 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -27,7 +27,7 @@ import Plutarch.Api.V1.Value ( PValue, ValueAmountGuarantees (NonZero, Positive), ValueKeyGuarantees (Sorted), - ) + ) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 324f2631f..f69279096 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -20,7 +20,7 @@ import Plutarch.Api.V1.Value ( PValue, ValueAmountGuarantees (Positive), ValueKeyGuarantees (Sorted), - ) + ) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, From 61b485a30ca3eab0a05c0e0f382f4c27f7b1392f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 13:52:13 -0400 Subject: [PATCH 441/584] Generalized the return type of pforgetPositive --- Plutarch/Api/V1/Value.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 861a5d7a2..4ba8e6aa7 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -246,7 +246,7 @@ passertPositive = phoistAcyclic $ (ptraceError "Negative amount in Value") -- | Forget the knowledge of value's positivity. -pforgetPositive :: Term s (PValue 'Sorted 'Positive) -> Term s (PValue 'Sorted 'NonZero) +pforgetPositive :: Term s (PValue 'Sorted 'Positive) -> Term s (PValue k a) pforgetPositive v = punsafeDowncast (pto v) zeroData :: ClosedTerm (PAsData PInteger) From f92383f5159205d633f7a302ad51d47207983564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 13:55:06 -0400 Subject: [PATCH 442/584] Added a warning to UTxO value field --- Plutarch/Api/V1/Tx.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index f69279096..a0ec4b0d6 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -94,7 +94,7 @@ newtype PTxOut (s :: S) s ( PDataRecord '[ "address" ':= PAddress - , "value" ':= PValue 'Sorted 'Positive + , "value" ':= PValue 'Sorted 'Positive -- ^ negative values may appear in a future Cardano version , "datumHash" ':= PMaybeData PDatumHash ] ) From f04107c7e89ec956cd43db3adfc60cd18de33c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 13:59:39 -0400 Subject: [PATCH 443/584] Removed the kind signatures off of (s :: S) in use sites --- Plutarch/Api/V1/AssocMap.hs | 46 ++++++++++++++++++------------------- Plutarch/Api/V1/Value.hs | 10 ++++---- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index f1e23fcc9..2d3f0adf5 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -125,7 +125,7 @@ pnull :: Term s (PMap k v :--> PBool) pnull = plam (\map -> List.pnull # pto map) -- | Look up the given key in a 'PMap'. -plookup :: (PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMaybe v) +plookup :: (PIsData k, PIsData v) => Term s (k :--> PMap k v :--> PMaybe v) plookup = phoistAcyclic $ plam $ \key -> plookupDataWith @@ -133,14 +133,14 @@ plookup = phoistAcyclic $ # pdata key -- | Look up the given key data in a 'PMap'. -plookupData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) +plookupData :: (PIsData k, PIsData v) => Term s (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) plookupData = plookupDataWith # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) -- | Look up the given key data in a 'PMap', applying the given function to the found key-value pair. plookupDataWith :: (PIsData k, PIsData v) => Term - (s :: S) + s ( (PBuiltinPair (PAsData k) (PAsData v) :--> PMaybe x) :--> PAsData k :--> PMap k v @@ -159,13 +159,13 @@ plookupDataWith = phoistAcyclic $ # pto map -- | Look up the given key in a 'PMap', returning the default value if the key is absent. -pfindWithDefault :: (PIsData k, PIsData v) => Term (s :: S) (v :--> k :--> PMap k v :--> v) +pfindWithDefault :: (PIsData k, PIsData v) => Term s (v :--> k :--> PMap k v :--> v) pfindWithDefault = phoistAcyclic $ plam $ \def key -> foldAtData # pdata key # def # plam pfromData {- | Look up the given key in a 'PMap'; return the default if the key is absent or apply the argument function to the value data if present. -} -pfoldAt :: (PIsData k, PIsData v) => Term (s :: S) (k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) +pfoldAt :: (PIsData k, PIsData v) => Term s (k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) pfoldAt = phoistAcyclic $ plam $ \key -> foldAtData # pdata key @@ -174,7 +174,7 @@ pfoldAt = phoistAcyclic $ -} foldAtData :: (PIsData k, PIsData v) => - Term (s :: S) (PAsData k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) + Term s (PAsData k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) foldAtData = phoistAcyclic $ plam $ \key def apply map -> precList @@ -188,7 +188,7 @@ foldAtData = phoistAcyclic $ # pto map -- | Insert a new key/value pair into the map, overiding the previous if any. -pinsert :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v :--> PMap k v) +pinsert :: (POrd k, PIsData k, PIsData v) => Term s (k :--> v :--> PMap k v :--> PMap k v) pinsert = phoistAcyclic $ plam $ \key val -> rebuildAtKey # (plam (pcons # (ppairDataBuiltin # pdata key # pdata val) #)) # key @@ -196,13 +196,13 @@ pinsert = phoistAcyclic $ -- | Insert a new data-encoded key/value pair into the map, overiding the previous if any. pinsertData :: (POrd k, PIsData k, PIsData v) => - Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v :--> PMap k v) + Term s (PAsData k :--> PAsData v :--> PMap k v :--> PMap k v) pinsertData = phoistAcyclic $ plam $ \key val -> rebuildAtKey # (plam (pcons # (ppairDataBuiltin # key # val) #)) # pfromData key -- | Delete a key from the map. -pdelete :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (k :--> PMap k v :--> PMap k v) +pdelete :: (POrd k, PIsData k, PIsData v) => Term s (k :--> PMap k v :--> PMap k v) pdelete = rebuildAtKey # plam id -- | Rebuild the map at the given key. @@ -238,24 +238,24 @@ rebuildAtKey = phoistAcyclic $ # plam id -- | Construct an empty 'PMap'. -pempty :: Term (s :: S) (PMap k v) +pempty :: Term s (PMap k v) pempty = punsafeDowncast pnil -- | Construct a singleton 'PMap' with the given key and value. -psingleton :: (PIsData k, PIsData v) => Term (s :: S) (k :--> v :--> PMap k v) +psingleton :: (PIsData k, PIsData v) => Term s (k :--> v :--> PMap k v) psingleton = phoistAcyclic $ plam $ \key value -> psingletonData # pdata key # pdata value -- | Construct a singleton 'PMap' with the given data-encoded key and value. -psingletonData :: (PIsData k, PIsData v) => Term (s :: S) (PAsData k :--> PAsData v :--> PMap k v) +psingletonData :: (PIsData k, PIsData v) => Term s (PAsData k :--> PAsData v :--> PMap k v) psingletonData = phoistAcyclic $ plam $ \key value -> punsafeDowncast (pcons # (ppairDataBuiltin # key # value) # pnil) -- | Construct a 'PMap' from a list of key-value pairs, sorted by ascending key data. -pfromAscList :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PBuiltinMap k v :--> PMap k v) +pfromAscList :: (POrd k, PIsData k, PIsData v) => Term s (PBuiltinMap k v :--> PMap k v) pfromAscList = plam $ (passertSorted #) . pcon . PMap -- | Assert the map is properly sorted -passertSorted :: (POrd k, PIsData k, PIsData v) => Term (s :: S) (PMap k v :--> PMap k v) +passertSorted :: (POrd k, PIsData k, PIsData v) => Term s (PMap k v :--> PMap k v) passertSorted = phoistAcyclic $ plam $ \map -> precList @@ -295,7 +295,7 @@ instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Monoid (Term s -} punionWith :: (POrd k, PIsData k, PIsData v) => - Term (s :: S) ((v :--> v :--> v) :--> PMap k v :--> PMap k v :--> PMap k v) + Term s ((v :--> v :--> v) :--> PMap k v :--> PMap k v :--> PMap k v) punionWith = phoistAcyclic $ plam $ \combine -> punionWithData #$ plam $ @@ -307,7 +307,7 @@ punionWith = phoistAcyclic $ punionWithData :: (POrd k, PIsData k, PIsData v) => Term - (s :: S) + s ( (PAsData v :--> PAsData v :--> PAsData v) :--> PMap k v :--> PMap k v @@ -319,7 +319,7 @@ punionWithData = phoistAcyclic $ mapUnion :: (POrd k, PIsData k, PIsData v) => - Term (s :: S) ((PAsData v :--> PAsData v :--> PAsData v) :--> ScottEncoding (MapUnion k v) (a :: PType)) + Term s ((PAsData v :--> PAsData v :--> PAsData v) :--> ScottEncoding (MapUnion k v) (a :: PType)) mapUnion = plam $ \combine -> letrec $ \MapUnion {merge, mergeInsert} -> MapUnion @@ -355,7 +355,7 @@ mapUnion = plam $ \combine -> -- | Difference of two maps. Return elements of the first map not existing in the second map. pdifference :: (POrd k, PIsData k, PIsData a, PIsData b) => - Term (s :: S) (PMap k a :--> PMap k b :--> PMap k a) + Term s (PMap k a :--> PMap k b :--> PMap k a) pdifference = phoistAcyclic $ plam $ \left right -> pcon . PMap $ @@ -372,19 +372,19 @@ pdifference = phoistAcyclic $ # pto left -- | Tests if all values in the map satisfy the given predicate. -pall :: PIsData v => Term (s :: S) ((v :--> PBool) :--> PMap k v :--> PBool) +pall :: PIsData v => Term s ((v :--> PBool) :--> PMap k v :--> PBool) pall = phoistAcyclic $ plam $ \pred map -> List.pall # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map -- | Tests if anu value in the map satisfies the given predicate. -pany :: PIsData v => Term (s :: S) ((v :--> PBool) :--> PMap k v :--> PBool) +pany :: PIsData v => Term s ((v :--> PBool) :--> PMap k v :--> PBool) pany = phoistAcyclic $ plam $ \pred map -> List.pany # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map -- | Filters the map so it contains only the values that satisfy the given predicate. -pfilter :: (PIsData k, PIsData a) => Term (s :: S) ((a :--> PBool) :--> PMap k a :--> PMap k a) +pfilter :: (PIsData k, PIsData a) => Term s ((a :--> PBool) :--> PMap k a :--> PMap k a) pfilter = phoistAcyclic $ plam $ \pred -> pmapMaybe #$ plam $ \v -> pif (pred # v) (pcon $ PJust v) (pcon PNothing) @@ -392,7 +392,7 @@ pfilter = phoistAcyclic $ -- | Maps and filters the map, much like 'Data.List.mapMaybe'. pmapMaybe :: (PIsData k, PIsData a, PIsData b) => - Term (s :: S) ((a :--> PMaybe b) :--> PMap k a :--> PMap k b) + Term s ((a :--> PMaybe b) :--> PMap k a :--> PMap k b) pmapMaybe = phoistAcyclic $ plam $ \f -> pmapMaybeData #$ plam $ \v -> pmatch (f # pfromData v) $ \case PNothing -> pcon PNothing @@ -401,7 +401,7 @@ pmapMaybe = phoistAcyclic $ pmapMaybeData :: forall s k a b. (PIsData k, PIsData a, PIsData b) => - Term (s :: S) ((PAsData a :--> PMaybe (PAsData b)) :--> PMap k a :--> PMap k b) + Term s ((PAsData a :--> PMaybe (PAsData b)) :--> PMap k a :--> PMap k b) pmapMaybeData = phoistAcyclic $ plam $ \f map -> pcon . PMap $ diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 4ba8e6aa7..cd0f644f2 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -123,7 +123,7 @@ pconstantPositiveSingleton symbol token amount -- | Construct a singleton 'PValue' containing only the given quantity of the given currency. psingleton :: Term - (s :: S) + s (PCurrencySymbol :--> PTokenName :--> PInteger :--> PValue 'Sorted 'NonZero) psingleton = phoistAcyclic $ plam $ \symbol token amount -> @@ -137,7 +137,7 @@ psingleton = phoistAcyclic $ -} psingletonData :: Term - (s :: S) + s ( PAsData PCurrencySymbol :--> PAsData PTokenName :--> PAsData PInteger :--> PValue 'Sorted 'NonZero ) @@ -154,7 +154,7 @@ psingletonData = phoistAcyclic $ ) -- | Get the quantity of the given currency in the 'PValue'. -pvalueOf :: Term (s :: S) (PValue _ _ :--> PCurrencySymbol :--> PTokenName :--> PInteger) +pvalueOf :: Term s (PValue _ _ :--> PCurrencySymbol :--> PTokenName :--> PInteger) pvalueOf = phoistAcyclic $ plam $ \value symbol token -> AssocMap.pfoldAt @@ -169,7 +169,7 @@ pvalueOf = phoistAcyclic $ -} punionWith :: Term - (s :: S) + s ( (PInteger :--> PInteger :--> PInteger) :--> PValue 'Sorted _ :--> PValue 'Sorted _ :--> PValue 'Sorted 'NoGuarantees ) @@ -187,7 +187,7 @@ punionWith = phoistAcyclic $ -} punionWithData :: Term - (s :: S) + s ( (PAsData PInteger :--> PAsData PInteger :--> PAsData PInteger) :--> PValue 'Sorted _ :--> PValue 'Sorted _ From b62487da6f655bf35afaf4b17da4975e94ebb891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 14:11:27 -0400 Subject: [PATCH 444/584] Removed extraneous golden outputs --- .../goldens/rec.dev=true.bench.golden | 45 -------------- .../goldens/rec.dev=true.uplc.eval.golden | 59 ------------------- .../goldens/rec.dev=true.uplc.golden | 45 -------------- 3 files changed, 149 deletions(-) delete mode 100644 plutarch-test/goldens/rec.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/rec.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.dev=true.uplc.golden diff --git a/plutarch-test/goldens/rec.dev=true.bench.golden b/plutarch-test/goldens/rec.dev=true.bench.golden deleted file mode 100644 index c1d0f244d..000000000 --- a/plutarch-test/goldens/rec.dev=true.bench.golden +++ /dev/null @@ -1,45 +0,0 @@ -simple.constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -simple.constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -simple.constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -simple.field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -simple.reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} -simple.reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} -LetRec.record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -LetRec.record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -LetRec.even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} -LetRec.even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} -LetRec.even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} -nested.flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} -nested.flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -nested.flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} -nested.flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} -nested.flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -nested.flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -nested.shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} -nested.shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} -nested.shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} -nested.shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} -nested.shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -nested.shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -Data.pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} -Data.pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} -Data.pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} -Data.pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} -Data.fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":72} -Data.fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":84} -Data.fieldFromData.nested.shallow {"exBudgetCPU":893290,"exBudgetMemory":3100,"scriptSizeBytes":161} -Data.pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":118} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.dev=true.uplc.eval.golden deleted file mode 100644 index 16ab3b629..000000000 --- a/plutarch-test/goldens/rec.dev=true.uplc.eval.golden +++ /dev/null @@ -1,59 +0,0 @@ -simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.field.access-term (program 1.0.0 6) -simple.field.value.direct-access (program 1.0.0 6) -simple.field.value.pmatch (program 1.0.0 "Salut, Monde!") -simple.field.value.pmatch' (program 1.0.0 "Salut, Monde!") -simple.field.value.rmatch (program 1.0.0 "Salut, Monde!") -simple.reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.reconstr.field-access (program 1.0.0 6) -LetRec.record (program 1.0.0 12) -LetRec.record-field (program 1.0.0 12) -LetRec.even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) -LetRec.even.4 (program 1.0.0 True) -LetRec.even.5 (program 1.0.0 False) -nested.flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -nested.flat.nested-field-access (program 1.0.0 9) -nested.flat.nested-field-value.direct-access (program 1.0.0 9) -nested.flat.nested-field-value.pmatch (program 1.0.0 9) -nested.flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -nested.flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -nested.flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -nested.flat.reconstr-nested-field-value (program 1.0.0 9) -nested.flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -nested.flat.nested-match-term (program 1.0.0 "Salut, Monde!") -nested.flat.nested-match-value (program 1.0.0 "Salut, Monde!") -nested.shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -nested.shallow.nested-field-access (program 1.0.0 9) -nested.shallow.nested-field-value.direct-access (program 1.0.0 9) -nested.shallow.nested-field-value.pmatch (program 1.0.0 9) -nested.shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -nested.shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -nested.shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -nested.shallow.reconstr-nested-field-value (program 1.0.0 9) -nested.shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -nested.shallow.nested-match-term (program 1.0.0 "Salut, Monde!") -nested.shallow.nested-match-value (program 1.0.0 "Salut, Monde!") -Data.pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) -Data.pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) -Data.pdata.flat-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d87980 - , #06 - , #4d53616c75742c204d6f6e646521 - , #04 - , #d87980 - , #09 - , #4d53616c75742c204d6f6e646521 - , #4c486f6c612c204d756e646f21 ] )) -Data.pdata.shallow-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d8799fd87980064d53616c75742c204d6f6e646521ff - , #04 - , #d8799fd87980094d53616c75742c204d6f6e646521ff - , #4c486f6c612c204d756e646f21 ] )) -Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) -Data.fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) -Data.fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) -Data.pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.dev=true.uplc.golden b/plutarch-test/goldens/rec.dev=true.uplc.golden deleted file mode 100644 index 772f9ecfb..000000000 --- a/plutarch-test/goldens/rec.dev=true.uplc.golden +++ /dev/null @@ -1,45 +0,0 @@ -simple.constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -simple.field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -simple.field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -simple.field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -simple.field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -simple.field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -simple.reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) -simple.reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) -LetRec.record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -LetRec.record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -LetRec.even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) -LetRec.even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) -LetRec.even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) -nested.flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) -nested.flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) -nested.flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -nested.flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) -nested.flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) -nested.shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) -nested.shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) -nested.shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -nested.shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) -nested.shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -nested.shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -Data.pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) -Data.pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) -Data.pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) -Data.pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) -Data.fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) -Data.fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1))) (force tailList))) -Data.fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay (force (i9 i10 (delay error)))))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay (force (i8 i9 (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (force trace)) "verifySoleConstructor failed")) -Data.pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file From ae4cc224be68f8440b0050a21d0684951beba558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 14:18:29 -0400 Subject: [PATCH 445/584] No Haddock allowed in a type-level list --- Plutarch/Api/V1/Tx.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index a0ec4b0d6..33952bf82 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -94,7 +94,7 @@ newtype PTxOut (s :: S) s ( PDataRecord '[ "address" ':= PAddress - , "value" ':= PValue 'Sorted 'Positive -- ^ negative values may appear in a future Cardano version + , "value" ':= PValue 'Sorted 'Positive -- negative values may appear in a future Cardano version , "datumHash" ':= PMaybeData PDatumHash ] ) From cfd0e37f3ab587e67f4e1ff08ebe4a9dc47837b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 14:34:05 -0400 Subject: [PATCH 446/584] Inlined the Rank2.TH instances --- Plutarch/Api/V1/AssocMap.hs | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 2d3f0adf5..db87a4fe4 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -88,7 +87,7 @@ import Plutarch.Rec (ScottEncoded, ScottEncoding, field, letrec) import Plutarch.Show (PShow) import Plutarch.Unsafe (punsafeDowncast) -import qualified Rank2.TH +import qualified Rank2 import Prelude hiding (all, any, filter, lookup, null) @@ -282,7 +281,26 @@ type instance :--> (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) :--> a -$(Rank2.TH.deriveAll ''MapUnion) +instance Rank2.Functor (MapUnion k v) where + f <$> x@MapUnion {} = + MapUnion + { merge = f (merge x) + , mergeInsert = f (mergeInsert x) + } + +instance Rank2.Foldable (MapUnion k v) where + foldMap f x@MapUnion {} = f (merge x) <> f (mergeInsert x) + +instance Rank2.Traversable (MapUnion k v) where + traverse f x@MapUnion {} = MapUnion <$> f (merge x) <*> f (mergeInsert x) + +instance Rank2.Distributive (MapUnion k v) where + cotraverse w f = + MapUnion + { merge = w (merge <$> f) + , mergeInsert = w (mergeInsert <$> f) + } +instance Rank2.DistributiveTraversable (MapUnion k v) instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap k v)) where a <> b = punionWith # plam (<>) # a # b From 874946e290392af7797c11732f1b67e94006ae19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 6 May 2022 17:05:49 -0400 Subject: [PATCH 447/584] Added plet y $ \y -> --- Plutarch/Api/V1/AssocMap.hs | 44 ++++--- plutarch-test/goldens/api.map.bench.golden | 16 +-- plutarch-test/goldens/api.map.uplc.golden | 16 +-- .../goldens/api.value.dev=false.bench.golden | 124 +++++++++--------- .../api.value.dev=false.uplc.eval.golden | 4 +- .../goldens/api.value.dev=false.uplc.golden | 124 +++++++++--------- .../goldens/api.value.dev=true.bench.golden | 124 +++++++++--------- .../api.value.dev=true.uplc.eval.golden | 4 +- .../goldens/api.value.dev=true.uplc.golden | 124 +++++++++--------- 9 files changed, 291 insertions(+), 289 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index db87a4fe4..6f3059bb6 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -344,30 +344,32 @@ mapUnion = plam $ \combine -> { merge = plam $ \xs ys -> pmatch xs $ \case PNil -> ys PCons x xs' -> mergeInsert # x # xs' # ys - , mergeInsert = plam $ \x xs ys -> pmatch ys $ \case - PNil -> pcons # x # xs - PCons y ys' -> - plet (pfstBuiltin # x) $ \xk -> - plet (pfstBuiltin # y) $ \yk -> - pif - (xk #== yk) - ( pcons - # (ppairDataBuiltin # xk #$ combine # (psndBuiltin # x) # (psndBuiltin # y)) - #$ merge - # xs - # ys' - ) - ( pif - (pfromData xk #< pfromData yk) + , mergeInsert = plam $ \x xs ys -> + pmatch ys $ \case + PNil -> pcons # x # xs + PCons y1 ys' -> + plet y1 $ \y -> + plet (pfstBuiltin # x) $ \xk -> + plet (pfstBuiltin # y) $ \yk -> + pif + (xk #== yk) ( pcons - # x - # (mergeInsert # y # ys' # xs) + # (ppairDataBuiltin # xk #$ combine # (psndBuiltin # x) # (psndBuiltin # y)) + #$ merge + # xs + # ys' ) - ( pcons - # y - # (mergeInsert # x # xs # ys') + ( pif + (pfromData xk #< pfromData yk) + ( pcons + # x + # (mergeInsert # y # ys' # xs) + ) + ( pcons + # y + # (mergeInsert # x # xs # ys') + ) ) - ) } -- | Difference of two maps. Return elements of the first map not existing in the second map. diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index a6603eee1..223f8b5cd 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -5,7 +5,7 @@ lookupData.hit {"exBudgetCPU":4140352,"exBudgetMemory":9090,"scriptSizeBytes":11 lookupData.miss {"exBudgetCPU":4885812,"exBudgetMemory":11122,"scriptSizeBytes":121} findWithDefault.itself {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":78} findWithDefault.hit {"exBudgetCPU":4797628,"exBudgetMemory":10354,"scriptSizeBytes":117} -findWithDefault.hit2 {"exBudgetCPU":16610415,"exBudgetMemory":37964,"scriptSizeBytes":344} +findWithDefault.hit2 {"exBudgetCPU":16490188,"exBudgetMemory":38032,"scriptSizeBytes":340} findWithDefault.miss {"exBudgetCPU":5153769,"exBudgetMemory":12022,"scriptSizeBytes":125} singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} @@ -19,10 +19,10 @@ delete.old {"exBudgetCPU":10735192,"exBudgetMemory":25178,"scriptSizeBytes":204} difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":162} difference.emptyRight {"exBudgetCPU":6655369,"exBudgetMemory":15848,"scriptSizeBytes":165} difference.emptyResult {"exBudgetCPU":9811977,"exBudgetMemory":22006,"scriptSizeBytes":179} -unionWith.const {"exBudgetCPU":12018584,"exBudgetMemory":28002,"scriptSizeBytes":263} -unionWith.double {"exBudgetCPU":12066928,"exBudgetMemory":27504,"scriptSizeBytes":260} -unionWith.(+) {"exBudgetCPU":11404475,"exBudgetMemory":27008,"scriptSizeBytes":265} -unionWith.flip (+) {"exBudgetCPU":11404475,"exBudgetMemory":27008,"scriptSizeBytes":265} -unionWithData.const {"exBudgetCPU":11121989,"exBudgetMemory":26406,"scriptSizeBytes":249} -unionWithData.emptyLeft {"exBudgetCPU":3906038,"exBudgetMemory":10860,"scriptSizeBytes":237} -unionWithData.emptyRight {"exBudgetCPU":5786277,"exBudgetMemory":15288,"scriptSizeBytes":236} \ No newline at end of file +unionWith.const {"exBudgetCPU":11898357,"exBudgetMemory":28070,"scriptSizeBytes":260} +unionWith.double {"exBudgetCPU":11946701,"exBudgetMemory":27572,"scriptSizeBytes":255} +unionWith.(+) {"exBudgetCPU":11284248,"exBudgetMemory":27076,"scriptSizeBytes":262} +unionWith.flip (+) {"exBudgetCPU":11284248,"exBudgetMemory":27076,"scriptSizeBytes":262} +unionWithData.const {"exBudgetCPU":11001762,"exBudgetMemory":26474,"scriptSizeBytes":246} +unionWithData.emptyLeft {"exBudgetCPU":3906038,"exBudgetMemory":10860,"scriptSizeBytes":233} +unionWithData.emptyRight {"exBudgetCPU":5786277,"exBudgetMemory":15288,"scriptSizeBytes":233} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index bd4e599b9..7fdd69114 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -5,7 +5,7 @@ lookupData.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i lookupData.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData #6e6f6b6579) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) findWithDefault.itself (program 1.0.0 ((\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) (force headList))) findWithDefault.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 i2 ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) -findWithDefault.hit2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1) (bData i1) i2 unIData) 12 i13 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i13 i5) (i13 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i22 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i9 #6b6579 42) (i9 i13 6))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6e65776b6579)) +findWithDefault.hit2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i14 (i15 i1)) i6) (delay (i4 (i10 (i15 i1)))) (delay (i2 (i13 i1)))))))) i1) (bData i1) i2 unIData) 12 i13 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i15 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i14 i6) (i14 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i15 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i23 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i9 #6b6579 42) (i9 i13 6))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6e65776b6579)) findWithDefault.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) @@ -19,10 +19,10 @@ delete.old (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (bData i1)) (unBData (i7 (i8 i2))) (i10 (i8 i2) i1) (\i0 -> i2) i4) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i15 (i16 i1)) i6) (delay (i4 (force (force sndPair) (i16 i1)))) (delay (i2 (i17 i1)))))))) i1) (bData i1)) (unBData (i8 (i9 i2))) (i11 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i15 (i16 i1)) i6) (delay (i4 (force (force sndPair) (i16 i1)))) (delay (i2 (i17 i1)))))))) i1) (bData i1)) (unBData (i8 (i9 i2))) (i13 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i13 i5) (i13 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i22 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i21 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i21 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 #6b6579 42) (i9 #6e65776b6579 6)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWith.flip (+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i21 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 #6e65776b6579 6) (i9 #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i21 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> i2) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i19 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> i2) i10 ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (force mkCons)) [ ])) -unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i19 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42) i10) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (force mkCons)) [ ])) \ No newline at end of file +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i15 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i14 i6) (i14 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i15 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i23 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i22 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i22 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 #6b6579 42) (i9 #6e65776b6579 6)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.flip (+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i22 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 #6e65776b6579 6) (i9 #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i22 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> i2) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i20 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> i2) i10 ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (force mkCons)) [ ])) +unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i20 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42) i10) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index ea23e68d7..e834fe12e 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -3,71 +3,71 @@ singletonData {"exBudgetCPU":3663984,"exBudgetMemory":7490,"scriptSizeBytes":80} valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":193} -valueOf.growing.2 {"exBudgetCPU":26339113,"exBudgetMemory":61204,"scriptSizeBytes":424} -valueOf.growing.3 {"exBudgetCPU":39079403,"exBudgetMemory":90042,"scriptSizeBytes":455} -valueOf.growing.4 {"exBudgetCPU":55498106,"exBudgetMemory":125972,"scriptSizeBytes":474} -valueOf.growing.5 {"exBudgetCPU":76041817,"exBudgetMemory":170494,"scriptSizeBytes":492} -valueOf.growing.6 {"exBudgetCPU":100710536,"exBudgetMemory":223608,"scriptSizeBytes":510} -valueOf.growing.7 {"exBudgetCPU":129504263,"exBudgetMemory":285314,"scriptSizeBytes":529} -valueOf.growing.8 {"exBudgetCPU":162422998,"exBudgetMemory":355612,"scriptSizeBytes":547} -valueOf.growing.9 {"exBudgetCPU":202325619,"exBudgetMemory":439660,"scriptSizeBytes":565} -valueOf.growing.10 {"exBudgetCPU":241562995,"exBudgetMemory":523212,"scriptSizeBytes":583} -valueOf.growing.11 {"exBudgetCPU":284925379,"exBudgetMemory":615356,"scriptSizeBytes":601} -valueOf.growing.12 {"exBudgetCPU":332412771,"exBudgetMemory":716092,"scriptSizeBytes":620} -valueOf.growing.13 {"exBudgetCPU":384025171,"exBudgetMemory":825420,"scriptSizeBytes":638} -valueOf.growing.14 {"exBudgetCPU":439762579,"exBudgetMemory":943340,"scriptSizeBytes":656} -valueOf.growing.15 {"exBudgetCPU":499624995,"exBudgetMemory":1069852,"scriptSizeBytes":675} -valueOf.growing.16 {"exBudgetCPU":563612419,"exBudgetMemory":1204956,"scriptSizeBytes":693} -valueOf.growing.17 {"exBudgetCPU":631724851,"exBudgetMemory":1348652,"scriptSizeBytes":712} -unionWith.const {"exBudgetCPU":23005013,"exBudgetMemory":52404,"scriptSizeBytes":321} -unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":236} -unionWith.(+).applied {"exBudgetCPU":23053357,"exBudgetMemory":51906,"scriptSizeBytes":318} -unionWith.tokens {"exBudgetCPU":22391152,"exBudgetMemory":51410,"scriptSizeBytes":327} -unionWith.symbols {"exBudgetCPU":14569493,"exBudgetMemory":33864,"scriptSizeBytes":319} -unionWith.growing.1 {"exBudgetCPU":14658812,"exBudgetMemory":34164,"scriptSizeBytes":323} -unionWith.growing.2 {"exBudgetCPU":33279138,"exBudgetMemory":76618,"scriptSizeBytes":357} -unionWith.growing.3 {"exBudgetCPU":47855785,"exBudgetMemory":108918,"scriptSizeBytes":378} -unionWith.growing.4 {"exBudgetCPU":66468121,"exBudgetMemory":149510,"scriptSizeBytes":396} -unionWith.growing.5 {"exBudgetCPU":89205465,"exBudgetMemory":198694,"scriptSizeBytes":415} -unionWith.growing.6 {"exBudgetCPU":116067817,"exBudgetMemory":256470,"scriptSizeBytes":433} -unionWith.growing.7 {"exBudgetCPU":147055177,"exBudgetMemory":322838,"scriptSizeBytes":452} -unionWith.growing.8 {"exBudgetCPU":182167545,"exBudgetMemory":397798,"scriptSizeBytes":470} -unionWith.growing.9 {"exBudgetCPU":229394970,"exBudgetMemory":499496,"scriptSizeBytes":486} -unionWith.growing.10 {"exBudgetCPU":268632346,"exBudgetMemory":583048,"scriptSizeBytes":505} -unionWith.growing.11 {"exBudgetCPU":311994730,"exBudgetMemory":675192,"scriptSizeBytes":523} -unionWith.growing.12 {"exBudgetCPU":359482122,"exBudgetMemory":775928,"scriptSizeBytes":541} -unionWith.growing.13 {"exBudgetCPU":411094522,"exBudgetMemory":885256,"scriptSizeBytes":560} -unionWith.growing.14 {"exBudgetCPU":466831930,"exBudgetMemory":1003176,"scriptSizeBytes":578} -unionWith.growing.15 {"exBudgetCPU":526694346,"exBudgetMemory":1129688,"scriptSizeBytes":597} -unionWith.growing.16 {"exBudgetCPU":590681770,"exBudgetMemory":1264792,"scriptSizeBytes":615} -unionWith.growing.17 {"exBudgetCPU":658794202,"exBudgetMemory":1408488,"scriptSizeBytes":633} -unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":226} -unionWithData const.applied {"exBudgetCPU":22197737,"exBudgetMemory":51108,"scriptSizeBytes":311} +valueOf.growing.2 {"exBudgetCPU":26098659,"exBudgetMemory":61340,"scriptSizeBytes":420} +valueOf.growing.3 {"exBudgetCPU":38718722,"exBudgetMemory":90246,"scriptSizeBytes":451} +valueOf.growing.4 {"exBudgetCPU":54896971,"exBudgetMemory":126312,"scriptSizeBytes":470} +valueOf.growing.5 {"exBudgetCPU":75080001,"exBudgetMemory":171038,"scriptSizeBytes":488} +valueOf.growing.6 {"exBudgetCPU":99267812,"exBudgetMemory":224424,"scriptSizeBytes":506} +valueOf.growing.7 {"exBudgetCPU":127460404,"exBudgetMemory":286470,"scriptSizeBytes":525} +valueOf.growing.8 {"exBudgetCPU":159657777,"exBudgetMemory":357176,"scriptSizeBytes":543} +valueOf.growing.9 {"exBudgetCPU":198718809,"exBudgetMemory":441700,"scriptSizeBytes":561} +valueOf.growing.10 {"exBudgetCPU":236994369,"exBudgetMemory":525796,"scriptSizeBytes":579} +valueOf.growing.11 {"exBudgetCPU":279274710,"exBudgetMemory":618552,"scriptSizeBytes":597} +valueOf.growing.12 {"exBudgetCPU":325559832,"exBudgetMemory":719968,"scriptSizeBytes":616} +valueOf.growing.13 {"exBudgetCPU":375849735,"exBudgetMemory":830044,"scriptSizeBytes":634} +valueOf.growing.14 {"exBudgetCPU":430144419,"exBudgetMemory":948780,"scriptSizeBytes":652} +valueOf.growing.15 {"exBudgetCPU":488443884,"exBudgetMemory":1076176,"scriptSizeBytes":671} +valueOf.growing.16 {"exBudgetCPU":550748130,"exBudgetMemory":1212232,"scriptSizeBytes":689} +valueOf.growing.17 {"exBudgetCPU":617057157,"exBudgetMemory":1356948,"scriptSizeBytes":708} +unionWith.const {"exBudgetCPU":22764559,"exBudgetMemory":52540,"scriptSizeBytes":318} +unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":232} +unionWith.(+).applied {"exBudgetCPU":22812903,"exBudgetMemory":52042,"scriptSizeBytes":314} +unionWith.tokens {"exBudgetCPU":22150698,"exBudgetMemory":51546,"scriptSizeBytes":324} +unionWith.symbols {"exBudgetCPU":14449266,"exBudgetMemory":33932,"scriptSizeBytes":316} +unionWith.growing.1 {"exBudgetCPU":14538585,"exBudgetMemory":34232,"scriptSizeBytes":320} +unionWith.growing.2 {"exBudgetCPU":32918457,"exBudgetMemory":76822,"scriptSizeBytes":354} +unionWith.growing.3 {"exBudgetCPU":47254650,"exBudgetMemory":109258,"scriptSizeBytes":375} +unionWith.growing.4 {"exBudgetCPU":65506305,"exBudgetMemory":150054,"scriptSizeBytes":393} +unionWith.growing.5 {"exBudgetCPU":87762741,"exBudgetMemory":199510,"scriptSizeBytes":412} +unionWith.growing.6 {"exBudgetCPU":114023958,"exBudgetMemory":257626,"scriptSizeBytes":430} +unionWith.growing.7 {"exBudgetCPU":144289956,"exBudgetMemory":324402,"scriptSizeBytes":449} +unionWith.growing.8 {"exBudgetCPU":178560735,"exBudgetMemory":399838,"scriptSizeBytes":467} +unionWith.growing.9 {"exBudgetCPU":224706117,"exBudgetMemory":502148,"scriptSizeBytes":482} +unionWith.growing.10 {"exBudgetCPU":262981677,"exBudgetMemory":586244,"scriptSizeBytes":501} +unionWith.growing.11 {"exBudgetCPU":305262018,"exBudgetMemory":679000,"scriptSizeBytes":519} +unionWith.growing.12 {"exBudgetCPU":351547140,"exBudgetMemory":780416,"scriptSizeBytes":537} +unionWith.growing.13 {"exBudgetCPU":401837043,"exBudgetMemory":890492,"scriptSizeBytes":556} +unionWith.growing.14 {"exBudgetCPU":456131727,"exBudgetMemory":1009228,"scriptSizeBytes":574} +unionWith.growing.15 {"exBudgetCPU":514431192,"exBudgetMemory":1136624,"scriptSizeBytes":593} +unionWith.growing.16 {"exBudgetCPU":576735438,"exBudgetMemory":1272680,"scriptSizeBytes":611} +unionWith.growing.17 {"exBudgetCPU":643044465,"exBudgetMemory":1417396,"scriptSizeBytes":629} +unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":222} +unionWithData const.applied {"exBudgetCPU":21957283,"exBudgetMemory":51244,"scriptSizeBytes":307} equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} -equality.swappedTokensTrue {"exBudgetCPU":49963365,"exBudgetMemory":111472,"scriptSizeBytes":466} -equality.swappedSymbolsTrue {"exBudgetCPU":38743024,"exBudgetMemory":84268,"scriptSizeBytes":457} +equality.swappedTokensTrue {"exBudgetCPU":49482457,"exBudgetMemory":111744,"scriptSizeBytes":463} +equality.swappedSymbolsTrue {"exBudgetCPU":38502570,"exBudgetMemory":84404,"scriptSizeBytes":454} equality.growing.1 {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.growing.2 {"exBudgetCPU":49932869,"exBudgetMemory":111472,"scriptSizeBytes":461} -equality.growing.3 {"exBudgetCPU":75448443,"exBudgetMemory":167076,"scriptSizeBytes":496} -equality.growing.4 {"exBudgetCPU":109214033,"exBudgetMemory":239864,"scriptSizeBytes":532} -equality.growing.5 {"exBudgetCPU":151229639,"exBudgetMemory":329836,"scriptSizeBytes":567} -equality.growing.6 {"exBudgetCPU":201495261,"exBudgetMemory":436992,"scriptSizeBytes":602} -equality.growing.7 {"exBudgetCPU":260010899,"exBudgetMemory":561332,"scriptSizeBytes":637} -equality.growing.8 {"exBudgetCPU":326776553,"exBudgetMemory":702856,"scriptSizeBytes":673} -equality.growing.9 {"exBudgetCPU":401792223,"exBudgetMemory":861564,"scriptSizeBytes":708} -equality.growing.10 {"exBudgetCPU":485057909,"exBudgetMemory":1037456,"scriptSizeBytes":743} -equality.growing.11 {"exBudgetCPU":576573611,"exBudgetMemory":1230532,"scriptSizeBytes":778} -equality.growing.12 {"exBudgetCPU":676339329,"exBudgetMemory":1440792,"scriptSizeBytes":814} -equality.growing.13 {"exBudgetCPU":784355063,"exBudgetMemory":1668236,"scriptSizeBytes":849} -equality.growing.14 {"exBudgetCPU":900620813,"exBudgetMemory":1912864,"scriptSizeBytes":884} -equality.growing.15 {"exBudgetCPU":1025136579,"exBudgetMemory":2174676,"scriptSizeBytes":919} -equality.growing.16 {"exBudgetCPU":1157902361,"exBudgetMemory":2453672,"scriptSizeBytes":955} -equality.growing.17 {"exBudgetCPU":1298918159,"exBudgetMemory":2749852,"scriptSizeBytes":990} -normalize.identity {"exBudgetCPU":45981657,"exBudgetMemory":105689,"scriptSizeBytes":533} -normalize.empty {"exBudgetCPU":30711364,"exBudgetMemory":70825,"scriptSizeBytes":447} -assertSorted.succeeds {"exBudgetCPU":39744930,"exBudgetMemory":94514,"scriptSizeBytes":477} +equality.growing.2 {"exBudgetCPU":49451961,"exBudgetMemory":111744,"scriptSizeBytes":458} +equality.growing.3 {"exBudgetCPU":74727081,"exBudgetMemory":167484,"scriptSizeBytes":493} +equality.growing.4 {"exBudgetCPU":108011763,"exBudgetMemory":240544,"scriptSizeBytes":528} +equality.growing.5 {"exBudgetCPU":149306007,"exBudgetMemory":330924,"scriptSizeBytes":563} +equality.growing.6 {"exBudgetCPU":198609813,"exBudgetMemory":438624,"scriptSizeBytes":599} +equality.growing.7 {"exBudgetCPU":255923181,"exBudgetMemory":563644,"scriptSizeBytes":634} +equality.growing.8 {"exBudgetCPU":321246111,"exBudgetMemory":705984,"scriptSizeBytes":669} +equality.growing.9 {"exBudgetCPU":394578603,"exBudgetMemory":865644,"scriptSizeBytes":704} +equality.growing.10 {"exBudgetCPU":475920657,"exBudgetMemory":1042624,"scriptSizeBytes":740} +equality.growing.11 {"exBudgetCPU":565272273,"exBudgetMemory":1236924,"scriptSizeBytes":775} +equality.growing.12 {"exBudgetCPU":662633451,"exBudgetMemory":1448544,"scriptSizeBytes":810} +equality.growing.13 {"exBudgetCPU":768004191,"exBudgetMemory":1677484,"scriptSizeBytes":845} +equality.growing.14 {"exBudgetCPU":881384493,"exBudgetMemory":1923744,"scriptSizeBytes":881} +equality.growing.15 {"exBudgetCPU":1002774357,"exBudgetMemory":2187324,"scriptSizeBytes":916} +equality.growing.16 {"exBudgetCPU":1132173783,"exBudgetMemory":2468224,"scriptSizeBytes":951} +equality.growing.17 {"exBudgetCPU":1269582771,"exBudgetMemory":2766444,"scriptSizeBytes":986} +normalize.identity {"exBudgetCPU":45861430,"exBudgetMemory":105757,"scriptSizeBytes":530} +normalize.empty {"exBudgetCPU":30470910,"exBudgetMemory":70961,"scriptSizeBytes":444} +assertSorted.succeeds {"exBudgetCPU":39624703,"exBudgetMemory":94582,"scriptSizeBytes":474} assertSorted.fails on malsorted symbols {"exBudgetCPU":28293494,"exBudgetMemory":62258,"scriptSizeBytes":294} -assertSorted.fails on zero quantities {"exBudgetCPU":28358984,"exBudgetMemory":62192,"scriptSizeBytes":476} +assertSorted.fails on zero quantities {"exBudgetCPU":28058984,"exBudgetMemory":62128,"scriptSizeBytes":472} assertSorted.fails on empty token map {"exBudgetCPU":1500103,"exBudgetMemory":423,"scriptSizeBytes":215} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden index 09c783367..423e0f59b 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden @@ -20,7 +20,7 @@ valueOf.growing.15 (program 1.0.0 1) valueOf.growing.16 (program 1.0.0 1) valueOf.growing.17 (program 1.0.0 1) unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) +unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) unionWith.tokens (program 1.0.0 [(#41c0, #a24a6f74686572746f6b656e0149736f6d65746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) @@ -170,7 +170,7 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cd, #a145746f6b656e01) , (#41ce, #a145746f6b656e01) , (#41cf, #a145746f6b656e01) ]) -unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) +unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) equality.triviallyTrue (program 1.0.0 True) diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden index 9e9d9f17b..3bbe13345 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.golden @@ -3,71 +3,71 @@ singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> forc valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> i11 (bData i14) (mapData i1)) ((\i0 -> i11 (bData i15) (iData i1)) 1)) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> i12 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i12 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) -unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 #736f6d65746f6b656e 1)) (i10 i11 (i12 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 (i15 i19 1)) (i14 i13 (i15 #746f6b656e 1))) (i14 #c7 (i15 i19 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c6 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) -unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i14 (i15 i1)) i6) (delay (i4 (i10 (i15 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 #736f6d65746f6b656e 1)) (i10 i11 (i12 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 (i15 i19 1)) (i14 i13 (i15 #746f6b656e 1))) (i14 #c7 (i15 i19 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c6 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i15 (i16 i13 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i13 (i16 i20 1))) (i1 addInteger (i14 i13 (i16 i20 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i15 (i16 i13 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i13 (i16 i20 1))) (i1 addInteger (i14 i13 (i16 i20 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay error))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i20 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i27 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i28 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i29 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i30 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i31 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i32 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i33 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i34 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i35 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i36 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i37 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i38 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i39 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i40 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i40 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i40 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay error))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i14 i2)) (\i0 -> i20 (mkPairData (i14 (i15 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i14 i2)) (\i0 -> i21 (mkPairData (i14 (i15 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i11 (i12 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i3) (delay (i19 (i14 i1) (i2 (i15 i1)))))) i2) (i12 #c7 (i13 i17 1)) (i12 #c0 (i13 i17 1)))) (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i12 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay error) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i5 (i8 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i16 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i16 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i11 (i12 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i16) (bData i2) (mapData i1)) #c0 i12)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i13 i1)) (delay (i2 (i11 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay error) (delay (i4 (i9 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i8 (i9 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index 0e8d3145a..c9870e379 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -3,71 +3,71 @@ singletonData {"exBudgetCPU":3663984,"exBudgetMemory":7490,"scriptSizeBytes":80} valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":193} -valueOf.growing.2 {"exBudgetCPU":26339113,"exBudgetMemory":61204,"scriptSizeBytes":424} -valueOf.growing.3 {"exBudgetCPU":39079403,"exBudgetMemory":90042,"scriptSizeBytes":455} -valueOf.growing.4 {"exBudgetCPU":55498106,"exBudgetMemory":125972,"scriptSizeBytes":474} -valueOf.growing.5 {"exBudgetCPU":76041817,"exBudgetMemory":170494,"scriptSizeBytes":492} -valueOf.growing.6 {"exBudgetCPU":100710536,"exBudgetMemory":223608,"scriptSizeBytes":510} -valueOf.growing.7 {"exBudgetCPU":129504263,"exBudgetMemory":285314,"scriptSizeBytes":529} -valueOf.growing.8 {"exBudgetCPU":162422998,"exBudgetMemory":355612,"scriptSizeBytes":547} -valueOf.growing.9 {"exBudgetCPU":202325619,"exBudgetMemory":439660,"scriptSizeBytes":565} -valueOf.growing.10 {"exBudgetCPU":241562995,"exBudgetMemory":523212,"scriptSizeBytes":583} -valueOf.growing.11 {"exBudgetCPU":284925379,"exBudgetMemory":615356,"scriptSizeBytes":601} -valueOf.growing.12 {"exBudgetCPU":332412771,"exBudgetMemory":716092,"scriptSizeBytes":620} -valueOf.growing.13 {"exBudgetCPU":384025171,"exBudgetMemory":825420,"scriptSizeBytes":638} -valueOf.growing.14 {"exBudgetCPU":439762579,"exBudgetMemory":943340,"scriptSizeBytes":656} -valueOf.growing.15 {"exBudgetCPU":499624995,"exBudgetMemory":1069852,"scriptSizeBytes":675} -valueOf.growing.16 {"exBudgetCPU":563612419,"exBudgetMemory":1204956,"scriptSizeBytes":693} -valueOf.growing.17 {"exBudgetCPU":631724851,"exBudgetMemory":1348652,"scriptSizeBytes":712} -unionWith.const {"exBudgetCPU":23005013,"exBudgetMemory":52404,"scriptSizeBytes":321} -unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":236} -unionWith.(+).applied {"exBudgetCPU":23053357,"exBudgetMemory":51906,"scriptSizeBytes":318} -unionWith.tokens {"exBudgetCPU":22391152,"exBudgetMemory":51410,"scriptSizeBytes":327} -unionWith.symbols {"exBudgetCPU":14569493,"exBudgetMemory":33864,"scriptSizeBytes":319} -unionWith.growing.1 {"exBudgetCPU":14658812,"exBudgetMemory":34164,"scriptSizeBytes":323} -unionWith.growing.2 {"exBudgetCPU":33279138,"exBudgetMemory":76618,"scriptSizeBytes":357} -unionWith.growing.3 {"exBudgetCPU":47855785,"exBudgetMemory":108918,"scriptSizeBytes":378} -unionWith.growing.4 {"exBudgetCPU":66468121,"exBudgetMemory":149510,"scriptSizeBytes":396} -unionWith.growing.5 {"exBudgetCPU":89205465,"exBudgetMemory":198694,"scriptSizeBytes":415} -unionWith.growing.6 {"exBudgetCPU":116067817,"exBudgetMemory":256470,"scriptSizeBytes":433} -unionWith.growing.7 {"exBudgetCPU":147055177,"exBudgetMemory":322838,"scriptSizeBytes":452} -unionWith.growing.8 {"exBudgetCPU":182167545,"exBudgetMemory":397798,"scriptSizeBytes":470} -unionWith.growing.9 {"exBudgetCPU":229394970,"exBudgetMemory":499496,"scriptSizeBytes":486} -unionWith.growing.10 {"exBudgetCPU":268632346,"exBudgetMemory":583048,"scriptSizeBytes":505} -unionWith.growing.11 {"exBudgetCPU":311994730,"exBudgetMemory":675192,"scriptSizeBytes":523} -unionWith.growing.12 {"exBudgetCPU":359482122,"exBudgetMemory":775928,"scriptSizeBytes":541} -unionWith.growing.13 {"exBudgetCPU":411094522,"exBudgetMemory":885256,"scriptSizeBytes":560} -unionWith.growing.14 {"exBudgetCPU":466831930,"exBudgetMemory":1003176,"scriptSizeBytes":578} -unionWith.growing.15 {"exBudgetCPU":526694346,"exBudgetMemory":1129688,"scriptSizeBytes":597} -unionWith.growing.16 {"exBudgetCPU":590681770,"exBudgetMemory":1264792,"scriptSizeBytes":615} -unionWith.growing.17 {"exBudgetCPU":658794202,"exBudgetMemory":1408488,"scriptSizeBytes":633} -unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":226} -unionWithData const.applied {"exBudgetCPU":22197737,"exBudgetMemory":51108,"scriptSizeBytes":311} +valueOf.growing.2 {"exBudgetCPU":26098659,"exBudgetMemory":61340,"scriptSizeBytes":420} +valueOf.growing.3 {"exBudgetCPU":38718722,"exBudgetMemory":90246,"scriptSizeBytes":451} +valueOf.growing.4 {"exBudgetCPU":54896971,"exBudgetMemory":126312,"scriptSizeBytes":470} +valueOf.growing.5 {"exBudgetCPU":75080001,"exBudgetMemory":171038,"scriptSizeBytes":488} +valueOf.growing.6 {"exBudgetCPU":99267812,"exBudgetMemory":224424,"scriptSizeBytes":506} +valueOf.growing.7 {"exBudgetCPU":127460404,"exBudgetMemory":286470,"scriptSizeBytes":525} +valueOf.growing.8 {"exBudgetCPU":159657777,"exBudgetMemory":357176,"scriptSizeBytes":543} +valueOf.growing.9 {"exBudgetCPU":198718809,"exBudgetMemory":441700,"scriptSizeBytes":561} +valueOf.growing.10 {"exBudgetCPU":236994369,"exBudgetMemory":525796,"scriptSizeBytes":579} +valueOf.growing.11 {"exBudgetCPU":279274710,"exBudgetMemory":618552,"scriptSizeBytes":597} +valueOf.growing.12 {"exBudgetCPU":325559832,"exBudgetMemory":719968,"scriptSizeBytes":616} +valueOf.growing.13 {"exBudgetCPU":375849735,"exBudgetMemory":830044,"scriptSizeBytes":634} +valueOf.growing.14 {"exBudgetCPU":430144419,"exBudgetMemory":948780,"scriptSizeBytes":652} +valueOf.growing.15 {"exBudgetCPU":488443884,"exBudgetMemory":1076176,"scriptSizeBytes":671} +valueOf.growing.16 {"exBudgetCPU":550748130,"exBudgetMemory":1212232,"scriptSizeBytes":689} +valueOf.growing.17 {"exBudgetCPU":617057157,"exBudgetMemory":1356948,"scriptSizeBytes":708} +unionWith.const {"exBudgetCPU":22764559,"exBudgetMemory":52540,"scriptSizeBytes":318} +unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":232} +unionWith.(+).applied {"exBudgetCPU":22812903,"exBudgetMemory":52042,"scriptSizeBytes":314} +unionWith.tokens {"exBudgetCPU":22150698,"exBudgetMemory":51546,"scriptSizeBytes":324} +unionWith.symbols {"exBudgetCPU":14449266,"exBudgetMemory":33932,"scriptSizeBytes":316} +unionWith.growing.1 {"exBudgetCPU":14538585,"exBudgetMemory":34232,"scriptSizeBytes":320} +unionWith.growing.2 {"exBudgetCPU":32918457,"exBudgetMemory":76822,"scriptSizeBytes":354} +unionWith.growing.3 {"exBudgetCPU":47254650,"exBudgetMemory":109258,"scriptSizeBytes":375} +unionWith.growing.4 {"exBudgetCPU":65506305,"exBudgetMemory":150054,"scriptSizeBytes":393} +unionWith.growing.5 {"exBudgetCPU":87762741,"exBudgetMemory":199510,"scriptSizeBytes":412} +unionWith.growing.6 {"exBudgetCPU":114023958,"exBudgetMemory":257626,"scriptSizeBytes":430} +unionWith.growing.7 {"exBudgetCPU":144289956,"exBudgetMemory":324402,"scriptSizeBytes":449} +unionWith.growing.8 {"exBudgetCPU":178560735,"exBudgetMemory":399838,"scriptSizeBytes":467} +unionWith.growing.9 {"exBudgetCPU":224706117,"exBudgetMemory":502148,"scriptSizeBytes":482} +unionWith.growing.10 {"exBudgetCPU":262981677,"exBudgetMemory":586244,"scriptSizeBytes":501} +unionWith.growing.11 {"exBudgetCPU":305262018,"exBudgetMemory":679000,"scriptSizeBytes":519} +unionWith.growing.12 {"exBudgetCPU":351547140,"exBudgetMemory":780416,"scriptSizeBytes":537} +unionWith.growing.13 {"exBudgetCPU":401837043,"exBudgetMemory":890492,"scriptSizeBytes":556} +unionWith.growing.14 {"exBudgetCPU":456131727,"exBudgetMemory":1009228,"scriptSizeBytes":574} +unionWith.growing.15 {"exBudgetCPU":514431192,"exBudgetMemory":1136624,"scriptSizeBytes":593} +unionWith.growing.16 {"exBudgetCPU":576735438,"exBudgetMemory":1272680,"scriptSizeBytes":611} +unionWith.growing.17 {"exBudgetCPU":643044465,"exBudgetMemory":1417396,"scriptSizeBytes":629} +unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":222} +unionWithData const.applied {"exBudgetCPU":21957283,"exBudgetMemory":51244,"scriptSizeBytes":307} equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} -equality.swappedTokensTrue {"exBudgetCPU":49963365,"exBudgetMemory":111472,"scriptSizeBytes":466} -equality.swappedSymbolsTrue {"exBudgetCPU":38743024,"exBudgetMemory":84268,"scriptSizeBytes":457} +equality.swappedTokensTrue {"exBudgetCPU":49482457,"exBudgetMemory":111744,"scriptSizeBytes":463} +equality.swappedSymbolsTrue {"exBudgetCPU":38502570,"exBudgetMemory":84404,"scriptSizeBytes":454} equality.growing.1 {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.growing.2 {"exBudgetCPU":49932869,"exBudgetMemory":111472,"scriptSizeBytes":461} -equality.growing.3 {"exBudgetCPU":75448443,"exBudgetMemory":167076,"scriptSizeBytes":496} -equality.growing.4 {"exBudgetCPU":109214033,"exBudgetMemory":239864,"scriptSizeBytes":532} -equality.growing.5 {"exBudgetCPU":151229639,"exBudgetMemory":329836,"scriptSizeBytes":567} -equality.growing.6 {"exBudgetCPU":201495261,"exBudgetMemory":436992,"scriptSizeBytes":602} -equality.growing.7 {"exBudgetCPU":260010899,"exBudgetMemory":561332,"scriptSizeBytes":637} -equality.growing.8 {"exBudgetCPU":326776553,"exBudgetMemory":702856,"scriptSizeBytes":673} -equality.growing.9 {"exBudgetCPU":401792223,"exBudgetMemory":861564,"scriptSizeBytes":708} -equality.growing.10 {"exBudgetCPU":485057909,"exBudgetMemory":1037456,"scriptSizeBytes":743} -equality.growing.11 {"exBudgetCPU":576573611,"exBudgetMemory":1230532,"scriptSizeBytes":778} -equality.growing.12 {"exBudgetCPU":676339329,"exBudgetMemory":1440792,"scriptSizeBytes":814} -equality.growing.13 {"exBudgetCPU":784355063,"exBudgetMemory":1668236,"scriptSizeBytes":849} -equality.growing.14 {"exBudgetCPU":900620813,"exBudgetMemory":1912864,"scriptSizeBytes":884} -equality.growing.15 {"exBudgetCPU":1025136579,"exBudgetMemory":2174676,"scriptSizeBytes":919} -equality.growing.16 {"exBudgetCPU":1157902361,"exBudgetMemory":2453672,"scriptSizeBytes":955} -equality.growing.17 {"exBudgetCPU":1298918159,"exBudgetMemory":2749852,"scriptSizeBytes":990} -normalize.identity {"exBudgetCPU":45981657,"exBudgetMemory":105689,"scriptSizeBytes":565} -normalize.empty {"exBudgetCPU":30711364,"exBudgetMemory":70825,"scriptSizeBytes":447} -assertSorted.succeeds {"exBudgetCPU":39953341,"exBudgetMemory":95214,"scriptSizeBytes":523} +equality.growing.2 {"exBudgetCPU":49451961,"exBudgetMemory":111744,"scriptSizeBytes":458} +equality.growing.3 {"exBudgetCPU":74727081,"exBudgetMemory":167484,"scriptSizeBytes":493} +equality.growing.4 {"exBudgetCPU":108011763,"exBudgetMemory":240544,"scriptSizeBytes":528} +equality.growing.5 {"exBudgetCPU":149306007,"exBudgetMemory":330924,"scriptSizeBytes":563} +equality.growing.6 {"exBudgetCPU":198609813,"exBudgetMemory":438624,"scriptSizeBytes":599} +equality.growing.7 {"exBudgetCPU":255923181,"exBudgetMemory":563644,"scriptSizeBytes":634} +equality.growing.8 {"exBudgetCPU":321246111,"exBudgetMemory":705984,"scriptSizeBytes":669} +equality.growing.9 {"exBudgetCPU":394578603,"exBudgetMemory":865644,"scriptSizeBytes":704} +equality.growing.10 {"exBudgetCPU":475920657,"exBudgetMemory":1042624,"scriptSizeBytes":740} +equality.growing.11 {"exBudgetCPU":565272273,"exBudgetMemory":1236924,"scriptSizeBytes":775} +equality.growing.12 {"exBudgetCPU":662633451,"exBudgetMemory":1448544,"scriptSizeBytes":810} +equality.growing.13 {"exBudgetCPU":768004191,"exBudgetMemory":1677484,"scriptSizeBytes":845} +equality.growing.14 {"exBudgetCPU":881384493,"exBudgetMemory":1923744,"scriptSizeBytes":881} +equality.growing.15 {"exBudgetCPU":1002774357,"exBudgetMemory":2187324,"scriptSizeBytes":916} +equality.growing.16 {"exBudgetCPU":1132173783,"exBudgetMemory":2468224,"scriptSizeBytes":951} +equality.growing.17 {"exBudgetCPU":1269582771,"exBudgetMemory":2766444,"scriptSizeBytes":986} +normalize.identity {"exBudgetCPU":45861430,"exBudgetMemory":105757,"scriptSizeBytes":562} +normalize.empty {"exBudgetCPU":30470910,"exBudgetMemory":70961,"scriptSizeBytes":444} +assertSorted.succeeds {"exBudgetCPU":39833114,"exBudgetMemory":95282,"scriptSizeBytes":519} assertSorted.fails on malsorted symbols {"exBudgetCPU":28443494,"exBudgetMemory":62290,"scriptSizeBytes":340} -assertSorted.fails on zero quantities {"exBudgetCPU":28508984,"exBudgetMemory":62224,"scriptSizeBytes":522} +assertSorted.fails on zero quantities {"exBudgetCPU":28208984,"exBudgetMemory":62160,"scriptSizeBytes":519} assertSorted.fails on empty token map {"exBudgetCPU":1650103,"exBudgetMemory":455,"scriptSizeBytes":262} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index 09c783367..423e0f59b 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -20,7 +20,7 @@ valueOf.growing.15 (program 1.0.0 1) valueOf.growing.16 (program 1.0.0 1) valueOf.growing.17 (program 1.0.0 1) unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) +unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) unionWith.tokens (program 1.0.0 [(#41c0, #a24a6f74686572746f6b656e0149736f6d65746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) @@ -170,7 +170,7 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cd, #a145746f6b656e01) , (#41ce, #a145746f6b656e01) , (#41cf, #a145746f6b656e01) ]) -unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i10 (force (force sndPair) i5) (force (force sndPair) (force headList i3)))) (i7 (\i0 -> \i0 -> i2) i4 (force tailList i3)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i5 (i7 (\i0 -> \i0 -> i1) (force headList i3) (force tailList i3) i4))) (delay (force mkCons (force headList i3) (i7 (\i0 -> \i0 -> i1) i5 i4 (force tailList i3))))))))) (force (force fstPair) (force headList i2))) (force (force fstPair) i3)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) +unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) equality.triviallyTrue (program 1.0.0 True) diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index 98aa4bc15..286627cd6 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -3,71 +3,71 @@ singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> forc valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> i11 (bData i14) (mapData i1)) ((\i0 -> i11 (bData i15) (iData i1)) 1)) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> i12 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i12 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i15 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i18 (i17 i1)) i6) (delay (i4 (i13 (i17 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) -unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 #736f6d65746f6b656e 1)) (i10 i11 (i12 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 (i15 i19 1)) (i14 i13 (i15 #746f6b656e 1))) (i14 #c7 (i15 i19 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c6 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i14 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i14 (mkPairData i2 (i10 (i12 i5) (i12 (i17 i3)))) (i7 i19 i4 (i16 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i14 i5 (i7 i15 (i17 i3) (i16 i3) i4))) (delay (i14 (i17 i3) (i7 i15 i5 i4 (i16 i3))))))))) (i17 (i16 i2))) (i16 i3)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2))) -unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i14 (i15 i1)) i6) (delay (i4 (i10 (i15 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 #736f6d65746f6b656e 1)) (i10 i11 (i12 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 (i15 i19 1)) (i14 i13 (i15 #746f6b656e 1))) (i14 #c7 (i15 i19 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c6 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i15 (i16 i13 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i13 (i16 i20 1))) (i1 addInteger (i14 i13 (i16 i20 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i15 (i16 i13 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i13 (i16 i20 1))) (i1 addInteger (i14 i13 (i16 i20 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i24 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i25 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i26 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i27 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i28 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i29 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i30 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i31 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i32 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i33 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i34 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i35 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i36 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i37 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i38 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i14 (i13 i2)) (i14 (i13 i1))) (delay (equalsData (i9 (i13 i2)) (i9 (i13 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i39 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay (force (force trace "Negative amount in Value" (delay error)))))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i20 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i13 i2)) (\i0 -> i21 (mkPairData (i15 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i22 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i27 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i28 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i29 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i30 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i31 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i32 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i33 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i34 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i35 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i36 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i37 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i38 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i39 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i40 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i40 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i40 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay (force (force trace "Negative amount in Value" (delay error)))))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i14 i2)) (\i0 -> i20 (mkPairData (i14 (i15 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i14 i2)) (\i0 -> i21 (mkPairData (i14 (i15 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i13 (i14 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i8 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i21 (i16 i1) (i2 (i17 i1)))))) i2) (i14 #c7 (i15 i19 1)) (i14 #c0 (i15 i19 1)))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i13 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i7 (i10 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force trace)) "unsorted map") (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i18 (i19 i23 1)) (i17 i18 (i19 i23 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i13 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i13 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i10 (i12 i5) (i12 (i16 i3)))) (i7 i18 i4 (i15 i3)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i5 (i7 i14 (i16 i3) (i15 i3) i4))) (delay (i23 (i16 i3) (i7 i14 i5 i4 (i15 i3))))))))) (i16 (i15 i2))) (i15 i3)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force headList)) (force (force fstPair))) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i18 (i19 i23 1)) (i17 i18 (i19 i23 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i13 (i14 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i10 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i18) (bData i2) (mapData i1)) #c0 i14)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay (force (i9 i10 (delay error)))) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i10 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force trace)) "unsorted map") (force tailList)) (force (force fstPair))) (force headList)) [ ])) \ No newline at end of file From 889a41f2c144726dd4f784c2f9ae7799df8cf44d Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 9 May 2022 09:25:55 -0400 Subject: [PATCH 448/584] Update emanote (to get rid of lint-utils) --- flake.lock | 209 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 131 insertions(+), 78 deletions(-) diff --git a/flake.lock b/flake.lock index 7e9cfadf3..91597990c 100644 --- a/flake.lock +++ b/flake.lock @@ -190,11 +190,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1648411303, - "narHash": "sha256-OhAbDxl+AaTQDvPUEVYn9xnW7iP++bZ3dCJEOLM29fk=", + "lastModified": 1650932571, + "narHash": "sha256-rdpfJ+10a1uBPtHMNoAcpDE183RzpILRpsMgxj/YJek=", "owner": "srid", "repo": "ema", - "rev": "976590c6cb7836cc4caeeaf2ca65d84a6c2502e3", + "rev": "05c8a2127391ee4b593fa6541bc9078eb44ad10f", "type": "github" }, "original": { @@ -218,22 +218,23 @@ "flake-utils" ], "heist": "heist", - "lint-utils": "lint-utils_2", + "ixset-typed": "ixset-typed", "nixpkgs": [ "emanote", "ema", "nixpkgs" ], + "pandoc-link-context": "pandoc-link-context", "pathtree": "pathtree", "tailwind-haskell": "tailwind-haskell", "unionmount": "unionmount" }, "locked": { - "lastModified": 1649015242, - "narHash": "sha256-CUB+JJawmI+4PeuCYwME/rZFebg9HTbbWAS66fRLHig=", + "lastModified": 1651699367, + "narHash": "sha256-f+whlGwxzv5Lcem+rxBgIgnkU+KcckogtWbRwZ6nM4I=", "owner": "srid", "repo": "emanote", - "rev": "34a2040d5b77e425f22183232dcbd6735f9b49a5", + "rev": "2b6558fde2999ec22f645cb95322995b780f09f1", "type": "github" }, "original": { @@ -276,6 +277,22 @@ } }, "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1627913399, @@ -323,11 +340,11 @@ }, "flake-utils_3": { "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "lastModified": 1642700792, + "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", "owner": "numtide", "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", "type": "github" }, "original": { @@ -570,23 +587,23 @@ "heist": { "flake": false, "locked": { - "lastModified": 1649013405, - "narHash": "sha256-4NK8ZLHm4iHWU+LCu3M0jnALCnQCa7lEu72NIOQ1YI8=", + "lastModified": 1649279862, + "narHash": "sha256-YPD7Qv1ZcXM4uAlsZ2P/2CKen4H2OY3VHHGluYFVulg=", "owner": "srid", "repo": "heist", - "rev": "a4b3d6d5573a4ba9c410b382fa3771e8ae53fcfa", + "rev": "085c7ab88b73079de27c8def27d67f03853fde05", "type": "github" }, "original": { "owner": "srid", - "ref": "emanote-release", + "ref": "emanote-release--ghc9", "repo": "heist", "type": "github" } }, "hercules-ci-effects": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1647711660, @@ -716,49 +733,42 @@ "type": "github" } }, - "lint-utils": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "emanote", - "ema", - "nixpkgs" - ] - }, + "ixset-typed": { + "flake": false, "locked": { - "lastModified": 1648405819, - "narHash": "sha256-Rv9QsHg5a3OurGxbC0Y2aERAZ0sFXYQyaxGYXdDPiZ4=", - "ref": "parameterized", - "rev": "9ba45de1fc3dbbe65c39d7d0107b99a8046a8081", - "revCount": 21, - "type": "git", - "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + "lastModified": 1639657838, + "narHash": "sha256-pI2dzJfkR10CHDEX6TV2E01pqcGkj7kheROw05MRTR8=", + "owner": "well-typed", + "repo": "ixset-typed", + "rev": "6cf16f77ae173311742623e5f0b308a21b337aa7", + "type": "github" }, "original": { - "ref": "parameterized", - "type": "git", - "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + "owner": "well-typed", + "repo": "ixset-typed", + "type": "github" } }, - "lint-utils_2": { + "lint-utils": { "inputs": { - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_2", "nixpkgs": [ "emanote", + "ema", "nixpkgs" ] }, "locked": { - "lastModified": 1648667273, - "narHash": "sha256-eQUb40xDyv0Ye3oMzGz6tcHPF9y9Xhq1QksV9h7uEDk=", - "ref": "spec-type", - "rev": "4648a98d91f754ae0f7a3d035a1aaa871eb1b4fc", - "revCount": 34, + "lastModified": 1650427214, + "narHash": "sha256-9m66rRSSM614ocRXNPAArwnrS6zzCQYYhd3nw8g4QUg=", + "ref": "overengineered", + "rev": "5555def5a25c5437834c06cbe79b3945916ec59f", + "revCount": 28, "type": "git", "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" }, "original": { - "ref": "spec-type", + "ref": "overengineered", "type": "git", "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" } @@ -781,17 +791,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1648219316, - "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", + "lastModified": 1650882267, + "narHash": "sha256-BFKiz8srATQIBuFEN2HgS2EHisK29EjZ/HV34wSr2lU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", + "rev": "2ea2f7b6d0cb7ce0712f2aa80303cda08deb0de2", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", + "rev": "2ea2f7b6d0cb7ce0712f2aa80303cda08deb0de2", "type": "github" } }, @@ -860,6 +870,52 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1647350163, + "narHash": "sha256-OcMI+PFEHTONthXuEQNddt16Ml7qGvanL3x8QOl2Aao=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1649456639, + "narHash": "sha256-rZCjaEAZgOtT9kYTBigksof64SqKAXOuoHhlzHvfl0E=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c48167590e3258daac6ab12a41bc2b7341e9b2ec", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c48167590e3258daac6ab12a41bc2b7341e9b2ec", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1648219316, + "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1647297614, "narHash": "sha256-ulGq3W5XsrBMU/u5k9d4oPy65pQTkunR4HKKtTq0RwY=", @@ -875,7 +931,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_6": { "flake": false, "locked": { "lastModified": 1628785280, @@ -909,15 +965,28 @@ "type": "github" } }, + "pandoc-link-context": { + "flake": false, + "locked": { + "lastModified": 1650932770, + "narHash": "sha256-/WzE4O23B1OcL3WF8Saz5TRQj0tGH7FtbgRLRson2Mc=", + "owner": "srid", + "repo": "pandoc-link-context", + "rev": "85bd204339aafd309b8a3dd99ebffa6a50776cb6", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "master", + "repo": "pandoc-link-context", + "type": "github" + } + }, "pathtree": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_4", - "nixpkgs": [ - "emanote", - "ema", - "nixpkgs" - ] + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1649011952, @@ -941,7 +1010,7 @@ "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", "iohk-nix": "iohk-nix_2", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_6", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sphinxcontrib-haddock": "sphinxcontrib-haddock", "stackage-nix": "stackage-nix" @@ -1089,28 +1158,16 @@ }, "tailwind-haskell": { "inputs": { - "flake-compat": [ - "emanote", - "ema", - "flake-compat" - ], - "flake-utils": [ - "emanote", - "ema", - "flake-utils" - ], - "nixpkgs": [ - "emanote", - "ema", - "nixpkgs" - ] + "flake-compat": "flake-compat_3", + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1649012698, - "narHash": "sha256-Kosm6SyTjbyD869o+qM4Zg7IUKdqRXq4FN/HCpXcflk=", + "lastModified": 1649519562, + "narHash": "sha256-IVZ4D7JkSCn0sjeTw5b0s2TTIU+g4hk78u1znXY4JjQ=", "owner": "srid", "repo": "tailwind-haskell", - "rev": "f17cea75ad6a27976e9445eba9f77fa8d323885c", + "rev": "f5bfc15da3ee6e74a077579fb10269bb450fa5cb", "type": "github" }, "original": { @@ -1139,13 +1196,9 @@ }, "unionmount": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "flake-utils": "flake-utils_5", - "nixpkgs": [ - "emanote", - "ema", - "nixpkgs" - ] + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1649012450, From f49ab796c31b08457ec8b16d5e54037029941c28 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 9 May 2022 20:29:29 +0530 Subject: [PATCH 449/584] Composable smart names and improvements --- Plutarch/Pretty.hs | 131 +++++++++++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 53 deletions(-) diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index aa615d855..6902fec6f 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -2,11 +2,12 @@ module Plutarch.Pretty (prettyTerm, prettyScript, prettyConstant) where +import Control.Monad ((<=<)) import Data.Bifunctor (first) import Data.ByteString (ByteString) import qualified Data.ByteString.Builder as BSB import qualified Data.ByteString.Lazy as LBS -import Data.List (foldl') +import Data.List (find, foldl') import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map import Data.Set (Set) @@ -38,7 +39,6 @@ import UntypedPlutusCore ( Program (_progTerm), Term (Apply, Builtin, Constant, Delay, Error, Force, LamAbs, Var), ) -import qualified UntypedPlutusCore as UPLC (Term) prettyScript :: Script -> PP.Doc () prettyScript = prettyUPLC . _progTerm . unScript @@ -46,26 +46,29 @@ prettyScript = prettyUPLC . _progTerm . unScript prettyTerm :: ClosedTerm a -> PP.Doc () prettyTerm x = prettyScript $ compile x +data PrettyState = Normal | Applying | AppliedOver | UnaryArg + deriving stock (Bounded, Enum, Eq, Show) + {- This isn't suitable for pretty printing UPLC from any source. It's primarily suited for Plutarch output. Practically speaking though, it should work with any _idiomatic_ UPLC. -} -prettyUPLC :: UPLC.Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () -prettyUPLC = go False mempty $ mkStdGen 42 +prettyUPLC :: Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () +prettyUPLC = go Normal mempty $ mkStdGen 42 where - go :: RandomGen g => Bool -> Map Index Text -> g -> UPLC.Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () + go :: RandomGen g => PrettyState -> Map Index Text -> g -> Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () go _ _ _ (Constant _ c) = prettyConstant c go _ _ _ (Builtin _ b) = PP.pretty b go _ _ _ (Error _) = "ERROR" - go _ nameMap _ (Var _ (DeBruijn x)) = case Map.lookup (x - 1) nameMap of + go _ nameMap _ (Var _ (DeBruijn x)) = case nameOfRef x nameMap of Just nm -> PP.pretty nm Nothing -> error "impossible: free variable" - go _ nameMap g (Force _ t@Apply {}) = "!" <> PP.parens (go False nameMap g t) - go _ nameMap g (Force _ t@LamAbs {}) = "!" <> PP.parens (go False nameMap g t) - go _ nameMap g (Force _ t) = "!" <> go False nameMap g t - go _ nameMap g (Delay _ t@Apply {}) = "~" <> PP.parens (go False nameMap g t) - go _ nameMap g (Delay _ t@LamAbs {}) = "~" <> PP.parens (go False nameMap g t) - go _ nameMap g (Delay _ t) = "~" <> go False nameMap g t + go _ nameMap g (Force _ t@Apply {}) = "!" <> PP.parens (go Normal nameMap g t) + go _ nameMap g (Force _ t@LamAbs {}) = "!" <> PP.parens (go Normal nameMap g t) + go _ nameMap g (Force _ t) = "!" <> go UnaryArg nameMap g t + go _ nameMap g (Delay _ t@Apply {}) = "~" <> PP.parens (go Normal nameMap g t) + go _ nameMap g (Delay _ t@LamAbs {}) = "~" <> PP.parens (go Normal nameMap g t) + go _ nameMap g (Delay _ t) = "~" <> go UnaryArg nameMap g t go _ nameMap g (LamAbs _ _ t') = PP.parens $ let (depth, t) = unwrapLamAbs 0 t' @@ -80,56 +83,71 @@ prettyUPLC = go False mempty $ mkStdGen 42 in PP.hang indentWidth $ PP.sep [ "\\" <> PP.hsep (reverse $ map PP.pretty names) <+> "->" - , go False (Map.mapKeys (+ (depth + 1)) nameMap <> Map.fromList (zip [0 .. depth] names)) finalG t + , go Normal (Map.mapKeys (+ (depth + 1)) nameMap <> Map.fromList (zip [0 .. depth] names)) finalG t ] - go _ nameMap g (Apply _ (LamAbs _ _ t) arg) = - let (l, ft) = unwrapBindings [] t - args = arg : reverse l - (names, _, finalG) = - foldr - ( \expr (l, existingNames, g) -> - let (newName, newG) = case expr of - Force _ (Force _ (Builtin _ b)) -> (fromString $ forcedPrefix <> show b, g) - Force _ (Builtin _ b) -> (fromString $ forcedPrefix <> show b, g) - PFixAst -> ("fix", g) - ComposeAST (Builtin () PLC.SndPair) (Builtin () PLC.UnConstrData) -> ("unDataSum", g) - ComposeAST (Var () (DeBruijn ix)) (Builtin () PLC.UnConstrData) - | ix == 2 -> ("unDataSum", g) - _ -> freshVarName existingNames g - in (newName : l, Set.insert newName existingNames, newG) + go _ nameMap g (Apply _ (LamAbs _ _ t) firstArg) = + let (restArgs, coreF) = unwrapBindings [] t + (firstName, nextG) = smartName nameMap g firstArg + nextMap = Map.mapKeys (+ 1) nameMap <> Map.singleton 0 firstName + (finalDoc, finalMap, finalG) = + foldl' + ( \(docAcc, mp, currG) argExpr -> + let (newName, newG) = smartName mp currG argExpr + newDoc = docAcc <> PP.flatAlt PP.hardline "; " <> helper mp (newName, argExpr) + in (newDoc, Map.mapKeys (+ 1) mp <> Map.singleton 0 newName, newG) ) - ([], Set.fromList $ Map.elems nameMap, g) - args - bindings = zip names args + (helper nextMap (firstName, firstArg), nextMap, nextG) + $ reverse restArgs helper mp (name, expr) = PP.hang indentWidth $ PP.sep [ PP.pretty name <+> "=" - , go False mp finalG expr + , go Normal mp nextG expr ] - (finalDoc, finalMap) = - foldl' - ( \(doc, mp) (name, expr) -> - let newDoc = doc <> PP.flatAlt PP.hardline "; " <> helper mp (name, expr) - in (newDoc, Map.mapKeys (+ 1) mp <> Map.singleton 0 name) - ) - (helper nameMap (head bindings), Map.mapKeys (+ 1) nameMap <> Map.singleton 0 (fst $ head bindings)) - $ tail bindings in PP.align $ PP.vsep [ "let" <+> PP.align finalDoc - , "in" <+> go False finalMap finalG ft + , "in" <+> go Normal finalMap finalG coreF ] go fl nameMap g (Apply _ t arg) = - (if fl then PP.parens else id) $ + (if fl == AppliedOver then PP.parens else id) $ let (l, f) = unwrapApply [] t args = l <> [arg] - in PP.hang indentWidth $ PP.sep $ go False nameMap g f : (go True nameMap g <$> args) + in PP.hang indentWidth $ PP.sep $ go Applying nameMap g f : (go AppliedOver nameMap g <$> args) + +smartName :: RandomGen g => Map Index Text -> g -> Term DeBruijn uni DefaultFun () -> (Text, g) +smartName nameMap g = \case + Force _ (Force _ (Builtin _ b)) -> (forcedPrefix <> showText b, g) + Force _ (Builtin _ b) -> (forcedPrefix <> showText b, g) + PFixAst -> ("fix", g) + ComposeAST + (Builtin () PLC.SndPair) + (Builtin () PLC.UnConstrData) -> ("unDataSum", g) + ComposeAST + (Var () (DeBruijn (builtinFunFromName <=< flip nameOfRef nameMap -> Just PLC.SndPair))) + (Builtin () PLC.UnConstrData) -> ("unDataSum", g) + _ -> freshVarName (Set.fromList $ Map.elems nameMap) g + +showText :: Show a => a -> Text +showText = Txt.pack . show + +nameOfRef :: (Ord k, Num k) => k -> Map k a -> Maybe a +nameOfRef ix = Map.lookup (ix - 1) + +builtinFunFromName :: Text -> Maybe DefaultFun +builtinFunFromName res = + if Txt.take prefixLen res == forcedPrefix + then helper $ Txt.drop prefixLen res + else helper res + where + prefixLen = Txt.length forcedPrefix + helper s = find (\e -> showText e == s) builtinFunNames + builtinFunNames = [minBound .. maxBound :: PLC.DefaultFun] prettyConstant :: PLC.Some (PLC.ValueOf DefaultUni) -> PP.Doc () prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniInteger n)) = PP.pretty n prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniByteString b)) = PP.pretty $ fromHex b -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniString s)) = PP.pretty s +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniString s)) = PP.pretty $ show s prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniUnit _)) = "()" prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniBool b)) = PP.pretty b prettyConstant (PLC.Some (PLC.ValueOf (PLC.DefaultUniList a) l)) = @@ -165,7 +183,7 @@ prettyConstant (PLC.Some (PLC.ValueOf uni _)) = fromHex :: ByteString -> Text fromHex = ("0x" <>) . TxtEnc.decodeUtf8 . LBS.toStrict . BSB.toLazyByteString . BSB.byteStringHex -forcedPrefix :: String +forcedPrefix :: Text forcedPrefix = "fr" freshVarName :: RandomGen g => Set Text -> g -> (Text, g) @@ -194,22 +212,23 @@ keywords = indentWidth :: Int indentWidth = 2 -unwrapLamAbs :: Index -> UPLC.Term name uni fun ann -> (Index, UPLC.Term name uni fun ann) +unwrapLamAbs :: Index -> Term name uni fun ann -> (Index, Term name uni fun ann) unwrapLamAbs d (LamAbs _ _ t) = unwrapLamAbs (d + 1) t unwrapLamAbs d a = (d, a) -unwrapBindings :: [UPLC.Term name uni fun ann] -> UPLC.Term name uni fun ann -> ([UPLC.Term name uni fun ann], UPLC.Term name uni fun ann) +unwrapBindings :: [Term name uni fun ann] -> Term name uni fun ann -> ([Term name uni fun ann], Term name uni fun ann) unwrapBindings l (Apply _ (LamAbs _ _ t) arg) = unwrapBindings (arg : l) t unwrapBindings l a = (l, a) unwrapApply :: - [UPLC.Term name uni fun ann] -> - UPLC.Term name uni fun ann -> - ([UPLC.Term name uni fun ann], UPLC.Term name uni fun ann) + [Term name uni fun ann] -> + Term name uni fun ann -> + ([Term name uni fun ann], Term name uni fun ann) unwrapApply l (Apply _ t arg) = unwrapApply (arg : l) t unwrapApply l arg = (l, arg) -pattern PFixAst :: UPLC.Term name uni fun () +-- AST resulting from `pfix`. This is always constant. +pattern PFixAst :: Term name uni fun () pattern PFixAst <- LamAbs () @@ -260,5 +279,11 @@ pattern PFixAst <- ) ) -pattern ComposeAST :: UPLC.Term DeBruijn uni fun () -> UPLC.Term DeBruijn uni fun () -> UPLC.Term DeBruijn uni fun () -pattern ComposeAST f g <- LamAbs () _ (Apply () f (Apply () g (Var () (DeBruijn 1)))) +-- If `f` and `g` are Var references, their indices are incremented once since they are within a lambda. +pattern ComposeAST :: Term DeBruijn uni fun () -> Term DeBruijn uni fun () -> Term DeBruijn uni fun () +pattern ComposeAST f g <- LamAbs () _ (Apply () (incrVar -> f) (Apply () (incrVar -> g) (Var () (DeBruijn 1)))) + +-- | Increment the debruijn index of a 'Var', leave any other AST node unchanged. +incrVar :: Term DeBruijn uni fun () -> Term DeBruijn uni fun () +incrVar (Var () (DeBruijn n)) = Var () . DeBruijn $ n - 1 +incrVar n = n From fa69cc3baaa47317076dd61582b54ad90ac50d98 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 9 May 2022 20:33:17 +0530 Subject: [PATCH 450/584] Pretty if/then/else --- Plutarch/Pretty.hs | 52 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index 6902fec6f..8e534ab09 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -63,6 +63,21 @@ prettyUPLC = go Normal mempty $ mkStdGen 42 go _ nameMap _ (Var _ (DeBruijn x)) = case nameOfRef x nameMap of Just nm -> PP.pretty nm Nothing -> error "impossible: free variable" + go fl nameMap g (IfThenElseLikeAST (Force () (Builtin () PLC.IfThenElse)) cond trueBranch falseBranch) = + (if fl `elem` [Applying, AppliedOver, UnaryArg] then PP.parens else id) $ + prettyIfThenElse (go Normal nameMap g) cond trueBranch falseBranch + go + fl + nameMap + g + ( IfThenElseLikeAST + (Var () (DeBruijn (builtinFunAtRef nameMap -> Just PLC.IfThenElse))) + cond + trueBranch + falseBranch + ) = + (if fl `elem` [Applying, AppliedOver, UnaryArg] then PP.parens else id) $ + prettyIfThenElse (go Normal nameMap g) cond trueBranch falseBranch go _ nameMap g (Force _ t@Apply {}) = "!" <> PP.parens (go Normal nameMap g t) go _ nameMap g (Force _ t@LamAbs {}) = "!" <> PP.parens (go Normal nameMap g t) go _ nameMap g (Force _ t) = "!" <> go UnaryArg nameMap g t @@ -115,6 +130,10 @@ prettyUPLC = go Normal mempty $ mkStdGen 42 args = l <> [arg] in PP.hang indentWidth $ PP.sep $ go Applying nameMap g f : (go AppliedOver nameMap g <$> args) +prettyIfThenElse :: (t -> PP.Doc ann) -> t -> t -> t -> PP.Doc ann +prettyIfThenElse cont cond trueBranch falseBranch = + PP.hang indentWidth $ PP.vsep ["if" <+> cont cond, "then" <+> cont trueBranch, "else" <+> cont falseBranch] + smartName :: RandomGen g => Map Index Text -> g -> Term DeBruijn uni DefaultFun () -> (Text, g) smartName nameMap g = \case Force _ (Force _ (Builtin _ b)) -> (forcedPrefix <> showText b, g) @@ -124,14 +143,17 @@ smartName nameMap g = \case (Builtin () PLC.SndPair) (Builtin () PLC.UnConstrData) -> ("unDataSum", g) ComposeAST - (Var () (DeBruijn (builtinFunFromName <=< flip nameOfRef nameMap -> Just PLC.SndPair))) + (Var () (DeBruijn (builtinFunAtRef nameMap -> Just PLC.SndPair))) (Builtin () PLC.UnConstrData) -> ("unDataSum", g) _ -> freshVarName (Set.fromList $ Map.elems nameMap) g showText :: Show a => a -> Text showText = Txt.pack . show -nameOfRef :: (Ord k, Num k) => k -> Map k a -> Maybe a +builtinFunAtRef :: Map Index Text -> Index -> Maybe DefaultFun +builtinFunAtRef nameMap = builtinFunFromName <=< flip nameOfRef nameMap + +nameOfRef :: Index -> Map Index Text -> Maybe Text nameOfRef ix = Map.lookup (ix - 1) builtinFunFromName :: Text -> Maybe DefaultFun @@ -283,6 +305,32 @@ pattern PFixAst <- pattern ComposeAST :: Term DeBruijn uni fun () -> Term DeBruijn uni fun () -> Term DeBruijn uni fun () pattern ComposeAST f g <- LamAbs () _ (Apply () (incrVar -> f) (Apply () (incrVar -> g) (Var () (DeBruijn 1)))) +{- This AST represents a typical if/then/else usage if and only if 'ifThenElseMaybe' is either the +builtin IfThenElse (forced once), or a reference to such. +-} +pattern IfThenElseLikeAST :: + Term name uni fun () -> + Term name uni fun () -> + Term name uni fun () -> + Term name uni fun () -> + Term name uni fun () +pattern IfThenElseLikeAST ifThenElseMaybe cond trueBranch falseBranch <- + Force + () + ( Apply + () + ( Apply + () + ( Apply + () + ifThenElseMaybe + cond + ) + (Delay () trueBranch) + ) + (Delay () falseBranch) + ) + -- | Increment the debruijn index of a 'Var', leave any other AST node unchanged. incrVar :: Term DeBruijn uni fun () -> Term DeBruijn uni fun () incrVar (Var () (DeBruijn n)) = Var () . DeBruijn $ n - 1 From cbb1b0fa8a619ab49152950c0c6cec57009c6c47 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 11 May 2022 22:34:18 +0530 Subject: [PATCH 451/584] fix `pfindOwnInput` --- plutarch-extra/Plutarch/Extra/Api.hs | 3 +-- plutarch-test/conditional/Plutarch/TryFromSpec.hs | 2 +- plutarch-test/goldens/extra.api.dev=false.bench.golden | 4 ++-- plutarch-test/goldens/extra.api.dev=false.uplc.golden | 4 ++-- plutarch-test/goldens/extra.api.dev=true.bench.golden | 4 ++-- plutarch-test/goldens/extra.api.dev=true.uplc.golden | 4 ++-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index 373752b82..a5db768a6 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -75,8 +75,7 @@ pfindOwnInput = phoistAcyclic $ matches :: Term s (PTxOutRef :--> PAsData PTxInInfo :--> PBool) matches = phoistAcyclic $ plam $ \outref txininfo -> - pfield @"id" # outref - #== pfield @"id" # (pfield @"outRef" # txininfo) + outref #== pfield @"outRef" # txininfo {- | Lookup up the datum given the datum hash. diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index ab03b4797..efc6ace53 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -359,7 +359,7 @@ pfindOwnInput = phoistAcyclic $ target = pfield @"_0" # txoutRef pred :: Term _ (PAsData PTxInInfo :--> PBool) pred = plam $ \actual -> - (pfield @"id" # target) #== (pfield @"id" #$ pfield @"outRef" # pfromData actual) + target #== pfield @"outRef" # pfromData actual pure $ pfind # pred # txInInfos ------------- Helpers -------------------------------------------------------- diff --git a/plutarch-test/goldens/extra.api.dev=false.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden index 4e68e39e8..160312b96 100644 --- a/plutarch-test/goldens/extra.api.dev=false.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=false.bench.golden @@ -1,3 +1,3 @@ -pfindOwnInput {"exBudgetCPU":8741650,"exBudgetMemory":16872,"scriptSizeBytes":329} -pgetContinuingOutputs {"exBudgetCPU":16619190,"exBudgetMemory":31878,"scriptSizeBytes":420} +pfindOwnInput {"exBudgetCPU":7306417,"exBudgetMemory":14580,"scriptSizeBytes":319} +pgetContinuingOutputs {"exBudgetCPU":15362595,"exBudgetMemory":30186,"scriptSizeBytes":405} pparseDatum {"exBudgetCPU":7551331,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.golden index 088f4db00..c77ae4864 100644 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=false.uplc.golden @@ -1,3 +1,3 @@ -pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData (i9 (i11 i2)) ((\i0 -> i10 (i12 i1)) (i9 (i11 i1)))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> equalsData (i12 (i14 i2)) ((\i0 -> i13 (i15 i1)) (i12 (i14 i1)))) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i15 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i14 (i16 i1))) ((\i0 -> i13 (i15 i1)) (i12 (i13 (i14 i1))))) i3) (delay error)) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) ((\i0 -> unListData (i9 (i10 (i11 i1)))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData i2 (i9 (i11 i1))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i15 i1)) (delay (\i0 -> \i0 -> i2 (i17 i3))) (delay (i3 i2 (i16 i1)))))))) (i11 i1) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (i12 ((\i0 -> i14 (i16 i1)) (i13 (i14 (i15 i1))))) i3) (delay error)) ((\i0 -> unListData (i10 (i12 i1))) (i9 i4)) ((\i0 -> unListData (i10 (i11 (i12 i1)))) (i9 i4)) (i9 i1))) (delay error))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (\i0 -> \i0 -> equalsData i2 (i3 (i5 i1)))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) pparseDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i9 i1)) (delay (\i0 -> \i0 -> i2 (i11 i3))) (delay (i3 i2 (i8 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i7 (i8 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 ((\i0 -> i10 (i9 (i11 i4))) ((\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i9 (i8 (i10 i3))))))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i5 ((\i0 -> i5 (i5 (i5 (i5 (i5 (i5 (i5 (i5 i1)))))))) (i6 i1)))) ((\i0 -> i5 (i6 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden index b9e4faafb..0f55a003d 100644 --- a/plutarch-test/goldens/extra.api.dev=true.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -1,3 +1,3 @@ -pfindOwnInput {"exBudgetCPU":8741650,"exBudgetMemory":16872,"scriptSizeBytes":329} -pgetContinuingOutputs {"exBudgetCPU":16619190,"exBudgetMemory":31878,"scriptSizeBytes":459} +pfindOwnInput {"exBudgetCPU":7306417,"exBudgetMemory":14580,"scriptSizeBytes":319} +pgetContinuingOutputs {"exBudgetCPU":15362595,"exBudgetMemory":30186,"scriptSizeBytes":444} pparseDatum {"exBudgetCPU":7551331,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.golden index 8b5e84082..79e29deb2 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.golden @@ -1,3 +1,3 @@ -pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData (i9 (i11 i2)) ((\i0 -> i10 (i12 i1)) (i9 (i11 i1)))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i14 i1)) (delay (\i0 -> \i0 -> i2 (i16 i3))) (delay (i3 i2 (i15 i1)))))))) (\i0 -> equalsData (i12 (i14 i2)) ((\i0 -> i13 (i15 i1)) (i12 (i14 i1)))) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i15 i1)))))) ((\i0 -> \i0 -> equalsData i2 (i14 (i16 i1))) ((\i0 -> i13 (i15 i1)) (i12 (i13 (i14 i1))))) i3) (delay (force (force trace "can't get any continuing outputs" (delay error))))) ((\i0 -> unListData (i9 (i11 i1))) (i8 i4)) ((\i0 -> unListData (i9 (i10 (i11 i1)))) (i8 i4)) (i8 i1))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData i2 (i9 (i11 i1))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i15 i1)) (delay (\i0 -> \i0 -> i2 (i17 i3))) (delay (i3 i2 (i16 i1)))))))) (i11 i1) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (i12 ((\i0 -> i14 (i16 i1)) (i13 (i14 (i15 i1))))) i3) (delay (force (force trace "can't get any continuing outputs" (delay error))))) ((\i0 -> unListData (i10 (i12 i1))) (i9 i4)) ((\i0 -> unListData (i10 (i11 (i12 i1)))) (i9 i4)) (i9 i1))) (delay error))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (\i0 -> \i0 -> equalsData i2 (i3 (i5 i1)))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) pparseDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i9 i1)) (delay (\i0 -> \i0 -> i2 (i11 i3))) (delay (i3 i2 (i8 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i7 (i8 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 ((\i0 -> i10 (i9 (i11 i4))) ((\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i9 (i8 (i10 i3))))))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i5 ((\i0 -> i5 (i5 (i5 (i5 (i5 (i5 (i5 (i5 i1)))))))) (i6 i1)))) ((\i0 -> i5 (i6 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file From 96e83e94448d6496c3b09b4c3095f7f59b023b68 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 12 May 2022 15:54:28 +0530 Subject: [PATCH 452/584] Fix some typos in documentation --- docs/Typeclasses/PIsDataRepr and PDataFields.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Typeclasses/PIsDataRepr and PDataFields.md b/docs/Typeclasses/PIsDataRepr and PDataFields.md index fed138662..407ef1c93 100644 --- a/docs/Typeclasses/PIsDataRepr and PDataFields.md +++ b/docs/Typeclasses/PIsDataRepr and PDataFields.md @@ -16,7 +16,7 @@ import qualified Plutarch.Monadic as P foo :: Term s (PScriptContext :--> PString) foo = plam $ \ctx -> P.do - purpose <- pmatch pfield @"purpose" # ctx + purpose <- pmatch $ pfield @"purpose" # ctx case purpose of PMinting _ -> "It's minting!" PSpending _ -> "It's spending!" @@ -247,7 +247,7 @@ Thus, you can use `PBuiltinList (PAsData PInteger)` as a field type, but not `PB > In this case, `PFourWheeler` is at the 0th index, `PTwoWheeler` is at the 1st index, and `PImmovableBox` is at the 3rd index. Thus, the corresponding `makeIsDataIndexed` usage should be: > > ```hs -> PlutusTx.makeIsDataIndexed ''FourWheeler [('FourWheeler,0),('TwoWheeler,1),('ImmovableBox,2)] +> PlutusTx.makeIsDataIndexed ''PVehicle [('FourWheeler,0),('TwoWheeler,1),('ImmovableBox,2)] > ``` > > Also see: [Isomorphism between Haskell ADTs and `PIsDataRepr`](./../Tricks/makeIsDataIndexed,%20Haskell%20ADTs,%20and%20PIsDataRepr.md) From 007643d5958f61cdef6093c3cd26e5ce817ca6c8 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 12 May 2022 15:54:40 +0530 Subject: [PATCH 453/584] Clarify `PLift` laws --- Plutarch/Lift.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 30ddad496..c7494f9fb 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -62,8 +62,8 @@ This typeclass is closely tied with 'PLift'. Laws: - @pconstantFromRepr . pconstantToRepr ≡ Just@ - @(pconstantToRepr <$>) . pconstantFromRepr ≡ Just@ - - @plift . pfromData . punsafeCoerce . pconstant . toData ≡ id@ - - @fromData . plift . pforgetData . ptoData . pconstant ≡ Just@ + - @plift . pfromData . punsafeCoerce . pconstant . PlutusTx.toData ≡ id@ + - @PlutusTx.fromData . plift . pforgetData . pdata . pconstant ≡ Just@ These laws must be upheld for the sake of soundness of the type system. -} From d62c38b36ca1dac960475b95ae6b8f59dc610c73 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 12 May 2022 15:55:05 +0530 Subject: [PATCH 454/584] Add `PIsData` constraint to `PConstantData` and `PLiftData` --- Plutarch/DataRepr/Internal.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 059d1113a..dd142f759 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -600,8 +600,9 @@ Polymorphic types can be derived as follows: type PConstantData :: Type -> Constraint type PConstantData h = ( PConstant h - , Ledger.FromData (h) - , Ledger.ToData (h) + , Ledger.FromData h + , Ledger.ToData h + , PIsData (PConstanted h) ) type PLiftData :: PType -> Constraint @@ -609,6 +610,7 @@ type PLiftData p = ( PLift p , Ledger.FromData (PLifted p) , Ledger.ToData (PLifted p) + , PIsData p ) {- | From 683c653c443dd1426eb50e96d60843cbf175f198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 12 May 2022 12:44:10 -0400 Subject: [PATCH 455/584] Shortened the *Guarantees names and moved KeyGuarantees into AssocMap --- Plutarch/Api/V1.hs | 4 ++-- Plutarch/Api/V1/AssocMap.hs | 3 +++ Plutarch/Api/V1/Contexts.hs | 4 ++-- Plutarch/Api/V1/Tx.hs | 4 ++-- Plutarch/Api/V1/Value.hs | 11 +++++------ plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 52a6f914c..1770bd6f8 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -31,8 +31,8 @@ module Plutarch.Api.V1 ( Value.PValue (PValue), Value.PCurrencySymbol (PCurrencySymbol), Value.PTokenName (PTokenName), - Value.ValueKeyGuarantees (Unsorted, Sorted), - Value.ValueAmountGuarantees (NoGuarantees, NonZero, Positive), + Value.KeyGuarantees (Unsorted, Sorted), + Value.AmountGuarantees (NoGuarantees, NonZero, Positive), -- ** Crypto Crypto.PPubKeyHash (PPubKeyHash), diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 6f3059bb6..604259cfe 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -3,6 +3,7 @@ module Plutarch.Api.V1.AssocMap ( PMap (PMap), + KeyGuarantees (Unsorted, Sorted), -- * Creation pempty, @@ -91,6 +92,8 @@ import qualified Rank2 import Prelude hiding (all, any, filter, lookup, null) +data KeyGuarantees = Sorted | Unsorted + newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) deriving (PlutusType, PIsData, PEq, PShow) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index 18c9a9f7d..aece5089e 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -23,10 +23,10 @@ import Plutarch.Api.V1.Time (PPOSIXTimeRange) import Plutarch.Api.V1.Tuple (PTuple) import Plutarch.Api.V1.Tx (PTxId, PTxInInfo, PTxOut, PTxOutRef) import Plutarch.Api.V1.Value ( + AmountGuarantees (NonZero, Positive), + KeyGuarantees (Sorted), PCurrencySymbol, PValue, - ValueAmountGuarantees (NonZero, Positive), - ValueKeyGuarantees (Sorted), ) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 33952bf82..7a7bdbbfa 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -17,9 +17,9 @@ import Plutarch.Api.V1.Address (PAddress) import Plutarch.Api.V1.Maybe (PMaybeData) import Plutarch.Api.V1.Scripts (PDatumHash) import Plutarch.Api.V1.Value ( + AmountGuarantees (Positive), + KeyGuarantees (Sorted), PValue, - ValueAmountGuarantees (Positive), - ValueKeyGuarantees (Sorted), ) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index cd0f644f2..8617057ea 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -6,8 +6,8 @@ module Plutarch.Api.V1.Value ( PValue (PValue), PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), - ValueKeyGuarantees (Unsorted, Sorted), - ValueAmountGuarantees (NoGuarantees, NonZero, Positive), + KeyGuarantees (Unsorted, Sorted), + AmountGuarantees (NoGuarantees, NonZero, Positive), passertSorted, passertPositive, pforgetPositive, @@ -23,7 +23,7 @@ module Plutarch.Api.V1.Value ( import qualified Plutus.V1.Ledger.Api as Plutus -import Plutarch.Api.V1.AssocMap (PMap) +import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted, Unsorted), PMap) import qualified Plutarch.Api.V1.AssocMap as AssocMap import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), @@ -54,10 +54,9 @@ deriving via instance PConstantDecl Plutus.CurrencySymbol -data ValueKeyGuarantees = Sorted | Unsorted -data ValueAmountGuarantees = NoGuarantees | NonZero | Positive +data AmountGuarantees = NoGuarantees | NonZero | Positive -newtype PValue (keys :: ValueKeyGuarantees) (amounts :: ValueAmountGuarantees) (s :: S) +newtype PValue (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S) = PValue (Term s (PMap PCurrencySymbol (PMap PTokenName PInteger))) deriving (PlutusType, PIsData) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 9e4f55b47..58c453377 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -23,6 +23,8 @@ import qualified Plutus.V1.Ledger.Interval as Interval import qualified Plutus.V1.Ledger.Value as Value import Plutarch.Api.V1 ( + AmountGuarantees (NonZero, Positive), + KeyGuarantees (Sorted), PCredential, PCurrencySymbol, PPubKeyHash, @@ -31,8 +33,6 @@ import Plutarch.Api.V1 ( PTxInInfo, PTxInfo, PValue, - ValueAmountGuarantees (NonZero, Positive), - ValueKeyGuarantees (Sorted), ) import qualified Plutarch.Api.V1.AssocMap as AssocMap import qualified Plutarch.Api.V1.Value as PValue From 874d3e7662b565d4e347a8a7426e8b6ea38e3577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 12 May 2022 13:58:53 -0400 Subject: [PATCH 456/584] Added a KeyGuarantees parameter to PMap --- Plutarch/Api/V1/AssocMap.hs | 80 ++++++++++--------- Plutarch/Api/V1/Value.hs | 21 +++-- .../plutarch-base/Plutarch/ApiSpec.hs | 18 ++--- 3 files changed, 65 insertions(+), 54 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 604259cfe..a0789e4e1 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -14,6 +14,7 @@ module Plutarch.Api.V1.AssocMap ( pdelete, pfromAscList, passertSorted, + pforgetSorted, -- * Lookups plookup, @@ -94,17 +95,18 @@ import Prelude hiding (all, any, filter, lookup, null) data KeyGuarantees = Sorted | Unsorted -newtype PMap (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) - deriving (PlutusType, PIsData, PEq, PShow) via (DerivePNewtype (PMap k v) (PBuiltinMap k v)) +newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) + deriving (PlutusType, PIsData, PEq, PShow) via (DerivePNewtype (PMap keysort k v) (PBuiltinMap k v)) +type role PMap nominal nominal representational phantom instance ( PLiftData k , PLiftData v , Ord (PLifted k) ) => - PUnsafeLiftDecl (PMap k v) + PUnsafeLiftDecl (PMap 'Unsorted k v) where - type PLifted (PMap k v) = PlutusMap.Map (PLifted k) (PLifted v) + type PLifted (PMap 'Unsorted k v) = PlutusMap.Map (PLifted k) (PLifted v) instance ( PConstantData k @@ -114,7 +116,7 @@ instance PConstantDecl (PlutusMap.Map k v) where type PConstantRepr (PlutusMap.Map k v) = [(Plutus.Data, Plutus.Data)] - type PConstanted (PlutusMap.Map k v) = PMap (PConstanted k) (PConstanted v) + type PConstanted (PlutusMap.Map k v) = PMap 'Unsorted (PConstanted k) (PConstanted v) pconstantToRepr m = (\(x, y) -> (Plutus.toData x, Plutus.toData y)) <$> PlutusMap.toList m pconstantFromRepr m = fmap PlutusMap.fromList $ flip traverse m $ \(x, y) -> do @@ -123,11 +125,11 @@ instance Just (x', y') -- | Tests whether the map is empty. -pnull :: Term s (PMap k v :--> PBool) +pnull :: Term s (PMap _ k v :--> PBool) pnull = plam (\map -> List.pnull # pto map) -- | Look up the given key in a 'PMap'. -plookup :: (PIsData k, PIsData v) => Term s (k :--> PMap k v :--> PMaybe v) +plookup :: (PIsData k, PIsData v) => Term s (k :--> PMap _ k v :--> PMaybe v) plookup = phoistAcyclic $ plam $ \key -> plookupDataWith @@ -135,7 +137,7 @@ plookup = phoistAcyclic $ # pdata key -- | Look up the given key data in a 'PMap'. -plookupData :: (PIsData k, PIsData v) => Term s (PAsData k :--> PMap k v :--> PMaybe (PAsData v)) +plookupData :: (PIsData k, PIsData v) => Term s (PAsData k :--> PMap _ k v :--> PMaybe (PAsData v)) plookupData = plookupDataWith # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) -- | Look up the given key data in a 'PMap', applying the given function to the found key-value pair. @@ -145,7 +147,7 @@ plookupDataWith :: s ( (PBuiltinPair (PAsData k) (PAsData v) :--> PMaybe x) :--> PAsData k - :--> PMap k v + :--> PMap _ k v :--> PMaybe x ) plookupDataWith = phoistAcyclic $ @@ -161,13 +163,13 @@ plookupDataWith = phoistAcyclic $ # pto map -- | Look up the given key in a 'PMap', returning the default value if the key is absent. -pfindWithDefault :: (PIsData k, PIsData v) => Term s (v :--> k :--> PMap k v :--> v) +pfindWithDefault :: (PIsData k, PIsData v) => Term s (v :--> k :--> PMap _ k v :--> v) pfindWithDefault = phoistAcyclic $ plam $ \def key -> foldAtData # pdata key # def # plam pfromData {- | Look up the given key in a 'PMap'; return the default if the key is absent or apply the argument function to the value data if present. -} -pfoldAt :: (PIsData k, PIsData v) => Term s (k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) +pfoldAt :: (PIsData k, PIsData v) => Term s (k :--> r :--> (PAsData v :--> r) :--> PMap _ k v :--> r) pfoldAt = phoistAcyclic $ plam $ \key -> foldAtData # pdata key @@ -176,7 +178,7 @@ pfoldAt = phoistAcyclic $ -} foldAtData :: (PIsData k, PIsData v) => - Term s (PAsData k :--> r :--> (PAsData v :--> r) :--> PMap k v :--> r) + Term s (PAsData k :--> r :--> (PAsData v :--> r) :--> PMap _ k v :--> r) foldAtData = phoistAcyclic $ plam $ \key def apply map -> precList @@ -190,7 +192,7 @@ foldAtData = phoistAcyclic $ # pto map -- | Insert a new key/value pair into the map, overiding the previous if any. -pinsert :: (POrd k, PIsData k, PIsData v) => Term s (k :--> v :--> PMap k v :--> PMap k v) +pinsert :: (POrd k, PIsData k, PIsData v) => Term s (k :--> v :--> PMap 'Sorted k v :--> PMap 'Sorted k v) pinsert = phoistAcyclic $ plam $ \key val -> rebuildAtKey # (plam (pcons # (ppairDataBuiltin # pdata key # pdata val) #)) # key @@ -198,13 +200,13 @@ pinsert = phoistAcyclic $ -- | Insert a new data-encoded key/value pair into the map, overiding the previous if any. pinsertData :: (POrd k, PIsData k, PIsData v) => - Term s (PAsData k :--> PAsData v :--> PMap k v :--> PMap k v) + Term s (PAsData k :--> PAsData v :--> PMap 'Sorted k v :--> PMap 'Sorted k v) pinsertData = phoistAcyclic $ plam $ \key val -> rebuildAtKey # (plam (pcons # (ppairDataBuiltin # key # val) #)) # pfromData key -- | Delete a key from the map. -pdelete :: (POrd k, PIsData k, PIsData v) => Term s (k :--> PMap k v :--> PMap k v) +pdelete :: (POrd k, PIsData k, PIsData v) => Term s (k :--> PMap 'Sorted k v :--> PMap 'Sorted k v) pdelete = rebuildAtKey # plam id -- | Rebuild the map at the given key. @@ -216,8 +218,8 @@ rebuildAtKey :: :--> PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)) ) :--> k - :--> PMap k v - :--> PMap k v + :--> PMap g k v + :--> PMap g k v ) rebuildAtKey = phoistAcyclic $ plam $ \handler key map -> @@ -240,24 +242,24 @@ rebuildAtKey = phoistAcyclic $ # plam id -- | Construct an empty 'PMap'. -pempty :: Term s (PMap k v) +pempty :: Term s (PMap 'Sorted k v) pempty = punsafeDowncast pnil -- | Construct a singleton 'PMap' with the given key and value. -psingleton :: (PIsData k, PIsData v) => Term s (k :--> v :--> PMap k v) +psingleton :: (PIsData k, PIsData v) => Term s (k :--> v :--> PMap 'Sorted k v) psingleton = phoistAcyclic $ plam $ \key value -> psingletonData # pdata key # pdata value -- | Construct a singleton 'PMap' with the given data-encoded key and value. -psingletonData :: (PIsData k, PIsData v) => Term s (PAsData k :--> PAsData v :--> PMap k v) +psingletonData :: (PIsData k, PIsData v) => Term s (PAsData k :--> PAsData v :--> PMap 'Sorted k v) psingletonData = phoistAcyclic $ plam $ \key value -> punsafeDowncast (pcons # (ppairDataBuiltin # key # value) # pnil) -- | Construct a 'PMap' from a list of key-value pairs, sorted by ascending key data. -pfromAscList :: (POrd k, PIsData k, PIsData v) => Term s (PBuiltinMap k v :--> PMap k v) +pfromAscList :: (POrd k, PIsData k, PIsData v) => Term s (PBuiltinMap k v :--> PMap 'Sorted k v) pfromAscList = plam $ (passertSorted #) . pcon . PMap --- | Assert the map is properly sorted -passertSorted :: (POrd k, PIsData k, PIsData v) => Term s (PMap k v :--> PMap k v) +-- | Assert the map is properly sorted. +passertSorted :: (POrd k, PIsData k, PIsData v) => Term s (PMap _ k v :--> PMap 'Sorted k v) passertSorted = phoistAcyclic $ plam $ \map -> precList @@ -273,6 +275,10 @@ passertSorted = phoistAcyclic $ # pto map # plam (const $ pcon PFalse) +-- | Forget the knowledge that keys were sorted. +pforgetSorted :: Term s (PMap 'Sorted k v) -> Term s (PMap g k v) +pforgetSorted v = punsafeDowncast (pto v) + data MapUnion k v f = MapUnion { merge :: f (PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) , mergeInsert :: f (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) @@ -305,10 +311,10 @@ instance Rank2.Distributive (MapUnion k v) where } instance Rank2.DistributiveTraversable (MapUnion k v) -instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap k v)) where +instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap 'Sorted k v)) where a <> b = punionWith # plam (<>) # a # b -instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Monoid (Term s (PMap k v)) where +instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Monoid (Term s (PMap 'Sorted k v)) where mempty = pempty {- | Combine two 'PMap's applying the given function to any two values that @@ -316,7 +322,7 @@ instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Monoid (Term s -} punionWith :: (POrd k, PIsData k, PIsData v) => - Term s ((v :--> v :--> v) :--> PMap k v :--> PMap k v :--> PMap k v) + Term s ((v :--> v :--> v) :--> PMap 'Sorted k v :--> PMap 'Sorted k v :--> PMap 'Sorted k v) punionWith = phoistAcyclic $ plam $ \combine -> punionWithData #$ plam $ @@ -330,9 +336,9 @@ punionWithData :: Term s ( (PAsData v :--> PAsData v :--> PAsData v) - :--> PMap k v - :--> PMap k v - :--> PMap k v + :--> PMap 'Sorted k v + :--> PMap 'Sorted k v + :--> PMap 'Sorted k v ) punionWithData = phoistAcyclic $ plam $ \combine x y -> @@ -377,8 +383,8 @@ mapUnion = plam $ \combine -> -- | Difference of two maps. Return elements of the first map not existing in the second map. pdifference :: - (POrd k, PIsData k, PIsData a, PIsData b) => - Term s (PMap k a :--> PMap k b :--> PMap k a) + (PIsData k, PIsData a, PIsData b) => + Term s (PMap g k a :--> PMap _ k b :--> PMap g k a) pdifference = phoistAcyclic $ plam $ \left right -> pcon . PMap $ @@ -395,19 +401,19 @@ pdifference = phoistAcyclic $ # pto left -- | Tests if all values in the map satisfy the given predicate. -pall :: PIsData v => Term s ((v :--> PBool) :--> PMap k v :--> PBool) +pall :: PIsData v => Term s ((v :--> PBool) :--> PMap _ k v :--> PBool) pall = phoistAcyclic $ plam $ \pred map -> List.pall # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map -- | Tests if anu value in the map satisfies the given predicate. -pany :: PIsData v => Term s ((v :--> PBool) :--> PMap k v :--> PBool) +pany :: PIsData v => Term s ((v :--> PBool) :--> PMap _ k v :--> PBool) pany = phoistAcyclic $ plam $ \pred map -> List.pany # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map -- | Filters the map so it contains only the values that satisfy the given predicate. -pfilter :: (PIsData k, PIsData a) => Term s ((a :--> PBool) :--> PMap k a :--> PMap k a) +pfilter :: (PIsData k, PIsData a) => Term s ((a :--> PBool) :--> PMap g k a :--> PMap g k a) pfilter = phoistAcyclic $ plam $ \pred -> pmapMaybe #$ plam $ \v -> pif (pred # v) (pcon $ PJust v) (pcon PNothing) @@ -415,16 +421,16 @@ pfilter = phoistAcyclic $ -- | Maps and filters the map, much like 'Data.List.mapMaybe'. pmapMaybe :: (PIsData k, PIsData a, PIsData b) => - Term s ((a :--> PMaybe b) :--> PMap k a :--> PMap k b) + Term s ((a :--> PMaybe b) :--> PMap g k a :--> PMap g k b) pmapMaybe = phoistAcyclic $ plam $ \f -> pmapMaybeData #$ plam $ \v -> pmatch (f # pfromData v) $ \case PNothing -> pcon PNothing PJust v' -> pcon $ PJust (pdata v') pmapMaybeData :: - forall s k a b. + forall s g k a b. (PIsData k, PIsData a, PIsData b) => - Term s ((PAsData a :--> PMaybe (PAsData b)) :--> PMap k a :--> PMap k b) + Term s ((PAsData a :--> PMaybe (PAsData b)) :--> PMap g k a :--> PMap g k b) pmapMaybeData = phoistAcyclic $ plam $ \f map -> pcon . PMap $ diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 8617057ea..0a49c3ec8 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -11,6 +11,7 @@ module Plutarch.Api.V1.Value ( passertSorted, passertPositive, pforgetPositive, + pforgetSorted, pnormalize, psingleton, psingletonData, @@ -32,7 +33,7 @@ import Plutarch.Lift ( PLifted, PUnsafeLiftDecl, ) -import Plutarch.Unsafe (punsafeDowncast) +import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import Plutarch.Prelude hiding (psingleton) @@ -57,19 +58,19 @@ deriving via data AmountGuarantees = NoGuarantees | NonZero | Positive newtype PValue (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S) - = PValue (Term s (PMap PCurrencySymbol (PMap PTokenName PInteger))) + = PValue (Term s (PMap keys PCurrencySymbol (PMap keys PTokenName PInteger))) deriving (PlutusType, PIsData) - via (DerivePNewtype (PValue keys amounts) (PMap PCurrencySymbol (PMap PTokenName PInteger))) + via (DerivePNewtype (PValue keys amounts) (PMap keys PCurrencySymbol (PMap keys PTokenName PInteger))) type role PValue nominal nominal phantom -instance PUnsafeLiftDecl (PValue 'Sorted 'NonZero) where - type PLifted (PValue 'Sorted 'NonZero) = Plutus.Value +instance PUnsafeLiftDecl (PValue 'Unsorted 'NonZero) where + type PLifted (PValue 'Unsorted 'NonZero) = Plutus.Value deriving via ( DerivePConstantViaNewtype Plutus.Value - (PValue 'Sorted 'NonZero) - (PMap PCurrencySymbol (PMap PTokenName PInteger)) + (PValue 'Unsorted 'NonZero) + (PMap 'Unsorted PCurrencySymbol (PMap 'Unsorted PTokenName PInteger)) ) instance PConstantDecl Plutus.Value @@ -246,7 +247,11 @@ passertPositive = phoistAcyclic $ -- | Forget the knowledge of value's positivity. pforgetPositive :: Term s (PValue 'Sorted 'Positive) -> Term s (PValue k a) -pforgetPositive v = punsafeDowncast (pto v) +pforgetPositive = punsafeCoerce + +-- | Forget the knowledge of all value's guarantees. +pforgetSorted :: Term s (PValue 'Sorted a) -> Term s (PValue k b) +pforgetSorted = punsafeCoerce zeroData :: ClosedTerm (PAsData PInteger) zeroData = pdata 0 diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 58c453377..a3bbcbd74 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -84,7 +84,7 @@ spec = do plift (PValue.pforgetPositive p) @?= mint "singletonData" @| PValue.psingletonData # pdata (pconstant "c0") # pdata (pconstant "sometoken") # pdata 1 - @-> \p -> plift p @?= mint + @-> \p -> plift (PValue.pforgetSorted p) @?= mint "valueOf" @\ do "itself" @| PValue.pvalueOf @-> \v -> plift (v # pmint # pconstant "c0" # pconstant "sometoken") @?= 1 "applied" @| PValue.pvalueOf # pmint # pconstant "c0" # pconstant "sometoken" @-> \p -> @@ -99,16 +99,16 @@ spec = do ) "unionWith" @\ do "const" @| PValue.punionWith # plam const # pmint # pmint @-> \p -> - plift (PValue.pnormalize # p) @?= mint + plift (PValue.pforgetSorted $ PValue.pnormalize # p) @?= mint "(+)" @\ do "itself" @| PValue.punionWith # plam (+) @-> \plus -> - plift (PValue.pnormalize #$ plus # pmint # pmint) @?= mint <> mint + plift (PValue.pforgetSorted $ PValue.pnormalize #$ plus # pmint # pmint) @?= mint <> mint "applied" @| PValue.punionWith # plam (+) # pmint # pmint @-> \p -> - plift (PValue.pnormalize # p) @?= mint <> mint + plift (PValue.pforgetSorted $ PValue.pnormalize # p) @?= mint <> mint "tokens" @| PValue.punionWith # plam (+) # pmint # pmintOtherToken @-> \p -> - plift (PValue.pnormalize # p) @?= mint <> mintOtherToken + plift (PValue.pforgetSorted $ PValue.pnormalize # p) @?= mint <> mintOtherToken "symbols" @| PValue.punionWith # plam (+) # pmint # pmintOtherSymbol @-> \p -> - plift (PValue.pnormalize # p) @?= mint <> mintOtherSymbol + plift (PValue.pforgetSorted $ PValue.pnormalize # p) @?= mint <> mintOtherSymbol "growing" @\ forM_ (zip [1 :: Int .. length growingSymbols] growingSymbols) @@ -118,9 +118,9 @@ spec = do ) "unionWithData const" @\ do "itself" @| PValue.punionWithData @-> \u -> - plift (PValue.pnormalize #$ u # plam const # pmint # pmint) @?= mint + plift (PValue.pforgetSorted $ PValue.pnormalize #$ u # plam const # pmint # pmint) @?= mint "applied" @| PValue.punionWithData # plam const # pmint # pmint @-> \p -> - plift (PValue.pnormalize # p) @?= mint + plift (PValue.pforgetSorted $ PValue.pnormalize # p) @?= mint "equality" @\ do "itself" @| plam ((#==) @(PValue 'Sorted 'Positive)) @-> \eq -> passert (eq # pmint # pmint) "triviallyTrue" @| pmint #== pmint @-> passert @@ -167,7 +167,7 @@ spec = do @-> pfails describe "map" $ do pgoldenSpec $ do - let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap PByteString PInteger) + let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap 'Sorted PByteString PInteger) pmap = AssocMap.psingleton # pconstant "key" # 42 pdmap = AssocMap.psingletonData # pdata (pconstant "key") # pdata 42 emptyMap = AssocMap.pempty From fffe8640724f95a0fde25762cb6c64ae57acfef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Thu, 12 May 2022 15:03:41 -0400 Subject: [PATCH 457/584] Added pmap and PlutusTx.Group instances --- Plutarch/Api/V1/AssocMap.hs | 55 ++++++++++++++++++- Plutarch/Api/V1/Value.hs | 34 ++++++++++++ .../goldens/api.value.dev=false.bench.golden | 1 + .../api.value.dev=false.uplc.eval.golden | 1 + .../goldens/api.value.dev=false.uplc.golden | 1 + .../goldens/api.value.dev=true.bench.golden | 1 + .../api.value.dev=true.uplc.eval.golden | 1 + .../goldens/api.value.dev=true.uplc.golden | 1 + .../plutarch-base/Plutarch/ApiSpec.hs | 12 ++-- 9 files changed, 97 insertions(+), 10 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index a0789e4e1..c991f8097 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -29,6 +29,8 @@ module Plutarch.Api.V1.AssocMap ( -- * Filters and traversals pfilter, + pmap, + pmapData, pmapMaybe, pmapMaybeData, @@ -40,6 +42,8 @@ module Plutarch.Api.V1.AssocMap ( import qualified Plutus.V1.Ledger.Api as Plutus import qualified PlutusTx.AssocMap as PlutusMap +import qualified PlutusTx.Monoid as PlutusTx +import qualified PlutusTx.Semigroup as PlutusTx import Plutarch.Builtin (PBuiltinList (PCons, PNil), PBuiltinMap, ppairDataBuiltin) import Plutarch.Lift ( @@ -311,12 +315,36 @@ instance Rank2.Distributive (MapUnion k v) where } instance Rank2.DistributiveTraversable (MapUnion k v) -instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap 'Sorted k v)) where +instance + (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => + Semigroup (Term s (PMap 'Sorted k v)) + where a <> b = punionWith # plam (<>) # a # b -instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Monoid (Term s (PMap 'Sorted k v)) where +instance + (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => + Monoid (Term s (PMap 'Sorted k v)) + where mempty = pempty +instance + (POrd k, PIsData k, PIsData v, PlutusTx.Semigroup (Term s v)) => + PlutusTx.Semigroup (Term s (PMap 'Sorted k v)) + where + a <> b = punionWith # plam (PlutusTx.<>) # a # b + +instance + (POrd k, PIsData k, PIsData v, PlutusTx.Semigroup (Term s v)) => + PlutusTx.Monoid (Term s (PMap 'Sorted k v)) + where + mempty = pempty + +instance + (POrd k, PIsData k, PIsData v, PlutusTx.Group (Term s v)) => + PlutusTx.Group (Term s (PMap 'Sorted k v)) + where + inv a = pmap # plam PlutusTx.inv # a + {- | Combine two 'PMap's applying the given function to any two values that share the same key. -} @@ -443,3 +471,26 @@ pmapMaybeData = phoistAcyclic $ ) (const pnil) # pto map + +-- | Applies a function to every value in the map, much like 'Data.List.map'. +pmap :: + (PIsData k, PIsData a, PIsData b) => + Term s ((a :--> b) :--> PMap g k a :--> PMap g k b) +pmap = phoistAcyclic $ + plam $ \f -> pmapData #$ plam $ \v -> pdata (f # pfromData v) + +pmapData :: + forall s g k a b. + (PIsData k, PIsData a, PIsData b) => + Term s ((PAsData a :--> PAsData b) :--> PMap g k a :--> PMap g k b) +pmapData = phoistAcyclic $ + plam $ \f map -> + pcon . PMap $ + precList + ( \self x xs -> + pcons + # (ppairDataBuiltin # (pfstBuiltin # x) # (f #$ psndBuiltin # x)) + # (self # xs) + ) + (const pnil) + # pto map diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 0a49c3ec8..c2481c28a 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -34,6 +34,8 @@ import Plutarch.Lift ( PUnsafeLiftDecl, ) import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) +import qualified PlutusTx.Monoid as PlutusTx +import qualified PlutusTx.Semigroup as PlutusTx import Plutarch.Prelude hiding (psingleton) @@ -87,18 +89,45 @@ instance PEq (PValue 'Sorted 'NoGuarantees) where instance Semigroup (Term s (PValue 'Sorted 'Positive)) where a <> b = punsafeDowncast (pto $ punionWith # plam (+) # a # b) +instance PlutusTx.Semigroup (Term s (PValue 'Sorted 'Positive)) where + a <> b = punsafeDowncast (pto $ punionWith # plam (+) # a # b) + instance Semigroup (Term s (PValue 'Sorted 'NonZero)) where a <> b = pnormalize #$ punionWith # plam (+) # a # b +instance PlutusTx.Semigroup (Term s (PValue 'Sorted 'NonZero)) where + a <> b = pnormalize #$ punionWith # plam (+) # a # b + instance Semigroup (Term s (PValue 'Sorted 'NoGuarantees)) where a <> b = punionWith # plam (+) # a # b +instance PlutusTx.Semigroup (Term s (PValue 'Sorted 'NoGuarantees)) where + a <> b = punionWith # plam (+) # a # b + instance Semigroup (Term s (PValue 'Sorted normalization)) => Monoid (Term s (PValue 'Sorted normalization)) where mempty = pcon (PValue AssocMap.pempty) +instance + PlutusTx.Semigroup (Term s (PValue 'Sorted normalization)) => + PlutusTx.Monoid (Term s (PValue 'Sorted normalization)) + where + mempty = pcon (PValue AssocMap.pempty) + +instance + PlutusTx.Semigroup (Term s (PValue 'Sorted 'NoGuarantees)) => + PlutusTx.Group (Term s (PValue 'Sorted 'NoGuarantees)) + where + inv a = pmapAmounts # plam negate # a + +instance + PlutusTx.Semigroup (Term s (PValue 'Sorted 'NonZero)) => + PlutusTx.Group (Term s (PValue 'Sorted 'NonZero)) + where + inv a = punsafeCoerce $ PlutusTx.inv (punsafeCoerce a :: Term s (PValue 'Sorted 'NoGuarantees)) + -- | Construct a constant singleton 'PValue' containing only the given quantity of the given currency. pconstantSingleton :: ClosedTerm PCurrencySymbol -> @@ -255,3 +284,8 @@ pforgetSorted = punsafeCoerce zeroData :: ClosedTerm (PAsData PInteger) zeroData = pdata 0 + +-- | Applies a function to every amount in the map. +pmapAmounts :: Term s ((PInteger :--> PInteger) :--> PValue k a :--> PValue k 'NoGuarantees) +pmapAmounts = phoistAcyclic $ + plam $ \f v -> pcon $ PValue $ AssocMap.pmap # plam (AssocMap.pmap # f #) # pto v diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index e834fe12e..a49c8a5c4 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -43,6 +43,7 @@ unionWith.growing.16 {"exBudgetCPU":576735438,"exBudgetMemory":1272680,"scriptSi unionWith.growing.17 {"exBudgetCPU":643044465,"exBudgetMemory":1417396,"scriptSizeBytes":629} unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":222} unionWithData const.applied {"exBudgetCPU":21957283,"exBudgetMemory":51244,"scriptSizeBytes":307} +inv {"exBudgetCPU":12110786,"exBudgetMemory":25962,"scriptSizeBytes":175} equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden index 423e0f59b..18250471f 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden @@ -172,6 +172,7 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cf, #a145746f6b656e01) ]) unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +inv (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e20)]) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden index 3bbe13345..bc5bcf7a3 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.golden @@ -43,6 +43,7 @@ unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +inv (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> mapData (i2 (unMapData i1)))) (\i0 -> i4 (\i0 -> iData (i4 (unIData i1))) i1) i1) (\i0 -> subtractInteger 0 i1) ((\i0 -> \i0 -> i10 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i10 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay (i12 (mkPairData (i7 (i9 i1)) (i4 (i8 (i9 i1)))) (i2 (i10 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index c9870e379..c9bced9c4 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -43,6 +43,7 @@ unionWith.growing.16 {"exBudgetCPU":576735438,"exBudgetMemory":1272680,"scriptSi unionWith.growing.17 {"exBudgetCPU":643044465,"exBudgetMemory":1417396,"scriptSizeBytes":629} unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":222} unionWithData const.applied {"exBudgetCPU":21957283,"exBudgetMemory":51244,"scriptSizeBytes":307} +inv {"exBudgetCPU":12110786,"exBudgetMemory":25962,"scriptSizeBytes":175} equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index 423e0f59b..18250471f 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -172,6 +172,7 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cf, #a145746f6b656e01) ]) unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +inv (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e20)]) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index 286627cd6..678839d1a 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -43,6 +43,7 @@ unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +inv (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> mapData (i2 (unMapData i1)))) (\i0 -> i4 (\i0 -> iData (i4 (unIData i1))) i1) i1) (\i0 -> subtractInteger 0 i1) ((\i0 -> \i0 -> i10 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i10 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay (i12 (mkPairData (i7 (i9 i1)) (i4 (i8 (i9 i1)))) (i2 (i10 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index a3bbcbd74..8e2243809 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -21,6 +21,7 @@ import Numeric (showHex) import Plutus.V1.Ledger.Api import qualified Plutus.V1.Ledger.Interval as Interval import qualified Plutus.V1.Ledger.Value as Value +import PlutusTx.Monoid (inv) import Plutarch.Api.V1 ( AmountGuarantees (NonZero, Positive), @@ -121,6 +122,9 @@ spec = do plift (PValue.pforgetSorted $ PValue.pnormalize #$ u # plam const # pmint # pmint) @?= mint "applied" @| PValue.punionWithData # plam const # pmint # pmint @-> \p -> plift (PValue.pforgetSorted $ PValue.pnormalize # p) @?= mint + "inv" + @| inv (PValue.pforgetPositive pmint :: Term _ (PValue 'Sorted 'NonZero)) + @-> \p -> plift (PValue.pforgetSorted p) @?= inv mint "equality" @\ do "itself" @| plam ((#==) @(PValue 'Sorted 'Positive)) @-> \eq -> passert (eq # pmint # pmint) "triviallyTrue" @| pmint #== pmint @-> passert @@ -227,14 +231,6 @@ spec = do "const" @| AssocMap.punionWithData # plam const # pmap # pmap @-> pshouldReallyBe pmap "emptyLeft" @| AssocMap.punionWithData # plam const # emptyMap # pmap @-> pshouldReallyBe pmap "emptyRight" @| AssocMap.punionWithData # plam const # pmap # emptyMap @-> pshouldReallyBe pmap - {- TODO: fails due to incomplete normalization - "mapEitherWithKey" @\ do - "const" @| AssocMap.pmapEitherWithKey # plam (const $ pcon . PRight) # pmap - @-> pshouldReallyBe (pcon $ PPair emptyMap pmap) - "mapEitherWithKey" @\ do - "const" @| AssocMap.pmapEitherWithKey # plam (const $ pcon . PRight) # pmap - @-> \result-> passert $ result #== pcon (PPair emptyMap pmap) - -} describe "example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. From 04f90d5d3d6edc67ea57a1eb73b1a94e65d58a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 13 May 2022 14:54:53 -0400 Subject: [PATCH 458/584] Fixed the type roles --- Plutarch/Api/V1/AssocMap.hs | 2 +- Plutarch/Api/V1/Value.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index c991f8097..acff01800 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -101,7 +101,7 @@ data KeyGuarantees = Sorted | Unsorted newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) deriving (PlutusType, PIsData, PEq, PShow) via (DerivePNewtype (PMap keysort k v) (PBuiltinMap k v)) -type role PMap nominal nominal representational phantom +type role PMap nominal nominal nominal nominal instance ( PLiftData k diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index c2481c28a..3b4fa54b8 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -64,7 +64,7 @@ newtype PValue (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S) deriving (PlutusType, PIsData) via (DerivePNewtype (PValue keys amounts) (PMap keys PCurrencySymbol (PMap keys PTokenName PInteger))) -type role PValue nominal nominal phantom +type role PValue nominal nominal nominal instance PUnsafeLiftDecl (PValue 'Unsorted 'NonZero) where type PLifted (PValue 'Unsorted 'NonZero) = Plutus.Value From 1594234d4aba186cfbe950abd1d5ce6bd50742cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 13 May 2022 16:53:44 -0400 Subject: [PATCH 459/584] Added -Wredundant-constraints and acted on the warnings --- Plutarch/Api/V1/AssocMap.hs | 20 ++++++++------------ plutarch.cabal | 4 ++-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index acff01800..5dd30f338 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -203,14 +203,14 @@ pinsert = phoistAcyclic $ -- | Insert a new data-encoded key/value pair into the map, overiding the previous if any. pinsertData :: - (POrd k, PIsData k, PIsData v) => + (POrd k, PIsData k) => Term s (PAsData k :--> PAsData v :--> PMap 'Sorted k v :--> PMap 'Sorted k v) pinsertData = phoistAcyclic $ plam $ \key val -> rebuildAtKey # (plam (pcons # (ppairDataBuiltin # key # val) #)) # pfromData key -- | Delete a key from the map. -pdelete :: (POrd k, PIsData k, PIsData v) => Term s (k :--> PMap 'Sorted k v :--> PMap 'Sorted k v) +pdelete :: (POrd k, PIsData k) => Term s (k :--> PMap 'Sorted k v :--> PMap 'Sorted k v) pdelete = rebuildAtKey # plam id -- | Rebuild the map at the given key. @@ -254,7 +254,7 @@ psingleton :: (PIsData k, PIsData v) => Term s (k :--> v :--> PMap 'Sorted k v) psingleton = phoistAcyclic $ plam $ \key value -> psingletonData # pdata key # pdata value -- | Construct a singleton 'PMap' with the given data-encoded key and value. -psingletonData :: (PIsData k, PIsData v) => Term s (PAsData k :--> PAsData v :--> PMap 'Sorted k v) +psingletonData :: Term s (PAsData k :--> PAsData v :--> PMap 'Sorted k v) psingletonData = phoistAcyclic $ plam $ \key value -> punsafeDowncast (pcons # (ppairDataBuiltin # key # value) # pnil) @@ -360,7 +360,7 @@ punionWith = phoistAcyclic $ values that share the same key. -} punionWithData :: - (POrd k, PIsData k, PIsData v) => + (POrd k, PIsData k) => Term s ( (PAsData v :--> PAsData v :--> PAsData v) @@ -373,7 +373,7 @@ punionWithData = phoistAcyclic $ pcon $ PMap $ mapUnion # combine # field merge # pto x # pto y mapUnion :: - (POrd k, PIsData k, PIsData v) => + (POrd k, PIsData k) => Term s ((PAsData v :--> PAsData v :--> PAsData v) :--> ScottEncoding (MapUnion k v) (a :: PType)) mapUnion = plam $ \combine -> letrec $ \MapUnion {merge, mergeInsert} -> @@ -441,14 +441,14 @@ pany = phoistAcyclic $ List.pany # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map -- | Filters the map so it contains only the values that satisfy the given predicate. -pfilter :: (PIsData k, PIsData a) => Term s ((a :--> PBool) :--> PMap g k a :--> PMap g k a) +pfilter :: PIsData v => Term s ((v :--> PBool) :--> PMap g k v :--> PMap g k v) pfilter = phoistAcyclic $ plam $ \pred -> pmapMaybe #$ plam $ \v -> pif (pred # v) (pcon $ PJust v) (pcon PNothing) -- | Maps and filters the map, much like 'Data.List.mapMaybe'. pmapMaybe :: - (PIsData k, PIsData a, PIsData b) => + (PIsData a, PIsData b) => Term s ((a :--> PMaybe b) :--> PMap g k a :--> PMap g k b) pmapMaybe = phoistAcyclic $ plam $ \f -> pmapMaybeData #$ plam $ \v -> pmatch (f # pfromData v) $ \case @@ -456,8 +456,6 @@ pmapMaybe = phoistAcyclic $ PJust v' -> pcon $ PJust (pdata v') pmapMaybeData :: - forall s g k a b. - (PIsData k, PIsData a, PIsData b) => Term s ((PAsData a :--> PMaybe (PAsData b)) :--> PMap g k a :--> PMap g k b) pmapMaybeData = phoistAcyclic $ plam $ \f map -> @@ -474,14 +472,12 @@ pmapMaybeData = phoistAcyclic $ -- | Applies a function to every value in the map, much like 'Data.List.map'. pmap :: - (PIsData k, PIsData a, PIsData b) => + (PIsData a, PIsData b) => Term s ((a :--> b) :--> PMap g k a :--> PMap g k b) pmap = phoistAcyclic $ plam $ \f -> pmapData #$ plam $ \v -> pdata (f # pfromData v) pmapData :: - forall s g k a b. - (PIsData k, PIsData a, PIsData b) => Term s ((PAsData a :--> PAsData b) :--> PMap g k a :--> PMap g k b) pmapData = phoistAcyclic $ plam $ \f map -> diff --git a/plutarch.cabal b/plutarch.cabal index 765e5081f..e9a06b69f 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -75,8 +75,8 @@ common c -Wall -Wcompat -Wincomplete-uni-patterns -Wno-unused-do-bind -Wno-partial-type-signatures -Wmissing-export-lists -Werror -Wincomplete-record-updates -Wmissing-deriving-strategies - -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls - -fprint-explicit-kinds + -Wno-name-shadowing -Wredundant-constraints -Wunused-foralls + -fprint-explicit-foralls -fprint-explicit-kinds library import: c From 9f6326d068db31b875767b5db69901b8533f2671 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sun, 17 Apr 2022 10:29:21 +0000 Subject: [PATCH 460/584] Update dependencies - Use GHC 9.2.2 - Update a lot of dependencies --- flake.lock | 422 +++++++++++++++++++++++++++++++---------------------- flake.nix | 130 ++++++----------- 2 files changed, 290 insertions(+), 262 deletions(-) diff --git a/flake.lock b/flake.lock index 91597990c..183d5aefc 100644 --- a/flake.lock +++ b/flake.lock @@ -19,11 +19,11 @@ "Shrinker": { "flake": false, "locked": { - "lastModified": 1642430208, - "narHash": "sha256-tfWyB7zCLzncwRpyl7eUOzuOBbg9KLu6sxSxRaFlOug=", + "lastModified": 1645834494, + "narHash": "sha256-q1GQipRjHJDuspJOD/cwCUKryW8lSFLe1Qf/IBkSeaM=", "owner": "Plutonomicon", "repo": "Shrinker", - "rev": "0e60707996b876c7bd23a348f54545217ce2e556", + "rev": "f23017cb938c83e979a89e9ec941252122fddddb", "type": "github" }, "original": { @@ -86,11 +86,11 @@ "cardano-base": { "flake": false, "locked": { - "lastModified": 1638456794, - "narHash": "sha256-0KAO6dWqupJzRyjWjAFLZrt0hA6pozeKsDv1Fnysib8=", + "lastModified": 1649207882, + "narHash": "sha256-JRhz+eSmrW+9yFtou+PDZYOKGO7au+OuL4c/0zINqeA=", "owner": "input-output-hk", "repo": "cardano-base", - "rev": "4fae3f0149fd8925be94707d3ae0e36c0d67bd58", + "rev": "bf03ef2f2fdd2df3a7ca86cf5ae2171b3c1d1377", "type": "github" }, "original": { @@ -165,23 +165,6 @@ "type": "github" } }, - "cryptonite": { - "flake": false, - "locked": { - "lastModified": 1639749289, - "narHash": "sha256-/KS2S0f9r4c/q+IUGwkFOY9jbZkyK3dl0xMpDbULeqc=", - "owner": "haskell-crypto", - "repo": "cryptonite", - "rev": "cec291d988f0f17828384f3358214ab9bf724a13", - "type": "github" - }, - "original": { - "owner": "haskell-crypto", - "repo": "cryptonite", - "rev": "cec291d988f0f17828384f3358214ab9bf724a13", - "type": "github" - } - }, "ema": { "inputs": { "flake-compat": "flake-compat", @@ -190,11 +173,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1650932571, - "narHash": "sha256-rdpfJ+10a1uBPtHMNoAcpDE183RzpILRpsMgxj/YJek=", + "lastModified": 1649899800, + "narHash": "sha256-MmmG1Gn+RohDnZzzHEKQxks9Q5Jz6rSziEdCm6l5tGo=", "owner": "srid", "repo": "ema", - "rev": "05c8a2127391ee4b593fa6541bc9078eb44ad10f", + "rev": "d53dad29fbacad97916057382528bc49b542e4bb", "type": "github" }, "original": { @@ -219,6 +202,7 @@ ], "heist": "heist", "ixset-typed": "ixset-typed", + "lint-utils": "lint-utils_2", "nixpkgs": [ "emanote", "ema", @@ -230,11 +214,11 @@ "unionmount": "unionmount" }, "locked": { - "lastModified": 1651699367, - "narHash": "sha256-f+whlGwxzv5Lcem+rxBgIgnkU+KcckogtWbRwZ6nM4I=", + "lastModified": 1649967299, + "narHash": "sha256-ln7XeTiaKD1sF2taP7k9Xgif87Uglu/hDkPOZepm56M=", "owner": "srid", "repo": "emanote", - "rev": "2b6558fde2999ec22f645cb95322995b780f09f1", + "rev": "ffb17f377db3553f09a23ae71a22561b1e9d3ea0", "type": "github" }, "original": { @@ -339,6 +323,21 @@ } }, "flake-utils_3": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { "locked": { "lastModified": 1642700792, "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", @@ -353,7 +352,7 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_5": { "locked": { "lastModified": 1642700792, "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", @@ -368,7 +367,7 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_6": { "locked": { "lastModified": 1631561581, "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", @@ -383,7 +382,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_7": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -415,23 +414,6 @@ "type": "github" } }, - "foundation": { - "flake": false, - "locked": { - "lastModified": 1635711016, - "narHash": "sha256-5TRuljpwt50DLjyFjiFj6quFncu8RT0d8/0jlzsenuc=", - "owner": "haskell-foundation", - "repo": "foundation", - "rev": "0bb195e1fea06d144dafc5af9a0ff79af0a5f4a0", - "type": "github" - }, - "original": { - "owner": "haskell-foundation", - "repo": "foundation", - "rev": "0bb195e1fea06d144dafc5af9a0ff79af0a5f4a0", - "type": "github" - } - }, "ghc-8.6.5-iohk": { "flake": false, "locked": { @@ -468,11 +450,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1644887696, - "narHash": "sha256-o4gltv4npUl7+1gEQIcrRqZniwqC9kK8QsPaftlrawc=", + "lastModified": 1650157984, + "narHash": "sha256-hitutrIIn+qINGi6oef53f87we+cp3QNmXSBiCzVU90=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "6ff64aa49b88e75dd6e0bbd2823c2a92c9174fa5", + "rev": "2290fdc4d135407896f41ba518a0eae8efaae9c5", "type": "github" }, "original": { @@ -500,11 +482,11 @@ "haskell-language-server": { "flake": false, "locked": { - "lastModified": 1645014262, - "narHash": "sha256-f49So1teiroV+S7sbGTK4AhzUOXpoiQ26/fTjdIKkqc=", + "lastModified": 1650179337, + "narHash": "sha256-OU8i3ewwRvewd2pj3DowHV6kh6lUJzNwf2atg16Vy30=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "96ea854debd92f9a54e2270b9b9a080c0ce6f3d1", + "rev": "41f917e959160885016568030ce45d0339649a09", "type": "github" }, "original": { @@ -537,10 +519,11 @@ "cabal-34": "cabal-34", "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_7", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", "hpc-coveralls": "hpc-coveralls", + "hydra": "hydra", "nix-tools": "nix-tools", "nixpkgs": [ "haskell-nix", @@ -554,16 +537,15 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1644944726, - "narHash": "sha256-jJWdP/3Ne1y1akC3m9rSO5ItRoBc4UTdVQZBCuPmmrM=", - "owner": "L-as", + "lastModified": 1650194184, + "narHash": "sha256-wwRdO075Gh+NbyTH4Gce/hxn7hKJjbNs4/YrKpOguAA=", + "owner": "mlabs-haskell", "repo": "haskell.nix", - "rev": "45c583b5580c130487eb5a342679f0bdbc2b23fc", + "rev": "cf1f0460b65efadac6dc96169ef1e497410fa4f4", "type": "github" }, "original": { - "owner": "L-as", - "ref": "master", + "owner": "mlabs-haskell", "repo": "haskell.nix", "type": "github" } @@ -571,11 +553,11 @@ "haskell-nix_2": { "flake": false, "locked": { - "lastModified": 1629380841, - "narHash": "sha256-gWOWCfX7IgVSvMMYN6rBGK6EA0pk6pmYguXzMvGte+Q=", + "lastModified": 1646278384, + "narHash": "sha256-Gv1Ws3vAojjvjATcsvwAOTuOhzpxwt6tBci7EBaXxU4=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "7215f083b37741446aa325b20c8ba9f9f76015eb", + "rev": "7e06e14ae1b894445254fe41288bfa7dd4ccbc6f", "type": "github" }, "original": { @@ -603,14 +585,14 @@ }, "hercules-ci-effects": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1647711660, - "narHash": "sha256-ZoV/oAH8g4NYeTzC7OCZnlM7l0hNBs0nUHf4l1+lmDc=", + "lastModified": 1649324058, + "narHash": "sha256-6U/SIhp/8Ht402Ip7pu7qQ7azquwYVCVbZfcv5M+4so=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "d17e41cfb454d07f5d8d3b667bf45b079d868541", + "rev": "14dcd541e4d5315deb3f6941cd5b293945c14584", "type": "github" }, "original": { @@ -635,36 +617,18 @@ "type": "github" } }, - "hs-memory": { - "flake": false, - "locked": { - "lastModified": 1636757734, - "narHash": "sha256-DIlt0NpFUx8IUeTcgZNBJWWfyNaKv5ZKYw1K9aLvxBs=", - "owner": "vincenthz", - "repo": "hs-memory", - "rev": "3cf661a8a9a8ac028df77daa88e8d65c55a3347a", - "type": "github" - }, - "original": { - "owner": "vincenthz", - "repo": "hs-memory", - "rev": "3cf661a8a9a8ac028df77daa88e8d65c55a3347a", - "type": "github" - } - }, "hspec": { "flake": false, "locked": { - "lastModified": 1649095108, - "narHash": "sha256-cPmt4hvmdh727VT6UAL8yFArmm4FAWeg3K5Qi3XtU4g=", - "owner": "srid", + "lastModified": 1650029958, + "narHash": "sha256-TME2ei7Lk13K6Kj9R9U96A6LldJnwq3IbDOXYXPQ/qA=", + "owner": "hspec", "repo": "hspec", - "rev": "44f2a143e10c93df237af428457d0e4b74ae270a", + "rev": "b4af2fa9fcdcc8fef2242c75ecc1b5fc2891bd79", "type": "github" }, "original": { - "owner": "srid", - "ref": "askAncestors", + "owner": "hspec", "repo": "hspec", "type": "github" } @@ -701,14 +665,53 @@ "type": "github" } }, + "hydra": { + "inputs": { + "nix": "nix", + "nixpkgs": [ + "haskell-nix", + "hydra", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1646878427, + "narHash": "sha256-KtbrofMtN8GlM7D+n90kixr7QpSlVmdN+vK5CA/aRzc=", + "owner": "NixOS", + "repo": "hydra", + "rev": "28b682b85b7efc5cf7974065792a1f22203a5927", + "type": "github" + }, + "original": { + "id": "hydra", + "type": "indirect" + } + }, + "inline-r": { + "flake": false, + "locked": { + "lastModified": 1644844599, + "narHash": "sha256-q39Dp5hj4u5Lx6wWwPoc9CbyocH3KutYDmWVd3xevgo=", + "owner": "tweag", + "repo": "haskellR", + "rev": "c3ba1023480e26ade420896bcb629ceaad59f308", + "type": "github" + }, + "original": { + "owner": "tweag", + "repo": "haskellR", + "type": "github" + } + }, "iohk-nix": { "flake": false, "locked": { - "lastModified": 1643251385, - "narHash": "sha256-Czbd69lg0ARSZfC18V6h+gtPMioWDAEVPbiHgL2x9LM=", + "lastModified": 1649070135, + "narHash": "sha256-UFKqcOSdPWk3TYUCPHF22p1zf7aXQpCmmgf7UMg7fWA=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "9d6ee3dcb3482f791e40ed991ad6fc649b343ad4", + "rev": "cecab9c71d1064f05f1615eead56ac0b9196bc20", "type": "github" }, "original": { @@ -759,28 +762,89 @@ ] }, "locked": { - "lastModified": 1650427214, - "narHash": "sha256-9m66rRSSM614ocRXNPAArwnrS6zzCQYYhd3nw8g4QUg=", - "ref": "overengineered", - "rev": "5555def5a25c5437834c06cbe79b3945916ec59f", - "revCount": 28, + "lastModified": 1648405819, + "narHash": "sha256-Rv9QsHg5a3OurGxbC0Y2aERAZ0sFXYQyaxGYXdDPiZ4=", + "ref": "parameterized", + "rev": "9ba45de1fc3dbbe65c39d7d0107b99a8046a8081", + "revCount": 21, + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + }, + "original": { + "ref": "parameterized", + "type": "git", + "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" + } + }, + "lint-utils_2": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "emanote", + "ema", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1648667273, + "narHash": "sha256-eQUb40xDyv0Ye3oMzGz6tcHPF9y9Xhq1QksV9h7uEDk=", + "ref": "spec-type", + "rev": "4648a98d91f754ae0f7a3d035a1aaa871eb1b4fc", + "revCount": 34, "type": "git", "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" }, "original": { - "ref": "overengineered", + "ref": "spec-type", "type": "git", "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" } }, + "lowdown-src": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, + "nix": { + "inputs": { + "lowdown-src": "lowdown-src", + "nixpkgs": "nixpkgs_5", + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1643066034, + "narHash": "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg=", + "owner": "NixOS", + "repo": "nix", + "rev": "a1cd7e58606a41fcf62bf8637804cf8306f17f62", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "2.6.0", + "repo": "nix", + "type": "github" + } + }, "nix-tools": { "flake": false, "locked": { - "lastModified": 1644395812, - "narHash": "sha256-BVFk/BEsTLq5MMZvdy3ZYHKfaS3dHrsKh4+tb5t5b58=", + "lastModified": 1649424170, + "narHash": "sha256-XgKXWispvv5RCvZzPb+p7e6Hy3LMuRjafKMl7kXzxGw=", "owner": "input-output-hk", "repo": "nix-tools", - "rev": "d847c63b99bbec78bf83be2a61dc9f09b8a9ccc1", + "rev": "e109c94016e3b6e0db7ed413c793e2d4bdb24aa7", "type": "github" }, "original": { @@ -791,17 +855,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1650882267, - "narHash": "sha256-BFKiz8srATQIBuFEN2HgS2EHisK29EjZ/HV34wSr2lU=", + "lastModified": 1649456639, + "narHash": "sha256-rZCjaEAZgOtT9kYTBigksof64SqKAXOuoHhlzHvfl0E=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2ea2f7b6d0cb7ce0712f2aa80303cda08deb0de2", + "rev": "c48167590e3258daac6ab12a41bc2b7341e9b2ec", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "2ea2f7b6d0cb7ce0712f2aa80303cda08deb0de2", + "rev": "c48167590e3258daac6ab12a41bc2b7341e9b2ec", "type": "github" } }, @@ -823,11 +887,11 @@ }, "nixpkgs-2105": { "locked": { - "lastModified": 1642244250, - "narHash": "sha256-vWpUEqQdVP4srj+/YLJRTN9vjpTs4je0cdWKXPbDItc=", + "lastModified": 1645296114, + "narHash": "sha256-y53N7TyIkXsjMpOG7RhvqJFGDacLs9HlyHeSTBioqYU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0fd9ee1aa36ce865ad273f4f07fdc093adeb5c00", + "rev": "530a53dcbc9437363471167a5e4762c5fcfa34a1", "type": "github" }, "original": { @@ -839,11 +903,11 @@ }, "nixpkgs-2111": { "locked": { - "lastModified": 1644510859, - "narHash": "sha256-xjpVvL5ecbyi0vxtVl/Fh9bwGlMbw3S06zE5nUzFB8A=", + "lastModified": 1648744337, + "narHash": "sha256-bYe1dFJAXovjqiaPKrmAbSBEK5KUkgwVaZcTbSoJ7hg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d1d5d7e3679fec9d07f2eb804d9f9fdb98378d3", + "rev": "0a58eebd8ec65ffdef2ce9562784123a73922052", "type": "github" }, "original": { @@ -853,13 +917,28 @@ "type": "github" } }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "indirect" + } + }, "nixpkgs-unstable": { "locked": { - "lastModified": 1644486793, - "narHash": "sha256-EeijR4guVHgVv+JpOX3cQO+1XdrkJfGmiJ9XVsVU530=", + "lastModified": 1648219316, + "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292", + "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", "type": "github" }, "original": { @@ -916,6 +995,21 @@ } }, "nixpkgs_5": { + "locked": { + "lastModified": 1632864508, + "narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "82891b5e2c2359d7e58d08849e4c89511ab94234", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-21.05-small", + "type": "indirect" + } + }, + "nixpkgs_6": { "locked": { "lastModified": 1647297614, "narHash": "sha256-ulGq3W5XsrBMU/u5k9d4oPy65pQTkunR4HKKtTq0RwY=", @@ -931,14 +1025,14 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "flake": false, "locked": { - "lastModified": 1628785280, - "narHash": "sha256-2B5eMrEr6O8ff2aQNeVxTB+9WrGE80OB4+oM6T7fOcc=", + "lastModified": 1645493675, + "narHash": "sha256-9xundbZQbhFodsQRh6QMN1GeSXfo3y/5NL0CZcJULz0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6525bbc06a39f26750ad8ee0d40000ddfdc24acb", + "rev": "74b10859829153d5c5d50f7c77b86763759e8654", "type": "github" }, "original": { @@ -968,16 +1062,16 @@ "pandoc-link-context": { "flake": false, "locked": { - "lastModified": 1650932770, + "lastModified": 1649279446, "narHash": "sha256-/WzE4O23B1OcL3WF8Saz5TRQj0tGH7FtbgRLRson2Mc=", "owner": "srid", "repo": "pandoc-link-context", - "rev": "85bd204339aafd309b8a3dd99ebffa6a50776cb6", + "rev": "3bffff3776c791686711d26c98c432983272d1ef", "type": "github" }, "original": { "owner": "srid", - "ref": "master", + "ref": "no-dl", "repo": "pandoc-link-context", "type": "github" } @@ -985,7 +1079,7 @@ "pathtree": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "nixpkgs": "nixpkgs_2" }, "locked": { @@ -1010,17 +1104,16 @@ "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", "iohk-nix": "iohk-nix_2", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "pre-commit-hooks-nix": "pre-commit-hooks-nix", - "sphinxcontrib-haddock": "sphinxcontrib-haddock", - "stackage-nix": "stackage-nix" + "sphinxcontrib-haddock": "sphinxcontrib-haddock" }, "locked": { - "lastModified": 1645203653, - "narHash": "sha256-HAi60mSkyMXzu1Wg3h6KdYZg+ufNMvX6obfcLo0ArL0=", + "lastModified": 1650299457, + "narHash": "sha256-gXNQLIjHAzF6riWb9zml7FZx4W7JkXkxSmR/pC5DKHo=", "owner": "L-as", "repo": "plutus", - "rev": "5ec17953aae3ac9546f6d923201eb1dbb4e058bb", + "rev": "5671d4906c545a3e37bab5cc6ea355f45fb9adb7", "type": "github" }, "original": { @@ -1069,17 +1162,15 @@ "cardano-base": "cardano-base", "cardano-crypto": "cardano-crypto", "cardano-prelude": "cardano-prelude", - "cryptonite": "cryptonite", "emanote": "emanote", "flat": "flat", - "foundation": "foundation", "haskell-language-server": "haskell-language-server", "haskell-nix": "haskell-nix", "hercules-ci-effects": "hercules-ci-effects", - "hs-memory": "hs-memory", "hspec": "hspec", "hspec-golden": "hspec-golden", "hspec-hedgehog": "hspec-hedgehog", + "inline-r": "inline-r", "iohk-nix": "iohk-nix", "nixpkgs": [ "haskell-nix", @@ -1087,8 +1178,24 @@ ], "plutus": "plutus", "protolude": "protolude", - "sized-functors": "sized-functors", - "th-extras": "th-extras" + "secp256k1-haskell": "secp256k1-haskell", + "sized-functors": "sized-functors" + } + }, + "secp256k1-haskell": { + "flake": false, + "locked": { + "lastModified": 1647456839, + "narHash": "sha256-+veCnxT9BYj1dNnK/bmwuRG8VTkLX81xqYyPtrrGH7E=", + "owner": "haskoin", + "repo": "secp256k1-haskell", + "rev": "40bfcde02970fa4a90de63bdc7839d454fce7f14", + "type": "github" + }, + "original": { + "owner": "haskoin", + "repo": "secp256k1-haskell", + "type": "github" } }, "sized-functors": { @@ -1127,27 +1234,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1644887829, - "narHash": "sha256-tjUXJpqB7MMnqM4FF5cdtZipfratUcTKRQVA6F77sEQ=", + "lastModified": 1650158092, + "narHash": "sha256-uQ/TEFcce0bKmYcoBziDhYYzCDmhPsjC5WgsJjpd9wA=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "db8bdef6588cf4f38e6069075ba76f0024381f68", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "stackage.nix", - "type": "github" - } - }, - "stackage-nix": { - "flake": false, - "locked": { - "lastModified": 1597712578, - "narHash": "sha256-c/pcfZ6w5Yp//7oC0hErOGVVphBLc5vc4IZlWKZ/t6E=", - "owner": "input-output-hk", - "repo": "stackage.nix", - "rev": "e32c8b06d56954865725514ce0d98d5d1867e43a", + "rev": "adc7f942e756b382a7a833520ebef6dfc859af8e", "type": "github" }, "original": { @@ -1159,7 +1250,7 @@ "tailwind-haskell": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": "nixpkgs_3" }, "locked": { @@ -1177,27 +1268,10 @@ "type": "github" } }, - "th-extras": { - "flake": false, - "locked": { - "lastModified": 1641329261, - "narHash": "sha256-+K91xH/zew66ry0EAV5FaEIAHUZdJ3ngD9GzCJiUq7k=", - "owner": "mokus0", - "repo": "th-extras", - "rev": "787ed752c1e5d41b5903b74e171ed087de38bffa", - "type": "github" - }, - "original": { - "owner": "mokus0", - "repo": "th-extras", - "rev": "787ed752c1e5d41b5903b74e171ed087de38bffa", - "type": "github" - } - }, "unionmount": { "inputs": { "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "nixpkgs": "nixpkgs_4" }, "locked": { diff --git a/flake.nix b/flake.nix index 6d261720e..78ba223cf 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "plutarch"; - inputs.haskell-nix.url = "github:L-as/haskell.nix?ref=master"; + inputs.haskell-nix.url = "github:mlabs-haskell/haskell.nix"; inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; @@ -19,31 +19,19 @@ # https://github.com/Quid2/flat/pull/27 inputs.flat.url = "github:Quid2/flat?rev=41a040c413351e021982bb78bd00f750628f8060"; inputs.flat.flake = false; - # https://github.com/haskell-foundation/foundation/pull/555 - inputs.foundation.url = "github:haskell-foundation/foundation?rev=0bb195e1fea06d144dafc5af9a0ff79af0a5f4a0"; - inputs.foundation.flake = false; # https://github.com/locallycompact/protolude inputs.protolude.url = "github:protolude/protolude?rev=d821ef0ac7552cfa2c3e7a7bdf29539f57e3fae6"; inputs.protolude.flake = false; - # https://github.com/vincenthz/hs-memory/pull/87 - inputs.hs-memory.url = "github:vincenthz/hs-memory?rev=3cf661a8a9a8ac028df77daa88e8d65c55a3347a"; - inputs.hs-memory.flake = false; - # https://github.com/haskell-crypto/cryptonite/issues/357 - inputs.cryptonite.url = "github:haskell-crypto/cryptonite?rev=cec291d988f0f17828384f3358214ab9bf724a13"; - inputs.cryptonite.flake = false; # https://github.com/JonasDuregard/sized-functors/pull/10 inputs.sized-functors.url = "github:JonasDuregard/sized-functors?rev=fe6bf78a1b97ff7429630d0e8974c9bc40945dcf"; inputs.sized-functors.flake = false; - # https://github.com/mokus0/th-extras/pull/17 - inputs.th-extras.url = "github:mokus0/th-extras?rev=787ed752c1e5d41b5903b74e171ed087de38bffa"; - inputs.th-extras.flake = false; inputs.Shrinker.url = "github:Plutonomicon/Shrinker"; inputs.Shrinker.flake = false; inputs.haskell-language-server.url = "github:haskell/haskell-language-server"; inputs.haskell-language-server.flake = false; # https://github.com/hspec/hspec/pull/648 - inputs.hspec.url = "github:srid/hspec/askAncestors"; + inputs.hspec.url = "github:hspec/hspec"; inputs.hspec.flake = false; # Overriding hspec (above) necessitates overriding these for some reason. inputs.hspec-hedgehog.url = "github:parsonsmatt/hspec-hedgehog"; @@ -51,6 +39,12 @@ inputs.hspec-golden.url = "github:stackbuilders/hspec-golden"; inputs.hspec-golden.flake = false; + inputs.secp256k1-haskell.url = "github:haskoin/secp256k1-haskell"; + inputs.secp256k1-haskell.flake = false; + + inputs.inline-r.url = "github:tweag/haskellR"; + inputs.inline-r.flake = false; + inputs.emanote.url = "github:srid/emanote/master"; outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, hercules-ci-effects, ... }: @@ -60,31 +54,16 @@ src = inputs.protolude; subdirs = [ "." ]; } - { - src = inputs.foundation; - subdirs = [ - "foundation" - "basement" - ]; - } { src = inputs.cardano-prelude; subdirs = [ "cardano-prelude" ]; } - { - src = inputs.hs-memory; - subdirs = [ "." ]; - } { src = inputs.cardano-crypto; subdirs = [ "." ]; } - { - src = inputs.cryptonite; - subdirs = [ "." ]; - } { src = inputs.flat; subdirs = [ "." ]; @@ -100,10 +79,6 @@ src = inputs.sized-functors; subdirs = [ "." ]; } - { - src = inputs.th-extras; - subdirs = [ "." ]; - } { src = inputs.plutus; subdirs = [ @@ -131,6 +106,14 @@ src = inputs.hspec-golden; subdirs = [ "." ]; } + { + src = inputs.secp256k1-haskell; + subdirs = [ "." ]; + } + { + src = inputs.inline-r; + subdirs = [ "inline-r" ]; + } ]; supportedSystems = with nixpkgs.lib.systems.supported; tier1 ++ tier2 ++ tier3; @@ -144,7 +127,7 @@ }; nixpkgsFor' = system: import nixpkgs { inherit system; }; - ghcVersion = "ghc921"; + ghcVersion = "ghc922"; # https://github.com/input-output-hk/haskell.nix/issues/1177 nonReinstallablePkgs = [ @@ -210,54 +193,31 @@ primitive-unlifted < 1.0.0.0 package haskell-language-server - flags: +use-ghc-stub +pedantic +ignore-plugins-ghc-bounds -alternateNumberFormat -brittany -class -eval -haddockComments -hlint -retrie -splice -stylishhaskell -tactic + flags: +use-ghc-stub +pedantic +ignore-plugins-ghc-bounds -alternateNumberFormat -brittany -eval -haddockComments -hlint -retrie -splice -stylishhaskell -tactic ''; src = "${inputs.haskell-language-server}"; }; - haskellModule = system: { - inherit nonReinstallablePkgs; # Needed only so we can use hspec; https://github.com/Plutonomicon/plutarch/issues/409 - packages = { - basement.src = "${inputs.foundation}/basement"; - basement.components.library.postUnpack = "\n"; - cardano-binary.doHaddock = false; - cardano-binary.ghcOptions = [ "-Wwarn" ]; - cardano-binary.src = "${inputs.cardano-base}/binary"; - cardano-binary.components.library.postUnpack = "\n"; - cardano-crypto-class.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (nixpkgsFor system).libsodium-vrf ] ]; - cardano-crypto-class.doHaddock = false; - cardano-crypto-class.ghcOptions = [ "-Wwarn" ]; - cardano-crypto-class.src = "${inputs.cardano-base}/cardano-crypto-class"; - cardano-crypto-class.components.library.postUnpack = "\n"; - cardano-crypto-praos.components.library.pkgconfig = nixpkgs.lib.mkForce [ [ (nixpkgsFor system).libsodium-vrf ] ]; - cardano-crypto.src = "${inputs.cardano-crypto}"; - cardano-crypto.components.library.postUnpack = "\n"; - cardano-prelude.doHaddock = false; # somehow above options are not applied? - cardano-prelude.ghcOptions = [ "-Wwarn" ]; - cardano-prelude.src = "${inputs.cardano-prelude}/cardano-prelude"; - cardano-prelude.components.library.postUnpack = "\n"; - cryptonite.src = "${inputs.cryptonite}"; - cryptonite.components.library.postUnpack = "\n"; - flat.src = "${inputs.flat}"; - flat.components.library.postUnpack = "\n"; - foundation.src = "${inputs.foundation}/foundation"; - foundation.components.library.postUnpack = "\n"; - memory.src = "${inputs.hs-memory}"; - memory.components.library.postUnpack = "\n"; - #plutus-core.src = "${inputs.plutus}/plutus-core"; - #plutus-core.components.library.postUnpack = "\n"; - plutus-tx.src = "${inputs.plutus}/plutus-tx"; - plutus-tx.components.library.postUnpack = "\n"; - plutus-ledger-api.src = "${inputs.plutus}/plutus-ledger-api"; - plutus-ledger-api.components.library.postUnpack = "\n"; - #prettyprinter-configurable.src = "${inputs.plutus}/prettyprinter-configurable"; - #prettyprinter-configurable.components.library.postUnpack = "\n"; - protolude.src = "${inputs.protolude}"; - protolude.components.library.postUnpack = "\n"; - word-array.src = "${inputs.plutus}/word-array"; - word-array.components.library.postUnpack = "\n"; - }; - }; + haskellModules = [ + ({ config, pkgs, hsPkgs, ... }: { + inherit nonReinstallablePkgs; # Needed only so we can use hspec; https://github.com/Plutonomicon/plutarch/issues/409 + packages = { + cardano-binary.doHaddock = false; + cardano-binary.ghcOptions = [ "-Wwarn" ]; + cardano-crypto-class.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ]; + cardano-crypto-class.doHaddock = false; + cardano-crypto-class.ghcOptions = [ "-Wwarn" ]; + cardano-crypto-praos.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ]; + cardano-prelude.doHaddock = false; # somehow above options are not applied? + cardano-prelude.ghcOptions = [ "-Wwarn" ]; + # Workaround missing support for build-tools: + # https://github.com/input-output-hk/haskell.nix/issues/231 + plutarch-test.components.exes.plutarch-test.build-tools = [ + config.hsPkgs.hspec-discover + ]; + }; + }) + ]; cabalProjectLocal = '' allow-newer: @@ -277,6 +237,7 @@ , protolude:hashable , protolude:bytestring , size-based:template-haskell + , int-cast:base constraints: OneTuple >= 0.3.1 @@ -446,6 +407,7 @@ , witherable >= 0.4.2 , wl-pprint-annotated >= 0.1.0.1 , word-array >= 0.1.0.0 + , secp256k1-haskell >= 0.6 ''; projectForGhc = ghcName: flagDevelopment: system: @@ -465,14 +427,8 @@ src = inputs.Shrinker; subdirs = [ "." ]; }]; - modules = [ - (haskellModule system) + modules = haskellModules ++ [ { - # Workaround missing support for build-tools: - # https://github.com/input-output-hk/haskell.nix/issues/231 - packages.plutarch-test.components.exes.plutarch-test.build-tools = [ - pkgSet.hsPkgs.hspec-discover - ]; packages.plutarch-test.flags.development = flagDevelopment; packages.plutarch.flags.development = flagDevelopment; } @@ -503,8 +459,6 @@ ps.hspec-discover ps.hspec-hedgehog ps.hspec-golden - #ps.shrinker - #ps.shrinker-testing ]; }; } // (if ghcName == ghcVersion then { @@ -628,7 +582,7 @@ (nixpkgsFor system).runCommand appName { } "${self.apps.${system}.${appName}.program} | tee $out"; in { - inherit extraSources cabalProjectLocal haskellModule tools; + inherit extraSources cabalProjectLocal haskellModules tools; # Build matrix. Plutarch is built against different GHC versions, and 'development' flag. projectMatrix = { From 41caa60432ccbfc1b7dc12f06ee246ca1df22d2e Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 18 Apr 2022 19:01:22 +0000 Subject: [PATCH 461/584] Fix `Plutarch.Lift` --- Plutarch/Lift.hs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index c7494f9fb..79c6b3cb9 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -38,8 +38,8 @@ import Plutarch.Evaluate (EvalError, evalScript) import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInternal) import qualified Plutus.V1.Ledger.Scripts as Scripts import qualified PlutusCore as PLC -import PlutusCore.Builtin (ReadKnownError, readKnownConstant) -import PlutusCore.Evaluation.Machine.Exception (ErrorWithCause (ErrorWithCause), MachineError, _UnliftingErrorE) +import PlutusCore.Builtin (KnownTypeError, readKnownConstant) +import PlutusCore.Evaluation.Machine.Exception (_UnliftingErrorE) import PlutusTx (BuiltinData, Data, builtinDataToData, dataToBuiltinData) import PlutusTx.Builtins.Class (FromBuiltin, ToBuiltin, fromBuiltin, toBuiltin) import qualified UntypedPlutusCore as UPLC @@ -97,7 +97,7 @@ pconstant x = punsafeConstantInternal $ PLC.someValue @(PConstantRepr (PLifted p -- | Error during script evaluation. data LiftError = LiftError_EvalError EvalError - | LiftError_ReadKnownError (ErrorWithCause ReadKnownError (MachineError PLC.DefaultFun)) + | LiftError_KnownTypeError KnownTypeError | LiftError_FromRepr deriving stock (Eq) @@ -107,11 +107,11 @@ This will fully evaluate the arbitrary closed expression, and convert the result plift' :: forall p. PUnsafeLiftDecl p => ClosedTerm p -> Either LiftError (PLifted p) plift' prog = case evalScript (compile prog) of (Right (Scripts.unScript -> UPLC.Program _ _ term), _, _) -> - case readKnownConstant @_ @(PConstantRepr (PLifted p)) @(MachineError PLC.DefaultFun) Nothing term of + case readKnownConstant term of Right r -> case pconstantFromRepr r of Just h -> Right h Nothing -> Left LiftError_FromRepr - Left e -> Left $ LiftError_ReadKnownError e + Left e -> Left $ LiftError_KnownTypeError e (Left e, _, _) -> Left $ LiftError_EvalError e -- | Like `plift'` but throws on failure. @@ -119,13 +119,11 @@ plift :: forall p. (HasCallStack, PLift p) => ClosedTerm p -> PLifted p plift prog = case plift' prog of Right x -> x Left LiftError_FromRepr -> error "plift failed: pconstantFromRepr returned 'Nothing'" - Left (LiftError_ReadKnownError (ErrorWithCause e causeMaybe)) -> + Left (LiftError_KnownTypeError e) -> let unliftErrMaybe = e ^? _UnliftingErrorE in error $ "plift failed: incorrect type: " <> maybe "absurd evaluation failure" show unliftErrMaybe - <> "\n" - <> maybe "" (\x -> "cause: " <> show x) causeMaybe Left (LiftError_EvalError e) -> error $ "plift failed: erring term: " <> show e {- | Newtype wrapper for deriving @PConstant@ when the wrapped type is directly From 14432b54a83eab1bd2e3298a9b65dfb2dfa14aee Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Mon, 18 Apr 2022 15:39:27 -0400 Subject: [PATCH 462/584] test: getSpecDescriptionPath now returns list in different order --- plutarch-test/common/Plutarch/Test/Golden.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index a87e36b50..5b1f31db9 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -157,8 +157,9 @@ mkGoldenKeyFromSpecPath path = case nonEmpty path of Nothing -> error "cannot use currentGoldenKey from top-level spec" Just anc -> - case nonEmpty (NE.drop 1 . NE.reverse $ anc) of - Nothing -> error "cannot use currentGoldenKey from top-level spec (after sydtest-discover)" + -- hspec-discover adds a top-level entry; remove that. + case nonEmpty (NE.drop 1 anc) of + Nothing -> error "cannot use currentGoldenKey from top-level spec (after hspec-discover)" Just path -> sconcat $ fmap GoldenKey path From be9c8c0e78abedffa78142111fb424cd84fe1d31 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 16 May 2022 17:33:06 +0530 Subject: [PATCH 463/584] Fix incorrect let binding pretty print --- Plutarch/Pretty.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index 8e534ab09..e6236f0eb 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -103,7 +103,6 @@ prettyUPLC = go Normal mempty $ mkStdGen 42 go _ nameMap g (Apply _ (LamAbs _ _ t) firstArg) = let (restArgs, coreF) = unwrapBindings [] t (firstName, nextG) = smartName nameMap g firstArg - nextMap = Map.mapKeys (+ 1) nameMap <> Map.singleton 0 firstName (finalDoc, finalMap, finalG) = foldl' ( \(docAcc, mp, currG) argExpr -> @@ -111,7 +110,7 @@ prettyUPLC = go Normal mempty $ mkStdGen 42 newDoc = docAcc <> PP.flatAlt PP.hardline "; " <> helper mp (newName, argExpr) in (newDoc, Map.mapKeys (+ 1) mp <> Map.singleton 0 newName, newG) ) - (helper nextMap (firstName, firstArg), nextMap, nextG) + (helper nameMap (firstName, firstArg), Map.mapKeys (+ 1) nameMap <> Map.singleton 0 firstName, nextG) $ reverse restArgs helper mp (name, expr) = PP.hang indentWidth $ From ff3e12341709994e089511812c516086cf9ac1bb Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 19 Apr 2022 10:27:32 +0000 Subject: [PATCH 464/584] Update dependencies again, use `applyPlutarchDep`, and stop using forks for most things --- flake.lock | 256 ++++++------------- flake.nix | 545 +++++++++++++++++++--------------------- plutus-bytestring.patch | 22 ++ 3 files changed, 348 insertions(+), 475 deletions(-) create mode 100644 plutus-bytestring.patch diff --git a/flake.lock b/flake.lock index 183d5aefc..232e8ec85 100644 --- a/flake.lock +++ b/flake.lock @@ -86,11 +86,11 @@ "cardano-base": { "flake": false, "locked": { - "lastModified": 1649207882, - "narHash": "sha256-JRhz+eSmrW+9yFtou+PDZYOKGO7au+OuL4c/0zINqeA=", + "lastModified": 1651043525, + "narHash": "sha256-5B5lJFfUm4jbCBQtqTMvtiY2AWtnsN/1TYftAglT38A=", "owner": "input-output-hk", "repo": "cardano-base", - "rev": "bf03ef2f2fdd2df3a7ca86cf5ae2171b3c1d1377", + "rev": "8fe904d629194b1fbaaf2d0a4e0ccd17052e9103", "type": "github" }, "original": { @@ -173,11 +173,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1649899800, - "narHash": "sha256-MmmG1Gn+RohDnZzzHEKQxks9Q5Jz6rSziEdCm6l5tGo=", + "lastModified": 1650932571, + "narHash": "sha256-rdpfJ+10a1uBPtHMNoAcpDE183RzpILRpsMgxj/YJek=", "owner": "srid", "repo": "ema", - "rev": "d53dad29fbacad97916057382528bc49b542e4bb", + "rev": "05c8a2127391ee4b593fa6541bc9078eb44ad10f", "type": "github" }, "original": { @@ -202,7 +202,6 @@ ], "heist": "heist", "ixset-typed": "ixset-typed", - "lint-utils": "lint-utils_2", "nixpkgs": [ "emanote", "ema", @@ -214,11 +213,11 @@ "unionmount": "unionmount" }, "locked": { - "lastModified": 1649967299, - "narHash": "sha256-ln7XeTiaKD1sF2taP7k9Xgif87Uglu/hDkPOZepm56M=", + "lastModified": 1651699367, + "narHash": "sha256-f+whlGwxzv5Lcem+rxBgIgnkU+KcckogtWbRwZ6nM4I=", "owner": "srid", "repo": "emanote", - "rev": "ffb17f377db3553f09a23ae71a22561b1e9d3ea0", + "rev": "2b6558fde2999ec22f645cb95322995b780f09f1", "type": "github" }, "original": { @@ -323,21 +322,6 @@ } }, "flake-utils_3": { - "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { "locked": { "lastModified": 1642700792, "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", @@ -352,7 +336,7 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_4": { "locked": { "lastModified": 1642700792, "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", @@ -367,7 +351,7 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_5": { "locked": { "lastModified": 1631561581, "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", @@ -382,7 +366,7 @@ "type": "github" } }, - "flake-utils_7": { + "flake-utils_6": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -400,17 +384,16 @@ "flat": { "flake": false, "locked": { - "lastModified": 1641898475, - "narHash": "sha256-D7jJ4t0T1ZvXbO61r3HQj77hZ5hWF/P1L8X9+MnfD6c=", + "lastModified": 1651403785, + "narHash": "sha256-g+jGep1IXdw4q01W67J6f6OODY91QzIlW1+Eu8pR+u0=", "owner": "Quid2", "repo": "flat", - "rev": "41a040c413351e021982bb78bd00f750628f8060", + "rev": "559617e058098b776b431e2a67346ad3adea2440", "type": "github" }, "original": { "owner": "Quid2", "repo": "flat", - "rev": "41a040c413351e021982bb78bd00f750628f8060", "type": "github" } }, @@ -450,11 +433,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1650157984, - "narHash": "sha256-hitutrIIn+qINGi6oef53f87we+cp3QNmXSBiCzVU90=", + "lastModified": 1652663624, + "narHash": "sha256-WeZYALZ6wjXJaMi0ZiSLq5A/ybvES8vN3zPozUgzkFs=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "2290fdc4d135407896f41ba518a0eae8efaae9c5", + "rev": "70c6780e617190a1ecc26bd004ece9ea67dcc260", "type": "github" }, "original": { @@ -466,11 +449,11 @@ "hackage-nix": { "flake": false, "locked": { - "lastModified": 1644369434, - "narHash": "sha256-WqU6f1OhSM0UHXFW8Mhhvhz0tcij+NQVtmb6sW4RiFw=", + "lastModified": 1651108473, + "narHash": "sha256-zHGCnBdwKvrcYanjf3GARTWF8V2pyJl1QNONUNZSoc0=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "644a0d702abf84cdec62f4e620ff1034000e6146", + "rev": "dbab3b292c3400d028a2257e3acd2ac0249da774", "type": "github" }, "original": { @@ -482,11 +465,11 @@ "haskell-language-server": { "flake": false, "locked": { - "lastModified": 1650179337, - "narHash": "sha256-OU8i3ewwRvewd2pj3DowHV6kh6lUJzNwf2atg16Vy30=", + "lastModified": 1652432991, + "narHash": "sha256-YDKZv7r+kA6s8A+iSev9hHFJF1dUPlZqROrATWp1rwk=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "41f917e959160885016568030ce45d0339649a09", + "rev": "b1bf5499155e259341e4868863b0fd743b6bd65f", "type": "github" }, "original": { @@ -498,16 +481,16 @@ "haskell-language-server_2": { "flake": false, "locked": { - "lastModified": 1643835246, - "narHash": "sha256-5LQHcQmi3mUGRgJu+X/m3jeM3kdkYjLD+KwgnxBlbeU=", + "lastModified": 1650980856, + "narHash": "sha256-uiwsfh/K3IABZDYj7JUZNIAPRVqH6g/r8X6QKg8DrZE=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "024ddc8b3904f8b8e8fe67ba6b9ebd8a4bd7ce76", + "rev": "b5a37f7fc360596899cb2945f363030f44156415", "type": "github" }, "original": { "owner": "haskell", - "ref": "1.6.1.1", + "ref": "1.7.0.0", "repo": "haskell-language-server", "type": "github" } @@ -519,7 +502,7 @@ "cabal-34": "cabal-34", "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", - "flake-utils": "flake-utils_7", + "flake-utils": "flake-utils_6", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", "hpc-coveralls": "hpc-coveralls", @@ -537,11 +520,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1650194184, - "narHash": "sha256-wwRdO075Gh+NbyTH4Gce/hxn7hKJjbNs4/YrKpOguAA=", + "lastModified": 1652698457, + "narHash": "sha256-o9UvhU9QwdzXTFOnRB+MTQ0+fP5DblInxHoXqN6DplA=", "owner": "mlabs-haskell", "repo": "haskell.nix", - "rev": "cf1f0460b65efadac6dc96169ef1e497410fa4f4", + "rev": "269936645c92aa74b8b0695e96a1c92fd108f8aa", "type": "github" }, "original": { @@ -553,11 +536,11 @@ "haskell-nix_2": { "flake": false, "locked": { - "lastModified": 1646278384, - "narHash": "sha256-Gv1Ws3vAojjvjATcsvwAOTuOhzpxwt6tBci7EBaXxU4=", + "lastModified": 1651151636, + "narHash": "sha256-WdMP9IMB5kByT0zimDuCYZF/dinRB104H8iDTG/c1Eo=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "7e06e14ae1b894445254fe41288bfa7dd4ccbc6f", + "rev": "f707aa2e75c0d33473166abc61c0b43ac6e107c0", "type": "github" }, "original": { @@ -588,11 +571,11 @@ "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1649324058, - "narHash": "sha256-6U/SIhp/8Ht402Ip7pu7qQ7azquwYVCVbZfcv5M+4so=", + "lastModified": 1651596301, + "narHash": "sha256-yo61VaBY2zk6oF+LEN89bdCyc33qXd4iUW1UIUINMxM=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "14dcd541e4d5315deb3f6941cd5b293945c14584", + "rev": "9159f70a8ab5c26f8dbca0ef3383998e1c8c95dd", "type": "github" }, "original": { @@ -617,54 +600,6 @@ "type": "github" } }, - "hspec": { - "flake": false, - "locked": { - "lastModified": 1650029958, - "narHash": "sha256-TME2ei7Lk13K6Kj9R9U96A6LldJnwq3IbDOXYXPQ/qA=", - "owner": "hspec", - "repo": "hspec", - "rev": "b4af2fa9fcdcc8fef2242c75ecc1b5fc2891bd79", - "type": "github" - }, - "original": { - "owner": "hspec", - "repo": "hspec", - "type": "github" - } - }, - "hspec-golden": { - "flake": false, - "locked": { - "lastModified": 1648755064, - "narHash": "sha256-5a6BksZx00o2iL0Ei/L1Kkou2BsnsIagN+tTmqYyKfs=", - "owner": "stackbuilders", - "repo": "hspec-golden", - "rev": "4b0ad56b2de0254a7b1e0feda917656f78a5bcda", - "type": "github" - }, - "original": { - "owner": "stackbuilders", - "repo": "hspec-golden", - "type": "github" - } - }, - "hspec-hedgehog": { - "flake": false, - "locked": { - "lastModified": 1602603478, - "narHash": "sha256-XnS3zjQ7eh3iBOWq+Z/YcwrfWI55hV6k8LsZ8qm/qOc=", - "owner": "parsonsmatt", - "repo": "hspec-hedgehog", - "rev": "eb617d854542510f0129acdea4bf52e50b13042e", - "type": "github" - }, - "original": { - "owner": "parsonsmatt", - "repo": "hspec-hedgehog", - "type": "github" - } - }, "hydra": { "inputs": { "nix": "nix", @@ -707,11 +642,11 @@ "iohk-nix": { "flake": false, "locked": { - "lastModified": 1649070135, - "narHash": "sha256-UFKqcOSdPWk3TYUCPHF22p1zf7aXQpCmmgf7UMg7fWA=", + "lastModified": 1652277463, + "narHash": "sha256-JAO2IuaaqYA3zsA63y2N3QsmyrcsDM6dEVc9n1CTBjw=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "cecab9c71d1064f05f1615eead56ac0b9196bc20", + "rev": "6a5b69dc042f521db028fed68799eb460bce05a7", "type": "github" }, "original": { @@ -762,40 +697,16 @@ ] }, "locked": { - "lastModified": 1648405819, - "narHash": "sha256-Rv9QsHg5a3OurGxbC0Y2aERAZ0sFXYQyaxGYXdDPiZ4=", - "ref": "parameterized", - "rev": "9ba45de1fc3dbbe65c39d7d0107b99a8046a8081", - "revCount": 21, + "lastModified": 1650427214, + "narHash": "sha256-9m66rRSSM614ocRXNPAArwnrS6zzCQYYhd3nw8g4QUg=", + "ref": "overengineered", + "rev": "5555def5a25c5437834c06cbe79b3945916ec59f", + "revCount": 28, "type": "git", "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" }, "original": { - "ref": "parameterized", - "type": "git", - "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" - } - }, - "lint-utils_2": { - "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": [ - "emanote", - "ema", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1648667273, - "narHash": "sha256-eQUb40xDyv0Ye3oMzGz6tcHPF9y9Xhq1QksV9h7uEDk=", - "ref": "spec-type", - "rev": "4648a98d91f754ae0f7a3d035a1aaa871eb1b4fc", - "revCount": 34, - "type": "git", - "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" - }, - "original": { - "ref": "spec-type", + "ref": "overengineered", "type": "git", "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" } @@ -855,17 +766,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1649456639, - "narHash": "sha256-rZCjaEAZgOtT9kYTBigksof64SqKAXOuoHhlzHvfl0E=", + "lastModified": 1650882267, + "narHash": "sha256-BFKiz8srATQIBuFEN2HgS2EHisK29EjZ/HV34wSr2lU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c48167590e3258daac6ab12a41bc2b7341e9b2ec", + "rev": "2ea2f7b6d0cb7ce0712f2aa80303cda08deb0de2", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "c48167590e3258daac6ab12a41bc2b7341e9b2ec", + "rev": "2ea2f7b6d0cb7ce0712f2aa80303cda08deb0de2", "type": "github" } }, @@ -1062,16 +973,16 @@ "pandoc-link-context": { "flake": false, "locked": { - "lastModified": 1649279446, + "lastModified": 1650932770, "narHash": "sha256-/WzE4O23B1OcL3WF8Saz5TRQj0tGH7FtbgRLRson2Mc=", "owner": "srid", "repo": "pandoc-link-context", - "rev": "3bffff3776c791686711d26c98c432983272d1ef", + "rev": "85bd204339aafd309b8a3dd99ebffa6a50776cb6", "type": "github" }, "original": { "owner": "srid", - "ref": "no-dl", + "ref": "master", "repo": "pandoc-link-context", "type": "github" } @@ -1079,7 +990,7 @@ "pathtree": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_3", "nixpkgs": "nixpkgs_2" }, "locked": { @@ -1109,16 +1020,15 @@ "sphinxcontrib-haddock": "sphinxcontrib-haddock" }, "locked": { - "lastModified": 1650299457, - "narHash": "sha256-gXNQLIjHAzF6riWb9zml7FZx4W7JkXkxSmR/pC5DKHo=", - "owner": "L-as", + "lastModified": 1652694497, + "narHash": "sha256-35OJBbS+/NnnEtkPkOEgk9DlFGsxr/2Vxu6pRHZKS4E=", + "owner": "input-output-hk", "repo": "plutus", - "rev": "5671d4906c545a3e37bab5cc6ea355f45fb9adb7", + "rev": "67ed06de8234555ed181d47ec6b49ab1a004b6f9", "type": "github" }, "original": { - "owner": "L-as", - "ref": "ghc9", + "owner": "input-output-hk", "repo": "plutus", "type": "github" } @@ -1142,17 +1052,16 @@ "protolude": { "flake": false, "locked": { - "lastModified": 1637276813, - "narHash": "sha256-/mgR1Vyp1WYBjdkbwQycrf6lcmOgUFcYUZIMhVgYhdo=", + "lastModified": 1647139352, + "narHash": "sha256-JyHAQfTTUswP8MeGEZibx/2/v01Q7cU5mNpnmDazh24=", "owner": "protolude", "repo": "protolude", - "rev": "d821ef0ac7552cfa2c3e7a7bdf29539f57e3fae6", + "rev": "3e249724fd0ead27370c8c297b1ecd38f92cbd5b", "type": "github" }, "original": { "owner": "protolude", "repo": "protolude", - "rev": "d821ef0ac7552cfa2c3e7a7bdf29539f57e3fae6", "type": "github" } }, @@ -1167,9 +1076,6 @@ "haskell-language-server": "haskell-language-server", "haskell-nix": "haskell-nix", "hercules-ci-effects": "hercules-ci-effects", - "hspec": "hspec", - "hspec-golden": "hspec-golden", - "hspec-hedgehog": "hspec-hedgehog", "inline-r": "inline-r", "iohk-nix": "iohk-nix", "nixpkgs": [ @@ -1178,18 +1084,17 @@ ], "plutus": "plutus", "protolude": "protolude", - "secp256k1-haskell": "secp256k1-haskell", - "sized-functors": "sized-functors" + "secp256k1-haskell": "secp256k1-haskell" } }, "secp256k1-haskell": { "flake": false, "locked": { - "lastModified": 1647456839, - "narHash": "sha256-+veCnxT9BYj1dNnK/bmwuRG8VTkLX81xqYyPtrrGH7E=", + "lastModified": 1650290419, + "narHash": "sha256-XrjiqCC7cNTFib78gdMPGNettAkwAxQlbC/n+/mRFt4=", "owner": "haskoin", "repo": "secp256k1-haskell", - "rev": "40bfcde02970fa4a90de63bdc7839d454fce7f14", + "rev": "3df963ab6ae14ec122691a97af09a7331511a387", "type": "github" }, "original": { @@ -1198,23 +1103,6 @@ "type": "github" } }, - "sized-functors": { - "flake": false, - "locked": { - "lastModified": 1620614934, - "narHash": "sha256-pVJbEGF4/lvXmWIypwkMQBYygOx3TQwLJbMpfdYovdY=", - "owner": "JonasDuregard", - "repo": "sized-functors", - "rev": "fe6bf78a1b97ff7429630d0e8974c9bc40945dcf", - "type": "github" - }, - "original": { - "owner": "JonasDuregard", - "repo": "sized-functors", - "rev": "fe6bf78a1b97ff7429630d0e8974c9bc40945dcf", - "type": "github" - } - }, "sphinxcontrib-haddock": { "flake": false, "locked": { @@ -1234,11 +1122,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1650158092, - "narHash": "sha256-uQ/TEFcce0bKmYcoBziDhYYzCDmhPsjC5WgsJjpd9wA=", + "lastModified": 1652577319, + "narHash": "sha256-zZxCo7vIdyjZueJD3VoR7YImsS54dRhqqVRcsLqUBP0=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "adc7f942e756b382a7a833520ebef6dfc859af8e", + "rev": "49dfbc9cbf38cbf8180a432fcd6d390326c74fba", "type": "github" }, "original": { @@ -1250,7 +1138,7 @@ "tailwind-haskell": { "inputs": { "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_4", "nixpkgs": "nixpkgs_3" }, "locked": { @@ -1271,7 +1159,7 @@ "unionmount": { "inputs": { "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_5", "nixpkgs": "nixpkgs_4" }, "locked": { diff --git a/flake.nix b/flake.nix index 78ba223cf..0c3051aaf 100644 --- a/flake.nix +++ b/flake.nix @@ -8,7 +8,7 @@ inputs.iohk-nix.url = "github:input-output-hk/iohk-nix"; inputs.iohk-nix.flake = false; # we use sphinxcontrib-haddock input - inputs.plutus.url = "github:L-as/plutus?ref=ghc9"; + inputs.plutus.url = "github:input-output-hk/plutus"; # https://github.com/input-output-hk/cardano-prelude/pull/162 inputs.cardano-prelude.url = "github:locallycompact/cardano-prelude?rev=93f95047bb36a055bdd56fb0cafd887c072cdce2"; inputs.cardano-prelude.flake = false; @@ -16,106 +16,27 @@ inputs.cardano-base.flake = false; inputs.cardano-crypto.url = "github:input-output-hk/cardano-crypto?rev=07397f0e50da97eaa0575d93bee7ac4b2b2576ec"; inputs.cardano-crypto.flake = false; - # https://github.com/Quid2/flat/pull/27 - inputs.flat.url = "github:Quid2/flat?rev=41a040c413351e021982bb78bd00f750628f8060"; + inputs.flat.url = "github:Quid2/flat"; inputs.flat.flake = false; - # https://github.com/locallycompact/protolude - inputs.protolude.url = "github:protolude/protolude?rev=d821ef0ac7552cfa2c3e7a7bdf29539f57e3fae6"; - inputs.protolude.flake = false; - # https://github.com/JonasDuregard/sized-functors/pull/10 - inputs.sized-functors.url = "github:JonasDuregard/sized-functors?rev=fe6bf78a1b97ff7429630d0e8974c9bc40945dcf"; - inputs.sized-functors.flake = false; inputs.Shrinker.url = "github:Plutonomicon/Shrinker"; inputs.Shrinker.flake = false; inputs.haskell-language-server.url = "github:haskell/haskell-language-server"; inputs.haskell-language-server.flake = false; - # https://github.com/hspec/hspec/pull/648 - inputs.hspec.url = "github:hspec/hspec"; - inputs.hspec.flake = false; - # Overriding hspec (above) necessitates overriding these for some reason. - inputs.hspec-hedgehog.url = "github:parsonsmatt/hspec-hedgehog"; - inputs.hspec-hedgehog.flake = false; - inputs.hspec-golden.url = "github:stackbuilders/hspec-golden"; - inputs.hspec-golden.flake = false; - inputs.secp256k1-haskell.url = "github:haskoin/secp256k1-haskell"; inputs.secp256k1-haskell.flake = false; inputs.inline-r.url = "github:tweag/haskellR"; inputs.inline-r.flake = false; + # https://github.com/protolude/protolude/pull/133#issuecomment-1112150422 RC not uploaded to hackage yet... + inputs.protolude.url = "github:protolude/protolude"; + inputs.protolude.flake = false; + inputs.emanote.url = "github:srid/emanote/master"; - outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, plutus, hercules-ci-effects, ... }: + outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, hercules-ci-effects, ... }: let - extraSources = [ - { - src = inputs.protolude; - subdirs = [ "." ]; - } - { - src = inputs.cardano-prelude; - subdirs = [ - "cardano-prelude" - ]; - } - { - src = inputs.cardano-crypto; - subdirs = [ "." ]; - } - { - src = inputs.flat; - subdirs = [ "." ]; - } - { - src = inputs.cardano-base; - subdirs = [ - "binary" - "cardano-crypto-class" - ]; - } - { - src = inputs.sized-functors; - subdirs = [ "." ]; - } - { - src = inputs.plutus; - subdirs = [ - "plutus-core" - "plutus-ledger-api" - "plutus-tx" - "prettyprinter-configurable" - "word-array" - ]; - } - { - src = inputs.hspec; - subdirs = [ - "." - "hspec-core" - "hspec-contrib" - "hspec-discover" - ]; - } - { - src = inputs.hspec-hedgehog; - subdirs = [ "." ]; - } - { - src = inputs.hspec-golden; - subdirs = [ "." ]; - } - { - src = inputs.secp256k1-haskell; - subdirs = [ "." ]; - } - { - src = inputs.inline-r; - subdirs = [ "inline-r" ]; - } - ]; - supportedSystems = with nixpkgs.lib.systems.supported; tier1 ++ tier2 ++ tier3; perSystem = nixpkgs.lib.genAttrs supportedSystems; @@ -128,6 +49,7 @@ nixpkgsFor' = system: import nixpkgs { inherit system; }; ghcVersion = "ghc922"; + isGhc9 = x: builtins.trace "Checking whether ${x} is GHC 9.*" (true); # https://github.com/input-output-hk/haskell.nix/issues/1177 nonReinstallablePkgs = [ @@ -200,7 +122,7 @@ haskellModules = [ ({ config, pkgs, hsPkgs, ... }: { - inherit nonReinstallablePkgs; # Needed only so we can use hspec; https://github.com/Plutonomicon/plutarch/issues/409 + inherit nonReinstallablePkgs; # Needed for a lot of different things packages = { cardano-binary.doHaddock = false; cardano-binary.ghcOptions = [ "-Wwarn" ]; @@ -219,196 +141,246 @@ }) ]; - cabalProjectLocal = '' - allow-newer: - cardano-binary:base - , cardano-crypto-class:base - , cardano-prelude:base - , canonical-json:bytestring - , plutus-core:ral - , plutus-core:some - , monoidal-containers:base - , hedgehog:mmorph - , text:deepseq - , hedgehog:template-haskell - , protolude:base - , protolude:ghc-prim - , protolude:transformers-compat - , protolude:hashable - , protolude:bytestring - , size-based:template-haskell - , int-cast:base - - constraints: - OneTuple >= 0.3.1 - , Only >= 0.1 - , QuickCheck >= 2.14.2 - , StateVar >= 1.2.2 - , Stream >= 0.4.7.2 - , adjunctions >= 4.4 - , aeson >= 2.0.3.0 - , algebraic-graphs >= 0.6 - , ansi-terminal >= 0.11.1 - , ansi-wl-pprint >= 0.6.9 - , assoc >= 1.0.2 - , async >= 2.2.4 - , attoparsec >= 0.14.4 - , barbies >= 2.0.3.1 - , base-compat >= 0.12.1 - , base-compat-batteries >= 0.12.1 - , base-orphans >= 0.8.6 - , base16-bytestring >= 1.0.2.0 - , basement >= 0.0.12 - , bifunctors >= 5.5.11 - , bimap >= 0.4.0 - , bin >= 0.1.2 - , boring >= 0.2 - , boxes >= 0.1.5 - , cabal-doctest >= 1.0.9 - , call-stack >= 0.4.0 - , canonical-json >= 0.6.0.0 - , cardano-binary >= 1.5.0 - , cardano-crypto >= 1.1.0 - , cardano-crypto-class >= 2.0.0 - , cardano-prelude >= 0.1.0.0 - , case-insensitive >= 1.2.1.0 - , cassava >= 0.5.2.0 - , cborg >= 0.2.6.0 - , clock >= 0.8.2 - , colour >= 2.3.6 - , comonad >= 5.0.8 - , composition-prelude >= 3.0.0.2 - , concurrent-output >= 1.10.14 - , constraints >= 0.13.2 - , constraints-extras >= 0.3.2.1 - , contravariant >= 1.5.5 - , cryptonite >= 0.29 - , data-default >= 0.7.1.1 - , data-default-class >= 0.1.2.0 - , data-default-instances-containers >= 0.0.1 - , data-default-instances-dlist >= 0.0.1 - , data-default-instances-old-locale >= 0.0.1 - , data-fix >= 0.3.2 - , dec >= 0.0.4 - , dependent-map >= 0.4.0.0 - , dependent-sum >= 0.7.1.0 - , dependent-sum-template >= 0.1.1.1 - , deriving-aeson >= 0.2.8 - , deriving-compat >= 0.6 - , dictionary-sharing >= 0.1.0.0 - , distributive >= 0.6.2.1 - , dlist >= 1.0 - , dom-lt >= 0.2.3 - , double-conversion >= 2.0.2.0 - , erf >= 2.0.0.0 - , exceptions >= 0.10.4 - , extra >= 1.7.10 - , fin >= 0.2.1 - , flat >= 0.4.5 - , foldl >= 1.4.12 - , formatting >= 7.1.3 - , foundation >= 0.0.26.1 - , free >= 5.1.7 - , half >= 0.3.1 - , hashable >= 1.4.0.2 - , haskell-lexer >= 1.1 - , hedgehog >= 1.0.5 - , indexed-traversable >= 0.1.2 - , indexed-traversable-instances >= 0.1.1 - , integer-logarithms >= 1.0.3.1 - , invariant >= 0.5.5 - , kan-extensions >= 5.2.3 - , lazy-search >= 0.1.2.1 - , lazysmallcheck >= 0.6 - , lens >= 5.1 - , lifted-async >= 0.10.2.2 - , lifted-base >= 0.2.3.12 - , list-t >= 1.0.5.1 - , logict >= 0.7.0.3 - , megaparsec >= 9.2.0 - , memory >= 0.16.0 - , microlens >= 0.4.12.0 - , mmorph >= 1.2.0 - , monad-control >= 1.0.3.1 - , mono-traversable >= 1.0.15.3 - , monoidal-containers >= 0.6.2.0 - , mtl-compat >= 0.2.2 - , newtype >= 0.2.2.0 - , newtype-generics >= 0.6.1 - , nothunks >= 0.1.3 - , old-locale >= 1.0.0.7 - , old-time >= 1.1.0.3 - , optparse-applicative >= 0.16.1.0 - , parallel >= 3.2.2.0 - , parser-combinators >= 1.3.0 - , plutus-core >= 0.1.0.0 - , plutus-ledger-api >= 0.1.0.0 - , plutus-tx >= 0.1.0.0 - , pretty-show >= 1.10 - , prettyprinter >= 1.7.1 - , prettyprinter-configurable >= 0.1.0.0 - , primitive >= 0.7.3.0 - , profunctors >= 5.6.2 - , protolude >= 0.3.0 - , quickcheck-instances >= 0.3.27 - , ral >= 0.2.1 - , random >= 1.2.1 - , rank2classes >= 1.4.4 - , recursion-schemes >= 5.2.2.2 - , reflection >= 2.1.6 - , resourcet >= 1.2.4.3 - , safe >= 0.3.19 - , safe-exceptions >= 0.1.7.2 - , scientific >= 0.3.7.0 - , semialign >= 1.2.0.1 - , semigroupoids >= 5.3.7 - , semigroups >= 0.20 - , serialise >= 0.2.4.0 - , size-based >= 0.1.2.0 - , some >= 1.0.3 - , split >= 0.2.3.4 - , splitmix >= 0.1.0.4 - , stm >= 2.5.0.0 - , strict >= 0.4.0.1 - , syb >= 0.7.2.1 - , tagged >= 0.8.6.1 - , tasty >= 1.4.2.1 - , tasty-golden >= 2.3.5 - , tasty-hedgehog >= 1.1.0.0 - , tasty-hunit >= 0.10.0.3 - , temporary >= 1.3 - , terminal-size >= 0.3.2.1 - , testing-type-modifiers >= 0.1.0.1 - , text-short >= 0.1.5 - , th-abstraction >= 0.4.3.0 - , th-compat >= 0.1.3 - , th-expand-syns >= 0.4.9.0 - , th-extras >= 0.0.0.6 - , th-lift >= 0.8.2 - , th-lift-instances >= 0.1.19 - , th-orphans >= 0.13.12 - , th-reify-many >= 0.1.10 - , th-utilities >= 0.2.4.3 - , these >= 1.1.1.1 - , time-compat >= 1.9.6.1 - , transformers-base >= 0.4.6 - , transformers-compat >= 0.7.1 - , type-equality >= 1 - , typed-process >= 0.2.8.0 - , unbounded-delays >= 0.1.1.1 - , universe-base >= 1.1.3 - , unliftio-core >= 0.2.0.1 - , unordered-containers >= 0.2.16.0 - , uuid-types >= 1.0.5 - , vector >= 0.12.3.1 - , vector-algorithms >= 0.8.0.4 - , void >= 0.7.3 - , wcwidth >= 0.0.2 - , witherable >= 0.4.2 - , wl-pprint-annotated >= 0.1.0.1 - , word-array >= 0.1.0.0 - , secp256k1-haskell >= 0.6 - ''; + applyPlutarchDep = pkgs: o: o // { + modules = haskellModules ++ o.modules; + cabalProjectLocal = + if isGhc9 o.compiler-nix-name then '' + allow-newer: + cardano-binary:base + , cardano-crypto-class:base + , cardano-prelude:base + , canonical-json:bytestring + , plutus-core:ral + , plutus-core:some + , monoidal-containers:base + , hedgehog:mmorph + , text:deepseq + , hedgehog:template-haskell + , protolude:base + , protolude:ghc-prim + , protolude:transformers-compat + , protolude:hashable + , protolude:bytestring + , int-cast:base + + constraints: + OneTuple >= 0.3.1 + , Only >= 0.1 + , QuickCheck >= 2.14.2 + , StateVar >= 1.2.2 + , Stream >= 0.4.7.2 + , adjunctions >= 4.4 + , aeson >= 2.0.3.0 + , algebraic-graphs >= 0.6 + , ansi-terminal >= 0.11.1 + , ansi-wl-pprint >= 0.6.9 + , assoc >= 1.0.2 + , async >= 2.2.4 + , attoparsec >= 0.14.4 + , barbies >= 2.0.3.1 + , base-compat >= 0.12.1 + , base-compat-batteries >= 0.12.1 + , base-orphans >= 0.8.6 + , base16-bytestring >= 1.0.2.0 + , basement >= 0.0.12 + , bifunctors >= 5.5.11 + , bimap >= 0.4.0 + , bin >= 0.1.2 + , boring >= 0.2 + , boxes >= 0.1.5 + , cabal-doctest >= 1.0.9 + , call-stack >= 0.4.0 + , canonical-json >= 0.6.0.0 + , cardano-binary >= 1.5.0 + , cardano-crypto >= 1.1.0 + , cardano-crypto-class >= 2.0.0 + , cardano-prelude >= 0.1.0.0 + , case-insensitive >= 1.2.1.0 + , cassava >= 0.5.2.0 + , cborg >= 0.2.6.0 + , clock >= 0.8.2 + , colour >= 2.3.6 + , comonad >= 5.0.8 + , composition-prelude >= 3.0.0.2 + , concurrent-output >= 1.10.14 + , constraints >= 0.13.2 + , constraints-extras >= 0.3.2.1 + , contravariant >= 1.5.5 + , cryptonite >= 0.29 + , data-default >= 0.7.1.1 + , data-default-class >= 0.1.2.0 + , data-default-instances-containers >= 0.0.1 + , data-default-instances-dlist >= 0.0.1 + , data-default-instances-old-locale >= 0.0.1 + , data-fix >= 0.3.2 + , dec >= 0.0.4 + , dependent-map >= 0.4.0.0 + , dependent-sum >= 0.7.1.0 + , dependent-sum-template >= 0.1.1.1 + , deriving-aeson >= 0.2.8 + , deriving-compat >= 0.6 + , dictionary-sharing >= 0.1.0.0 + , distributive >= 0.6.2.1 + , dlist >= 1.0 + , dom-lt >= 0.2.3 + , double-conversion >= 2.0.2.0 + , erf >= 2.0.0.0 + , exceptions >= 0.10.4 + , extra >= 1.7.10 + , fin >= 0.2.1 + , flat >= 0.4.5 + , foldl >= 1.4.12 + , formatting >= 7.1.3 + , foundation >= 0.0.26.1 + , free >= 5.1.7 + , half >= 0.3.1 + , hashable >= 1.4.0.2 + , haskell-lexer >= 1.1 + , hedgehog >= 1.0.5 + , indexed-traversable >= 0.1.2 + , indexed-traversable-instances >= 0.1.1 + , integer-logarithms >= 1.0.3.1 + , invariant >= 0.5.5 + , kan-extensions >= 5.2.3 + , lazy-search >= 0.1.2.1 + , lazysmallcheck >= 0.6 + , lens >= 5.1 + , lifted-async >= 0.10.2.2 + , lifted-base >= 0.2.3.12 + , list-t >= 1.0.5.1 + , logict >= 0.7.0.3 + , megaparsec >= 9.2.0 + , memory >= 0.16.0 + , microlens >= 0.4.12.0 + , mmorph >= 1.2.0 + , monad-control >= 1.0.3.1 + , mono-traversable >= 1.0.15.3 + , monoidal-containers >= 0.6.2.0 + , mtl-compat >= 0.2.2 + , newtype >= 0.2.2.0 + , newtype-generics >= 0.6.1 + , nothunks >= 0.1.3 + , old-locale >= 1.0.0.7 + , old-time >= 1.1.0.3 + , optparse-applicative >= 0.16.1.0 + , parallel >= 3.2.2.0 + , parser-combinators >= 1.3.0 + , plutus-core >= 0.1.0.0 + , plutus-ledger-api >= 0.1.0.0 + , plutus-tx >= 0.1.0.0 + , pretty-show >= 1.10 + , prettyprinter >= 1.7.1 + , prettyprinter-configurable >= 0.1.0.0 + , primitive >= 0.7.3.0 + , profunctors >= 5.6.2 + , protolude >= 0.3.0 + , quickcheck-instances >= 0.3.27 + , ral >= 0.2.1 + , random >= 1.2.1 + , rank2classes >= 1.4.4 + , recursion-schemes >= 5.2.2.2 + , reflection >= 2.1.6 + , resourcet >= 1.2.4.3 + , safe >= 0.3.19 + , safe-exceptions >= 0.1.7.2 + , scientific >= 0.3.7.0 + , semialign >= 1.2.0.1 + , semigroupoids >= 5.3.7 + , semigroups >= 0.20 + , serialise >= 0.2.4.0 + , size-based >= 0.1.2.0 + , some >= 1.0.3 + , split >= 0.2.3.4 + , splitmix >= 0.1.0.4 + , stm >= 2.5.0.0 + , strict >= 0.4.0.1 + , syb >= 0.7.2.1 + , tagged >= 0.8.6.1 + , tasty >= 1.4.2.1 + , tasty-golden >= 2.3.5 + , tasty-hedgehog >= 1.1.0.0 + , tasty-hunit >= 0.10.0.3 + , temporary >= 1.3 + , terminal-size >= 0.3.2.1 + , testing-type-modifiers >= 0.1.0.1 + , text-short >= 0.1.5 + , th-abstraction >= 0.4.3.0 + , th-compat >= 0.1.3 + , th-expand-syns >= 0.4.9.0 + , th-extras >= 0.0.0.6 + , th-lift >= 0.8.2 + , th-lift-instances >= 0.1.19 + , th-orphans >= 0.13.12 + , th-reify-many >= 0.1.10 + , th-utilities >= 0.2.4.3 + , these >= 1.1.1.1 + , time-compat >= 1.9.6.1 + , transformers-base >= 0.4.6 + , transformers-compat >= 0.7.1 + , type-equality >= 1 + , typed-process >= 0.2.8.0 + , unbounded-delays >= 0.1.1.1 + , universe-base >= 1.1.3 + , unliftio-core >= 0.2.0.1 + , unordered-containers >= 0.2.16.0 + , uuid-types >= 1.0.5 + , vector >= 0.12.3.1 + , vector-algorithms >= 0.8.0.4 + , void >= 0.7.3 + , wcwidth >= 0.0.2 + , witherable >= 0.4.2 + , wl-pprint-annotated >= 0.1.0.1 + , word-array >= 0.1.0.0 + , secp256k1-haskell >= 0.6 + '' else ""; + extraSources = [ + { + src = inputs.protolude; + subdirs = [ "." ]; + } + { + src = inputs.cardano-prelude; + subdirs = [ + "cardano-prelude" + ]; + } + { + src = inputs.cardano-crypto; + subdirs = [ "." ]; + } + { + src = inputs.flat; + subdirs = [ "." ]; + } + { + src = inputs.cardano-base; + subdirs = [ + "binary" + "cardano-crypto-class" + ]; + } + { + src = inputs.plutus; + subdirs = [ + "plutus-core" + "plutus-ledger-api" + "plutus-tx" + "prettyprinter-configurable" + "word-array" + ]; + } + { + src = inputs.secp256k1-haskell; + subdirs = [ "." ]; + } + ] ++ (if isGhc9 o.compiler-nix-name then [{ + src = inputs.inline-r; + subdirs = [ "inline-r" ]; + }] else [{ + src = inputs.Shrinker; + subdirs = [ "." ]; + }]); + }; projectForGhc = ghcName: flagDevelopment: system: let pkgs = nixpkgsFor system; in @@ -417,17 +389,10 @@ if source.src == target then source // { subdirs = source.subdirs ++ [ subdir ]; } else source; in - let pkgSet = (nixpkgsFor system).haskell-nix.cabalProject' ({ + let pkgSet = pkgs.haskell-nix.cabalProject' (applyPlutarchDep pkgs { src = ./.; compiler-nix-name = ghcName; - extraSources = - if ghcName == ghcVersion then extraSources - else map (addSubDir inputs.plutus "plutus-tx-plugin") extraSources - ++ [{ - src = inputs.Shrinker; - subdirs = [ "." ]; - }]; - modules = haskellModules ++ [ + modules = [ { packages.plutarch-test.flags.development = flagDevelopment; packages.plutarch.flags.development = flagDevelopment; @@ -461,9 +426,7 @@ ps.hspec-golden ]; }; - } // (if ghcName == ghcVersion then { - inherit cabalProjectLocal; - } else { })); in + }); in pkgSet; projectFor = projectForGhc ghcVersion; @@ -492,7 +455,7 @@ let pkgs = nixpkgsFor system; sphinxcontrib-haddock = - pkgs.callPackage plutus.inputs.sphinxcontrib-haddock { pythonPackages = pkgs.python3Packages; }; + pkgs.callPackage inputs.plutus.inputs.sphinxcontrib-haddock { pythonPackages = pkgs.python3Packages; }; haddock-combine = pkgs.callPackage "${inputs.plutus}/nix/lib/haddock-combine.nix" { ghc = pkgs.haskell-nix.compiler.${ghcVersion}; inherit (sphinxcontrib-haddock) sphinxcontrib-haddock; @@ -582,7 +545,7 @@ (nixpkgsFor system).runCommand appName { } "${self.apps.${system}.${appName}.program} | tee $out"; in { - inherit extraSources cabalProjectLocal haskellModules tools; + inherit tools applyPlutarchDep; # Build matrix. Plutarch is built against different GHC versions, and 'development' flag. projectMatrix = { diff --git a/plutus-bytestring.patch b/plutus-bytestring.patch new file mode 100644 index 000000000..e909dfd9c --- /dev/null +++ b/plutus-bytestring.patch @@ -0,0 +1,22 @@ +From 5671d4906c545a3e37bab5cc6ea355f45fb9adb7 Mon Sep 17 00:00:00 2001 +From: Las Safin +Date: Mon, 18 Apr 2022 16:30:57 +0000 +Subject: [PATCH] plutus-ledger-api: Hide import of `singleton` + +--- + plutus-ledger-api/src/Plutus/V1/Ledger/Api.hs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plutus-ledger-api/src/Plutus/V1/Ledger/Api.hs b/plutus-ledger-api/src/Plutus/V1/Ledger/Api.hs +index 31f903444f..f5fe77f97e 100644 +--- a/plutus-ledger-api/src/Plutus/V1/Ledger/Api.hs ++++ b/plutus-ledger-api/src/Plutus/V1/Ledger/Api.hs +@@ -119,7 +119,7 @@ import Control.Monad.Except + import Control.Monad.Writer + import Data.Bifunctor + import Data.ByteString.Lazy (fromStrict) +-import Data.ByteString.Short ++import Data.ByteString.Short hiding (singleton) + import Data.Coerce (coerce) + import Data.Either + import Data.SatInt From 0df716575e7c6bcd106fca07ae39bb68c0cde9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Mon, 16 May 2022 11:50:16 -0400 Subject: [PATCH 465/584] Removed -Wredundant-constraints, too many false positives --- plutarch.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plutarch.cabal b/plutarch.cabal index e9a06b69f..765e5081f 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -75,8 +75,8 @@ common c -Wall -Wcompat -Wincomplete-uni-patterns -Wno-unused-do-bind -Wno-partial-type-signatures -Wmissing-export-lists -Werror -Wincomplete-record-updates -Wmissing-deriving-strategies - -Wno-name-shadowing -Wredundant-constraints -Wunused-foralls - -fprint-explicit-foralls -fprint-explicit-kinds + -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls + -fprint-explicit-kinds library import: c From 52476c4101228cc75752ab16266e3664e13c7eb3 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 16 May 2022 22:17:08 +0530 Subject: [PATCH 466/584] Rename `pnonZero'` -> `ptryNonZero` --- Plutarch/NonZero.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plutarch/NonZero.hs b/Plutarch/NonZero.hs index 7f0403548..204fa04c5 100644 --- a/Plutarch/NonZero.hs +++ b/Plutarch/NonZero.hs @@ -1,6 +1,6 @@ {-# LANGUAGE UndecidableInstances #-} -module Plutarch.NonZero (PNonZero, pnonZero, pnonZero') where +module Plutarch.NonZero (PNonZero, pnonZero, ptryNonZero) where import qualified GHC.Generics as GHC import Generics.SOP (Generic, HasDatatypeInfo, I (I)) @@ -35,8 +35,8 @@ pnonZero = phoistAcyclic $ $ pcon . PJust . pcon $ PNonZero i -- | Partial version of 'pnonZero'. Errors if argument is zero. -pnonZero' :: Term s (PInteger :--> PNonZero) -pnonZero' = phoistAcyclic $ +ptryNonZero :: Term s (PInteger :--> PNonZero) +ptryNonZero = phoistAcyclic $ plam $ \i -> pif (i #== 0) From b07d97ae19920fc5d508398fd4d4aed8729c427b Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 16 May 2022 22:59:51 +0530 Subject: [PATCH 467/584] Deduplicate `Flip` --- Plutarch/Builtin.hs | 17 ++++------------- Plutarch/DataRepr/Internal.hs | 7 +------ Plutarch/Reducible.hs | 7 ++++++- .../conditional/Plutarch/TryFromSpec.hs | 7 +------ 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 3b9b5096e..0a8e495e8 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -32,6 +32,7 @@ module Plutarch.Builtin ( ) where import Data.Coerce (Coercible, coerce) +import Data.Functor.Const (Const) import Data.Proxy (Proxy (Proxy)) import Plutarch ( DerivePNewtype, @@ -87,21 +88,16 @@ import Plutarch.List ( pshowList, ptail, ) +import Plutarch.Reducible (Flip) import Plutarch.Show (PShow (pshow'), pshow) +import Plutarch.TermCont (TermCont (runTermCont), tcont, unTermCont) +import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) import Plutarch.Unit (PUnit) import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce, punsafeDowncast) import qualified PlutusCore as PLC import PlutusTx (Data (Constr), ToData) import qualified PlutusTx -import Plutarch.TermCont (TermCont (runTermCont), tcont, unTermCont) - -import Plutarch.Reducible (Reducible (Reduce)) - -import Data.Functor.Const (Const) - -import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) - -- | Plutus 'BuiltinPair' data PBuiltinPair (a :: PType) (b :: PType) (s :: S) @@ -422,11 +418,6 @@ Example: pconstantData :: forall p h s. (ToData h, PLifted p ~ h, PConstanted h ~ p) => h -> Term s (PAsData p) pconstantData x = punsafeCoerce $ pconstant $ PlutusTx.toData x -newtype Flip f a b = Flip (f b a) - -instance Reducible (f x y) => Reducible (Flip f y x) where - type Reduce (Flip f y x) = Reduce (f x y) - instance PTryFrom PData (PAsData PInteger) where type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger ptryFrom' opq = runTermCont $ do diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index dd142f759..5328b1f19 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -131,7 +131,7 @@ import Plutarch.Unit (PUnit (PUnit)) import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import qualified Plutus.V1.Ledger.Api as Ledger -import Plutarch.Reducible (Reduce, Reducible) +import Plutarch.Reducible (Flip, Reduce, Reducible) {- | A "record" of `exists a. PAsData a`. The underlying representation is `PBuiltinList PData`. @@ -668,11 +668,6 @@ newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (HRecGeneric (HRecPAppl instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecGeneric (HRecPApply as s) -newtype Flip f a b = Flip (f b a) - -instance Reducible (f x y) => Reducible (Flip f y x) where - type Reduce (Flip f y x) = Reduce (f x y) - -- We could have a more advanced instance but it's not needed really. newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) diff --git a/Plutarch/Reducible.hs b/Plutarch/Reducible.hs index 70f28dd7c..b632326e3 100644 --- a/Plutarch/Reducible.hs +++ b/Plutarch/Reducible.hs @@ -1,5 +1,5 @@ -- FIXME: This should be its own package as it's not related to Plutarch at all. -module Plutarch.Reducible (Reducible (Reduce)) where +module Plutarch.Reducible (Reducible (Reduce), Flip (Flip)) where import Data.Coerce (Coercible) import Data.Functor.Const (Const (Const)) @@ -15,3 +15,8 @@ instance Reducible a => Reducible (Const a b) where instance Reducible a => Reducible (Identity a) where type Reduce (Identity a) = Reduce a + +newtype Flip f a b = Flip (f b a) + +instance Reducible (f x y) => Reducible (Flip f y x) where + type Reduce (Flip f y x) = Reduce (f x y) diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index efc6ace53..55daa2d96 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -51,7 +51,7 @@ import Plutarch.TryFrom ( ptryFrom', ) -import Plutarch.Reducible (Reduce, Reducible) +import Plutarch.Reducible (Flip) import Plutarch.ApiSpec (invalidContext1, validContext0) import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) @@ -271,11 +271,6 @@ newtype PNatural (s :: S) = PMkNatural (Term s PInteger) pmkNatural :: Term s (PInteger :--> PNatural) pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) -newtype Flip f b a = Flip (f a b) - -instance Reducible (f a b) => Reducible (Flip f b a) where - type Reduce (Flip f b a) = Reduce (f a b) - instance PTryFrom PData (PAsData PNatural) where type PTryFromExcess PData (PAsData PNatural) = Flip Term PNatural ptryFrom' opq = runTermCont $ do From 88916a081d8b0276ba3af3b380f495afa9f06aff Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Mon, 16 May 2022 23:01:07 +0530 Subject: [PATCH 468/584] `PTryFrom` instances for `PNonZero` --- Plutarch/NonZero.hs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Plutarch/NonZero.hs b/Plutarch/NonZero.hs index 204fa04c5..bda7cda9e 100644 --- a/Plutarch/NonZero.hs +++ b/Plutarch/NonZero.hs @@ -2,10 +2,12 @@ module Plutarch.NonZero (PNonZero, pnonZero, ptryNonZero) where +import Data.Functor.Const (Const) import qualified GHC.Generics as GHC import Generics.SOP (Generic, HasDatatypeInfo, I (I)) + import Plutarch.Bool (PEq, POrd, pif, (#==)) -import Plutarch.Builtin (PIsData) +import Plutarch.Builtin (PAsData, PData, PIsData, pdata) import Plutarch.Integer (PInteger, PIntegral) import Plutarch.Internal.Other ( DerivePNewtype (DerivePNewtype), @@ -14,17 +16,33 @@ import Plutarch.Internal.Other ( pcon, phoistAcyclic, plam, + plet, + (#), type (:-->), ) import Plutarch.Maybe (PMaybe (PJust, PNothing)) +import Plutarch.Reducible (Flip) import Plutarch.Show (PShow) +import Plutarch.TermCont (runTermCont, tcont) import Plutarch.Trace (ptraceError) +import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom'), ptryFrom) newtype PNonZero s = PNonZero (Term s PInteger) deriving stock (GHC.Generic) deriving anyclass (Generic, HasDatatypeInfo, PShow) deriving (PlutusType, PIsData, PEq, POrd, PIntegral) via (DerivePNewtype PNonZero PInteger) +instance PTryFrom PInteger PNonZero where + type PTryFromExcess PInteger PNonZero = Const () + ptryFrom' opq = runTermCont $ pure (ptryNonZero # opq, ()) + +instance PTryFrom PData (PAsData PNonZero) where + type PTryFromExcess PData (PAsData PNonZero) = Flip Term PNonZero + ptryFrom' opq = runTermCont $ do + (_, i) <- tcont $ ptryFrom @(PAsData PInteger) opq + res <- tcont . plet $ ptryNonZero # i + pure (pdata res, res) + -- | Build a 'PNonZero' from a 'PInteger'. Yields 'PNothing' if argument is zero. pnonZero :: Term s (PInteger :--> PMaybe PNonZero) pnonZero = phoistAcyclic $ From 0ea3b7c990952d7b8e2238265a32da73d456d5f9 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 17 May 2022 12:23:34 +0530 Subject: [PATCH 469/584] Unexport `PRational` constructor... And add supplementary functions --- Plutarch/Rational.hs | 52 ++++++++++++------- .../goldens/rational.dev=false.uplc.golden | 40 +++++++------- .../goldens/rational.dev=true.uplc.golden | 40 +++++++------- .../goldens/show.dev=false.uplc.golden | 2 +- .../goldens/show.dev=true.uplc.golden | 2 +- 5 files changed, 76 insertions(+), 60 deletions(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 48a39e1cc..067f2255d 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -1,5 +1,5 @@ module Plutarch.Rational ( - PRational (..), + PRational, preduce, pnumerator, pdenominator, @@ -7,7 +7,9 @@ module Plutarch.Rational ( pround, ptruncate, pproperFraction, - pratLazy, + prationalLazy, + prational, + punrational, ) where import Data.Ratio (denominator, numerator) @@ -53,17 +55,30 @@ data PRational s deriving stock (GHC.Generic) deriving anyclass (Generic, PEq) +{- | NOTE: This instance may delegate the nonzero invariant check during construction. + +As such, the constructor is not exported and users are expected to use 'prational', 'prationalLazy', and +'punrational' instead. +-} instance PlutusType PRational where type PInner PRational b = (PInteger :--> PNonZero :--> b) :--> b - pcon' (PRational x y') = plet y' $ \y -> plam $ \f -> f # x # y + pcon' (PRational x y) = plam $ \f -> f # x # y pmatch' ratF f = ratF #$ plam $ \a b -> f $ PRational a b {- | Builds a rational with lazy non-zero denominator verification. i.e, if the denominator was zero, it'll error only after 'pmatch'ing on the resulting rational. -} -pratLazy :: Term s PInteger -> Term s PNonZero -> Term s PRational -pratLazy numr denm = punsafeDowncast $ plam $ \f -> f # numr # denm +prationalLazy :: Term s PInteger -> Term s PNonZero -> Term s PRational +prationalLazy numr denm = pcon $ PRational numr denm + +-- | Build a rational, without delegating the denominator invariant. +prational :: Term s (PInteger :--> PNonZero :--> PRational) +prational = phoistAcyclic $ plam $ \numr denm -> pcon $ PRational numr denm + +-- | 'pmatch' specialized for 'PRational'. +punrational :: Term s PRational -> ((Term s PInteger, Term s PNonZero) -> Term s b) -> Term s b +punrational r f = pmatch r $ \(PRational x y) -> f (x, y) instance PShow PRational where pshow' _ x = @@ -76,7 +91,7 @@ instance PShow PRational where instance PIsData PRational where pfromDataImpl x' = phoistAcyclic (plam $ \x -> plistToRat #$ pasList # pforgetData x) # x' where - plistToRat = plam $ \x -> pratLazy (pasInt #$ phead # x) $ punsafeDowncast $ pasInt #$ phead #$ ptail # x + plistToRat = plam $ \x -> prationalLazy (pasInt #$ phead # x) $ punsafeDowncast $ pasInt #$ phead #$ ptail # x pdataImpl x' = phoistAcyclic ( plam $ \x -> unTermCont $ do @@ -118,7 +133,7 @@ instance Num (Term s PRational) where yd <- tcont $ plet yd' pure $ preduce - #$ pratLazy (xn * pto yd + yn * pto xd) + #$ prationalLazy (xn * pto yd + yn * pto xd) $ punsafeDowncast $ pto xd * pto yd ) # x' @@ -133,7 +148,7 @@ instance Num (Term s PRational) where yd <- tcont $ plet yd' pure $ preduce - #$ pratLazy (xn * pto yd - yn * pto xd) + #$ prationalLazy (xn * pto yd - yn * pto xd) $ punsafeDowncast $ pto xd * pto yd ) # x' @@ -146,7 +161,7 @@ instance Num (Term s PRational) where PRational yn yd <- tcont $ pmatch y pure $ preduce - #$ pratLazy (xn * yn) + #$ prationalLazy (xn * yn) $ punsafeDowncast $ pto xd * pto yd ) # x' @@ -156,7 +171,7 @@ instance Num (Term s PRational) where phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - pratLazy (negate xn) xd + prationalLazy (negate xn) xd ) # x' @@ -164,7 +179,7 @@ instance Num (Term s PRational) where phoistAcyclic ( plam $ \x -> pmatch x $ \(PRational xn xd) -> - pratLazy (abs xn) $ punsafeDowncast $ abs $ pto xd + prationalLazy (abs xn) $ punsafeDowncast $ abs $ pto xd ) # x' @@ -181,14 +196,14 @@ instance Num (Term s PRational) where ) # x' - fromInteger n = pratLazy (pconstant n) $ punsafeDowncast 1 + fromInteger n = prationalLazy (pconstant n) $ punsafeDowncast 1 instance Fractional (Term s PRational) where recip x' = phoistAcyclic ( plam $ \x -> - pmatch x $ \(PRational xn xd) -> - pcon . PRational (pto xd) $ ptryNonZero # xn + pmatch x $ \(PRational xn xd) -> plet (ptryNonZero # xn) $ \denm -> + prationalLazy (pto xd) denm ) # x' @@ -197,13 +212,14 @@ instance Fractional (Term s PRational) where ( plam $ \x y -> unTermCont $ do PRational xn xd <- tcont $ pmatch x PRational yn yd <- tcont $ pmatch y - pure $ preduce #$ pcon . PRational (xn * pto yd) $ ptryNonZero #$ pto xd * yn + denm <- tcont . plet $ ptryNonZero #$ pto xd * yn + pure $ preduce #$ prationalLazy (xn * pto yd) denm ) # x' # y' fromRational r = - pratLazy (pconstant $ numerator r) $ punsafeDowncast $ pconstant $ denominator r + prationalLazy (pconstant $ numerator r) $ punsafeDowncast $ pconstant $ denominator r preduce :: Term s (PRational :--> PRational) preduce = phoistAcyclic $ @@ -212,7 +228,7 @@ preduce = phoistAcyclic $ xd <- tcont . plet $ pto xd' r <- tcont . plet $ pgcd # xn # xd s <- tcont . plet . signum $ xd - pure . pratLazy (s * pdiv # xn # r) $ punsafeDowncast $ s * pdiv # xd # r + pure . prationalLazy (s * pdiv # xn # r) $ punsafeDowncast $ s * pdiv # xd # r pgcd :: Term s (PInteger :--> PInteger :--> PInteger) pgcd = phoistAcyclic $ @@ -244,7 +260,7 @@ pdenominator :: Term s (PRational :--> PNonZero) pdenominator = phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational _ d) -> d pfromInteger :: Term s (PInteger :--> PRational) -pfromInteger = phoistAcyclic $ plam $ \n -> pratLazy n $ punsafeDowncast 1 +pfromInteger = phoistAcyclic $ plam $ \n -> prationalLazy n $ punsafeDowncast 1 pround :: Term s (PRational :--> PInteger) pround = phoistAcyclic $ diff --git a/plutarch-test/goldens/rational.dev=false.uplc.golden b/plutarch-test/goldens/rational.dev=false.uplc.golden index b78485d21..d96ef65ad 100644 --- a/plutarch-test/goldens/rational.dev=false.uplc.golden +++ b/plutarch-test/goldens/rational.dev=false.uplc.golden @@ -1,24 +1,24 @@ literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (equalsInteger i2 0) (delay error) (delay i2))))) (\i0 -> i1 0 1))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i14 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force ifThenElse))) \ No newline at end of file +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i14 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.uplc.golden b/plutarch-test/goldens/rational.dev=true.uplc.golden index 9ae21504f..f07e9666c 100644 --- a/plutarch-test/goldens/rational.dev=true.uplc.golden +++ b/plutarch-test/goldens/rational.dev=true.uplc.golden @@ -1,24 +1,24 @@ literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) (i13 (multiplyInteger i3 i2))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i12 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (equalsInteger i2 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i2))))) (\i0 -> i1 0 1))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i14 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force ifThenElse))) \ No newline at end of file +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i14 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.uplc.golden b/plutarch-test/goldens/show.dev=false.uplc.golden index f086b8cb2..a69a53a74 100644 --- a/plutarch-test/goldens/show.dev=false.uplc.golden +++ b/plutarch-test/goldens/show.dev=false.uplc.golden @@ -1 +1 @@ -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i26 (equalsInteger i2 0) (delay 0) (delay (force (i26 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> i26 (\i0 -> \i0 -> \i0 -> force (i30 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i27 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i27 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i26 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i25 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i23 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i27 (equalsInteger i2 0) (delay 0) (delay (force (i27 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> i27 (\i0 -> \i0 -> \i0 -> force (i31 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i28 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i28 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i27 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i26 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i23 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.uplc.golden b/plutarch-test/goldens/show.dev=true.uplc.golden index 9f895c428..69b5a3e5a 100644 --- a/plutarch-test/goldens/show.dev=true.uplc.golden +++ b/plutarch-test/goldens/show.dev=true.uplc.golden @@ -1 +1 @@ -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i26 (equalsInteger i2 0) (delay 0) (delay (force (i26 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> i26 (\i0 -> \i0 -> \i0 -> force (i30 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i27 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i27 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i26 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i25 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) ((\i0 -> \i0 -> i1 (multiplyInteger i6 i3) i2) ((\i0 -> force (i23 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2)))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i27 (equalsInteger i2 0) (delay 0) (delay (force (i27 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> i27 (\i0 -> \i0 -> \i0 -> force (i31 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i28 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i28 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i27 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i26 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i23 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file From 3ca3ef42f1f8a0ce1625ad80254e4feb396b112f Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 17 May 2022 13:13:01 +0530 Subject: [PATCH 470/584] `TryFrom` instance for `PRational` and cleanup --- Plutarch/NonZero.hs | 3 ++- Plutarch/Prelude.hs | 3 ++- Plutarch/Rational.hs | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Plutarch/NonZero.hs b/Plutarch/NonZero.hs index bda7cda9e..36a9817c6 100644 --- a/Plutarch/NonZero.hs +++ b/Plutarch/NonZero.hs @@ -41,7 +41,8 @@ instance PTryFrom PData (PAsData PNonZero) where ptryFrom' opq = runTermCont $ do (_, i) <- tcont $ ptryFrom @(PAsData PInteger) opq res <- tcont . plet $ ptryNonZero # i - pure (pdata res, res) + resData <- tcont . plet $ pdata res + pure (resData, res) -- | Build a 'PNonZero' from a 'PInteger'. Yields 'PNothing' if argument is zero. pnonZero :: Term s (PInteger :--> PMaybe PNonZero) diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 2b13ace67..a63982521 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -30,9 +30,10 @@ module Plutarch.Prelude ( -- * Rational numbers and utilities PRational, + prational, + punrational, pnumerator, pdenominator, - pfromInteger, pround, -- * Booleans and boolean functions diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 067f2255d..02b173365 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -25,6 +25,7 @@ import Plutarch ( plet, pmatch, pto, + runTermCont, (#), (#$), type (:-->), @@ -33,6 +34,7 @@ import Plutarch.Bool (PEq, POrd, pif, (#<), (#<=), (#==)) import Plutarch.Builtin ( PAsData, PBuiltinList, + PData, PIsData, pasInt, pasList, @@ -43,11 +45,14 @@ import Plutarch.Builtin ( ) import Plutarch.Integer (PInteger, pdiv, pmod) import Plutarch.Lift (pconstant) -import Plutarch.List (pcons, phead, pnil, ptail) +import Plutarch.List (pcons, phead, plength, pnil, ptail) import Plutarch.NonZero (PNonZero, ptryNonZero) import Plutarch.Pair (PPair (PPair)) +import Plutarch.Reducible import Plutarch.Show (PShow, pshow, pshow') import Plutarch.TermCont (tcont, unTermCont) +import Plutarch.Trace +import Plutarch.TryFrom import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) data PRational s @@ -102,6 +107,16 @@ instance PIsData PRational where ) # x' +-- | NOTE: This instance produces a verified 'PNonZero' as the excess output. +instance PTryFrom PData (PAsData PRational) where + type PTryFromExcess PData (PAsData PRational) = Flip Term PNonZero + ptryFrom' opq = runTermCont $ do + (_, ld) <- tcont $ ptryFrom @(PAsData (PBuiltinList PData)) opq + tcont $ \f -> pif (plength # ld #== 2) (f ()) (ptraceError "ptryFrom(PRational): data list length should be 2") + (_, denm) <- tcont $ ptryFrom @(PAsData PInteger) $ phead #$ ptail # ld + res <- tcont . plet $ ptryNonZero # denm + pure (punsafeCoerce opq, res) + instance POrd PRational where l' #<= r' = phoistAcyclic From 2f66f929e3796b0582177fcf89497b72d269dd66 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 17 May 2022 13:18:16 +0530 Subject: [PATCH 471/584] `TryFrom` tests for `PRational` --- .../conditional/Plutarch/TryFromSpec.hs | 53 +++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 55daa2d96..3ef8a3da3 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -51,16 +51,17 @@ import Plutarch.TryFrom ( ptryFrom', ) -import Plutarch.Reducible (Flip) +import Plutarch.Reducible (Flip, Reducible (Reduce)) import Plutarch.ApiSpec (invalidContext1, validContext0) import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) +import Plutarch.Extra.TermCont import Test.Hspec spec :: Spec spec = do - describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "data-verif" . plutarchDevFlagDescribe . pgoldenSpec $ do "erroneous" @\ do "(String, Integer) /= (String, String)" @| checkDeep @@ -94,6 +95,30 @@ spec = do @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) (punsafeCoerce $ pconstant $ Constr 2 [PlutusTx.I 5, B "foo"]) @-> pfails + "[ByteString] (with length == 2) /= PRational" + @| checkDeep + @PRational + @(PBuiltinList (PAsData PByteString)) + (pdata $ pcons # pdata (phexByteStr "41") #$ pcons # pdata (phexByteStr "2b") # pnil) + @-> pfails + "[Integer] (with length == 0) /= PRational" + @| checkDeep + @PRational + @(PBuiltinList (PAsData PInteger)) + (pdata $ pnil) + @-> pfails + "[Integer] (with length == 3) /= PRational" + @| checkDeep + @PRational + @(PBuiltinList (PAsData PInteger)) + (pdata $ pcons # pconstantData 42 #$ pcons # pconstantData 7 #$ pcons # pconstantData 0 # pnil) + @-> pfails + "[Integer] (with length == 2, with 0 denominator) /= PRational" + @| checkDeep + @PRational + @(PBuiltinList (PAsData PInteger)) + (pdata $ pcons # pconstantData 42 #$ pcons # pconstantData 0 # pnil) + @-> pfails "working" @\ do "(String, String) == (String, String)" @| checkDeep @@ -107,6 +132,18 @@ spec = do @(PBuiltinList (PAsData PByteString)) (pdata $ (pcons # (pdata $ pconstant "foo")) #$ (psingleton # (pdata $ pconstant "bar"))) @-> psucceeds + "[Integer] (with length == 2) == PRational" + @| ( unTermCont $ do + let numr = pconstantData 42 + let denm = pconstantData 31 + (drat, nz) <- + checkDeep' @PRational @(PBuiltinList (PAsData PInteger)) + (pdata $ pcons # numr #$ pcons # denm # pnil) + pguardC "non-zero should be as expected" $ pto nz #== pfromData denm + pguardC "drat should be as expected" $ pfromData drat #== prational # pfromData numr # nz + pure $ pconstant () + ) + @-> psucceeds "A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer }" @| checkDeep @(PDataRecord (("foo" ':= PInteger) ': ("bar" ':= PInteger) ': '[])) @@ -237,7 +274,17 @@ checkDeep :: ) => ClosedTerm (PAsData actual) -> ClosedTerm (PAsData target) -checkDeep t = unTermCont $ fst <$> TermCont (ptryFrom @(PAsData target) $ pforgetData t) +checkDeep t = unTermCont $ fst <$> checkDeep' t + +checkDeep' :: + forall (target :: PType) (actual :: PType) (s :: S). + ( PTryFrom PData (PAsData target) + , PIsData actual + , PIsData target + ) => + ClosedTerm (PAsData actual) -> + TermCont s ((Term s (PAsData target), Reduce (PTryFromExcess PData (PAsData target) s))) +checkDeep' t = TermCont (ptryFrom @(PAsData target) $ pforgetData t) checkDeepUnwrap :: forall (target :: PType) (actual :: PType) (s :: S). From 33aceffafa1bb62babe935fdd0d94465e48a9b73 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 17 May 2022 13:23:43 +0530 Subject: [PATCH 472/584] Actually run `TryFromSpec` tests --- plutarch-test/Main.hs | 2 ++ .../conditional/Plutarch/TryFromSpec.hs | 2 +- .../goldens/data-verif.dev=false.bench.golden | 31 +++++++++++++++++++ .../data-verif.dev=false.uplc.eval.golden | 31 +++++++++++++++++++ .../goldens/data-verif.dev=false.uplc.golden | 31 +++++++++++++++++++ .../goldens/data-verif.dev=true.bench.golden | 31 +++++++++++++++++++ .../data-verif.dev=true.uplc.eval.golden | 31 +++++++++++++++++++ .../goldens/data-verif.dev=true.uplc.golden | 31 +++++++++++++++++++ 8 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 plutarch-test/goldens/data-verif.dev=false.bench.golden create mode 100644 plutarch-test/goldens/data-verif.dev=false.uplc.eval.golden create mode 100644 plutarch-test/goldens/data-verif.dev=false.uplc.golden create mode 100644 plutarch-test/goldens/data-verif.dev=true.bench.golden create mode 100644 plutarch-test/goldens/data-verif.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/data-verif.dev=true.uplc.golden diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 8edbf31ae..1294f91c5 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -8,6 +8,7 @@ import qualified ExtraSpec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) import qualified Plutarch.FieldSpec as FieldSpec import qualified Plutarch.MonadicSpec as MonadicSpec +import qualified Plutarch.TryFromSpec as TryFromSpec import Plutarch.Test.Run (noUnusedGoldens, hspecAndReturnForest) import Test.Hspec (Spec, describe) #else @@ -38,6 +39,7 @@ spec = do describe "GHC-9-only" $ do FieldSpec.spec MonadicSpec.spec + TryFromSpec.spec #else describe "GHC-8-only" $ do FFISpec.spec diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index efc6ace53..6f801930e 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -60,7 +60,7 @@ import Test.Hspec spec :: Spec spec = do - describe "verification_untrusted_data" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "data-verif" . plutarchDevFlagDescribe . pgoldenSpec $ do "erroneous" @\ do "(String, Integer) /= (String, String)" @| checkDeep diff --git a/plutarch-test/goldens/data-verif.dev=false.bench.golden b/plutarch-test/goldens/data-verif.dev=false.bench.golden new file mode 100644 index 000000000..e138d9741 --- /dev/null +++ b/plutarch-test/goldens/data-verif.dev=false.bench.golden @@ -0,0 +1,31 @@ +erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} +erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":97} +erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} +erroneous.PDataSum constr 2 {"exBudgetCPU":587969,"exBudgetMemory":198,"scriptSizeBytes":92} +erroneous.PDataSum wrong record type {"exBudgetCPU":725838,"exBudgetMemory":200,"scriptSizeBytes":145} +working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} +working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":5439216,"exBudgetMemory":9876,"scriptSizeBytes":90} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":5439216,"exBudgetMemory":9876,"scriptSizeBytes":90} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":5528535,"exBudgetMemory":10176,"scriptSizeBytes":97} +working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} +working.PDataSum constr 0 {"exBudgetCPU":4496177,"exBudgetMemory":10022,"scriptSizeBytes":145} +working.PDataSum constr 1 {"exBudgetCPU":4991322,"exBudgetMemory":11224,"scriptSizeBytes":145} +working.recover PWrapInt {"exBudgetCPU":705925,"exBudgetMemory":1065,"scriptSizeBytes":15} +recovering a record partially vs completely.partially {"exBudgetCPU":5229670,"exBudgetMemory":9644,"scriptSizeBytes":92} +recovering a record partially vs completely.completely {"exBudgetCPU":5528535,"exBudgetMemory":10176,"scriptSizeBytes":96} +removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} +removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} +removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} +removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} +removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} +removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} +removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":6006038,"exBudgetMemory":11308,"scriptSizeBytes":100} +removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":100} +removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":5096176,"exBudgetMemory":10149,"scriptSizeBytes":90} +example.concatenate two lists, legal {"exBudgetCPU":54126198,"exBudgetMemory":103259,"scriptSizeBytes":700} +example.concatenate two lists, illegal (list too short) {"exBudgetCPU":47367778,"exBudgetMemory":84633,"scriptSizeBytes":694} +example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":48647966,"exBudgetMemory":84859,"scriptSizeBytes":700} +example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35022714,"exBudgetMemory":63352,"scriptSizeBytes":721} +example2.recovering a record succeeds {"exBudgetCPU":7157324,"exBudgetMemory":14242,"scriptSizeBytes":227} \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=false.uplc.eval.golden b/plutarch-test/goldens/data-verif.dev=false.uplc.eval.golden new file mode 100644 index 000000000..7a6315f76 --- /dev/null +++ b/plutarch-test/goldens/data-verif.dev=false.uplc.eval.golden @@ -0,0 +1,31 @@ +erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) +erroneous.[String] /= [Integer] (program 1.0.0 error) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 error) +erroneous.Map Int String /= Map Int Int (program 1.0.0 error) +erroneous.PDataSum constr 2 (program 1.0.0 error) +erroneous.PDataSum wrong record type (program 1.0.0 error) +working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) +working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) +working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) +working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) +working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) +working.recover PWrapInt (program 1.0.0 True) +recovering a record partially vs completely.partially (program 1.0.0 #9f034362617aff) +recovering a record partially vs completely.completely (program 1.0.0 #9f034362617aff) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) +removing the data wrapper.working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) +removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 #9f9f182affff) +removing the data wrapper.recovering a nested record.fails (program 1.0.0 error) +removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 True) +example.concatenate two lists, legal (program 1.0.0 ()) +example.concatenate two lists, illegal (list too short) (program 1.0.0 error) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 error) +example2.recovering a record succeeds (program 1.0.0 #d8799f0443666f6fff) \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=false.uplc.golden b/plutarch-test/goldens/data-verif.dev=false.uplc.golden new file mode 100644 index 000000000..1a99db26e --- /dev/null +++ b/plutarch-test/goldens/data-verif.dev=false.uplc.golden @@ -0,0 +1,31 @@ +erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay error)))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i3)) (force tailList)) (force headList)) #d87a9f0543666f6fff)) +erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unBData i1)) (i7 i1))) (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i5)) (force ifThenElse)) (force (force chooseList))) (force tailList)) (force headList)) #d87b9f0543666f6fff)) +working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i5)) (force ifThenElse)) (force (force chooseList))) (force tailList)) (force headList)) #d8799f0543666f6fff)) +working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i5)) (force ifThenElse)) (force (force chooseList))) (force tailList)) (force headList)) #d87a9f0543666f6fff)) +working.recover PWrapInt (program 1.0.0 (equalsInteger 42 (unIData (iData 42)))) +recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (iData 3) (i10 (bData i11) i12))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i6 i2)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 3) (i11 (bData i12) i13))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unBData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) +removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i13 (listData (i13 (iData 42) i14)) i14)) (force (i9 i1 (delay ()) (delay error)))) (i9 i7)) (force (i7 i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (unListData i1)) (i4 i1)) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5)))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i13 (listData (i13 (iData 42) i14)) i14)) (force (i9 i1 (delay ()) (delay error)))) (i9 i7)) (force (i7 i1 (delay ()) (delay error)))) (i7 i3)) (unBData i1)) (i6 i1)) (unListData i1)) (i4 i1)) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5)))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (force (i9 i1 (delay ()) (delay error)))) (i9 i7)) (force (i7 i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (unListData i1)) (i4 i1)) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5))))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) i10))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 8) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) +example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i9 (iData 4) (i9 (bData i10) i11))) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 i1 (delay i14) (delay (i12 (i3 (i11 i1)) (i2 (i10 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (i7 i1))) (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData (constrData 0 (i5 (iData 4) (i5 (bData i6) i7))))) (force ifThenElse)) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) #666f6f) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=true.bench.golden b/plutarch-test/goldens/data-verif.dev=true.bench.golden new file mode 100644 index 000000000..f23dae053 --- /dev/null +++ b/plutarch-test/goldens/data-verif.dev=true.bench.golden @@ -0,0 +1,31 @@ +erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} +erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":128} +erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} +erroneous.PDataSum constr 2 {"exBudgetCPU":737969,"exBudgetMemory":230,"scriptSizeBytes":197} +erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":256} +working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} +working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":5439216,"exBudgetMemory":9876,"scriptSizeBytes":122} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":5439216,"exBudgetMemory":9876,"scriptSizeBytes":122} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":5528535,"exBudgetMemory":10176,"scriptSizeBytes":128} +working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} +working.PDataSum constr 0 {"exBudgetCPU":4704588,"exBudgetMemory":10722,"scriptSizeBytes":256} +working.PDataSum constr 1 {"exBudgetCPU":5199733,"exBudgetMemory":11924,"scriptSizeBytes":256} +working.recover PWrapInt {"exBudgetCPU":705925,"exBudgetMemory":1065,"scriptSizeBytes":15} +recovering a record partially vs completely.partially {"exBudgetCPU":5229670,"exBudgetMemory":9644,"scriptSizeBytes":124} +recovering a record partially vs completely.completely {"exBudgetCPU":5528535,"exBudgetMemory":10176,"scriptSizeBytes":128} +removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} +removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} +removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} +removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} +removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} +removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} +removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":6214449,"exBudgetMemory":12008,"scriptSizeBytes":142} +removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":142} +removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":5304587,"exBudgetMemory":10849,"scriptSizeBytes":132} +example.concatenate two lists, legal {"exBudgetCPU":54902566,"exBudgetMemory":104923,"scriptSizeBytes":1096} +example.concatenate two lists, illegal (list too short) {"exBudgetCPU":47817778,"exBudgetMemory":84729,"scriptSizeBytes":1089} +example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":55052566,"exBudgetMemory":104955,"scriptSizeBytes":1096} +example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35172714,"exBudgetMemory":63384,"scriptSizeBytes":1117} +example2.recovering a record succeeds {"exBudgetCPU":7365735,"exBudgetMemory":14942,"scriptSizeBytes":341} \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=true.uplc.eval.golden b/plutarch-test/goldens/data-verif.dev=true.uplc.eval.golden new file mode 100644 index 000000000..7a6315f76 --- /dev/null +++ b/plutarch-test/goldens/data-verif.dev=true.uplc.eval.golden @@ -0,0 +1,31 @@ +erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) +erroneous.[String] /= [Integer] (program 1.0.0 error) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 error) +erroneous.Map Int String /= Map Int Int (program 1.0.0 error) +erroneous.PDataSum constr 2 (program 1.0.0 error) +erroneous.PDataSum wrong record type (program 1.0.0 error) +working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) +working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) +working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) +working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) +working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) +working.recover PWrapInt (program 1.0.0 True) +recovering a record partially vs completely.partially (program 1.0.0 #9f034362617aff) +recovering a record partially vs completely.completely (program 1.0.0 #9f034362617aff) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) +removing the data wrapper.working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) +removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) +removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 #9f9f182affff) +removing the data wrapper.recovering a nested record.fails (program 1.0.0 error) +removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 True) +example.concatenate two lists, legal (program 1.0.0 ()) +example.concatenate two lists, illegal (list too short) (program 1.0.0 error) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 error) +example2.recovering a record succeeds (program 1.0.0 #d8799f0443666f6fff) \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=true.uplc.golden b/plutarch-test/goldens/data-verif.dev=true.uplc.golden new file mode 100644 index 000000000..cc6df7795 --- /dev/null +++ b/plutarch-test/goldens/data-verif.dev=true.uplc.golden @@ -0,0 +1,31 @@ +erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i8) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay (force (i12 "list is longer than zero" (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i4)) (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) +erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unBData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87b9f0543666f6fff)) +working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) +working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d8799f0543666f6fff)) +working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) +working.recover PWrapInt (program 1.0.0 (equalsInteger 42 (unIData (iData 42)))) +recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (iData 3) (i10 (bData i11) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i6 i2)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 3) (i11 (bData i12) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unBData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) +removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) +removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) +removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) +removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i15 (listData (i15 (iData 42) i16)) i16)) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unIData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force trace)) "list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i15 (listData (i15 (iData 42) i16)) i16)) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force trace)) "list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unIData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7))))) (force (force chooseList))) (force trace)) "list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:355:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:305:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:296:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:355:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:305:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:296:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:355:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:305:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:296:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:355:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:305:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:296:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i11 (iData 4) (i11 (bData i12) i13))) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i12 i1 (delay ()) (delay (force (i15 i11 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i12 i1 (delay ()) (delay (force (i15 i11 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i10 i1 (delay i16) (delay (i14 (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData (constrData 0 (i7 (iData 4) (i7 (bData i8) i9))))) (force ifThenElse)) "list is longer than zero") (force (force chooseList))) (force tailList)) (force headList)) (force trace)) (force mkCons)) #666f6f) [ ])) \ No newline at end of file From 219eb4793df16eb5e7dc0a447d871688db31e082 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 17 May 2022 14:45:28 +0530 Subject: [PATCH 473/584] Amend `pconstant` law --- Plutarch/Lift.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index c7494f9fb..ee5e7a6c0 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -62,7 +62,7 @@ This typeclass is closely tied with 'PLift'. Laws: - @pconstantFromRepr . pconstantToRepr ≡ Just@ - @(pconstantToRepr <$>) . pconstantFromRepr ≡ Just@ - - @plift . pfromData . punsafeCoerce . pconstant . PlutusTx.toData ≡ id@ + - @plift . pfromData . flip ptryFrom fst . pconstant . PlutusTx.toData ≡ id@ - @PlutusTx.fromData . plift . pforgetData . pdata . pconstant ≡ Just@ These laws must be upheld for the sake of soundness of the type system. From ecad1cb59c906544316dd03afccf7dd77cc3b9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 18 May 2022 09:06:26 -0400 Subject: [PATCH 474/584] Allow the PTxInfo.mint field to contain zero Ada --- Plutarch/Api/V1/Contexts.hs | 4 ++-- plutarch-test/goldens/api.ctx.bench.golden | 2 +- plutarch-test/goldens/api.ctx.uplc.golden | 2 +- plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 9 +++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index aece5089e..2f9ce9b6a 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -23,7 +23,7 @@ import Plutarch.Api.V1.Time (PPOSIXTimeRange) import Plutarch.Api.V1.Tuple (PTuple) import Plutarch.Api.V1.Tx (PTxId, PTxInInfo, PTxOut, PTxOutRef) import Plutarch.Api.V1.Value ( - AmountGuarantees (NonZero, Positive), + AmountGuarantees (NoGuarantees, Positive), KeyGuarantees (Sorted), PCurrencySymbol, PValue, @@ -49,7 +49,7 @@ newtype PTxInfo (s :: S) '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- Transaction inputs , "outputs" ':= PBuiltinList (PAsData PTxOut) -- Transaction outputs , "fee" ':= PValue 'Sorted 'Positive -- The fee paid by this transaction. - , "mint" ':= PValue 'Sorted 'NonZero -- The value minted by the transaction. + , "mint" ':= PValue 'Sorted 'NoGuarantees -- The value minted by the transaction. , "dcert" ':= PBuiltinList (PAsData PDCert) -- Digests of the certificates included in this transaction. , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- Staking withdrawals , "validRange" ':= PPOSIXTimeRange -- The valid range for the transaction. diff --git a/plutarch-test/goldens/api.ctx.bench.golden b/plutarch-test/goldens/api.ctx.bench.golden index 46308ed55..8044cf1de 100644 --- a/plutarch-test/goldens/api.ctx.bench.golden +++ b/plutarch-test/goldens/api.ctx.bench.golden @@ -2,6 +2,6 @@ term {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":140} get.txInfo {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} get.mint {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} get.credentials {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} -get.sym {"exBudgetCPU":3825799,"exBudgetMemory":6816,"scriptSizeBytes":188} +get.sym {"exBudgetCPU":14262910,"exBudgetMemory":30823,"scriptSizeBytes":337} ScriptPurpose.literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":48} ScriptPurpose.decode {"exBudgetCPU":1570478,"exBudgetMemory":3498,"scriptSizeBytes":74} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.uplc.golden b/plutarch-test/goldens/api.ctx.uplc.golden index 490acea63..6d232dd12 100644 --- a/plutarch-test/goldens/api.ctx.uplc.golden +++ b/plutarch-test/goldens/api.ctx.uplc.golden @@ -2,6 +2,6 @@ term (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9 get.txInfo (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) get.mint (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) get.credentials (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (i5 i1)) (i2 (i4 i1))))))) (\i0 -> i3 (i5 (unConstrData ((\i0 -> i4 (i5 i1)) ((\i0 -> i4 (i5 i1)) (i3 (i2 (i4 i1)))))))) ((\i0 -> unListData (i3 (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -get.sym (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> force (force fstPair) (i3 i1)) (unMapData ((\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +get.sym (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> i7 (i10 i1)) ((\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i10 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i10 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) (unMapData ((\i0 -> i10 ((\i0 -> i10 (i10 (i10 i1))) (i11 i1))) ((\i0 -> i10 (i11 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)))))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i7) (delay ((\i0 -> i5 (i15 (i13 i2)) (\i0 -> i10 (mkPairData (i11 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force (force fstPair))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) ScriptPurpose.literal (program 1.0.0 #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff) ScriptPurpose.decode (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 8e2243809..99b0d7d4c 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -24,7 +24,7 @@ import qualified Plutus.V1.Ledger.Value as Value import PlutusTx.Monoid (inv) import Plutarch.Api.V1 ( - AmountGuarantees (NonZero, Positive), + AmountGuarantees (NoGuarantees, NonZero, Positive), KeyGuarantees (Sorted), PCredential, PCurrencySymbol, @@ -57,8 +57,9 @@ spec = do plift p @?= toData mint "credentials" @| getCredentials ctx @-> \p -> plift p @?= [toData validator] - "sym" @| pfromData (getSym #$ pfromData $ getMint #$ getTxInfo # ctx) @-> \p -> - plift p @?= sym + "sym" + @| pfromData (getSym #$ PValue.pnormalize #$ pfromData $ getMint #$ getTxInfo # ctx) + @-> \p -> plift p @?= sym "ScriptPurpose" @\ do "literal" @| pconstant @PScriptPurpose (Minting dummyCurrency) "decode" @@ -322,7 +323,7 @@ getTxInfo = plam $ \ctx -> pfield @"txInfo" # ctx -getMint :: Term s (PAsData PTxInfo :--> PAsData (PValue 'Sorted 'NonZero)) +getMint :: Term s (PAsData PTxInfo :--> PAsData (PValue 'Sorted 'NoGuarantees)) getMint = plam $ \info -> pfield @"mint" # info From 0baae535e72bbe7e492756934db0e45cdda998e4 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 24 May 2022 13:46:50 +0530 Subject: [PATCH 475/584] Use a stateful monad stack for pretty printing --- Plutarch/Pretty.hs | 424 +++++------------- Plutarch/Pretty/Internal/BuiltinConstant.hs | 55 +++ Plutarch/Pretty/Internal/Config.hs | 23 + Plutarch/Pretty/Internal/Name.hs | 64 +++ Plutarch/Pretty/Internal/TermUtils.hs | 119 +++++ Plutarch/Pretty/Internal/Types.hs | 97 ++++ plutarch-extra/Plutarch/Extra/RationalData.hs | 66 +++ plutarch.cabal | 5 + 8 files changed, 550 insertions(+), 303 deletions(-) create mode 100644 Plutarch/Pretty/Internal/BuiltinConstant.hs create mode 100644 Plutarch/Pretty/Internal/Config.hs create mode 100644 Plutarch/Pretty/Internal/Name.hs create mode 100644 Plutarch/Pretty/Internal/TermUtils.hs create mode 100644 Plutarch/Pretty/Internal/Types.hs create mode 100644 plutarch-extra/Plutarch/Extra/RationalData.hs diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index e6236f0eb..92a220322 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -1,336 +1,154 @@ {-# LANGUAGE PatternSynonyms #-} -module Plutarch.Pretty (prettyTerm, prettyScript, prettyConstant) where +module Plutarch.Pretty (prettyTerm, prettyScript) where -import Control.Monad ((<=<)) -import Data.Bifunctor (first) -import Data.ByteString (ByteString) -import qualified Data.ByteString.Builder as BSB -import qualified Data.ByteString.Lazy as LBS -import Data.List (find, foldl') -import Data.Map.Strict (Map) -import qualified Data.Map.Strict as Map -import Data.Set (Set) -import qualified Data.Set as Set -import Data.String (fromString) -import Data.Text (Text) -import qualified Data.Text as Txt -import qualified Data.Text.Encoding as TxtEnc +import Control.Monad.Reader (ReaderT (runReaderT)) +import Control.Monad.ST (runST) +import Control.Monad.State (MonadState (get, put), StateT (runStateT), modify, modify') +import Data.Foldable (fold) +import Data.Functor (($>), (<&>)) +import Data.Traversable (for) -import System.Random ( - Random (randomR), - RandomGen, - mkStdGen, - uniformR, - ) +import System.Random.Stateful (mkStdGen, newSTGenM) import Prettyprinter ((<+>)) import qualified Prettyprinter as PP -import Plutarch.Internal.Other (ClosedTerm, compile) +import Plutarch.Internal (ClosedTerm, compile) import Plutus.V1.Ledger.Scripts (Script (unScript)) import qualified PlutusCore as PLC -import qualified PlutusCore.Data as Plutus import UntypedPlutusCore ( DeBruijn (DeBruijn), DefaultFun, DefaultUni, - Index, Program (_progTerm), Term (Apply, Builtin, Constant, Delay, Error, Force, LamAbs, Var), ) +import Plutarch.Pretty.Internal.BuiltinConstant (prettyConstant) +import Plutarch.Pretty.Internal.Config (indentWidth) +import Plutarch.Pretty.Internal.Name (freshVarName, smartName) +import Plutarch.Pretty.Internal.TermUtils ( + unwrapApply, + unwrapBindings, + unwrapLamAbs, + pattern IfThenElseLikeAST, + ) +import Plutarch.Pretty.Internal.Types ( + PrettyCursor (AppliedOver, Applying, Normal, UnaryArg), + PrettyMonad, + PrettyState (PrettyState, ps'cursor, ps'nameMap), + appliedCursor, + applyingCursor, + builtinFunAtRef, + forkState, + insertBindings, + insertName, + nameOfRef, + normalizeCursor, + unaryCursor, + ) + prettyScript :: Script -> PP.Doc () prettyScript = prettyUPLC . _progTerm . unScript prettyTerm :: ClosedTerm a -> PP.Doc () prettyTerm x = prettyScript $ compile x -data PrettyState = Normal | Applying | AppliedOver | UnaryArg - deriving stock (Bounded, Enum, Eq, Show) - {- This isn't suitable for pretty printing UPLC from any source. It's primarily suited for Plutarch output. - Practically speaking though, it should work with any _idiomatic_ UPLC. -} prettyUPLC :: Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () -prettyUPLC = go Normal mempty $ mkStdGen 42 +prettyUPLC uplc = runST $ do + stGen <- newSTGenM $ mkStdGen 42 + (doc, _) <- runReaderT (go uplc) stGen `runStateT` PrettyState mempty mempty Normal + pure doc where - go :: RandomGen g => PrettyState -> Map Index Text -> g -> Term DeBruijn DefaultUni DefaultFun () -> PP.Doc () - go _ _ _ (Constant _ c) = prettyConstant c - go _ _ _ (Builtin _ b) = PP.pretty b - go _ _ _ (Error _) = "ERROR" - go _ nameMap _ (Var _ (DeBruijn x)) = case nameOfRef x nameMap of - Just nm -> PP.pretty nm - Nothing -> error "impossible: free variable" - go fl nameMap g (IfThenElseLikeAST (Force () (Builtin () PLC.IfThenElse)) cond trueBranch falseBranch) = - (if fl `elem` [Applying, AppliedOver, UnaryArg] then PP.parens else id) $ - prettyIfThenElse (go Normal nameMap g) cond trueBranch falseBranch - go - fl - nameMap - g - ( IfThenElseLikeAST - (Var () (DeBruijn (builtinFunAtRef nameMap -> Just PLC.IfThenElse))) - cond - trueBranch - falseBranch - ) = - (if fl `elem` [Applying, AppliedOver, UnaryArg] then PP.parens else id) $ - prettyIfThenElse (go Normal nameMap g) cond trueBranch falseBranch - go _ nameMap g (Force _ t@Apply {}) = "!" <> PP.parens (go Normal nameMap g t) - go _ nameMap g (Force _ t@LamAbs {}) = "!" <> PP.parens (go Normal nameMap g t) - go _ nameMap g (Force _ t) = "!" <> go UnaryArg nameMap g t - go _ nameMap g (Delay _ t@Apply {}) = "~" <> PP.parens (go Normal nameMap g t) - go _ nameMap g (Delay _ t@LamAbs {}) = "~" <> PP.parens (go Normal nameMap g t) - go _ nameMap g (Delay _ t) = "~" <> go UnaryArg nameMap g t - go _ nameMap g (LamAbs _ _ t') = - PP.parens $ - let (depth, t) = unwrapLamAbs 0 t' - (names, _, finalG) = - foldl' - ( \(l, existingNames, g) _ -> - let (newName, newG) = freshVarName existingNames g - in (newName : l, Set.insert newName existingNames, newG) - ) - ([], Set.fromList $ Map.elems nameMap, g) - [0 .. depth] - in PP.hang indentWidth $ - PP.sep - [ "\\" <> PP.hsep (reverse $ map PP.pretty names) <+> "->" - , go Normal (Map.mapKeys (+ (depth + 1)) nameMap <> Map.fromList (zip [0 .. depth] names)) finalG t - ] - go _ nameMap g (Apply _ (LamAbs _ _ t) firstArg) = + prettyUnaryParens unaryOp t = modify normalizeCursor *> go t <&> (\x -> unaryOp <> PP.parens x) + + go :: Term DeBruijn DefaultUni DefaultFun () -> PrettyMonad s (PP.Doc ()) + go (Constant _ c) = pure $ prettyConstant c + go (Builtin _ b) = pure $ PP.pretty b + go (Error _) = pure "ERROR" + go (Var _ (DeBruijn x)) = do + PrettyState {ps'nameMap} <- get + pure $ case nameOfRef x ps'nameMap of + Just nm -> PP.pretty nm + Nothing -> error "impossible: free variable" + go (IfThenElseLikeAST (Force () (Builtin () PLC.IfThenElse)) cond trueBranch falseBranch) = do + prettyIfThenElse (forkState . go) cond trueBranch falseBranch + go ast@(IfThenElseLikeAST scrutinee cond trueBranch falseBranch) = do + PrettyState {ps'nameMap} <- get + case scrutinee of + Var () (DeBruijn (builtinFunAtRef ps'nameMap -> Just PLC.IfThenElse)) -> + prettyIfThenElse (forkState . go) cond trueBranch falseBranch + _ -> case ast of + Force _ t@Apply {} -> prettyUnaryParens "!" t + _ -> error "impossible: IfThenElseLikeAST" + go (Force _ t@Apply {}) = prettyUnaryParens "!" t + go (Force _ t@LamAbs {}) = prettyUnaryParens "!" t + go (Force _ t) = modify unaryCursor *> go t <&> ("!" <>) + go (Delay _ t@Apply {}) = prettyUnaryParens "~" t + go (Delay _ t@LamAbs {}) = prettyUnaryParens "~" t + go (Delay _ t) = modify unaryCursor *> go t <&> ("~" <>) + go (LamAbs _ _ t') = do + currState <- get + let (depth, bodyTerm) = unwrapLamAbs 0 t' + names <- traverse (const freshVarName) [0 .. depth] + -- Add all the new names to the nameMap, starting with 0 index. + put $ insertBindings names currState + modify' normalizeCursor + funcBody <- forkState $ go bodyTerm + pure . PP.parens . PP.hang indentWidth $ + PP.sep + [ "\\" <> PP.hsep (reverse $ map PP.pretty names) <+> "->" + , funcBody + ] + go (Apply _ (LamAbs _ _ t) firstArg) = do let (restArgs, coreF) = unwrapBindings [] t - (firstName, nextG) = smartName nameMap g firstArg - (finalDoc, finalMap, finalG) = - foldl' - ( \(docAcc, mp, currG) argExpr -> - let (newName, newG) = smartName mp currG argExpr - newDoc = docAcc <> PP.flatAlt PP.hardline "; " <> helper mp (newName, argExpr) - in (newDoc, Map.mapKeys (+ 1) mp <> Map.singleton 0 newName, newG) - ) - (helper nameMap (firstName, firstArg), Map.mapKeys (+ 1) nameMap <> Map.singleton 0 firstName, nextG) - $ reverse restArgs - helper mp (name, expr) = - PP.hang indentWidth $ + helper (name, expr) = do + modify' normalizeCursor + valueDoc <- forkState $ go expr + pure . PP.hang indentWidth $ PP.sep [ PP.pretty name <+> "=" - , go Normal mp nextG expr + , valueDoc ] - in PP.align $ - PP.vsep - [ "let" <+> PP.align finalDoc - , "in" <+> go Normal finalMap finalG coreF - ] - go fl nameMap g (Apply _ t arg) = - (if fl == AppliedOver then PP.parens else id) $ - let (l, f) = unwrapApply [] t - args = l <> [arg] - in PP.hang indentWidth $ PP.sep $ go Applying nameMap g f : (go AppliedOver nameMap g <$> args) - -prettyIfThenElse :: (t -> PP.Doc ann) -> t -> t -> t -> PP.Doc ann -prettyIfThenElse cont cond trueBranch falseBranch = - PP.hang indentWidth $ PP.vsep ["if" <+> cont cond, "then" <+> cont trueBranch, "else" <+> cont falseBranch] - -smartName :: RandomGen g => Map Index Text -> g -> Term DeBruijn uni DefaultFun () -> (Text, g) -smartName nameMap g = \case - Force _ (Force _ (Builtin _ b)) -> (forcedPrefix <> showText b, g) - Force _ (Builtin _ b) -> (forcedPrefix <> showText b, g) - PFixAst -> ("fix", g) - ComposeAST - (Builtin () PLC.SndPair) - (Builtin () PLC.UnConstrData) -> ("unDataSum", g) - ComposeAST - (Var () (DeBruijn (builtinFunAtRef nameMap -> Just PLC.SndPair))) - (Builtin () PLC.UnConstrData) -> ("unDataSum", g) - _ -> freshVarName (Set.fromList $ Map.elems nameMap) g - -showText :: Show a => a -> Text -showText = Txt.pack . show - -builtinFunAtRef :: Map Index Text -> Index -> Maybe DefaultFun -builtinFunAtRef nameMap = builtinFunFromName <=< flip nameOfRef nameMap - -nameOfRef :: Index -> Map Index Text -> Maybe Text -nameOfRef ix = Map.lookup (ix - 1) - -builtinFunFromName :: Text -> Maybe DefaultFun -builtinFunFromName res = - if Txt.take prefixLen res == forcedPrefix - then helper $ Txt.drop prefixLen res - else helper res - where - prefixLen = Txt.length forcedPrefix - helper s = find (\e -> showText e == s) builtinFunNames - builtinFunNames = [minBound .. maxBound :: PLC.DefaultFun] - -prettyConstant :: PLC.Some (PLC.ValueOf DefaultUni) -> PP.Doc () -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniInteger n)) = PP.pretty n -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniByteString b)) = PP.pretty $ fromHex b -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniString s)) = PP.pretty $ show s -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniUnit _)) = "()" -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniBool b)) = PP.pretty b -prettyConstant (PLC.Some (PLC.ValueOf (PLC.DefaultUniList a) l)) = - PP.list $ - map (prettyConstant . PLC.Some . PLC.ValueOf a) l -prettyConstant (PLC.Some (PLC.ValueOf (PLC.DefaultUniPair a b) ~(x, y))) = - PP.tupled - [prettyConstant . PLC.Some $ PLC.ValueOf a x, prettyConstant . PLC.Some $ PLC.ValueOf b y] -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.Constr ix dl))) = - "Σ" <> PP.pretty ix <> "." - <> PP.list (prettyConstant . PLC.Some . PLC.ValueOf PLC.DefaultUniData <$> dl) -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.Map ascList))) = - PP.group - . PP.encloseSep (PP.flatAlt "{ " "{") (PP.flatAlt " }" "}") ", " - $ map - ( \(a, b) -> - PP.hang indentWidth $ - PP.sep - [ prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData a)) <+> "=" - , prettyConstant $ PLC.Some $ PLC.ValueOf PLC.DefaultUniData b - ] - ) - ascList -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.List l))) = - "#" <> PP.list (prettyConstant . PLC.Some . PLC.ValueOf PLC.DefaultUniData <$> l) -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.B b))) = - "#" <> prettyConstant (PLC.Some $ PLC.ValueOf PLC.DefaultUniByteString b) -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.I i))) = - "#" <> prettyConstant (PLC.Some $ PLC.ValueOf PLC.DefaultUniInteger i) -prettyConstant (PLC.Some (PLC.ValueOf uni _)) = - error $ "prettyConstant(impossible): " <> show uni - -fromHex :: ByteString -> Text -fromHex = ("0x" <>) . TxtEnc.decodeUtf8 . LBS.toStrict . BSB.toLazyByteString . BSB.byteStringHex - -forcedPrefix :: Text -forcedPrefix = "fr" - -freshVarName :: RandomGen g => Set Text -> g -> (Text, g) -freshVarName s' g' = if Set.member res s then freshVarName s' finalG else r - where - r@(res, finalG) = - first Txt.pack $ - foldl' - ( \(l, g) _ -> - let (res, newG) = uniformR (1, Txt.length chars - 1) g - in (Txt.index chars res : l, newG) - ) - ([], g) - [1 .. nameLen] - (nameLen, g) = randomR (1 :: Int, 7) g' - chars :: Text - chars = "abcdefghijkmnprstuvwxyz" - s = Set.union s' keywords - -keywords :: Set Text -keywords = - Set.fromList $ - ["let", "in"] - <> map (fromString . show . PP.pretty) [(minBound @PLC.DefaultFun) .. maxBound] - -indentWidth :: Int -indentWidth = 2 - -unwrapLamAbs :: Index -> Term name uni fun ann -> (Index, Term name uni fun ann) -unwrapLamAbs d (LamAbs _ _ t) = unwrapLamAbs (d + 1) t -unwrapLamAbs d a = (d, a) - -unwrapBindings :: [Term name uni fun ann] -> Term name uni fun ann -> ([Term name uni fun ann], Term name uni fun ann) -unwrapBindings l (Apply _ (LamAbs _ _ t) arg) = unwrapBindings (arg : l) t -unwrapBindings l a = (l, a) - -unwrapApply :: - [Term name uni fun ann] -> - Term name uni fun ann -> - ([Term name uni fun ann], Term name uni fun ann) -unwrapApply l (Apply _ t arg) = unwrapApply (arg : l) t -unwrapApply l arg = (l, arg) - --- AST resulting from `pfix`. This is always constant. -pattern PFixAst :: Term name uni fun () -pattern PFixAst <- - LamAbs - () - _ - ( Apply - () - ( LamAbs - () - _ - ( Apply - () - (Var () _) - ( LamAbs - () - _ - ( Apply - () - ( Apply - () - (Var () _) - (Var () _) - ) - (Var () _) - ) - ) - ) - ) - ( LamAbs - () - _ - ( Apply - () - (Var () _) - ( LamAbs - () - _ - ( Apply - () - ( Apply - () - (Var () _) - (Var () _) - ) - (Var () _) - ) - ) - ) - ) - ) - --- If `f` and `g` are Var references, their indices are incremented once since they are within a lambda. -pattern ComposeAST :: Term DeBruijn uni fun () -> Term DeBruijn uni fun () -> Term DeBruijn uni fun () -pattern ComposeAST f g <- LamAbs () _ (Apply () (incrVar -> f) (Apply () (incrVar -> g) (Var () (DeBruijn 1)))) - -{- This AST represents a typical if/then/else usage if and only if 'ifThenElseMaybe' is either the -builtin IfThenElse (forced once), or a reference to such. --} -pattern IfThenElseLikeAST :: - Term name uni fun () -> - Term name uni fun () -> - Term name uni fun () -> - Term name uni fun () -> - Term name uni fun () -pattern IfThenElseLikeAST ifThenElseMaybe cond trueBranch falseBranch <- - Force - () - ( Apply - () - ( Apply - () - ( Apply - () - ifThenElseMaybe - cond - ) - (Delay () trueBranch) - ) - (Delay () falseBranch) - ) - --- | Increment the debruijn index of a 'Var', leave any other AST node unchanged. -incrVar :: Term DeBruijn uni fun () -> Term DeBruijn uni fun () -incrVar (Var () (DeBruijn n)) = Var () . DeBruijn $ n - 1 -incrVar n = n + firstName <- smartName firstArg + firstBindingDoc <- helper (firstName, firstArg) + modify' $ insertName firstName + restBindingDoc <- fmap fold . for (reverse restArgs) $ \argExpr -> do + newName <- smartName argExpr + bindingDoc <- helper (newName, argExpr) + modify' (insertName newName) $> PP.flatAlt PP.hardline "; " <> bindingDoc + modify' normalizeCursor + coreExprDoc <- go coreF + pure $ + PP.align $ + PP.vsep + [ "let" <+> PP.align (firstBindingDoc <> restBindingDoc) + , "in" <+> coreExprDoc + ] + go (Apply _ t arg) = do + PrettyState {ps'cursor} <- get + let (l, f) = unwrapApply [] t + args = l <> [arg] + functionDoc <- forkState $ modify' applyingCursor *> go f + argsDoc <- modify' appliedCursor *> traverse (forkState . go) args + (if ps'cursor == AppliedOver then pure . PP.parens else pure) $ + PP.hang indentWidth $ PP.sep $ functionDoc : argsDoc + +prettyIfThenElse :: + (t -> PrettyMonad s (PP.Doc ann)) -> + t -> + t -> + t -> + PrettyMonad s (PP.Doc ann) +prettyIfThenElse cont cond trueBranch falseBranch = do + PrettyState {ps'cursor} <- get + modify' normalizeCursor + condAst <- cont cond + trueAst <- cont trueBranch + falseAst <- cont falseBranch + (if ps'cursor `elem` [Applying, AppliedOver, UnaryArg] then pure . PP.parens else pure) $ + PP.hang indentWidth $ PP.vsep ["if" <+> condAst, "then" <+> trueAst, "else" <+> falseAst] diff --git a/Plutarch/Pretty/Internal/BuiltinConstant.hs b/Plutarch/Pretty/Internal/BuiltinConstant.hs new file mode 100644 index 000000000..96e7175aa --- /dev/null +++ b/Plutarch/Pretty/Internal/BuiltinConstant.hs @@ -0,0 +1,55 @@ +module Plutarch.Pretty.Internal.BuiltinConstant (prettyConstant) where + +import Data.ByteString (ByteString) +import qualified Data.ByteString.Builder as BSB +import qualified Data.ByteString.Lazy as LBS +import Data.Text (Text) +import qualified Data.Text.Encoding as TxtEnc + +import Prettyprinter ((<+>)) +import qualified Prettyprinter as PP + +import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusCore as PLC +import UntypedPlutusCore (DefaultUni) + +import Plutarch.Pretty.Internal.Config (indentWidth) + +prettyConstant :: PLC.Some (PLC.ValueOf DefaultUni) -> PP.Doc () +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniInteger n)) = PP.pretty n +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniByteString b)) = PP.pretty $ fromHex b +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniString s)) = PP.pretty $ show s +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniUnit _)) = "()" +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniBool b)) = PP.pretty b +prettyConstant (PLC.Some (PLC.ValueOf (PLC.DefaultUniList a) l)) = + PP.list $ + map (prettyConstant . PLC.Some . PLC.ValueOf a) l +prettyConstant (PLC.Some (PLC.ValueOf (PLC.DefaultUniPair a b) ~(x, y))) = + PP.tupled + [prettyConstant . PLC.Some $ PLC.ValueOf a x, prettyConstant . PLC.Some $ PLC.ValueOf b y] +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.Constr ix dl))) = + "Σ" <> PP.pretty ix <> "." + <> PP.list (prettyConstant . PLC.Some . PLC.ValueOf PLC.DefaultUniData <$> dl) +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.Map ascList))) = + PP.group + . PP.encloseSep (PP.flatAlt "{ " "{") (PP.flatAlt " }" "}") ", " + $ map + ( \(a, b) -> + PP.hang indentWidth $ + PP.sep + [ prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData a)) <+> "=" + , prettyConstant $ PLC.Some $ PLC.ValueOf PLC.DefaultUniData b + ] + ) + ascList +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.List l))) = + "#" <> PP.list (prettyConstant . PLC.Some . PLC.ValueOf PLC.DefaultUniData <$> l) +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.B b))) = + "#" <> prettyConstant (PLC.Some $ PLC.ValueOf PLC.DefaultUniByteString b) +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.I i))) = + "#" <> prettyConstant (PLC.Some $ PLC.ValueOf PLC.DefaultUniInteger i) +prettyConstant (PLC.Some (PLC.ValueOf uni _)) = + error $ "prettyConstant(impossible): " <> show uni + +fromHex :: ByteString -> Text +fromHex = ("0x" <>) . TxtEnc.decodeUtf8 . LBS.toStrict . BSB.toLazyByteString . BSB.byteStringHex diff --git a/Plutarch/Pretty/Internal/Config.hs b/Plutarch/Pretty/Internal/Config.hs new file mode 100644 index 000000000..47cd02e62 --- /dev/null +++ b/Plutarch/Pretty/Internal/Config.hs @@ -0,0 +1,23 @@ +module Plutarch.Pretty.Internal.Config (keywords, indentWidth, forcedPrefix) where + +import Data.Set (Set) +import qualified Data.Set as Set +import Data.String (fromString) +import Data.Text (Text) + +import qualified Prettyprinter as PP + +import qualified PlutusCore as PLC + +keywords :: Set Text +keywords = + Set.fromList $ + ["let", "in"] + <> map (fromString . show . PP.pretty) [(minBound @PLC.DefaultFun) .. maxBound] + +indentWidth :: Int +indentWidth = 2 + +-- | Prefix to use for naming forced builtin functions. +forcedPrefix :: Text +forcedPrefix = "fr" diff --git a/Plutarch/Pretty/Internal/Name.hs b/Plutarch/Pretty/Internal/Name.hs new file mode 100644 index 000000000..c899b085a --- /dev/null +++ b/Plutarch/Pretty/Internal/Name.hs @@ -0,0 +1,64 @@ +{-# LANGUAGE PatternSynonyms #-} + +module Plutarch.Pretty.Internal.Name (smartName, freshVarName) where + +import Control.Monad.Reader (ask) +import Control.Monad.State ( + get, + lift, + modify', + ) +import Data.Functor (($>)) +import qualified Data.Set as Set +import Data.Text (Text) +import qualified Data.Text as Txt +import Data.Traversable (for) + +import System.Random.Stateful (randomRM, uniformRM) + +import qualified PlutusCore as PLC +import UntypedPlutusCore ( + DeBruijn (DeBruijn), + DefaultFun, + Term (Builtin, Force, Var), + ) + +import Plutarch.Pretty.Internal.Config (forcedPrefix, keywords) +import Plutarch.Pretty.Internal.TermUtils (pattern ComposeAST, pattern PFixAst) +import Plutarch.Pretty.Internal.Types ( + PrettyMonad, + PrettyState (PrettyState, ps'nameMap, ps'names), + builtinFunAtRef, + memorizeName, + ) + +smartName :: Term DeBruijn uni DefaultFun () -> PrettyMonad s Text +smartName uplc = do + PrettyState {ps'nameMap} <- get + case uplc of + Force _ (Force _ (Builtin _ b)) -> pure $ forcedPrefix <> Txt.pack (show b) + Force _ (Builtin _ b) -> pure $ forcedPrefix <> Txt.pack (show b) + PFixAst -> pure "fix" + ComposeAST + (Builtin () PLC.SndPair) + (Builtin () PLC.UnConstrData) -> pure "unDataSum" + ComposeAST + (Var () (DeBruijn (builtinFunAtRef ps'nameMap -> Just PLC.SndPair))) + (Builtin () PLC.UnConstrData) -> pure "unDataSum" + _ -> freshVarName + +freshVarName :: PrettyMonad s Text +freshVarName = do + stGen <- ask + PrettyState {ps'names} <- get + let existingNames = Set.union ps'names keywords + nameLen <- lift . lift $ randomRM (1 :: Int, 7) stGen + newName <- fmap Txt.pack . for [1 .. nameLen] $ \_ -> do + chosenIx <- lift . lift $ uniformRM (1, Txt.length chars - 1) stGen + pure $ Txt.index chars chosenIx + if Set.member newName existingNames + then freshVarName + else modify' (memorizeName newName) $> newName + where + chars :: Text + chars = "abcdefghijkmnprstuvwxyz" diff --git a/Plutarch/Pretty/Internal/TermUtils.hs b/Plutarch/Pretty/Internal/TermUtils.hs new file mode 100644 index 000000000..397ab9818 --- /dev/null +++ b/Plutarch/Pretty/Internal/TermUtils.hs @@ -0,0 +1,119 @@ +{-# LANGUAGE PatternSynonyms #-} + +module Plutarch.Pretty.Internal.TermUtils ( + unwrapLamAbs, + unwrapBindings, + unwrapApply, + incrVar, + pattern PFixAst, + pattern ComposeAST, + pattern IfThenElseLikeAST, +) where + +import UntypedPlutusCore ( + DeBruijn (DeBruijn), + Index, + Term (Apply, Delay, Force, LamAbs, Var), + ) + +unwrapLamAbs :: Index -> Term name uni fun ann -> (Index, Term name uni fun ann) +unwrapLamAbs d (LamAbs _ _ t) = unwrapLamAbs (d + 1) t +unwrapLamAbs d a = (d, a) + +unwrapBindings :: [Term name uni fun ann] -> Term name uni fun ann -> ([Term name uni fun ann], Term name uni fun ann) +unwrapBindings l (Apply _ (LamAbs _ _ t) arg) = unwrapBindings (arg : l) t +unwrapBindings l a = (l, a) + +unwrapApply :: + [Term name uni fun ann] -> + Term name uni fun ann -> + ([Term name uni fun ann], Term name uni fun ann) +unwrapApply l (Apply _ t arg) = unwrapApply (arg : l) t +unwrapApply l arg = (l, arg) + +-- AST resulting from `pfix`. This is always constant. +pattern PFixAst :: Term name uni fun () +pattern PFixAst <- + LamAbs + () + _ + ( Apply + () + ( LamAbs + () + _ + ( Apply + () + (Var () _) + ( LamAbs + () + _ + ( Apply + () + ( Apply + () + (Var () _) + (Var () _) + ) + (Var () _) + ) + ) + ) + ) + ( LamAbs + () + _ + ( Apply + () + (Var () _) + ( LamAbs + () + _ + ( Apply + () + ( Apply + () + (Var () _) + (Var () _) + ) + (Var () _) + ) + ) + ) + ) + ) + +-- If `f` and `g` are Var references, their indices are incremented once since they are within a lambda. +pattern ComposeAST :: Term DeBruijn uni fun () -> Term DeBruijn uni fun () -> Term DeBruijn uni fun () +pattern ComposeAST f g <- LamAbs () _ (Apply () (incrVar -> f) (Apply () (incrVar -> g) (Var () (DeBruijn 1)))) + +{- This AST represents a typical if/then/else usage if and only if 'ifThenElseMaybe' is either the +builtin IfThenElse (forced once), or a reference to such. +-} +pattern IfThenElseLikeAST :: + Term name uni fun () -> + Term name uni fun () -> + Term name uni fun () -> + Term name uni fun () -> + Term name uni fun () +pattern IfThenElseLikeAST ifThenElseMaybe cond trueBranch falseBranch <- + Force + () + ( Apply + () + ( Apply + () + ( Apply + () + ifThenElseMaybe + cond + ) + (Delay () trueBranch) + ) + (Delay () falseBranch) + ) + +-- | Increment the debruijn index of a 'Var', leave any other AST node unchanged. +incrVar :: Term DeBruijn uni fun () -> Term DeBruijn uni fun () +incrVar (Var () (DeBruijn n)) = Var () . DeBruijn $ n - 1 +incrVar n = n diff --git a/Plutarch/Pretty/Internal/Types.hs b/Plutarch/Pretty/Internal/Types.hs new file mode 100644 index 000000000..b1f5a173d --- /dev/null +++ b/Plutarch/Pretty/Internal/Types.hs @@ -0,0 +1,97 @@ +module Plutarch.Pretty.Internal.Types ( + PrettyCursor (..), + PrettyState (..), + PrettyMonad, + forkState, + normalizeCursor, + unaryCursor, + applyingCursor, + appliedCursor, + memorizeName, + insertName, + insertBindings, + builtinFunAtRef, + nameOfRef, +) where + +import Control.Monad.Reader (ReaderT, (<=<)) +import Control.Monad.ST (ST) +import Control.Monad.State (MonadState (get, put), StateT) +import Data.List (find) +import Data.Map.Strict (Map) +import qualified Data.Map.Strict as Map +import Data.Set (Set) +import qualified Data.Set as Set +import Data.Text (Text) +import qualified Data.Text as Txt +import System.Random.Stateful (STGenM, StdGen) + +import qualified PlutusCore as PLC +import UntypedPlutusCore (DefaultFun, Index) + +import Plutarch.Pretty.Internal.Config (forcedPrefix) + +data PrettyCursor = Normal | Applying | AppliedOver | UnaryArg + deriving stock (Bounded, Enum, Eq, Show) + +data PrettyState = PrettyState + { ps'nameMap :: Map Index Text + , ps'names :: Set Text + , ps'cursor :: PrettyCursor + } + +type PrettyMonad s = ReaderT (STGenM StdGen s) (StateT PrettyState (ST s)) + +forkState :: MonadState s m => m b -> m b +forkState x = get >>= (\s -> x <* put s) + +normalizeCursor :: PrettyState -> PrettyState +normalizeCursor x = x {ps'cursor = Normal} + +unaryCursor :: PrettyState -> PrettyState +unaryCursor x = x {ps'cursor = UnaryArg} + +applyingCursor :: PrettyState -> PrettyState +applyingCursor x = x {ps'cursor = Applying} + +appliedCursor :: PrettyState -> PrettyState +appliedCursor x = x {ps'cursor = AppliedOver} + +memorizeName :: Text -> PrettyState -> PrettyState +memorizeName n x@PrettyState {ps'names} = x {ps'names = Set.insert n ps'names} + +-- | Insert a fresh binding onto the name map, i.e a name at index 0 - incrementing all other indices. +insertName :: Text -> PrettyState -> PrettyState +insertName name x@PrettyState {ps'nameMap} = + x + { ps'nameMap = Map.mapKeys (+ 1) ps'nameMap <> Map.singleton 0 name + } + +insertBindings :: [Text] -> PrettyState -> PrettyState +insertBindings names prst@PrettyState {ps'nameMap} = + prst + { ps'nameMap = + Map.mapKeys (+ nameCount) ps'nameMap + <> foldMap (uncurry Map.singleton) (zip [0 .. (nameCount - 1)] names) + } + where + nameCount = fromIntegral $ length names + +builtinFunAtRef :: Map Index Text -> Index -> Maybe DefaultFun +builtinFunAtRef nameMap = builtinFunFromName <=< flip nameOfRef nameMap + +nameOfRef :: Index -> Map Index Text -> Maybe Text +nameOfRef ix = Map.lookup (ix - 1) + +builtinFunFromName :: Text -> Maybe DefaultFun +builtinFunFromName res = + if Txt.take prefixLen res == forcedPrefix + then helper $ Txt.drop prefixLen res + else helper res + where + prefixLen = Txt.length forcedPrefix + helper s = find (\e -> showText e == s) builtinFunNames + builtinFunNames = [minBound .. maxBound :: PLC.DefaultFun] + +showText :: Show a => a -> Text +showText = Txt.pack . show diff --git a/plutarch-extra/Plutarch/Extra/RationalData.hs b/plutarch-extra/Plutarch/Extra/RationalData.hs new file mode 100644 index 000000000..d3a544d23 --- /dev/null +++ b/plutarch-extra/Plutarch/Extra/RationalData.hs @@ -0,0 +1,66 @@ +module Plutarch.Rational ( + PRational (..), + preduce, + pnumerator, + pdenominator, + pfromInteger, + pround, + ptruncate, + pproperFraction, +) where + +import Data.Ratio (denominator, numerator) +import qualified GHC.Generics as GHC +import Generics.SOP (Generic, I (I)) +import Plutarch ( + PlutusType (..), + Term, + pcon, + pfix, + phoistAcyclic, + plam, + plet, + pmatch, + (#), + (#$), + type (:-->), + ) +import Plutarch.Bool (PEq (..), POrd (..), pif) +import Plutarch.Builtin ( + PAsData, + PBuiltinList, + PData, + PIsData, + pasInt, + pasList, + pdata, + pdataImpl, + pforgetData, + pfromDataImpl, + ) +import Plutarch.Integer (PInteger, PIntegral (pdiv, pmod)) +import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) +import Plutarch.Pair (PPair (..)) +import Plutarch.Show (PShow (pshow'), pshow) +import Plutarch.Trace (ptraceError) +import Plutarch.Unsafe (punsafeCoerce) + +data PRational s + = PRational + ( Term + s + ( PDataRecord + '[ "numerator" ':= PInteger + , "denominator" ':= PInteger + ] + ) + ) + deriving stock (GHC.Generic) + deriving anyclass (Generic) + deriving anyclass (PIsDataRepr) + deriving + (PlutusType, PIsData, PDataFields, PEq) + via PIsDataReprInstances PScriptContext + +instance PUnsafeLiftDecl PScriptContext where type PLifted PScriptContext = Plutus.ScriptContext +deriving via (DerivePConstantViaData Plutus.ScriptContext PScriptContext) instance PConstantDecl Plutus.ScriptContext diff --git a/plutarch.cabal b/plutarch.cabal index c0ccec102..54ef842a8 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -123,6 +123,11 @@ library Plutarch.Pair Plutarch.Prelude Plutarch.Pretty + Plutarch.Pretty.Internal.BuiltinConstant + Plutarch.Pretty.Internal.Config + Plutarch.Pretty.Internal.Name + Plutarch.Pretty.Internal.TermUtils + Plutarch.Pretty.Internal.Types Plutarch.Rational Plutarch.Rec Plutarch.Rec.TH From e1f237b9e67aee22302f7146bb846a982b773155 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelaziz Date: Sat, 28 May 2022 15:24:23 +0000 Subject: [PATCH 476/584] Interval utils --- plutarch-extra/Plutarch/Extra/Interval.hs | 426 ++++++++++++++++++ plutarch-extra/plutarch-extra.cabal | 1 + .../Plutarch/Extra/IntervalSpec.hs | 241 ++++++++++ plutarch-test/plutarch-test.cabal | 1 + 4 files changed, 669 insertions(+) create mode 100644 plutarch-extra/Plutarch/Extra/Interval.hs create mode 100644 plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs diff --git a/plutarch-extra/Plutarch/Extra/Interval.hs b/plutarch-extra/Plutarch/Extra/Interval.hs new file mode 100644 index 000000000..8d4b9924d --- /dev/null +++ b/plutarch-extra/Plutarch/Extra/Interval.hs @@ -0,0 +1,426 @@ +{-# LANGUAGE OverloadedRecordDot #-} +{-# LANGUAGE QualifiedDo #-} + +module Plutarch.Extra.Interval ( + member, + interval, + from, + to, + always, + never, + singleton, + hull, + intersection, + contains, + before, + after, +) where + +import Plutarch.Api.V1.Interval ( + PClosure, + PExtended (PFinite, PNegInf, PPosInf), + PInterval (PInterval), + PLowerBound (PLowerBound), + PUpperBound (PUpperBound), + ) +import qualified Plutarch.Monadic as P +import Plutarch.Prelude + +-- check if `a` belongs to interval `i` +member :: + forall a (s :: S). + (PEq a, POrd a, PIsData a) => + Term s a -> + Term s (PInterval a) -> + Term s PBool +member a i = i `contains` (singleton a) + +{- | create an interval that includes all values that are greater than or equal + - to a and smaller than or equal to b +-} +interval :: + forall a (s :: S). + PIsData a => + Term s a -> + Term s a -> + Term s (PInterval a) +interval a b = closedInterval start end + where + start :: Term s (PExtended a) + start = pcon $ PFinite $ pdcons @"_0" # (pdata a) # pdnil + + end :: Term s (PExtended a) + end = pcon $ PFinite $ pdcons @"_0" # (pdata b) # pdnil + +{- | create an interval that includes all values that are greater than or equal + - to a +-} +from :: forall a s. PIsData a => Term s a -> Term s (PInterval a) +from a = closedInterval start end + where + start :: Term s (PExtended a) + start = pcon $ PFinite $ pdcons @"_0" # (pdata a) # pdnil + + end :: Term s (PExtended a) + end = pcon $ PPosInf pdnil + +{- | create an interval that includes all values that are smaller than or equal + - to a +-} +to :: forall a (s :: S). PIsData a => Term s a -> Term s (PInterval a) +to a = closedInterval start end + where + start :: Term s (PExtended a) + start = pcon $ PNegInf pdnil + + end :: Term s (PExtended a) + end = pcon $ PFinite $ pdcons @"_0" # (pdata a) # pdnil + +-- | create an interval that covers every slot +always :: forall a (s :: S). PIsData a => Term s (PInterval a) +always = closedInterval start end + where + start :: Term s (PExtended a) + start = pcon $ PNegInf pdnil + + end :: Term s (PExtended a) + end = pcon $ PPosInf pdnil + +-- | create an interval that is empty +never :: forall a (s :: S). PIsData a => Term s (PInterval a) +never = closedInterval start end + where + start :: Term s (PExtended a) + start = pcon $ PPosInf pdnil + + end :: Term s (PExtended a) + end = pcon $ PNegInf pdnil + +-- | create and interval [a, a] +singleton :: forall a (s :: S). PIsData a => Term s a -> Term s (PInterval a) +singleton a = closedInterval start start + where + start :: Term s (PExtended a) + start = pcon $ PFinite $ pdcons @"_0" # (pdata a) # pdnil + +-- | `hull i1 i2` is the smallest interval containing `i1` and `i2` +hull :: + forall a (s :: S). + (PEq a, POrd a, PIsData a) => + Term s (PInterval a) -> + Term s (PInterval a) -> + Term s (PInterval a) +hull x' y' = P.do + x <- pletFields @'["from", "to"] x' + y <- pletFields @'["from", "to"] y' + + lowerX <- plet x.from + upperX <- plet x.to + + lowerY <- plet y.from + upperY <- plet y.to + + let lower = pcon $ PLowerBound $ minP (lToE lowerX) (lToE lowerY) + upper = pcon $ PUpperBound $ maxP (uToE upperX) (uToE upperY) + + interval' lower upper + +-- | `intersecion i1 i2` is the largest interval contained in `i1` and `i2` +intersection :: + forall a (s :: S). + (PEq a, POrd a, PIsData a) => + Term s (PInterval a) -> + Term s (PInterval a) -> + Term s (PInterval a) +intersection x' y' = P.do + x <- pletFields @'["from", "to"] x' + y <- pletFields @'["from", "to"] y' + + lowerX <- plet x.from + upperX <- plet x.to + + lowerY <- plet y.from + upperY <- plet y.to + + let lower = pcon $ PLowerBound $ maxP (lToE lowerX) (lToE lowerY) + upper = pcon $ PUpperBound $ minP (uToE upperX) (uToE upperY) + + interval' lower upper + +-- | `a` contains `b` is true if the interval `b` is entirely contained in `a` +contains :: + forall a (s :: S). + (PEq a, POrd a, PIsData a) => + Term s (PInterval a) -> + Term s (PInterval a) -> + Term s PBool +contains x' y' = P.do + x <- pletFields @'["from", "to"] x' + y <- pletFields @'["from", "to"] y' + + lowerX <- plet x.from + upperX <- plet x.to + + lowerY <- plet y.from + upperY <- plet y.to + + (leqP (lToE lowerX) (lToE lowerY)) #&& (leqP (uToE upperY) (uToE upperX)) + +-- | `a` before interval `i` is true if `a` is earlier than the start of `i` +before :: + forall a (s :: S). + (PEq a, POrd a, PIsData a) => + Term s a -> + Term s (PInterval a) -> + Term s PBool +before a y = P.do + lower <- plet $ pfield @"from" # y + before' a (lToE lower) + +-- | `a` after interval `i` is true if `a` is later than the end of `i` +after :: + forall a s. + (PEq a, POrd a, PIsData a) => + Term s a -> + Term s (PInterval a) -> + Term s PBool +after a y = P.do + upper <- plet $ pfield @"to" # y + after' a (uToE upper) + +-- | interval from upper and lower +interval' :: + forall a (s :: S). + PIsData a => + Term s (PLowerBound a) -> + Term s (PUpperBound a) -> + Term s (PInterval a) +interval' lower upper = + pcon $ + PInterval $ + pdcons @"from" # pdata lower + #$ pdcons @"to" # pdata upper # pdnil + +-- | closed interval from PExtended +closedInterval :: + forall a (s :: S). + PIsData a => + Term s (PExtended a) -> + Term s (PExtended a) -> + Term s (PInterval a) +closedInterval start end = interval' lower upper + where + closure :: Term s PClosure + closure = pconstant True + + upper :: Term s (PUpperBound a) + upper = + pcon $ + PUpperBound $ + pdcons @"_0" # pdata end #$ pdcons @"_1" + # pdata closure + # pdnil + + lower :: Term s (PLowerBound a) + lower = + pcon $ + PLowerBound $ + pdcons @"_0" # pdata start #$ pdcons @"_1" + # pdata closure + # pdnil + +-- | value < endpoint +before' :: + forall a (s :: S). + (PIsData a, POrd a, PEq a) => + Term s a -> + Term s (EndPoint a) -> + Term s PBool +before' a y' = P.do + y <- pletFields @'["_0", "_1"] y' + yt <- plet $ y._0 + yc <- plet $ y._1 + + pif + yc + (pmatch yt (ltE' a)) + (pmatch yt (leqE' a)) + +-- | value > endpoint +after' :: + forall a (s :: S). + (PIsData a, POrd a, PEq a) => + Term s a -> + Term s (EndPoint a) -> + Term s PBool +after' a y' = P.do + y <- pletFields @'["_0", "_1"] y' + yt <- plet $ y._0 + yc <- plet $ y._1 + + pif + yc + (pmatch yt (gtE' a)) + (pmatch yt (geqE' a)) + +-- | (x :: Term s (EndPoint a)) <= (y :: Term s (EndPoint a)) +leqP :: + forall a (s :: S). + (PIsData a, POrd a, PEq a) => + Term s (EndPoint a) -> + Term s (EndPoint a) -> + Term s PBool +leqP x' y' = P.do + x <- pletFields @'["_0", "_1"] x' + y <- pletFields @'["_0", "_1"] y' + + xt <- plet $ x._0 + yt <- plet $ y._0 + + xc <- plet $ x._1 + yc <- plet $ y._1 + + pif + (xc #&& yc #|| (pnot # xc) #&& (pnot # yc)) + (leqE xt yt) + (ltE xt yt) + +minP :: + forall a (s :: S). + (PIsData a, POrd a, PEq a) => + Term s (EndPoint a) -> + Term s (EndPoint a) -> + Term s (EndPoint a) +minP x y = pif (leqP x y) x y + +maxP :: + forall a (s :: S). + (PIsData a, POrd a, PEq a) => + Term s (EndPoint a) -> + Term s (EndPoint a) -> + Term s (EndPoint a) +maxP x y = pif (leqP x y) y x + +-- | (x :: Term s (PExtended a)) < (y :: Term s (PExtended b)) +ltE :: + forall a (s :: S). + (POrd a, PIsData a) => + Term s (PExtended a) -> + Term s (PExtended a) -> + Term s PBool +ltE x y = pmatch x (cont y) + where + cont :: Term s (PExtended a) -> PExtended a s -> Term s PBool + cont y' x' = case x' of + PNegInf _ -> pconstant True + PPosInf _ -> pmatch y' isPosInf + PFinite l -> P.do + a <- plet $ pfield @"_0" # l + pmatch y' (ltE' a) + +-- | (x :: Term s (PExtended a)) = (y :: Term s (PExtended b)) +eqE :: + forall a (s :: S). + (PEq a, PIsData a) => + Term s (PExtended a) -> + Term s (PExtended a) -> + Term s PBool +eqE x y = pmatch x cont + where + cont :: PExtended a s -> Term s PBool + cont x' = case x' of + PNegInf _ -> pmatch y isNegInf + PPosInf _ -> pmatch y isPosInf + PFinite l -> P.do + a <- plet $ pfield @"_0" # l + pmatch y (eqE' a) + +-- | value < PExtended +ltE' :: + forall a (s :: S). + (POrd a, PIsData a) => + Term s a -> + PExtended a s -> + Term s PBool +ltE' a y' = case y' of + PNegInf _ -> pconstant False + PPosInf _ -> pconstant True + PFinite r -> P.do + b <- plet $ pfield @"_0" # r + a #< b + +-- | value > PExtended +gtE' :: + forall a (s :: S). + (POrd a, PIsData a) => + Term s a -> + PExtended a s -> + Term s PBool +gtE' a y' = case y' of + PNegInf _ -> pconstant False + PPosInf _ -> pconstant True + PFinite r -> P.do + b <- plet $ pfield @"_0" # r + b #< a + +-- | value = PExtended +eqE' :: + forall a (s :: S). + (PEq a, PIsData a) => + Term s a -> + PExtended a s -> + Term s PBool +eqE' a y' = case y' of + PFinite r -> P.do + b <- plet $ pfield @"_0" # r + a #== b + _ -> pconstant False + +-- | value <= PExtended +leqE' :: + forall a (s :: S). + (POrd a, PEq a, PIsData a) => + Term s a -> + PExtended a s -> + Term s PBool +leqE' a y = (ltE' a y) #|| (eqE' a y) + +-- | value >= PExtended +geqE' :: + forall a (s :: S). + (POrd a, PEq a, PIsData a) => + Term s a -> + PExtended a s -> + Term s PBool +geqE' a y = (gtE' a y) #|| (eqE' a y) + +-- | (x :: Term s (PExtended a)) <= (y :: Term s (PExtended b)) +leqE :: + forall a (s :: S). + (PEq a, POrd a, PIsData a) => + Term s (PExtended a) -> + Term s (PExtended a) -> + Term s PBool +leqE x y = (ltE x y) #|| (eqE x y) + +isNegInf :: PExtended a s -> Term s PBool +isNegInf x = case x of + PNegInf _ -> pconstant True + _ -> pconstant False + +isPosInf :: PExtended a s -> Term s PBool +isPosInf x = case x of + PPosInf _ -> pconstant True + _ -> pconstant False + +type EndPoint a = + PDataRecord + '[ "_0" ':= PExtended a + , "_1" ':= PClosure + ] + +uToE :: Term s (PUpperBound a) -> Term s (EndPoint a) +uToE x = pmatch x (\(PUpperBound a) -> a) + +lToE :: Term s (PLowerBound a) -> Term s (EndPoint a) +lToE x = pmatch x (\(PLowerBound a) -> a) diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index 2c372f042..0ab0c2a06 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -81,6 +81,7 @@ library exposed-modules: Plutarch.Extra Plutarch.Extra.Api + Plutarch.Extra.Interval Plutarch.Extra.List Plutarch.Extra.TermCont diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs new file mode 100644 index 000000000..eefde8b11 --- /dev/null +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs @@ -0,0 +1,241 @@ +module Plutarch.Extra.IntervalSpec (spec) where + +import Plutarch.Api.V1.Interval (PInterval) +import Plutarch.Extra.Interval ( + after, + always, + before, + contains, + from, + hull, + intersection, + interval, + member, + never, + to, + ) +import Plutarch.Prelude + +import Hedgehog (Property, PropertyT, assert, forAll, property) +import qualified Hedgehog.Gen as Gen (int, list) +import Hedgehog.Internal.Property (propertyTest) +import qualified Hedgehog.Range as Range (constantBounded, singleton) +import Test.Hspec (Spec, describe, it) +import Test.Hspec.Hedgehog (hedgehog) + +spec :: Spec +spec = do + describe "extra.intervalutils" $ do + describe "member" $ do + it "a is a member of [b, c] iff b <= a and a <= c" . hedgehog + . propertyTest + $ prop_member + describe "always" $ do + it "always contains everything" . hedgehog . propertyTest $ prop_always + describe "never" $ do + it "never contains nothing" . hedgehog . propertyTest $ prop_never + describe "hull" $ do + it "hull of a and b contains a and b" . hedgehog . propertyTest $ + prop_hull + describe "intersection" $ do + it "intersection of a and b is contained in a and b" . hedgehog + . propertyTest $ prop_intersection + describe "contains" $ do + describe "contains on bounded intervals" $ do + it "[a, b] contains [c, d] iff a <= c and d <= b" . hedgehog + . propertyTest + $ prop_containsBounded + describe "contains on unbounded (from above) intervals" $ do + it "[a, inf] contains [c, d] iff a <= c" . hedgehog + . propertyTest + $ prop_containsUnboundedUpper + describe "contains on unbounded (from below) intervals" $ do + it "[-inf, b] contains [c, d] iff d <= b" . hedgehog + . propertyTest + $ prop_containsUnboundedLower + describe "before" $ do + it "a is before [b, c] iff a < b" . hedgehog + . propertyTest + $ prop_before + describe "after" $ do + it "a is after [b, c] iff c < a" . hedgehog + . propertyTest + $ prop_after + +prop_member :: Property +prop_member = property $ do + [a, b, c] <- genIntegerList 3 + assert $ checkMember a b c + +prop_always :: Property +prop_always = property $ do + [a, b] <- genIntegerList 2 + assert $ checkAlways a b + +prop_never :: Property +prop_never = property $ do + [a, b] <- genIntegerList 2 + assert $ checkNever a b + +prop_hull :: Property +prop_hull = property $ do + [a, b, c, d] <- genIntegerList 4 + assert $ checkHull a b c d + +prop_intersection :: Property +prop_intersection = property $ do + [a, b, c, d] <- genIntegerList 4 + assert $ checkIntersection a b c d + +prop_containsBounded :: Property +prop_containsBounded = property $ do + [a, b, c, d] <- genIntegerList 4 + assert $ checkBoundedContains a b c d + +prop_containsUnboundedUpper :: Property +prop_containsUnboundedUpper = property $ do + [a, b, c] <- genIntegerList 3 + assert $ checkUnboundedUpperContains a b c + +prop_containsUnboundedLower :: Property +prop_containsUnboundedLower = property $ do + [a, b, c] <- genIntegerList 3 + assert $ checkUnboundedLowerContains a b c + +prop_before :: Property +prop_before = property $ do + [a, b, c] <- genIntegerList 3 + assert $ checkBefore a b c + +prop_after :: Property +prop_after = property $ do + [a, b, c] <- genIntegerList 3 + assert $ checkAfter a b c + +checkMember :: Integer -> Integer -> Integer -> Bool +checkMember a b c = actual == expected + where + i :: Term s (PInterval PInteger) + i = mkInterval b c + + actual = plift $ (pconstant a) `member` i + expected = (min b c <= a) && (a <= max b c) + +checkAlways :: Integer -> Integer -> Bool +checkAlways a b = plift $ always `contains` i + where + i :: Term s (PInterval PInteger) + i = mkInterval a b + +checkNever :: Integer -> Integer -> Bool +checkNever a b = not (plift $ never `contains` i) + where + i :: Term s (PInterval PInteger) + i = mkInterval a b + +checkHull :: Integer -> Integer -> Integer -> Integer -> Bool +checkHull a b c d = plift $ (i3 `contains` i1) #&& (i3 `contains` i2) + where + i1 :: Term s (PInterval PInteger) + i1 = mkInterval a b + + i2 :: Term s (PInterval PInteger) + i2 = mkInterval c d + + i3 = hull i1 i2 + +checkIntersection :: Integer -> Integer -> Integer -> Integer -> Bool +checkIntersection a b c d = plift $ (i1 `contains` i3) #&& (i2 `contains` i3) + where + i1 :: Term s (PInterval PInteger) + i1 = mkInterval a b + + i2 :: Term s (PInterval PInteger) + i2 = mkInterval c d + + i3 = intersection i1 i2 + +checkBoundedContains :: Integer -> Integer -> Integer -> Integer -> Bool +checkBoundedContains a b c d = actual == expected + where + i1 :: Term s (PInterval PInteger) + i1 = mkInterval a b + i2 :: Term s (PInterval PInteger) + i2 = mkInterval c d + + expected :: Bool + expected = (min a b <= min c d) && (max c d <= max a b) + + actual' :: ClosedTerm PBool + actual' = i1 `contains` i2 + actual = plift actual' + +checkUnboundedUpperContains :: Integer -> Integer -> Integer -> Bool +checkUnboundedUpperContains a b c = actual == expected + where + i1 :: Term s (PInterval PInteger) + i1 = from (pconstant a) + i2 :: Term s (PInterval PInteger) + i2 = mkInterval b c + + expected :: Bool + expected = a <= (min b c) + + actual' :: ClosedTerm PBool + actual' = i1 `contains` i2 + actual = plift actual' + +checkUnboundedLowerContains :: Integer -> Integer -> Integer -> Bool +checkUnboundedLowerContains a b c = actual == expected + where + i1 :: Term s (PInterval PInteger) + i1 = to (pconstant a) + i2 :: Term s (PInterval PInteger) + i2 = mkInterval b c + + expected :: Bool + expected = a >= (max b c) + + actual' :: ClosedTerm PBool + actual' = i1 `contains` i2 + actual = plift actual' + +checkBefore :: Integer -> Integer -> Integer -> Bool +checkBefore a b c = actual == expected + where + i :: Term s (PInterval PInteger) + i = mkInterval b c + + expected :: Bool + expected = a < (min b c) + + actual' :: ClosedTerm PBool + actual' = (pconstant a) `before` i + actual = plift actual' + +checkAfter :: Integer -> Integer -> Integer -> Bool +checkAfter a b c = actual == expected + where + i :: Term s (PInterval PInteger) + i = mkInterval b c + + expected :: Bool + expected = (max b c) < a + + actual' :: ClosedTerm PBool + actual' = (pconstant a) `after` i + actual = plift actual' + +mkInterval :: forall s. Integer -> Integer -> Term s (PInterval PInteger) +mkInterval a' b' = interval (pconstant a) (pconstant b) + where + a = min a' b' + b = max a' b' + +genIntegerList :: Monad m => Int -> PropertyT m [Integer] +genIntegerList n = + (fmap . fmap) toInteger $ + forAll $ + Gen.list + (Range.singleton n) + (Gen.int Range.constantBounded) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 6cc361ff5..91c9a2b1a 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -156,6 +156,7 @@ executable plutarch-test Plutarch.ByteStringSpec Plutarch.EitherSpec Plutarch.Extra.ApiSpec + Plutarch.Extra.IntervalSpec Plutarch.Extra.ListSpec Plutarch.IntegerSpec Plutarch.LiftSpec From e527218573e1d1113c93031f5296528b5041f0bb Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 30 May 2022 13:12:18 +0000 Subject: [PATCH 477/584] `nix flake update` --- flake.lock | 323 +++++++++++++---------------------------------------- 1 file changed, 76 insertions(+), 247 deletions(-) diff --git a/flake.lock b/flake.lock index 232e8ec85..56f5259d0 100644 --- a/flake.lock +++ b/flake.lock @@ -86,11 +86,11 @@ "cardano-base": { "flake": false, "locked": { - "lastModified": 1651043525, - "narHash": "sha256-5B5lJFfUm4jbCBQtqTMvtiY2AWtnsN/1TYftAglT38A=", + "lastModified": 1652788515, + "narHash": "sha256-l0KgomRi6YhEoOlFnBYEXhnZO2+PW68rhfUrbMXjhCQ=", "owner": "input-output-hk", "repo": "cardano-base", - "rev": "8fe904d629194b1fbaaf2d0a4e0ccd17052e9103", + "rev": "631cb6cf1fa01ab346233b610a38b3b4cba6e6ab", "type": "github" }, "original": { @@ -169,15 +169,14 @@ "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "lint-utils": "lint-utils", "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1650932571, - "narHash": "sha256-rdpfJ+10a1uBPtHMNoAcpDE183RzpILRpsMgxj/YJek=", + "lastModified": 1653742730, + "narHash": "sha256-NyhjoMbm3h1aTskIU6jowNClSgA92bUcGcVNPfWNWgE=", "owner": "srid", "repo": "ema", - "rev": "05c8a2127391ee4b593fa6541bc9078eb44ad10f", + "rev": "50d9499db16b4e334776d8e8cffcd144c67f9fc4", "type": "github" }, "original": { @@ -208,16 +207,14 @@ "nixpkgs" ], "pandoc-link-context": "pandoc-link-context", - "pathtree": "pathtree", - "tailwind-haskell": "tailwind-haskell", - "unionmount": "unionmount" + "tailwind-haskell": "tailwind-haskell" }, "locked": { - "lastModified": 1651699367, - "narHash": "sha256-f+whlGwxzv5Lcem+rxBgIgnkU+KcckogtWbRwZ6nM4I=", + "lastModified": 1653742875, + "narHash": "sha256-2IFMkA6/T0nCQHQcC8UhYWh8q8FQyGDBKfcDIhBJ3JM=", "owner": "srid", "repo": "emanote", - "rev": "2b6558fde2999ec22f645cb95322995b780f09f1", + "rev": "ab5155ef400ce83a744362a4b953315d7ee6a8c3", "type": "github" }, "original": { @@ -230,11 +227,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1648199409, - "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", "owner": "edolstra", "repo": "flake-compat", - "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", "type": "github" }, "original": { @@ -259,114 +256,39 @@ "type": "github" } }, - "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1641205782, - "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_4": { - "flake": false, - "locked": { - "lastModified": 1627913399, - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "locked": { - "lastModified": 1648297722, - "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", + "lastModified": 1652776076, + "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", "owner": "numtide", "repo": "flake-utils", - "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", + "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", "type": "github" }, "original": { "owner": "numtide", + "ref": "v1.0.0", "repo": "flake-utils", "type": "github" } }, "flake-utils_2": { "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "lastModified": 1652776076, + "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", "owner": "numtide", "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", "type": "github" }, "original": { "owner": "numtide", + "ref": "v1.0.0", "repo": "flake-utils", "type": "github" } }, "flake-utils_3": { - "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { - "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { - "locked": { - "lastModified": 1631561581, - "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_6": { "locked": { "lastModified": 1644229661, "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", @@ -433,11 +355,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1652663624, - "narHash": "sha256-WeZYALZ6wjXJaMi0ZiSLq5A/ybvES8vN3zPozUgzkFs=", + "lastModified": 1653441966, + "narHash": "sha256-aJFK0wDzoOrtb7ucZzKh5J+S2pThpwNCofl74s1olXU=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "70c6780e617190a1ecc26bd004ece9ea67dcc260", + "rev": "f7fe6ef8de52c43a9efa6fd4ac4902e5957dc573", "type": "github" }, "original": { @@ -465,11 +387,11 @@ "haskell-language-server": { "flake": false, "locked": { - "lastModified": 1652432991, - "narHash": "sha256-YDKZv7r+kA6s8A+iSev9hHFJF1dUPlZqROrATWp1rwk=", + "lastModified": 1653778781, + "narHash": "sha256-oEVBaYRLjD4gC3vQuT0DCgmCSIeWSwGPVXXSKJDFUK0=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "b1bf5499155e259341e4868863b0fd743b6bd65f", + "rev": "8c47d6ce2a8409a285a3f4c3f0e10c25fb4dd848", "type": "github" }, "original": { @@ -502,7 +424,7 @@ "cabal-34": "cabal-34", "cabal-36": "cabal-36", "cardano-shell": "cardano-shell", - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_3", "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", "hackage": "hackage", "hpc-coveralls": "hpc-coveralls", @@ -520,11 +442,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1652698457, - "narHash": "sha256-o9UvhU9QwdzXTFOnRB+MTQ0+fP5DblInxHoXqN6DplA=", + "lastModified": 1653486569, + "narHash": "sha256-342b0LPX6kaBuEX8KZV40FwCCFre1lCtjdTQIDEt9kw=", "owner": "mlabs-haskell", "repo": "haskell.nix", - "rev": "269936645c92aa74b8b0695e96a1c92fd108f8aa", + "rev": "220f8a9cd166e726aea62843bdafa7ecded3375c", "type": "github" }, "original": { @@ -552,30 +474,30 @@ "heist": { "flake": false, "locked": { - "lastModified": 1649279862, - "narHash": "sha256-YPD7Qv1ZcXM4uAlsZ2P/2CKen4H2OY3VHHGluYFVulg=", + "lastModified": 1653169917, + "narHash": "sha256-i52wi4nNC6ATx8gTtmpLnxQZEhKSM0LbpmSu57d5VqI=", "owner": "srid", "repo": "heist", - "rev": "085c7ab88b73079de27c8def27d67f03853fde05", + "rev": "75533cade1a0d9859ff487cbf6f22e98711248d3", "type": "github" }, "original": { "owner": "srid", - "ref": "emanote-release--ghc9", + "ref": "emanote", "repo": "heist", "type": "github" } }, "hercules-ci-effects": { "inputs": { - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1651596301, - "narHash": "sha256-yo61VaBY2zk6oF+LEN89bdCyc33qXd4iUW1UIUINMxM=", + "lastModified": 1653841712, + "narHash": "sha256-XBF4i1MuIRAEbFpj3Z3fVaYxzNEsYapyENtw3vG+q1I=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "9159f70a8ab5c26f8dbca0ef3383998e1c8c95dd", + "rev": "e14d2131b7c81acca3904b584ac45fb72da64dd2", "type": "github" }, "original": { @@ -642,11 +564,11 @@ "iohk-nix": { "flake": false, "locked": { - "lastModified": 1652277463, - "narHash": "sha256-JAO2IuaaqYA3zsA63y2N3QsmyrcsDM6dEVc9n1CTBjw=", + "lastModified": 1653579289, + "narHash": "sha256-wveDdPsgB/3nAGAdFaxrcgLEpdi0aJ5kEVNtI+YqVfo=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "6a5b69dc042f521db028fed68799eb460bce05a7", + "rev": "edb2d2df2ebe42bbdf03a0711115cf6213c9d366", "type": "github" }, "original": { @@ -674,11 +596,11 @@ "ixset-typed": { "flake": false, "locked": { - "lastModified": 1639657838, - "narHash": "sha256-pI2dzJfkR10CHDEX6TV2E01pqcGkj7kheROw05MRTR8=", + "lastModified": 1652177108, + "narHash": "sha256-g0N1jiumsxHzfo9SGVR+q9awRvHEehSRaoW89LXCCnY=", "owner": "well-typed", "repo": "ixset-typed", - "rev": "6cf16f77ae173311742623e5f0b308a21b337aa7", + "rev": "244d3b72fd051b8d78f2d4edb6208269f29d85b7", "type": "github" }, "original": { @@ -687,30 +609,6 @@ "type": "github" } }, - "lint-utils": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "emanote", - "ema", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1650427214, - "narHash": "sha256-9m66rRSSM614ocRXNPAArwnrS6zzCQYYhd3nw8g4QUg=", - "ref": "overengineered", - "rev": "5555def5a25c5437834c06cbe79b3945916ec59f", - "revCount": 28, - "type": "git", - "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" - }, - "original": { - "ref": "overengineered", - "type": "git", - "url": "https://gitlab.homotopic.tech/nix/lint-utils.git" - } - }, "lowdown-src": { "flake": false, "locked": { @@ -730,7 +628,7 @@ "nix": { "inputs": { "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_3", "nixpkgs-regression": "nixpkgs-regression" }, "locked": { @@ -766,17 +664,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1650882267, - "narHash": "sha256-BFKiz8srATQIBuFEN2HgS2EHisK29EjZ/HV34wSr2lU=", + "lastModified": 1652885393, + "narHash": "sha256-YIgvvlk4iQ1Hi7KD9o5gsojc+ApB+jiH1d5stK8uXiw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2ea2f7b6d0cb7ce0712f2aa80303cda08deb0de2", + "rev": "48037fd90426e44e4bf03e6479e88a11453b9b66", "type": "github" }, "original": { "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", - "rev": "2ea2f7b6d0cb7ce0712f2aa80303cda08deb0de2", "type": "github" } }, @@ -861,43 +759,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1647350163, - "narHash": "sha256-OcMI+PFEHTONthXuEQNddt16Ml7qGvanL3x8QOl2Aao=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1649456639, - "narHash": "sha256-rZCjaEAZgOtT9kYTBigksof64SqKAXOuoHhlzHvfl0E=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "c48167590e3258daac6ab12a41bc2b7341e9b2ec", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "rev": "c48167590e3258daac6ab12a41bc2b7341e9b2ec", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1648219316, - "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", + "lastModified": 1653117584, + "narHash": "sha256-5uUrHeHBIaySBTrRExcCoW8fBBYVSDjDYDU5A6iOl+k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", + "rev": "f4dfed73ee886b115a99e5b85fdfbeb683290d83", "type": "github" }, "original": { @@ -905,7 +771,7 @@ "type": "indirect" } }, - "nixpkgs_5": { + "nixpkgs_3": { "locked": { "lastModified": 1632864508, "narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=", @@ -920,7 +786,7 @@ "type": "indirect" } }, - "nixpkgs_6": { + "nixpkgs_4": { "locked": { "lastModified": 1647297614, "narHash": "sha256-ulGq3W5XsrBMU/u5k9d4oPy65pQTkunR4HKKtTq0RwY=", @@ -936,7 +802,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_5": { "flake": false, "locked": { "lastModified": 1645493675, @@ -973,11 +839,11 @@ "pandoc-link-context": { "flake": false, "locked": { - "lastModified": 1650932770, - "narHash": "sha256-/WzE4O23B1OcL3WF8Saz5TRQj0tGH7FtbgRLRson2Mc=", + "lastModified": 1653170888, + "narHash": "sha256-bA/Oj2pt3H2b4lqWqVBYo3Qhvhd01r4vM39+vLuPMtA=", "owner": "srid", "repo": "pandoc-link-context", - "rev": "85bd204339aafd309b8a3dd99ebffa6a50776cb6", + "rev": "c3a3de34b291b2bfec04387af65e0cc0822373c5", "type": "github" }, "original": { @@ -987,26 +853,6 @@ "type": "github" } }, - "pathtree": { - "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1649011952, - "narHash": "sha256-RuNIoPXx0xy5TZ81JH33V8EqXWX5erv8gepM0Aaeat8=", - "owner": "srid", - "repo": "pathtree", - "rev": "d60f22b356f79663aca3f5fde9f23bb4a1412963", - "type": "github" - }, - "original": { - "owner": "srid", - "repo": "pathtree", - "type": "github" - } - }, "plutus": { "inputs": { "cardano-repo-tool": "cardano-repo-tool", @@ -1015,16 +861,16 @@ "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", "iohk-nix": "iohk-nix_2", - "nixpkgs": "nixpkgs_7", + "nixpkgs": "nixpkgs_5", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sphinxcontrib-haddock": "sphinxcontrib-haddock" }, "locked": { - "lastModified": 1652694497, - "narHash": "sha256-35OJBbS+/NnnEtkPkOEgk9DlFGsxr/2Vxu6pRHZKS4E=", + "lastModified": 1653669501, + "narHash": "sha256-qJrjEeo9Jmar1TwihDFzKQNC1ui4M03iClJM1zMd5Uk=", "owner": "input-output-hk", "repo": "plutus", - "rev": "67ed06de8234555ed181d47ec6b49ab1a004b6f9", + "rev": "fed48a71550a12290efc84eefb74305d93cde69d", "type": "github" }, "original": { @@ -1122,11 +968,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1652577319, - "narHash": "sha256-zZxCo7vIdyjZueJD3VoR7YImsS54dRhqqVRcsLqUBP0=", + "lastModified": 1653355076, + "narHash": "sha256-mQdOgAyFkLUJBPrVDZmZQ2JRtgHKOQkil//SDdcjP1U=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "49dfbc9cbf38cbf8180a432fcd6d390326c74fba", + "rev": "71b16ca68d6acd639121db43238896357fe53f54", "type": "github" }, "original": { @@ -1137,16 +983,20 @@ }, "tailwind-haskell": { "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_3" + "ema": [ + "emanote", + "ema" + ], + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1649519562, - "narHash": "sha256-IVZ4D7JkSCn0sjeTw5b0s2TTIU+g4hk78u1znXY4JjQ=", + "lastModified": 1653230344, + "narHash": "sha256-MNwayqvZHsIsP1uyqwQFvzcfFGBMejzZOqAapDjrV5I=", "owner": "srid", "repo": "tailwind-haskell", - "rev": "f5bfc15da3ee6e74a077579fb10269bb450fa5cb", + "rev": "0fb8a18b0e770bafc17521836658f31c56e6dfdb", "type": "github" }, "original": { @@ -1155,27 +1005,6 @@ "repo": "tailwind-haskell", "type": "github" } - }, - "unionmount": { - "inputs": { - "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_4" - }, - "locked": { - "lastModified": 1649012450, - "narHash": "sha256-m0qlPd3jxjyDEkd7cQKLX0GT9a00qnvygec9GCBZ1hc=", - "owner": "srid", - "repo": "unionmount", - "rev": "27584567d9182c12018f988db899593a896f86ff", - "type": "github" - }, - "original": { - "owner": "srid", - "ref": "master", - "repo": "unionmount", - "type": "github" - } } }, "root": "root", From d9691f1e4b9e4ecfc986d2b33a859d938ee306da Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 30 May 2022 20:40:33 +0000 Subject: [PATCH 478/584] use `haskell-nix-extra-hackage` --- flake.lock | 34 +++- flake.nix | 478 +++++++++++++++++++++++++---------------------------- 2 files changed, 254 insertions(+), 258 deletions(-) diff --git a/flake.lock b/flake.lock index 56f5259d0..a3f4d7e9e 100644 --- a/flake.lock +++ b/flake.lock @@ -442,19 +442,42 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1653486569, - "narHash": "sha256-342b0LPX6kaBuEX8KZV40FwCCFre1lCtjdTQIDEt9kw=", - "owner": "mlabs-haskell", + "lastModified": 1653910415, + "narHash": "sha256-04WohZsQTyb2k7u1w+OGpnUgXQ8d9UqTZal4IHCSx+A=", + "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "220f8a9cd166e726aea62843bdafa7ecded3375c", + "rev": "07619e19798ebd9e01fe9708335afbdb5151dead", "type": "github" }, "original": { - "owner": "mlabs-haskell", + "owner": "input-output-hk", "repo": "haskell.nix", "type": "github" } }, + "haskell-nix-extra-hackage": { + "inputs": { + "haskell-nix": [ + "haskell-nix" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1653405678, + "narHash": "sha256-fPpPxuCZDF5b/iQgmUg2jspPObsK0mpcchUti/LR8D0=", + "owner": "mlabs-haskell", + "repo": "haskell-nix-extra-hackage", + "rev": "cf4613eb0d883a8c12c86d7cdbdaaf15fdc70128", + "type": "github" + }, + "original": { + "owner": "mlabs-haskell", + "repo": "haskell-nix-extra-hackage", + "type": "github" + } + }, "haskell-nix_2": { "flake": false, "locked": { @@ -921,6 +944,7 @@ "flat": "flat", "haskell-language-server": "haskell-language-server", "haskell-nix": "haskell-nix", + "haskell-nix-extra-hackage": "haskell-nix-extra-hackage", "hercules-ci-effects": "hercules-ci-effects", "inline-r": "inline-r", "iohk-nix": "iohk-nix", diff --git a/flake.nix b/flake.nix index 0c3051aaf..a8047248e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,10 +1,14 @@ { description = "plutarch"; - inputs.haskell-nix.url = "github:mlabs-haskell/haskell.nix"; + inputs.haskell-nix.url = "github:input-output-hk/haskell.nix"; inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; + inputs.haskell-nix-extra-hackage.url = "github:mlabs-haskell/haskell-nix-extra-hackage"; + inputs.haskell-nix-extra-hackage.inputs.haskell-nix.follows = "haskell-nix"; + inputs.haskell-nix-extra-hackage.inputs.nixpkgs.follows = "nixpkgs"; + inputs.iohk-nix.url = "github:input-output-hk/iohk-nix"; inputs.iohk-nix.flake = false; # we use sphinxcontrib-haddock input @@ -35,7 +39,7 @@ inputs.emanote.url = "github:srid/emanote/master"; - outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, hercules-ci-effects, ... }: + outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, hercules-ci-effects, haskell-nix-extra-hackage, ... }: let supportedSystems = with nixpkgs.lib.systems.supported; tier1 ++ tier2 ++ tier3; @@ -141,246 +145,225 @@ }) ]; - applyPlutarchDep = pkgs: o: o // { - modules = haskellModules ++ o.modules; - cabalProjectLocal = - if isGhc9 o.compiler-nix-name then '' - allow-newer: - cardano-binary:base - , cardano-crypto-class:base - , cardano-prelude:base - , canonical-json:bytestring - , plutus-core:ral - , plutus-core:some - , monoidal-containers:base - , hedgehog:mmorph - , text:deepseq - , hedgehog:template-haskell - , protolude:base - , protolude:ghc-prim - , protolude:transformers-compat - , protolude:hashable - , protolude:bytestring - , int-cast:base - - constraints: - OneTuple >= 0.3.1 - , Only >= 0.1 - , QuickCheck >= 2.14.2 - , StateVar >= 1.2.2 - , Stream >= 0.4.7.2 - , adjunctions >= 4.4 - , aeson >= 2.0.3.0 - , algebraic-graphs >= 0.6 - , ansi-terminal >= 0.11.1 - , ansi-wl-pprint >= 0.6.9 - , assoc >= 1.0.2 - , async >= 2.2.4 - , attoparsec >= 0.14.4 - , barbies >= 2.0.3.1 - , base-compat >= 0.12.1 - , base-compat-batteries >= 0.12.1 - , base-orphans >= 0.8.6 - , base16-bytestring >= 1.0.2.0 - , basement >= 0.0.12 - , bifunctors >= 5.5.11 - , bimap >= 0.4.0 - , bin >= 0.1.2 - , boring >= 0.2 - , boxes >= 0.1.5 - , cabal-doctest >= 1.0.9 - , call-stack >= 0.4.0 - , canonical-json >= 0.6.0.0 - , cardano-binary >= 1.5.0 - , cardano-crypto >= 1.1.0 - , cardano-crypto-class >= 2.0.0 - , cardano-prelude >= 0.1.0.0 - , case-insensitive >= 1.2.1.0 - , cassava >= 0.5.2.0 - , cborg >= 0.2.6.0 - , clock >= 0.8.2 - , colour >= 2.3.6 - , comonad >= 5.0.8 - , composition-prelude >= 3.0.0.2 - , concurrent-output >= 1.10.14 - , constraints >= 0.13.2 - , constraints-extras >= 0.3.2.1 - , contravariant >= 1.5.5 - , cryptonite >= 0.29 - , data-default >= 0.7.1.1 - , data-default-class >= 0.1.2.0 - , data-default-instances-containers >= 0.0.1 - , data-default-instances-dlist >= 0.0.1 - , data-default-instances-old-locale >= 0.0.1 - , data-fix >= 0.3.2 - , dec >= 0.0.4 - , dependent-map >= 0.4.0.0 - , dependent-sum >= 0.7.1.0 - , dependent-sum-template >= 0.1.1.1 - , deriving-aeson >= 0.2.8 - , deriving-compat >= 0.6 - , dictionary-sharing >= 0.1.0.0 - , distributive >= 0.6.2.1 - , dlist >= 1.0 - , dom-lt >= 0.2.3 - , double-conversion >= 2.0.2.0 - , erf >= 2.0.0.0 - , exceptions >= 0.10.4 - , extra >= 1.7.10 - , fin >= 0.2.1 - , flat >= 0.4.5 - , foldl >= 1.4.12 - , formatting >= 7.1.3 - , foundation >= 0.0.26.1 - , free >= 5.1.7 - , half >= 0.3.1 - , hashable >= 1.4.0.2 - , haskell-lexer >= 1.1 - , hedgehog >= 1.0.5 - , indexed-traversable >= 0.1.2 - , indexed-traversable-instances >= 0.1.1 - , integer-logarithms >= 1.0.3.1 - , invariant >= 0.5.5 - , kan-extensions >= 5.2.3 - , lazy-search >= 0.1.2.1 - , lazysmallcheck >= 0.6 - , lens >= 5.1 - , lifted-async >= 0.10.2.2 - , lifted-base >= 0.2.3.12 - , list-t >= 1.0.5.1 - , logict >= 0.7.0.3 - , megaparsec >= 9.2.0 - , memory >= 0.16.0 - , microlens >= 0.4.12.0 - , mmorph >= 1.2.0 - , monad-control >= 1.0.3.1 - , mono-traversable >= 1.0.15.3 - , monoidal-containers >= 0.6.2.0 - , mtl-compat >= 0.2.2 - , newtype >= 0.2.2.0 - , newtype-generics >= 0.6.1 - , nothunks >= 0.1.3 - , old-locale >= 1.0.0.7 - , old-time >= 1.1.0.3 - , optparse-applicative >= 0.16.1.0 - , parallel >= 3.2.2.0 - , parser-combinators >= 1.3.0 - , plutus-core >= 0.1.0.0 - , plutus-ledger-api >= 0.1.0.0 - , plutus-tx >= 0.1.0.0 - , pretty-show >= 1.10 - , prettyprinter >= 1.7.1 - , prettyprinter-configurable >= 0.1.0.0 - , primitive >= 0.7.3.0 - , profunctors >= 5.6.2 - , protolude >= 0.3.0 - , quickcheck-instances >= 0.3.27 - , ral >= 0.2.1 - , random >= 1.2.1 - , rank2classes >= 1.4.4 - , recursion-schemes >= 5.2.2.2 - , reflection >= 2.1.6 - , resourcet >= 1.2.4.3 - , safe >= 0.3.19 - , safe-exceptions >= 0.1.7.2 - , scientific >= 0.3.7.0 - , semialign >= 1.2.0.1 - , semigroupoids >= 5.3.7 - , semigroups >= 0.20 - , serialise >= 0.2.4.0 - , size-based >= 0.1.2.0 - , some >= 1.0.3 - , split >= 0.2.3.4 - , splitmix >= 0.1.0.4 - , stm >= 2.5.0.0 - , strict >= 0.4.0.1 - , syb >= 0.7.2.1 - , tagged >= 0.8.6.1 - , tasty >= 1.4.2.1 - , tasty-golden >= 2.3.5 - , tasty-hedgehog >= 1.1.0.0 - , tasty-hunit >= 0.10.0.3 - , temporary >= 1.3 - , terminal-size >= 0.3.2.1 - , testing-type-modifiers >= 0.1.0.1 - , text-short >= 0.1.5 - , th-abstraction >= 0.4.3.0 - , th-compat >= 0.1.3 - , th-expand-syns >= 0.4.9.0 - , th-extras >= 0.0.0.6 - , th-lift >= 0.8.2 - , th-lift-instances >= 0.1.19 - , th-orphans >= 0.13.12 - , th-reify-many >= 0.1.10 - , th-utilities >= 0.2.4.3 - , these >= 1.1.1.1 - , time-compat >= 1.9.6.1 - , transformers-base >= 0.4.6 - , transformers-compat >= 0.7.1 - , type-equality >= 1 - , typed-process >= 0.2.8.0 - , unbounded-delays >= 0.1.1.1 - , universe-base >= 1.1.3 - , unliftio-core >= 0.2.0.1 - , unordered-containers >= 0.2.16.0 - , uuid-types >= 1.0.5 - , vector >= 0.12.3.1 - , vector-algorithms >= 0.8.0.4 - , void >= 0.7.3 - , wcwidth >= 0.0.2 - , witherable >= 0.4.2 - , wl-pprint-annotated >= 0.1.0.1 - , word-array >= 0.1.0.0 - , secp256k1-haskell >= 0.6 - '' else ""; - extraSources = [ - { - src = inputs.protolude; - subdirs = [ "." ]; - } - { - src = inputs.cardano-prelude; - subdirs = [ - "cardano-prelude" - ]; - } - { - src = inputs.cardano-crypto; - subdirs = [ "." ]; - } - { - src = inputs.flat; - subdirs = [ "." ]; - } - { - src = inputs.cardano-base; - subdirs = [ - "binary" - "cardano-crypto-class" - ]; - } - { - src = inputs.plutus; - subdirs = [ - "plutus-core" - "plutus-ledger-api" - "plutus-tx" - "prettyprinter-configurable" - "word-array" - ]; - } - { - src = inputs.secp256k1-haskell; - subdirs = [ "." ]; - } - ] ++ (if isGhc9 o.compiler-nix-name then [{ - src = inputs.inline-r; - subdirs = [ "inline-r" ]; - }] else [{ - src = inputs.Shrinker; - subdirs = [ "." ]; - }]); - }; + myhackage = system: compiler-nix-name: haskell-nix-extra-hackage.mkHackageFor system compiler-nix-name ( + [ + "${inputs.protolude}" + "${inputs.cardano-prelude}/cardano-prelude" + "${inputs.cardano-crypto}" + "${inputs.flat}" + "${inputs.cardano-base}/binary" + "${inputs.cardano-base}/cardano-crypto-class" + "${inputs.plutus}/plutus-core" + "${inputs.plutus}/plutus-ledger-api" + "${inputs.plutus}/plutus-tx" + "${inputs.plutus}/prettyprinter-configurable" + "${inputs.plutus}/word-array" + "${inputs.secp256k1-haskell}" + ] ++ ( + if isGhc9 compiler-nix-name + then [ "${inputs.inline-r}/inline-r" ] + else [ "${inputs.Shrinker}" ] + ) + ); + + applyPlutarchDep = pkgs: o: + let h = myhackage pkgs.system o.compiler-nix-name; in + o // { + modules = haskellModules ++ [ h.module ] ++ (o.modules or []); + extra-hackages = [ (import h.hackageNix) ] ++ (o.extra-hackages or []); + extra-hackage-tarballs = { _xNJUd_plutarch-hackage = h.hackageTarball; } // (o.extra-hackage-tarballs or {}); + cabalProjectLocal = (o.cabalProjectLocal or "") + ( + if isGhc9 o.compiler-nix-name then '' + allow-newer: + cardano-binary:base + , cardano-crypto-class:base + , cardano-prelude:base + , canonical-json:bytestring + , plutus-core:ral + , plutus-core:some + , monoidal-containers:base + , hedgehog:mmorph + , text:deepseq + , hedgehog:template-haskell + , protolude:base + , protolude:ghc-prim + , protolude:transformers-compat + , protolude:hashable + , protolude:bytestring + , int-cast:base + + constraints: + OneTuple >= 0.3.1 + , Only >= 0.1 + , QuickCheck >= 2.14.2 + , StateVar >= 1.2.2 + , Stream >= 0.4.7.2 + , adjunctions >= 4.4 + , aeson >= 2.0.3.0 + , algebraic-graphs >= 0.6 + , ansi-terminal >= 0.11.1 + , ansi-wl-pprint >= 0.6.9 + , assoc >= 1.0.2 + , async >= 2.2.4 + , attoparsec >= 0.14.4 + , barbies >= 2.0.3.1 + , base-compat >= 0.12.1 + , base-compat-batteries >= 0.12.1 + , base-orphans >= 0.8.6 + , base16-bytestring >= 1.0.2.0 + , basement >= 0.0.12 + , bifunctors >= 5.5.11 + , bimap >= 0.4.0 + , bin >= 0.1.2 + , boring >= 0.2 + , boxes >= 0.1.5 + , cabal-doctest >= 1.0.9 + , call-stack >= 0.4.0 + , canonical-json >= 0.6.0.0 + , cardano-binary >= 1.5.0 + , cardano-crypto >= 1.1.0 + , cardano-crypto-class >= 2.0.0 + , cardano-prelude >= 0.1.0.0 + , case-insensitive >= 1.2.1.0 + , cassava >= 0.5.2.0 + , cborg >= 0.2.6.0 + , clock >= 0.8.2 + , colour >= 2.3.6 + , comonad >= 5.0.8 + , composition-prelude >= 3.0.0.2 + , concurrent-output >= 1.10.14 + , constraints >= 0.13.2 + , constraints-extras >= 0.3.2.1 + , contravariant >= 1.5.5 + , cryptonite >= 0.29 + , data-default >= 0.7.1.1 + , data-default-class >= 0.1.2.0 + , data-default-instances-containers >= 0.0.1 + , data-default-instances-dlist >= 0.0.1 + , data-default-instances-old-locale >= 0.0.1 + , data-fix >= 0.3.2 + , dec >= 0.0.4 + , dependent-map >= 0.4.0.0 + , dependent-sum >= 0.7.1.0 + , dependent-sum-template >= 0.1.1.1 + , deriving-aeson >= 0.2.8 + , deriving-compat >= 0.6 + , dictionary-sharing >= 0.1.0.0 + , distributive >= 0.6.2.1 + , dlist >= 1.0 + , dom-lt >= 0.2.3 + , double-conversion >= 2.0.2.0 + , erf >= 2.0.0.0 + , exceptions >= 0.10.4 + , extra >= 1.7.10 + , fin >= 0.2.1 + , flat >= 0.4.5 + , foldl >= 1.4.12 + , formatting >= 7.1.3 + , foundation >= 0.0.26.1 + , free >= 5.1.7 + , half >= 0.3.1 + , hashable >= 1.4.0.2 + , haskell-lexer >= 1.1 + , hedgehog >= 1.0.5 + , indexed-traversable >= 0.1.2 + , indexed-traversable-instances >= 0.1.1 + , integer-logarithms >= 1.0.3.1 + , invariant >= 0.5.5 + , kan-extensions >= 5.2.3 + , lazy-search >= 0.1.2.1 + , lazysmallcheck >= 0.6 + , lens >= 5.1 + , lifted-async >= 0.10.2.2 + , lifted-base >= 0.2.3.12 + , list-t >= 1.0.5.1 + , logict >= 0.7.0.3 + , megaparsec >= 9.2.0 + , memory >= 0.16.0 + , microlens >= 0.4.12.0 + , mmorph >= 1.2.0 + , monad-control >= 1.0.3.1 + , mono-traversable >= 1.0.15.3 + , monoidal-containers >= 0.6.2.0 + , mtl-compat >= 0.2.2 + , newtype >= 0.2.2.0 + , newtype-generics >= 0.6.1 + , nothunks >= 0.1.3 + , old-locale >= 1.0.0.7 + , old-time >= 1.1.0.3 + , optparse-applicative >= 0.16.1.0 + , parallel >= 3.2.2.0 + , parser-combinators >= 1.3.0 + , plutus-core >= 0.1.0.0 + , plutus-ledger-api >= 0.1.0.0 + , plutus-tx >= 0.1.0.0 + , pretty-show >= 1.10 + , prettyprinter >= 1.7.1 + , prettyprinter-configurable >= 0.1.0.0 + , primitive >= 0.7.3.0 + , profunctors >= 5.6.2 + , protolude >= 0.3.0 + , quickcheck-instances >= 0.3.27 + , ral >= 0.2.1 + , random >= 1.2.1 + , rank2classes >= 1.4.4 + , recursion-schemes >= 5.2.2.2 + , reflection >= 2.1.6 + , resourcet >= 1.2.4.3 + , safe >= 0.3.19 + , safe-exceptions >= 0.1.7.2 + , scientific >= 0.3.7.0 + , semialign >= 1.2.0.1 + , semigroupoids >= 5.3.7 + , semigroups >= 0.20 + , serialise >= 0.2.4.0 + , size-based >= 0.1.2.0 + , some >= 1.0.3 + , split >= 0.2.3.4 + , splitmix >= 0.1.0.4 + , stm >= 2.5.0.0 + , strict >= 0.4.0.1 + , syb >= 0.7.2.1 + , tagged >= 0.8.6.1 + , tasty >= 1.4.2.1 + , tasty-golden >= 2.3.5 + , tasty-hedgehog >= 1.1.0.0 + , tasty-hunit >= 0.10.0.3 + , temporary >= 1.3 + , terminal-size >= 0.3.2.1 + , testing-type-modifiers >= 0.1.0.1 + , text-short >= 0.1.5 + , th-abstraction >= 0.4.3.0 + , th-compat >= 0.1.3 + , th-expand-syns >= 0.4.9.0 + , th-extras >= 0.0.0.6 + , th-lift >= 0.8.2 + , th-lift-instances >= 0.1.19 + , th-orphans >= 0.13.12 + , th-reify-many >= 0.1.10 + , th-utilities >= 0.2.4.3 + , these >= 1.1.1.1 + , time-compat >= 1.9.6.1 + , transformers-base >= 0.4.6 + , transformers-compat >= 0.7.1 + , type-equality >= 1 + , typed-process >= 0.2.8.0 + , unbounded-delays >= 0.1.1.1 + , universe-base >= 1.1.3 + , unliftio-core >= 0.2.0.1 + , unordered-containers >= 0.2.16.0 + , uuid-types >= 1.0.5 + , vector >= 0.12.3.1 + , vector-algorithms >= 0.8.0.4 + , void >= 0.7.3 + , wcwidth >= 0.0.2 + , witherable >= 0.4.2 + , wl-pprint-annotated >= 0.1.0.1 + , word-array >= 0.1.0.0 + , secp256k1-haskell >= 0.6 + '' else "" + ); + }; projectForGhc = ghcName: flagDevelopment: system: let pkgs = nixpkgsFor system; in @@ -414,17 +397,6 @@ ]; inherit tools; - - additional = ps: [ - ps.plutus-ledger-api - - ps.hspec - ps.hspec-core - ps.hspec-contrib - ps.hspec-discover - ps.hspec-hedgehog - ps.hspec-golden - ]; }; }); in pkgSet; From 8a93ac08321cfcfa59b23fbc78b284fd9f864298 Mon Sep 17 00:00:00 2001 From: MangoIV Date: Tue, 31 May 2022 15:24:02 +0200 Subject: [PATCH 479/584] replace haskell.nix fourmolu with nixpkgs fourmolu --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index a8047248e..695efd1ef 100644 --- a/flake.nix +++ b/flake.nix @@ -100,7 +100,6 @@ "terminfo" ]; - tools.fourmolu = { }; tools.haskell-language-server = { modules = [ { inherit nonReinstallablePkgs; } @@ -392,6 +391,7 @@ pkgs'.cabal-install pkgs'.hlint pkgs'.haskellPackages.cabal-fmt + pkgs'.haskellPackages.fourmolu pkgs'.nixpkgs-fmt pkgSet.hsPkgs.hspec-discover.components.exes.hspec-discover ]; @@ -408,11 +408,11 @@ let pkgs = nixpkgsFor system; pkgs' = nixpkgsFor' system; - t = pkgs.haskell-nix.tools ghcVersion { inherit (tools) fourmolu haskell-language-server; }; + t = pkgs.haskell-nix.tools ghcVersion { inherit (tools) haskell-language-server; }; in pkgs.runCommand "format-check" { - nativeBuildInputs = [ pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt t.fourmolu ]; + nativeBuildInputs = [ pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt pkgs'.haskellPackages.fourmolu ]; } '' export LC_CTYPE=C.UTF-8 export LC_ALL=C.UTF-8 From 17cc393a8f6d6f0800150a20385107b04235c6cd Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 31 May 2022 14:47:20 +0000 Subject: [PATCH 480/584] Update stuff --- Plutarch/Api/Internal/Hashing.hs | 4 +- Plutarch/Api/V1.hs | 4 +- Plutarch/Api/V1/Address.hs | 2 +- Plutarch/Api/V1/AssocMap.hs | 2 +- Plutarch/Api/V1/Contexts.hs | 2 +- Plutarch/Api/V1/Crypto.hs | 2 +- Plutarch/Api/V1/DCert.hs | 2 +- Plutarch/Api/V1/Scripts.hs | 2 +- Plutarch/Api/V1/Time.hs | 2 +- Plutarch/Api/V1/Tx.hs | 2 +- Plutarch/Api/V1/Value.hs | 2 +- Plutarch/Crypto.hs | 2 +- Plutarch/DataRepr/Internal.hs | 2 +- Plutarch/Evaluate.hs | 7 +- Plutarch/FFI.hs | 2 +- Plutarch/Internal.hs | 6 +- Plutarch/Internal/Other.hs | 2 +- Plutarch/Lift.hs | 2 +- flake.lock | 72 +++----- flake.nix | 171 ++++++++---------- plutarch-test/Main.hs | 8 +- plutarch-test/README.md | 3 +- plutarch-test/common/Plutarch/Test.hs | 2 +- .../common/Plutarch/Test/Benchmark.hs | 2 +- plutarch-test/common/Plutarch/Test/Golden.hs | 4 +- .../Plutarch/Test/Property/HaskEquiv.hs | 2 +- plutarch-test/common/Plutarch/Test/Run.hs | 4 +- plutarch-test/conditional/Plutarch/FFISpec.hs | 17 +- .../conditional/Plutarch/FieldSpec.hs | 4 +- .../conditional/Plutarch/MonadicSpec.hs | 2 +- plutarch-test/goldens/api.ctx.bench.golden | 14 +- .../api.example.getFields.bench.golden | 2 +- ...i.example.signatory.dev=false.bench.golden | 8 +- ...pi.example.signatory.dev=true.bench.golden | 8 +- plutarch-test/goldens/bool.bench.golden | 34 ++-- plutarch-test/goldens/bytestring.bench.golden | 20 +- plutarch-test/goldens/either.bench.golden | 10 +- .../goldens/extra.api.dev=false.bench.golden | 6 +- .../goldens/extra.api.dev=true.bench.golden | 6 +- .../goldens/extra.listutils.bench.golden | 8 +- plutarch-test/goldens/field.data.bench.golden | 8 +- .../goldens/field.dropFields.bench.golden | 4 +- .../goldens/field.other.bench.golden | 4 +- .../goldens/field.pletFields.bench.golden | 10 +- .../goldens/field.rangeFields.bench.golden | 4 +- .../goldens/field.trips.bench.golden | 14 +- .../goldens/int.examples.bench.golden | 14 +- .../goldens/lift.pconstantData.bench.golden | 10 +- .../goldens/list.dev=false.bench.golden | 50 ++--- .../goldens/list.dev=true.bench.golden | 50 ++--- plutarch-test/goldens/maybe.bench.golden | 8 +- ...monadic.api.example.getFields.bench.golden | 2 +- ...i.example.signatory.dev=false.bench.golden | 4 +- ...pi.example.signatory.dev=true.bench.golden | 4 +- plutarch-test/goldens/pair.bench.golden | 8 +- .../goldens/pisdata.constr.bench.golden | 26 +-- .../goldens/pisdata.equality.bench.golden | 8 +- plutarch-test/goldens/pisdata.lt.bench.golden | 24 +-- .../goldens/pisdata.lte.bench.golden | 36 ++-- .../goldens/pisdata.ppair.bench.golden | 10 +- plutarch-test/goldens/plam.bench.golden | 56 +++--- .../goldens/plutustype.deconstr.bench.golden | 74 ++++---- .../goldens/plutustype.example.bench.golden | 12 +- .../goldens/rational.dev=false.bench.golden | 48 ++--- .../goldens/rational.dev=true.bench.golden | 48 ++--- .../goldens/rec.Data.dev=false.bench.golden | 16 +- .../goldens/rec.Data.dev=true.bench.golden | 16 +- .../goldens/rec.LetRec.dev=false.bench.golden | 16 +- .../goldens/rec.LetRec.dev=true.bench.golden | 16 +- .../goldens/rec.nested.dev=false.bench.golden | 44 ++--- .../goldens/rec.nested.dev=true.bench.golden | 44 ++--- .../goldens/rec.simple.dev=false.bench.golden | 20 +- .../goldens/rec.simple.dev=true.bench.golden | 20 +- .../goldens/recursion.example.bench.golden | 6 +- plutarch-test/goldens/scripts.bench.golden | 12 +- .../goldens/scripts.uplc.eval.golden | 2 +- plutarch-test/goldens/scripts.uplc.golden | 2 +- plutarch-test/goldens/show.bench.golden | 70 +++---- .../goldens/show.dev=false.bench.golden | 2 +- .../goldens/show.dev=true.bench.golden | 2 +- plutarch-test/goldens/str.bench.golden | 10 +- .../goldens/trace.dev=false.bench.golden | 20 +- .../goldens/trace.dev=true.bench.golden | 20 +- plutarch-test/goldens/unit.bench.golden | 10 +- .../goldens/uplc-behaviour.bench.golden | 6 +- plutarch-test/goldens/uplc-misc.bench.golden | 8 +- .../plutarch-base/Plutarch/ApiSpec.hs | 6 +- .../plutarch-base/Plutarch/LiftSpec.hs | 2 +- .../plutarch-base/Plutarch/PIsDataSpec.hs | 2 +- .../plutarch-base/Plutarch/POrdSpec.hs | 2 +- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 8 +- .../plutarch-base/Plutarch/ScriptsSpec.hs | 2 +- plutarch-test/plutarch-test.cabal | 10 +- 93 files changed, 668 insertions(+), 718 deletions(-) diff --git a/Plutarch/Api/Internal/Hashing.hs b/Plutarch/Api/Internal/Hashing.hs index bacc42e06..d23b7168c 100644 --- a/Plutarch/Api/Internal/Hashing.hs +++ b/Plutarch/Api/Internal/Hashing.hs @@ -15,8 +15,8 @@ import Data.ByteArray (convert) import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as Lazy -import qualified Plutus.V1.Ledger.Api as Plutus -import qualified Plutus.V1.Ledger.Scripts as Plutus +import qualified PlutusLedgerApi.V1 as Plutus +import qualified PlutusLedgerApi.V1.Scripts as Plutus import qualified PlutusTx.Builtins as PlutusTx _plutusHashWith :: HashAlgorithm alg => alg -> ByteString -> PlutusTx.BuiltinByteString diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 0f9336f39..af2ce9b54 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -97,8 +97,8 @@ import qualified Plutarch.Api.V1.Value as Value import Data.Coerce (coerce) -import qualified Plutus.V1.Ledger.Api as Plutus -import qualified Plutus.V1.Ledger.Scripts as Plutus +import qualified PlutusLedgerApi.V1 as Plutus +import qualified PlutusLedgerApi.V1.Scripts as Plutus import Plutarch (compile) import Plutarch.Api.Internal.Hashing (hashData, hashScriptWithPrefix) diff --git a/Plutarch/Api/V1/Address.hs b/Plutarch/Api/V1/Address.hs index 7bbbebe91..2513a5002 100644 --- a/Plutarch/Api/V1/Address.hs +++ b/Plutarch/Api/V1/Address.hs @@ -10,7 +10,7 @@ module Plutarch.Api.V1.Address ( import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Api.V1.Maybe (PMaybeData) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 7853d5489..e2c494893 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -5,7 +5,7 @@ module Plutarch.Api.V1.AssocMap ( PMap (PMap), ) where -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import qualified PlutusTx.AssocMap as PlutusMap import Plutarch.Builtin (PBuiltinMap) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index b934aceee..4c6d28762 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -11,7 +11,7 @@ module Plutarch.Api.V1.Contexts ( import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Address ( PStakingCredential, diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index 5ad4aed7d..59e359c5b 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -7,7 +7,7 @@ module Plutarch.Api.V1.Crypto ( pubKeyHash, ) where -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import Data.Coerce (coerce) import Plutarch.Api.Internal.Hashing (hashLedgerBytes) diff --git a/Plutarch/Api/V1/DCert.hs b/Plutarch/Api/V1/DCert.hs index 5c0e8e4cf..17bee271a 100644 --- a/Plutarch/Api/V1/DCert.hs +++ b/Plutarch/Api/V1/DCert.hs @@ -16,7 +16,7 @@ module Plutarch.Api.V1.DCert ( import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Address (PStakingCredential) import Plutarch.Api.V1.Crypto (PPubKeyHash) diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index f4c291432..a3ebd7892 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -11,7 +11,7 @@ module Plutarch.Api.V1.Scripts ( PValidatorHash (PValidatorHash), ) where -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), diff --git a/Plutarch/Api/V1/Time.hs b/Plutarch/Api/V1/Time.hs index 8bfa28d98..c825ef613 100644 --- a/Plutarch/Api/V1/Time.hs +++ b/Plutarch/Api/V1/Time.hs @@ -6,7 +6,7 @@ module Plutarch.Api.V1.Time ( PPOSIXTimeRange, ) where -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Interval (PInterval) import Plutarch.Lift ( diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 4f06e6054..9650b143c 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -11,7 +11,7 @@ module Plutarch.Api.V1.Tx ( import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I)) -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Address (PAddress) import Plutarch.Api.V1.Maybe (PMaybeData) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 4281dcc2c..b6f2365d0 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -7,7 +7,7 @@ module Plutarch.Api.V1.Value ( PTokenName (PTokenName), ) where -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.AssocMap (PMap) import Plutarch.Lift ( diff --git a/Plutarch/Crypto.hs b/Plutarch/Crypto.hs index a1b44f2e4..01e117119 100644 --- a/Plutarch/Crypto.hs +++ b/Plutarch/Crypto.hs @@ -30,4 +30,4 @@ pblake2b_256 = punsafeBuiltin PLC.Blake2b_256 -- | Verify the signature against the public key and message. pverifySignature :: Term s (PByteString :--> PByteString :--> PByteString :--> PBool) -pverifySignature = punsafeBuiltin PLC.VerifySignature +pverifySignature = punsafeBuiltin PLC.VerifyEd25519Signature diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index dd142f759..c6b18e8c9 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -129,7 +129,7 @@ import Plutarch.Trace (ptraceError) import Plutarch.TryFrom (PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) import Plutarch.Unit (PUnit (PUnit)) import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) -import qualified Plutus.V1.Ledger.Api as Ledger +import qualified PlutusLedgerApi.V1 as Ledger import Plutarch.Reducible (Reduce, Reducible) diff --git a/Plutarch/Evaluate.hs b/Plutarch/Evaluate.hs index 16086f962..7c2ed62ed 100644 --- a/Plutarch/Evaluate.hs +++ b/Plutarch/Evaluate.hs @@ -3,9 +3,10 @@ module Plutarch.Evaluate (evaluateBudgetedScript, evaluateScript, evalScript, evalScript', EvalError) where import Data.Text (Text) -import Plutus.V1.Ledger.Scripts (Script (Script)) -import qualified Plutus.V1.Ledger.Scripts as Scripts +import PlutusLedgerApi.V1.Scripts (Script (Script)) +import qualified PlutusLedgerApi.V1.Scripts as Scripts import qualified PlutusCore as PLC +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultCekParameters) import PlutusCore.Evaluation.Machine.ExBudget ( ExBudget (ExBudget), ExRestrictingBudget (ExRestrictingBudget), @@ -55,5 +56,5 @@ evalTerm :: , [Text] ) evalTerm budget t = - case Cek.runCekDeBruijn PLC.defaultCekParameters (Cek.restricting (ExRestrictingBudget budget)) Cek.logEmitter t of + case Cek.runCekDeBruijn defaultCekParameters (Cek.restricting (ExRestrictingBudget budget)) Cek.logEmitter t of (errOrRes, Cek.RestrictingSt (ExRestrictingBudget final), logs) -> (errOrRes, budget `minusExBudget` final, logs) diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 3a810edbd..a9c386835 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -63,7 +63,7 @@ import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Show (PShow) import Plutarch.String (PString) import Plutarch.Unit (PUnit) -import Plutus.V1.Ledger.Scripts (Script (unScript), fromCompiledCode) +import PlutusLedgerApi.V1.Scripts (Script (unScript), fromCompiledCode) import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinByteString, BuiltinData, BuiltinUnit) import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) import PlutusTx.Prelude (BuiltinString) diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index fbd35db55..379063ce2 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -45,7 +45,7 @@ import GHC.Stack (HasCallStack) import GHC.Word (Word64) import Plutarch.Evaluate (evalScript) import Plutarch.Reducible (Reducible (Reduce)) -import Plutus.V1.Ledger.Scripts (Script (Script)) +import PlutusLedgerApi.V1.Scripts (Script (Script)) import PlutusCore (Some (Some), ValueOf (ValueOf)) import qualified PlutusCore as PLC import PlutusCore.DeBruijn (DeBruijn (DeBruijn), Index (Index)) @@ -204,7 +204,9 @@ plam' f = Term $ \i -> getArityBuiltin (RBuiltin PLC.Sha2_256) = Just 0 getArityBuiltin (RBuiltin PLC.Sha3_256) = Just 0 getArityBuiltin (RBuiltin PLC.Blake2b_256) = Just 0 - getArityBuiltin (RBuiltin PLC.VerifySignature) = Just 2 + getArityBuiltin (RBuiltin PLC.VerifyEd25519Signature) = Just 2 + getArityBuiltin (RBuiltin PLC.VerifyEcdsaSecp256k1Signature) = Just 2 + getArityBuiltin (RBuiltin PLC.VerifySchnorrSecp256k1Signature) = Just 2 getArityBuiltin (RBuiltin PLC.AppendString) = Just 1 getArityBuiltin (RBuiltin PLC.EqualsString) = Just 1 getArityBuiltin (RBuiltin PLC.EncodeUtf8) = Just 0 diff --git a/Plutarch/Internal/Other.hs b/Plutarch/Internal/Other.hs index 8b8a77bcf..d77066e50 100644 --- a/Plutarch/Internal/Other.hs +++ b/Plutarch/Internal/Other.hs @@ -39,7 +39,7 @@ import Plutarch.Internal (ClosedTerm, PType, Term, compile, phoistAcyclic, punsa import qualified Plutarch.Internal as PI import Plutarch.Internal.PLam (pinl, plam, (#), (#$)) import Plutarch.Internal.PlutusType (PCon (pcon), PMatch (pmatch), PlutusType (PInner, pcon', pmatch')) -import Plutus.V1.Ledger.Scripts (Script (Script)) +import PlutusLedgerApi.V1.Scripts (Script (Script)) import PlutusCore.Pretty (prettyPlcReadableDebug) -- | Prettyprint a compiled Script via the PLC pretty printer diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 79c6b3cb9..38bd98759 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -36,7 +36,7 @@ import Data.Kind (Constraint, Type) import GHC.Stack (HasCallStack) import Plutarch.Evaluate (EvalError, evalScript) import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInternal) -import qualified Plutus.V1.Ledger.Scripts as Scripts +import qualified PlutusLedgerApi.V1.Scripts as Scripts import qualified PlutusCore as PLC import PlutusCore.Builtin (KnownTypeError, readKnownConstant) import PlutusCore.Evaluation.Machine.Exception (_UnliftingErrorE) diff --git a/flake.lock b/flake.lock index a3f4d7e9e..e173189e8 100644 --- a/flake.lock +++ b/flake.lock @@ -16,22 +16,6 @@ "type": "github" } }, - "Shrinker": { - "flake": false, - "locked": { - "lastModified": 1645834494, - "narHash": "sha256-q1GQipRjHJDuspJOD/cwCUKryW8lSFLe1Qf/IBkSeaM=", - "owner": "Plutonomicon", - "repo": "Shrinker", - "rev": "f23017cb938c83e979a89e9ec941252122fddddb", - "type": "github" - }, - "original": { - "owner": "Plutonomicon", - "repo": "Shrinker", - "type": "github" - } - }, "cabal-32": { "flake": false, "locked": { @@ -119,17 +103,17 @@ "cardano-prelude": { "flake": false, "locked": { - "lastModified": 1641566029, - "narHash": "sha256-CylaHhO4zbZ1dEAv8yWp1swP1xys/s2Sbxg3a2pdnCI=", - "owner": "locallycompact", + "lastModified": 1653997332, + "narHash": "sha256-E+YSfUsvxdoOr7n7fz4xd7zb4z8XBRGNYOKipc2A1pw=", + "owner": "mlabs-haskell", "repo": "cardano-prelude", - "rev": "93f95047bb36a055bdd56fb0cafd887c072cdce2", + "rev": "713c7ae79a4d538fcd653c976a652913df1567b9", "type": "github" }, "original": { - "owner": "locallycompact", + "owner": "mlabs-haskell", "repo": "cardano-prelude", - "rev": "93f95047bb36a055bdd56fb0cafd887c072cdce2", + "rev": "713c7ae79a4d538fcd653c976a652913df1567b9", "type": "github" } }, @@ -431,8 +415,7 @@ "hydra": "hydra", "nix-tools": "nix-tools", "nixpkgs": [ - "haskell-nix", - "nixpkgs-unstable" + "nixpkgs" ], "nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2105": "nixpkgs-2105", @@ -568,22 +551,6 @@ "type": "indirect" } }, - "inline-r": { - "flake": false, - "locked": { - "lastModified": 1644844599, - "narHash": "sha256-q39Dp5hj4u5Lx6wWwPoc9CbyocH3KutYDmWVd3xevgo=", - "owner": "tweag", - "repo": "haskellR", - "rev": "c3ba1023480e26ade420896bcb629ceaad59f308", - "type": "github" - }, - "original": { - "owner": "tweag", - "repo": "haskellR", - "type": "github" - } - }, "iohk-nix": { "flake": false, "locked": { @@ -826,6 +793,22 @@ } }, "nixpkgs_5": { + "locked": { + "lastModified": 1653845079, + "narHash": "sha256-7ghaQZ+7JXLI9FgNH8+RQHAt3/ubT92j8NtjZleP6t4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b62ada430501de88dfbb08cea4eb98ead3a5e3e7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { "flake": false, "locked": { "lastModified": 1645493675, @@ -884,7 +867,7 @@ "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", "iohk-nix": "iohk-nix_2", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sphinxcontrib-haddock": "sphinxcontrib-haddock" }, @@ -936,7 +919,6 @@ }, "root": { "inputs": { - "Shrinker": "Shrinker", "cardano-base": "cardano-base", "cardano-crypto": "cardano-crypto", "cardano-prelude": "cardano-prelude", @@ -946,12 +928,8 @@ "haskell-nix": "haskell-nix", "haskell-nix-extra-hackage": "haskell-nix-extra-hackage", "hercules-ci-effects": "hercules-ci-effects", - "inline-r": "inline-r", "iohk-nix": "iohk-nix", - "nixpkgs": [ - "haskell-nix", - "nixpkgs-unstable" - ], + "nixpkgs": "nixpkgs_5", "plutus": "plutus", "protolude": "protolude", "secp256k1-haskell": "secp256k1-haskell" diff --git a/flake.nix b/flake.nix index a8047248e..498c7d303 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,11 @@ { description = "plutarch"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + inputs.haskell-nix.url = "github:input-output-hk/haskell.nix"; - inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; + inputs.haskell-nix.inputs.nixpkgs.follows = "nixpkgs"; + inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; inputs.haskell-nix-extra-hackage.url = "github:mlabs-haskell/haskell-nix-extra-hackage"; @@ -13,30 +16,27 @@ inputs.iohk-nix.flake = false; # we use sphinxcontrib-haddock input inputs.plutus.url = "github:input-output-hk/plutus"; - # https://github.com/input-output-hk/cardano-prelude/pull/162 - inputs.cardano-prelude.url = "github:locallycompact/cardano-prelude?rev=93f95047bb36a055bdd56fb0cafd887c072cdce2"; + # https://github.com/input-output-hk/cardano-prelude/pull/163 + inputs.cardano-prelude.url = "github:mlabs-haskell/cardano-prelude?rev=713c7ae79a4d538fcd653c976a652913df1567b9"; inputs.cardano-prelude.flake = false; inputs.cardano-base.url = "github:input-output-hk/cardano-base"; inputs.cardano-base.flake = false; inputs.cardano-crypto.url = "github:input-output-hk/cardano-crypto?rev=07397f0e50da97eaa0575d93bee7ac4b2b2576ec"; inputs.cardano-crypto.flake = false; - inputs.flat.url = "github:Quid2/flat"; - inputs.flat.flake = false; - inputs.Shrinker.url = "github:Plutonomicon/Shrinker"; - inputs.Shrinker.flake = false; inputs.haskell-language-server.url = "github:haskell/haskell-language-server"; inputs.haskell-language-server.flake = false; inputs.secp256k1-haskell.url = "github:haskoin/secp256k1-haskell"; inputs.secp256k1-haskell.flake = false; - inputs.inline-r.url = "github:tweag/haskellR"; - inputs.inline-r.flake = false; - # https://github.com/protolude/protolude/pull/133#issuecomment-1112150422 RC not uploaded to hackage yet... inputs.protolude.url = "github:protolude/protolude"; inputs.protolude.flake = false; + # 0.4.5 hasn't been published to Hackage... + inputs.flat.url = "github:Quid2/flat"; + inputs.flat.flake = false; + inputs.emanote.url = "github:srid/emanote/master"; outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, hercules-ci-effects, haskell-nix-extra-hackage, ... }: @@ -45,84 +45,72 @@ perSystem = nixpkgs.lib.genAttrs supportedSystems; - nixpkgsFor = system: import nixpkgs { + pkgsFor = system: import nixpkgs { inherit system; overlays = [ haskell-nix.overlay (import "${iohk-nix}/overlays/crypto") ]; - inherit (haskell-nix) config; + # This only does bad things for us... + # inherit (haskell-nix) config; }; - nixpkgsFor' = system: import nixpkgs { inherit system; }; + pkgsFor' = system: import nixpkgs { inherit system; }; - ghcVersion = "ghc922"; - isGhc9 = x: builtins.trace "Checking whether ${x} is GHC 9.*" (true); + defaultGhcVersion = "ghc922"; + isGhc9 = x: builtins.trace "Checking whether ${x} is GHC 9.*" (builtins.substring 3 1 x == "9"); # https://github.com/input-output-hk/haskell.nix/issues/1177 nonReinstallablePkgs = [ - "rts" - "ghc-heap" - "ghc-prim" - "integer-gmp" - "integer-simple" - "base" - "deepseq" "array" - "ghc-boot-th" - "pretty" - "template-haskell" - # ghcjs custom packages - "ghcjs-prim" - "ghcjs-th" - "ghc-bignum" - "exceptions" - "stm" - "ghc-boot" - "ghc" - "Cabal" - "Win32" "array" + "base" "binary" "bytestring" + "Cabal" "containers" + "deepseq" "directory" + "exceptions" "filepath" + "ghc" + "ghc-bignum" + "ghc-boot" "ghc-boot" + "ghc-boot-th" "ghc-compact" + "ghc-heap" + # "ghci" + # "haskeline" + "ghcjs-prim" + "ghcjs-th" + "ghc-prim" "ghc-prim" - # "ghci" "haskeline" "hpc" + "integer-gmp" + "integer-simple" "mtl" "parsec" + "pretty" "process" + "rts" + "stm" + "template-haskell" + "terminfo" "text" "time" "transformers" "unix" + "Win32" "xhtml" - "terminfo" ]; - tools.fourmolu = { }; - tools.haskell-language-server = { - modules = [ - { inherit nonReinstallablePkgs; } - ]; - compiler-nix-name = ghcVersion; - # For some reason it doesn't use the latest version automatically. - index-state = - let l = builtins.attrNames (import "${haskell-nix.inputs.hackage}/index-state-hashes.nix"); in - builtins.elemAt l (builtins.length l - 1); - name = "haskell-language-server"; - version = "latest"; - cabalProjectLocal = '' - allow-newer: *:* - - constraints: - primitive-unlifted < 1.0.0.0 - - package haskell-language-server - flags: +use-ghc-stub +pedantic +ignore-plugins-ghc-bounds -alternateNumberFormat -brittany -eval -haddockComments -hlint -retrie -splice -stylishhaskell -tactic - ''; - src = "${inputs.haskell-language-server}"; - }; + hlsFor' = compiler-nix-name: system: + let pkgs = pkgsFor system; in + pkgs.haskell-nix.cabalProject' { + modules = [ + { inherit nonReinstallablePkgs; } + ]; + inherit compiler-nix-name; + src = "${inputs.haskell-language-server}"; + }; + hlsFor = compiler-nix-name: system: (hlsFor' compiler-nix-name system).hsPkgs.haskell-language-server.components.exes.haskell-language-server; haskellModules = [ ({ config, pkgs, hsPkgs, ... }: { @@ -147,10 +135,10 @@ myhackage = system: compiler-nix-name: haskell-nix-extra-hackage.mkHackageFor system compiler-nix-name ( [ + "${inputs.flat}" "${inputs.protolude}" "${inputs.cardano-prelude}/cardano-prelude" "${inputs.cardano-crypto}" - "${inputs.flat}" "${inputs.cardano-base}/binary" "${inputs.cardano-base}/cardano-crypto-class" "${inputs.plutus}/plutus-core" @@ -159,11 +147,8 @@ "${inputs.plutus}/prettyprinter-configurable" "${inputs.plutus}/word-array" "${inputs.secp256k1-haskell}" - ] ++ ( - if isGhc9 compiler-nix-name - then [ "${inputs.inline-r}/inline-r" ] - else [ "${inputs.Shrinker}" ] - ) + "${inputs.plutus}/plutus-tx-plugin" # necessary for FFI tests + ] ); applyPlutarchDep = pkgs: o: @@ -181,16 +166,8 @@ , canonical-json:bytestring , plutus-core:ral , plutus-core:some - , monoidal-containers:base - , hedgehog:mmorph - , text:deepseq - , hedgehog:template-haskell - , protolude:base - , protolude:ghc-prim - , protolude:transformers-compat - , protolude:hashable - , protolude:bytestring , int-cast:base + , inline-r:singletons constraints: OneTuple >= 0.3.1 @@ -361,20 +338,17 @@ , wl-pprint-annotated >= 0.1.0.1 , word-array >= 0.1.0.0 , secp256k1-haskell >= 0.6 + , inline-r >= 0.10.5 '' else "" ); }; - projectForGhc = ghcName: flagDevelopment: system: - let pkgs = nixpkgsFor system; in - let pkgs' = nixpkgsFor' system; in - let addSubDir = target: subdir: source: - if source.src == target - then source // { subdirs = source.subdirs ++ [ subdir ]; } - else source; in + projectForGhc = compiler-nix-name: flagDevelopment: system: + let pkgs = pkgsFor system; in + let pkgs' = pkgsFor' system; in let pkgSet = pkgs.haskell-nix.cabalProject' (applyPlutarchDep pkgs { src = ./.; - compiler-nix-name = ghcName; + inherit compiler-nix-name; modules = [ { packages.plutarch-test.flags.development = flagDevelopment; @@ -392,27 +366,25 @@ pkgs'.cabal-install pkgs'.hlint pkgs'.haskellPackages.cabal-fmt + pkgs'.haskellPackages.fourmolu_0_6_0_0 pkgs'.nixpkgs-fmt pkgSet.hsPkgs.hspec-discover.components.exes.hspec-discover + # (hlsFor compiler-nix-name system) ]; - - inherit tools; }; }); in pkgSet; - projectFor = projectForGhc ghcVersion; + projectFor = projectForGhc defaultGhcVersion; projectFor810 = projectForGhc "ghc8107"; formatCheckFor = system: let - pkgs = nixpkgsFor system; - pkgs' = nixpkgsFor' system; - t = pkgs.haskell-nix.tools ghcVersion { inherit (tools) fourmolu haskell-language-server; }; + pkgs' = pkgsFor' system; in - pkgs.runCommand "format-check" + pkgs'.runCommand "format-check" { - nativeBuildInputs = [ pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt t.fourmolu ]; + nativeBuildInputs = [ pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt pkgs'.haskellPackages.fourmolu_0_6_0_0 ]; } '' export LC_CTYPE=C.UTF-8 export LC_ALL=C.UTF-8 @@ -425,11 +397,11 @@ haddock = system: let - pkgs = nixpkgsFor system; + pkgs = pkgsFor system; sphinxcontrib-haddock = pkgs.callPackage inputs.plutus.inputs.sphinxcontrib-haddock { pythonPackages = pkgs.python3Packages; }; haddock-combine = pkgs.callPackage "${inputs.plutus}/nix/lib/haddock-combine.nix" { - ghc = pkgs.haskell-nix.compiler.${ghcVersion}; + ghc = pkgs.haskell-nix.compiler.${defaultGhcVersion}; inherit (sphinxcontrib-haddock) sphinxcontrib-haddock; }; # If you use this, filter out pretty-show, it doesn't work if not. @@ -461,7 +433,7 @@ }; plutarchWebsiteStatic = system: let - pkgs = nixpkgsFor system; + pkgs = pkgsFor system; configFile = (pkgs.formats.yaml { }).generate "emanote-configFile" { template.baseUrl = "/"; # Use this when pushing to github.io: "/plutarch/"; }; @@ -481,7 +453,7 @@ rec { type = "app"; # '' is required for escaping ${} in nix - script = (nixpkgsFor system).writers.writeBash "emanoteLiveReload.sh" '' + script = (pkgsFor system).writers.writeBash "emanoteLiveReload.sh" '' set -xe export PORT="''${EMANOTE_PORT:-7072}" ${inputs.emanote.defaultPackage.${system}}/bin/emanote --layers ${path} run --port "$PORT" @@ -491,7 +463,7 @@ # Checks the shell script using ShellCheck checkedShellScript = system: name: text: - ((nixpkgsFor system).writeShellApplication { + ((pkgsFor system).writeShellApplication { inherit name text; }) + "/bin/${name}"; @@ -504,7 +476,6 @@ type = "app"; program = checkedShellScript system "plutarch-test-${name}" '' - cd ${self}/plutarch-test ${flake.packages."plutarch-test:exe:plutarch-test"}/bin/plutarch-test; ''; }; @@ -514,10 +485,10 @@ # # In effect, this allows us to run an 'app' as part of the build process (eg: in CI). flakeApp2Derivation = system: appName: - (nixpkgsFor system).runCommand appName { } "${self.apps.${system}.${appName}.program} | tee $out"; + (pkgsFor system).runCommand appName { } "${self.apps.${system}.${appName}.program} | tee $out"; in { - inherit tools applyPlutarchDep; + inherit hlsFor hlsFor' applyPlutarchDep; # Build matrix. Plutarch is built against different GHC versions, and 'development' flag. projectMatrix = { @@ -558,7 +529,7 @@ # we provide this attribute for running the checks locally, using: # nix build .#check.x86_64-linux check = perSystem (system: - (nixpkgsFor system).runCommand "combined-test" + (pkgsFor system).runCommand "combined-test" { checksss = builtins.attrValues self.checks.${system}; } '' diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 8edbf31ae..dfdca9725 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -11,8 +11,8 @@ import qualified Plutarch.MonadicSpec as MonadicSpec import Plutarch.Test.Run (noUnusedGoldens, hspecAndReturnForest) import Test.Hspec (Spec, describe) #else -import qualified Plutarch.FFISpec as FFISpec -import Test.Hspec (Spec, describe, hspec) +-- import qualified Plutarch.FFISpec as FFISpec +import Test.Hspec (Spec, hspec) #endif import GHC.IO.Encoding (setLocaleEncoding, utf8) @@ -39,6 +39,6 @@ spec = do FieldSpec.spec MonadicSpec.spec #else - describe "GHC-8-only" $ do - FFISpec.spec + -- describe "GHC-8-only" $ do + -- FFISpec.spec #endif diff --git a/plutarch-test/README.md b/plutarch-test/README.md index c49379849..e49aeadc6 100644 --- a/plutarch-test/README.md +++ b/plutarch-test/README.md @@ -3,6 +3,7 @@ To run the tests using Nix: ```sh-session +$ cd $projectroot/plutarch-test # Runs tests $ nix run .#test-ghc9-nodev # To run the above in GHC 8.10 instead: @@ -48,4 +49,4 @@ When writing tests you may want to clean up working copy goldens, and start from ```sh-session rm plutarch-test/goldens/*.golden; git restore --source=HEAD --staged --worktree -- plutarch-test/goldens/ -``` \ No newline at end of file +``` diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index c30c573f6..3e575b42d 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -63,7 +63,7 @@ import Plutarch.Test.Golden ( (@|), ) import Plutarch.Test.Run (hspecAndReturnForest, noUnusedGoldens, noUnusedGoldens') -import qualified Plutus.V1.Ledger.Scripts as Scripts +import qualified PlutusLedgerApi.V1.Scripts as Scripts import Test.Hspec (Expectation, Spec, describe, expectationFailure, shouldBe, shouldSatisfy) import Test.Tasty.HUnit (assertFailure) diff --git a/plutarch-test/common/Plutarch/Test/Benchmark.hs b/plutarch-test/common/Plutarch/Test/Benchmark.hs index 544a706b0..dd1cb8289 100644 --- a/plutarch-test/common/Plutarch/Test/Benchmark.hs +++ b/plutarch-test/common/Plutarch/Test/Benchmark.hs @@ -14,7 +14,7 @@ import qualified Data.ByteString.Lazy as LB import qualified Data.ByteString.Short as SBS import Data.Int (Int64) import GHC.Generics (Generic) -import Plutus.V1.Ledger.Api (ExBudget (ExBudget), ExCPU, ExMemory, Script) +import PlutusLedgerApi.V1 (ExBudget (ExBudget), ExCPU, ExMemory, Script) data Benchmark = Benchmark { exBudgetCPU :: ExCPU diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 5b1f31db9..c5205a37c 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -52,8 +52,8 @@ import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Prelude import Plutarch.Test.Benchmark (Benchmark, mkBenchmark, scriptSize) import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) -import Plutus.V1.Ledger.Scripts (Script) -import qualified Plutus.V1.Ledger.Scripts as Scripts +import PlutusLedgerApi.V1.Scripts (Script) +import qualified PlutusLedgerApi.V1.Scripts as Scripts import Test.Hspec (Expectation, Spec, describe, it) import Test.Hspec.Core.Spec (SpecM, getSpecDescriptionPath) diff --git a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs index ee68c636f..4b7f3bb41 100644 --- a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs +++ b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs @@ -31,7 +31,7 @@ import Control.Monad.IO.Class (liftIO) import Data.SOP (NP (Nil, (:*))) import Data.Text (Text) import Hedgehog (Gen, Property, PropertyT, annotate, annotateShow, assert, forAll, property, (===)) -import Plutus.V1.Ledger.Scripts (Script (Script, unScript)) +import PlutusLedgerApi.V1.Scripts (Script (Script, unScript)) import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) diff --git a/plutarch-test/common/Plutarch/Test/Run.hs b/plutarch-test/common/Plutarch/Test/Run.hs index 5148255e9..9bfab9216 100644 --- a/plutarch-test/common/Plutarch/Test/Run.hs +++ b/plutarch-test/common/Plutarch/Test/Run.hs @@ -20,7 +20,7 @@ import System.Environment (getArgs, withArgs) import System.Exit (ExitCode (ExitFailure), exitWith) import System.FilePath (()) import Test.Hspec (Spec) -import Test.Hspec.Core.Runner (defaultConfig, evalSpec, evaluateSummary, readConfig, runSpecForest) +import Test.Hspec.Core.Runner (defaultConfig, evalSpec, evaluateResult, readConfig, runSpecForest) import Test.Hspec.Core.Spec (SpecTree, Tree (Leaf, Node, NodeWithCleanup)) {- | Like `hspec`, but returns the test forest after running the tests. @@ -32,7 +32,7 @@ hspecAndReturnForest spec0 = do (config, spec) <- evalSpec defaultConfig spec0 getArgs >>= readConfig config >>= withArgs [] . runSpecForest spec - >>= evaluateSummary -- use evaluateResult instead, if you are on #656 + >>= evaluateResult return spec {- | Ensures that there are no unused goldens left behind. diff --git a/plutarch-test/conditional/Plutarch/FFISpec.hs b/plutarch-test/conditional/Plutarch/FFISpec.hs index 6b7673db6..789318a2a 100644 --- a/plutarch-test/conditional/Plutarch/FFISpec.hs +++ b/plutarch-test/conditional/Plutarch/FFISpec.hs @@ -22,7 +22,7 @@ import Plutarch.List (pconvertLists) import Plutarch.Prelude import Plutarch.Rec qualified as Rec import Plutarch.Rec.TH (deriveAll) -import Plutus.V1.Ledger.Api ( +import PlutusLedgerApi.V1 ( Address (Address), Credential (ScriptCredential), CurrencySymbol, @@ -52,15 +52,14 @@ import Plutus.V1.Ledger.Api ( adaToken, getTxId, ) -import Plutus.V1.Ledger.Contexts qualified as Contexts -import Plutus.V1.Ledger.Interval qualified as Interval -import Plutus.V1.Ledger.Scripts (fromCompiledCode) -import Plutus.V1.Ledger.Value qualified as Value +import PlutusLedgerApi.V1.Contexts qualified as Contexts +import PlutusLedgerApi.V1.Interval qualified as Interval +import PlutusLedgerApi.V1.Scripts (fromCompiledCode) +import PlutusLedgerApi.V1.Value qualified as Value import PlutusTx (CompiledCode, applyCode) import PlutusTx qualified import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinUnit) import PlutusTx.Prelude -import Shrink (shrinkScript, shrinkScriptSp, withoutTactics) import Test.Hspec import Test.Tasty.HUnit ((@?=)) @@ -73,15 +72,13 @@ printCode :: CompiledCode a -> String printCode = printScript . fromCompiledCode printShrunkCode :: CompiledCode a -> String -printShrunkCode = printScript . shrink . shrink . shrink . fromCompiledCode - where - shrink = shrinkScriptSp (withoutTactics ["strongUnsubs", "weakUnsubs"]) +printShrunkCode = printScript . fromCompiledCode -- TODO: Plutonomy? printEvaluatedCode :: CompiledCode a -> Either EvalError String printEvaluatedCode = fmap printScript . fstOf3 . evalScript . fromCompiledCode printShrunkTerm :: ClosedTerm a -> String -printShrunkTerm x = printScript $ shrinkScript $ compile x +printShrunkTerm x = printScript $ compile x -- TODO: Plutonomy? printEvaluatedTerm :: ClosedTerm a -> Either EvalError String printEvaluatedTerm s = fmap printScript . fstOf3 . evalScript $ compile s diff --git a/plutarch-test/conditional/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs index cedc41e55..d261d3840 100644 --- a/plutarch-test/conditional/Plutarch/FieldSpec.hs +++ b/plutarch-test/conditional/Plutarch/FieldSpec.hs @@ -2,8 +2,8 @@ module Plutarch.FieldSpec (spec) where -import Plutus.V1.Ledger.Address (Address (Address)) -import Plutus.V1.Ledger.Credential (Credential (PubKeyCredential)) +import PlutusLedgerApi.V1.Address (Address (Address)) +import PlutusLedgerApi.V1.Credential (Credential (PubKeyCredential)) import qualified PlutusCore as PLC import qualified PlutusTx import Test.Tasty.HUnit diff --git a/plutarch-test/conditional/Plutarch/MonadicSpec.hs b/plutarch-test/conditional/Plutarch/MonadicSpec.hs index 7b772f496..a5ac241ad 100644 --- a/plutarch-test/conditional/Plutarch/MonadicSpec.hs +++ b/plutarch-test/conditional/Plutarch/MonadicSpec.hs @@ -16,7 +16,7 @@ import qualified Plutarch.ApiSpec as ApiSpec import qualified Plutarch.Monadic as P import Plutarch.Prelude import Plutarch.Test -import Plutus.V1.Ledger.Api +import PlutusLedgerApi.V1 import Test.Hspec spec :: Spec diff --git a/plutarch-test/goldens/api.ctx.bench.golden b/plutarch-test/goldens/api.ctx.bench.golden index 46308ed55..d1afe2d22 100644 --- a/plutarch-test/goldens/api.ctx.bench.golden +++ b/plutarch-test/goldens/api.ctx.bench.golden @@ -1,7 +1,7 @@ -term {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":140} -get.txInfo {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} -get.mint {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} -get.credentials {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} -get.sym {"exBudgetCPU":3825799,"exBudgetMemory":6816,"scriptSizeBytes":188} -ScriptPurpose.literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":48} -ScriptPurpose.decode {"exBudgetCPU":1570478,"exBudgetMemory":3498,"scriptSizeBytes":74} \ No newline at end of file +term {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":140} +get.txInfo {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":149} +get.mint {"exBudgetCPU":1597398,"exBudgetMemory":5388,"scriptSizeBytes":177} +get.credentials {"exBudgetCPU":4834417,"exBudgetMemory":15200,"scriptSizeBytes":242} +get.sym {"exBudgetCPU":2089617,"exBudgetMemory":6816,"scriptSizeBytes":188} +ScriptPurpose.literal {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":48} +ScriptPurpose.decode {"exBudgetCPU":1247652,"exBudgetMemory":3498,"scriptSizeBytes":74} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.getFields.bench.golden b/plutarch-test/goldens/api.example.getFields.bench.golden index b8e62d0c1..4855f700a 100644 --- a/plutarch-test/goldens/api.example.getFields.bench.golden +++ b/plutarch-test/goldens/api.example.getFields.bench.golden @@ -1 +1 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file +0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden index 336511516..1997f8efe 100644 --- a/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden +++ b/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden @@ -1,4 +1,4 @@ -cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} -cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":286} -termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} -termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file +cont.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":290} +cont.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":286} +termcont.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":290} +termcont.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden index 6759b8694..3e66861c5 100644 --- a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden +++ b/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden @@ -1,4 +1,4 @@ -cont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} -cont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} -termcont.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":335} -termcont.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":331} \ No newline at end of file +cont.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":335} +cont.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":331} +termcont.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":335} +termcont.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":331} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.bench.golden b/plutarch-test/goldens/bool.bench.golden index 01924390f..e2a013ad5 100644 --- a/plutarch-test/goldens/bool.bench.golden +++ b/plutarch-test/goldens/bool.bench.golden @@ -1,21 +1,21 @@ -pnot.lam {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":13} -pnot.app {"exBudgetCPU":327604,"exBudgetMemory":1201,"scriptSizeBytes":15} -pand.tf {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -pand.ft {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -pand.tt {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -pand.ff {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":19} -pand.laziness.pand {"exBudgetCPU":416923,"exBudgetMemory":1501,"scriptSizeBytes":17} -pand.laziness.op {"exBudgetCPU":476469,"exBudgetMemory":1701,"scriptSizeBytes":18} +pnot.lam {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":13} +pnot.app {"exBudgetCPU":333656,"exBudgetMemory":1201,"scriptSizeBytes":15} +pand.tf {"exBudgetCPU":448656,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.ft {"exBudgetCPU":448656,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.tt {"exBudgetCPU":448656,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.ff {"exBudgetCPU":448656,"exBudgetMemory":1701,"scriptSizeBytes":19} +pand.laziness.pand {"exBudgetCPU":402656,"exBudgetMemory":1501,"scriptSizeBytes":17} +pand.laziness.op {"exBudgetCPU":448656,"exBudgetMemory":1701,"scriptSizeBytes":18} pand.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} pand.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} -pand.laziness.pand.perror.op {"exBudgetCPU":101,"exBudgetMemory":101,"scriptSizeBytes":18} -por.tf {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} -por.ft {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} -por.tt {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} -por.ff {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":16} -por.laziness.por {"exBudgetCPU":327604,"exBudgetMemory":1201,"scriptSizeBytes":15} -por.laziness.op {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":15} +pand.laziness.pand.perror.op {"exBudgetCPU":80656,"exBudgetMemory":101,"scriptSizeBytes":18} +por.tf {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.ft {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.tt {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.ff {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":16} +por.laziness.por {"exBudgetCPU":333656,"exBudgetMemory":1201,"scriptSizeBytes":15} +por.laziness.op {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":15} por.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} por.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} -por.laziness.pand.perror.op.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":15} -por.laziness.pand.perror.op.false {"exBudgetCPU":101,"exBudgetMemory":101,"scriptSizeBytes":15} \ No newline at end of file +por.laziness.pand.perror.op.true {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":15} +por.laziness.pand.perror.op.false {"exBudgetCPU":80656,"exBudgetMemory":101,"scriptSizeBytes":15} \ No newline at end of file diff --git a/plutarch-test/goldens/bytestring.bench.golden b/plutarch-test/goldens/bytestring.bench.golden index 547539432..99da4b615 100644 --- a/plutarch-test/goldens/bytestring.bench.golden +++ b/plutarch-test/goldens/bytestring.bench.golden @@ -1,10 +1,10 @@ -empty {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":14} -phexByteStr {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":19} -plengthByteStr {"exBudgetCPU":496379,"exBudgetMemory":805,"scriptSizeBytes":17} -pconsBS {"exBudgetCPU":1381637,"exBudgetMemory":2113,"scriptSizeBytes":33} -pindexByteStr {"exBudgetCPU":298965,"exBudgetMemory":601,"scriptSizeBytes":16} -psliceByteStr {"exBudgetCPU":363511,"exBudgetMemory":801,"scriptSizeBytes":22} -eq {"exBudgetCPU":351067,"exBudgetMemory":901,"scriptSizeBytes":16} -semigroup.concats {"exBudgetCPU":546438,"exBudgetMemory":602,"scriptSizeBytes":17} -semigroup.laws.id.1 {"exBudgetCPU":867632,"exBudgetMemory":1303,"scriptSizeBytes":22} -semigroup.laws.id.2 {"exBudgetCPU":867632,"exBudgetMemory":1303,"scriptSizeBytes":21} \ No newline at end of file +empty {"exBudgetCPU":400935,"exBudgetMemory":901,"scriptSizeBytes":14} +phexByteStr {"exBudgetCPU":400935,"exBudgetMemory":901,"scriptSizeBytes":19} +plengthByteStr {"exBudgetCPU":371033,"exBudgetMemory":811,"scriptSizeBytes":17} +pconsBS {"exBudgetCPU":1099994,"exBudgetMemory":2125,"scriptSizeBytes":33} +pindexByteStr {"exBudgetCPU":172767,"exBudgetMemory":604,"scriptSizeBytes":16} +psliceByteStr {"exBudgetCPU":426418,"exBudgetMemory":804,"scriptSizeBytes":22} +eq {"exBudgetCPU":400935,"exBudgetMemory":901,"scriptSizeBytes":16} +semigroup.concats {"exBudgetCPU":117242,"exBudgetMemory":602,"scriptSizeBytes":17} +semigroup.laws.id.1 {"exBudgetCPU":495077,"exBudgetMemory":1303,"scriptSizeBytes":22} +semigroup.laws.id.2 {"exBudgetCPU":495077,"exBudgetMemory":1303,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/either.bench.golden b/plutarch-test/goldens/either.bench.golden index d12cf9cfb..e6c9b510a 100644 --- a/plutarch-test/goldens/either.bench.golden +++ b/plutarch-test/goldens/either.bench.golden @@ -1,5 +1,5 @@ -eq.true.left {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} -eq.true.right {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} -eq.false.left-right {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":42} -eq.false.left-left {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} -eq.false.right-right {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":42} \ No newline at end of file +eq.true.left {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":42} +eq.true.right {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":42} +eq.false.left-right {"exBudgetCPU":575100,"exBudgetMemory":2600,"scriptSizeBytes":42} +eq.false.left-left {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":42} +eq.false.right-right {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":42} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden index 160312b96..eb493a68a 100644 --- a/plutarch-test/goldens/extra.api.dev=false.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=false.bench.golden @@ -1,3 +1,3 @@ -pfindOwnInput {"exBudgetCPU":7306417,"exBudgetMemory":14580,"scriptSizeBytes":319} -pgetContinuingOutputs {"exBudgetCPU":15362595,"exBudgetMemory":30186,"scriptSizeBytes":405} -pparseDatum {"exBudgetCPU":7551331,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file +pfindOwnInput {"exBudgetCPU":5917281,"exBudgetMemory":14580,"scriptSizeBytes":319} +pgetContinuingOutputs {"exBudgetCPU":12048411,"exBudgetMemory":30186,"scriptSizeBytes":405} +pparseDatum {"exBudgetCPU":4634894,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden index 0f55a003d..f733a7669 100644 --- a/plutarch-test/goldens/extra.api.dev=true.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -1,3 +1,3 @@ -pfindOwnInput {"exBudgetCPU":7306417,"exBudgetMemory":14580,"scriptSizeBytes":319} -pgetContinuingOutputs {"exBudgetCPU":15362595,"exBudgetMemory":30186,"scriptSizeBytes":444} -pparseDatum {"exBudgetCPU":7551331,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file +pfindOwnInput {"exBudgetCPU":5917281,"exBudgetMemory":14580,"scriptSizeBytes":319} +pgetContinuingOutputs {"exBudgetCPU":12048411,"exBudgetMemory":30186,"scriptSizeBytes":444} +pparseDatum {"exBudgetCPU":4634894,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.listutils.bench.golden b/plutarch-test/goldens/extra.listutils.bench.golden index 3f32ffa2d..7b04fe4a8 100644 --- a/plutarch-test/goldens/extra.listutils.bench.golden +++ b/plutarch-test/goldens/extra.listutils.bench.golden @@ -1,4 +1,4 @@ -reverse.reverse_[1..5] {"exBudgetCPU":7592215,"exBudgetMemory":25600,"scriptSizeBytes":87} -isSorted.[1..10] {"exBudgetCPU":18915730,"exBudgetMemory":59218,"scriptSizeBytes":115} -isSorted.reverse_[1..10] {"exBudgetCPU":4047007,"exBudgetMemory":13203,"scriptSizeBytes":126} -isSorted.reverse_[] {"exBudgetCPU":803971,"exBudgetMemory":2800,"scriptSizeBytes":56} \ No newline at end of file +reverse.reverse_[1..5] {"exBudgetCPU":5865100,"exBudgetMemory":25600,"scriptSizeBytes":87} +isSorted.[1..10] {"exBudgetCPU":16166677,"exBudgetMemory":59218,"scriptSizeBytes":115} +isSorted.reverse_[1..10] {"exBudgetCPU":3379609,"exBudgetMemory":13203,"scriptSizeBytes":126} +isSorted.reverse_[] {"exBudgetCPU":621100,"exBudgetMemory":2800,"scriptSizeBytes":56} \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.bench.golden b/plutarch-test/goldens/field.data.bench.golden index fb3535e2d..dbc24ebdd 100644 --- a/plutarch-test/goldens/field.data.bench.golden +++ b/plutarch-test/goldens/field.data.bench.golden @@ -1,4 +1,4 @@ -pmatch-pfield.pmatch.newtype {"exBudgetCPU":1733744,"exBudgetMemory":3092,"scriptSizeBytes":45} -pmatch-pfield.pfield.newtype {"exBudgetCPU":1733744,"exBudgetMemory":3092,"scriptSizeBytes":45} -pfield-pletFields.pfield.single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} -pfield-pletFields.pletFields.single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} \ No newline at end of file +pmatch-pfield.pmatch.newtype {"exBudgetCPU":966918,"exBudgetMemory":3092,"scriptSizeBytes":45} +pmatch-pfield.pfield.newtype {"exBudgetCPU":966918,"exBudgetMemory":3092,"scriptSizeBytes":45} +pfield-pletFields.pfield.single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} +pfield-pletFields.pletFields.single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.bench.golden b/plutarch-test/goldens/field.dropFields.bench.golden index 48a962abf..e68db7f4d 100644 --- a/plutarch-test/goldens/field.dropFields.bench.golden +++ b/plutarch-test/goldens/field.dropFields.bench.golden @@ -1,2 +1,2 @@ -lam {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":45} -app {"exBudgetCPU":3487094,"exBudgetMemory":5018,"scriptSizeBytes":88} \ No newline at end of file +lam {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":45} +app {"exBudgetCPU":1785427,"exBudgetMemory":5018,"scriptSizeBytes":88} \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.bench.golden b/plutarch-test/goldens/field.other.bench.golden index 5dc766302..9b73e8cd0 100644 --- a/plutarch-test/goldens/field.other.bench.golden +++ b/plutarch-test/goldens/field.other.bench.golden @@ -1,2 +1,2 @@ -by {"exBudgetCPU":3110112,"exBudgetMemory":4884,"scriptSizeBytes":49} -dotPlus {"exBudgetCPU":17921705,"exBudgetMemory":26900,"scriptSizeBytes":239} \ No newline at end of file +by {"exBudgetCPU":1547135,"exBudgetMemory":4884,"scriptSizeBytes":49} +dotPlus {"exBudgetCPU":9879818,"exBudgetMemory":26900,"scriptSizeBytes":239} \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.bench.golden b/plutarch-test/goldens/field.pletFields.bench.golden index b31518bc3..fa7fcc031 100644 --- a/plutarch-test/goldens/field.pletFields.bench.golden +++ b/plutarch-test/goldens/field.pletFields.bench.golden @@ -1,5 +1,5 @@ -letSomeFields.lam {"exBudgetCPU":357376,"exBudgetMemory":1300,"scriptSizeBytes":55} -letSomeFields.order {"exBudgetCPU":357376,"exBudgetMemory":1300,"scriptSizeBytes":55} -letSomeFields.app {"exBudgetCPU":4160671,"exBudgetMemory":6620,"scriptSizeBytes":97} -nFields.lam {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":23} -nFields.app {"exBudgetCPU":1632088,"exBudgetMemory":2562,"scriptSizeBytes":68} \ No newline at end of file +letSomeFields.lam {"exBudgetCPU":276100,"exBudgetMemory":1300,"scriptSizeBytes":55} +letSomeFields.order {"exBudgetCPU":276100,"exBudgetMemory":1300,"scriptSizeBytes":55} +letSomeFields.app {"exBudgetCPU":2364146,"exBudgetMemory":6620,"scriptSizeBytes":97} +nFields.lam {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":23} +nFields.app {"exBudgetCPU":949971,"exBudgetMemory":2562,"scriptSizeBytes":68} \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.bench.golden b/plutarch-test/goldens/field.rangeFields.bench.golden index de23c31f9..7c4135681 100644 --- a/plutarch-test/goldens/field.rangeFields.bench.golden +++ b/plutarch-test/goldens/field.rangeFields.bench.golden @@ -1,2 +1,2 @@ -lam {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":39} -app {"exBudgetCPU":2858456,"exBudgetMemory":4322,"scriptSizeBytes":82} \ No newline at end of file +lam {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":39} +app {"exBudgetCPU":1523881,"exBudgetMemory":4322,"scriptSizeBytes":82} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.bench.golden b/plutarch-test/goldens/field.trips.bench.golden index c3d97a005..880e5cc3a 100644 --- a/plutarch-test/goldens/field.trips.bench.golden +++ b/plutarch-test/goldens/field.trips.bench.golden @@ -1,7 +1,7 @@ -lam.tripSum {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":46} -lam.getY {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} -lam.tripYZ {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":36} -tripSum.A {"exBudgetCPU":5147720,"exBudgetMemory":8048,"scriptSizeBytes":80} -tripSum.B {"exBudgetCPU":5147720,"exBudgetMemory":8048,"scriptSizeBytes":77} -tripSum.C {"exBudgetCPU":5147720,"exBudgetMemory":8048,"scriptSizeBytes":77} -tripYZ=tripZY {"exBudgetCPU":268057,"exBudgetMemory":1000,"scriptSizeBytes":36} \ No newline at end of file +lam.tripSum {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":46} +lam.getY {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":16} +lam.tripYZ {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":36} +tripSum.A {"exBudgetCPU":2864483,"exBudgetMemory":8048,"scriptSizeBytes":80} +tripSum.B {"exBudgetCPU":2864483,"exBudgetMemory":8048,"scriptSizeBytes":77} +tripSum.C {"exBudgetCPU":2864483,"exBudgetMemory":8048,"scriptSizeBytes":77} +tripYZ=tripZY {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":36} \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.bench.golden b/plutarch-test/goldens/int.examples.bench.golden index e6789832b..9e03a8307 100644 --- a/plutarch-test/goldens/int.examples.bench.golden +++ b/plutarch-test/goldens/int.examples.bench.golden @@ -1,8 +1,8 @@ -add1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} -add1Hoisted {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} -example1 {"exBudgetCPU":2057973,"exBudgetMemory":3710,"scriptSizeBytes":34} -example2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":21} -fib.lam {"exBudgetCPU":416922,"exBudgetMemory":1500,"scriptSizeBytes":72} -fib.app.9 {"exBudgetCPU":187876376,"exBudgetMemory":433318,"scriptSizeBytes":75} +add1 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":16} +add1Hoisted {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":16} +example1 {"exBudgetCPU":1860485,"exBudgetMemory":3710,"scriptSizeBytes":34} +example2 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":21} +fib.lam {"exBudgetCPU":322100,"exBudgetMemory":1500,"scriptSizeBytes":72} +fib.app.9 {"exBudgetCPU":189953707,"exBudgetMemory":433318,"scriptSizeBytes":75} fib.error {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} -uglyDouble {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file +uglyDouble {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file diff --git a/plutarch-test/goldens/lift.pconstantData.bench.golden b/plutarch-test/goldens/lift.pconstantData.bench.golden index a1c4f2059..e4b5a3db3 100644 --- a/plutarch-test/goldens/lift.pconstantData.bench.golden +++ b/plutarch-test/goldens/lift.pconstantData.bench.golden @@ -1,5 +1,5 @@ -bool {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -int {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} -pkh {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -minting {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":14} -txoutref {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":20} \ No newline at end of file +bool {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} +int {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} +pkh {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} +minting {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":14} +txoutref {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":20} \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=false.bench.golden b/plutarch-test/goldens/list.dev=false.bench.golden index 553b1cb10..fbc365f7d 100644 --- a/plutarch-test/goldens/list.dev=false.bench.golden +++ b/plutarch-test/goldens/list.dev=false.bench.golden @@ -1,25 +1,25 @@ -pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} -phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} -ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} -pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} -pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} -pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} -pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} -pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} -pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} -pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} -pfoldl.nonempty {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.nonempty-primed {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.empty {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} -pfoldl.empty-primed {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} -elemAt.elemAt_3_[1..10] {"exBudgetCPU":22527179,"exBudgetMemory":56708,"scriptSizeBytes":127} -elemAt.elemAt_0_[1..10] {"exBudgetCPU":17681228,"exBudgetMemory":43796,"scriptSizeBytes":127} -elemAt.elemAt_9_[1..10] {"exBudgetCPU":32219081,"exBudgetMemory":82532,"scriptSizeBytes":127} -find.find_(==3)_[1..4] {"exBudgetCPU":11027650,"exBudgetMemory":29622,"scriptSizeBytes":100} -find.find_(==5)_[1..4] {"exBudgetCPU":13130537,"exBudgetMemory":36224,"scriptSizeBytes":100} -x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} -x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} -uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} -uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} -uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file +pmatch {"exBudgetCPU":954809,"exBudgetMemory":420,"scriptSizeBytes":63} +phead {"exBudgetCPU":11768237,"exBudgetMemory":39293,"scriptSizeBytes":79} +ptail {"exBudgetCPU":34066124,"exBudgetMemory":115806,"scriptSizeBytes":142} +pnull.empty {"exBudgetCPU":957454,"exBudgetMemory":3532,"scriptSizeBytes":64} +pnull.nonempty {"exBudgetCPU":11777860,"exBudgetMemory":39893,"scriptSizeBytes":84} +pconcat.identity {"exBudgetCPU":80305252,"exBudgetMemory":279509,"scriptSizeBytes":188} +pmap.eg {"exBudgetCPU":47260168,"exBudgetMemory":161924,"scriptSizeBytes":163} +pmap.identity {"exBudgetCPU":1334100,"exBudgetMemory":5900,"scriptSizeBytes":97} +pfilter.evens {"exBudgetCPU":42495518,"exBudgetMemory":129344,"scriptSizeBytes":175} +pfilter.gt5 {"exBudgetCPU":37045658,"exBudgetMemory":125334,"scriptSizeBytes":170} +pzipWith.double {"exBudgetCPU":60015372,"exBudgetMemory":206316,"scriptSizeBytes":174} +pfoldl.nonempty {"exBudgetCPU":21216007,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.nonempty-primed {"exBudgetCPU":21216007,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.empty {"exBudgetCPU":1603387,"exBudgetMemory":5433,"scriptSizeBytes":85} +pfoldl.empty-primed {"exBudgetCPU":1603387,"exBudgetMemory":5433,"scriptSizeBytes":85} +elemAt.elemAt_3_[1..10] {"exBudgetCPU":17628654,"exBudgetMemory":56708,"scriptSizeBytes":127} +elemAt.elemAt_0_[1..10] {"exBudgetCPU":13173756,"exBudgetMemory":43796,"scriptSizeBytes":127} +elemAt.elemAt_9_[1..10] {"exBudgetCPU":26538450,"exBudgetMemory":82532,"scriptSizeBytes":127} +find.find_(==3)_[1..4] {"exBudgetCPU":8776061,"exBudgetMemory":29622,"scriptSizeBytes":100} +find.find_(==5)_[1..4] {"exBudgetCPU":10583550,"exBudgetMemory":36224,"scriptSizeBytes":100} +x1+x2.builtin {"exBudgetCPU":771257,"exBudgetMemory":2098,"scriptSizeBytes":29} +x1+x2.pmatch {"exBudgetCPU":1673965,"exBudgetMemory":4562,"scriptSizeBytes":48} +uncons.ChooseList {"exBudgetCPU":607636,"exBudgetMemory":1864,"scriptSizeBytes":26} +uncons.head-and-tail {"exBudgetCPU":383531,"exBudgetMemory":1464,"scriptSizeBytes":23} +uncons.head-and-tail-and-null {"exBudgetCPU":869178,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=true.bench.golden b/plutarch-test/goldens/list.dev=true.bench.golden index 64e96914d..935c4fdd8 100644 --- a/plutarch-test/goldens/list.dev=true.bench.golden +++ b/plutarch-test/goldens/list.dev=true.bench.golden @@ -1,25 +1,25 @@ -pmatch {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":63} -phead {"exBudgetCPU":16161254,"exBudgetMemory":39293,"scriptSizeBytes":79} -ptail {"exBudgetCPU":43972595,"exBudgetMemory":115806,"scriptSizeBytes":142} -pnull.empty {"exBudgetCPU":1162382,"exBudgetMemory":3532,"scriptSizeBytes":64} -pnull.nonempty {"exBudgetCPU":16202025,"exBudgetMemory":39893,"scriptSizeBytes":84} -pconcat.identity {"exBudgetCPU":103352323,"exBudgetMemory":279509,"scriptSizeBytes":188} -pmap.eg {"exBudgetCPU":60228134,"exBudgetMemory":161924,"scriptSizeBytes":163} -pmap.identity {"exBudgetCPU":1726934,"exBudgetMemory":5900,"scriptSizeBytes":97} -pfilter.evens {"exBudgetCPU":51394506,"exBudgetMemory":129344,"scriptSizeBytes":175} -pfilter.gt5 {"exBudgetCPU":46370526,"exBudgetMemory":125334,"scriptSizeBytes":170} -pzipWith.double {"exBudgetCPU":77799616,"exBudgetMemory":206316,"scriptSizeBytes":174} -pfoldl.nonempty {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.nonempty-primed {"exBudgetCPU":27690477,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.empty {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} -pfoldl.empty-primed {"exBudgetCPU":1865937,"exBudgetMemory":5433,"scriptSizeBytes":85} -elemAt.elemAt_3_[1..10] {"exBudgetCPU":22527179,"exBudgetMemory":56708,"scriptSizeBytes":157} -elemAt.elemAt_0_[1..10] {"exBudgetCPU":17681228,"exBudgetMemory":43796,"scriptSizeBytes":157} -elemAt.elemAt_9_[1..10] {"exBudgetCPU":32219081,"exBudgetMemory":82532,"scriptSizeBytes":157} -find.find_(==3)_[1..4] {"exBudgetCPU":11027650,"exBudgetMemory":29622,"scriptSizeBytes":100} -find.find_(==5)_[1..4] {"exBudgetCPU":13130537,"exBudgetMemory":36224,"scriptSizeBytes":100} -x1+x2.builtin {"exBudgetCPU":1212996,"exBudgetMemory":2098,"scriptSizeBytes":29} -x1+x2.pmatch {"exBudgetCPU":2227548,"exBudgetMemory":4562,"scriptSizeBytes":48} -uncons.ChooseList {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":26} -uncons.head-and-tail {"exBudgetCPU":687149,"exBudgetMemory":1464,"scriptSizeBytes":23} -uncons.head-and-tail-and-null {"exBudgetCPU":1283745,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file +pmatch {"exBudgetCPU":954809,"exBudgetMemory":420,"scriptSizeBytes":63} +phead {"exBudgetCPU":11768237,"exBudgetMemory":39293,"scriptSizeBytes":79} +ptail {"exBudgetCPU":34066124,"exBudgetMemory":115806,"scriptSizeBytes":142} +pnull.empty {"exBudgetCPU":957454,"exBudgetMemory":3532,"scriptSizeBytes":64} +pnull.nonempty {"exBudgetCPU":11777860,"exBudgetMemory":39893,"scriptSizeBytes":84} +pconcat.identity {"exBudgetCPU":80305252,"exBudgetMemory":279509,"scriptSizeBytes":188} +pmap.eg {"exBudgetCPU":47260168,"exBudgetMemory":161924,"scriptSizeBytes":163} +pmap.identity {"exBudgetCPU":1334100,"exBudgetMemory":5900,"scriptSizeBytes":97} +pfilter.evens {"exBudgetCPU":42495518,"exBudgetMemory":129344,"scriptSizeBytes":175} +pfilter.gt5 {"exBudgetCPU":37045658,"exBudgetMemory":125334,"scriptSizeBytes":170} +pzipWith.double {"exBudgetCPU":60015372,"exBudgetMemory":206316,"scriptSizeBytes":174} +pfoldl.nonempty {"exBudgetCPU":21216007,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.nonempty-primed {"exBudgetCPU":21216007,"exBudgetMemory":71413,"scriptSizeBytes":96} +pfoldl.empty {"exBudgetCPU":1603387,"exBudgetMemory":5433,"scriptSizeBytes":85} +pfoldl.empty-primed {"exBudgetCPU":1603387,"exBudgetMemory":5433,"scriptSizeBytes":85} +elemAt.elemAt_3_[1..10] {"exBudgetCPU":17628654,"exBudgetMemory":56708,"scriptSizeBytes":157} +elemAt.elemAt_0_[1..10] {"exBudgetCPU":13173756,"exBudgetMemory":43796,"scriptSizeBytes":157} +elemAt.elemAt_9_[1..10] {"exBudgetCPU":26538450,"exBudgetMemory":82532,"scriptSizeBytes":157} +find.find_(==3)_[1..4] {"exBudgetCPU":8776061,"exBudgetMemory":29622,"scriptSizeBytes":100} +find.find_(==5)_[1..4] {"exBudgetCPU":10583550,"exBudgetMemory":36224,"scriptSizeBytes":100} +x1+x2.builtin {"exBudgetCPU":771257,"exBudgetMemory":2098,"scriptSizeBytes":29} +x1+x2.pmatch {"exBudgetCPU":1673965,"exBudgetMemory":4562,"scriptSizeBytes":48} +uncons.ChooseList {"exBudgetCPU":607636,"exBudgetMemory":1864,"scriptSizeBytes":26} +uncons.head-and-tail {"exBudgetCPU":383531,"exBudgetMemory":1464,"scriptSizeBytes":23} +uncons.head-and-tail-and-null {"exBudgetCPU":869178,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.bench.golden b/plutarch-test/goldens/maybe.bench.golden index 5187c86d7..8e0d309d4 100644 --- a/plutarch-test/goldens/maybe.bench.golden +++ b/plutarch-test/goldens/maybe.bench.golden @@ -1,4 +1,4 @@ -eq.true.nothing {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":34} -eq.true.just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} -eq.false.nothing-just {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":36} -eq.false.just-just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} \ No newline at end of file +eq.true.nothing {"exBudgetCPU":529100,"exBudgetMemory":2400,"scriptSizeBytes":34} +eq.true.just {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":38} +eq.false.nothing-just {"exBudgetCPU":552100,"exBudgetMemory":2500,"scriptSizeBytes":36} +eq.false.just-just {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":38} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.getFields.bench.golden b/plutarch-test/goldens/monadic.api.example.getFields.bench.golden index b8e62d0c1..4855f700a 100644 --- a/plutarch-test/goldens/monadic.api.example.getFields.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.getFields.bench.golden @@ -1 +1 @@ -0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file +0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden index bcae55e29..750638dba 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden @@ -1,2 +1,2 @@ -do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":290} -do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file +do.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":290} +do.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden index 332672742..a934ec699 100644 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -1,2 +1,2 @@ -do.succeeds {"exBudgetCPU":8163467,"exBudgetMemory":16009,"scriptSizeBytes":390} -do.fails {"exBudgetCPU":11192573,"exBudgetMemory":21069,"scriptSizeBytes":386} \ No newline at end of file +do.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":390} +do.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":386} \ No newline at end of file diff --git a/plutarch-test/goldens/pair.bench.golden b/plutarch-test/goldens/pair.bench.golden index a85af75ee..44b4da15a 100644 --- a/plutarch-test/goldens/pair.bench.golden +++ b/plutarch-test/goldens/pair.bench.golden @@ -1,4 +1,4 @@ -eq.true {"exBudgetCPU":1811392,"exBudgetMemory":5203,"scriptSizeBytes":59} -eq.false.fst {"exBudgetCPU":1537300,"exBudgetMemory":4802,"scriptSizeBytes":59} -eq.false.snd {"exBudgetCPU":1722073,"exBudgetMemory":4903,"scriptSizeBytes":64} -eq.false.both {"exBudgetCPU":1447981,"exBudgetMemory":4502,"scriptSizeBytes":64} \ No newline at end of file +eq.true {"exBudgetCPU":1728579,"exBudgetMemory":5203,"scriptSizeBytes":59} +eq.false.fst {"exBudgetCPU":1370589,"exBudgetMemory":4802,"scriptSizeBytes":59} +eq.false.snd {"exBudgetCPU":1659579,"exBudgetMemory":4903,"scriptSizeBytes":64} +eq.false.both {"exBudgetCPU":1301589,"exBudgetMemory":4502,"scriptSizeBytes":64} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.constr.bench.golden b/plutarch-test/goldens/pisdata.constr.bench.golden index 0e240d135..ae4d13e9e 100644 --- a/plutarch-test/goldens/pisdata.constr.bench.golden +++ b/plutarch-test/goldens/pisdata.constr.bench.golden @@ -1,13 +1,13 @@ -sop.4wheeler.normal {"exBudgetCPU":1494425,"exBudgetMemory":2760,"scriptSizeBytes":45} -sop.4wheeler.pdatasum {"exBudgetCPU":1494425,"exBudgetMemory":2760,"scriptSizeBytes":45} -sop.2wheeler.normal {"exBudgetCPU":956241,"exBudgetMemory":1896,"scriptSizeBytes":30} -sop.2wheeler.pdatasum {"exBudgetCPU":956241,"exBudgetMemory":1896,"scriptSizeBytes":30} -sop.immovable.normal {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} -sop.immovable.pdatasum {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} -prod.1.normal {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":40} -prod.1.pdatasum {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":40} -prod.2.normal {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":68} -prod.2.datasum {"exBudgetCPU":1225333,"exBudgetMemory":2328,"scriptSizeBytes":68} -enum.PA {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} -enum.PB {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":12} -pconstant-pcon-rel {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":22} \ No newline at end of file +sop.4wheeler.normal {"exBudgetCPU":926213,"exBudgetMemory":2760,"scriptSizeBytes":45} +sop.4wheeler.pdatasum {"exBudgetCPU":926213,"exBudgetMemory":2760,"scriptSizeBytes":45} +sop.2wheeler.normal {"exBudgetCPU":611227,"exBudgetMemory":1896,"scriptSizeBytes":30} +sop.2wheeler.pdatasum {"exBudgetCPU":611227,"exBudgetMemory":1896,"scriptSizeBytes":30} +sop.immovable.normal {"exBudgetCPU":204241,"exBudgetMemory":632,"scriptSizeBytes":12} +sop.immovable.pdatasum {"exBudgetCPU":204241,"exBudgetMemory":632,"scriptSizeBytes":12} +prod.1.normal {"exBudgetCPU":768720,"exBudgetMemory":2328,"scriptSizeBytes":40} +prod.1.pdatasum {"exBudgetCPU":768720,"exBudgetMemory":2328,"scriptSizeBytes":40} +prod.2.normal {"exBudgetCPU":768720,"exBudgetMemory":2328,"scriptSizeBytes":68} +prod.2.datasum {"exBudgetCPU":768720,"exBudgetMemory":2328,"scriptSizeBytes":68} +enum.PA {"exBudgetCPU":204241,"exBudgetMemory":632,"scriptSizeBytes":12} +enum.PB {"exBudgetCPU":204241,"exBudgetMemory":632,"scriptSizeBytes":12} +pconstant-pcon-rel {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":22} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.equality.bench.golden b/plutarch-test/goldens/pisdata.equality.bench.golden index 823f5cf55..8b5f656a1 100644 --- a/plutarch-test/goldens/pisdata.equality.bench.golden +++ b/plutarch-test/goldens/pisdata.equality.bench.golden @@ -1,4 +1,4 @@ -PData.1 {"exBudgetCPU":518284,"exBudgetMemory":901,"scriptSizeBytes":22} -PData.2 {"exBudgetCPU":636696,"exBudgetMemory":1602,"scriptSizeBytes":30} -PAsData.1 {"exBudgetCPU":768057,"exBudgetMemory":1065,"scriptSizeBytes":15} -PAsData.1 {"exBudgetCPU":1065788,"exBudgetMemory":2066,"scriptSizeBytes":31} \ No newline at end of file +PData.1 {"exBudgetCPU":1408085,"exBudgetMemory":901,"scriptSizeBytes":22} +PData.2 {"exBudgetCPU":1536367,"exBudgetMemory":1602,"scriptSizeBytes":30} +PAsData.1 {"exBudgetCPU":1332397,"exBudgetMemory":1065,"scriptSizeBytes":15} +PAsData.1 {"exBudgetCPU":1642953,"exBudgetMemory":2066,"scriptSizeBytes":31} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lt.bench.golden b/plutarch-test/goldens/pisdata.lt.bench.golden index 9f795981e..03e9a3c1f 100644 --- a/plutarch-test/goldens/pisdata.lt.bench.golden +++ b/plutarch-test/goldens/pisdata.lt.bench.golden @@ -1,12 +1,12 @@ -PCredential.derived.true {"exBudgetCPU":2477349,"exBudgetMemory":5930,"scriptSizeBytes":101} -PCredential.derived.false {"exBudgetCPU":2972494,"exBudgetMemory":7132,"scriptSizeBytes":101} -PCredential.pmatch.true {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PCredential.pmatch-pdatarecord.true {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PTriplet.derived.true {"exBudgetCPU":6200878,"exBudgetMemory":12654,"scriptSizeBytes":158} -PTriplet.derived.false {"exBudgetCPU":6696023,"exBudgetMemory":13856,"scriptSizeBytes":158} -PTriplet.pmatch.true {"exBudgetCPU":6736792,"exBudgetMemory":14454,"scriptSizeBytes":161} -PTriplet.pmatch.false {"exBudgetCPU":7410575,"exBudgetMemory":16256,"scriptSizeBytes":161} -PTriplet.pmatch-pdatarecord.true {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} -PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} \ No newline at end of file +PCredential.derived.true {"exBudgetCPU":1827327,"exBudgetMemory":5930,"scriptSizeBytes":101} +PCredential.derived.false {"exBudgetCPU":2392816,"exBudgetMemory":7132,"scriptSizeBytes":101} +PCredential.pmatch.true {"exBudgetCPU":2725204,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch.false {"exBudgetCPU":2725204,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.true {"exBudgetCPU":2725204,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.false {"exBudgetCPU":2725204,"exBudgetMemory":7896,"scriptSizeBytes":137} +PTriplet.derived.true {"exBudgetCPU":4318557,"exBudgetMemory":12654,"scriptSizeBytes":158} +PTriplet.derived.false {"exBudgetCPU":4884046,"exBudgetMemory":13856,"scriptSizeBytes":158} +PTriplet.pmatch.true {"exBudgetCPU":4732557,"exBudgetMemory":14454,"scriptSizeBytes":161} +PTriplet.pmatch.false {"exBudgetCPU":5436046,"exBudgetMemory":16256,"scriptSizeBytes":161} +PTriplet.pmatch-pdatarecord.true {"exBudgetCPU":4180557,"exBudgetMemory":12054,"scriptSizeBytes":153} +PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":4746046,"exBudgetMemory":13256,"scriptSizeBytes":153} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.lte.bench.golden b/plutarch-test/goldens/pisdata.lte.bench.golden index 37ac92a56..9470f616a 100644 --- a/plutarch-test/goldens/pisdata.lte.bench.golden +++ b/plutarch-test/goldens/pisdata.lte.bench.golden @@ -1,18 +1,18 @@ -PCredential.derived.true.eq {"exBudgetCPU":4542028,"exBudgetMemory":9225,"scriptSizeBytes":91} -PCredential.derived.true.less {"exBudgetCPU":2477349,"exBudgetMemory":5930,"scriptSizeBytes":101} -PCredential.derived.false {"exBudgetCPU":2972494,"exBudgetMemory":7132,"scriptSizeBytes":101} -PCredential.pmatch.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} -PCredential.pmatch.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PCredential.pmatch.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":4499709,"exBudgetMemory":9225,"scriptSizeBytes":129} -PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PCredential.pmatch-pdatarecord.false {"exBudgetCPU":3438586,"exBudgetMemory":7896,"scriptSizeBytes":137} -PTriplet.derived.true.eq {"exBudgetCPU":8308352,"exBudgetMemory":15949,"scriptSizeBytes":147} -PTriplet.derived.true.less {"exBudgetCPU":6200878,"exBudgetMemory":12654,"scriptSizeBytes":158} -PTriplet.derived.false {"exBudgetCPU":6696023,"exBudgetMemory":13856,"scriptSizeBytes":158} -PTriplet.pmatch.true.eq {"exBudgetCPU":9022904,"exBudgetMemory":18349,"scriptSizeBytes":155} -PTriplet.pmatch.true.less {"exBudgetCPU":6736792,"exBudgetMemory":14454,"scriptSizeBytes":161} -PTriplet.pmatch.false {"exBudgetCPU":7410575,"exBudgetMemory":16256,"scriptSizeBytes":161} -PTriplet.pmatch-pdatarecord.true.eq {"exBudgetCPU":8308352,"exBudgetMemory":15949,"scriptSizeBytes":147} -PTriplet.pmatch-pdatarecord.true.less {"exBudgetCPU":6022240,"exBudgetMemory":12054,"scriptSizeBytes":153} -PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":6517385,"exBudgetMemory":13256,"scriptSizeBytes":153} \ No newline at end of file +PCredential.derived.true.eq {"exBudgetCPU":3347917,"exBudgetMemory":9225,"scriptSizeBytes":91} +PCredential.derived.true.less {"exBudgetCPU":1827327,"exBudgetMemory":5930,"scriptSizeBytes":101} +PCredential.derived.false {"exBudgetCPU":2392816,"exBudgetMemory":7132,"scriptSizeBytes":101} +PCredential.pmatch.true.eq {"exBudgetCPU":3347443,"exBudgetMemory":9225,"scriptSizeBytes":129} +PCredential.pmatch.true.less {"exBudgetCPU":2725204,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch.false {"exBudgetCPU":2725204,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.true.eq {"exBudgetCPU":3347443,"exBudgetMemory":9225,"scriptSizeBytes":129} +PCredential.pmatch-pdatarecord.true.less {"exBudgetCPU":2725204,"exBudgetMemory":7896,"scriptSizeBytes":137} +PCredential.pmatch-pdatarecord.false {"exBudgetCPU":2725204,"exBudgetMemory":7896,"scriptSizeBytes":137} +PTriplet.derived.true.eq {"exBudgetCPU":5782019,"exBudgetMemory":15949,"scriptSizeBytes":147} +PTriplet.derived.true.less {"exBudgetCPU":4318557,"exBudgetMemory":12654,"scriptSizeBytes":158} +PTriplet.derived.false {"exBudgetCPU":4884046,"exBudgetMemory":13856,"scriptSizeBytes":158} +PTriplet.pmatch.true.eq {"exBudgetCPU":6334019,"exBudgetMemory":18349,"scriptSizeBytes":155} +PTriplet.pmatch.true.less {"exBudgetCPU":4732557,"exBudgetMemory":14454,"scriptSizeBytes":161} +PTriplet.pmatch.false {"exBudgetCPU":5436046,"exBudgetMemory":16256,"scriptSizeBytes":161} +PTriplet.pmatch-pdatarecord.true.eq {"exBudgetCPU":5782019,"exBudgetMemory":15949,"scriptSizeBytes":147} +PTriplet.pmatch-pdatarecord.true.less {"exBudgetCPU":4180557,"exBudgetMemory":12054,"scriptSizeBytes":153} +PTriplet.pmatch-pdatarecord.false {"exBudgetCPU":4746046,"exBudgetMemory":13256,"scriptSizeBytes":153} \ No newline at end of file diff --git a/plutarch-test/goldens/pisdata.ppair.bench.golden b/plutarch-test/goldens/pisdata.ppair.bench.golden index 4e2199b85..ca959902e 100644 --- a/plutarch-test/goldens/pisdata.ppair.bench.golden +++ b/plutarch-test/goldens/pisdata.ppair.bench.golden @@ -1,5 +1,5 @@ -simple {"exBudgetCPU":508511,"exBudgetMemory":864,"scriptSizeBytes":19} -scriptcredential {"exBudgetCPU":298965,"exBudgetMemory":632,"scriptSizeBytes":28} -isomorphism.pforgetData {"exBudgetCPU":1852836,"exBudgetMemory":3492,"scriptSizeBytes":52} -isomorphism.pbuiltinPairFromTuple {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":68} -isomorphism.ptupleFromBuiltin {"exBudgetCPU":1852836,"exBudgetMemory":3492,"scriptSizeBytes":52} \ No newline at end of file +simple {"exBudgetCPU":238611,"exBudgetMemory":864,"scriptSizeBytes":19} +scriptcredential {"exBudgetCPU":191611,"exBudgetMemory":632,"scriptSizeBytes":28} +isomorphism.pforgetData {"exBudgetCPU":1199105,"exBudgetMemory":3492,"scriptSizeBytes":52} +isomorphism.pbuiltinPairFromTuple {"exBudgetCPU":1693045,"exBudgetMemory":5388,"scriptSizeBytes":68} +isomorphism.ptupleFromBuiltin {"exBudgetCPU":1199105,"exBudgetMemory":3492,"scriptSizeBytes":52} \ No newline at end of file diff --git a/plutarch-test/goldens/plam.bench.golden b/plutarch-test/goldens/plam.bench.golden index 1756137ec..ee5053909 100644 --- a/plutarch-test/goldens/plam.bench.golden +++ b/plutarch-test/goldens/plam.bench.golden @@ -1,28 +1,28 @@ -id {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -flip.const {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -plet {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -primitives.bool.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -primitives.int.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -primitives.int.1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -primitives.int.512 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} -primitives.int.1048576 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} -primitives.bytestring.1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} -primitives.bytestring.1111111 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":16} -primitives.unit.list {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} -primitives.unit.() {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -primitives.id {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -primitives.fun.lam+ {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -primitives.fun.+ {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -η-reduction-optimisations.λx y. addInteger x y => addInteger {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -η-reduction-optimisations.λx y. hoist (force mkCons) x y => force mkCons {"exBudgetCPU":59646,"exBudgetMemory":300,"scriptSizeBytes":6} -η-reduction-optimisations.λx y. hoist mkCons x y => mkCons x y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} -η-reduction-optimisations.λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":19} -η-reduction-optimisations.λx y. x + x {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} -η-reduction-optimisations.let x = addInteger in x 1 1 {"exBudgetCPU":346174,"exBudgetMemory":602,"scriptSizeBytes":11} -η-reduction-optimisations.let x = 0 in x => 0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -η-reduction-optimisations.let x = hoist (λx. x + x) in 0 => 0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -η-reduction-optimisations.let x = hoist (λx. x + x) in x {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} -η-reduction-optimisations.λx y. sha2_256 x y =>! {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} -η-reduction-optimisations.let f = hoist (λx. x) in λx y. f x y => λx y. x y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":9} -η-reduction-optimisations.let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} -η-reduction-optimisations.λy. (λx. x + x) y {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file +id {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +flip.const {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +plet {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.bool.true {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.int.0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +primitives.int.1 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +primitives.int.512 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} +primitives.int.1048576 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":10} +primitives.bytestring.1 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":10} +primitives.bytestring.1111111 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":16} +primitives.unit.list {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} +primitives.unit.() {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.id {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +primitives.fun.lam+ {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +primitives.fun.+ {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +η-reduction-optimisations.λx y. addInteger x y => addInteger {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +η-reduction-optimisations.λx y. hoist (force mkCons) x y => force mkCons {"exBudgetCPU":46100,"exBudgetMemory":300,"scriptSizeBytes":6} +η-reduction-optimisations.λx y. hoist mkCons x y => mkCons x y {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.λx y. hoist (λx y. x + y - y - x) x y => λx y. x + y - y - x {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":19} +η-reduction-optimisations.λx y. x + x {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.let x = addInteger in x 1 1 {"exBudgetCPU":321577,"exBudgetMemory":602,"scriptSizeBytes":11} +η-reduction-optimisations.let x = 0 in x => 0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +η-reduction-optimisations.let x = hoist (λx. x + x) in 0 => 0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +η-reduction-optimisations.let x = hoist (λx. x + x) in x {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":10} +η-reduction-optimisations.λx y. sha2_256 x y =>! {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.let f = hoist (λx. x) in λx y. f x y => λx y. x y {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":9} +η-reduction-optimisations.let f = hoist (λx. x True) in λx y. f x y => λx y. (λz. z True) x y {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} +η-reduction-optimisations.λy. (λx. x + x) y {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.bench.golden b/plutarch-test/goldens/plutustype.deconstr.bench.golden index 5b4582dd9..87d1ebb45 100644 --- a/plutarch-test/goldens/plutustype.deconstr.bench.golden +++ b/plutarch-test/goldens/plutustype.deconstr.bench.golden @@ -1,37 +1,37 @@ -matching.typed.newtype.normal {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} -matching.typed.newtype.datasum {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} -matching.typed.sumtype(ignore-fields).normal {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} -matching.typed.sumtype(ignore-fields).datasum {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} -matching.typed.sumtype(partial-match).normal {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} -matching.typed.sumtype(partial-match).datasum {"exBudgetCPU":1659797,"exBudgetMemory":3798,"scriptSizeBytes":44} -matching.typed.sumtype(exhaustive).normal.minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} -matching.typed.sumtype(exhaustive).normal.spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} -matching.typed.sumtype(exhaustive).normal.rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} -matching.typed.sumtype(exhaustive).normal.certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} -matching.typed.sumtype(exhaustive).datasum.minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} -matching.typed.sumtype(exhaustive).datasum.spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} -matching.typed.sumtype(exhaustive).datasum.rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} -matching.typed.sumtype(exhaustive).datasum.certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} -matching.typed.sumtype(exhaustive)(ignore-fields).normal.minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} -matching.typed.sumtype(exhaustive)(ignore-fields).normal.spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} -matching.typed.sumtype(exhaustive)(ignore-fields).normal.rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} -matching.typed.sumtype(exhaustive)(ignore-fields).normal.certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} -matching.typed.sumtype(exhaustive)(ignore-fields).datasum.minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} -matching.typed.sumtype(exhaustive)(ignore-fields).datasum.spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} -matching.typed.sumtype(exhaustive)(ignore-fields).datasum.rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} -matching.typed.sumtype(exhaustive)(ignore-fields).datasum.certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} -matching.raw.newtype {"exBudgetCPU":597830,"exBudgetMemory":1164,"scriptSizeBytes":30} -matching.raw.sumtype(ignore-fields) {"exBudgetCPU":1122748,"exBudgetMemory":2466,"scriptSizeBytes":33} -matching.raw.sumtype(partial-match) {"exBudgetCPU":1481159,"exBudgetMemory":3198,"scriptSizeBytes":39} -matching.raw.sumtype(exhaustive).minting {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":83} -matching.raw.sumtype(exhaustive).spending {"exBudgetCPU":1749116,"exBudgetMemory":4098,"scriptSizeBytes":93} -matching.raw.sumtype(exhaustive).rewarding {"exBudgetCPU":2244261,"exBudgetMemory":5300,"scriptSizeBytes":90} -matching.raw.sumtype(exhaustive).certifying {"exBudgetCPU":2739406,"exBudgetMemory":6502,"scriptSizeBytes":85} -matching.raw.sumtype(exhaustive)(ignore-fields).minting {"exBudgetCPU":2291676,"exBudgetMemory":5470,"scriptSizeBytes":75} -matching.raw.sumtype(exhaustive)(ignore-fields).spending {"exBudgetCPU":1301386,"exBudgetMemory":3066,"scriptSizeBytes":85} -matching.raw.sumtype(exhaustive)(ignore-fields).rewarding {"exBudgetCPU":1796531,"exBudgetMemory":4268,"scriptSizeBytes":82} -matching.raw.sumtype(exhaustive)(ignore-fields).certifying {"exBudgetCPU":2291676,"exBudgetMemory":5470,"scriptSizeBytes":77} -fields.typed.extract-single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} -fields.raw.extract-single {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":32} -combined.typed.toValidatorHash {"exBudgetCPU":2496846,"exBudgetMemory":5194,"scriptSizeBytes":72} -combined.raw.toValidatorHash {"exBudgetCPU":2108662,"exBudgetMemory":4362,"scriptSizeBytes":67} \ No newline at end of file +matching.typed.newtype.normal {"exBudgetCPU":348727,"exBudgetMemory":1164,"scriptSizeBytes":30} +matching.typed.newtype.datasum {"exBudgetCPU":348727,"exBudgetMemory":1164,"scriptSizeBytes":30} +matching.typed.sumtype(ignore-fields).normal {"exBudgetCPU":1316652,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(ignore-fields).datasum {"exBudgetCPU":1316652,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(partial-match).normal {"exBudgetCPU":1316652,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(partial-match).datasum {"exBudgetCPU":1316652,"exBudgetMemory":3798,"scriptSizeBytes":44} +matching.typed.sumtype(exhaustive).normal.minting {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive).normal.spending {"exBudgetCPU":1385652,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive).normal.rewarding {"exBudgetCPU":1951141,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive).normal.certifying {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.typed.sumtype(exhaustive).datasum.minting {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive).datasum.spending {"exBudgetCPU":1385652,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive).datasum.rewarding {"exBudgetCPU":1951141,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive).datasum.certifying {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.typed.sumtype(exhaustive)(ignore-fields).normal.minting {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive)(ignore-fields).normal.spending {"exBudgetCPU":1385652,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive)(ignore-fields).normal.rewarding {"exBudgetCPU":1951141,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive)(ignore-fields).normal.certifying {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.minting {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.spending {"exBudgetCPU":1385652,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.rewarding {"exBudgetCPU":1951141,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.typed.sumtype(exhaustive)(ignore-fields).datasum.certifying {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.raw.newtype {"exBudgetCPU":348727,"exBudgetMemory":1164,"scriptSizeBytes":30} +matching.raw.sumtype(ignore-fields) {"exBudgetCPU":931721,"exBudgetMemory":2466,"scriptSizeBytes":33} +matching.raw.sumtype(partial-match) {"exBudgetCPU":1178652,"exBudgetMemory":3198,"scriptSizeBytes":39} +matching.raw.sumtype(exhaustive).minting {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":83} +matching.raw.sumtype(exhaustive).spending {"exBudgetCPU":1385652,"exBudgetMemory":4098,"scriptSizeBytes":93} +matching.raw.sumtype(exhaustive).rewarding {"exBudgetCPU":1951141,"exBudgetMemory":5300,"scriptSizeBytes":90} +matching.raw.sumtype(exhaustive).certifying {"exBudgetCPU":2516630,"exBudgetMemory":6502,"scriptSizeBytes":85} +matching.raw.sumtype(exhaustive)(ignore-fields).minting {"exBudgetCPU":2200699,"exBudgetMemory":5470,"scriptSizeBytes":75} +matching.raw.sumtype(exhaustive)(ignore-fields).spending {"exBudgetCPU":1069721,"exBudgetMemory":3066,"scriptSizeBytes":85} +matching.raw.sumtype(exhaustive)(ignore-fields).rewarding {"exBudgetCPU":1635210,"exBudgetMemory":4268,"scriptSizeBytes":82} +matching.raw.sumtype(exhaustive)(ignore-fields).certifying {"exBudgetCPU":2200699,"exBudgetMemory":5470,"scriptSizeBytes":77} +fields.typed.extract-single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} +fields.raw.extract-single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} +combined.typed.toValidatorHash {"exBudgetCPU":1777528,"exBudgetMemory":5194,"scriptSizeBytes":72} +combined.raw.toValidatorHash {"exBudgetCPU":1507597,"exBudgetMemory":4362,"scriptSizeBytes":67} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.bench.golden b/plutarch-test/goldens/plutustype.example.bench.golden index 6c43feb59..ca08b9f05 100644 --- a/plutarch-test/goldens/plutustype.example.bench.golden +++ b/plutarch-test/goldens/plutustype.example.bench.golden @@ -1,6 +1,6 @@ -A-as-0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -B-as-1 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -swap.A {"exBudgetCPU":554791,"exBudgetMemory":1502,"scriptSizeBytes":21} -swap.B {"exBudgetCPU":554791,"exBudgetMemory":1502,"scriptSizeBytes":21} -scottenc.PMaybe {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":14} -scottenc.PPair {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":26} \ No newline at end of file +A-as-0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +B-as-1 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +swap.A {"exBudgetCPU":611589,"exBudgetMemory":1502,"scriptSizeBytes":21} +swap.B {"exBudgetCPU":611589,"exBudgetMemory":1502,"scriptSizeBytes":21} +scottenc.PMaybe {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":14} +scottenc.PPair {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":26} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=false.bench.golden b/plutarch-test/goldens/rational.dev=false.bench.golden index 4a97891a0..e05a841fe 100644 --- a/plutarch-test/goldens/rational.dev=false.bench.golden +++ b/plutarch-test/goldens/rational.dev=false.bench.golden @@ -1,24 +1,24 @@ -literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -ops.+ {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} -ops.- {"exBudgetCPU":31240045,"exBudgetMemory":74895,"scriptSizeBytes":330} -ops.* {"exBudgetCPU":55159921,"exBudgetMemory":128071,"scriptSizeBytes":374} -ops.harmonic-sum {"exBudgetCPU":82224392,"exBudgetMemory":189749,"scriptSizeBytes":372} -ops.multi-product {"exBudgetCPU":92216413,"exBudgetMemory":215883,"scriptSizeBytes":385} -compare {"exBudgetCPU":26756207,"exBudgetMemory":62977,"scriptSizeBytes":320} -round.5/3 {"exBudgetCPU":17444245,"exBudgetMemory":36449,"scriptSizeBytes":338} -round.4/3 {"exBudgetCPU":15957788,"exBudgetMemory":33346,"scriptSizeBytes":338} -round.-5/2 {"exBudgetCPU":17133763,"exBudgetMemory":35349,"scriptSizeBytes":353} -round.-1/4 {"exBudgetCPU":16184770,"exBudgetMemory":33448,"scriptSizeBytes":353} -truncate.5/4 {"exBudgetCPU":13389327,"exBudgetMemory":30239,"scriptSizeBytes":289} -truncate.7/4 {"exBudgetCPU":14875784,"exBudgetMemory":33342,"scriptSizeBytes":289} -truncate.1/4 {"exBudgetCPU":11902870,"exBudgetMemory":27136,"scriptSizeBytes":289} -truncate.-7/4 {"exBudgetCPU":16905524,"exBudgetMemory":36949,"scriptSizeBytes":303} -properFraction.-1/2 {"exBudgetCPU":39886057,"exBudgetMemory":91924,"scriptSizeBytes":444} -properFraction.-3/2 {"exBudgetCPU":41688815,"exBudgetMemory":95429,"scriptSizeBytes":449} -properFraction.-4/3 {"exBudgetCPU":41688815,"exBudgetMemory":95429,"scriptSizeBytes":449} -data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.11/3 {"exBudgetCPU":11885031,"exBudgetMemory":28633,"scriptSizeBytes":242} -div by 0.1/0 {"exBudgetCPU":221921,"exBudgetMemory":104,"scriptSizeBytes":242} -div by 0.recip 0 {"exBudgetCPU":137969,"exBudgetMemory":102,"scriptSizeBytes":37} -div by 0.1/(1-1) {"exBudgetCPU":9048111,"exBudgetMemory":20136,"scriptSizeBytes":312} \ No newline at end of file +literal {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} +ops.+ {"exBudgetCPU":30296189,"exBudgetMemory":74895,"scriptSizeBytes":330} +ops.- {"exBudgetCPU":30296189,"exBudgetMemory":74895,"scriptSizeBytes":330} +ops.* {"exBudgetCPU":53593714,"exBudgetMemory":128071,"scriptSizeBytes":374} +ops.harmonic-sum {"exBudgetCPU":80085207,"exBudgetMemory":189749,"scriptSizeBytes":372} +ops.multi-product {"exBudgetCPU":89908183,"exBudgetMemory":215883,"scriptSizeBytes":385} +compare {"exBudgetCPU":25790475,"exBudgetMemory":62977,"scriptSizeBytes":320} +round.5/3 {"exBudgetCPU":17167406,"exBudgetMemory":36449,"scriptSizeBytes":338} +round.4/3 {"exBudgetCPU":15711457,"exBudgetMemory":33346,"scriptSizeBytes":338} +round.-5/2 {"exBudgetCPU":16830920,"exBudgetMemory":35349,"scriptSizeBytes":353} +round.-1/4 {"exBudgetCPU":15940934,"exBudgetMemory":33448,"scriptSizeBytes":353} +truncate.5/4 {"exBudgetCPU":13138101,"exBudgetMemory":30239,"scriptSizeBytes":289} +truncate.7/4 {"exBudgetCPU":14594050,"exBudgetMemory":33342,"scriptSizeBytes":289} +truncate.1/4 {"exBudgetCPU":11682152,"exBudgetMemory":27136,"scriptSizeBytes":289} +truncate.-7/4 {"exBudgetCPU":16577953,"exBudgetMemory":36949,"scriptSizeBytes":303} +properFraction.-1/2 {"exBudgetCPU":38497862,"exBudgetMemory":91924,"scriptSizeBytes":444} +properFraction.-3/2 {"exBudgetCPU":40252288,"exBudgetMemory":95429,"scriptSizeBytes":449} +properFraction.-4/3 {"exBudgetCPU":40252288,"exBudgetMemory":95429,"scriptSizeBytes":449} +data.id.0.5 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.2 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.11/3 {"exBudgetCPU":11680925,"exBudgetMemory":28633,"scriptSizeBytes":242} +div by 0.1/0 {"exBudgetCPU":382485,"exBudgetMemory":104,"scriptSizeBytes":242} +div by 0.recip 0 {"exBudgetCPU":289589,"exBudgetMemory":102,"scriptSizeBytes":37} +div by 0.1/(1-1) {"exBudgetCPU":8982059,"exBudgetMemory":20136,"scriptSizeBytes":312} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.bench.golden b/plutarch-test/goldens/rational.dev=true.bench.golden index 566a00d57..b79f77209 100644 --- a/plutarch-test/goldens/rational.dev=true.bench.golden +++ b/plutarch-test/goldens/rational.dev=true.bench.golden @@ -1,24 +1,24 @@ -literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -ops.+ {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":369} -ops.- {"exBudgetCPU":31448456,"exBudgetMemory":75595,"scriptSizeBytes":369} -ops.* {"exBudgetCPU":55368332,"exBudgetMemory":128771,"scriptSizeBytes":413} -ops.harmonic-sum {"exBudgetCPU":82432803,"exBudgetMemory":190449,"scriptSizeBytes":412} -ops.multi-product {"exBudgetCPU":92424824,"exBudgetMemory":216583,"scriptSizeBytes":424} -compare {"exBudgetCPU":26964618,"exBudgetMemory":63677,"scriptSizeBytes":359} -round.5/3 {"exBudgetCPU":17444245,"exBudgetMemory":36449,"scriptSizeBytes":372} -round.4/3 {"exBudgetCPU":15957788,"exBudgetMemory":33346,"scriptSizeBytes":372} -round.-5/2 {"exBudgetCPU":17133763,"exBudgetMemory":35349,"scriptSizeBytes":387} -round.-1/4 {"exBudgetCPU":16184770,"exBudgetMemory":33448,"scriptSizeBytes":387} -truncate.5/4 {"exBudgetCPU":13389327,"exBudgetMemory":30239,"scriptSizeBytes":323} -truncate.7/4 {"exBudgetCPU":14875784,"exBudgetMemory":33342,"scriptSizeBytes":323} -truncate.1/4 {"exBudgetCPU":11902870,"exBudgetMemory":27136,"scriptSizeBytes":323} -truncate.-7/4 {"exBudgetCPU":16905524,"exBudgetMemory":36949,"scriptSizeBytes":337} -properFraction.-1/2 {"exBudgetCPU":40094468,"exBudgetMemory":92624,"scriptSizeBytes":483} -properFraction.-3/2 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":488} -properFraction.-4/3 {"exBudgetCPU":41897226,"exBudgetMemory":96129,"scriptSizeBytes":488} -data.id.0.5 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.2 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.11/3 {"exBudgetCPU":11885031,"exBudgetMemory":28633,"scriptSizeBytes":277} -div by 0.1/0 {"exBudgetCPU":371921,"exBudgetMemory":136,"scriptSizeBytes":277} -div by 0.recip 0 {"exBudgetCPU":287969,"exBudgetMemory":134,"scriptSizeBytes":71} -div by 0.1/(1-1) {"exBudgetCPU":9198111,"exBudgetMemory":20168,"scriptSizeBytes":346} \ No newline at end of file +literal {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} +ops.+ {"exBudgetCPU":30457189,"exBudgetMemory":75595,"scriptSizeBytes":369} +ops.- {"exBudgetCPU":30457189,"exBudgetMemory":75595,"scriptSizeBytes":369} +ops.* {"exBudgetCPU":53754714,"exBudgetMemory":128771,"scriptSizeBytes":413} +ops.harmonic-sum {"exBudgetCPU":80246207,"exBudgetMemory":190449,"scriptSizeBytes":412} +ops.multi-product {"exBudgetCPU":90069183,"exBudgetMemory":216583,"scriptSizeBytes":424} +compare {"exBudgetCPU":25951475,"exBudgetMemory":63677,"scriptSizeBytes":359} +round.5/3 {"exBudgetCPU":17167406,"exBudgetMemory":36449,"scriptSizeBytes":372} +round.4/3 {"exBudgetCPU":15711457,"exBudgetMemory":33346,"scriptSizeBytes":372} +round.-5/2 {"exBudgetCPU":16830920,"exBudgetMemory":35349,"scriptSizeBytes":387} +round.-1/4 {"exBudgetCPU":15940934,"exBudgetMemory":33448,"scriptSizeBytes":387} +truncate.5/4 {"exBudgetCPU":13138101,"exBudgetMemory":30239,"scriptSizeBytes":323} +truncate.7/4 {"exBudgetCPU":14594050,"exBudgetMemory":33342,"scriptSizeBytes":323} +truncate.1/4 {"exBudgetCPU":11682152,"exBudgetMemory":27136,"scriptSizeBytes":323} +truncate.-7/4 {"exBudgetCPU":16577953,"exBudgetMemory":36949,"scriptSizeBytes":337} +properFraction.-1/2 {"exBudgetCPU":38658862,"exBudgetMemory":92624,"scriptSizeBytes":483} +properFraction.-3/2 {"exBudgetCPU":40413288,"exBudgetMemory":96129,"scriptSizeBytes":488} +properFraction.-4/3 {"exBudgetCPU":40413288,"exBudgetMemory":96129,"scriptSizeBytes":488} +data.id.0.5 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.2 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} +data.id.11/3 {"exBudgetCPU":11680925,"exBudgetMemory":28633,"scriptSizeBytes":277} +div by 0.1/0 {"exBudgetCPU":594827,"exBudgetMemory":136,"scriptSizeBytes":277} +div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":71} +div by 0.1/(1-1) {"exBudgetCPU":9194401,"exBudgetMemory":20168,"scriptSizeBytes":346} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=false.bench.golden b/plutarch-test/goldens/rec.Data.dev=false.bench.golden index eea3aeb86..8299cd1b1 100644 --- a/plutarch-test/goldens/rec.Data.dev=false.bench.golden +++ b/plutarch-test/goldens/rec.Data.dev=false.bench.golden @@ -1,8 +1,8 @@ -pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} -pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} -pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} -pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} -fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":36} -fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":48} -fieldFromData.nested.shallow {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":115} -pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":83} \ No newline at end of file +pdata.simple {"exBudgetCPU":1958023,"exBudgetMemory":5255,"scriptSizeBytes":70} +pdata.simple-value-deconstructed {"exBudgetCPU":2036719,"exBudgetMemory":5487,"scriptSizeBytes":72} +pdata.flat-data-deconstructed {"exBudgetCPU":5446621,"exBudgetMemory":14431,"scriptSizeBytes":169} +pdata.shallow-data-deconstructed {"exBudgetCPU":6445889,"exBudgetMemory":17559,"scriptSizeBytes":200} +fieldFromData.simple {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":36} +fieldFromData.nested.flat {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":48} +fieldFromData.nested.shallow {"exBudgetCPU":529100,"exBudgetMemory":2400,"scriptSizeBytes":115} +pfromData {"exBudgetCPU":437100,"exBudgetMemory":2000,"scriptSizeBytes":83} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=true.bench.golden b/plutarch-test/goldens/rec.Data.dev=true.bench.golden index 431a50a72..d6fec1224 100644 --- a/plutarch-test/goldens/rec.Data.dev=true.bench.golden +++ b/plutarch-test/goldens/rec.Data.dev=true.bench.golden @@ -1,8 +1,8 @@ -pdata.simple {"exBudgetCPU":2671978,"exBudgetMemory":5329,"scriptSizeBytes":70} -pdata.simple-value-deconstructed {"exBudgetCPU":2881524,"exBudgetMemory":5561,"scriptSizeBytes":72} -pdata.flat-data-deconstructed {"exBudgetCPU":7537231,"exBudgetMemory":14647,"scriptSizeBytes":169} -pdata.shallow-data-deconstructed {"exBudgetCPU":9030421,"exBudgetMemory":17775,"scriptSizeBytes":200} -fieldFromData.simple {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":72} -fieldFromData.nested.flat {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":84} -fieldFromData.nested.shallow {"exBudgetCPU":893290,"exBudgetMemory":3100,"scriptSizeBytes":161} -pfromData {"exBudgetCPU":565787,"exBudgetMemory":2000,"scriptSizeBytes":118} \ No newline at end of file +pdata.simple {"exBudgetCPU":1958023,"exBudgetMemory":5255,"scriptSizeBytes":70} +pdata.simple-value-deconstructed {"exBudgetCPU":2036719,"exBudgetMemory":5487,"scriptSizeBytes":72} +pdata.flat-data-deconstructed {"exBudgetCPU":5446621,"exBudgetMemory":14431,"scriptSizeBytes":169} +pdata.shallow-data-deconstructed {"exBudgetCPU":6445889,"exBudgetMemory":17559,"scriptSizeBytes":200} +fieldFromData.simple {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":72} +fieldFromData.nested.flat {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":84} +fieldFromData.nested.shallow {"exBudgetCPU":690100,"exBudgetMemory":3100,"scriptSizeBytes":161} +pfromData {"exBudgetCPU":437100,"exBudgetMemory":2000,"scriptSizeBytes":118} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden b/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden index 87f87948c..c31acdf7a 100644 --- a/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden +++ b/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden @@ -1,8 +1,8 @@ -record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} -even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} -even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} -knownEven {"exBudgetCPU":863517,"exBudgetMemory":3000,"scriptSizeBytes":85} -knownEven.6 {"exBudgetCPU":4589296,"exBudgetMemory":12810,"scriptSizeBytes":87} -knownEven.7 {"exBudgetCPU":6115294,"exBudgetMemory":16814,"scriptSizeBytes":87} \ No newline at end of file +record {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":52} +record-field {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":52} +even {"exBudgetCPU":598100,"exBudgetMemory":2700,"scriptSizeBytes":82} +even.4 {"exBudgetCPU":6620453,"exBudgetMemory":19018,"scriptSizeBytes":85} +even.5 {"exBudgetCPU":7967419,"exBudgetMemory":22722,"scriptSizeBytes":85} +knownEven {"exBudgetCPU":667100,"exBudgetMemory":3000,"scriptSizeBytes":85} +knownEven.6 {"exBudgetCPU":4202521,"exBudgetMemory":12810,"scriptSizeBytes":87} +knownEven.7 {"exBudgetCPU":5618487,"exBudgetMemory":16814,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden b/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden index 87f87948c..c31acdf7a 100644 --- a/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden +++ b/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden @@ -1,8 +1,8 @@ -record {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -record-field {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":52} -even {"exBudgetCPU":774198,"exBudgetMemory":2700,"scriptSizeBytes":82} -even.4 {"exBudgetCPU":7105378,"exBudgetMemory":19018,"scriptSizeBytes":85} -even.5 {"exBudgetCPU":8542057,"exBudgetMemory":22722,"scriptSizeBytes":85} -knownEven {"exBudgetCPU":863517,"exBudgetMemory":3000,"scriptSizeBytes":85} -knownEven.6 {"exBudgetCPU":4589296,"exBudgetMemory":12810,"scriptSizeBytes":87} -knownEven.7 {"exBudgetCPU":6115294,"exBudgetMemory":16814,"scriptSizeBytes":87} \ No newline at end of file +record {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":52} +record-field {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":52} +even {"exBudgetCPU":598100,"exBudgetMemory":2700,"scriptSizeBytes":82} +even.4 {"exBudgetCPU":6620453,"exBudgetMemory":19018,"scriptSizeBytes":85} +even.5 {"exBudgetCPU":7967419,"exBudgetMemory":22722,"scriptSizeBytes":85} +knownEven {"exBudgetCPU":667100,"exBudgetMemory":3000,"scriptSizeBytes":85} +knownEven.6 {"exBudgetCPU":4202521,"exBudgetMemory":12810,"scriptSizeBytes":87} +knownEven.7 {"exBudgetCPU":5618487,"exBudgetMemory":16814,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=false.bench.golden b/plutarch-test/goldens/rec.nested.dev=false.bench.golden index bdece172a..a3377e5b6 100644 --- a/plutarch-test/goldens/rec.nested.dev=false.bench.golden +++ b/plutarch-test/goldens/rec.nested.dev=false.bench.golden @@ -1,22 +1,22 @@ -flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} -flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} -flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} -flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} -shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} -shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} -shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} -shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} \ No newline at end of file +flat.reconstr-with-rcon {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":60} +flat.nested-field-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.direct-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.pmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.pmatch' {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.rmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.reconstr-with-pcon {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":85} +flat.reconstr-nested-field-value {"exBudgetCPU":1472100,"exBudgetMemory":6500,"scriptSizeBytes":91} +flat.nested-record-access-term {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +flat.nested-match-term {"exBudgetCPU":1058100,"exBudgetMemory":4700,"scriptSizeBytes":77} +flat.nested-match-value {"exBudgetCPU":1058100,"exBudgetMemory":4700,"scriptSizeBytes":77} +shallow.constr-with-rcon {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":65} +shallow.nested-field-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.direct-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.pmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.pmatch' {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.rmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.reconstr-with-pcon {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":80} +shallow.reconstr-nested-field-value {"exBudgetCPU":1196100,"exBudgetMemory":5300,"scriptSizeBytes":88} +shallow.nested-record-access-term {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":70} +shallow.nested-match-term {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-match-value {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=true.bench.golden b/plutarch-test/goldens/rec.nested.dev=true.bench.golden index bdece172a..a3377e5b6 100644 --- a/plutarch-test/goldens/rec.nested.dev=true.bench.golden +++ b/plutarch-test/goldens/rec.nested.dev=true.bench.golden @@ -1,22 +1,22 @@ -flat.reconstr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":60} -flat.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.reconstr-with-pcon {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":85} -flat.reconstr-nested-field-value {"exBudgetCPU":1905572,"exBudgetMemory":6500,"scriptSizeBytes":91} -flat.nested-record-access-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -flat.nested-match-term {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -flat.nested-match-value {"exBudgetCPU":1369658,"exBudgetMemory":4700,"scriptSizeBytes":77} -shallow.constr-with-rcon {"exBudgetCPU":119192,"exBudgetMemory":500,"scriptSizeBytes":65} -shallow.nested-field-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.direct-access {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.pmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.pmatch' {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.rmatch {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.reconstr-with-pcon {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":80} -shallow.reconstr-nested-field-value {"exBudgetCPU":1548296,"exBudgetMemory":5300,"scriptSizeBytes":88} -shallow.nested-record-access-term {"exBudgetCPU":655106,"exBudgetMemory":2300,"scriptSizeBytes":70} -shallow.nested-match-term {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-match-value {"exBudgetCPU":1012382,"exBudgetMemory":3500,"scriptSizeBytes":73} \ No newline at end of file +flat.reconstr-with-rcon {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":60} +flat.nested-field-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.direct-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.pmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.pmatch' {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.nested-field-value.rmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} +flat.reconstr-with-pcon {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":85} +flat.reconstr-nested-field-value {"exBudgetCPU":1472100,"exBudgetMemory":6500,"scriptSizeBytes":91} +flat.nested-record-access-term {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +flat.nested-match-term {"exBudgetCPU":1058100,"exBudgetMemory":4700,"scriptSizeBytes":77} +flat.nested-match-value {"exBudgetCPU":1058100,"exBudgetMemory":4700,"scriptSizeBytes":77} +shallow.constr-with-rcon {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":65} +shallow.nested-field-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.direct-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.pmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.pmatch' {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-field-value.rmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.reconstr-with-pcon {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":80} +shallow.reconstr-nested-field-value {"exBudgetCPU":1196100,"exBudgetMemory":5300,"scriptSizeBytes":88} +shallow.nested-record-access-term {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":70} +shallow.nested-match-term {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} +shallow.nested-match-value {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=false.bench.golden b/plutarch-test/goldens/rec.simple.dev=false.bench.golden index 78a06fe15..64d79d08f 100644 --- a/plutarch-test/goldens/rec.simple.dev=false.bench.golden +++ b/plutarch-test/goldens/rec.simple.dev=false.bench.golden @@ -1,10 +1,10 @@ -constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} -reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} \ No newline at end of file +constr.pcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} +constr.pcon' {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} +constr.rcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} +field.access-term {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.direct-access {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.pmatch {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.pmatch' {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.rmatch {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +reconstr.pcon {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":39} +reconstr.field-access {"exBudgetCPU":575100,"exBudgetMemory":2600,"scriptSizeBytes":43} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=true.bench.golden b/plutarch-test/goldens/rec.simple.dev=true.bench.golden index 78a06fe15..64d79d08f 100644 --- a/plutarch-test/goldens/rec.simple.dev=true.bench.golden +++ b/plutarch-test/goldens/rec.simple.dev=true.bench.golden @@ -1,10 +1,10 @@ -constr.pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -constr.pcon' {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -constr.rcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":30} -field.access-term {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.direct-access {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.pmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.pmatch' {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.rmatch {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":33} -reconstr.pcon {"exBudgetCPU":387149,"exBudgetMemory":1400,"scriptSizeBytes":39} -reconstr.field-access {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":43} \ No newline at end of file +constr.pcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} +constr.pcon' {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} +constr.rcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} +field.access-term {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.direct-access {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.pmatch {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.pmatch' {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +field.value.rmatch {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} +reconstr.pcon {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":39} +reconstr.field-access {"exBudgetCPU":575100,"exBudgetMemory":2600,"scriptSizeBytes":43} \ No newline at end of file diff --git a/plutarch-test/goldens/recursion.example.bench.golden b/plutarch-test/goldens/recursion.example.bench.golden index 8d6fc2845..0586b4e7f 100644 --- a/plutarch-test/goldens/recursion.example.bench.golden +++ b/plutarch-test/goldens/recursion.example.bench.golden @@ -1,3 +1,3 @@ -iterateN.lam {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} -iterateN.app.succ {"exBudgetCPU":18918235,"exBudgetMemory":45362,"scriptSizeBytes":65} -iterateN.app.double {"exBudgetCPU":17785665,"exBudgetMemory":45362,"scriptSizeBytes":65} \ No newline at end of file +iterateN.lam {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":53} +iterateN.app.succ {"exBudgetCPU":17710019,"exBudgetMemory":45362,"scriptSizeBytes":65} +iterateN.app.double {"exBudgetCPU":16574209,"exBudgetMemory":45362,"scriptSizeBytes":65} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.bench.golden b/plutarch-test/goldens/scripts.bench.golden index f3e924bf2..3d967bd99 100644 --- a/plutarch-test/goldens/scripts.bench.golden +++ b/plutarch-test/goldens/scripts.bench.golden @@ -1,6 +1,6 @@ -auth_validator.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":155} -auth_validator.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} -auth_policy.0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} -auth_policy.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} -auth_stake_validator.0 {"exBudgetCPU":625333,"exBudgetMemory":2200,"scriptSizeBytes":144} -auth_stake_validator.hash {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":70} \ No newline at end of file +auth_validator.0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":155} +auth_validator.hash {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":70} +auth_policy.0 {"exBudgetCPU":483100,"exBudgetMemory":2200,"scriptSizeBytes":144} +auth_policy.hash {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":70} +auth_stake_validator.0 {"exBudgetCPU":483100,"exBudgetMemory":2200,"scriptSizeBytes":144} +auth_stake_validator.hash {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":70} \ No newline at end of file diff --git a/plutarch-test/goldens/scripts.uplc.eval.golden b/plutarch-test/goldens/scripts.uplc.eval.golden index c3daaad0a..8f850d233 100644 --- a/plutarch-test/goldens/scripts.uplc.eval.golden +++ b/plutarch-test/goldens/scripts.uplc.eval.golden @@ -1,4 +1,4 @@ -auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) +auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifyEd25519Signature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) auth_validator.hash (program 1.0.0 "581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047") auth_policy.0 (program 1.0.0 (\i0 -> \i0 -> force (force ifThenElse ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (equalsData (force headList i1) i3) (delay True) (delay (i2 (force tailList i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> force headList ((\i0 -> force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) ((\i0 -> force (force sndPair) (unConstrData i1)) i1))) (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) i1))))) (delay ()) (delay error)))) auth_policy.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") diff --git a/plutarch-test/goldens/scripts.uplc.golden b/plutarch-test/goldens/scripts.uplc.golden index b08743053..e2368a834 100644 --- a/plutarch-test/goldens/scripts.uplc.golden +++ b/plutarch-test/goldens/scripts.uplc.golden @@ -1,4 +1,4 @@ -auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifySignature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) +auth_validator.0 (program 1.0.0 (\i0 -> \i0 -> \i0 -> force (force ifThenElse (verifyEd25519Signature #3131363631613861636139623039626239336565666461323935623564613262653366393434643166343235336162323964613137646235383066353064303264323632313865333366626261356530636331623063306361646662363761356639613930313537646363313965656364376339333733623034313563383838 (unBData i3) (unBData i2)) (delay ()) (delay error)))) auth_validator.hash (program 1.0.0 "581c8ac3f00bb148ff48cb551e7d5ea877863d152e75f459e0066f3dd047") auth_policy.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (i3 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i6 (equalsData (i8 i1) i3) (delay True) (delay (i2 (i7 i1))))))))) #581ccc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f (unListData ((\i0 -> i6 ((\i0 -> i6 (i6 (i6 (i6 (i6 (i6 (i6 i1))))))) (i7 i1))) (i5 (i6 i1))))) (delay ()) (delay error))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) auth_policy.hash (program 1.0.0 "581cb9f49b1f51a0c1c285c9fde6b1da21e7094f7c19efb6eeace1ada858") diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index 00a08cd7b..ad2e1cecd 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -1,35 +1,35 @@ -unit {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":11} -bool.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":33} -bool.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":33} -int.0 {"exBudgetCPU":6284427,"exBudgetMemory":14017,"scriptSizeBytes":317} -int.5 {"exBudgetCPU":8760152,"exBudgetMemory":20027,"scriptSizeBytes":317} -int.-5 {"exBudgetCPU":9393754,"exBudgetMemory":20832,"scriptSizeBytes":317} -int.10 {"exBudgetCPU":12293936,"exBudgetMemory":26039,"scriptSizeBytes":317} -int.-10 {"exBudgetCPU":12927538,"exBudgetMemory":26844,"scriptSizeBytes":317} -int.14 {"exBudgetCPU":14274516,"exBudgetMemory":30847,"scriptSizeBytes":317} -int.-14 {"exBudgetCPU":14908118,"exBudgetMemory":31652,"scriptSizeBytes":317} -int.102 {"exBudgetCPU":18800590,"exBudgetMemory":39265,"scriptSizeBytes":318} -int.-102 {"exBudgetCPU":19434192,"exBudgetMemory":40070,"scriptSizeBytes":318} -bytestring.empty {"exBudgetCPU":3357723,"exBudgetMemory":9908,"scriptSizeBytes":414} -bytestring.1 {"exBudgetCPU":11420863,"exBudgetMemory":27240,"scriptSizeBytes":416} -bytestring.2 {"exBudgetCPU":29388903,"exBudgetMemory":68614,"scriptSizeBytes":417} -bytestring.3 {"exBudgetCPU":36465753,"exBudgetMemory":83546,"scriptSizeBytes":418} -bytestring.n {"exBudgetCPU":64689018,"exBudgetMemory":152060,"scriptSizeBytes":418} -bytestring.0 {"exBudgetCPU":20125968,"exBudgetMemory":43880,"scriptSizeBytes":418} -str.empty {"exBudgetCPU":2529484,"exBudgetMemory":5617,"scriptSizeBytes":128} -str.hello123 {"exBudgetCPU":28810676,"exBudgetMemory":65009,"scriptSizeBytes":137} -str.quoted {"exBudgetCPU":32374917,"exBudgetMemory":72847,"scriptSizeBytes":138} -str.slash {"exBudgetCPU":25525527,"exBudgetMemory":57585,"scriptSizeBytes":136} -str.unicode {"exBudgetCPU":35389974,"exBudgetMemory":79858,"scriptSizeBytes":139} -str.unicode-quoted {"exBudgetCPU":42518456,"exBudgetMemory":95520,"scriptSizeBytes":141} -maybe.nothing {"exBudgetCPU":1458977,"exBudgetMemory":5000,"scriptSizeBytes":354} -maybe.just {"exBudgetCPU":15676121,"exBudgetMemory":34060,"scriptSizeBytes":356} -either.right {"exBudgetCPU":15766440,"exBudgetMemory":34361,"scriptSizeBytes":370} -maybe.either {"exBudgetCPU":17334403,"exBudgetMemory":37506,"scriptSizeBytes":431} -list.nil {"exBudgetCPU":3787676,"exBudgetMemory":11335,"scriptSizeBytes":410} -list.1 {"exBudgetCPU":10989375,"exBudgetMemory":26452,"scriptSizeBytes":411} -list.1,2,3 {"exBudgetCPU":29411680,"exBudgetMemory":66720,"scriptSizeBytes":413} -builtinlist.nil {"exBudgetCPU":3519719,"exBudgetMemory":10435,"scriptSizeBytes":401} -builtinlist.1,2,3 {"exBudgetCPU":26855742,"exBudgetMemory":56248,"scriptSizeBytes":404} -pair.int-str {"exBudgetCPU":35143888,"exBudgetMemory":77331,"scriptSizeBytes":464} -pair.int-list {"exBudgetCPU":41712616,"exBudgetMemory":86350,"scriptSizeBytes":443} \ No newline at end of file +unit {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} +bool.true {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":33} +bool.false {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":33} +int.0 {"exBudgetCPU":5982998,"exBudgetMemory":14021,"scriptSizeBytes":317} +int.5 {"exBudgetCPU":8810443,"exBudgetMemory":20031,"scriptSizeBytes":317} +int.-5 {"exBudgetCPU":9431574,"exBudgetMemory":20836,"scriptSizeBytes":317} +int.10 {"exBudgetCPU":11891916,"exBudgetMemory":26051,"scriptSizeBytes":317} +int.-10 {"exBudgetCPU":12513047,"exBudgetMemory":26856,"scriptSizeBytes":317} +int.14 {"exBudgetCPU":14153872,"exBudgetMemory":30859,"scriptSizeBytes":317} +int.-14 {"exBudgetCPU":14775003,"exBudgetMemory":31664,"scriptSizeBytes":317} +int.102 {"exBudgetCPU":18414677,"exBudgetMemory":39285,"scriptSizeBytes":318} +int.-102 {"exBudgetCPU":19035808,"exBudgetMemory":40090,"scriptSizeBytes":318} +bytestring.empty {"exBudgetCPU":2593943,"exBudgetMemory":9918,"scriptSizeBytes":414} +bytestring.1 {"exBudgetCPU":10473299,"exBudgetMemory":27270,"scriptSizeBytes":416} +bytestring.2 {"exBudgetCPU":29710789,"exBudgetMemory":68664,"scriptSizeBytes":417} +bytestring.3 {"exBudgetCPU":36555875,"exBudgetMemory":83616,"scriptSizeBytes":418} +bytestring.n {"exBudgetCPU":68788748,"exBudgetMemory":152130,"scriptSizeBytes":418} +bytestring.0 {"exBudgetCPU":17894738,"exBudgetMemory":43950,"scriptSizeBytes":418} +str.empty {"exBudgetCPU":2142713,"exBudgetMemory":5633,"scriptSizeBytes":128} +str.hello123 {"exBudgetCPU":27030233,"exBudgetMemory":65073,"scriptSizeBytes":137} +str.quoted {"exBudgetCPU":30518590,"exBudgetMemory":72910,"scriptSizeBytes":138} +str.slash {"exBudgetCPU":23919293,"exBudgetMemory":57643,"scriptSizeBytes":136} +str.unicode {"exBudgetCPU":33189676,"exBudgetMemory":79932,"scriptSizeBytes":139} +str.unicode-quoted {"exBudgetCPU":40139276,"exBudgetMemory":95604,"scriptSizeBytes":141} +maybe.nothing {"exBudgetCPU":1127100,"exBudgetMemory":5000,"scriptSizeBytes":354} +maybe.just {"exBudgetCPU":15447308,"exBudgetMemory":34080,"scriptSizeBytes":356} +either.right {"exBudgetCPU":15540485,"exBudgetMemory":34381,"scriptSizeBytes":370} +maybe.either {"exBudgetCPU":17345450,"exBudgetMemory":37542,"scriptSizeBytes":431} +list.nil {"exBudgetCPU":2825985,"exBudgetMemory":11343,"scriptSizeBytes":410} +list.1 {"exBudgetCPU":9659511,"exBudgetMemory":26464,"scriptSizeBytes":411} +list.1,2,3 {"exBudgetCPU":27175986,"exBudgetMemory":66756,"scriptSizeBytes":413} +builtinlist.nil {"exBudgetCPU":2618985,"exBudgetMemory":10443,"scriptSizeBytes":401} +builtinlist.1,2,3 {"exBudgetCPU":25171058,"exBudgetMemory":56284,"scriptSizeBytes":404} +pair.int-str {"exBudgetCPU":34106639,"exBudgetMemory":77405,"scriptSizeBytes":464} +pair.int-list {"exBudgetCPU":40738700,"exBudgetMemory":86414,"scriptSizeBytes":443} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.bench.golden b/plutarch-test/goldens/show.dev=false.bench.golden index 5dff81677..faed08162 100644 --- a/plutarch-test/goldens/show.dev=false.bench.golden +++ b/plutarch-test/goldens/show.dev=false.bench.golden @@ -1 +1 @@ -rational.1/2 {"exBudgetCPU":24171268,"exBudgetMemory":53478,"scriptSizeBytes":562} \ No newline at end of file +rational.1/2 {"exBudgetCPU":23554887,"exBudgetMemory":53494,"scriptSizeBytes":562} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.bench.golden b/plutarch-test/goldens/show.dev=true.bench.golden index ce15d96c2..c78c3c541 100644 --- a/plutarch-test/goldens/show.dev=true.bench.golden +++ b/plutarch-test/goldens/show.dev=true.bench.golden @@ -1 +1 @@ -rational.1/2 {"exBudgetCPU":24171268,"exBudgetMemory":53478,"scriptSizeBytes":595} \ No newline at end of file +rational.1/2 {"exBudgetCPU":23554887,"exBudgetMemory":53494,"scriptSizeBytes":595} \ No newline at end of file diff --git a/plutarch-test/goldens/str.bench.golden b/plutarch-test/goldens/str.bench.golden index 87291e28b..e29874316 100644 --- a/plutarch-test/goldens/str.bench.golden +++ b/plutarch-test/goldens/str.bench.golden @@ -1,5 +1,5 @@ -eq {"exBudgetCPU":391284,"exBudgetMemory":901,"scriptSizeBytes":18} -semigroup.laws.id.1 {"exBudgetCPU":663376,"exBudgetMemory":1304,"scriptSizeBytes":24} -semigroup.laws.id.2 {"exBudgetCPU":663376,"exBudgetMemory":1304,"scriptSizeBytes":23} -semigroup.concat {"exBudgetCPU":580057,"exBudgetMemory":1007,"scriptSizeBytes":35} -semigroup.mempty {"exBudgetCPU":388284,"exBudgetMemory":901,"scriptSizeBytes":14} \ No newline at end of file +eq {"exBudgetCPU":344094,"exBudgetMemory":901,"scriptSizeBytes":18} +semigroup.laws.id.1 {"exBudgetCPU":509625,"exBudgetMemory":1308,"scriptSizeBytes":24} +semigroup.laws.id.2 {"exBudgetCPU":509625,"exBudgetMemory":1308,"scriptSizeBytes":23} +semigroup.concat {"exBudgetCPU":672150,"exBudgetMemory":1011,"scriptSizeBytes":35} +semigroup.mempty {"exBudgetCPU":185100,"exBudgetMemory":901,"scriptSizeBytes":14} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.bench.golden b/plutarch-test/goldens/trace.dev=false.bench.golden index e2a1b0baf..58d2c8cdb 100644 --- a/plutarch-test/goldens/trace.dev=false.bench.golden +++ b/plutarch-test/goldens/trace.dev=false.bench.golden @@ -1,10 +1,10 @@ -ptrace.one {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -ptrace.two {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -ptraceShowId.right-42 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} -ptraceIfTrue.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -ptraceIfTrue.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -ptraceIfFalse.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -ptraceIfFalse.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -chained.false.true.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -chained.ptrace.true.false {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -chained.ptrace.true.true {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file +ptrace.one {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +ptrace.two {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceShowId.right-42 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":10} +ptraceIfTrue.true {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfTrue.false {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfFalse.true {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +ptraceIfFalse.false {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +chained.false.true.false {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +chained.ptrace.true.false {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +chained.ptrace.true.true {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.bench.golden b/plutarch-test/goldens/trace.dev=true.bench.golden index 98057425d..228f67498 100644 --- a/plutarch-test/goldens/trace.dev=true.bench.golden +++ b/plutarch-test/goldens/trace.dev=true.bench.golden @@ -1,10 +1,10 @@ -ptrace.one {"exBudgetCPU":388284,"exBudgetMemory":932,"scriptSizeBytes":16} -ptrace.two {"exBudgetCPU":806241,"exBudgetMemory":1864,"scriptSizeBytes":30} -ptraceShowId.right-42 {"exBudgetCPU":16124851,"exBudgetMemory":35093,"scriptSizeBytes":379} -ptraceIfTrue.true {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} -ptraceIfTrue.false {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} -ptraceIfFalse.true {"exBudgetCPU":387150,"exBudgetMemory":1401,"scriptSizeBytes":27} -ptraceIfFalse.false {"exBudgetCPU":686015,"exBudgetMemory":1933,"scriptSizeBytes":27} -chained.false.true.false {"exBudgetCPU":1192157,"exBudgetMemory":3634,"scriptSizeBytes":51} -chained.ptrace.true.false {"exBudgetCPU":834880,"exBudgetMemory":2433,"scriptSizeBytes":40} -chained.ptrace.true.true {"exBudgetCPU":1103972,"exBudgetMemory":2865,"scriptSizeBytes":40} \ No newline at end of file +ptrace.one {"exBudgetCPU":396442,"exBudgetMemory":932,"scriptSizeBytes":16} +ptrace.two {"exBudgetCPU":815784,"exBudgetMemory":1864,"scriptSizeBytes":30} +ptraceShowId.right-42 {"exBudgetCPU":15913827,"exBudgetMemory":35113,"scriptSizeBytes":379} +ptraceIfTrue.true {"exBudgetCPU":706998,"exBudgetMemory":1933,"scriptSizeBytes":27} +ptraceIfTrue.false {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":27} +ptraceIfFalse.true {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":27} +ptraceIfFalse.false {"exBudgetCPU":706998,"exBudgetMemory":1933,"scriptSizeBytes":27} +chained.false.true.false {"exBudgetCPU":1178554,"exBudgetMemory":3634,"scriptSizeBytes":51} +chained.ptrace.true.false {"exBudgetCPU":821998,"exBudgetMemory":2433,"scriptSizeBytes":40} +chained.ptrace.true.true {"exBudgetCPU":1126340,"exBudgetMemory":2865,"scriptSizeBytes":40} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.bench.golden b/plutarch-test/goldens/unit.bench.golden index ed147f57e..172f52e91 100644 --- a/plutarch-test/goldens/unit.bench.golden +++ b/plutarch-test/goldens/unit.bench.golden @@ -1,5 +1,5 @@ -pcon {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -pmatch {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -compare.== {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -compare.< {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} -compare.<= {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file +pcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +pmatch {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +compare.== {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +compare.< {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} +compare.<= {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-behaviour.bench.golden b/plutarch-test/goldens/uplc-behaviour.bench.golden index 87aaea128..12b8afbb5 100644 --- a/plutarch-test/goldens/uplc-behaviour.bench.golden +++ b/plutarch-test/goldens/uplc-behaviour.bench.golden @@ -1,4 +1,4 @@ -2:[1] {"exBudgetCPU":328738,"exBudgetMemory":732,"scriptSizeBytes":13} -fails:True:[1] {"exBudgetCPU":150100,"exBudgetMemory":132,"scriptSizeBytes":13} -(2,1) {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":10} +2:[1] {"exBudgetCPU":203593,"exBudgetMemory":732,"scriptSizeBytes":13} +fails:True:[1] {"exBudgetCPU":65593,"exBudgetMemory":132,"scriptSizeBytes":13} +(2,1) {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":10} fails:MkPair-1-2 {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":11} \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-misc.bench.golden b/plutarch-test/goldens/uplc-misc.bench.golden index e6bd51f17..8606bfb7a 100644 --- a/plutarch-test/goldens/uplc-misc.bench.golden +++ b/plutarch-test/goldens/uplc-misc.bench.golden @@ -1,6 +1,6 @@ perror {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} perror.arg {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} -laziness.f.d {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -laziness.d.f.d {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":7} -hoist.id.0 {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":9} -hoist.fstPair {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file +laziness.f.d {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +laziness.d.f.d {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} +hoist.id.0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":9} +hoist.fstPair {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 7e9733821..7fc72794a 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -15,9 +15,9 @@ module Plutarch.ApiSpec ( import Test.Tasty.HUnit import Control.Monad.Trans.Cont (cont, runCont) -import Plutus.V1.Ledger.Api -import qualified Plutus.V1.Ledger.Interval as Interval -import qualified Plutus.V1.Ledger.Value as Value +import PlutusLedgerApi.V1 +import qualified PlutusLedgerApi.V1.Interval as Interval +import qualified PlutusLedgerApi.V1.Value as Value import Plutarch.Api.V1 ( PCredential, diff --git a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs index 68439fbf8..d5f4fc80a 100644 --- a/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/LiftSpec.hs @@ -2,7 +2,7 @@ module Plutarch.LiftSpec (spec) where import Data.Text (Text) import Plutarch.Api.V1 () -import Plutus.V1.Ledger.Api (PubKeyHash (PubKeyHash), ScriptPurpose (Minting), TxOutRef (TxOutRef)) +import PlutusLedgerApi.V1 (PubKeyHash (PubKeyHash), ScriptPurpose (Minting), TxOutRef (TxOutRef)) import qualified PlutusTx import Plutarch.Lift (PLifted) diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index 5b79b24cd..d64e51d15 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -9,7 +9,7 @@ import Data.Functor.Compose (Compose (Compose)) import Data.String (fromString) import qualified GHC.Generics as GHC import Generics.SOP (Generic, I (I), NS (S, Z)) -import Plutus.V1.Ledger.Api ( +import PlutusLedgerApi.V1 ( Address (Address), Credential (PubKeyCredential, ScriptCredential), CurrencySymbol, diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index fdefb3894..77c047d54 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -5,7 +5,7 @@ module Plutarch.POrdSpec (spec) where import Data.ByteString (ByteString) -import Plutus.V1.Ledger.Api ( +import PlutusLedgerApi.V1 ( Address (Address), Credential (PubKeyCredential, ScriptCredential), PubKeyHash (PubKeyHash), diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index 9c4cead45..f8a88d066 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -15,10 +15,10 @@ import Plutarch.Builtin (pasByteStr, pasConstr) import Plutarch.DataRepr (PDataSum (PDataSum), pasDataSum) import Plutarch.Prelude import Plutarch.Test -import Plutus.V1.Ledger.Address (Address (Address)) -import Plutus.V1.Ledger.Api (DCert (DCertGenesis), toData) -import Plutus.V1.Ledger.Contexts (ScriptPurpose (Certifying, Minting, Rewarding, Spending), TxOutRef (TxOutRef)) -import Plutus.V1.Ledger.Credential ( +import PlutusLedgerApi.V1.Address (Address (Address)) +import PlutusLedgerApi.V1 (DCert (DCertGenesis), toData) +import PlutusLedgerApi.V1.Contexts (ScriptPurpose (Certifying, Minting, Rewarding, Spending), TxOutRef (TxOutRef)) +import PlutusLedgerApi.V1.Credential ( Credential (PubKeyCredential, ScriptCredential), StakingCredential (StakingPtr), ) diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 80ba3d202..ddc078f56 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -19,7 +19,7 @@ module Plutarch.ScriptsSpec ( import Data.Text (Text) -import qualified Plutus.V1.Ledger.Api as Plutus +import qualified PlutusLedgerApi.V1 as Plutus import Data.Coerce (coerce) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 6cc361ff5..c3d3c1905 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -135,12 +135,12 @@ executable plutarch-test , rank2classes , serialise - if impl(ghc <9.0) - build-depends: - , plutus-tx-plugin - , shrinker + -- FIXME: Re-enable + -- if impl(ghc <9.0) + -- build-depends: + -- , plutus-tx-plugin - other-modules: Plutarch.FFISpec + -- other-modules: Plutarch.FFISpec if impl(ghc >=9.0) other-modules: From 4d3b7a4c080361c79f7d1fb6b313ec9a41d01b1d Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 31 May 2022 15:19:53 +0000 Subject: [PATCH 481/584] Update Nixpkgs --- flake.lock | 8 ++++---- flake.nix | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index e173189e8..0aec9c283 100644 --- a/flake.lock +++ b/flake.lock @@ -794,17 +794,17 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1653845079, - "narHash": "sha256-7ghaQZ+7JXLI9FgNH8+RQHAt3/ubT92j8NtjZleP6t4=", + "lastModified": 1653918805, + "narHash": "sha256-6ahwAnBNGgqSNSn/6RnsxrlFi+fkA+RyT6o/5S1915o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b62ada430501de88dfbb08cea4eb98ead3a5e3e7", + "rev": "a0a69be4b5ee63f1b5e75887a406e9194012b492", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", "repo": "nixpkgs", + "rev": "a0a69be4b5ee63f1b5e75887a406e9194012b492", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 498c7d303..174ea2ef7 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "plutarch"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=a0a69be4b5ee63f1b5e75887a406e9194012b492"; inputs.haskell-nix.url = "github:input-output-hk/haskell.nix"; inputs.haskell-nix.inputs.nixpkgs.follows = "nixpkgs"; @@ -41,7 +41,7 @@ outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, hercules-ci-effects, haskell-nix-extra-hackage, ... }: let - supportedSystems = with nixpkgs.lib.systems.supported; tier1 ++ tier2 ++ tier3; + supportedSystems = nixpkgs.lib.systems.flakeExposed; perSystem = nixpkgs.lib.genAttrs supportedSystems; From 7340706af280c10797e04d0a9c2cbf04f32079a7 Mon Sep 17 00:00:00 2001 From: Peter Dragos Date: Tue, 31 May 2022 14:16:08 -0400 Subject: [PATCH 482/584] add link in guide (README -> PTryFrom ) --- docs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/README.md b/docs/README.md index 03eec8fc4..d45a07689 100644 --- a/docs/README.md +++ b/docs/README.md @@ -96,6 +96,7 @@ The [Typeclasses section](./Typeclasses.md) discusses the primary typeclasses re - [Alternatives to `OverloadedRecordDot`](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#alternatives-to-overloadedrecorddot) - [All about constructing data values](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#all-about-constructing-data-values) - [Implementing `PIsDataRepr` and friends](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) +- [`PTryFrom`](./Typeclasses/PTryFrom.md) ## Working with Types From 382791d50bf9b3dcd24aa8c95b5ba505f796b145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 31 May 2022 14:17:09 -0400 Subject: [PATCH 483/584] Ada-related functionality --- Plutarch/Api/V1/Value.hs | 84 +++++++++++++++++++ .../goldens/api.value.dev=false.bench.golden | 17 +++- .../api.value.dev=false.uplc.eval.golden | 17 +++- .../goldens/api.value.dev=false.uplc.golden | 17 +++- .../goldens/api.value.dev=true.bench.golden | 17 +++- .../api.value.dev=true.uplc.eval.golden | 17 +++- .../goldens/api.value.dev=true.uplc.golden | 17 +++- .../plutarch-base/Plutarch/ApiSpec.hs | 24 ++++++ 8 files changed, 204 insertions(+), 6 deletions(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 3b4fa54b8..023a4effe 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -2,30 +2,58 @@ {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} +-- | Value-related functionality. In order to keep the interface efficient and +-- safe at the same time, there is a type-level distinction between 'PValue's +-- that are guaranteed to be properly normalized and those that provide no +-- such guarantee. +-- +-- Also for efficiency reasons, the Ada-specific functions assume that there +-- can be only one token name for the Ada currency symbol, and they don't chek +-- whether it matches 'Plutus.adaToken'. module Plutarch.Api.V1.Value ( PValue (PValue), PCurrencySymbol (PCurrencySymbol), PTokenName (PTokenName), KeyGuarantees (Unsorted, Sorted), AmountGuarantees (NoGuarantees, NonZero, Positive), + + -- * Conversions and assertions passertSorted, passertPositive, pforgetPositive, pforgetSorted, pnormalize, + + -- * Creation psingleton, psingletonData, pconstantSingleton, pconstantPositiveSingleton, + + -- * Combining values punionWith, punionWithData, + + -- * Lookups pvalueOf, + plovelaceValueOf, + + -- * Ada-specific + padaSymbol, + padaSymbolData, + padaToken, + padaTokenData, + pisAdaOnlyValue, + padaOnlyValue, + pnoAdaValue, ) where import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted, Unsorted), PMap) import qualified Plutarch.Api.V1.AssocMap as AssocMap +import Plutarch.Bool (pif') +import Plutarch.FFI (foreignImport) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), @@ -33,7 +61,9 @@ import Plutarch.Lift ( PLifted, PUnsafeLiftDecl, ) +import qualified Plutarch.List as List import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) +import qualified PlutusTx as PlutusTx import qualified PlutusTx.Monoid as PlutusTx import qualified PlutusTx.Semigroup as PlutusTx @@ -192,6 +222,60 @@ pvalueOf = phoistAcyclic $ # plam (\map -> AssocMap.pfoldAt # token # 0 # plam pfromData # pfromData map) # pto value +-- | The 'PCurrencySymbol' of the Ada currency. +padaSymbol :: Term s PCurrencySymbol +padaSymbol = phoistAcyclic (foreignImport $ PlutusTx.liftCode Plutus.adaSymbol) + +-- | Data-encoded 'PCurrencySymbol' of the Ada currency. +padaSymbolData :: Term s (PAsData PCurrencySymbol) +padaSymbolData = phoistAcyclic (pdata padaSymbol) + +-- | The 'PTokenName' of the Ada currency. +padaToken :: Term s PTokenName +padaToken = phoistAcyclic (foreignImport $ PlutusTx.liftCode Plutus.adaToken) + +-- | Data-encoded 'PTokenName' of the Ada currency. +padaTokenData :: Term s (PAsData PTokenName) +padaTokenData = phoistAcyclic (pdata padaToken) + +-- | Test if the value contains nothing but Ada +pisAdaOnlyValue :: Term s (PValue 'Sorted 'Positive :--> PBool) +pisAdaOnlyValue = phoistAcyclic $ + plam $ \value -> + pmatch (pto $ pto value) $ \case + PNil -> pcon PTrue + PCons x xs -> pnull # xs #&& pfstBuiltin # x #== padaSymbolData + +-- | Value without any non-Ada +padaOnlyValue :: Term s (PValue 'Sorted v :--> PValue 'Sorted v) +padaOnlyValue = phoistAcyclic $ + plam $ \value -> + pmatch (pto $ pto value) $ \case + PNil -> value + PCons x _ -> + pif' # (pfstBuiltin # x #== padaSymbolData) + # pcon (PValue $ pcon $ AssocMap.PMap $ List.psingleton # x) + # pcon (PValue AssocMap.pempty) + +-- | Value without any Ada +pnoAdaValue :: Term s (PValue 'Sorted v :--> PValue 'Sorted v) +pnoAdaValue = phoistAcyclic $ + plam $ \value -> + pmatch (pto $ pto value) $ \case + PNil -> value + PCons x xs -> pif' # (pfstBuiltin # x #== padaSymbolData) # pcon (PValue $ pcon $ AssocMap.PMap xs) # value + +-- | The amount of Lovelace in value +plovelaceValueOf :: Term s (PValue 'Sorted v :--> PInteger) +plovelaceValueOf = phoistAcyclic $ + plam $ \value -> + pmatch (pto $ pto value) $ \case + PNil -> 0 + PCons x _ -> + pif' # (pfstBuiltin # x #== padaSymbolData) + # (pfromData $ psndBuiltin #$ phead #$ pto $ pfromData $ psndBuiltin # x) + # 0 + {- | Combine two 'PValue's applying the given function to any pair of quantities with the same asset class. Note that the result is _not_ 'normalize'd and may contain zero quantities. diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index a49c8a5c4..0fd53cc62 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -71,4 +71,19 @@ normalize.empty {"exBudgetCPU":30470910,"exBudgetMemory":70961,"scriptSizeBytes" assertSorted.succeeds {"exBudgetCPU":39624703,"exBudgetMemory":94582,"scriptSizeBytes":474} assertSorted.fails on malsorted symbols {"exBudgetCPU":28293494,"exBudgetMemory":62258,"scriptSizeBytes":294} assertSorted.fails on zero quantities {"exBudgetCPU":28058984,"exBudgetMemory":62128,"scriptSizeBytes":472} -assertSorted.fails on empty token map {"exBudgetCPU":1500103,"exBudgetMemory":423,"scriptSizeBytes":215} \ No newline at end of file +assertSorted.fails on empty token map {"exBudgetCPU":1500103,"exBudgetMemory":423,"scriptSizeBytes":215} +Ada.adaSymbol {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} +Ada.adaToken {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} +Ada.lovelaceValueOf {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} +Ada.isAdaOnlyValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":46} +Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":52} +Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":5456039,"exBudgetMemory":11150,"scriptSizeBytes":109} +Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":15792457,"exBudgetMemory":37029,"scriptSizeBytes":353} +Ada.adaOnlyValue.itself {"exBudgetCPU":238284,"exBudgetMemory":900,"scriptSizeBytes":52} +Ada.adaOnlyValue.on empty {"exBudgetCPU":686014,"exBudgetMemory":1932,"scriptSizeBytes":51} +Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":109} +Ada.adaOnlyValue.on Ada {"exBudgetCPU":5307174,"exBudgetMemory":10650,"scriptSizeBytes":95} +Ada.noAdaValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":37} +Ada.noAdaValue.on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":43} +Ada.noAdaValue.on non-Ada {"exBudgetCPU":4978536,"exBudgetMemory":10018,"scriptSizeBytes":100} +Ada.noAdaValue.on Ada {"exBudgetCPU":4889217,"exBudgetMemory":9718,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden index 18250471f..a4c96a9d4 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden @@ -202,4 +202,19 @@ assertSorted.succeeds (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) , (#41c7, #a149736f6d65746f6b656e01) ]) assertSorted.fails on malsorted symbols (program 1.0.0 error) assertSorted.fails on zero quantities (program 1.0.0 error) -assertSorted.fails on empty token map (program 1.0.0 error) \ No newline at end of file +assertSorted.fails on empty token map (program 1.0.0 error) +Ada.adaSymbol (program 1.0.0 #) +Ada.adaToken (program 1.0.0 #) +Ada.lovelaceValueOf (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (unIData (force (force sndPair) (force headList (unMapData (force (force sndPair) (force headList i1)))))) 0))))) +Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #))))))))) +Ada.isAdaOnlyValue.true on empty (program 1.0.0 True) +Ada.isAdaOnlyValue.trivially false (program 1.0.0 False) +Ada.isAdaOnlyValue.less trivially false (program 1.0.0 False) +Ada.adaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) ((\i0 -> force mkCons i1 [ ]) (force headList i1)) [ ]))))) +Ada.adaOnlyValue.on empty (program 1.0.0 []) +Ada.adaOnlyValue.on non-Ada (program 1.0.0 []) +Ada.adaOnlyValue.on Ada (program 1.0.0 [(#40, #a1401a00989680)]) +Ada.noAdaValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1))))) +Ada.noAdaValue.on empty (program 1.0.0 []) +Ada.noAdaValue.on non-Ada (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +Ada.noAdaValue.on Ada (program 1.0.0 []) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden index bc5bcf7a3..99e9caaa2 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.golden @@ -71,4 +71,19 @@ normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i11 (i12 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i3) (delay (i19 (i14 i1) (i2 (i15 i1)))))) i2) (i12 #c7 (i13 i17 1)) (i12 #c0 (i13 i17 1)))) (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i12 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay error) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i5 (i8 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i16 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i11 (i12 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i16) (bData i2) (mapData i1)) #c0 i12)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i13 i1)) (delay (i2 (i11 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay error) (delay (i4 (i9 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i8 (i9 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) [ ])) \ No newline at end of file +assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i16) (bData i2) (mapData i1)) #c0 i12)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i13 i1)) (delay (i2 (i11 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay error) (delay (i4 (i9 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i8 (i9 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) [ ])) +Ada.adaSymbol (program 1.0.0 #) +Ada.adaToken (program 1.0.0 #) +Ada.lovelaceValueOf (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (i3 i1)) (bData #)) (unIData (i2 (i3 (unMapData (i2 (i3 i1)))))) 0)))) (force (force sndPair))) (force headList))) +Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #))))))))) +Ada.isAdaOnlyValue.true on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #)))))))) [ ])) +Ada.isAdaOnlyValue.trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #)))))))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 i1 (delay True) (delay (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (force nullList (i7 i1)) (delay (equalsData (i8 (i9 i1)) (bData i16)))))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 #736f6d65746f6b656e 1)) (i10 i15 (i11 i15 10000000)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) +Ada.adaOnlyValue.itself (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> force mkCons i1 i4) (i2 i1)) i3)))) (force headList)) [ ])) +Ada.adaOnlyValue.on empty (program 1.0.0 ((\i0 -> (\i0 -> force (force (force chooseList) i2 (delay i2) (delay (force ifThenElse (equalsData (force (force fstPair) (i1 i2)) (bData #)) ((\i0 -> force mkCons i1 i3) (i1 i2)) i2)))) (force headList)) [ ])) +Ada.adaOnlyValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> \i0 -> i4 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i4 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +Ada.adaOnlyValue.on Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData i6)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> i3 (bData i6) (mapData i1)) ((\i0 -> i3 (bData i6) (iData i1)) 10000000))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) +Ada.noAdaValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1))))) +Ada.noAdaValue.on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1)))) [ ])) +Ada.noAdaValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1)))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +Ada.noAdaValue.on Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData i5)) (force tailList i1) i1)))) ((\i0 -> i2 (bData i5) (mapData i1)) ((\i0 -> i2 (bData i5) (iData i1)) 10000000))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index c9bced9c4..3a6862401 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -71,4 +71,19 @@ normalize.empty {"exBudgetCPU":30470910,"exBudgetMemory":70961,"scriptSizeBytes" assertSorted.succeeds {"exBudgetCPU":39833114,"exBudgetMemory":95282,"scriptSizeBytes":519} assertSorted.fails on malsorted symbols {"exBudgetCPU":28443494,"exBudgetMemory":62290,"scriptSizeBytes":340} assertSorted.fails on zero quantities {"exBudgetCPU":28208984,"exBudgetMemory":62160,"scriptSizeBytes":519} -assertSorted.fails on empty token map {"exBudgetCPU":1650103,"exBudgetMemory":455,"scriptSizeBytes":262} \ No newline at end of file +assertSorted.fails on empty token map {"exBudgetCPU":1650103,"exBudgetMemory":455,"scriptSizeBytes":262} +Ada.adaSymbol {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} +Ada.adaToken {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} +Ada.lovelaceValueOf {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} +Ada.isAdaOnlyValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":46} +Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":52} +Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":5456039,"exBudgetMemory":11150,"scriptSizeBytes":109} +Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":15792457,"exBudgetMemory":37029,"scriptSizeBytes":353} +Ada.adaOnlyValue.itself {"exBudgetCPU":238284,"exBudgetMemory":900,"scriptSizeBytes":52} +Ada.adaOnlyValue.on empty {"exBudgetCPU":686014,"exBudgetMemory":1932,"scriptSizeBytes":51} +Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":109} +Ada.adaOnlyValue.on Ada {"exBudgetCPU":5307174,"exBudgetMemory":10650,"scriptSizeBytes":95} +Ada.noAdaValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":37} +Ada.noAdaValue.on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":43} +Ada.noAdaValue.on non-Ada {"exBudgetCPU":4978536,"exBudgetMemory":10018,"scriptSizeBytes":100} +Ada.noAdaValue.on Ada {"exBudgetCPU":4889217,"exBudgetMemory":9718,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index 18250471f..a4c96a9d4 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -202,4 +202,19 @@ assertSorted.succeeds (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) , (#41c7, #a149736f6d65746f6b656e01) ]) assertSorted.fails on malsorted symbols (program 1.0.0 error) assertSorted.fails on zero quantities (program 1.0.0 error) -assertSorted.fails on empty token map (program 1.0.0 error) \ No newline at end of file +assertSorted.fails on empty token map (program 1.0.0 error) +Ada.adaSymbol (program 1.0.0 #) +Ada.adaToken (program 1.0.0 #) +Ada.lovelaceValueOf (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (unIData (force (force sndPair) (force headList (unMapData (force (force sndPair) (force headList i1)))))) 0))))) +Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #))))))))) +Ada.isAdaOnlyValue.true on empty (program 1.0.0 True) +Ada.isAdaOnlyValue.trivially false (program 1.0.0 False) +Ada.isAdaOnlyValue.less trivially false (program 1.0.0 False) +Ada.adaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) ((\i0 -> force mkCons i1 [ ]) (force headList i1)) [ ]))))) +Ada.adaOnlyValue.on empty (program 1.0.0 []) +Ada.adaOnlyValue.on non-Ada (program 1.0.0 []) +Ada.adaOnlyValue.on Ada (program 1.0.0 [(#40, #a1401a00989680)]) +Ada.noAdaValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1))))) +Ada.noAdaValue.on empty (program 1.0.0 []) +Ada.noAdaValue.on non-Ada (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) +Ada.noAdaValue.on Ada (program 1.0.0 []) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index 678839d1a..c4eb87ef2 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -71,4 +71,19 @@ normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i13 (i14 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i8 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i21 (i16 i1) (i2 (i17 i1)))))) i2) (i14 #c7 (i15 i19 1)) (i14 #c0 (i15 i19 1)))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i13 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i7 (i10 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force trace)) "unsorted map") (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i18 (i19 i23 1)) (i17 i18 (i19 i23 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i13 (i14 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i10 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i18) (bData i2) (mapData i1)) #c0 i14)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay (force (i9 i10 (delay error)))) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i10 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force trace)) "unsorted map") (force tailList)) (force (force fstPair))) (force headList)) [ ])) \ No newline at end of file +assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i10 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i18) (bData i2) (mapData i1)) #c0 i14)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay (force (i9 i10 (delay error)))) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i10 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force trace)) "unsorted map") (force tailList)) (force (force fstPair))) (force headList)) [ ])) +Ada.adaSymbol (program 1.0.0 #) +Ada.adaToken (program 1.0.0 #) +Ada.lovelaceValueOf (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (i3 i1)) (bData #)) (unIData (i2 (i3 (unMapData (i2 (i3 i1)))))) 0)))) (force (force sndPair))) (force headList))) +Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #))))))))) +Ada.isAdaOnlyValue.true on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #)))))))) [ ])) +Ada.isAdaOnlyValue.trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #)))))))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 i1 (delay True) (delay (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (force nullList (i7 i1)) (delay (equalsData (i8 (i9 i1)) (bData i16)))))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 #736f6d65746f6b656e 1)) (i10 i15 (i11 i15 10000000)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) +Ada.adaOnlyValue.itself (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> force mkCons i1 i4) (i2 i1)) i3)))) (force headList)) [ ])) +Ada.adaOnlyValue.on empty (program 1.0.0 ((\i0 -> (\i0 -> force (force (force chooseList) i2 (delay i2) (delay (force ifThenElse (equalsData (force (force fstPair) (i1 i2)) (bData #)) ((\i0 -> force mkCons i1 i3) (i1 i2)) i2)))) (force headList)) [ ])) +Ada.adaOnlyValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> \i0 -> i4 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i4 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +Ada.adaOnlyValue.on Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData i6)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> i3 (bData i6) (mapData i1)) ((\i0 -> i3 (bData i6) (iData i1)) 10000000))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) +Ada.noAdaValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1))))) +Ada.noAdaValue.on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1)))) [ ])) +Ada.noAdaValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1)))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +Ada.noAdaValue.on Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData i5)) (force tailList i1) i1)))) ((\i0 -> i2 (bData i5) (mapData i1)) ((\i0 -> i2 (bData i5) (iData i1)) 10000000))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 99b0d7d4c..c41a97982 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -72,6 +72,7 @@ spec = do let pmint = PValue.pconstantPositiveSingleton (pconstant "c0") (pconstant "sometoken") 1 pmintOtherToken = PValue.pconstantPositiveSingleton (pconstant "c0") (pconstant "othertoken") 1 pmintOtherSymbol = PValue.pconstantPositiveSingleton (pconstant "c7") (pconstant "sometoken") 1 + pada = PValue.pconstantPositiveSingleton PValue.padaSymbol PValue.padaToken 10_000_000 growingSymbols, symbols :: [EnclosedTerm (PValue 'Sorted 'Positive)] growingSymbols = scanl @@ -170,6 +171,29 @@ spec = do @| PValue.passertSorted # (pcon $ PValue.PValue $ AssocMap.psingleton # pconstant "c0" # AssocMap.pempty) @-> pfails + "Ada" @\ do + "adaSymbol" @| PValue.padaSymbol @-> psucceeds + "adaToken" @| PValue.padaToken @-> psucceeds + "lovelaceValueOf" @| PValue.plovelaceValueOf @-> \p -> passert (p # pada #== 10_000_000) + "isAdaOnlyValue" @\ do + "itself" @| PValue.pisAdaOnlyValue @-> \p -> passert (p # pada) + "true on empty" @| PValue.pisAdaOnlyValue # (mempty :: Term _ (PValue 'Sorted 'Positive)) @-> passert + "trivially false" @| PValue.pisAdaOnlyValue # pmint @-> passertNot + "less trivially false" @| PValue.pisAdaOnlyValue # (pmint <> pada) @-> passertNot + "adaOnlyValue" @\ do + "itself" @| PValue.padaOnlyValue @-> \p -> passert (p # (pada <> pmint) #== pada) + "on empty" + @| PValue.padaOnlyValue # (mempty :: Term _ (PValue 'Sorted 'Positive)) + @-> \p -> passert (p #== mempty) + "on non-Ada" @| PValue.padaOnlyValue # pmint @-> \p -> passert (p #== mempty) + "on Ada" @| PValue.padaOnlyValue # pada @-> \p -> passert (p #== pada) + "noAdaValue" @\ do + "itself" @| PValue.pnoAdaValue @-> \p -> passert (p # (pada <> pmint) #== pmint) + "on empty" + @| PValue.pnoAdaValue # (mempty :: Term _ (PValue 'Sorted 'Positive)) + @-> \p -> passert (p #== mempty) + "on non-Ada" @| PValue.pnoAdaValue # pmint @-> \p -> passert (p #== pmint) + "on Ada" @| PValue.pnoAdaValue # pada @-> \p -> passert (p #== mempty) describe "map" $ do pgoldenSpec $ do let pmap, pdmap, emptyMap, doubleMap, otherMap :: Term _ (AssocMap.PMap 'Sorted PByteString PInteger) From f81954e1e91d9e54ac367583184511f36d1bbed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 31 May 2022 14:47:29 -0400 Subject: [PATCH 484/584] A slight optimization most of the time --- Plutarch/Api/V1/Value.hs | 4 ++-- plutarch-test/goldens/api.value.dev=false.bench.golden | 8 ++++---- .../goldens/api.value.dev=false.uplc.eval.golden | 2 +- plutarch-test/goldens/api.value.dev=false.uplc.golden | 8 ++++---- plutarch-test/goldens/api.value.dev=true.bench.golden | 8 ++++---- plutarch-test/goldens/api.value.dev=true.uplc.eval.golden | 2 +- plutarch-test/goldens/api.value.dev=true.uplc.golden | 8 ++++---- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 023a4effe..744f80f76 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -52,7 +52,7 @@ import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted, Unsorted), PMap) import qualified Plutarch.Api.V1.AssocMap as AssocMap -import Plutarch.Bool (pif') +import Plutarch.Bool (pand', pif') import Plutarch.FFI (foreignImport) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), @@ -244,7 +244,7 @@ pisAdaOnlyValue = phoistAcyclic $ plam $ \value -> pmatch (pto $ pto value) $ \case PNil -> pcon PTrue - PCons x xs -> pnull # xs #&& pfstBuiltin # x #== padaSymbolData + PCons x xs -> pand' # (pnull # xs) # (pfstBuiltin # x #== padaSymbolData) -- | Value without any non-Ada padaOnlyValue :: Term s (PValue 'Sorted v :--> PValue 'Sorted v) diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index 0fd53cc62..5021dc07c 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -75,10 +75,10 @@ assertSorted.fails on empty token map {"exBudgetCPU":1500103,"exBudgetMemory":42 Ada.adaSymbol {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} Ada.adaToken {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} Ada.lovelaceValueOf {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} -Ada.isAdaOnlyValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":46} -Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":52} -Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":5456039,"exBudgetMemory":11150,"scriptSizeBytes":109} -Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":15792457,"exBudgetMemory":37029,"scriptSizeBytes":353} +Ada.isAdaOnlyValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":45} +Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":50} +Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":107} +Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":16680641,"exBudgetMemory":37926,"scriptSizeBytes":351} Ada.adaOnlyValue.itself {"exBudgetCPU":238284,"exBudgetMemory":900,"scriptSizeBytes":52} Ada.adaOnlyValue.on empty {"exBudgetCPU":686014,"exBudgetMemory":1932,"scriptSizeBytes":51} Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":109} diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden index a4c96a9d4..da2128aab 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden @@ -206,7 +206,7 @@ assertSorted.fails on empty token map (program 1.0.0 error) Ada.adaSymbol (program 1.0.0 #) Ada.adaToken (program 1.0.0 #) Ada.lovelaceValueOf (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (unIData (force (force sndPair) (force headList (unMapData (force (force sndPair) (force headList i1)))))) 0))))) -Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #))))))))) +Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #))))))) Ada.isAdaOnlyValue.true on empty (program 1.0.0 True) Ada.isAdaOnlyValue.trivially false (program 1.0.0 False) Ada.isAdaOnlyValue.less trivially false (program 1.0.0 False) diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden index 99e9caaa2..e3028ff49 100644 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=false.uplc.golden @@ -75,10 +75,10 @@ assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\ Ada.adaSymbol (program 1.0.0 #) Ada.adaToken (program 1.0.0 #) Ada.lovelaceValueOf (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (i3 i1)) (bData #)) (unIData (i2 (i3 (unMapData (i2 (i3 i1)))))) 0)))) (force (force sndPair))) (force headList))) -Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #))))))))) -Ada.isAdaOnlyValue.true on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #)))))))) [ ])) -Ada.isAdaOnlyValue.trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #)))))))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 i1 (delay True) (delay (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (force nullList (i7 i1)) (delay (equalsData (i8 (i9 i1)) (bData i16)))))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 #736f6d65746f6b656e 1)) (i10 i15 (i11 i15 10000000)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) +Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #))))))) +Ada.isAdaOnlyValue.true on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) [ ])) +Ada.isAdaOnlyValue.trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 i1 (delay True) (delay ((\i0 -> \i0 -> i7 i2 i1 False) (force nullList (i7 i1)) (equalsData (i8 (i9 i1)) (bData i16)))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 #736f6d65746f6b656e 1)) (i10 i15 (i11 i15 10000000)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) Ada.adaOnlyValue.itself (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> force mkCons i1 i4) (i2 i1)) i3)))) (force headList)) [ ])) Ada.adaOnlyValue.on empty (program 1.0.0 ((\i0 -> (\i0 -> force (force (force chooseList) i2 (delay i2) (delay (force ifThenElse (equalsData (force (force fstPair) (i1 i2)) (bData #)) ((\i0 -> force mkCons i1 i3) (i1 i2)) i2)))) (force headList)) [ ])) Ada.adaOnlyValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> \i0 -> i4 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i4 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index 3a6862401..d2794e70f 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -75,10 +75,10 @@ assertSorted.fails on empty token map {"exBudgetCPU":1650103,"exBudgetMemory":45 Ada.adaSymbol {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} Ada.adaToken {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} Ada.lovelaceValueOf {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} -Ada.isAdaOnlyValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":46} -Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":52} -Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":5456039,"exBudgetMemory":11150,"scriptSizeBytes":109} -Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":15792457,"exBudgetMemory":37029,"scriptSizeBytes":353} +Ada.isAdaOnlyValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":45} +Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":50} +Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":107} +Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":16680641,"exBudgetMemory":37926,"scriptSizeBytes":351} Ada.adaOnlyValue.itself {"exBudgetCPU":238284,"exBudgetMemory":900,"scriptSizeBytes":52} Ada.adaOnlyValue.on empty {"exBudgetCPU":686014,"exBudgetMemory":1932,"scriptSizeBytes":51} Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":109} diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index a4c96a9d4..da2128aab 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -206,7 +206,7 @@ assertSorted.fails on empty token map (program 1.0.0 error) Ada.adaSymbol (program 1.0.0 #) Ada.adaToken (program 1.0.0 #) Ada.lovelaceValueOf (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (unIData (force (force sndPair) (force headList (unMapData (force (force sndPair) (force headList i1)))))) 0))))) -Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #))))))))) +Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #))))))) Ada.isAdaOnlyValue.true on empty (program 1.0.0 True) Ada.isAdaOnlyValue.trivially false (program 1.0.0 False) Ada.isAdaOnlyValue.less trivially false (program 1.0.0 False) diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index c4eb87ef2..0740ab4ab 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -75,10 +75,10 @@ assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\ Ada.adaSymbol (program 1.0.0 #) Ada.adaToken (program 1.0.0 #) Ada.lovelaceValueOf (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (i3 i1)) (bData #)) (unIData (i2 (i3 (unMapData (i2 (i3 i1)))))) 0)))) (force (force sndPair))) (force headList))) -Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #))))))))) -Ada.isAdaOnlyValue.true on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #)))))))) [ ])) -Ada.isAdaOnlyValue.trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay True) (delay (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (force nullList (force tailList i1)) (delay (equalsData (force (force fstPair) (force headList i1)) (bData #)))))))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 i1 (delay True) (delay (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (force nullList (i7 i1)) (delay (equalsData (i8 (i9 i1)) (bData i16)))))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 #736f6d65746f6b656e 1)) (i10 i15 (i11 i15 10000000)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) +Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #))))))) +Ada.isAdaOnlyValue.true on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) [ ])) +Ada.isAdaOnlyValue.trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 i1 (delay True) (delay ((\i0 -> \i0 -> i7 i2 i1 False) (force nullList (i7 i1)) (equalsData (i8 (i9 i1)) (bData i16)))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 #736f6d65746f6b656e 1)) (i10 i15 (i11 i15 10000000)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) Ada.adaOnlyValue.itself (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> force mkCons i1 i4) (i2 i1)) i3)))) (force headList)) [ ])) Ada.adaOnlyValue.on empty (program 1.0.0 ((\i0 -> (\i0 -> force (force (force chooseList) i2 (delay i2) (delay (force ifThenElse (equalsData (force (force fstPair) (i1 i2)) (bData #)) ((\i0 -> force mkCons i1 i3) (i1 i2)) i2)))) (force headList)) [ ])) Ada.adaOnlyValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> \i0 -> i4 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i4 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) From 5df0fade3bf127622e038fa2b00cfeeeaf41932e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 31 May 2022 14:48:16 -0400 Subject: [PATCH 485/584] Formatting --- Plutarch/Api/V1/Value.hs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 744f80f76..053a03320 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -2,14 +2,15 @@ {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} --- | Value-related functionality. In order to keep the interface efficient and --- safe at the same time, there is a type-level distinction between 'PValue's --- that are guaranteed to be properly normalized and those that provide no --- such guarantee. --- --- Also for efficiency reasons, the Ada-specific functions assume that there --- can be only one token name for the Ada currency symbol, and they don't chek --- whether it matches 'Plutus.adaToken'. +{- | Value-related functionality. In order to keep the interface efficient and + safe at the same time, there is a type-level distinction between 'PValue's + that are guaranteed to be properly normalized and those that provide no + such guarantee. + + Also for efficiency reasons, the Ada-specific functions assume that there + can be only one token name for the Ada currency symbol, and they don't chek + whether it matches 'Plutus.adaToken'. +-} module Plutarch.Api.V1.Value ( PValue (PValue), PCurrencySymbol (PCurrencySymbol), From 8b470bd2e55113d0682d03b6e3ca5443af943d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 31 May 2022 14:51:19 -0400 Subject: [PATCH 486/584] Fixed a typo --- Plutarch/Api/V1/Value.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 053a03320..9baaa54a8 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -8,7 +8,7 @@ such guarantee. Also for efficiency reasons, the Ada-specific functions assume that there - can be only one token name for the Ada currency symbol, and they don't chek + can be only one token name for the Ada currency symbol, and they don't check whether it matches 'Plutus.adaToken'. -} module Plutarch.Api.V1.Value ( From da570fb38c907c067d596ef80b7e0352e8e4c0b9 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 31 May 2022 19:30:06 +0000 Subject: [PATCH 487/584] Always use cabalProjectLocal --- flake.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 174ea2ef7..a2294e56e 100644 --- a/flake.nix +++ b/flake.nix @@ -157,8 +157,7 @@ modules = haskellModules ++ [ h.module ] ++ (o.modules or []); extra-hackages = [ (import h.hackageNix) ] ++ (o.extra-hackages or []); extra-hackage-tarballs = { _xNJUd_plutarch-hackage = h.hackageTarball; } // (o.extra-hackage-tarballs or {}); - cabalProjectLocal = (o.cabalProjectLocal or "") + ( - if isGhc9 o.compiler-nix-name then '' + cabalProjectLocal = (o.cabalProjectLocal or "") + ('' allow-newer: cardano-binary:base , cardano-crypto-class:base @@ -339,7 +338,7 @@ , word-array >= 0.1.0.0 , secp256k1-haskell >= 0.6 , inline-r >= 0.10.5 - '' else "" + '' ); }; From ff35eaa705fe2f168fc128f2273e23a628bc2136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 31 May 2022 16:43:59 -0400 Subject: [PATCH 488/584] Replaced FFI.foreignImport with pconstant --- Plutarch/Api/V1/Value.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 9baaa54a8..eb2419c04 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -54,7 +54,6 @@ import qualified Plutus.V1.Ledger.Api as Plutus import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted, Unsorted), PMap) import qualified Plutarch.Api.V1.AssocMap as AssocMap import Plutarch.Bool (pand', pif') -import Plutarch.FFI (foreignImport) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), @@ -64,7 +63,6 @@ import Plutarch.Lift ( ) import qualified Plutarch.List as List import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) -import qualified PlutusTx as PlutusTx import qualified PlutusTx.Monoid as PlutusTx import qualified PlutusTx.Semigroup as PlutusTx @@ -225,19 +223,19 @@ pvalueOf = phoistAcyclic $ -- | The 'PCurrencySymbol' of the Ada currency. padaSymbol :: Term s PCurrencySymbol -padaSymbol = phoistAcyclic (foreignImport $ PlutusTx.liftCode Plutus.adaSymbol) +padaSymbol = pconstant Plutus.adaSymbol -- | Data-encoded 'PCurrencySymbol' of the Ada currency. padaSymbolData :: Term s (PAsData PCurrencySymbol) -padaSymbolData = phoistAcyclic (pdata padaSymbol) +padaSymbolData = pdata padaSymbol -- | The 'PTokenName' of the Ada currency. padaToken :: Term s PTokenName -padaToken = phoistAcyclic (foreignImport $ PlutusTx.liftCode Plutus.adaToken) +padaToken = pconstant Plutus.adaToken -- | Data-encoded 'PTokenName' of the Ada currency. padaTokenData :: Term s (PAsData PTokenName) -padaTokenData = phoistAcyclic (pdata padaToken) +padaTokenData = pdata padaToken -- | Test if the value contains nothing but Ada pisAdaOnlyValue :: Term s (PValue 'Sorted 'Positive :--> PBool) From 978433f8265df2e93b2cce36d6ee075e0f3531e9 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Jun 2022 09:01:57 +0000 Subject: [PATCH 489/584] Use ghc923 and re-enable HLS --- flake.lock | 61 +++++++++++++++++++++++++++++------------------------- flake.nix | 25 +++++++++++----------- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/flake.lock b/flake.lock index 0aec9c283..86eba7375 100644 --- a/flake.lock +++ b/flake.lock @@ -339,11 +339,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1653441966, - "narHash": "sha256-aJFK0wDzoOrtb7ucZzKh5J+S2pThpwNCofl74s1olXU=", + "lastModified": 1654046237, + "narHash": "sha256-FpM9zE+Q+WrvCiaZBCg5U1g0bYpiZOCxY8V3R5ydBu8=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "f7fe6ef8de52c43a9efa6fd4ac4902e5957dc573", + "rev": "eeae1790b9c6a880d96e4a7214fdf0a73bdd6fc0", "type": "github" }, "original": { @@ -415,7 +415,8 @@ "hydra": "hydra", "nix-tools": "nix-tools", "nixpkgs": [ - "nixpkgs" + "haskell-nix", + "nixpkgs-unstable" ], "nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2105": "nixpkgs-2105", @@ -425,11 +426,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1653910415, - "narHash": "sha256-04WohZsQTyb2k7u1w+OGpnUgXQ8d9UqTZal4IHCSx+A=", + "lastModified": 1654068838, + "narHash": "sha256-GHSufC21DSg8Lz2AzIg3DA9DPxGvLqxGFa/4ADoXRhU=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "07619e19798ebd9e01fe9708335afbdb5151dead", + "rev": "fa2fa131fe15e630c91ab4078d12eb32c41f934b", "type": "github" }, "original": { @@ -716,6 +717,22 @@ "type": "github" } }, + "nixpkgs-latest": { + "locked": { + "lastModified": 1653918805, + "narHash": "sha256-6ahwAnBNGgqSNSn/6RnsxrlFi+fkA+RyT6o/5S1915o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a0a69be4b5ee63f1b5e75887a406e9194012b492", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a0a69be4b5ee63f1b5e75887a406e9194012b492", + "type": "github" + } + }, "nixpkgs-regression": { "locked": { "lastModified": 1643052045, @@ -793,22 +810,6 @@ } }, "nixpkgs_5": { - "locked": { - "lastModified": 1653918805, - "narHash": "sha256-6ahwAnBNGgqSNSn/6RnsxrlFi+fkA+RyT6o/5S1915o=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a0a69be4b5ee63f1b5e75887a406e9194012b492", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "a0a69be4b5ee63f1b5e75887a406e9194012b492", - "type": "github" - } - }, - "nixpkgs_6": { "flake": false, "locked": { "lastModified": 1645493675, @@ -867,7 +868,7 @@ "haskell-language-server": "haskell-language-server_2", "haskell-nix": "haskell-nix_2", "iohk-nix": "iohk-nix_2", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_5", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sphinxcontrib-haddock": "sphinxcontrib-haddock" }, @@ -929,7 +930,11 @@ "haskell-nix-extra-hackage": "haskell-nix-extra-hackage", "hercules-ci-effects": "hercules-ci-effects", "iohk-nix": "iohk-nix", - "nixpkgs": "nixpkgs_5", + "nixpkgs": [ + "haskell-nix", + "nixpkgs-unstable" + ], + "nixpkgs-latest": "nixpkgs-latest", "plutus": "plutus", "protolude": "protolude", "secp256k1-haskell": "secp256k1-haskell" @@ -970,11 +975,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1653355076, - "narHash": "sha256-mQdOgAyFkLUJBPrVDZmZQ2JRtgHKOQkil//SDdcjP1U=", + "lastModified": 1654046327, + "narHash": "sha256-IxX46Dh4OZpF3k7KPMa3tZSScYYGqFxXpCnMc0QRkuQ=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "71b16ca68d6acd639121db43238896357fe53f54", + "rev": "cc1d778723fcd431f9b2ed632a50c610c3e38b54", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a2294e56e..c52c1daea 100644 --- a/flake.nix +++ b/flake.nix @@ -1,10 +1,9 @@ { description = "plutarch"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=a0a69be4b5ee63f1b5e75887a406e9194012b492"; - inputs.haskell-nix.url = "github:input-output-hk/haskell.nix"; - inputs.haskell-nix.inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable"; + inputs.nixpkgs-latest.url = "github:NixOS/nixpkgs?rev=a0a69be4b5ee63f1b5e75887a406e9194012b492"; inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; @@ -39,7 +38,7 @@ inputs.emanote.url = "github:srid/emanote/master"; - outputs = inputs@{ self, nixpkgs, iohk-nix, haskell-nix, hercules-ci-effects, haskell-nix-extra-hackage, ... }: + outputs = inputs@{ self, nixpkgs, nixpkgs-latest, iohk-nix, haskell-nix, hercules-ci-effects, haskell-nix-extra-hackage, ... }: let supportedSystems = nixpkgs.lib.systems.flakeExposed; @@ -51,9 +50,11 @@ # This only does bad things for us... # inherit (haskell-nix) config; }; - pkgsFor' = system: import nixpkgs { inherit system; }; + pkgsFor' = system: import nixpkgs-latest { inherit system; }; + + fourmoluFor = system: (pkgsFor' system).haskell.packages.ghc922.fourmolu_0_6_0_0; - defaultGhcVersion = "ghc922"; + defaultGhcVersion = "ghc923"; isGhc9 = x: builtins.trace "Checking whether ${x} is GHC 9.*" (builtins.substring 3 1 x == "9"); # https://github.com/input-output-hk/haskell.nix/issues/1177 @@ -104,9 +105,9 @@ hlsFor' = compiler-nix-name: system: let pkgs = pkgsFor system; in pkgs.haskell-nix.cabalProject' { - modules = [ - { inherit nonReinstallablePkgs; } - ]; + modules = [{ + reinstallableLibGhc = true; + }]; inherit compiler-nix-name; src = "${inputs.haskell-language-server}"; }; @@ -365,10 +366,10 @@ pkgs'.cabal-install pkgs'.hlint pkgs'.haskellPackages.cabal-fmt - pkgs'.haskellPackages.fourmolu_0_6_0_0 + (fourmoluFor system) pkgs'.nixpkgs-fmt pkgSet.hsPkgs.hspec-discover.components.exes.hspec-discover - # (hlsFor compiler-nix-name system) + (hlsFor compiler-nix-name system) ]; }; }); in @@ -383,7 +384,7 @@ in pkgs'.runCommand "format-check" { - nativeBuildInputs = [ pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt pkgs'.haskellPackages.fourmolu_0_6_0_0 ]; + nativeBuildInputs = [ pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt (fourmoluFor system) ]; } '' export LC_CTYPE=C.UTF-8 export LC_ALL=C.UTF-8 From 42def00bcaae939d1b702ca14e36b740ead55da0 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Jun 2022 09:14:37 +0000 Subject: [PATCH 490/584] Use nixpkgs-latest's lib --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index c52c1daea..ff9ddee5a 100644 --- a/flake.nix +++ b/flake.nix @@ -40,9 +40,9 @@ outputs = inputs@{ self, nixpkgs, nixpkgs-latest, iohk-nix, haskell-nix, hercules-ci-effects, haskell-nix-extra-hackage, ... }: let - supportedSystems = nixpkgs.lib.systems.flakeExposed; + supportedSystems = nixpkgs-latest.lib.systems.flakeExposed; - perSystem = nixpkgs.lib.genAttrs supportedSystems; + perSystem = nixpkgs-latest.lib.genAttrs supportedSystems; pkgsFor = system: import nixpkgs { inherit system; From 974373a24ef9a08a9d1b1c626097a1cb3fb4289c Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Jun 2022 10:24:55 +0000 Subject: [PATCH 491/584] Fix HLS --- flake.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flake.nix b/flake.nix index ff9ddee5a..ec6d04ffd 100644 --- a/flake.nix +++ b/flake.nix @@ -106,10 +106,12 @@ let pkgs = pkgsFor system; in pkgs.haskell-nix.cabalProject' { modules = [{ + inherit nonReinstallablePkgs; reinstallableLibGhc = true; }]; inherit compiler-nix-name; src = "${inputs.haskell-language-server}"; + sha256map."https://github.com/pepeiborra/ekg-json"."7a0af7a8fd38045fd15fb13445bdcc7085325460" = "fVwKxGgM0S4Kv/4egVAAiAjV7QB5PBqMVMCfsv7otIQ="; }; hlsFor = compiler-nix-name: system: (hlsFor' compiler-nix-name system).hsPkgs.haskell-language-server.components.exes.haskell-language-server; From a7da898b44626f8d50742b4d8965beb10ef9540c Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Jun 2022 13:05:43 +0000 Subject: [PATCH 492/584] ./bin/format --- Plutarch/Evaluate.hs | 6 +++--- Plutarch/Internal.hs | 2 +- Plutarch/Internal/Other.hs | 2 +- Plutarch/Lift.hs | 2 +- flake.nix | 9 +++++---- plutarch-test/common/Plutarch/Test/Golden.hs | 4 ++-- plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs | 2 +- plutarch-test/conditional/Plutarch/FieldSpec.hs | 2 +- plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs | 2 +- 9 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Plutarch/Evaluate.hs b/Plutarch/Evaluate.hs index 7c2ed62ed..4813d0717 100644 --- a/Plutarch/Evaluate.hs +++ b/Plutarch/Evaluate.hs @@ -3,16 +3,16 @@ module Plutarch.Evaluate (evaluateBudgetedScript, evaluateScript, evalScript, evalScript', EvalError) where import Data.Text (Text) -import PlutusLedgerApi.V1.Scripts (Script (Script)) -import qualified PlutusLedgerApi.V1.Scripts as Scripts import qualified PlutusCore as PLC -import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultCekParameters) import PlutusCore.Evaluation.Machine.ExBudget ( ExBudget (ExBudget), ExRestrictingBudget (ExRestrictingBudget), minusExBudget, ) +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultCekParameters) import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) +import PlutusLedgerApi.V1.Scripts (Script (Script)) +import qualified PlutusLedgerApi.V1.Scripts as Scripts import UntypedPlutusCore ( Program (Program), Term, diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 379063ce2..a9de187de 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -45,10 +45,10 @@ import GHC.Stack (HasCallStack) import GHC.Word (Word64) import Plutarch.Evaluate (evalScript) import Plutarch.Reducible (Reducible (Reduce)) -import PlutusLedgerApi.V1.Scripts (Script (Script)) import PlutusCore (Some (Some), ValueOf (ValueOf)) import qualified PlutusCore as PLC import PlutusCore.DeBruijn (DeBruijn (DeBruijn), Index (Index)) +import PlutusLedgerApi.V1.Scripts (Script (Script)) import qualified UntypedPlutusCore as UPLC {- $hoisted diff --git a/Plutarch/Internal/Other.hs b/Plutarch/Internal/Other.hs index d77066e50..cfcfaebf2 100644 --- a/Plutarch/Internal/Other.hs +++ b/Plutarch/Internal/Other.hs @@ -39,8 +39,8 @@ import Plutarch.Internal (ClosedTerm, PType, Term, compile, phoistAcyclic, punsa import qualified Plutarch.Internal as PI import Plutarch.Internal.PLam (pinl, plam, (#), (#$)) import Plutarch.Internal.PlutusType (PCon (pcon), PMatch (pmatch), PlutusType (PInner, pcon', pmatch')) -import PlutusLedgerApi.V1.Scripts (Script (Script)) import PlutusCore.Pretty (prettyPlcReadableDebug) +import PlutusLedgerApi.V1.Scripts (Script (Script)) -- | Prettyprint a compiled Script via the PLC pretty printer printScript :: Script -> String diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 38bd98759..b8133ddd8 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -36,10 +36,10 @@ import Data.Kind (Constraint, Type) import GHC.Stack (HasCallStack) import Plutarch.Evaluate (EvalError, evalScript) import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInternal) -import qualified PlutusLedgerApi.V1.Scripts as Scripts import qualified PlutusCore as PLC import PlutusCore.Builtin (KnownTypeError, readKnownConstant) import PlutusCore.Evaluation.Machine.Exception (_UnliftingErrorE) +import qualified PlutusLedgerApi.V1.Scripts as Scripts import PlutusTx (BuiltinData, Data, builtinDataToData, dataToBuiltinData) import PlutusTx.Builtins.Class (FromBuiltin, ToBuiltin, fromBuiltin, toBuiltin) import qualified UntypedPlutusCore as UPLC diff --git a/flake.nix b/flake.nix index ec6d04ffd..6d51ead86 100644 --- a/flake.nix +++ b/flake.nix @@ -157,10 +157,11 @@ applyPlutarchDep = pkgs: o: let h = myhackage pkgs.system o.compiler-nix-name; in o // { - modules = haskellModules ++ [ h.module ] ++ (o.modules or []); - extra-hackages = [ (import h.hackageNix) ] ++ (o.extra-hackages or []); - extra-hackage-tarballs = { _xNJUd_plutarch-hackage = h.hackageTarball; } // (o.extra-hackage-tarballs or {}); - cabalProjectLocal = (o.cabalProjectLocal or "") + ('' + modules = haskellModules ++ [ h.module ] ++ (o.modules or [ ]); + extra-hackages = [ (import h.hackageNix) ] ++ (o.extra-hackages or [ ]); + extra-hackage-tarballs = { _xNJUd_plutarch-hackage = h.hackageTarball; } // (o.extra-hackage-tarballs or { }); + cabalProjectLocal = (o.cabalProjectLocal or "") + ( + '' allow-newer: cardano-binary:base , cardano-crypto-class:base diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index c5205a37c..19ad7d2a4 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -276,8 +276,8 @@ evalScriptAlwaysWithBenchmark script = let (res, exbudget, _traces) = evalScript script bench = mkBenchmark exbudget (scriptSize script) in ( case res of - Left _ -> compile perror - Right x -> x + Left _ -> compile perror + Right x -> x , bench ) diff --git a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs index 4b7f3bb41..7d5adb4e2 100644 --- a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs +++ b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs @@ -31,9 +31,9 @@ import Control.Monad.IO.Class (liftIO) import Data.SOP (NP (Nil, (:*))) import Data.Text (Text) import Hedgehog (Gen, Property, PropertyT, annotate, annotateShow, assert, forAll, property, (===)) -import PlutusLedgerApi.V1.Scripts (Script (Script, unScript)) import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) +import PlutusLedgerApi.V1.Scripts (Script (Script, unScript)) import Plutarch (compile) import Plutarch.Evaluate (EvalError, evalScript') diff --git a/plutarch-test/conditional/Plutarch/FieldSpec.hs b/plutarch-test/conditional/Plutarch/FieldSpec.hs index d261d3840..4888ab2c0 100644 --- a/plutarch-test/conditional/Plutarch/FieldSpec.hs +++ b/plutarch-test/conditional/Plutarch/FieldSpec.hs @@ -2,9 +2,9 @@ module Plutarch.FieldSpec (spec) where +import qualified PlutusCore as PLC import PlutusLedgerApi.V1.Address (Address (Address)) import PlutusLedgerApi.V1.Credential (Credential (PubKeyCredential)) -import qualified PlutusCore as PLC import qualified PlutusTx import Test.Tasty.HUnit diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index f8a88d066..35879e413 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -15,8 +15,8 @@ import Plutarch.Builtin (pasByteStr, pasConstr) import Plutarch.DataRepr (PDataSum (PDataSum), pasDataSum) import Plutarch.Prelude import Plutarch.Test -import PlutusLedgerApi.V1.Address (Address (Address)) import PlutusLedgerApi.V1 (DCert (DCertGenesis), toData) +import PlutusLedgerApi.V1.Address (Address (Address)) import PlutusLedgerApi.V1.Contexts (ScriptPurpose (Certifying, Minting, Rewarding, Spending), TxOutRef (TxOutRef)) import PlutusLedgerApi.V1.Credential ( Credential (PubKeyCredential, ScriptCredential), From 7e0806bde171c6f3c6b5935d0c3e2050155a4ae7 Mon Sep 17 00:00:00 2001 From: Peter Dragos Date: Wed, 1 Jun 2022 12:50:17 -0400 Subject: [PATCH 493/584] add `PTryFrom` hyperlink to `Typeclasses.md` --- docs/Typeclasses.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Typeclasses.md b/docs/Typeclasses.md index 627ac970b..e62975e7d 100644 --- a/docs/Typeclasses.md +++ b/docs/Typeclasses.md @@ -18,3 +18,4 @@ This section describes the primary typeclasses used in Plutarch. - [Alternatives to `OverloadedRecordDot`](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#alternatives-to-overloadedrecorddot) - [All about constructing data values](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#all-about-constructing-data-values) - [Implementing `PIsDataRepr` and friends](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) +- [`PTryFrom`](./Typeclasses/PTryFrom.md) From df975a450575cc379eabaa227ee9e0642b0dab8c Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Jun 2022 17:11:59 +0000 Subject: [PATCH 494/584] Disable unused golden checking temporarily --- plutarch-test/Main.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index dfdca9725..09db46fa6 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -8,8 +8,8 @@ import qualified ExtraSpec #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) import qualified Plutarch.FieldSpec as FieldSpec import qualified Plutarch.MonadicSpec as MonadicSpec -import Plutarch.Test.Run (noUnusedGoldens, hspecAndReturnForest) -import Test.Hspec (Spec, describe) +-- import Plutarch.Test.Run (noUnusedGoldens, hspecAndReturnForest) +import Test.Hspec (Spec, hspec, describe) #else -- import qualified Plutarch.FFISpec as FFISpec import Test.Hspec (Spec, hspec) @@ -21,6 +21,7 @@ main :: IO () main = do setLocaleEncoding utf8 +{- -- We test for unused goldens, but do so only in GHC 9. Because, under GHC 8 -- certain modules are disabled (see the CPP below) which leads to legitimately -- unused goldens detected leading to false positive in test failure. @@ -29,6 +30,10 @@ main = do #else hspec spec #endif +-} + + -- FIXME: Re-enable unused golden checks + hspec spec spec :: Spec spec = do From 34aaec7614c36256be72257ea08c0fdcf9103f81 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 1 Jun 2022 22:41:01 +0530 Subject: [PATCH 495/584] Add remaining hyperlinks --- docs/README.md | 3 +++ docs/Typeclasses.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/README.md b/docs/README.md index d45a07689..141a9ac04 100644 --- a/docs/README.md +++ b/docs/README.md @@ -97,6 +97,9 @@ The [Typeclasses section](./Typeclasses.md) discusses the primary typeclasses re - [All about constructing data values](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#all-about-constructing-data-values) - [Implementing `PIsDataRepr` and friends](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) - [`PTryFrom`](./Typeclasses/PTryFrom.md) + - [Laws](./Typeclasses/PTryFrom.md#laws) + - [`PTryFromExcess`](./Typeclasses/PTryFrom.md#ptryfromexcess) + - [Recovering only partially](./Typeclasses/PTryFrom.md#recovering-only-partially) ## Working with Types diff --git a/docs/Typeclasses.md b/docs/Typeclasses.md index e62975e7d..97c9e528f 100644 --- a/docs/Typeclasses.md +++ b/docs/Typeclasses.md @@ -19,3 +19,6 @@ This section describes the primary typeclasses used in Plutarch. - [All about constructing data values](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#all-about-constructing-data-values) - [Implementing `PIsDataRepr` and friends](./Typeclasses/PIsDataRepr%20and%20PDataFields.md#implementing-pisdatarepr-and-friends) - [`PTryFrom`](./Typeclasses/PTryFrom.md) + - [Laws](./Typeclasses/PTryFrom.md#laws) + - [`PTryFromExcess`](./Typeclasses/PTryFrom.md#ptryfromexcess) + - [Recovering only partially](./Typeclasses/PTryFrom.md#recovering-only-partially) From eb402180e63c4e31b1926a2f16fc7d7f40203e76 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Jun 2022 17:19:43 +0000 Subject: [PATCH 496/584] Fix issue with fourmolu --- plutarch-test/Main.hs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/plutarch-test/Main.hs b/plutarch-test/Main.hs index 09db46fa6..fd58883c1 100644 --- a/plutarch-test/Main.hs +++ b/plutarch-test/Main.hs @@ -21,20 +21,18 @@ main :: IO () main = do setLocaleEncoding utf8 -{- --- We test for unused goldens, but do so only in GHC 9. Because, under GHC 8 --- certain modules are disabled (see the CPP below) which leads to legitimately --- unused goldens detected leading to false positive in test failure. -#if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) - noUnusedGoldens =<< hspecAndReturnForest spec -#else - hspec spec -#endif --} - -- FIXME: Re-enable unused golden checks + -- Old: + -- We test for unused goldens, but do so only in GHC 9. Because, under GHC 8 + -- certain modules are disabled (see the CPP below) which leads to legitimately + -- unused goldens detected leading to false positive in test failure. + -- #if MIN_VERSION_GLASGOW_HASKELL(9,0,0,0) + -- noUnusedGoldens =<< hspecAndReturnForest spec + -- #else hspec spec +-- #endif + spec :: Spec spec = do BaseSpec.spec From 6a2ae099235e24e1792695be38fef4483023825c Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Jun 2022 18:00:13 +0000 Subject: [PATCH 497/584] Update goldens --- .../goldens/FFI.Data.Benchmarks.bench.golden | 4 - .../FFI.Data.Benchmarks.uplc.eval.golden | 4 - .../goldens/FFI.Data.Benchmarks.uplc.golden | 4 - plutarch-test/goldens/api.ctx.bench.golden | 14 +- plutarch-test/goldens/api.map.bench.golden | 56 +++---- .../goldens/api.value.dev=false.bench.golden | 148 +++++++++--------- .../goldens/api.value.dev=true.bench.golden | 148 +++++++++--------- plutarch-test/goldens/field.data.bench.golden | 4 - .../goldens/field.data.uplc.eval.golden | 4 - plutarch-test/goldens/field.data.uplc.golden | 4 - .../goldens/field.dropFields.bench.golden | 2 - .../goldens/field.dropFields.uplc.eval.golden | 2 - .../goldens/field.dropFields.uplc.golden | 11 -- .../goldens/field.other.bench.golden | 2 - .../goldens/field.other.uplc.eval.golden | 2 - plutarch-test/goldens/field.other.uplc.golden | 2 - .../goldens/field.pletFields.bench.golden | 5 - .../goldens/field.pletFields.uplc.eval.golden | 5 - .../goldens/field.pletFields.uplc.golden | 23 --- .../goldens/field.rangeFields.bench.golden | 2 - .../field.rangeFields.uplc.eval.golden | 2 - .../goldens/field.rangeFields.uplc.golden | 11 -- .../goldens/field.trips.bench.golden | 7 - .../goldens/field.trips.uplc.eval.golden | 7 - plutarch-test/goldens/field.trips.uplc.golden | 7 - plutarch-test/goldens/maybe.bench.golden | 10 +- ...monadic.api.example.getFields.bench.golden | 1 - ...dic.api.example.getFields.uplc.eval.golden | 1 - .../monadic.api.example.getFields.uplc.golden | 1 - ...i.example.signatory.dev=false.bench.golden | 2 - ...ample.signatory.dev=false.uplc.eval.golden | 2 - ...pi.example.signatory.dev=false.uplc.golden | 2 - ...pi.example.signatory.dev=true.bench.golden | 2 - ...xample.signatory.dev=true.uplc.eval.golden | 2 - ...api.example.signatory.dev=true.uplc.golden | 2 - 35 files changed, 188 insertions(+), 317 deletions(-) delete mode 100644 plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden delete mode 100644 plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden delete mode 100644 plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden delete mode 100644 plutarch-test/goldens/field.data.bench.golden delete mode 100644 plutarch-test/goldens/field.data.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.data.uplc.golden delete mode 100644 plutarch-test/goldens/field.dropFields.bench.golden delete mode 100644 plutarch-test/goldens/field.dropFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.dropFields.uplc.golden delete mode 100644 plutarch-test/goldens/field.other.bench.golden delete mode 100644 plutarch-test/goldens/field.other.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.other.uplc.golden delete mode 100644 plutarch-test/goldens/field.pletFields.bench.golden delete mode 100644 plutarch-test/goldens/field.pletFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.pletFields.uplc.golden delete mode 100644 plutarch-test/goldens/field.rangeFields.bench.golden delete mode 100644 plutarch-test/goldens/field.rangeFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.rangeFields.uplc.golden delete mode 100644 plutarch-test/goldens/field.trips.bench.golden delete mode 100644 plutarch-test/goldens/field.trips.uplc.eval.golden delete mode 100644 plutarch-test/goldens/field.trips.uplc.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.getFields.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.getFields.uplc.eval.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.getFields.uplc.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden deleted file mode 100644 index f183bc134..000000000 --- a/plutarch-test/goldens/FFI.Data.Benchmarks.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -Value.isZero {"exBudgetCPU":744425,"exBudgetMemory":2600,"scriptSizeBytes":154} -Value.valueOf {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":110} -mappend @Value {"exBudgetCPU":3662179,"exBudgetMemory":12400,"scriptSizeBytes":529} -(==) @Value {"exBudgetCPU":2977400,"exBudgetMemory":10100,"scriptSizeBytes":565} \ No newline at end of file diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden deleted file mode 100644 index 424411047..000000000 --- a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -Value.isZero (program 1.0.0 (\i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))) (delay (\i0 -> i1)))) (force (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1)))) i1)) i1))) -Value.valueOf (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i1 i5) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force i1 0 (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force ifThenElse (equalsByteString i2 i9) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (i7 i1)) (delay (i6 i3))))))))) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force i1 0 (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force ifThenElse (equalsByteString i2 i7) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay i1) (delay (i6 i3)))))))))) -mappend @Value (program 1.0.0 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force i1 (\i0 -> (\i0 -> \i0 -> addInteger i2 i1) 0 i1) (\i0 -> \i0 -> (\i0 -> \i0 -> addInteger i2 i1) i2 i1) (\i0 -> (\i0 -> \i0 -> addInteger i2 i1) i1 0)))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force i1 (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) i1) (\i0 -> \i0 -> force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1) (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i1))) i1)))) (force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force (delay (\i0 -> force i1 (\i0 -> \i0 -> i2))) i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1)))) -(==) @Value (program 1.0.0 (\i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1)))) (force (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay (delay (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> i2))))))) (\i0 -> force i1 (\i0 -> \i0 -> force i1 (\i0 -> (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) 0 i1) (\i0 -> \i0 -> (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1) (\i0 -> (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i1 0))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force i1 (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) i1) (\i0 -> \i0 -> force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1) (\i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i1))) i1)))) (force (force (force (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i2 (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4))))) i1))) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) ((\i0 -> force (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))) (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay (delay (\i0 -> \i0 -> i2))) (delay i1))) (delay (\i0 -> \i0 -> i1))))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) i4 i3))))) (force (delay (delay (\i0 -> \i0 -> i2)))) i1)) (force (force ((\i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) ((\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1) (\i0 -> \i0 -> (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force (delay (delay (\i0 -> \i0 -> i2))))) (\i0 -> \i0 -> delay (force (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3))) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1))))))) (i2 i2) i1)) i1) (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) i3 (i1 i5)) ((\i0 -> i1) (force (force (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1))))) (\i0 -> \i0 -> force (force i1 (delay (force (force (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2))))))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) i2 i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden b/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden deleted file mode 100644 index b25a3fce0..000000000 --- a/plutarch-test/goldens/FFI.Data.Benchmarks.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -Value.isZero (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force (i6 (delay (\i0 -> i1)))) (force i5 (force i2)) (\i0 -> force i1 (\i0 -> \i0 -> force (force (i9 (delay (\i0 -> i1)))) (force i8 (force i5)) (\i0 -> force i1 (\i0 -> \i0 -> force ifThenElse (equalsInteger 0 i1) i10 i9)) i1)) i1)) (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay i4))) i3)))) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (\i0 -> (\i0 -> delay (\i0 -> i1 (\i0 -> \i0 -> force i5 (\i0 -> \i0 -> i2) i2 i1) i2)) (force i1 (\i0 -> \i0 -> i1))))) ((\i0 -> i1) ((\i0 -> i1 i1) (\i0 -> \i0 -> (\i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i5 i4 i1))))))) (i2 i2)))))) -Value.valueOf (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i1 i5) ((\i0 -> i1) (force (force i7) (\i0 -> \i0 -> force i1 0 (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force ifThenElse (equalsByteString i2 i9) i12 i11) (delay (i7 i1)) (delay (i6 i3))))))))) ((\i0 -> i1) (force (force i6) (\i0 -> \i0 -> force i1 0 (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force ifThenElse (equalsByteString i2 i7) i11 i10) (delay i1) (delay (i6 i3))))))))) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1)))))) -mappend @Value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force i10 (force i11 (\i0 -> \i0 -> force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force (force (i11 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i13) i2 (force i1 (\i0 -> i24 0 i1) (\i0 -> \i0 -> i25 i2 i1) (\i0 -> i24 i1 0)))) i1))) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force i1 (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i13) i1))) i1) (\i0 -> \i0 -> force (force (force i8)) i19 i2 i1) (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i12) i1))) i1)))) (force (force (force i3)) i14 i2 i1))) (force i9))) (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force (i4 (delay (\i0 -> i1)))) (force i10) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force (force i9) i1))) (force (force (i4 (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force (i13 (delay (\i0 -> i1)))) ((\i0 -> force i18 (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i23) (delay i1))) i20))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force i14 i4 i3))))) (force i11) i1)) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force i11) i3 (i1 i5)) ((\i0 -> i1) (force (force i21) (\i0 -> \i0 -> force (force i1 (delay (force (force i10) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2)))))) ((\i0 -> i1) (force (force i14) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4)))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) ((\i0 -> i1) (force (force i10) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force i7)) (\i0 -> \i0 -> delay (force i8 (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1)))))))))) ((\i0 -> i1) (force (force i9) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i10 i5 (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> \i0 -> i2))) (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (delay (\i0 -> force i1 (\i0 -> \i0 -> i2)))) (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2)))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) i4 i3)) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> addInteger i2 i1)) (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1)))))) -(==) @Value (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> force (force i1 (delay True) (delay False))) (force (force (i9 (delay (\i0 -> i1)))) (force i14 (force i13)) (\i0 -> force i1 (\i0 -> \i0 -> force (force (i12 (delay (\i0 -> i1)))) (force i17 (force i16)) (\i0 -> force i1 (\i0 -> \i0 -> force i1 (\i0 -> i23 0 i1) (\i0 -> \i0 -> i24 i2 i1) (\i0 -> i23 i1 0))) i1)) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force i1 (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i13) i1))) i1) (\i0 -> \i0 -> force (force (force i8)) i17 i2 i1) (\i0 -> force (force (i12 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i14) i2 (force (force i12) i1))) i1)))) (force (force (force i3)) i12 i2 i1)))) (delay (delay (delay (\i0 -> \i0 -> \i0 -> force (force (i4 (delay (\i0 -> i1)))) (force i10) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> force (force i10) i2 (force (force i9) i1))) (force (force (i4 (delay (\i0 -> i1)))) (\i0 -> \i0 -> force i2 (\i0 -> \i0 -> force (force (force (force (i13 (delay (\i0 -> i1)))) ((\i0 -> force i20 (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))) (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i25) (delay i1))) i22))) (\i0 -> force i1 (\i0 -> \i0 -> i10 i2 i5)) i6) (delay i3) (delay (force i14 i4 i3))))) (force i11) i1)) (force (force (i8 (delay (\i0 -> i1)))) (\i0 -> force i1 (\i0 -> \i0 -> (\i0 -> force (force i11) i3 (i1 i5)) ((\i0 -> i1) (force (force i22) (\i0 -> \i0 -> force (force i1 (delay (force (force i10) i3)) (\i0 -> \i0 -> delay (force i2 (\i0 -> \i0 -> force (force (i12 i2 i8) (delay (delay (\i0 -> \i0 -> \i0 -> i2 i10 i4))) (delay (i6 i3)))))))))))) i2)))))) ((\i0 -> i1) (force (force i15) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay i2) (\i0 -> \i0 -> delay (i5 i2 (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i3 i4)))) (delay (delay (\i0 -> delay (\i0 -> \i0 -> \i0 -> i1 i4))))) (delay (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2))))) ((\i0 -> i1) (force (force i11) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> force (force i1 (delay (force i7)) (\i0 -> \i0 -> delay (force i8 (i4 i2) (force (force (i6 (delay (\i0 -> i1)))) i4 i1)))))))))) ((\i0 -> i1) (force (force i10) (\i0 -> \i0 -> delay (delay (\i0 -> \i0 -> \i0 -> force (force i1 (delay (force i3 (\i0 -> \i0 -> i1))) (\i0 -> \i0 -> delay (force i5 (\i0 -> \i0 -> i2) (i4 i2) (force (force (i7 (delay (\i0 -> i1)))) i5 i4 i1)))))))))) (delay (delay (\i0 -> \i0 -> i2))) (delay (\i0 -> \i0 -> delay (\i0 -> \i0 -> i1 i4 i3)))) (\i0 -> \i0 -> force ifThenElse (equalsByteString i2 i1) i8 i7)) (delay (delay (\i0 -> i1 (\i0 -> \i0 -> force (force i2 (delay i1) (delay i7))) i6)))) (delay (\i0 -> force i2 (\i0 -> \i0 -> force i3 (\i0 -> \i0 -> i2) i2 i1) (force i1 (\i0 -> \i0 -> i1))))) (delay (\i0 -> \i0 -> delay (\i0 -> i1 i3 i2)))) (\i0 -> \i0 -> force ifThenElse (equalsInteger i2 i1) i4 i3)) (delay (\i0 -> \i0 -> i2)) (delay (\i0 -> \i0 -> i1))) (delay (delay (\i0 -> (\i0 -> i1 i1) (\i0 -> \i0 -> i3 (i2 i2) i1)))))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.bench.golden b/plutarch-test/goldens/api.ctx.bench.golden index 8044cf1de..2071f1ae2 100644 --- a/plutarch-test/goldens/api.ctx.bench.golden +++ b/plutarch-test/goldens/api.ctx.bench.golden @@ -1,7 +1,7 @@ -term {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":140} -get.txInfo {"exBudgetCPU":837149,"exBudgetMemory":1496,"scriptSizeBytes":149} -get.mint {"exBudgetCPU":2838750,"exBudgetMemory":5388,"scriptSizeBytes":177} -get.credentials {"exBudgetCPU":8007639,"exBudgetMemory":15200,"scriptSizeBytes":242} -get.sym {"exBudgetCPU":14262910,"exBudgetMemory":30823,"scriptSizeBytes":337} -ScriptPurpose.literal {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":48} -ScriptPurpose.decode {"exBudgetCPU":1570478,"exBudgetMemory":3498,"scriptSizeBytes":74} \ No newline at end of file +term {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":140} +get.txInfo {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":149} +get.mint {"exBudgetCPU":1597398,"exBudgetMemory":5388,"scriptSizeBytes":177} +get.credentials {"exBudgetCPU":4834417,"exBudgetMemory":15200,"scriptSizeBytes":242} +get.sym {"exBudgetCPU":10470781,"exBudgetMemory":30823,"scriptSizeBytes":337} +ScriptPurpose.literal {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":48} +ScriptPurpose.decode {"exBudgetCPU":1247652,"exBudgetMemory":3498,"scriptSizeBytes":74} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index 223f8b5cd..79f29f880 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -1,28 +1,28 @@ -lookup.itself {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":82} -lookup.hit {"exBudgetCPU":4140352,"exBudgetMemory":9090,"scriptSizeBytes":116} -lookup.miss {"exBudgetCPU":4975131,"exBudgetMemory":11422,"scriptSizeBytes":126} -lookupData.hit {"exBudgetCPU":4140352,"exBudgetMemory":9090,"scriptSizeBytes":114} -lookupData.miss {"exBudgetCPU":4885812,"exBudgetMemory":11122,"scriptSizeBytes":121} -findWithDefault.itself {"exBudgetCPU":148965,"exBudgetMemory":600,"scriptSizeBytes":78} -findWithDefault.hit {"exBudgetCPU":4797628,"exBudgetMemory":10354,"scriptSizeBytes":117} -findWithDefault.hit2 {"exBudgetCPU":16490188,"exBudgetMemory":38032,"scriptSizeBytes":340} -findWithDefault.miss {"exBudgetCPU":5153769,"exBudgetMemory":12022,"scriptSizeBytes":125} -singleton {"exBudgetCPU":1374198,"exBudgetMemory":2828,"scriptSizeBytes":39} -singletonData {"exBudgetCPU":1195560,"exBudgetMemory":2228,"scriptSizeBytes":34} -insert.empty {"exBudgetCPU":3072394,"exBudgetMemory":8060,"scriptSizeBytes":157} -insert.replace {"exBudgetCPU":6215860,"exBudgetMemory":14120,"scriptSizeBytes":179} -delete.empty {"exBudgetCPU":1936480,"exBudgetMemory":6132,"scriptSizeBytes":140} -delete.only {"exBudgetCPU":5169265,"exBudgetMemory":12492,"scriptSizeBytes":163} -delete.miss {"exBudgetCPU":6161487,"exBudgetMemory":14786,"scriptSizeBytes":169} -delete.new {"exBudgetCPU":13526555,"exBudgetMemory":30904,"scriptSizeBytes":205} -delete.old {"exBudgetCPU":10735192,"exBudgetMemory":25178,"scriptSizeBytes":204} -difference.emptyLeft {"exBudgetCPU":3012848,"exBudgetMemory":7860,"scriptSizeBytes":162} -difference.emptyRight {"exBudgetCPU":6655369,"exBudgetMemory":15848,"scriptSizeBytes":165} -difference.emptyResult {"exBudgetCPU":9811977,"exBudgetMemory":22006,"scriptSizeBytes":179} -unionWith.const {"exBudgetCPU":11898357,"exBudgetMemory":28070,"scriptSizeBytes":260} -unionWith.double {"exBudgetCPU":11946701,"exBudgetMemory":27572,"scriptSizeBytes":255} -unionWith.(+) {"exBudgetCPU":11284248,"exBudgetMemory":27076,"scriptSizeBytes":262} -unionWith.flip (+) {"exBudgetCPU":11284248,"exBudgetMemory":27076,"scriptSizeBytes":262} -unionWithData.const {"exBudgetCPU":11001762,"exBudgetMemory":26474,"scriptSizeBytes":246} -unionWithData.emptyLeft {"exBudgetCPU":3906038,"exBudgetMemory":10860,"scriptSizeBytes":233} -unionWithData.emptyRight {"exBudgetCPU":5786277,"exBudgetMemory":15288,"scriptSizeBytes":233} \ No newline at end of file +lookup.itself {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":82} +lookup.hit {"exBudgetCPU":3692245,"exBudgetMemory":9090,"scriptSizeBytes":116} +lookup.miss {"exBudgetCPU":4394532,"exBudgetMemory":11422,"scriptSizeBytes":126} +lookupData.hit {"exBudgetCPU":3692245,"exBudgetMemory":9090,"scriptSizeBytes":114} +lookupData.miss {"exBudgetCPU":4325532,"exBudgetMemory":11122,"scriptSizeBytes":121} +findWithDefault.itself {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":78} +findWithDefault.hit {"exBudgetCPU":4097533,"exBudgetMemory":10354,"scriptSizeBytes":117} +findWithDefault.hit2 {"exBudgetCPU":14526543,"exBudgetMemory":38032,"scriptSizeBytes":340} +findWithDefault.miss {"exBudgetCPU":4532532,"exBudgetMemory":12022,"scriptSizeBytes":125} +singleton {"exBudgetCPU":742104,"exBudgetMemory":2828,"scriptSizeBytes":39} +singletonData {"exBudgetCPU":604104,"exBudgetMemory":2228,"scriptSizeBytes":34} +insert.empty {"exBudgetCPU":2113458,"exBudgetMemory":8060,"scriptSizeBytes":157} +insert.replace {"exBudgetCPU":4362797,"exBudgetMemory":14120,"scriptSizeBytes":179} +delete.empty {"exBudgetCPU":1555454,"exBudgetMemory":6132,"scriptSizeBytes":140} +delete.only {"exBudgetCPU":3873793,"exBudgetMemory":12492,"scriptSizeBytes":163} +delete.miss {"exBudgetCPU":4366498,"exBudgetMemory":14786,"scriptSizeBytes":169} +delete.new {"exBudgetCPU":9803231,"exBudgetMemory":30904,"scriptSizeBytes":205} +delete.old {"exBudgetCPU":7780191,"exBudgetMemory":25178,"scriptSizeBytes":204} +difference.emptyLeft {"exBudgetCPU":2067458,"exBudgetMemory":7860,"scriptSizeBytes":162} +difference.emptyRight {"exBudgetCPU":4494995,"exBudgetMemory":15848,"scriptSizeBytes":165} +difference.emptyResult {"exBudgetCPU":7452717,"exBudgetMemory":22006,"scriptSizeBytes":179} +unionWith.const {"exBudgetCPU":9005337,"exBudgetMemory":28070,"scriptSizeBytes":260} +unionWith.double {"exBudgetCPU":9096814,"exBudgetMemory":27572,"scriptSizeBytes":255} +unionWith.(+) {"exBudgetCPU":8868040,"exBudgetMemory":27076,"scriptSizeBytes":262} +unionWith.flip (+) {"exBudgetCPU":8868040,"exBudgetMemory":27076,"scriptSizeBytes":262} +unionWithData.const {"exBudgetCPU":8572623,"exBudgetMemory":26474,"scriptSizeBytes":246} +unionWithData.emptyLeft {"exBudgetCPU":2757458,"exBudgetMemory":10860,"scriptSizeBytes":233} +unionWithData.emptyRight {"exBudgetCPU":4071736,"exBudgetMemory":15288,"scriptSizeBytes":233} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index a49c8a5c4..2ef3cb169 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -1,74 +1,74 @@ -singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -singletonData {"exBudgetCPU":3663984,"exBudgetMemory":7490,"scriptSizeBytes":80} -valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} -valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} -valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":193} -valueOf.growing.2 {"exBudgetCPU":26098659,"exBudgetMemory":61340,"scriptSizeBytes":420} -valueOf.growing.3 {"exBudgetCPU":38718722,"exBudgetMemory":90246,"scriptSizeBytes":451} -valueOf.growing.4 {"exBudgetCPU":54896971,"exBudgetMemory":126312,"scriptSizeBytes":470} -valueOf.growing.5 {"exBudgetCPU":75080001,"exBudgetMemory":171038,"scriptSizeBytes":488} -valueOf.growing.6 {"exBudgetCPU":99267812,"exBudgetMemory":224424,"scriptSizeBytes":506} -valueOf.growing.7 {"exBudgetCPU":127460404,"exBudgetMemory":286470,"scriptSizeBytes":525} -valueOf.growing.8 {"exBudgetCPU":159657777,"exBudgetMemory":357176,"scriptSizeBytes":543} -valueOf.growing.9 {"exBudgetCPU":198718809,"exBudgetMemory":441700,"scriptSizeBytes":561} -valueOf.growing.10 {"exBudgetCPU":236994369,"exBudgetMemory":525796,"scriptSizeBytes":579} -valueOf.growing.11 {"exBudgetCPU":279274710,"exBudgetMemory":618552,"scriptSizeBytes":597} -valueOf.growing.12 {"exBudgetCPU":325559832,"exBudgetMemory":719968,"scriptSizeBytes":616} -valueOf.growing.13 {"exBudgetCPU":375849735,"exBudgetMemory":830044,"scriptSizeBytes":634} -valueOf.growing.14 {"exBudgetCPU":430144419,"exBudgetMemory":948780,"scriptSizeBytes":652} -valueOf.growing.15 {"exBudgetCPU":488443884,"exBudgetMemory":1076176,"scriptSizeBytes":671} -valueOf.growing.16 {"exBudgetCPU":550748130,"exBudgetMemory":1212232,"scriptSizeBytes":689} -valueOf.growing.17 {"exBudgetCPU":617057157,"exBudgetMemory":1356948,"scriptSizeBytes":708} -unionWith.const {"exBudgetCPU":22764559,"exBudgetMemory":52540,"scriptSizeBytes":318} -unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":232} -unionWith.(+).applied {"exBudgetCPU":22812903,"exBudgetMemory":52042,"scriptSizeBytes":314} -unionWith.tokens {"exBudgetCPU":22150698,"exBudgetMemory":51546,"scriptSizeBytes":324} -unionWith.symbols {"exBudgetCPU":14449266,"exBudgetMemory":33932,"scriptSizeBytes":316} -unionWith.growing.1 {"exBudgetCPU":14538585,"exBudgetMemory":34232,"scriptSizeBytes":320} -unionWith.growing.2 {"exBudgetCPU":32918457,"exBudgetMemory":76822,"scriptSizeBytes":354} -unionWith.growing.3 {"exBudgetCPU":47254650,"exBudgetMemory":109258,"scriptSizeBytes":375} -unionWith.growing.4 {"exBudgetCPU":65506305,"exBudgetMemory":150054,"scriptSizeBytes":393} -unionWith.growing.5 {"exBudgetCPU":87762741,"exBudgetMemory":199510,"scriptSizeBytes":412} -unionWith.growing.6 {"exBudgetCPU":114023958,"exBudgetMemory":257626,"scriptSizeBytes":430} -unionWith.growing.7 {"exBudgetCPU":144289956,"exBudgetMemory":324402,"scriptSizeBytes":449} -unionWith.growing.8 {"exBudgetCPU":178560735,"exBudgetMemory":399838,"scriptSizeBytes":467} -unionWith.growing.9 {"exBudgetCPU":224706117,"exBudgetMemory":502148,"scriptSizeBytes":482} -unionWith.growing.10 {"exBudgetCPU":262981677,"exBudgetMemory":586244,"scriptSizeBytes":501} -unionWith.growing.11 {"exBudgetCPU":305262018,"exBudgetMemory":679000,"scriptSizeBytes":519} -unionWith.growing.12 {"exBudgetCPU":351547140,"exBudgetMemory":780416,"scriptSizeBytes":537} -unionWith.growing.13 {"exBudgetCPU":401837043,"exBudgetMemory":890492,"scriptSizeBytes":556} -unionWith.growing.14 {"exBudgetCPU":456131727,"exBudgetMemory":1009228,"scriptSizeBytes":574} -unionWith.growing.15 {"exBudgetCPU":514431192,"exBudgetMemory":1136624,"scriptSizeBytes":593} -unionWith.growing.16 {"exBudgetCPU":576735438,"exBudgetMemory":1272680,"scriptSizeBytes":611} -unionWith.growing.17 {"exBudgetCPU":643044465,"exBudgetMemory":1417396,"scriptSizeBytes":629} -unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":222} -unionWithData const.applied {"exBudgetCPU":21957283,"exBudgetMemory":51244,"scriptSizeBytes":307} -inv {"exBudgetCPU":12110786,"exBudgetMemory":25962,"scriptSizeBytes":175} -equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} -equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} -equality.swappedTokensTrue {"exBudgetCPU":49482457,"exBudgetMemory":111744,"scriptSizeBytes":463} -equality.swappedSymbolsTrue {"exBudgetCPU":38502570,"exBudgetMemory":84404,"scriptSizeBytes":454} -equality.growing.1 {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.growing.2 {"exBudgetCPU":49451961,"exBudgetMemory":111744,"scriptSizeBytes":458} -equality.growing.3 {"exBudgetCPU":74727081,"exBudgetMemory":167484,"scriptSizeBytes":493} -equality.growing.4 {"exBudgetCPU":108011763,"exBudgetMemory":240544,"scriptSizeBytes":528} -equality.growing.5 {"exBudgetCPU":149306007,"exBudgetMemory":330924,"scriptSizeBytes":563} -equality.growing.6 {"exBudgetCPU":198609813,"exBudgetMemory":438624,"scriptSizeBytes":599} -equality.growing.7 {"exBudgetCPU":255923181,"exBudgetMemory":563644,"scriptSizeBytes":634} -equality.growing.8 {"exBudgetCPU":321246111,"exBudgetMemory":705984,"scriptSizeBytes":669} -equality.growing.9 {"exBudgetCPU":394578603,"exBudgetMemory":865644,"scriptSizeBytes":704} -equality.growing.10 {"exBudgetCPU":475920657,"exBudgetMemory":1042624,"scriptSizeBytes":740} -equality.growing.11 {"exBudgetCPU":565272273,"exBudgetMemory":1236924,"scriptSizeBytes":775} -equality.growing.12 {"exBudgetCPU":662633451,"exBudgetMemory":1448544,"scriptSizeBytes":810} -equality.growing.13 {"exBudgetCPU":768004191,"exBudgetMemory":1677484,"scriptSizeBytes":845} -equality.growing.14 {"exBudgetCPU":881384493,"exBudgetMemory":1923744,"scriptSizeBytes":881} -equality.growing.15 {"exBudgetCPU":1002774357,"exBudgetMemory":2187324,"scriptSizeBytes":916} -equality.growing.16 {"exBudgetCPU":1132173783,"exBudgetMemory":2468224,"scriptSizeBytes":951} -equality.growing.17 {"exBudgetCPU":1269582771,"exBudgetMemory":2766444,"scriptSizeBytes":986} -normalize.identity {"exBudgetCPU":45861430,"exBudgetMemory":105757,"scriptSizeBytes":530} -normalize.empty {"exBudgetCPU":30470910,"exBudgetMemory":70961,"scriptSizeBytes":444} -assertSorted.succeeds {"exBudgetCPU":39624703,"exBudgetMemory":94582,"scriptSizeBytes":474} -assertSorted.fails on malsorted symbols {"exBudgetCPU":28293494,"exBudgetMemory":62258,"scriptSizeBytes":294} -assertSorted.fails on zero quantities {"exBudgetCPU":28058984,"exBudgetMemory":62128,"scriptSizeBytes":472} -assertSorted.fails on empty token map {"exBudgetCPU":1500103,"exBudgetMemory":423,"scriptSizeBytes":215} \ No newline at end of file +singleton {"exBudgetCPU":1708940,"exBudgetMemory":6256,"scriptSizeBytes":68} +singletonData {"exBudgetCPU":3189793,"exBudgetMemory":7490,"scriptSizeBytes":80} +valueOf.itself {"exBudgetCPU":851100,"exBudgetMemory":3800,"scriptSizeBytes":115} +valueOf.applied {"exBudgetCPU":8887341,"exBudgetMemory":23308,"scriptSizeBytes":183} +valueOf.growing.1 {"exBudgetCPU":6189368,"exBudgetMemory":18450,"scriptSizeBytes":193} +valueOf.growing.2 {"exBudgetCPU":21178115,"exBudgetMemory":61340,"scriptSizeBytes":420} +valueOf.growing.3 {"exBudgetCPU":32067961,"exBudgetMemory":90246,"scriptSizeBytes":451} +valueOf.growing.4 {"exBudgetCPU":46575107,"exBudgetMemory":126312,"scriptSizeBytes":470} +valueOf.growing.5 {"exBudgetCPU":65044553,"exBudgetMemory":171038,"scriptSizeBytes":488} +valueOf.growing.6 {"exBudgetCPU":87476299,"exBudgetMemory":224424,"scriptSizeBytes":506} +valueOf.growing.7 {"exBudgetCPU":113870345,"exBudgetMemory":286470,"scriptSizeBytes":525} +valueOf.growing.8 {"exBudgetCPU":144226691,"exBudgetMemory":357176,"scriptSizeBytes":543} +valueOf.growing.9 {"exBudgetCPU":181299724,"exBudgetMemory":441700,"scriptSizeBytes":561} +valueOf.growing.10 {"exBudgetCPU":217162596,"exBudgetMemory":525796,"scriptSizeBytes":579} +valueOf.growing.11 {"exBudgetCPU":256987768,"exBudgetMemory":618552,"scriptSizeBytes":597} +valueOf.growing.12 {"exBudgetCPU":300775240,"exBudgetMemory":719968,"scriptSizeBytes":616} +valueOf.growing.13 {"exBudgetCPU":348525012,"exBudgetMemory":830044,"scriptSizeBytes":634} +valueOf.growing.14 {"exBudgetCPU":400237084,"exBudgetMemory":948780,"scriptSizeBytes":652} +valueOf.growing.15 {"exBudgetCPU":455911456,"exBudgetMemory":1076176,"scriptSizeBytes":671} +valueOf.growing.16 {"exBudgetCPU":515548128,"exBudgetMemory":1212232,"scriptSizeBytes":689} +valueOf.growing.17 {"exBudgetCPU":579147100,"exBudgetMemory":1356948,"scriptSizeBytes":708} +unionWith.const {"exBudgetCPU":17399570,"exBudgetMemory":52540,"scriptSizeBytes":318} +unionWith.(+).itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":232} +unionWith.(+).applied {"exBudgetCPU":17491047,"exBudgetMemory":52042,"scriptSizeBytes":314} +unionWith.tokens {"exBudgetCPU":17262429,"exBudgetMemory":51546,"scriptSizeBytes":324} +unionWith.symbols {"exBudgetCPU":10801712,"exBudgetMemory":33932,"scriptSizeBytes":316} +unionWith.growing.1 {"exBudgetCPU":10870712,"exBudgetMemory":34232,"scriptSizeBytes":320} +unionWith.growing.2 {"exBudgetCPU":25790459,"exBudgetMemory":76822,"scriptSizeBytes":354} +unionWith.growing.3 {"exBudgetCPU":37948531,"exBudgetMemory":109258,"scriptSizeBytes":375} +unionWith.growing.4 {"exBudgetCPU":53999903,"exBudgetMemory":150054,"scriptSizeBytes":393} +unionWith.growing.5 {"exBudgetCPU":74013575,"exBudgetMemory":199510,"scriptSizeBytes":412} +unionWith.growing.6 {"exBudgetCPU":97989547,"exBudgetMemory":257626,"scriptSizeBytes":430} +unionWith.growing.7 {"exBudgetCPU":125927819,"exBudgetMemory":324402,"scriptSizeBytes":449} +unionWith.growing.8 {"exBudgetCPU":157828391,"exBudgetMemory":399838,"scriptSizeBytes":467} +unionWith.growing.9 {"exBudgetCPU":200277238,"exBudgetMemory":502148,"scriptSizeBytes":482} +unionWith.growing.10 {"exBudgetCPU":236140110,"exBudgetMemory":586244,"scriptSizeBytes":501} +unionWith.growing.11 {"exBudgetCPU":275965282,"exBudgetMemory":679000,"scriptSizeBytes":519} +unionWith.growing.12 {"exBudgetCPU":319752754,"exBudgetMemory":780416,"scriptSizeBytes":537} +unionWith.growing.13 {"exBudgetCPU":367502526,"exBudgetMemory":890492,"scriptSizeBytes":556} +unionWith.growing.14 {"exBudgetCPU":419214598,"exBudgetMemory":1009228,"scriptSizeBytes":574} +unionWith.growing.15 {"exBudgetCPU":474888970,"exBudgetMemory":1136624,"scriptSizeBytes":593} +unionWith.growing.16 {"exBudgetCPU":534525642,"exBudgetMemory":1272680,"scriptSizeBytes":611} +unionWith.growing.17 {"exBudgetCPU":598124614,"exBudgetMemory":1417396,"scriptSizeBytes":629} +unionWithData const.itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":222} +unionWithData const.applied {"exBudgetCPU":17035856,"exBudgetMemory":51244,"scriptSizeBytes":307} +inv {"exBudgetCPU":8006438,"exBudgetMemory":25962,"scriptSizeBytes":175} +equality.itself {"exBudgetCPU":644100,"exBudgetMemory":2900,"scriptSizeBytes":124} +equality.triviallyTrue {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.triviallyFalse {"exBudgetCPU":9153784,"exBudgetMemory":22936,"scriptSizeBytes":213} +equality.swappedTokensTrue {"exBudgetCPU":40395280,"exBudgetMemory":111744,"scriptSizeBytes":463} +equality.swappedSymbolsTrue {"exBudgetCPU":32532768,"exBudgetMemory":84404,"scriptSizeBytes":454} +equality.growing.1 {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.growing.2 {"exBudgetCPU":40357210,"exBudgetMemory":111744,"scriptSizeBytes":458} +equality.growing.3 {"exBudgetCPU":62002536,"exBudgetMemory":167484,"scriptSizeBytes":493} +equality.growing.4 {"exBudgetCPU":91572462,"exBudgetMemory":240544,"scriptSizeBytes":528} +equality.growing.5 {"exBudgetCPU":129066988,"exBudgetMemory":330924,"scriptSizeBytes":563} +equality.growing.6 {"exBudgetCPU":174486114,"exBudgetMemory":438624,"scriptSizeBytes":599} +equality.growing.7 {"exBudgetCPU":227829840,"exBudgetMemory":563644,"scriptSizeBytes":634} +equality.growing.8 {"exBudgetCPU":289098166,"exBudgetMemory":705984,"scriptSizeBytes":669} +equality.growing.9 {"exBudgetCPU":358291092,"exBudgetMemory":865644,"scriptSizeBytes":704} +equality.growing.10 {"exBudgetCPU":435408618,"exBudgetMemory":1042624,"scriptSizeBytes":740} +equality.growing.11 {"exBudgetCPU":520450744,"exBudgetMemory":1236924,"scriptSizeBytes":775} +equality.growing.12 {"exBudgetCPU":613417470,"exBudgetMemory":1448544,"scriptSizeBytes":810} +equality.growing.13 {"exBudgetCPU":714308796,"exBudgetMemory":1677484,"scriptSizeBytes":845} +equality.growing.14 {"exBudgetCPU":823124722,"exBudgetMemory":1923744,"scriptSizeBytes":881} +equality.growing.15 {"exBudgetCPU":939865248,"exBudgetMemory":2187324,"scriptSizeBytes":916} +equality.growing.16 {"exBudgetCPU":1064530374,"exBudgetMemory":2468224,"scriptSizeBytes":951} +equality.growing.17 {"exBudgetCPU":1197120100,"exBudgetMemory":2766444,"scriptSizeBytes":986} +normalize.identity {"exBudgetCPU":35595548,"exBudgetMemory":105757,"scriptSizeBytes":530} +normalize.empty {"exBudgetCPU":24172001,"exBudgetMemory":70961,"scriptSizeBytes":444} +assertSorted.succeeds {"exBudgetCPU":30100271,"exBudgetMemory":94582,"scriptSizeBytes":474} +assertSorted.fails on malsorted symbols {"exBudgetCPU":20493435,"exBudgetMemory":62258,"scriptSizeBytes":294} +assertSorted.fails on zero quantities {"exBudgetCPU":21608385,"exBudgetMemory":62128,"scriptSizeBytes":472} +assertSorted.fails on empty token map {"exBudgetCPU":1027897,"exBudgetMemory":423,"scriptSizeBytes":215} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index c9bced9c4..221b8cfa4 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -1,74 +1,74 @@ -singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -singletonData {"exBudgetCPU":3663984,"exBudgetMemory":7490,"scriptSizeBytes":80} -valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} -valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} -valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":193} -valueOf.growing.2 {"exBudgetCPU":26098659,"exBudgetMemory":61340,"scriptSizeBytes":420} -valueOf.growing.3 {"exBudgetCPU":38718722,"exBudgetMemory":90246,"scriptSizeBytes":451} -valueOf.growing.4 {"exBudgetCPU":54896971,"exBudgetMemory":126312,"scriptSizeBytes":470} -valueOf.growing.5 {"exBudgetCPU":75080001,"exBudgetMemory":171038,"scriptSizeBytes":488} -valueOf.growing.6 {"exBudgetCPU":99267812,"exBudgetMemory":224424,"scriptSizeBytes":506} -valueOf.growing.7 {"exBudgetCPU":127460404,"exBudgetMemory":286470,"scriptSizeBytes":525} -valueOf.growing.8 {"exBudgetCPU":159657777,"exBudgetMemory":357176,"scriptSizeBytes":543} -valueOf.growing.9 {"exBudgetCPU":198718809,"exBudgetMemory":441700,"scriptSizeBytes":561} -valueOf.growing.10 {"exBudgetCPU":236994369,"exBudgetMemory":525796,"scriptSizeBytes":579} -valueOf.growing.11 {"exBudgetCPU":279274710,"exBudgetMemory":618552,"scriptSizeBytes":597} -valueOf.growing.12 {"exBudgetCPU":325559832,"exBudgetMemory":719968,"scriptSizeBytes":616} -valueOf.growing.13 {"exBudgetCPU":375849735,"exBudgetMemory":830044,"scriptSizeBytes":634} -valueOf.growing.14 {"exBudgetCPU":430144419,"exBudgetMemory":948780,"scriptSizeBytes":652} -valueOf.growing.15 {"exBudgetCPU":488443884,"exBudgetMemory":1076176,"scriptSizeBytes":671} -valueOf.growing.16 {"exBudgetCPU":550748130,"exBudgetMemory":1212232,"scriptSizeBytes":689} -valueOf.growing.17 {"exBudgetCPU":617057157,"exBudgetMemory":1356948,"scriptSizeBytes":708} -unionWith.const {"exBudgetCPU":22764559,"exBudgetMemory":52540,"scriptSizeBytes":318} -unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":232} -unionWith.(+).applied {"exBudgetCPU":22812903,"exBudgetMemory":52042,"scriptSizeBytes":314} -unionWith.tokens {"exBudgetCPU":22150698,"exBudgetMemory":51546,"scriptSizeBytes":324} -unionWith.symbols {"exBudgetCPU":14449266,"exBudgetMemory":33932,"scriptSizeBytes":316} -unionWith.growing.1 {"exBudgetCPU":14538585,"exBudgetMemory":34232,"scriptSizeBytes":320} -unionWith.growing.2 {"exBudgetCPU":32918457,"exBudgetMemory":76822,"scriptSizeBytes":354} -unionWith.growing.3 {"exBudgetCPU":47254650,"exBudgetMemory":109258,"scriptSizeBytes":375} -unionWith.growing.4 {"exBudgetCPU":65506305,"exBudgetMemory":150054,"scriptSizeBytes":393} -unionWith.growing.5 {"exBudgetCPU":87762741,"exBudgetMemory":199510,"scriptSizeBytes":412} -unionWith.growing.6 {"exBudgetCPU":114023958,"exBudgetMemory":257626,"scriptSizeBytes":430} -unionWith.growing.7 {"exBudgetCPU":144289956,"exBudgetMemory":324402,"scriptSizeBytes":449} -unionWith.growing.8 {"exBudgetCPU":178560735,"exBudgetMemory":399838,"scriptSizeBytes":467} -unionWith.growing.9 {"exBudgetCPU":224706117,"exBudgetMemory":502148,"scriptSizeBytes":482} -unionWith.growing.10 {"exBudgetCPU":262981677,"exBudgetMemory":586244,"scriptSizeBytes":501} -unionWith.growing.11 {"exBudgetCPU":305262018,"exBudgetMemory":679000,"scriptSizeBytes":519} -unionWith.growing.12 {"exBudgetCPU":351547140,"exBudgetMemory":780416,"scriptSizeBytes":537} -unionWith.growing.13 {"exBudgetCPU":401837043,"exBudgetMemory":890492,"scriptSizeBytes":556} -unionWith.growing.14 {"exBudgetCPU":456131727,"exBudgetMemory":1009228,"scriptSizeBytes":574} -unionWith.growing.15 {"exBudgetCPU":514431192,"exBudgetMemory":1136624,"scriptSizeBytes":593} -unionWith.growing.16 {"exBudgetCPU":576735438,"exBudgetMemory":1272680,"scriptSizeBytes":611} -unionWith.growing.17 {"exBudgetCPU":643044465,"exBudgetMemory":1417396,"scriptSizeBytes":629} -unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":222} -unionWithData const.applied {"exBudgetCPU":21957283,"exBudgetMemory":51244,"scriptSizeBytes":307} -inv {"exBudgetCPU":12110786,"exBudgetMemory":25962,"scriptSizeBytes":175} -equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} -equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} -equality.swappedTokensTrue {"exBudgetCPU":49482457,"exBudgetMemory":111744,"scriptSizeBytes":463} -equality.swappedSymbolsTrue {"exBudgetCPU":38502570,"exBudgetMemory":84404,"scriptSizeBytes":454} -equality.growing.1 {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.growing.2 {"exBudgetCPU":49451961,"exBudgetMemory":111744,"scriptSizeBytes":458} -equality.growing.3 {"exBudgetCPU":74727081,"exBudgetMemory":167484,"scriptSizeBytes":493} -equality.growing.4 {"exBudgetCPU":108011763,"exBudgetMemory":240544,"scriptSizeBytes":528} -equality.growing.5 {"exBudgetCPU":149306007,"exBudgetMemory":330924,"scriptSizeBytes":563} -equality.growing.6 {"exBudgetCPU":198609813,"exBudgetMemory":438624,"scriptSizeBytes":599} -equality.growing.7 {"exBudgetCPU":255923181,"exBudgetMemory":563644,"scriptSizeBytes":634} -equality.growing.8 {"exBudgetCPU":321246111,"exBudgetMemory":705984,"scriptSizeBytes":669} -equality.growing.9 {"exBudgetCPU":394578603,"exBudgetMemory":865644,"scriptSizeBytes":704} -equality.growing.10 {"exBudgetCPU":475920657,"exBudgetMemory":1042624,"scriptSizeBytes":740} -equality.growing.11 {"exBudgetCPU":565272273,"exBudgetMemory":1236924,"scriptSizeBytes":775} -equality.growing.12 {"exBudgetCPU":662633451,"exBudgetMemory":1448544,"scriptSizeBytes":810} -equality.growing.13 {"exBudgetCPU":768004191,"exBudgetMemory":1677484,"scriptSizeBytes":845} -equality.growing.14 {"exBudgetCPU":881384493,"exBudgetMemory":1923744,"scriptSizeBytes":881} -equality.growing.15 {"exBudgetCPU":1002774357,"exBudgetMemory":2187324,"scriptSizeBytes":916} -equality.growing.16 {"exBudgetCPU":1132173783,"exBudgetMemory":2468224,"scriptSizeBytes":951} -equality.growing.17 {"exBudgetCPU":1269582771,"exBudgetMemory":2766444,"scriptSizeBytes":986} -normalize.identity {"exBudgetCPU":45861430,"exBudgetMemory":105757,"scriptSizeBytes":562} -normalize.empty {"exBudgetCPU":30470910,"exBudgetMemory":70961,"scriptSizeBytes":444} -assertSorted.succeeds {"exBudgetCPU":39833114,"exBudgetMemory":95282,"scriptSizeBytes":519} -assertSorted.fails on malsorted symbols {"exBudgetCPU":28443494,"exBudgetMemory":62290,"scriptSizeBytes":340} -assertSorted.fails on zero quantities {"exBudgetCPU":28208984,"exBudgetMemory":62160,"scriptSizeBytes":519} -assertSorted.fails on empty token map {"exBudgetCPU":1650103,"exBudgetMemory":455,"scriptSizeBytes":262} \ No newline at end of file +singleton {"exBudgetCPU":1708940,"exBudgetMemory":6256,"scriptSizeBytes":68} +singletonData {"exBudgetCPU":3189793,"exBudgetMemory":7490,"scriptSizeBytes":80} +valueOf.itself {"exBudgetCPU":851100,"exBudgetMemory":3800,"scriptSizeBytes":115} +valueOf.applied {"exBudgetCPU":8887341,"exBudgetMemory":23308,"scriptSizeBytes":183} +valueOf.growing.1 {"exBudgetCPU":6189368,"exBudgetMemory":18450,"scriptSizeBytes":193} +valueOf.growing.2 {"exBudgetCPU":21178115,"exBudgetMemory":61340,"scriptSizeBytes":420} +valueOf.growing.3 {"exBudgetCPU":32067961,"exBudgetMemory":90246,"scriptSizeBytes":451} +valueOf.growing.4 {"exBudgetCPU":46575107,"exBudgetMemory":126312,"scriptSizeBytes":470} +valueOf.growing.5 {"exBudgetCPU":65044553,"exBudgetMemory":171038,"scriptSizeBytes":488} +valueOf.growing.6 {"exBudgetCPU":87476299,"exBudgetMemory":224424,"scriptSizeBytes":506} +valueOf.growing.7 {"exBudgetCPU":113870345,"exBudgetMemory":286470,"scriptSizeBytes":525} +valueOf.growing.8 {"exBudgetCPU":144226691,"exBudgetMemory":357176,"scriptSizeBytes":543} +valueOf.growing.9 {"exBudgetCPU":181299724,"exBudgetMemory":441700,"scriptSizeBytes":561} +valueOf.growing.10 {"exBudgetCPU":217162596,"exBudgetMemory":525796,"scriptSizeBytes":579} +valueOf.growing.11 {"exBudgetCPU":256987768,"exBudgetMemory":618552,"scriptSizeBytes":597} +valueOf.growing.12 {"exBudgetCPU":300775240,"exBudgetMemory":719968,"scriptSizeBytes":616} +valueOf.growing.13 {"exBudgetCPU":348525012,"exBudgetMemory":830044,"scriptSizeBytes":634} +valueOf.growing.14 {"exBudgetCPU":400237084,"exBudgetMemory":948780,"scriptSizeBytes":652} +valueOf.growing.15 {"exBudgetCPU":455911456,"exBudgetMemory":1076176,"scriptSizeBytes":671} +valueOf.growing.16 {"exBudgetCPU":515548128,"exBudgetMemory":1212232,"scriptSizeBytes":689} +valueOf.growing.17 {"exBudgetCPU":579147100,"exBudgetMemory":1356948,"scriptSizeBytes":708} +unionWith.const {"exBudgetCPU":17399570,"exBudgetMemory":52540,"scriptSizeBytes":318} +unionWith.(+).itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":232} +unionWith.(+).applied {"exBudgetCPU":17491047,"exBudgetMemory":52042,"scriptSizeBytes":314} +unionWith.tokens {"exBudgetCPU":17262429,"exBudgetMemory":51546,"scriptSizeBytes":324} +unionWith.symbols {"exBudgetCPU":10801712,"exBudgetMemory":33932,"scriptSizeBytes":316} +unionWith.growing.1 {"exBudgetCPU":10870712,"exBudgetMemory":34232,"scriptSizeBytes":320} +unionWith.growing.2 {"exBudgetCPU":25790459,"exBudgetMemory":76822,"scriptSizeBytes":354} +unionWith.growing.3 {"exBudgetCPU":37948531,"exBudgetMemory":109258,"scriptSizeBytes":375} +unionWith.growing.4 {"exBudgetCPU":53999903,"exBudgetMemory":150054,"scriptSizeBytes":393} +unionWith.growing.5 {"exBudgetCPU":74013575,"exBudgetMemory":199510,"scriptSizeBytes":412} +unionWith.growing.6 {"exBudgetCPU":97989547,"exBudgetMemory":257626,"scriptSizeBytes":430} +unionWith.growing.7 {"exBudgetCPU":125927819,"exBudgetMemory":324402,"scriptSizeBytes":449} +unionWith.growing.8 {"exBudgetCPU":157828391,"exBudgetMemory":399838,"scriptSizeBytes":467} +unionWith.growing.9 {"exBudgetCPU":200277238,"exBudgetMemory":502148,"scriptSizeBytes":482} +unionWith.growing.10 {"exBudgetCPU":236140110,"exBudgetMemory":586244,"scriptSizeBytes":501} +unionWith.growing.11 {"exBudgetCPU":275965282,"exBudgetMemory":679000,"scriptSizeBytes":519} +unionWith.growing.12 {"exBudgetCPU":319752754,"exBudgetMemory":780416,"scriptSizeBytes":537} +unionWith.growing.13 {"exBudgetCPU":367502526,"exBudgetMemory":890492,"scriptSizeBytes":556} +unionWith.growing.14 {"exBudgetCPU":419214598,"exBudgetMemory":1009228,"scriptSizeBytes":574} +unionWith.growing.15 {"exBudgetCPU":474888970,"exBudgetMemory":1136624,"scriptSizeBytes":593} +unionWith.growing.16 {"exBudgetCPU":534525642,"exBudgetMemory":1272680,"scriptSizeBytes":611} +unionWith.growing.17 {"exBudgetCPU":598124614,"exBudgetMemory":1417396,"scriptSizeBytes":629} +unionWithData const.itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":222} +unionWithData const.applied {"exBudgetCPU":17035856,"exBudgetMemory":51244,"scriptSizeBytes":307} +inv {"exBudgetCPU":8006438,"exBudgetMemory":25962,"scriptSizeBytes":175} +equality.itself {"exBudgetCPU":644100,"exBudgetMemory":2900,"scriptSizeBytes":124} +equality.triviallyTrue {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.triviallyFalse {"exBudgetCPU":9153784,"exBudgetMemory":22936,"scriptSizeBytes":213} +equality.swappedTokensTrue {"exBudgetCPU":40395280,"exBudgetMemory":111744,"scriptSizeBytes":463} +equality.swappedSymbolsTrue {"exBudgetCPU":32532768,"exBudgetMemory":84404,"scriptSizeBytes":454} +equality.growing.1 {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.growing.2 {"exBudgetCPU":40357210,"exBudgetMemory":111744,"scriptSizeBytes":458} +equality.growing.3 {"exBudgetCPU":62002536,"exBudgetMemory":167484,"scriptSizeBytes":493} +equality.growing.4 {"exBudgetCPU":91572462,"exBudgetMemory":240544,"scriptSizeBytes":528} +equality.growing.5 {"exBudgetCPU":129066988,"exBudgetMemory":330924,"scriptSizeBytes":563} +equality.growing.6 {"exBudgetCPU":174486114,"exBudgetMemory":438624,"scriptSizeBytes":599} +equality.growing.7 {"exBudgetCPU":227829840,"exBudgetMemory":563644,"scriptSizeBytes":634} +equality.growing.8 {"exBudgetCPU":289098166,"exBudgetMemory":705984,"scriptSizeBytes":669} +equality.growing.9 {"exBudgetCPU":358291092,"exBudgetMemory":865644,"scriptSizeBytes":704} +equality.growing.10 {"exBudgetCPU":435408618,"exBudgetMemory":1042624,"scriptSizeBytes":740} +equality.growing.11 {"exBudgetCPU":520450744,"exBudgetMemory":1236924,"scriptSizeBytes":775} +equality.growing.12 {"exBudgetCPU":613417470,"exBudgetMemory":1448544,"scriptSizeBytes":810} +equality.growing.13 {"exBudgetCPU":714308796,"exBudgetMemory":1677484,"scriptSizeBytes":845} +equality.growing.14 {"exBudgetCPU":823124722,"exBudgetMemory":1923744,"scriptSizeBytes":881} +equality.growing.15 {"exBudgetCPU":939865248,"exBudgetMemory":2187324,"scriptSizeBytes":916} +equality.growing.16 {"exBudgetCPU":1064530374,"exBudgetMemory":2468224,"scriptSizeBytes":951} +equality.growing.17 {"exBudgetCPU":1197120100,"exBudgetMemory":2766444,"scriptSizeBytes":986} +normalize.identity {"exBudgetCPU":35595548,"exBudgetMemory":105757,"scriptSizeBytes":562} +normalize.empty {"exBudgetCPU":24172001,"exBudgetMemory":70961,"scriptSizeBytes":444} +assertSorted.succeeds {"exBudgetCPU":30261271,"exBudgetMemory":95282,"scriptSizeBytes":519} +assertSorted.fails on malsorted symbols {"exBudgetCPU":20705777,"exBudgetMemory":62290,"scriptSizeBytes":340} +assertSorted.fails on zero quantities {"exBudgetCPU":21820727,"exBudgetMemory":62160,"scriptSizeBytes":519} +assertSorted.fails on empty token map {"exBudgetCPU":1240239,"exBudgetMemory":455,"scriptSizeBytes":262} \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.bench.golden b/plutarch-test/goldens/field.data.bench.golden deleted file mode 100644 index dbc24ebdd..000000000 --- a/plutarch-test/goldens/field.data.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -pmatch-pfield.pmatch.newtype {"exBudgetCPU":966918,"exBudgetMemory":3092,"scriptSizeBytes":45} -pmatch-pfield.pfield.newtype {"exBudgetCPU":966918,"exBudgetMemory":3092,"scriptSizeBytes":45} -pfield-pletFields.pfield.single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} -pfield-pletFields.pletFields.single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.uplc.eval.golden b/plutarch-test/goldens/field.data.uplc.eval.golden deleted file mode 100644 index 183cfd7b7..000000000 --- a/plutarch-test/goldens/field.data.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -pmatch-pfield.pmatch.newtype (program 1.0.0 (#d8799f41abff, #d87a80)) -pmatch-pfield.pfield.newtype (program 1.0.0 (#d8799f41abff, #d87a80)) -pfield-pletFields.pfield.single (program 1.0.0 #d8799f41abff) -pfield-pletFields.pletFields.single (program 1.0.0 #d8799f41abff) \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.uplc.golden b/plutarch-test/goldens/field.data.uplc.golden deleted file mode 100644 index b8d5b8853..000000000 --- a/plutarch-test/goldens/field.data.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -pmatch-pfield.pmatch.newtype (program 1.0.0 ((\i0 -> (\i0 -> mkPairData (i2 i1) (i2 (force tailList i1))) ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) (force headList))) -pmatch-pfield.pfield.newtype (program 1.0.0 ((\i0 -> (\i0 -> mkPairData (i2 i1) (i2 (force tailList i1))) ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) (force headList))) -pfield-pletFields.pfield.single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f41abffd87a80ff)) -pfield-pletFields.pletFields.single (program 1.0.0 (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.bench.golden b/plutarch-test/goldens/field.dropFields.bench.golden deleted file mode 100644 index e68db7f4d..000000000 --- a/plutarch-test/goldens/field.dropFields.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":45} -app {"exBudgetCPU":1785427,"exBudgetMemory":5018,"scriptSizeBytes":88} \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.uplc.eval.golden b/plutarch-test/goldens/field.dropFields.uplc.eval.golden deleted file mode 100644 index e4e3ead44..000000000 --- a/plutarch-test/goldens/field.dropFields.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1)))))))))) -app (program 1.0.0 17) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.uplc.golden b/plutarch-test/goldens/field.dropFields.uplc.golden deleted file mode 100644 index 5541a25de..000000000 --- a/plutarch-test/goldens/field.dropFields.uplc.golden +++ /dev/null @@ -1,11 +0,0 @@ -lam (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) (force headList)) (force tailList))) -app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) [ #00 - , #01 - , #02 - , #03 - , #04 - , #05 - , #06 - , #07 - , #08 - , #09 ]) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.bench.golden b/plutarch-test/goldens/field.other.bench.golden deleted file mode 100644 index 9b73e8cd0..000000000 --- a/plutarch-test/goldens/field.other.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -by {"exBudgetCPU":1547135,"exBudgetMemory":4884,"scriptSizeBytes":49} -dotPlus {"exBudgetCPU":9879818,"exBudgetMemory":26900,"scriptSizeBytes":239} \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.uplc.eval.golden b/plutarch-test/goldens/field.other.uplc.eval.golden deleted file mode 100644 index b53a90f6a..000000000 --- a/plutarch-test/goldens/field.other.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -by (program 1.0.0 10) -dotPlus (program 1.0.0 19010) \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.uplc.golden b/plutarch-test/goldens/field.other.uplc.golden deleted file mode 100644 index c99ec4f08..000000000 --- a/plutarch-test/goldens/field.other.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -by (program 1.0.0 ((\i0 -> (\i0 -> unIData (force headList (force tailList (force (force sndPair) (unConstrData i1))))) (constrData 0 (i1 (iData 50) (i1 (iData 10) (i1 (iData 40) [ ]))))) (force mkCons))) -dotPlus (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (addInteger (addInteger (addInteger (multiplyInteger (unIData (i9 i6)) (unIData (i9 i4))) (multiplyInteger (unIData (i9 i5)) (unIData (i9 i3)))) (multiplyInteger (unIData (i9 (i10 i5))) (unIData (i9 (i10 i3))))) (unIData (i9 i2))) (unIData (i9 i1))) (unIData (i9 (i10 i1)))) (i9 i1)) (i9 (i7 (i8 i5)))) (i7 i1)) (i7 (i5 i3))) (i5 i1)) (i5 (i3 i2))) (i3 i1)) (i3 (constrData 0 (i5 (constrData 0 (i5 (iData 150) (i5 (iData 750) (i5 (iData 100) i6)))) (i5 (constrData 0 (i5 (iData 50) (i5 (iData 10) (i5 (iData 40) i6)))) (i5 (constrData 0 (i5 (iData 1) (i5 (iData 8) (i5 (iData 1) i6)))) i6)))))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.bench.golden b/plutarch-test/goldens/field.pletFields.bench.golden deleted file mode 100644 index fa7fcc031..000000000 --- a/plutarch-test/goldens/field.pletFields.bench.golden +++ /dev/null @@ -1,5 +0,0 @@ -letSomeFields.lam {"exBudgetCPU":276100,"exBudgetMemory":1300,"scriptSizeBytes":55} -letSomeFields.order {"exBudgetCPU":276100,"exBudgetMemory":1300,"scriptSizeBytes":55} -letSomeFields.app {"exBudgetCPU":2364146,"exBudgetMemory":6620,"scriptSizeBytes":97} -nFields.lam {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":23} -nFields.app {"exBudgetCPU":949971,"exBudgetMemory":2562,"scriptSizeBytes":68} \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.uplc.eval.golden b/plutarch-test/goldens/field.pletFields.uplc.eval.golden deleted file mode 100644 index 395124ffd..000000000 --- a/plutarch-test/goldens/field.pletFields.uplc.eval.golden +++ /dev/null @@ -1,5 +0,0 @@ -letSomeFields.lam (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) -letSomeFields.order (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) -letSomeFields.app (program 1.0.0 14) -nFields.lam (program 1.0.0 (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1))))) -nFields.app (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.uplc.golden b/plutarch-test/goldens/field.pletFields.uplc.golden deleted file mode 100644 index 44ba7ab72..000000000 --- a/plutarch-test/goldens/field.pletFields.uplc.golden +++ /dev/null @@ -1,23 +0,0 @@ -letSomeFields.lam (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) -letSomeFields.order (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) -letSomeFields.app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) [ #00 - , #01 - , #02 - , #03 - , #04 - , #05 - , #06 - , #07 - , #08 - , #09 ]) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) -nFields.lam (program 1.0.0 ((\i0 -> \i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) (force headList))) -nFields.app (program 1.0.0 ((\i0 -> (\i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) [ #00 - , #01 - , #02 - , #03 - , #04 - , #05 - , #06 - , #07 - , #08 - , #09 ]) (force headList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.bench.golden b/plutarch-test/goldens/field.rangeFields.bench.golden deleted file mode 100644 index 7c4135681..000000000 --- a/plutarch-test/goldens/field.rangeFields.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":39} -app {"exBudgetCPU":1523881,"exBudgetMemory":4322,"scriptSizeBytes":82} \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.uplc.eval.golden b/plutarch-test/goldens/field.rangeFields.uplc.eval.golden deleted file mode 100644 index 16b4687d3..000000000 --- a/plutarch-test/goldens/field.rangeFields.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -lam (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) -app (program 1.0.0 11) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.uplc.golden b/plutarch-test/goldens/field.rangeFields.uplc.golden deleted file mode 100644 index 1161c974b..000000000 --- a/plutarch-test/goldens/field.rangeFields.uplc.golden +++ /dev/null @@ -1,11 +0,0 @@ -lam (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) (force headList)) (force tailList))) -app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) [ #00 - , #01 - , #02 - , #03 - , #04 - , #05 - , #06 - , #07 - , #08 - , #09 ]) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.bench.golden b/plutarch-test/goldens/field.trips.bench.golden deleted file mode 100644 index 880e5cc3a..000000000 --- a/plutarch-test/goldens/field.trips.bench.golden +++ /dev/null @@ -1,7 +0,0 @@ -lam.tripSum {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":46} -lam.getY {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":16} -lam.tripYZ {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":36} -tripSum.A {"exBudgetCPU":2864483,"exBudgetMemory":8048,"scriptSizeBytes":80} -tripSum.B {"exBudgetCPU":2864483,"exBudgetMemory":8048,"scriptSizeBytes":77} -tripSum.C {"exBudgetCPU":2864483,"exBudgetMemory":8048,"scriptSizeBytes":77} -tripYZ=tripZY {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":36} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.uplc.eval.golden b/plutarch-test/goldens/field.trips.uplc.eval.golden deleted file mode 100644 index f21ca2849..000000000 --- a/plutarch-test/goldens/field.trips.uplc.eval.golden +++ /dev/null @@ -1,7 +0,0 @@ -lam.tripSum (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList (force tailList i1)))) (force tailList i1)) (force (force sndPair) (unConstrData i1)))) -lam.getY (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) -lam.tripYZ (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) -tripSum.A (program 1.0.0 1000) -tripSum.B (program 1.0.0 100) -tripSum.C (program 1.0.0 10) -tripYZ=tripZY (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.uplc.golden b/plutarch-test/goldens/field.trips.uplc.golden deleted file mode 100644 index 04daca150..000000000 --- a/plutarch-test/goldens/field.trips.uplc.golden +++ /dev/null @@ -1,7 +0,0 @@ -lam.tripSum (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (force headList)) (force tailList))) -lam.getY (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) -lam.tripYZ (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) -tripSum.A (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 150) (i3 (iData 750) (i3 (iData 100) [ ]))))) (force headList)) (force tailList)) (force mkCons))) -tripSum.B (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 50) (i3 (iData 10) (i3 (iData 40) [ ]))))) (force headList)) (force tailList)) (force mkCons))) -tripSum.C (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 1) (i3 (iData 8) (i3 (iData 1) [ ]))))) (force headList)) (force tailList)) (force mkCons))) -tripYZ=tripZY (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.bench.golden b/plutarch-test/goldens/maybe.bench.golden index 6693b191c..5f3c793cc 100644 --- a/plutarch-test/goldens/maybe.bench.golden +++ b/plutarch-test/goldens/maybe.bench.golden @@ -1,6 +1,6 @@ -eq.true.nothing {"exBudgetCPU":684879,"exBudgetMemory":2400,"scriptSizeBytes":34} -eq.true.just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} -eq.false.nothing-just {"exBudgetCPU":714652,"exBudgetMemory":2500,"scriptSizeBytes":36} -eq.false.just-just {"exBudgetCPU":1001385,"exBudgetMemory":3001,"scriptSizeBytes":38} +eq.true.nothing {"exBudgetCPU":529100,"exBudgetMemory":2400,"scriptSizeBytes":34} +eq.true.just {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":38} +eq.false.nothing-just {"exBudgetCPU":552100,"exBudgetMemory":2500,"scriptSizeBytes":36} +eq.false.just-just {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":38} pfromJust.nothing {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":14} -pfromJust.just {"exBudgetCPU":644109,"exBudgetMemory":1801,"scriptSizeBytes":21} \ No newline at end of file +pfromJust.just {"exBudgetCPU":600033,"exBudgetMemory":1801,"scriptSizeBytes":21} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.getFields.bench.golden b/plutarch-test/goldens/monadic.api.example.getFields.bench.golden deleted file mode 100644 index 4855f700a..000000000 --- a/plutarch-test/goldens/monadic.api.example.getFields.bench.golden +++ /dev/null @@ -1 +0,0 @@ -0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.getFields.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.getFields.uplc.eval.golden deleted file mode 100644 index 4ce239055..000000000 --- a/plutarch-test/goldens/monadic.api.example.getFields.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.getFields.uplc.golden b/plutarch-test/goldens/monadic.api.example.getFields.uplc.golden deleted file mode 100644 index 4ce239055..000000000 --- a/plutarch-test/goldens/monadic.api.example.getFields.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -0 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden deleted file mode 100644 index 750638dba..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -do.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":290} -do.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden deleted file mode 100644 index a9c117adc..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -do.succeeds (program 1.0.0 ()) -do.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden deleted file mode 100644 index d5e484e74..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=false.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden deleted file mode 100644 index a934ec699..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden +++ /dev/null @@ -1,2 +0,0 @@ -do.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":390} -do.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":386} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden deleted file mode 100644 index a9c117adc..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden +++ /dev/null @@ -1,2 +0,0 @@ -do.succeeds (program 1.0.0 ()) -do.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden deleted file mode 100644 index 03ca95ab4..000000000 --- a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden +++ /dev/null @@ -1,2 +0,0 @@ -do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:79:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:79:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file From 9da025c4788fccb9e286eec6d76336a95063d865 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Jun 2022 18:13:46 +0000 Subject: [PATCH 498/584] Fix tests --- .../goldens/api.value.dev=false.bench.golden | 178 +++++++++--------- .../goldens/api.value.dev=true.bench.golden | 178 +++++++++--------- plutarch-test/goldens/field.data.bench.golden | 4 + .../goldens/field.data.uplc.eval.golden | 4 + plutarch-test/goldens/field.data.uplc.golden | 4 + .../goldens/field.dropFields.bench.golden | 2 + .../goldens/field.dropFields.uplc.eval.golden | 2 + .../goldens/field.dropFields.uplc.golden | 11 ++ .../goldens/field.other.bench.golden | 2 + .../goldens/field.other.uplc.eval.golden | 2 + plutarch-test/goldens/field.other.uplc.golden | 2 + .../goldens/field.pletFields.bench.golden | 5 + .../goldens/field.pletFields.uplc.eval.golden | 5 + .../goldens/field.pletFields.uplc.golden | 23 +++ .../goldens/field.rangeFields.bench.golden | 2 + .../field.rangeFields.uplc.eval.golden | 2 + .../goldens/field.rangeFields.uplc.golden | 11 ++ .../goldens/field.trips.bench.golden | 7 + .../goldens/field.trips.uplc.eval.golden | 7 + plutarch-test/goldens/field.trips.uplc.golden | 7 + ...monadic.api.example.getFields.bench.golden | 1 + ...dic.api.example.getFields.uplc.eval.golden | 1 + .../monadic.api.example.getFields.uplc.golden | 1 + ...pi.example.signatory.dev=true.bench.golden | 2 + ...xample.signatory.dev=true.uplc.eval.golden | 2 + ...api.example.signatory.dev=true.uplc.golden | 2 + .../plutarch-base/Plutarch/ApiSpec.hs | 6 +- 27 files changed, 292 insertions(+), 181 deletions(-) create mode 100644 plutarch-test/goldens/field.data.bench.golden create mode 100644 plutarch-test/goldens/field.data.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.data.uplc.golden create mode 100644 plutarch-test/goldens/field.dropFields.bench.golden create mode 100644 plutarch-test/goldens/field.dropFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.dropFields.uplc.golden create mode 100644 plutarch-test/goldens/field.other.bench.golden create mode 100644 plutarch-test/goldens/field.other.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.other.uplc.golden create mode 100644 plutarch-test/goldens/field.pletFields.bench.golden create mode 100644 plutarch-test/goldens/field.pletFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.pletFields.uplc.golden create mode 100644 plutarch-test/goldens/field.rangeFields.bench.golden create mode 100644 plutarch-test/goldens/field.rangeFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.rangeFields.uplc.golden create mode 100644 plutarch-test/goldens/field.trips.bench.golden create mode 100644 plutarch-test/goldens/field.trips.uplc.eval.golden create mode 100644 plutarch-test/goldens/field.trips.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.getFields.bench.golden create mode 100644 plutarch-test/goldens/monadic.api.example.getFields.uplc.eval.golden create mode 100644 plutarch-test/goldens/monadic.api.example.getFields.uplc.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden create mode 100644 plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden index 5021dc07c..3372e12b3 100644 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ b/plutarch-test/goldens/api.value.dev=false.bench.golden @@ -1,89 +1,89 @@ -singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -singletonData {"exBudgetCPU":3663984,"exBudgetMemory":7490,"scriptSizeBytes":80} -valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} -valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} -valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":193} -valueOf.growing.2 {"exBudgetCPU":26098659,"exBudgetMemory":61340,"scriptSizeBytes":420} -valueOf.growing.3 {"exBudgetCPU":38718722,"exBudgetMemory":90246,"scriptSizeBytes":451} -valueOf.growing.4 {"exBudgetCPU":54896971,"exBudgetMemory":126312,"scriptSizeBytes":470} -valueOf.growing.5 {"exBudgetCPU":75080001,"exBudgetMemory":171038,"scriptSizeBytes":488} -valueOf.growing.6 {"exBudgetCPU":99267812,"exBudgetMemory":224424,"scriptSizeBytes":506} -valueOf.growing.7 {"exBudgetCPU":127460404,"exBudgetMemory":286470,"scriptSizeBytes":525} -valueOf.growing.8 {"exBudgetCPU":159657777,"exBudgetMemory":357176,"scriptSizeBytes":543} -valueOf.growing.9 {"exBudgetCPU":198718809,"exBudgetMemory":441700,"scriptSizeBytes":561} -valueOf.growing.10 {"exBudgetCPU":236994369,"exBudgetMemory":525796,"scriptSizeBytes":579} -valueOf.growing.11 {"exBudgetCPU":279274710,"exBudgetMemory":618552,"scriptSizeBytes":597} -valueOf.growing.12 {"exBudgetCPU":325559832,"exBudgetMemory":719968,"scriptSizeBytes":616} -valueOf.growing.13 {"exBudgetCPU":375849735,"exBudgetMemory":830044,"scriptSizeBytes":634} -valueOf.growing.14 {"exBudgetCPU":430144419,"exBudgetMemory":948780,"scriptSizeBytes":652} -valueOf.growing.15 {"exBudgetCPU":488443884,"exBudgetMemory":1076176,"scriptSizeBytes":671} -valueOf.growing.16 {"exBudgetCPU":550748130,"exBudgetMemory":1212232,"scriptSizeBytes":689} -valueOf.growing.17 {"exBudgetCPU":617057157,"exBudgetMemory":1356948,"scriptSizeBytes":708} -unionWith.const {"exBudgetCPU":22764559,"exBudgetMemory":52540,"scriptSizeBytes":318} -unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":232} -unionWith.(+).applied {"exBudgetCPU":22812903,"exBudgetMemory":52042,"scriptSizeBytes":314} -unionWith.tokens {"exBudgetCPU":22150698,"exBudgetMemory":51546,"scriptSizeBytes":324} -unionWith.symbols {"exBudgetCPU":14449266,"exBudgetMemory":33932,"scriptSizeBytes":316} -unionWith.growing.1 {"exBudgetCPU":14538585,"exBudgetMemory":34232,"scriptSizeBytes":320} -unionWith.growing.2 {"exBudgetCPU":32918457,"exBudgetMemory":76822,"scriptSizeBytes":354} -unionWith.growing.3 {"exBudgetCPU":47254650,"exBudgetMemory":109258,"scriptSizeBytes":375} -unionWith.growing.4 {"exBudgetCPU":65506305,"exBudgetMemory":150054,"scriptSizeBytes":393} -unionWith.growing.5 {"exBudgetCPU":87762741,"exBudgetMemory":199510,"scriptSizeBytes":412} -unionWith.growing.6 {"exBudgetCPU":114023958,"exBudgetMemory":257626,"scriptSizeBytes":430} -unionWith.growing.7 {"exBudgetCPU":144289956,"exBudgetMemory":324402,"scriptSizeBytes":449} -unionWith.growing.8 {"exBudgetCPU":178560735,"exBudgetMemory":399838,"scriptSizeBytes":467} -unionWith.growing.9 {"exBudgetCPU":224706117,"exBudgetMemory":502148,"scriptSizeBytes":482} -unionWith.growing.10 {"exBudgetCPU":262981677,"exBudgetMemory":586244,"scriptSizeBytes":501} -unionWith.growing.11 {"exBudgetCPU":305262018,"exBudgetMemory":679000,"scriptSizeBytes":519} -unionWith.growing.12 {"exBudgetCPU":351547140,"exBudgetMemory":780416,"scriptSizeBytes":537} -unionWith.growing.13 {"exBudgetCPU":401837043,"exBudgetMemory":890492,"scriptSizeBytes":556} -unionWith.growing.14 {"exBudgetCPU":456131727,"exBudgetMemory":1009228,"scriptSizeBytes":574} -unionWith.growing.15 {"exBudgetCPU":514431192,"exBudgetMemory":1136624,"scriptSizeBytes":593} -unionWith.growing.16 {"exBudgetCPU":576735438,"exBudgetMemory":1272680,"scriptSizeBytes":611} -unionWith.growing.17 {"exBudgetCPU":643044465,"exBudgetMemory":1417396,"scriptSizeBytes":629} -unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":222} -unionWithData const.applied {"exBudgetCPU":21957283,"exBudgetMemory":51244,"scriptSizeBytes":307} -inv {"exBudgetCPU":12110786,"exBudgetMemory":25962,"scriptSizeBytes":175} -equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} -equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} -equality.swappedTokensTrue {"exBudgetCPU":49482457,"exBudgetMemory":111744,"scriptSizeBytes":463} -equality.swappedSymbolsTrue {"exBudgetCPU":38502570,"exBudgetMemory":84404,"scriptSizeBytes":454} -equality.growing.1 {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.growing.2 {"exBudgetCPU":49451961,"exBudgetMemory":111744,"scriptSizeBytes":458} -equality.growing.3 {"exBudgetCPU":74727081,"exBudgetMemory":167484,"scriptSizeBytes":493} -equality.growing.4 {"exBudgetCPU":108011763,"exBudgetMemory":240544,"scriptSizeBytes":528} -equality.growing.5 {"exBudgetCPU":149306007,"exBudgetMemory":330924,"scriptSizeBytes":563} -equality.growing.6 {"exBudgetCPU":198609813,"exBudgetMemory":438624,"scriptSizeBytes":599} -equality.growing.7 {"exBudgetCPU":255923181,"exBudgetMemory":563644,"scriptSizeBytes":634} -equality.growing.8 {"exBudgetCPU":321246111,"exBudgetMemory":705984,"scriptSizeBytes":669} -equality.growing.9 {"exBudgetCPU":394578603,"exBudgetMemory":865644,"scriptSizeBytes":704} -equality.growing.10 {"exBudgetCPU":475920657,"exBudgetMemory":1042624,"scriptSizeBytes":740} -equality.growing.11 {"exBudgetCPU":565272273,"exBudgetMemory":1236924,"scriptSizeBytes":775} -equality.growing.12 {"exBudgetCPU":662633451,"exBudgetMemory":1448544,"scriptSizeBytes":810} -equality.growing.13 {"exBudgetCPU":768004191,"exBudgetMemory":1677484,"scriptSizeBytes":845} -equality.growing.14 {"exBudgetCPU":881384493,"exBudgetMemory":1923744,"scriptSizeBytes":881} -equality.growing.15 {"exBudgetCPU":1002774357,"exBudgetMemory":2187324,"scriptSizeBytes":916} -equality.growing.16 {"exBudgetCPU":1132173783,"exBudgetMemory":2468224,"scriptSizeBytes":951} -equality.growing.17 {"exBudgetCPU":1269582771,"exBudgetMemory":2766444,"scriptSizeBytes":986} -normalize.identity {"exBudgetCPU":45861430,"exBudgetMemory":105757,"scriptSizeBytes":530} -normalize.empty {"exBudgetCPU":30470910,"exBudgetMemory":70961,"scriptSizeBytes":444} -assertSorted.succeeds {"exBudgetCPU":39624703,"exBudgetMemory":94582,"scriptSizeBytes":474} -assertSorted.fails on malsorted symbols {"exBudgetCPU":28293494,"exBudgetMemory":62258,"scriptSizeBytes":294} -assertSorted.fails on zero quantities {"exBudgetCPU":28058984,"exBudgetMemory":62128,"scriptSizeBytes":472} -assertSorted.fails on empty token map {"exBudgetCPU":1500103,"exBudgetMemory":423,"scriptSizeBytes":215} -Ada.adaSymbol {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} -Ada.adaToken {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} -Ada.lovelaceValueOf {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} -Ada.isAdaOnlyValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":45} -Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":50} -Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":107} -Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":16680641,"exBudgetMemory":37926,"scriptSizeBytes":351} -Ada.adaOnlyValue.itself {"exBudgetCPU":238284,"exBudgetMemory":900,"scriptSizeBytes":52} -Ada.adaOnlyValue.on empty {"exBudgetCPU":686014,"exBudgetMemory":1932,"scriptSizeBytes":51} -Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":109} -Ada.adaOnlyValue.on Ada {"exBudgetCPU":5307174,"exBudgetMemory":10650,"scriptSizeBytes":95} -Ada.noAdaValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":37} -Ada.noAdaValue.on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":43} -Ada.noAdaValue.on non-Ada {"exBudgetCPU":4978536,"exBudgetMemory":10018,"scriptSizeBytes":100} -Ada.noAdaValue.on Ada {"exBudgetCPU":4889217,"exBudgetMemory":9718,"scriptSizeBytes":87} \ No newline at end of file +singleton {"exBudgetCPU":1708940,"exBudgetMemory":6256,"scriptSizeBytes":68} +singletonData {"exBudgetCPU":3189793,"exBudgetMemory":7490,"scriptSizeBytes":80} +valueOf.itself {"exBudgetCPU":851100,"exBudgetMemory":3800,"scriptSizeBytes":115} +valueOf.applied {"exBudgetCPU":8887341,"exBudgetMemory":23308,"scriptSizeBytes":183} +valueOf.growing.1 {"exBudgetCPU":6189368,"exBudgetMemory":18450,"scriptSizeBytes":193} +valueOf.growing.2 {"exBudgetCPU":21178115,"exBudgetMemory":61340,"scriptSizeBytes":420} +valueOf.growing.3 {"exBudgetCPU":32067961,"exBudgetMemory":90246,"scriptSizeBytes":451} +valueOf.growing.4 {"exBudgetCPU":46575107,"exBudgetMemory":126312,"scriptSizeBytes":470} +valueOf.growing.5 {"exBudgetCPU":65044553,"exBudgetMemory":171038,"scriptSizeBytes":488} +valueOf.growing.6 {"exBudgetCPU":87476299,"exBudgetMemory":224424,"scriptSizeBytes":506} +valueOf.growing.7 {"exBudgetCPU":113870345,"exBudgetMemory":286470,"scriptSizeBytes":525} +valueOf.growing.8 {"exBudgetCPU":144226691,"exBudgetMemory":357176,"scriptSizeBytes":543} +valueOf.growing.9 {"exBudgetCPU":181299724,"exBudgetMemory":441700,"scriptSizeBytes":561} +valueOf.growing.10 {"exBudgetCPU":217162596,"exBudgetMemory":525796,"scriptSizeBytes":579} +valueOf.growing.11 {"exBudgetCPU":256987768,"exBudgetMemory":618552,"scriptSizeBytes":597} +valueOf.growing.12 {"exBudgetCPU":300775240,"exBudgetMemory":719968,"scriptSizeBytes":616} +valueOf.growing.13 {"exBudgetCPU":348525012,"exBudgetMemory":830044,"scriptSizeBytes":634} +valueOf.growing.14 {"exBudgetCPU":400237084,"exBudgetMemory":948780,"scriptSizeBytes":652} +valueOf.growing.15 {"exBudgetCPU":455911456,"exBudgetMemory":1076176,"scriptSizeBytes":671} +valueOf.growing.16 {"exBudgetCPU":515548128,"exBudgetMemory":1212232,"scriptSizeBytes":689} +valueOf.growing.17 {"exBudgetCPU":579147100,"exBudgetMemory":1356948,"scriptSizeBytes":708} +unionWith.const {"exBudgetCPU":17399570,"exBudgetMemory":52540,"scriptSizeBytes":318} +unionWith.(+).itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":232} +unionWith.(+).applied {"exBudgetCPU":17491047,"exBudgetMemory":52042,"scriptSizeBytes":314} +unionWith.tokens {"exBudgetCPU":17262429,"exBudgetMemory":51546,"scriptSizeBytes":324} +unionWith.symbols {"exBudgetCPU":10801712,"exBudgetMemory":33932,"scriptSizeBytes":316} +unionWith.growing.1 {"exBudgetCPU":10870712,"exBudgetMemory":34232,"scriptSizeBytes":320} +unionWith.growing.2 {"exBudgetCPU":25790459,"exBudgetMemory":76822,"scriptSizeBytes":354} +unionWith.growing.3 {"exBudgetCPU":37948531,"exBudgetMemory":109258,"scriptSizeBytes":375} +unionWith.growing.4 {"exBudgetCPU":53999903,"exBudgetMemory":150054,"scriptSizeBytes":393} +unionWith.growing.5 {"exBudgetCPU":74013575,"exBudgetMemory":199510,"scriptSizeBytes":412} +unionWith.growing.6 {"exBudgetCPU":97989547,"exBudgetMemory":257626,"scriptSizeBytes":430} +unionWith.growing.7 {"exBudgetCPU":125927819,"exBudgetMemory":324402,"scriptSizeBytes":449} +unionWith.growing.8 {"exBudgetCPU":157828391,"exBudgetMemory":399838,"scriptSizeBytes":467} +unionWith.growing.9 {"exBudgetCPU":200277238,"exBudgetMemory":502148,"scriptSizeBytes":482} +unionWith.growing.10 {"exBudgetCPU":236140110,"exBudgetMemory":586244,"scriptSizeBytes":501} +unionWith.growing.11 {"exBudgetCPU":275965282,"exBudgetMemory":679000,"scriptSizeBytes":519} +unionWith.growing.12 {"exBudgetCPU":319752754,"exBudgetMemory":780416,"scriptSizeBytes":537} +unionWith.growing.13 {"exBudgetCPU":367502526,"exBudgetMemory":890492,"scriptSizeBytes":556} +unionWith.growing.14 {"exBudgetCPU":419214598,"exBudgetMemory":1009228,"scriptSizeBytes":574} +unionWith.growing.15 {"exBudgetCPU":474888970,"exBudgetMemory":1136624,"scriptSizeBytes":593} +unionWith.growing.16 {"exBudgetCPU":534525642,"exBudgetMemory":1272680,"scriptSizeBytes":611} +unionWith.growing.17 {"exBudgetCPU":598124614,"exBudgetMemory":1417396,"scriptSizeBytes":629} +unionWithData const.itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":222} +unionWithData const.applied {"exBudgetCPU":17035856,"exBudgetMemory":51244,"scriptSizeBytes":307} +inv {"exBudgetCPU":8006438,"exBudgetMemory":25962,"scriptSizeBytes":175} +equality.itself {"exBudgetCPU":644100,"exBudgetMemory":2900,"scriptSizeBytes":124} +equality.triviallyTrue {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.triviallyFalse {"exBudgetCPU":9153784,"exBudgetMemory":22936,"scriptSizeBytes":213} +equality.swappedTokensTrue {"exBudgetCPU":40395280,"exBudgetMemory":111744,"scriptSizeBytes":463} +equality.swappedSymbolsTrue {"exBudgetCPU":32532768,"exBudgetMemory":84404,"scriptSizeBytes":454} +equality.growing.1 {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.growing.2 {"exBudgetCPU":40357210,"exBudgetMemory":111744,"scriptSizeBytes":458} +equality.growing.3 {"exBudgetCPU":62002536,"exBudgetMemory":167484,"scriptSizeBytes":493} +equality.growing.4 {"exBudgetCPU":91572462,"exBudgetMemory":240544,"scriptSizeBytes":528} +equality.growing.5 {"exBudgetCPU":129066988,"exBudgetMemory":330924,"scriptSizeBytes":563} +equality.growing.6 {"exBudgetCPU":174486114,"exBudgetMemory":438624,"scriptSizeBytes":599} +equality.growing.7 {"exBudgetCPU":227829840,"exBudgetMemory":563644,"scriptSizeBytes":634} +equality.growing.8 {"exBudgetCPU":289098166,"exBudgetMemory":705984,"scriptSizeBytes":669} +equality.growing.9 {"exBudgetCPU":358291092,"exBudgetMemory":865644,"scriptSizeBytes":704} +equality.growing.10 {"exBudgetCPU":435408618,"exBudgetMemory":1042624,"scriptSizeBytes":740} +equality.growing.11 {"exBudgetCPU":520450744,"exBudgetMemory":1236924,"scriptSizeBytes":775} +equality.growing.12 {"exBudgetCPU":613417470,"exBudgetMemory":1448544,"scriptSizeBytes":810} +equality.growing.13 {"exBudgetCPU":714308796,"exBudgetMemory":1677484,"scriptSizeBytes":845} +equality.growing.14 {"exBudgetCPU":823124722,"exBudgetMemory":1923744,"scriptSizeBytes":881} +equality.growing.15 {"exBudgetCPU":939865248,"exBudgetMemory":2187324,"scriptSizeBytes":916} +equality.growing.16 {"exBudgetCPU":1064530374,"exBudgetMemory":2468224,"scriptSizeBytes":951} +equality.growing.17 {"exBudgetCPU":1197120100,"exBudgetMemory":2766444,"scriptSizeBytes":986} +normalize.identity {"exBudgetCPU":35595548,"exBudgetMemory":105757,"scriptSizeBytes":530} +normalize.empty {"exBudgetCPU":24172001,"exBudgetMemory":70961,"scriptSizeBytes":444} +assertSorted.succeeds {"exBudgetCPU":30100271,"exBudgetMemory":94582,"scriptSizeBytes":474} +assertSorted.fails on malsorted symbols {"exBudgetCPU":20493435,"exBudgetMemory":62258,"scriptSizeBytes":294} +assertSorted.fails on zero quantities {"exBudgetCPU":21608385,"exBudgetMemory":62128,"scriptSizeBytes":472} +assertSorted.fails on empty token map {"exBudgetCPU":1027897,"exBudgetMemory":423,"scriptSizeBytes":215} +Ada.adaSymbol {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} +Ada.adaToken {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} +Ada.lovelaceValueOf {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":53} +Ada.isAdaOnlyValue.itself {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":45} +Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":497454,"exBudgetMemory":1532,"scriptSizeBytes":50} +Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":4349105,"exBudgetMemory":10950,"scriptSizeBytes":107} +Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":13280877,"exBudgetMemory":37926,"scriptSizeBytes":351} +Ada.adaOnlyValue.itself {"exBudgetCPU":184100,"exBudgetMemory":900,"scriptSizeBytes":52} +Ada.adaOnlyValue.on empty {"exBudgetCPU":589454,"exBudgetMemory":1932,"scriptSizeBytes":51} +Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":4356574,"exBudgetMemory":10950,"scriptSizeBytes":109} +Ada.adaOnlyValue.on Ada {"exBudgetCPU":4287574,"exBudgetMemory":10650,"scriptSizeBytes":95} +Ada.noAdaValue.itself {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":37} +Ada.noAdaValue.on empty {"exBudgetCPU":497454,"exBudgetMemory":1532,"scriptSizeBytes":43} +Ada.noAdaValue.on non-Ada {"exBudgetCPU":4082014,"exBudgetMemory":10018,"scriptSizeBytes":100} +Ada.noAdaValue.on Ada {"exBudgetCPU":4013014,"exBudgetMemory":9718,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index d2794e70f..eec264eb7 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -1,89 +1,89 @@ -singleton {"exBudgetCPU":2956707,"exBudgetMemory":6256,"scriptSizeBytes":68} -singletonData {"exBudgetCPU":3663984,"exBudgetMemory":7490,"scriptSizeBytes":80} -valueOf.itself {"exBudgetCPU":1101701,"exBudgetMemory":3800,"scriptSizeBytes":115} -valueOf.applied {"exBudgetCPU":10409027,"exBudgetMemory":23308,"scriptSizeBytes":183} -valueOf.growing.1 {"exBudgetCPU":7629468,"exBudgetMemory":18450,"scriptSizeBytes":193} -valueOf.growing.2 {"exBudgetCPU":26098659,"exBudgetMemory":61340,"scriptSizeBytes":420} -valueOf.growing.3 {"exBudgetCPU":38718722,"exBudgetMemory":90246,"scriptSizeBytes":451} -valueOf.growing.4 {"exBudgetCPU":54896971,"exBudgetMemory":126312,"scriptSizeBytes":470} -valueOf.growing.5 {"exBudgetCPU":75080001,"exBudgetMemory":171038,"scriptSizeBytes":488} -valueOf.growing.6 {"exBudgetCPU":99267812,"exBudgetMemory":224424,"scriptSizeBytes":506} -valueOf.growing.7 {"exBudgetCPU":127460404,"exBudgetMemory":286470,"scriptSizeBytes":525} -valueOf.growing.8 {"exBudgetCPU":159657777,"exBudgetMemory":357176,"scriptSizeBytes":543} -valueOf.growing.9 {"exBudgetCPU":198718809,"exBudgetMemory":441700,"scriptSizeBytes":561} -valueOf.growing.10 {"exBudgetCPU":236994369,"exBudgetMemory":525796,"scriptSizeBytes":579} -valueOf.growing.11 {"exBudgetCPU":279274710,"exBudgetMemory":618552,"scriptSizeBytes":597} -valueOf.growing.12 {"exBudgetCPU":325559832,"exBudgetMemory":719968,"scriptSizeBytes":616} -valueOf.growing.13 {"exBudgetCPU":375849735,"exBudgetMemory":830044,"scriptSizeBytes":634} -valueOf.growing.14 {"exBudgetCPU":430144419,"exBudgetMemory":948780,"scriptSizeBytes":652} -valueOf.growing.15 {"exBudgetCPU":488443884,"exBudgetMemory":1076176,"scriptSizeBytes":671} -valueOf.growing.16 {"exBudgetCPU":550748130,"exBudgetMemory":1212232,"scriptSizeBytes":689} -valueOf.growing.17 {"exBudgetCPU":617057157,"exBudgetMemory":1356948,"scriptSizeBytes":708} -unionWith.const {"exBudgetCPU":22764559,"exBudgetMemory":52540,"scriptSizeBytes":318} -unionWith.(+).itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":232} -unionWith.(+).applied {"exBudgetCPU":22812903,"exBudgetMemory":52042,"scriptSizeBytes":314} -unionWith.tokens {"exBudgetCPU":22150698,"exBudgetMemory":51546,"scriptSizeBytes":324} -unionWith.symbols {"exBudgetCPU":14449266,"exBudgetMemory":33932,"scriptSizeBytes":316} -unionWith.growing.1 {"exBudgetCPU":14538585,"exBudgetMemory":34232,"scriptSizeBytes":320} -unionWith.growing.2 {"exBudgetCPU":32918457,"exBudgetMemory":76822,"scriptSizeBytes":354} -unionWith.growing.3 {"exBudgetCPU":47254650,"exBudgetMemory":109258,"scriptSizeBytes":375} -unionWith.growing.4 {"exBudgetCPU":65506305,"exBudgetMemory":150054,"scriptSizeBytes":393} -unionWith.growing.5 {"exBudgetCPU":87762741,"exBudgetMemory":199510,"scriptSizeBytes":412} -unionWith.growing.6 {"exBudgetCPU":114023958,"exBudgetMemory":257626,"scriptSizeBytes":430} -unionWith.growing.7 {"exBudgetCPU":144289956,"exBudgetMemory":324402,"scriptSizeBytes":449} -unionWith.growing.8 {"exBudgetCPU":178560735,"exBudgetMemory":399838,"scriptSizeBytes":467} -unionWith.growing.9 {"exBudgetCPU":224706117,"exBudgetMemory":502148,"scriptSizeBytes":482} -unionWith.growing.10 {"exBudgetCPU":262981677,"exBudgetMemory":586244,"scriptSizeBytes":501} -unionWith.growing.11 {"exBudgetCPU":305262018,"exBudgetMemory":679000,"scriptSizeBytes":519} -unionWith.growing.12 {"exBudgetCPU":351547140,"exBudgetMemory":780416,"scriptSizeBytes":537} -unionWith.growing.13 {"exBudgetCPU":401837043,"exBudgetMemory":890492,"scriptSizeBytes":556} -unionWith.growing.14 {"exBudgetCPU":456131727,"exBudgetMemory":1009228,"scriptSizeBytes":574} -unionWith.growing.15 {"exBudgetCPU":514431192,"exBudgetMemory":1136624,"scriptSizeBytes":593} -unionWith.growing.16 {"exBudgetCPU":576735438,"exBudgetMemory":1272680,"scriptSizeBytes":611} -unionWith.growing.17 {"exBudgetCPU":643044465,"exBudgetMemory":1417396,"scriptSizeBytes":629} -unionWithData const.itself {"exBudgetCPU":1220793,"exBudgetMemory":4200,"scriptSizeBytes":222} -unionWithData const.applied {"exBudgetCPU":21957283,"exBudgetMemory":51244,"scriptSizeBytes":307} -inv {"exBudgetCPU":12110786,"exBudgetMemory":25962,"scriptSizeBytes":175} -equality.itself {"exBudgetCPU":833744,"exBudgetMemory":2900,"scriptSizeBytes":124} -equality.triviallyTrue {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.triviallyFalse {"exBudgetCPU":10950162,"exBudgetMemory":22936,"scriptSizeBytes":213} -equality.swappedTokensTrue {"exBudgetCPU":49482457,"exBudgetMemory":111744,"scriptSizeBytes":463} -equality.swappedSymbolsTrue {"exBudgetCPU":38502570,"exBudgetMemory":84404,"scriptSizeBytes":454} -equality.growing.1 {"exBudgetCPU":12681536,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.growing.2 {"exBudgetCPU":49451961,"exBudgetMemory":111744,"scriptSizeBytes":458} -equality.growing.3 {"exBudgetCPU":74727081,"exBudgetMemory":167484,"scriptSizeBytes":493} -equality.growing.4 {"exBudgetCPU":108011763,"exBudgetMemory":240544,"scriptSizeBytes":528} -equality.growing.5 {"exBudgetCPU":149306007,"exBudgetMemory":330924,"scriptSizeBytes":563} -equality.growing.6 {"exBudgetCPU":198609813,"exBudgetMemory":438624,"scriptSizeBytes":599} -equality.growing.7 {"exBudgetCPU":255923181,"exBudgetMemory":563644,"scriptSizeBytes":634} -equality.growing.8 {"exBudgetCPU":321246111,"exBudgetMemory":705984,"scriptSizeBytes":669} -equality.growing.9 {"exBudgetCPU":394578603,"exBudgetMemory":865644,"scriptSizeBytes":704} -equality.growing.10 {"exBudgetCPU":475920657,"exBudgetMemory":1042624,"scriptSizeBytes":740} -equality.growing.11 {"exBudgetCPU":565272273,"exBudgetMemory":1236924,"scriptSizeBytes":775} -equality.growing.12 {"exBudgetCPU":662633451,"exBudgetMemory":1448544,"scriptSizeBytes":810} -equality.growing.13 {"exBudgetCPU":768004191,"exBudgetMemory":1677484,"scriptSizeBytes":845} -equality.growing.14 {"exBudgetCPU":881384493,"exBudgetMemory":1923744,"scriptSizeBytes":881} -equality.growing.15 {"exBudgetCPU":1002774357,"exBudgetMemory":2187324,"scriptSizeBytes":916} -equality.growing.16 {"exBudgetCPU":1132173783,"exBudgetMemory":2468224,"scriptSizeBytes":951} -equality.growing.17 {"exBudgetCPU":1269582771,"exBudgetMemory":2766444,"scriptSizeBytes":986} -normalize.identity {"exBudgetCPU":45861430,"exBudgetMemory":105757,"scriptSizeBytes":562} -normalize.empty {"exBudgetCPU":30470910,"exBudgetMemory":70961,"scriptSizeBytes":444} -assertSorted.succeeds {"exBudgetCPU":39833114,"exBudgetMemory":95282,"scriptSizeBytes":519} -assertSorted.fails on malsorted symbols {"exBudgetCPU":28443494,"exBudgetMemory":62290,"scriptSizeBytes":340} -assertSorted.fails on zero quantities {"exBudgetCPU":28208984,"exBudgetMemory":62160,"scriptSizeBytes":519} -assertSorted.fails on empty token map {"exBudgetCPU":1650103,"exBudgetMemory":455,"scriptSizeBytes":262} -Ada.adaSymbol {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} -Ada.adaToken {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":8} -Ada.lovelaceValueOf {"exBudgetCPU":297830,"exBudgetMemory":1100,"scriptSizeBytes":53} -Ada.isAdaOnlyValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":45} -Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":50} -Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":107} -Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":16680641,"exBudgetMemory":37926,"scriptSizeBytes":351} -Ada.adaOnlyValue.itself {"exBudgetCPU":238284,"exBudgetMemory":900,"scriptSizeBytes":52} -Ada.adaOnlyValue.on empty {"exBudgetCPU":686014,"exBudgetMemory":1932,"scriptSizeBytes":51} -Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":5396493,"exBudgetMemory":10950,"scriptSizeBytes":109} -Ada.adaOnlyValue.on Ada {"exBudgetCPU":5307174,"exBudgetMemory":10650,"scriptSizeBytes":95} -Ada.noAdaValue.itself {"exBudgetCPU":29873,"exBudgetMemory":200,"scriptSizeBytes":37} -Ada.noAdaValue.on empty {"exBudgetCPU":566922,"exBudgetMemory":1532,"scriptSizeBytes":43} -Ada.noAdaValue.on non-Ada {"exBudgetCPU":4978536,"exBudgetMemory":10018,"scriptSizeBytes":100} -Ada.noAdaValue.on Ada {"exBudgetCPU":4889217,"exBudgetMemory":9718,"scriptSizeBytes":87} \ No newline at end of file +singleton {"exBudgetCPU":1708940,"exBudgetMemory":6256,"scriptSizeBytes":68} +singletonData {"exBudgetCPU":3189793,"exBudgetMemory":7490,"scriptSizeBytes":80} +valueOf.itself {"exBudgetCPU":851100,"exBudgetMemory":3800,"scriptSizeBytes":115} +valueOf.applied {"exBudgetCPU":8887341,"exBudgetMemory":23308,"scriptSizeBytes":183} +valueOf.growing.1 {"exBudgetCPU":6189368,"exBudgetMemory":18450,"scriptSizeBytes":193} +valueOf.growing.2 {"exBudgetCPU":21178115,"exBudgetMemory":61340,"scriptSizeBytes":420} +valueOf.growing.3 {"exBudgetCPU":32067961,"exBudgetMemory":90246,"scriptSizeBytes":451} +valueOf.growing.4 {"exBudgetCPU":46575107,"exBudgetMemory":126312,"scriptSizeBytes":470} +valueOf.growing.5 {"exBudgetCPU":65044553,"exBudgetMemory":171038,"scriptSizeBytes":488} +valueOf.growing.6 {"exBudgetCPU":87476299,"exBudgetMemory":224424,"scriptSizeBytes":506} +valueOf.growing.7 {"exBudgetCPU":113870345,"exBudgetMemory":286470,"scriptSizeBytes":525} +valueOf.growing.8 {"exBudgetCPU":144226691,"exBudgetMemory":357176,"scriptSizeBytes":543} +valueOf.growing.9 {"exBudgetCPU":181299724,"exBudgetMemory":441700,"scriptSizeBytes":561} +valueOf.growing.10 {"exBudgetCPU":217162596,"exBudgetMemory":525796,"scriptSizeBytes":579} +valueOf.growing.11 {"exBudgetCPU":256987768,"exBudgetMemory":618552,"scriptSizeBytes":597} +valueOf.growing.12 {"exBudgetCPU":300775240,"exBudgetMemory":719968,"scriptSizeBytes":616} +valueOf.growing.13 {"exBudgetCPU":348525012,"exBudgetMemory":830044,"scriptSizeBytes":634} +valueOf.growing.14 {"exBudgetCPU":400237084,"exBudgetMemory":948780,"scriptSizeBytes":652} +valueOf.growing.15 {"exBudgetCPU":455911456,"exBudgetMemory":1076176,"scriptSizeBytes":671} +valueOf.growing.16 {"exBudgetCPU":515548128,"exBudgetMemory":1212232,"scriptSizeBytes":689} +valueOf.growing.17 {"exBudgetCPU":579147100,"exBudgetMemory":1356948,"scriptSizeBytes":708} +unionWith.const {"exBudgetCPU":17399570,"exBudgetMemory":52540,"scriptSizeBytes":318} +unionWith.(+).itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":232} +unionWith.(+).applied {"exBudgetCPU":17491047,"exBudgetMemory":52042,"scriptSizeBytes":314} +unionWith.tokens {"exBudgetCPU":17262429,"exBudgetMemory":51546,"scriptSizeBytes":324} +unionWith.symbols {"exBudgetCPU":10801712,"exBudgetMemory":33932,"scriptSizeBytes":316} +unionWith.growing.1 {"exBudgetCPU":10870712,"exBudgetMemory":34232,"scriptSizeBytes":320} +unionWith.growing.2 {"exBudgetCPU":25790459,"exBudgetMemory":76822,"scriptSizeBytes":354} +unionWith.growing.3 {"exBudgetCPU":37948531,"exBudgetMemory":109258,"scriptSizeBytes":375} +unionWith.growing.4 {"exBudgetCPU":53999903,"exBudgetMemory":150054,"scriptSizeBytes":393} +unionWith.growing.5 {"exBudgetCPU":74013575,"exBudgetMemory":199510,"scriptSizeBytes":412} +unionWith.growing.6 {"exBudgetCPU":97989547,"exBudgetMemory":257626,"scriptSizeBytes":430} +unionWith.growing.7 {"exBudgetCPU":125927819,"exBudgetMemory":324402,"scriptSizeBytes":449} +unionWith.growing.8 {"exBudgetCPU":157828391,"exBudgetMemory":399838,"scriptSizeBytes":467} +unionWith.growing.9 {"exBudgetCPU":200277238,"exBudgetMemory":502148,"scriptSizeBytes":482} +unionWith.growing.10 {"exBudgetCPU":236140110,"exBudgetMemory":586244,"scriptSizeBytes":501} +unionWith.growing.11 {"exBudgetCPU":275965282,"exBudgetMemory":679000,"scriptSizeBytes":519} +unionWith.growing.12 {"exBudgetCPU":319752754,"exBudgetMemory":780416,"scriptSizeBytes":537} +unionWith.growing.13 {"exBudgetCPU":367502526,"exBudgetMemory":890492,"scriptSizeBytes":556} +unionWith.growing.14 {"exBudgetCPU":419214598,"exBudgetMemory":1009228,"scriptSizeBytes":574} +unionWith.growing.15 {"exBudgetCPU":474888970,"exBudgetMemory":1136624,"scriptSizeBytes":593} +unionWith.growing.16 {"exBudgetCPU":534525642,"exBudgetMemory":1272680,"scriptSizeBytes":611} +unionWith.growing.17 {"exBudgetCPU":598124614,"exBudgetMemory":1417396,"scriptSizeBytes":629} +unionWithData const.itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":222} +unionWithData const.applied {"exBudgetCPU":17035856,"exBudgetMemory":51244,"scriptSizeBytes":307} +inv {"exBudgetCPU":8006438,"exBudgetMemory":25962,"scriptSizeBytes":175} +equality.itself {"exBudgetCPU":644100,"exBudgetMemory":2900,"scriptSizeBytes":124} +equality.triviallyTrue {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.triviallyFalse {"exBudgetCPU":9153784,"exBudgetMemory":22936,"scriptSizeBytes":213} +equality.swappedTokensTrue {"exBudgetCPU":40395280,"exBudgetMemory":111744,"scriptSizeBytes":463} +equality.swappedSymbolsTrue {"exBudgetCPU":32532768,"exBudgetMemory":84404,"scriptSizeBytes":454} +equality.growing.1 {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} +equality.growing.2 {"exBudgetCPU":40357210,"exBudgetMemory":111744,"scriptSizeBytes":458} +equality.growing.3 {"exBudgetCPU":62002536,"exBudgetMemory":167484,"scriptSizeBytes":493} +equality.growing.4 {"exBudgetCPU":91572462,"exBudgetMemory":240544,"scriptSizeBytes":528} +equality.growing.5 {"exBudgetCPU":129066988,"exBudgetMemory":330924,"scriptSizeBytes":563} +equality.growing.6 {"exBudgetCPU":174486114,"exBudgetMemory":438624,"scriptSizeBytes":599} +equality.growing.7 {"exBudgetCPU":227829840,"exBudgetMemory":563644,"scriptSizeBytes":634} +equality.growing.8 {"exBudgetCPU":289098166,"exBudgetMemory":705984,"scriptSizeBytes":669} +equality.growing.9 {"exBudgetCPU":358291092,"exBudgetMemory":865644,"scriptSizeBytes":704} +equality.growing.10 {"exBudgetCPU":435408618,"exBudgetMemory":1042624,"scriptSizeBytes":740} +equality.growing.11 {"exBudgetCPU":520450744,"exBudgetMemory":1236924,"scriptSizeBytes":775} +equality.growing.12 {"exBudgetCPU":613417470,"exBudgetMemory":1448544,"scriptSizeBytes":810} +equality.growing.13 {"exBudgetCPU":714308796,"exBudgetMemory":1677484,"scriptSizeBytes":845} +equality.growing.14 {"exBudgetCPU":823124722,"exBudgetMemory":1923744,"scriptSizeBytes":881} +equality.growing.15 {"exBudgetCPU":939865248,"exBudgetMemory":2187324,"scriptSizeBytes":916} +equality.growing.16 {"exBudgetCPU":1064530374,"exBudgetMemory":2468224,"scriptSizeBytes":951} +equality.growing.17 {"exBudgetCPU":1197120100,"exBudgetMemory":2766444,"scriptSizeBytes":986} +normalize.identity {"exBudgetCPU":35595548,"exBudgetMemory":105757,"scriptSizeBytes":562} +normalize.empty {"exBudgetCPU":24172001,"exBudgetMemory":70961,"scriptSizeBytes":444} +assertSorted.succeeds {"exBudgetCPU":30261271,"exBudgetMemory":95282,"scriptSizeBytes":519} +assertSorted.fails on malsorted symbols {"exBudgetCPU":20705777,"exBudgetMemory":62290,"scriptSizeBytes":340} +assertSorted.fails on zero quantities {"exBudgetCPU":21820727,"exBudgetMemory":62160,"scriptSizeBytes":519} +assertSorted.fails on empty token map {"exBudgetCPU":1240239,"exBudgetMemory":455,"scriptSizeBytes":262} +Ada.adaSymbol {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} +Ada.adaToken {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} +Ada.lovelaceValueOf {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":53} +Ada.isAdaOnlyValue.itself {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":45} +Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":497454,"exBudgetMemory":1532,"scriptSizeBytes":50} +Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":4349105,"exBudgetMemory":10950,"scriptSizeBytes":107} +Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":13280877,"exBudgetMemory":37926,"scriptSizeBytes":351} +Ada.adaOnlyValue.itself {"exBudgetCPU":184100,"exBudgetMemory":900,"scriptSizeBytes":52} +Ada.adaOnlyValue.on empty {"exBudgetCPU":589454,"exBudgetMemory":1932,"scriptSizeBytes":51} +Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":4356574,"exBudgetMemory":10950,"scriptSizeBytes":109} +Ada.adaOnlyValue.on Ada {"exBudgetCPU":4287574,"exBudgetMemory":10650,"scriptSizeBytes":95} +Ada.noAdaValue.itself {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":37} +Ada.noAdaValue.on empty {"exBudgetCPU":497454,"exBudgetMemory":1532,"scriptSizeBytes":43} +Ada.noAdaValue.on non-Ada {"exBudgetCPU":4082014,"exBudgetMemory":10018,"scriptSizeBytes":100} +Ada.noAdaValue.on Ada {"exBudgetCPU":4013014,"exBudgetMemory":9718,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.bench.golden b/plutarch-test/goldens/field.data.bench.golden new file mode 100644 index 000000000..dbc24ebdd --- /dev/null +++ b/plutarch-test/goldens/field.data.bench.golden @@ -0,0 +1,4 @@ +pmatch-pfield.pmatch.newtype {"exBudgetCPU":966918,"exBudgetMemory":3092,"scriptSizeBytes":45} +pmatch-pfield.pfield.newtype {"exBudgetCPU":966918,"exBudgetMemory":3092,"scriptSizeBytes":45} +pfield-pletFields.pfield.single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} +pfield-pletFields.pletFields.single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.uplc.eval.golden b/plutarch-test/goldens/field.data.uplc.eval.golden new file mode 100644 index 000000000..183cfd7b7 --- /dev/null +++ b/plutarch-test/goldens/field.data.uplc.eval.golden @@ -0,0 +1,4 @@ +pmatch-pfield.pmatch.newtype (program 1.0.0 (#d8799f41abff, #d87a80)) +pmatch-pfield.pfield.newtype (program 1.0.0 (#d8799f41abff, #d87a80)) +pfield-pletFields.pfield.single (program 1.0.0 #d8799f41abff) +pfield-pletFields.pletFields.single (program 1.0.0 #d8799f41abff) \ No newline at end of file diff --git a/plutarch-test/goldens/field.data.uplc.golden b/plutarch-test/goldens/field.data.uplc.golden new file mode 100644 index 000000000..b8d5b8853 --- /dev/null +++ b/plutarch-test/goldens/field.data.uplc.golden @@ -0,0 +1,4 @@ +pmatch-pfield.pmatch.newtype (program 1.0.0 ((\i0 -> (\i0 -> mkPairData (i2 i1) (i2 (force tailList i1))) ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) (force headList))) +pmatch-pfield.pfield.newtype (program 1.0.0 ((\i0 -> (\i0 -> mkPairData (i2 i1) (i2 (force tailList i1))) ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff)) (force headList))) +pfield-pletFields.pfield.single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f41abffd87a80ff)) +pfield-pletFields.pletFields.single (program 1.0.0 (force headList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799fd8799f41abffd87a80ff))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.bench.golden b/plutarch-test/goldens/field.dropFields.bench.golden new file mode 100644 index 000000000..e68db7f4d --- /dev/null +++ b/plutarch-test/goldens/field.dropFields.bench.golden @@ -0,0 +1,2 @@ +lam {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":45} +app {"exBudgetCPU":1785427,"exBudgetMemory":5018,"scriptSizeBytes":88} \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.uplc.eval.golden b/plutarch-test/goldens/field.dropFields.uplc.eval.golden new file mode 100644 index 000000000..e4e3ead44 --- /dev/null +++ b/plutarch-test/goldens/field.dropFields.uplc.eval.golden @@ -0,0 +1,2 @@ +lam (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList i1)))))))))) +app (program 1.0.0 17) \ No newline at end of file diff --git a/plutarch-test/goldens/field.dropFields.uplc.golden b/plutarch-test/goldens/field.dropFields.uplc.golden new file mode 100644 index 000000000..5541a25de --- /dev/null +++ b/plutarch-test/goldens/field.dropFields.uplc.golden @@ -0,0 +1,11 @@ +lam (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) (force headList)) (force tailList))) +app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 (i3 (i3 (i3 i1))))))))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.bench.golden b/plutarch-test/goldens/field.other.bench.golden new file mode 100644 index 000000000..9b73e8cd0 --- /dev/null +++ b/plutarch-test/goldens/field.other.bench.golden @@ -0,0 +1,2 @@ +by {"exBudgetCPU":1547135,"exBudgetMemory":4884,"scriptSizeBytes":49} +dotPlus {"exBudgetCPU":9879818,"exBudgetMemory":26900,"scriptSizeBytes":239} \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.uplc.eval.golden b/plutarch-test/goldens/field.other.uplc.eval.golden new file mode 100644 index 000000000..b53a90f6a --- /dev/null +++ b/plutarch-test/goldens/field.other.uplc.eval.golden @@ -0,0 +1,2 @@ +by (program 1.0.0 10) +dotPlus (program 1.0.0 19010) \ No newline at end of file diff --git a/plutarch-test/goldens/field.other.uplc.golden b/plutarch-test/goldens/field.other.uplc.golden new file mode 100644 index 000000000..c99ec4f08 --- /dev/null +++ b/plutarch-test/goldens/field.other.uplc.golden @@ -0,0 +1,2 @@ +by (program 1.0.0 ((\i0 -> (\i0 -> unIData (force headList (force tailList (force (force sndPair) (unConstrData i1))))) (constrData 0 (i1 (iData 50) (i1 (iData 10) (i1 (iData 40) [ ]))))) (force mkCons))) +dotPlus (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (addInteger (addInteger (addInteger (multiplyInteger (unIData (i9 i6)) (unIData (i9 i4))) (multiplyInteger (unIData (i9 i5)) (unIData (i9 i3)))) (multiplyInteger (unIData (i9 (i10 i5))) (unIData (i9 (i10 i3))))) (unIData (i9 i2))) (unIData (i9 i1))) (unIData (i9 (i10 i1)))) (i9 i1)) (i9 (i7 (i8 i5)))) (i7 i1)) (i7 (i5 i3))) (i5 i1)) (i5 (i3 i2))) (i3 i1)) (i3 (constrData 0 (i5 (constrData 0 (i5 (iData 150) (i5 (iData 750) (i5 (iData 100) i6)))) (i5 (constrData 0 (i5 (iData 50) (i5 (iData 10) (i5 (iData 40) i6)))) (i5 (constrData 0 (i5 (iData 1) (i5 (iData 8) (i5 (iData 1) i6)))) i6)))))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.bench.golden b/plutarch-test/goldens/field.pletFields.bench.golden new file mode 100644 index 000000000..fa7fcc031 --- /dev/null +++ b/plutarch-test/goldens/field.pletFields.bench.golden @@ -0,0 +1,5 @@ +letSomeFields.lam {"exBudgetCPU":276100,"exBudgetMemory":1300,"scriptSizeBytes":55} +letSomeFields.order {"exBudgetCPU":276100,"exBudgetMemory":1300,"scriptSizeBytes":55} +letSomeFields.app {"exBudgetCPU":2364146,"exBudgetMemory":6620,"scriptSizeBytes":97} +nFields.lam {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":23} +nFields.app {"exBudgetCPU":949971,"exBudgetMemory":2562,"scriptSizeBytes":68} \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.uplc.eval.golden b/plutarch-test/goldens/field.pletFields.uplc.eval.golden new file mode 100644 index 000000000..395124ffd --- /dev/null +++ b/plutarch-test/goldens/field.pletFields.uplc.eval.golden @@ -0,0 +1,5 @@ +letSomeFields.lam (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) +letSomeFields.order (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList ((\i0 -> force tailList (force tailList i1)) (force tailList i1))))) (force tailList i1)) (force tailList ((\i0 -> force tailList (force tailList i1)) i1)))) +letSomeFields.app (program 1.0.0 14) +nFields.lam (program 1.0.0 (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1))))) +nFields.app (program 1.0.0 1) \ No newline at end of file diff --git a/plutarch-test/goldens/field.pletFields.uplc.golden b/plutarch-test/goldens/field.pletFields.uplc.golden new file mode 100644 index 000000000..44ba7ab72 --- /dev/null +++ b/plutarch-test/goldens/field.pletFields.uplc.golden @@ -0,0 +1,23 @@ +letSomeFields.lam (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) +letSomeFields.order (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) +letSomeFields.app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 (i6 i1))))) (i5 i1)) (i4 (i3 i1))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList)) (\i0 -> i2 (i2 i1))) (force tailList))) +nFields.lam (program 1.0.0 ((\i0 -> \i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) (force headList))) +nFields.app (program 1.0.0 ((\i0 -> (\i0 -> addInteger (unIData (i2 i1)) (unIData (i2 (force tailList i1)))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.bench.golden b/plutarch-test/goldens/field.rangeFields.bench.golden new file mode 100644 index 000000000..7c4135681 --- /dev/null +++ b/plutarch-test/goldens/field.rangeFields.bench.golden @@ -0,0 +1,2 @@ +lam {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":39} +app {"exBudgetCPU":1523881,"exBudgetMemory":4322,"scriptSizeBytes":82} \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.uplc.eval.golden b/plutarch-test/goldens/field.rangeFields.uplc.eval.golden new file mode 100644 index 000000000..16b4687d3 --- /dev/null +++ b/plutarch-test/goldens/field.rangeFields.uplc.eval.golden @@ -0,0 +1,2 @@ +lam (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force tailList (force tailList (force tailList (force tailList i1))))))) +app (program 1.0.0 11) \ No newline at end of file diff --git a/plutarch-test/goldens/field.rangeFields.uplc.golden b/plutarch-test/goldens/field.rangeFields.uplc.golden new file mode 100644 index 000000000..1161c974b --- /dev/null +++ b/plutarch-test/goldens/field.rangeFields.uplc.golden @@ -0,0 +1,11 @@ +lam (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) (force headList)) (force tailList))) +app (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (i3 (i3 (i3 (i3 i1)))))) [ #00 + , #01 + , #02 + , #03 + , #04 + , #05 + , #06 + , #07 + , #08 + , #09 ]) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.bench.golden b/plutarch-test/goldens/field.trips.bench.golden new file mode 100644 index 000000000..880e5cc3a --- /dev/null +++ b/plutarch-test/goldens/field.trips.bench.golden @@ -0,0 +1,7 @@ +lam.tripSum {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":46} +lam.getY {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":16} +lam.tripYZ {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":36} +tripSum.A {"exBudgetCPU":2864483,"exBudgetMemory":8048,"scriptSizeBytes":80} +tripSum.B {"exBudgetCPU":2864483,"exBudgetMemory":8048,"scriptSizeBytes":77} +tripSum.C {"exBudgetCPU":2864483,"exBudgetMemory":8048,"scriptSizeBytes":77} +tripYZ=tripZY {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":36} \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.uplc.eval.golden b/plutarch-test/goldens/field.trips.uplc.eval.golden new file mode 100644 index 000000000..f21ca2849 --- /dev/null +++ b/plutarch-test/goldens/field.trips.uplc.eval.golden @@ -0,0 +1,7 @@ +lam.tripSum (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (force headList i2)) (unIData (force headList i1))) (unIData (force headList (force tailList i1)))) (force tailList i1)) (force (force sndPair) (unConstrData i1)))) +lam.getY (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) +lam.tripYZ (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) +tripSum.A (program 1.0.0 1000) +tripSum.B (program 1.0.0 100) +tripSum.C (program 1.0.0 10) +tripYZ=tripZY (program 1.0.0 (\i0 -> (\i0 -> addInteger (unIData (force headList i1)) (unIData (force headList (force tailList i1)))) (force tailList (force (force sndPair) (unConstrData i1))))) \ No newline at end of file diff --git a/plutarch-test/goldens/field.trips.uplc.golden b/plutarch-test/goldens/field.trips.uplc.golden new file mode 100644 index 000000000..04daca150 --- /dev/null +++ b/plutarch-test/goldens/field.trips.uplc.golden @@ -0,0 +1,7 @@ +lam.tripSum (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (force headList)) (force tailList))) +lam.getY (program 1.0.0 (\i0 -> force headList (force tailList (force (force sndPair) (unConstrData i1))))) +lam.tripYZ (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) +tripSum.A (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 150) (i3 (iData 750) (i3 (iData 100) [ ]))))) (force headList)) (force tailList)) (force mkCons))) +tripSum.B (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 50) (i3 (iData 10) (i3 (iData 40) [ ]))))) (force headList)) (force tailList)) (force mkCons))) +tripSum.C (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> addInteger (addInteger (unIData (i4 i2)) (unIData (i4 i1))) (unIData (i4 (i5 i1)))) (i4 i1)) (force (force sndPair) (unConstrData i1))) (constrData 0 (i3 (iData 1) (i3 (iData 8) (i3 (iData 1) [ ]))))) (force headList)) (force tailList)) (force mkCons))) +tripYZ=tripZY (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> addInteger (unIData (i3 i1)) (unIData (i3 (i4 i1)))) (i3 (force (force sndPair) (unConstrData i1)))) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.getFields.bench.golden b/plutarch-test/goldens/monadic.api.example.getFields.bench.golden new file mode 100644 index 000000000..4855f700a --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.getFields.bench.golden @@ -0,0 +1 @@ +0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.getFields.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.getFields.uplc.eval.golden new file mode 100644 index 000000000..4ce239055 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.getFields.uplc.eval.golden @@ -0,0 +1 @@ +0 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.getFields.uplc.golden b/plutarch-test/goldens/monadic.api.example.getFields.uplc.golden new file mode 100644 index 000000000..4ce239055 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.getFields.uplc.golden @@ -0,0 +1 @@ +0 (program 1.0.0 (\i0 -> force (force sndPair) (unConstrData i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden new file mode 100644 index 000000000..a934ec699 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden @@ -0,0 +1,2 @@ +do.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":390} +do.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":386} \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden new file mode 100644 index 000000000..a9c117adc --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ()) +do.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden new file mode 100644 index 000000000..03ca95ab4 --- /dev/null +++ b/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden @@ -0,0 +1,2 @@ +do.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:79:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +do.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay (force (force trace "Pattern match failure in qualified 'do' block at conditional/Plutarch/MonadicSpec.hs:79:5-15" (delay error)))))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index c41a97982..2b8d74f6f 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -18,9 +18,9 @@ import Control.Monad (forM_) import Control.Monad.Trans.Cont (cont, runCont) import Data.String (fromString) import Numeric (showHex) -import Plutus.V1.Ledger.Api -import qualified Plutus.V1.Ledger.Interval as Interval -import qualified Plutus.V1.Ledger.Value as Value +import PlutusLedgerApi.V1 +import qualified PlutusLedgerApi.V1.Interval as Interval +import qualified PlutusLedgerApi.V1.Value as Value import PlutusTx.Monoid (inv) import Plutarch.Api.V1 ( From 803108d112f1ca6f815a78cf4fdf87b7503ff8bb Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 1 Jun 2022 20:30:56 +0000 Subject: [PATCH 499/584] Thread hard-coded monad through Term --- Plutarch/Internal.hs | 118 ++++++++++++++++++++++++------------------- plutarch.cabal | 1 + 2 files changed, 68 insertions(+), 51 deletions(-) diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index a9de187de..a886d8f51 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -30,18 +30,22 @@ module Plutarch.Internal ( TermResult (TermResult, getDeps, getTerm), S (SI), PType, + pthrow, ) where import Crypto.Hash (Context, Digest, hashFinalize, hashInit, hashUpdate) import Crypto.Hash.Algorithms (Blake2b_160) import Crypto.Hash.IO (HashAlgorithm) import qualified Data.ByteString as BS +import Data.Functor ((<&>)) import Data.Kind (Type) import Data.List (foldl', groupBy, sortOn) import qualified Data.Map.Lazy as M import qualified Data.Set as S +import Data.String (fromString) +import Data.Text (Text) import qualified Flat.Run as F -import GHC.Stack (HasCallStack) +import GHC.Stack (HasCallStack, callStack, prettyCallStack) import GHC.Word (Word64) import Plutarch.Evaluate (evalScript) import Plutarch.Reducible (Reducible (Reduce)) @@ -71,6 +75,8 @@ type Dig = Digest Blake2b_160 data HoistedTerm = HoistedTerm Dig RawTerm deriving stock (Show) +type UTerm = UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () + data RawTerm = RVar Word64 | RLamAbs Word64 RawTerm @@ -79,7 +85,7 @@ data RawTerm | RDelay RawTerm | RConstant (Some (ValueOf PLC.DefaultUni)) | RBuiltin PLC.DefaultFun - | RCompiled (UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) + | RCompiled UTerm | RError | RHoisted HoistedTerm deriving stock (Show) @@ -124,6 +130,8 @@ type PType = S -> Type type role Term phantom representational +type TermMonad = Either Text + {- $term Source: Unembedding Domain-Specific Languages by Robert Atkey, Sam Lindley, Jeremy Yallop Thanks! @@ -138,7 +146,7 @@ type role Term phantom representational de-Bruijn index needed to reach its own level given the level it itself is instantiated with. -} -newtype Term (s :: S) (a :: PType) = Term {asRawTerm :: Word64 -> TermResult} +newtype Term (s :: S) (a :: PType) = Term {asRawTerm :: Word64 -> TermMonad TermResult} instance Reducible (Term s a) where type Reduce (Term s a) = Term s a @@ -159,9 +167,9 @@ data PDelayed (a :: PType) (s :: S) Use 'plam' instead, to support currying. -} plam' :: (Term s a -> Term s b) -> Term s (a :--> b) -plam' f = Term $ \i -> - let v = Term $ \j -> mkTermRes $ RVar (j - (i + 1)) - in case asRawTerm (f v) (i + 1) of +plam' f = Term \i -> + let v = Term \j -> pure $ mkTermRes $ RVar (j - (i + 1)) + in flip fmap (asRawTerm (f v) (i + 1)) \case -- eta-reduce for arity 1 t@(getTerm -> RApply t'@(getArity -> Just _) [RVar 0]) -> t {getTerm = t'} -- eta-reduce for arity 2 + n @@ -248,43 +256,52 @@ plam' f = Term $ \i -> But sufficiently small terms in WHNF may be inlined for efficiency. -} plet :: Term s a -> (Term s a -> Term s b) -> Term s b -plet v f = Term $ \i -> case asRawTerm v i of - -- Inline sufficiently small terms in WHNF - (getTerm -> RVar _) -> asRawTerm (f v) i - (getTerm -> RBuiltin _) -> asRawTerm (f v) i - (getTerm -> RHoisted _) -> asRawTerm (f v) i - _ -> asRawTerm (papp (plam' f) v) i +plet v f = Term \i -> + asRawTerm v i >>= \case + -- Inline sufficiently small terms in WHNF + (getTerm -> RVar _) -> asRawTerm (f v) i + (getTerm -> RBuiltin _) -> asRawTerm (f v) i + (getTerm -> RHoisted _) -> asRawTerm (f v) i + _ -> asRawTerm (papp (plam' f) v) i + +pthrow' :: HasCallStack => Text -> TermMonad a +pthrow' msg = Left (fromString (prettyCallStack callStack) <> "\n\n" <> msg) + +pthrow :: HasCallStack => Text -> Term s a +pthrow = Term . pure . pthrow' -- | Lambda Application. -papp :: Term s (a :--> b) -> Term s a -> Term s b -papp x y = Term $ \i -> case (asRawTerm x i, asRawTerm y i) of - -- Applying anything to an error is an error. - (getTerm -> RError, _) -> mkTermRes RError - -- Applying an error to anything is an error. - (_, getTerm -> RError) -> mkTermRes RError - -- Applying to `id` changes nothing. - (getTerm -> RLamAbs 0 (RVar 0), y') -> y' - (getTerm -> RHoisted (HoistedTerm _ (RLamAbs 0 (RVar 0))), y') -> y' - -- append argument - (x'@(getTerm -> RApply x'l x'r), y') -> TermResult (RApply x'l (getTerm y' : x'r)) (getDeps x' <> getDeps y') - -- new RApply - (x', y') -> TermResult (RApply (getTerm x') [getTerm y']) (getDeps x' <> getDeps y') +papp :: HasCallStack => Term s (a :--> b) -> Term s a -> Term s b +papp x y = Term \i -> + (,) <$> (asRawTerm x i) <*> (asRawTerm y i) >>= \case + -- Applying anything to an error is an error. + (getTerm -> RError, _) -> pthrow' "application to an error" + -- Applying an error to anything is an error. + (_, getTerm -> RError) -> pthrow' "application with an error" + -- Applying to `id` changes nothing. + (getTerm -> RLamAbs 0 (RVar 0), y') -> pure y' + (getTerm -> RHoisted (HoistedTerm _ (RLamAbs 0 (RVar 0))), y') -> pure y' + -- append argument + (x'@(getTerm -> RApply x'l x'r), y') -> pure $ TermResult (RApply x'l (getTerm y' : x'r)) (getDeps x' <> getDeps y') + -- new RApply + (x', y') -> pure $ TermResult (RApply (getTerm x') [getTerm y']) (getDeps x' <> getDeps y') {- | Plutus \'delay\', used for laziness. -} pdelay :: Term s a -> Term s (PDelayed a) -pdelay x = Term $ \i -> mapTerm RDelay $ asRawTerm x i +pdelay x = Term \i -> mapTerm RDelay <$> asRawTerm x i {- | Plutus \'force\', used to force evaluation of 'PDelayed' terms. -} pforce :: Term s (PDelayed a) -> Term s a -pforce x = Term $ \i -> case asRawTerm x i of - -- A force cancels a delay - t@(getTerm -> RDelay t') -> t {getTerm = t'} - t -> mapTerm RForce t +pforce x = Term \i -> + asRawTerm x i <&> \case + -- A force cancels a delay + t@(getTerm -> RDelay t') -> t {getTerm = t'} + t -> mapTerm RForce t {- | Plutus \'error\'. @@ -293,7 +310,7 @@ pforce x = Term $ \i -> case asRawTerm x i of the containing term is delayed, avoiding premature evaluation. -} perror :: Term s a -perror = Term $ \_ -> mkTermRes RError +perror = Term \_ -> pure $ mkTermRes RError {- | Unsafely coerce the type-tag of a Term. @@ -305,15 +322,15 @@ punsafeCoerce :: Term s a -> Term s b punsafeCoerce (Term x) = Term x punsafeBuiltin :: UPLC.DefaultFun -> Term s a -punsafeBuiltin f = Term $ \_ -> mkTermRes $ RBuiltin f +punsafeBuiltin f = Term \_ -> pure $ mkTermRes $ RBuiltin f {-# DEPRECATED punsafeConstant "Use `pconstant` instead." #-} punsafeConstant :: Some (ValueOf PLC.DefaultUni) -> Term s a punsafeConstant = punsafeConstantInternal punsafeConstantInternal :: Some (ValueOf PLC.DefaultUni) -> Term s a -punsafeConstantInternal c = Term $ \_ -> - case c of +punsafeConstantInternal c = Term \_ -> + pure $ case c of -- These constants are smaller than variable references. Some (ValueOf PLC.DefaultUniBool _) -> mkTermRes $ RConstant c Some (ValueOf PLC.DefaultUniUnit _) -> mkTermRes $ RConstant c @@ -322,25 +339,26 @@ punsafeConstantInternal c = Term $ \_ -> let hoisted = HoistedTerm (hashRawTerm $ RConstant c) (RConstant c) in TermResult (RHoisted hoisted) [hoisted] -asClosedRawTerm :: ClosedTerm a -> TermResult +asClosedRawTerm :: ClosedTerm a -> TermMonad TermResult asClosedRawTerm t = asRawTerm t 0 -- FIXME: Give proper error message when mutually recursive. phoistAcyclic :: HasCallStack => ClosedTerm a -> Term s a -phoistAcyclic t = case asRawTerm t 0 of - -- Built-ins are smaller than variable references - t'@(getTerm -> RBuiltin _) -> Term $ \_ -> t' - t' -> case evalScript . Script . UPLC.Program () (PLC.defaultVersion ()) $ compile' t' of - (Right _, _, _) -> - let hoisted = HoistedTerm (hashRawTerm . getTerm $ t') (getTerm t') - in Term $ \_ -> TermResult (RHoisted hoisted) (hoisted : getDeps t') - (Left e, _, _) -> error $ "Hoisted term errs! " <> show e +phoistAcyclic t = Term \_ -> + asRawTerm t 0 >>= \case + -- Built-ins are smaller than variable references + t'@(getTerm -> RBuiltin _) -> pure $ t' + t' -> case evalScript . Script . UPLC.Program () (PLC.defaultVersion ()) $ compile' t' of + (Right _, _, _) -> + let hoisted = HoistedTerm (hashRawTerm . getTerm $ t') (getTerm t') + in pure $ TermResult (RHoisted hoisted) (hoisted : getDeps t') + (Left e, _, _) -> pthrow' $ "Hoisted term errs! " <> fromString (show e) punsafeAsClosedTerm :: forall s a. Term s a -> ClosedTerm a punsafeAsClosedTerm (Term t) = (Term t) -- Couldn't find a definition for this in plutus-core -subst :: Word64 -> (Word64 -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () +subst :: Word64 -> (Word64 -> UTerm) -> UTerm -> UTerm subst idx x (UPLC.Apply () yx yy) = UPLC.Apply () (subst idx x yx) (subst idx x yy) subst idx x (UPLC.LamAbs () name y) = UPLC.LamAbs () name (subst (idx + 1) x y) subst idx x (UPLC.Delay () y) = UPLC.Delay () (subst idx x y) @@ -382,7 +400,7 @@ rawTermToUPLC _ _ RError = UPLC.Error () rawTermToUPLC m l (RHoisted hoisted) = m hoisted l -- UPLC.Var () . DeBruijn . Index $ l - m hoisted -- The logic is mostly for hoisting -compile' :: TermResult -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun () +compile' :: TermResult -> UTerm compile' t = let t' = getTerm t deps = getDeps t @@ -428,10 +446,8 @@ compile' t = in wrapped -- | Compile a (closed) Plutus Term to a usable script -compile :: ClosedTerm a -> Script -compile t = Script $ UPLC.Program () (PLC.defaultVersion ()) (compile' $ asClosedRawTerm $ t) +compile :: ClosedTerm a -> Either Text Script +compile t = (Script . UPLC.Program () (PLC.defaultVersion ()) . compile') <$> asClosedRawTerm t -hashTerm :: ClosedTerm a -> Dig -hashTerm t = - let t' = asRawTerm t 0 - in hashRawTerm . getTerm $ t' +hashTerm :: ClosedTerm a -> Either Text Dig +hashTerm t = hashRawTerm . getTerm <$> asRawTerm t 0 diff --git a/plutarch.cabal b/plutarch.cabal index 765e5081f..e734e09f6 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -16,6 +16,7 @@ common c NoStarIsType BangPatterns BinaryLiterals + BlockArguments ConstrainedClassMethods ConstraintKinds DataKinds From 5f4ea0df59148ae9bccd4a6908d1f933d6fd102b Mon Sep 17 00:00:00 2001 From: Las Safin Date: Thu, 2 Jun 2022 18:55:28 +0000 Subject: [PATCH 500/584] Make Term monadic, remove CPP, and Plutarch.Rec (sorry) We now thread the hard-coded `TermMonad` through terms. This also means errors are done properly rather than using `error`. In addition, compilation now takes a configuration, with currently 3 options: - No tracing - Do tracing normally (like now) - Do tracing deterministically The last is useful for tests where we don't want the trace messages to reference line numbers, as that adds non-useful noise. I removed `Plutarch.Rec` because of several reasons: - The mutual recursion it does can be emulated somewhat trivially with `pfix` and normal `PlutusType` derivation. - In the future mutual recursion will happen in a very different way. - `PlutusType` derivation replaces its need somewhat. - It was very complex as it dealt with the Term representation directly, and as I looked through the code, it seemed like there were places were hoisting was handled incorrectly. - Seeing that Plutarch 1.2 is the final release before Plutarch 2.0, I didn't see the point in spending that much time on something that will only be relevant for quite a short period of time. - Plutarch 2.0 has `EType` which fully covers all the use cases and more, in an ergonomic fashion. In addition, some bad workarounds has happened in this PR: - We no longer do tests without tracing generally. It is entirely possible to still do this, but I didn't want to put more time into Plutarch 1.2. --- Plutarch.hs | 4 + Plutarch/Api/V1.hs | 17 +- Plutarch/Api/V1/AssocMap.hs | 126 +++---- Plutarch/FFI.hs | 24 +- Plutarch/Internal.hs | 40 ++- Plutarch/Internal/Other.hs | 12 +- Plutarch/Internal/PLam.hs | 5 +- Plutarch/Lift.hs | 27 +- Plutarch/Rec.hs | 244 ------------- Plutarch/Rec/TH.hs | 60 ---- Plutarch/TermCont.hs | 23 +- Plutarch/Trace.hs | 60 ++-- bin/format | 2 +- flake.nix | 38 +-- plutarch-test/common/Plutarch/Test.hs | 33 +- plutarch-test/common/Plutarch/Test/Golden.hs | 8 +- .../Plutarch/Test/Property/HaskEquiv.hs | 5 +- ...i.example.signatory.dev=false.bench.golden | 4 - ...ample.signatory.dev=false.uplc.eval.golden | 4 - ...pi.example.signatory.dev=false.uplc.golden | 4 - plutarch-test/goldens/api.map.bench.golden | 16 +- plutarch-test/goldens/api.map.uplc.golden | 16 +- .../goldens/api.value.dev=false.bench.golden | 89 ----- .../api.value.dev=false.uplc.eval.golden | 220 ------------ .../goldens/api.value.dev=false.uplc.golden | 89 ----- .../goldens/api.value.dev=true.bench.golden | 126 +++---- .../api.value.dev=true.uplc.eval.golden | 4 +- .../goldens/api.value.dev=true.uplc.golden | 126 +++---- plutarch-test/goldens/bool.bench.golden | 4 - plutarch-test/goldens/bool.uplc.eval.golden | 4 - plutarch-test/goldens/bool.uplc.golden | 4 - .../goldens/extra.api.dev=false.bench.golden | 3 - .../extra.api.dev=false.uplc.eval.golden | 3 - .../goldens/extra.api.dev=false.uplc.golden | 3 - .../goldens/int.examples.bench.golden | 1 - .../goldens/int.examples.uplc.eval.golden | 1 - .../goldens/int.examples.uplc.golden | 1 - .../goldens/list.dev=false.bench.golden | 25 -- .../goldens/list.dev=false.uplc.eval.golden | 25 -- .../goldens/list.dev=false.uplc.golden | 25 -- .../goldens/rational.dev=false.bench.golden | 24 -- .../rational.dev=false.uplc.eval.golden | 24 -- .../goldens/rational.dev=false.uplc.golden | 24 -- .../goldens/rec.Data.dev=false.bench.golden | 8 - .../rec.Data.dev=false.uplc.eval.golden | 22 -- .../goldens/rec.Data.dev=false.uplc.golden | 8 - .../goldens/rec.Data.dev=true.bench.golden | 8 - .../rec.Data.dev=true.uplc.eval.golden | 22 -- .../goldens/rec.Data.dev=true.uplc.golden | 8 - .../goldens/rec.LetRec.dev=false.bench.golden | 8 - .../rec.LetRec.dev=false.uplc.eval.golden | 8 - .../goldens/rec.LetRec.dev=false.uplc.golden | 8 - .../goldens/rec.LetRec.dev=true.bench.golden | 8 - .../rec.LetRec.dev=true.uplc.eval.golden | 8 - .../goldens/rec.LetRec.dev=true.uplc.golden | 8 - .../goldens/rec.nested.dev=false.bench.golden | 22 -- .../rec.nested.dev=false.uplc.eval.golden | 22 -- .../goldens/rec.nested.dev=false.uplc.golden | 22 -- .../goldens/rec.nested.dev=true.bench.golden | 22 -- .../rec.nested.dev=true.uplc.eval.golden | 22 -- .../goldens/rec.nested.dev=true.uplc.golden | 22 -- .../goldens/rec.simple.dev=false.bench.golden | 10 - .../rec.simple.dev=false.uplc.eval.golden | 10 - .../goldens/rec.simple.dev=false.uplc.golden | 10 - .../goldens/rec.simple.dev=true.bench.golden | 10 - .../rec.simple.dev=true.uplc.eval.golden | 10 - .../goldens/rec.simple.dev=true.uplc.golden | 10 - .../goldens/show.dev=false.bench.golden | 1 - .../goldens/show.dev=false.uplc.eval.golden | 1 - .../goldens/show.dev=false.uplc.golden | 1 - .../goldens/trace.dev=false.bench.golden | 10 - .../goldens/trace.dev=false.uplc.eval.golden | 10 - .../goldens/trace.dev=false.uplc.golden | 10 - plutarch-test/goldens/uplc-misc.bench.golden | 1 - .../goldens/uplc-misc.uplc.eval.golden | 1 - plutarch-test/goldens/uplc-misc.uplc.golden | 1 - .../plutarch-base/Plutarch/BoolSpec.hs | 10 +- .../plutarch-base/Plutarch/IntegerSpec.hs | 1 - .../plutarch-base/Plutarch/RecSpec.hs | 322 ------------------ .../plutarch-base/Plutarch/ScriptsSpec.hs | 7 +- .../plutarch-base/Plutarch/UPLCSpec.hs | 3 +- plutarch-test/plutarch-test.cabal | 8 +- plutarch.cabal | 3 +- 83 files changed, 368 insertions(+), 1935 deletions(-) delete mode 100644 Plutarch/Rec.hs delete mode 100644 Plutarch/Rec/TH.hs delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/api.value.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/api.value.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/api.value.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/extra.api.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/extra.api.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/list.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/list.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/list.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/rational.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/rational.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rational.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/rec.Data.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/rec.Data.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.Data.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/rec.Data.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/rec.Data.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.Data.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/rec.LetRec.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/rec.LetRec.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/rec.nested.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/rec.nested.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.nested.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/rec.nested.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/rec.nested.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.nested.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/rec.simple.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/rec.simple.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.simple.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/rec.simple.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/rec.simple.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/rec.simple.dev=true.uplc.golden delete mode 100644 plutarch-test/goldens/show.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/show.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/show.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.uplc.eval.golden delete mode 100644 plutarch-test/goldens/trace.dev=false.uplc.golden delete mode 100644 plutarch-test/plutarch-base/Plutarch/RecSpec.hs diff --git a/Plutarch.hs b/Plutarch.hs index 1e8987687..22ffc7417 100644 --- a/Plutarch.hs +++ b/Plutarch.hs @@ -33,6 +33,10 @@ module Plutarch ( PT.hashOpenTerm, PT.runTermCont, PT.unTermCont, + Config (Config, tracingMode), + TracingMode (NoTracing, DoTracing, DetTracing), + pgetConfig, + defaultConfig, ) where import Plutarch.Internal.Other diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 3ed185226..7ee79a599 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -102,11 +102,14 @@ import Data.Coerce (coerce) import qualified PlutusLedgerApi.V1 as Plutus import qualified PlutusLedgerApi.V1.Scripts as Plutus -import Plutarch (compile) +import Plutarch (Config, compile) import Plutarch.Api.Internal.Hashing (hashData, hashScriptWithPrefix) import Plutarch.Api.V1.Contexts (PScriptContext) import Plutarch.Prelude +import qualified Data.Text as T +import GHC.Stack (HasCallStack) + -- On-chain Script Types -- | a Validator Term @@ -119,16 +122,16 @@ type PMintingPolicy = PData :--> PScriptContext :--> POpaque type PStakeValidator = PData :--> PScriptContext :--> POpaque -- | Compile a Validator -mkValidator :: ClosedTerm PValidator -> Plutus.Validator -mkValidator s = Plutus.Validator $ compile s +mkValidator :: HasCallStack => Config -> ClosedTerm PValidator -> Plutus.Validator +mkValidator config s = Plutus.Validator $ either (error . T.unpack) id $ compile config s -- | Compile a MintingPolicy -mkMintingPolicy :: ClosedTerm PMintingPolicy -> Plutus.MintingPolicy -mkMintingPolicy s = Plutus.MintingPolicy $ compile s +mkMintingPolicy :: HasCallStack => Config -> ClosedTerm PMintingPolicy -> Plutus.MintingPolicy +mkMintingPolicy config s = Plutus.MintingPolicy $ either (error . T.unpack) id $ compile config s -- | Compile a StakeValidator -mkStakeValidator :: ClosedTerm PStakeValidator -> Plutus.StakeValidator -mkStakeValidator s = Plutus.StakeValidator $ compile s +mkStakeValidator :: HasCallStack => Config -> ClosedTerm PStakeValidator -> Plutus.StakeValidator +mkStakeValidator config s = Plutus.StakeValidator $ either (error . T.unpack) id $ compile config s -- | Hash a Script, with the correct prefix for Plutus V1 scriptHash :: Plutus.Script -> Plutus.ScriptHash diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index c290cafcc..041fbdd08 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -45,6 +45,9 @@ import qualified PlutusTx.AssocMap as PlutusMap import qualified PlutusTx.Monoid as PlutusTx import qualified PlutusTx.Semigroup as PlutusTx +import qualified GHC.Generics as GHC +import Generics.SOP (Generic, I (I)) +import Plutarch (pfix) import Plutarch.Builtin (PBuiltinList (PCons, PNil), PBuiltinMap, ppairDataBuiltin) import Plutarch.Lift ( PConstantDecl, @@ -89,11 +92,8 @@ import Plutarch.Prelude ( (#$), type (:-->), ) -import Plutarch.Rec (ScottEncoded, ScottEncoding, field, letrec) import Plutarch.Show (PShow) -import Plutarch.Unsafe (punsafeDowncast) - -import qualified Rank2 +import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import Prelude hiding (all, any, filter, lookup, null) @@ -283,38 +283,6 @@ passertSorted = phoistAcyclic $ pforgetSorted :: Term s (PMap 'Sorted k v) -> Term s (PMap g k v) pforgetSorted v = punsafeDowncast (pto v) -data MapUnion k v f = MapUnion - { merge :: f (PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) - , mergeInsert :: f (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) - } - -type instance - ScottEncoded (MapUnion k v) a = - (PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) - :--> (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) - :--> a - -instance Rank2.Functor (MapUnion k v) where - f <$> x@MapUnion {} = - MapUnion - { merge = f (merge x) - , mergeInsert = f (mergeInsert x) - } - -instance Rank2.Foldable (MapUnion k v) where - foldMap f x@MapUnion {} = f (merge x) <> f (mergeInsert x) - -instance Rank2.Traversable (MapUnion k v) where - traverse f x@MapUnion {} = MapUnion <$> f (merge x) <*> f (mergeInsert x) - -instance Rank2.Distributive (MapUnion k v) where - cotraverse w f = - MapUnion - { merge = w (merge <$> f) - , mergeInsert = w (mergeInsert <$> f) - } -instance Rank2.DistributiveTraversable (MapUnion k v) - instance (POrd k, PIsData k, PIsData v, Semigroup (Term s v)) => Semigroup (Term s (PMap 'Sorted k v)) @@ -356,6 +324,53 @@ punionWith = phoistAcyclic $ \combine -> punionWithData #$ plam $ \x y -> pdata (combine # pfromData x # pfromData y) +data MapUnionCarrier k v s = MapUnionCarrier + { merge :: Term s (PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) + , mergeInsert :: Term s (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) + } + deriving stock (GHC.Generic) + deriving anyclass (Generic, PlutusType) + +mapUnionCarrier :: (POrd k, PIsData k) => Term s ((PAsData v :--> PAsData v :--> PAsData v) :--> MapUnionCarrier k v :--> MapUnionCarrier k v) +mapUnionCarrier = phoistAcyclic $ plam \combine self -> + let mergeInsert = (pmatch self \(MapUnionCarrier {mergeInsert}) -> mergeInsert) + merge = (pmatch self \(MapUnionCarrier {merge}) -> merge) + in pcon $ + MapUnionCarrier + { merge = plam $ \xs ys -> pmatch xs $ \case + PNil -> ys + PCons x xs' -> mergeInsert # x # xs' # ys + , mergeInsert = plam $ \x xs ys -> + pmatch ys $ \case + PNil -> pcons # x # xs + PCons y1 ys' -> + plet y1 $ \y -> + plet (pfstBuiltin # x) $ \xk -> + plet (pfstBuiltin # y) $ \yk -> + pif + (xk #== yk) + ( pcons + # (ppairDataBuiltin # xk #$ combine # (psndBuiltin # x) # (psndBuiltin # y)) + #$ merge + # xs + # ys' + ) + ( pif + (pfromData xk #< pfromData yk) + ( pcons + # x + # (mergeInsert # y # ys' # xs) + ) + ( pcons + # y + # (mergeInsert # x # xs # ys') + ) + ) + } + +mapUnion :: forall k v s. (POrd k, PIsData k) => Term s ((PAsData v :--> PAsData v :--> PAsData v) :--> MapUnionCarrier k v) +mapUnion = phoistAcyclic $ plam \combine -> (punsafeCoerce pfix) # (mapUnionCarrier # combine :: Term _ (MapUnionCarrier k v :--> MapUnionCarrier k v)) + {- | Combine two 'PMap's applying the given function to any two data-encoded values that share the same key. -} @@ -370,44 +385,7 @@ punionWithData :: ) punionWithData = phoistAcyclic $ plam $ \combine x y -> - pcon $ PMap $ mapUnion # combine # field merge # pto x # pto y - -mapUnion :: - (POrd k, PIsData k) => - Term s ((PAsData v :--> PAsData v :--> PAsData v) :--> ScottEncoding (MapUnion k v) (a :: PType)) -mapUnion = plam $ \combine -> - letrec $ \MapUnion {merge, mergeInsert} -> - MapUnion - { merge = plam $ \xs ys -> pmatch xs $ \case - PNil -> ys - PCons x xs' -> mergeInsert # x # xs' # ys - , mergeInsert = plam $ \x xs ys -> - pmatch ys $ \case - PNil -> pcons # x # xs - PCons y1 ys' -> - plet y1 $ \y -> - plet (pfstBuiltin # x) $ \xk -> - plet (pfstBuiltin # y) $ \yk -> - pif - (xk #== yk) - ( pcons - # (ppairDataBuiltin # xk #$ combine # (psndBuiltin # x) # (psndBuiltin # y)) - #$ merge - # xs - # ys' - ) - ( pif - (pfromData xk #< pfromData yk) - ( pcons - # x - # (mergeInsert # y # ys' # xs) - ) - ( pcons - # y - # (mergeInsert # x # xs # ys') - ) - ) - } + pcon $ PMap $ (pmatch (mapUnion # combine) \(MapUnionCarrier {merge}) -> merge) # pto x # pto y -- | Difference of two maps. Return elements of the first map not existing in the second map. pdifference :: diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index a9c386835..317228048 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -19,6 +19,7 @@ module Plutarch.FFI ( import Data.ByteString (ByteString) import Data.Kind (Constraint, Type) import Data.Text (Text) +import qualified Data.Text as T import Data.Void (Void) import GHC.Generics (Generic) import GHC.TypeLits (TypeError) @@ -32,10 +33,12 @@ import Generics.SOP.Type.Metadata ( ) import Plutarch ( ClosedTerm, + Config, PDelayed, POpaque, PType, S, + compile, pcon, pdelay, pforce, @@ -54,8 +57,6 @@ import Plutarch.Internal ( RawTerm (RCompiled), Term (Term), TermResult (TermResult), - asClosedRawTerm, - compile', ) import Plutarch.Internal.PlutusType (PlutusType (PInner, pcon', pmatch')) import Plutarch.List (PList, PListLike (PElemConstraint, pcons, pelimList, pnil), pconvertLists, plistEquals) @@ -63,7 +64,7 @@ import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Show (PShow) import Plutarch.String (PString) import Plutarch.Unit (PUnit) -import PlutusLedgerApi.V1.Scripts (Script (unScript), fromCompiledCode) +import PlutusLedgerApi.V1.Scripts (Script (Script, unScript), fromCompiledCode) import PlutusTx.Builtins.Internal (BuiltinBool, BuiltinByteString, BuiltinData, BuiltinUnit) import PlutusTx.Code (CompiledCode, CompiledCodeIn (DeserializedCode)) import PlutusTx.Prelude (BuiltinString) @@ -99,7 +100,7 @@ instance PEq a => PEq (PTxList a) where (#==) xs ys = plistEquals # xs # ys -- | Compile and export a Plutarch term so it can be used by `PlutusTx.applyCode`. -foreignExport :: p >~< t => ClosedTerm p -> CompiledCode t +foreignExport :: p >~< t => Config -> ClosedTerm p -> CompiledCode t foreignExport = unsafeForeignExport -- | Import compiled UPLC code (such as a spliced `PlutusTx.compile` result) as a Plutarch term. @@ -107,7 +108,7 @@ foreignImport :: p >~< t => CompiledCode t -> ClosedTerm p foreignImport = unsafeForeignImport -- | Export Plutarch term of any type as @CompiledCode Void@. -opaqueExport :: ClosedTerm p -> CompiledCode Void +opaqueExport :: Config -> ClosedTerm p -> CompiledCode Void opaqueExport = unsafeForeignExport -- | Import compiled UPLC code of any type as a Plutarch opaque term. @@ -115,18 +116,17 @@ opaqueImport :: CompiledCode t -> ClosedTerm POpaque opaqueImport = unsafeForeignImport -- | Seriously unsafe, may fail at run time or result in unexpected behaviour in your on-chain validator. -unsafeForeignExport :: ClosedTerm p -> CompiledCode t -unsafeForeignExport t = DeserializedCode program Nothing mempty +unsafeForeignExport :: Config -> ClosedTerm p -> CompiledCode t +unsafeForeignExport config t = DeserializedCode program Nothing mempty where + (Script (UPLC.Program _ version term)) = either (error . T.unpack) id $ compile config t program = - UPLC.Program () (UPLC.Version () 1 0 0) $ - UPLC.termMapNames fakeNameDeBruijn $ - compile' $ - asClosedRawTerm t + UPLC.Program () version $ + UPLC.termMapNames fakeNameDeBruijn term -- | Seriously unsafe, may fail at run time or result in unexpected behaviour in your on-chain validator. unsafeForeignImport :: CompiledCode t -> ClosedTerm p -unsafeForeignImport c = Term $ const $ TermResult (RCompiled $ UPLC._progTerm $ unScript $ fromCompiledCode c) [] +unsafeForeignImport c = Term $ const $ pure $ TermResult (RCompiled $ UPLC._progTerm $ unScript $ fromCompiledCode c) [] -- | Convert a 'PList' to a 'PTxList', perhaps before exporting it with 'foreignExport'. plistToTx :: Term s (PList a :--> PTxList a) diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index a886d8f51..3d202b4b2 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -5,7 +5,7 @@ module Plutarch.Internal ( (:-->), PDelayed, -- | $term - Term (Term, asRawTerm), + Term (..), asClosedRawTerm, mapTerm, plam', @@ -31,8 +31,14 @@ module Plutarch.Internal ( S (SI), PType, pthrow, + Config (..), + TracingMode (..), + defaultConfig, + pgetConfig, + TermMonad (..), ) where +import Control.Monad.Reader (ReaderT (ReaderT), ask, runReaderT) import Crypto.Hash (Context, Digest, hashFinalize, hashInit, hashUpdate) import Crypto.Hash.Algorithms (Blake2b_160) import Crypto.Hash.IO (HashAlgorithm) @@ -130,7 +136,21 @@ type PType = S -> Type type role Term phantom representational -type TermMonad = Either Text +data Config = Config + { tracingMode :: TracingMode + } + +data TracingMode = NoTracing | DoTracing | DetTracing + +-- Default is to be efficient +defaultConfig :: Config +defaultConfig = + Config + { tracingMode = NoTracing + } + +newtype TermMonad m = TermMonad {runTermMonad :: ReaderT Config (Either Text) m} + deriving newtype (Functor, Applicative, Monad) {- $term Source: Unembedding Domain-Specific Languages by Robert Atkey, Sam Lindley, Jeremy Yallop @@ -265,7 +285,7 @@ plet v f = Term \i -> _ -> asRawTerm (papp (plam' f) v) i pthrow' :: HasCallStack => Text -> TermMonad a -pthrow' msg = Left (fromString (prettyCallStack callStack) <> "\n\n" <> msg) +pthrow' msg = TermMonad $ ReaderT $ const $ Left (fromString (prettyCallStack callStack) <> "\n\n" <> msg) pthrow :: HasCallStack => Text -> Term s a pthrow = Term . pure . pthrow' @@ -312,6 +332,11 @@ pforce x = Term \i -> perror :: Term s a perror = Term \_ -> pure $ mkTermRes RError +pgetConfig :: (Config -> Term s a) -> Term s a +pgetConfig f = Term \lvl -> TermMonad $ do + config <- ask + runTermMonad $ asRawTerm (f config) lvl + {- | Unsafely coerce the type-tag of a Term. @@ -446,8 +471,9 @@ compile' t = in wrapped -- | Compile a (closed) Plutus Term to a usable script -compile :: ClosedTerm a -> Either Text Script -compile t = (Script . UPLC.Program () (PLC.defaultVersion ()) . compile') <$> asClosedRawTerm t +compile :: Config -> ClosedTerm a -> Either Text Script +compile config t = case asClosedRawTerm t of + TermMonad (ReaderT t') -> (Script . UPLC.Program () (UPLC.Version () 1 0 0) . compile') <$> t' config -hashTerm :: ClosedTerm a -> Either Text Dig -hashTerm t = hashRawTerm . getTerm <$> asRawTerm t 0 +hashTerm :: Config -> ClosedTerm a -> Either Text Dig +hashTerm config t = hashRawTerm . getTerm <$> runReaderT (runTermMonad $ asRawTerm t 0) config diff --git a/Plutarch/Internal/Other.hs b/Plutarch/Internal/Other.hs index cfcfaebf2..9c65153d8 100644 --- a/Plutarch/Internal/Other.hs +++ b/Plutarch/Internal/Other.hs @@ -32,10 +32,16 @@ module Plutarch.Internal.Other ( popaque, plam, DerivePNewtype (DerivePNewtype), + PI.pgetConfig, + PI.Config (..), + PI.TracingMode (..), + PI.defaultConfig, ) where import Data.Coerce (Coercible, coerce) -import Plutarch.Internal (ClosedTerm, PType, Term, compile, phoistAcyclic, punsafeCoerce, (:-->)) +import qualified Data.Text as T +import GHC.Stack (HasCallStack) +import Plutarch.Internal (ClosedTerm, Config, PType, Term, compile, phoistAcyclic, punsafeCoerce, (:-->)) import qualified Plutarch.Internal as PI import Plutarch.Internal.PLam (pinl, plam, (#), (#$)) import Plutarch.Internal.PlutusType (PCon (pcon), PMatch (pmatch), PlutusType (PInner, pcon', pmatch')) @@ -54,8 +60,8 @@ printScript = show . prettyPlcReadableDebug . (\(Script s) -> s) > show . prettyPlcReadableDef . (\(Right p) -> p) . Scripts.mkTermToEvaluate . compile $ term -} -printTerm :: ClosedTerm a -> String -printTerm term = printScript $ compile term +printTerm :: HasCallStack => Config -> ClosedTerm a -> String +printTerm config term = printScript $ either (error . T.unpack) id $ compile config term {- | Safely coerce from a Term to it's 'PInner' representation. diff --git a/Plutarch/Internal/PLam.hs b/Plutarch/Internal/PLam.hs index 86b93bfdc..479de755b 100644 --- a/Plutarch/Internal/PLam.hs +++ b/Plutarch/Internal/PLam.hs @@ -9,6 +9,7 @@ module Plutarch.Internal.PLam ( ) where import Data.Kind (Type) +import GHC.Stack (HasCallStack) import Plutarch.Internal (PType, S, Term, papp, plam', (:-->)) {- | @@ -18,7 +19,7 @@ import Plutarch.Internal (PType, S, Term, papp, plam', (:-->)) >>> f # x # y f x y -} -(#) :: Term s (a :--> b) -> Term s a -> Term s b +(#) :: HasCallStack => Term s (a :--> b) -> Term s a -> Term s b (#) = papp infixl 8 # @@ -30,7 +31,7 @@ infixl 8 # >>> f # x #$ g # y # z f x (g y z) -} -(#$) :: Term s (a :--> b) -> Term s a -> Term s b +(#$) :: HasCallStack => Term s (a :--> b) -> Term s a -> Term s b (#$) = papp infixr 0 #$ diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index b8133ddd8..11c7729ad 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -33,9 +33,10 @@ module Plutarch.Lift ( import Control.Lens ((^?)) import Data.Coerce (Coercible, coerce) import Data.Kind (Constraint, Type) +import Data.Text (Text) import GHC.Stack (HasCallStack) import Plutarch.Evaluate (EvalError, evalScript) -import Plutarch.Internal (ClosedTerm, PType, Term, compile, punsafeConstantInternal) +import Plutarch.Internal (ClosedTerm, Config (Config, tracingMode), PType, Term, compile, punsafeConstantInternal, pattern DoTracing) import qualified PlutusCore as PLC import PlutusCore.Builtin (KnownTypeError, readKnownConstant) import PlutusCore.Evaluation.Machine.Exception (_UnliftingErrorE) @@ -99,24 +100,27 @@ data LiftError = LiftError_EvalError EvalError | LiftError_KnownTypeError KnownTypeError | LiftError_FromRepr + | LiftError_CompilationError Text deriving stock (Eq) {- | Convert a Plutarch term to the associated Haskell value. Fail otherwise. This will fully evaluate the arbitrary closed expression, and convert the resulting value. -} -plift' :: forall p. PUnsafeLiftDecl p => ClosedTerm p -> Either LiftError (PLifted p) -plift' prog = case evalScript (compile prog) of - (Right (Scripts.unScript -> UPLC.Program _ _ term), _, _) -> - case readKnownConstant term of - Right r -> case pconstantFromRepr r of - Just h -> Right h - Nothing -> Left LiftError_FromRepr - Left e -> Left $ LiftError_KnownTypeError e - (Left e, _, _) -> Left $ LiftError_EvalError e +plift' :: forall p. PUnsafeLiftDecl p => Config -> ClosedTerm p -> Either LiftError (PLifted p) +plift' config prog = case compile config prog of + Left msg -> Left $ LiftError_CompilationError msg + Right script -> case evalScript script of + (Right (Scripts.unScript -> UPLC.Program _ _ term), _, _) -> + case readKnownConstant term of + Right r -> case pconstantFromRepr r of + Just h -> Right h + Nothing -> Left LiftError_FromRepr + Left e -> Left $ LiftError_KnownTypeError e + (Left e, _, _) -> Left $ LiftError_EvalError e -- | Like `plift'` but throws on failure. plift :: forall p. (HasCallStack, PLift p) => ClosedTerm p -> PLifted p -plift prog = case plift' prog of +plift prog = case plift' (Config {tracingMode = DoTracing}) prog of Right x -> x Left LiftError_FromRepr -> error "plift failed: pconstantFromRepr returned 'Nothing'" Left (LiftError_KnownTypeError e) -> @@ -125,6 +129,7 @@ plift prog = case plift' prog of "plift failed: incorrect type: " <> maybe "absurd evaluation failure" show unliftErrMaybe Left (LiftError_EvalError e) -> error $ "plift failed: erring term: " <> show e + Left (LiftError_CompilationError msg) -> error $ "plift failed: compilation failed: " <> show msg {- | Newtype wrapper for deriving @PConstant@ when the wrapped type is directly represented by a builtin UPLC type that is /not/ @Data@. diff --git a/Plutarch/Rec.hs b/Plutarch/Rec.hs deleted file mode 100644 index 6059c754d..000000000 --- a/Plutarch/Rec.hs +++ /dev/null @@ -1,244 +0,0 @@ -{-# LANGUAGE DefaultSignatures #-} - -module Plutarch.Rec ( - DataReader (DataReader, readData), - DataWriter (DataWriter, writeData), - PRecord (PRecord, getRecord), - ScottEncoded, - ScottEncoding, - RecordFromData (fieldFoci, fieldListFoci), - field, - fieldFromData, - letrec, - pletrec, - rcon, - recordDataFromFieldWriters, - recordFromFieldReaders, - rmatch, -) where - -import Control.Monad.Trans.State.Lazy (State, evalState, get, put) -import Data.Functor.Compose (Compose (Compose, getCompose)) -import Data.Kind (Type) -import Data.Monoid (Dual (Dual, getDual), Endo (Endo, appEndo), Sum (Sum, getSum)) -import GHC.Word (Word64) -import Plutarch ( - PlutusType (PInner, pcon', pmatch'), - pcon, - phoistAcyclic, - plam, - plet, - pmatch, - (#), - (:-->), - ) -import Plutarch.Bool (pif, (#==)) -import Plutarch.Builtin (PAsData, PBuiltinList, PData, pasConstr, pforgetData, pfstBuiltin, psndBuiltin) -import Plutarch.Integer (PInteger) -import Plutarch.Internal ( - PType, - RawTerm (RApply, RLamAbs, RVar), - Term (Term, asRawTerm), - TermResult (TermResult, getDeps, getTerm), - mapTerm, - ) -import Plutarch.List (pcons, phead, pnil, ptail) -import Plutarch.Trace (ptraceError) -import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce) -import qualified PlutusCore as PLC -import qualified Rank2 - -newtype PRecord r s = PRecord {getRecord :: r (Term s)} - -type family ScottEncoded (r :: ((PType) -> Type) -> Type) (a :: PType) :: PType -newtype ScottArgument r s t = ScottArgument {getScott :: Term s (ScottEncoded r t)} -type ScottEncoding r t = ScottEncoded r t :--> t - -instance (Rank2.Distributive r, Rank2.Traversable r) => PlutusType (PRecord r) where - type PInner (PRecord r) t = ScottEncoding r t - pcon' :: forall s t. PRecord r s -> Term s (ScottEncoding r t) - pcon' (PRecord r) = rcon r - pmatch' :: forall s t. (Term s (ScottEncoding r t)) -> (PRecord r s -> Term s t) -> Term s t - pmatch' p f = rmatch p (f . PRecord) - --- | Convert a Haskell record value to a Scott-encoded record. -rcon :: forall r s t. Rank2.Foldable r => r (Term s) -> Term s (ScottEncoding r t) -rcon r = plam (\f -> punsafeCoerce $ appEndo (getDual $ Rank2.foldMap (Dual . Endo . applyField) r) f) - where - applyField x f = punsafeCoerce f # x - --- | Match a Scott-encoded record using a function that takes a Haskell record value. -rmatch :: - forall r s t. - (Rank2.Distributive r, Rank2.Traversable r) => - (Term s (ScottEncoding r t)) -> - (r (Term s) -> Term s t) -> - Term s t -rmatch p f = p # arg - where - arg :: Term s (ScottEncoded r t) - arg = Term (\i -> TermResult (RLamAbs (fieldCount (initial @r) - 1) $ rawArg i) []) - rawArg :: Word64 -> RawTerm - rawArg depth = getTerm $ asRawTerm (f $ variables depth) $ depth + fieldCount (initial @r) - --- | Wrapped recursive let construct, tying into knot the recursive equations specified in the record fields. -pletrec :: forall r s. (Rank2.Distributive r, Rank2.Traversable r) => (r (Term s) -> r (Term s)) -> Term s (PRecord r) -pletrec = punsafeCoerce . letrec - --- | Recursive let construct, tying into knot the recursive equations specified in the record fields. -letrec :: - forall r s t. - (Rank2.Distributive r, Rank2.Traversable r) => - (r (Term s) -> r (Term s)) -> - Term s (ScottEncoding r t) -letrec r = Term term - where - term n = TermResult {getTerm = RApply rfix [RLamAbs 1 $ RApply (RVar 0) $ rawTerms], getDeps = deps} - where - (Dual rawTerms, deps) = Rank2.foldMap (rawResult . ($ n + 2) . asRawTerm) (r selfReferring) - selfReferring = Rank2.fmap fromRecord accessors - fromRecord :: ScottArgument r s a -> Term s a - fromRecord (ScottArgument (Term access)) = - Term $ \depth -> mapTerm (\field -> RApply (RVar $ depth - n - 1) [field]) (access 0) - rawResult TermResult {getTerm, getDeps} = (Dual [getTerm], getDeps) - --- | Converts a Haskell field function to a Scott-encoded record field accessor. -field :: - forall r s t. - (Rank2.Distributive r, Rank2.Traversable r) => - (r (ScottArgument r s) -> ScottArgument r s t) -> - Term s (ScottEncoded r t) -field f = getScott (f accessors) - --- | Provides a record of function terms that access each field out of a Scott-encoded record. -accessors :: forall r s. (Rank2.Distributive r, Rank2.Traversable r) => r (ScottArgument r s) -accessors = abstract Rank2.<$> variables 0 - where - abstract :: Term s a -> ScottArgument r s a - abstract (Term t) = ScottArgument (phoistAcyclic $ Term $ mapTerm (RLamAbs $ depth - 1) . t . (depth +)) - depth = fieldCount (initial @r) - -{- | A record of terms that each accesses a different variable in scope, - outside in following the field order. --} -variables :: forall r s. (Rank2.Distributive r, Rank2.Traversable r) => Word64 -> r (Term s) -variables baseDepth = Rank2.cotraverse var id - where - var :: (r (Term s) -> Term s a) -> Term s a - var ref = ref ordered - ordered :: r (Term s) - ordered = evalState (Rank2.traverse next $ initial @r) 0 - next :: f a -> State Word64 (Term s a) - next _ = do - i <- get - let i' = succ i - seq i' (put i') - return $ - Term $ - \depth -> - TermResult - { getTerm = RVar (depth - baseDepth - i') - , getDeps = [] - } - -newtype DataReader s a = DataReader {readData :: Term s (PAsData a) -> Term s a} -newtype DataWriter s a = DataWriter {writeData :: Term s a -> Term s (PAsData a)} -newtype FocusFromData s a b = FocusFromData {getFocus :: Term s (PAsData a :--> PAsData b)} -newtype FocusFromDataList s a = FocusFromDataList {getItem :: Term s (PBuiltinList PData) -> Term s (PAsData a)} - -{- | Converts a record of field DataReaders to a DataReader of the whole - record. If you only need a single field or two, use `fieldFromData` - instead. --} -recordFromFieldReaders :: - forall r s. - (Rank2.Apply r, RecordFromData r) => - r (DataReader s) -> - DataReader s (PRecord r) -recordFromFieldReaders reader = DataReader $ verifySoleConstructor readRecord - where - readRecord :: Term s (PBuiltinList PData) -> Term s (PRecord r) - readRecord dat = pcon $ PRecord $ Rank2.liftA2 (flip readData . getCompose) (fields dat) reader - fields :: Term s (PBuiltinList PData) -> r (Compose (Term s) PAsData) - fields bis = (\f -> Compose $ getItem f bis) Rank2.<$> fieldListFoci - -recordDataFromFieldWriters :: - forall r s. - (Rank2.Apply r, RecordFromData r) => - r (DataWriter s) -> - DataWriter s (PRecord r) -recordDataFromFieldWriters writer = DataWriter (`pmatch` writeRecord) - where - writeRecord :: PRecord r s -> Term s (PAsData (PRecord r)) - writeRecord (PRecord r) = - punsafeBuiltin PLC.ConstrData # (0 :: Term s PInteger) - # appEndo (Rank2.foldMap (Endo . consField) (Rank2.liftA2 writeField writer r)) pnil - consField :: Compose (Term s) PAsData a -> Term s (PBuiltinList PData) -> Term s (PBuiltinList PData) - consField (Compose h) t = pcons # pforgetData h # t - writeField :: DataWriter s a -> Term s a -> Compose (Term s) PAsData a - writeField w r = Compose (writeData w r) - -{- | Converts a Haskell field function to a function term that extracts the 'Data' encoding of the field from the - encoding of the whole record. If you need to access most of the record fields, it's more efficient to decode the - entire record at once with `recordFromFieldReaders`. --} -fieldFromData :: - RecordFromData r => - (r (FocusFromData s (PRecord r)) -> FocusFromData s (PRecord r) t) -> - Term s (PAsData (PRecord r) :--> PAsData t) -fieldFromData f = getFocus (f fieldFoci) - -{- | Instances of this class must know how to focus on individual fields of - the data-encoded record. If the declared order of the record fields doesn't - match the encoding order, you must override the method defaults. --} -class (Rank2.Distributive r, Rank2.Traversable r) => RecordFromData r where - -- | Given the encoding of the whole record, every field focuses on its own encoding. - fieldFoci :: r (FocusFromData s (PRecord r)) - - -- | Given the encoding of the list of all fields, every field focuses on its own encoding. - fieldListFoci :: r (FocusFromDataList s) - - fieldFoci = Rank2.cotraverse focus id - where - focus :: (r (FocusFromData s (PRecord r)) -> FocusFromData s (PRecord r) a) -> FocusFromData s (PRecord r) a - focus ref = ref foci - foci :: r (FocusFromData s (PRecord r)) - foci = fieldsFromRecord Rank2.<$> fieldListFoci - fieldsFromRecord :: FocusFromDataList s a -> FocusFromData s (PRecord r) a - fieldsFromRecord (FocusFromDataList f) = FocusFromData $ plam $ verifySoleConstructor f - fieldListFoci = Rank2.cotraverse focus id - where - focus :: (r (FocusFromDataList s) -> FocusFromDataList s a) -> FocusFromDataList s a - focus ref = ref foci - foci :: r (FocusFromDataList s) - foci = evalState (Rank2.traverse next $ initial @r) id - next :: f a -> State (Term s (PBuiltinList PData) -> Term s (PBuiltinList PData)) (FocusFromDataList s a) - next _ = do - rest <- get - put ((ptail #) . rest) - return $ FocusFromDataList (punsafeCoerce . (phead #) . rest) - -verifySoleConstructor :: (Term s (PBuiltinList PData) -> Term s a) -> (Term s (PAsData (PRecord r)) -> Term s a) -verifySoleConstructor f d = - plet (pasConstr # pforgetData d) $ \constr -> - pif - (pfstBuiltin # constr #== 0) - (f $ psndBuiltin # constr) - (ptraceError "verifySoleConstructor failed") - -initial :: Rank2.Distributive r => r (Compose Maybe (Term s)) -initial = Rank2.distribute Nothing - -fieldCount :: Rank2.Foldable r => r f -> Word64 -fieldCount = getSum . Rank2.foldMap (const $ Sum 1) - --- | The raw Y-combinator term -rfix :: RawTerm --- The simplest variant of the Y combinator hangs the interpreter, so we use an eta-expanded version instead. --- rfix = RLamAbs 0 $ RApply (RLamAbs 0 $ RApply (RVar 1) [RApply (RVar 0) [RVar 0]]) [RLamAbs 0 $ RApply (RVar 1) [RApply (RVar 0) [RVar 0]]] -rfix = - RLamAbs 0 $ - RApply - (RLamAbs 0 $ RApply (RVar 1) [RLamAbs 0 $ RApply (RVar 1) [RVar 0, RVar 1]]) - [RLamAbs 0 $ RApply (RVar 1) [RLamAbs 0 $ RApply (RVar 1) [RVar 0, RVar 1]]] diff --git a/Plutarch/Rec/TH.hs b/Plutarch/Rec/TH.hs deleted file mode 100644 index bd7461ec4..000000000 --- a/Plutarch/Rec/TH.hs +++ /dev/null @@ -1,60 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE TemplateHaskell #-} - -module Plutarch.Rec.TH (deriveAll, deriveScottEncoded) where - -import Language.Haskell.TH (Q) -import qualified Language.Haskell.TH as TH -import Plutarch ((:-->)) -import Plutarch.Rec (PRecord, ScottEncoded) -import qualified Rank2.TH - --- | Use as a TH splice for all necessary @instance@ declarations. -deriveAll :: TH.Name -> Q [TH.Dec] -deriveAll name = (<>) <$> deriveScottEncoded name <*> Rank2.TH.deriveAll name - --- | Use as a TH splice for @type instance ScottEncoded@ declarations. -deriveScottEncoded :: TH.Name -> Q [TH.Dec] -deriveScottEncoded name = do - (con, tyVars) <- reifyConstructor name - a <- TH.newName "a" - let qa = pure (TH.VarT a) - ty = foldl apply (TH.conT name) (init tyVars) - apply t v = TH.appT t (TH.varT v) - - [d|type instance ScottEncoded $ty $qa = $(genScottEncoded con qa)|] - -genScottEncoded :: TH.Con -> Q TH.Type -> Q TH.Type -genScottEncoded (TH.InfixC (_, left) _name (_, right)) result = argType left (argType right result) -genScottEncoded (TH.NormalC _name fields) result = foldr argType result (snd <$> fields) -genScottEncoded (TH.RecC _name fields) result = foldr argType result (fieldType <$> fields) - where - fieldType (_, _, t) = t -genScottEncoded _ _ = error "Can't encode GADTs" - -argType :: TH.Type -> Q TH.Type -> Q TH.Type -argType (TH.AppT (TH.VarT _) t) result = [t|$(bare t) :--> $result|] -argType (TH.AppT t (TH.VarT _)) result = [t|PRecord $(bare t) :--> $result|] -argType _ _ = error "Expected an HKD field type of form (f FieldType)" - -bare :: TH.Type -> Q TH.Type -bare (TH.SigT t _) = bare t -bare t = pure t - -#if MIN_VERSION_template_haskell(2,17,0) -bindingName :: TH.TyVarBndr flag -> TH.Name -bindingName (TH.PlainTV name _) = name -bindingName (TH.KindedTV name _ _) = name -#else -bindingName :: TH.TyVarBndr -> TH.Name -bindingName (TH.PlainTV name) = name -bindingName (TH.KindedTV name _) = name -#endif - -reifyConstructor :: TH.Name -> Q (TH.Con, [TH.Name]) -reifyConstructor ty = do - (TH.TyConI tyCon) <- TH.reify ty - case tyCon of - TH.DataD _ _nm tyVars _kind [c] _ -> return (c, bindingName <$> tyVars) - TH.NewtypeD _ _nm tyVars _kind c _ -> return (c, bindingName <$> tyVars) - _ -> fail "Expected a single-constructor data or newtype" diff --git a/Plutarch/TermCont.hs b/Plutarch/TermCont.hs index c446c7b08..38cddd850 100644 --- a/Plutarch/TermCont.hs +++ b/Plutarch/TermCont.hs @@ -10,7 +10,18 @@ module Plutarch.TermCont ( import Data.Kind (Type) import Data.String (fromString) -import Plutarch.Internal (Dig, PType, S, Term (Term), asRawTerm, getTerm, hashRawTerm) +import Plutarch.Internal ( + Dig, + PType, + S, + Term (Term), + asRawTerm, + getTerm, + hashRawTerm, + pgetConfig, + tracingMode, + pattern DetTracing, + ) import Plutarch.Trace (ptraceError) newtype TermCont :: forall (r :: PType). S -> Type -> Type where @@ -38,12 +49,14 @@ instance Monad (TermCont s) where instance MonadFail (TermCont s) where fail s = TermCont $ \_ -> - ptraceError $ fromString s + pgetConfig \c -> case tracingMode c of + DetTracing -> ptraceError "Pattern matching failure in TermCont" + _ -> ptraceError $ fromString s tcont :: ((a -> Term s r) -> Term s r) -> TermCont @r s a tcont = TermCont hashOpenTerm :: Term s a -> TermCont s Dig -hashOpenTerm x = TermCont $ \f -> Term $ \i -> - let inner = f $ hashRawTerm . getTerm $ asRawTerm x i - in asRawTerm inner i +hashOpenTerm x = TermCont $ \f -> Term $ \i -> do + y <- asRawTerm x i + asRawTerm (f . hashRawTerm . getTerm $ y) i diff --git a/Plutarch/Trace.hs b/Plutarch/Trace.hs index 795b7c1b2..bfcb24f8f 100644 --- a/Plutarch/Trace.hs +++ b/Plutarch/Trace.hs @@ -11,67 +11,45 @@ module Plutarch.Trace ( -- CPP support isn't great in fourmolu. {- ORMOLU_DISABLE -} -import Plutarch.Internal.Other (Term, perror) -#ifdef Development -import Plutarch.Internal.Other (type (:-->), (#), phoistAcyclic, plet, pforce, pdelay) -#endif -#ifdef Development +import Plutarch.Internal.Other (Term, perror, type (:-->), (#), phoistAcyclic, plet, pforce, pdelay, + tracingMode, + pattern NoTracing, pgetConfig) import Plutarch.Bool (PBool, pif) -#else -import Plutarch.Bool (PBool) -#endif import Plutarch.String (PString) -#ifdef Development import Plutarch.Show (PShow, pshow) -#else -import Plutarch.Show (PShow) -#endif -#ifdef Development + import Plutarch.Unsafe (punsafeBuiltin) import qualified PlutusCore as PLC -#endif -#ifdef Development ptrace' :: Term s (PString :--> a :--> a) ptrace' = phoistAcyclic $ pforce $ punsafeBuiltin PLC.Trace -#endif -- | Trace the given message before evaluating the argument. ptrace :: Term s PString -> Term s a -> Term s a -#ifdef Development -ptrace s a = pforce $ ptrace' # s # pdelay a -#else -ptrace _ a = a -#endif +ptrace s a = pgetConfig \c -> case tracingMode c of + NoTracing -> a + _ -> pforce $ ptrace' # s # pdelay a -- | Like Haskell's `traceShowId` but for Plutarch ptraceShowId :: PShow a => Term s a -> Term s a -#ifdef Development -ptraceShowId x = ptrace (pshow x) x -#else -ptraceShowId a = a -#endif +ptraceShowId a = pgetConfig \c -> case tracingMode c of + NoTracing -> a + _ -> ptrace (pshow a) a -- | Trace the given message and terminate evaluation with a 'perror'. ptraceError :: Term s PString -> Term s a -#ifdef Development -ptraceError s = pforce $ ptrace' # s # pdelay perror -#else -ptraceError _ = perror -#endif +ptraceError s = pgetConfig \c -> case tracingMode c of + NoTracing -> perror + _ -> pforce $ ptrace' # s # pdelay perror -- | Trace the given message if the argument evaluates to true. ptraceIfTrue :: Term s PString -> Term s PBool -> Term s PBool -#ifdef Development -ptraceIfTrue s a' = plet a' $ \a -> pif a (ptrace' # s # a) a -#else -ptraceIfTrue _ a = a -#endif +ptraceIfTrue s a' = pgetConfig \c -> case tracingMode c of + NoTracing -> a' + _ -> plet a' $ \a -> pif a (ptrace' # s # a) a -- | Trace the given message if the argument evaluates to False. ptraceIfFalse :: Term s PString -> Term s PBool -> Term s PBool -#ifdef Development -ptraceIfFalse s a' = plet a' $ \a -> pif a a (ptrace' # s # a) -#else -ptraceIfFalse _ a = a -#endif +ptraceIfFalse s a' = pgetConfig \c -> case tracingMode c of + NoTracing -> a' + _ -> plet a' $ \a -> pif a a (ptrace' # s # a) diff --git a/bin/format b/bin/format index f65deafe2..24b0d552a 100755 --- a/bin/format +++ b/bin/format @@ -2,6 +2,6 @@ set -xe -find -type f -name '*.hs' ! -path '*/dist-newstyle/*' ! -path '*/tmp/*' | xargs fourmolu -o-XTypeApplications -o-XQualifiedDo -o-XOverloadedRecordDot -m inplace +find -type f -name '*.hs' ! -path '*/dist-newstyle/*' ! -path '*/tmp/*' | xargs fourmolu -o-XTypeApplications -o-XQualifiedDo -o-XOverloadedRecordDot -o-XNondecreasingIndentation -o-XPatternSynonyms -m inplace find -type f -name '*.cabal' | xargs cabal-fmt -i nixpkgs-fmt *.nix diff --git a/flake.nix b/flake.nix index 6d51ead86..642a5956d 100644 --- a/flake.nix +++ b/flake.nix @@ -346,18 +346,12 @@ ); }; - projectForGhc = compiler-nix-name: flagDevelopment: system: + projectForGhc = compiler-nix-name: system: let pkgs = pkgsFor system; in let pkgs' = pkgsFor' system; in let pkgSet = pkgs.haskell-nix.cabalProject' (applyPlutarchDep pkgs { src = ./.; inherit compiler-nix-name; - modules = [ - { - packages.plutarch-test.flags.development = flagDevelopment; - packages.plutarch.flags.development = flagDevelopment; - } - ]; shell = { withHoogle = true; @@ -495,21 +489,15 @@ # Build matrix. Plutarch is built against different GHC versions, and 'development' flag. projectMatrix = { - ghc9 = { - nodev = perSystem (system: (projectFor false system)); - dev = perSystem (system: (projectFor true system)); - }; - ghc810 = { - nodev = perSystem (system: (projectFor810 false system)); - dev = perSystem (system: (projectFor810 true system)); - }; + ghc9 = perSystem projectFor; + ghc810 = perSystem projectFor810; }; # Default build configuration. - project = self.projectMatrix.ghc9.nodev; + project = self.projectMatrix.ghc9; flake = perSystem (system: self.project.${system}.flake { }); - haddockProject = perSystem (projectFor false); + haddockProject = self.project; packages = perSystem (system: self.flake.${system}.packages // { haddock = haddock system; @@ -520,12 +508,10 @@ self.flake.${system}.checks // { formatCheck = formatCheckFor system; - test-ghc9-nodev = flakeApp2Derivation system "test-ghc9-nodev"; - test-ghc9-dev = flakeApp2Derivation system "test-ghc9-dev"; - test-ghc810-nodev = flakeApp2Derivation system "test-ghc810-nodev"; - test-ghc810-dev = flakeApp2Derivation system "test-ghc810-dev"; - "ghc810-plutarch:lib:plutarch" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch:lib:plutarch"; - "ghc810-plutarch:lib:plutarch-test" = (self.projectMatrix.ghc810.nodev.${system}.flake { }).packages."plutarch-test:lib:plutarch-test"; + test-ghc9 = flakeApp2Derivation system "test-ghc9"; + test-ghc810 = flakeApp2Derivation system "test-ghc810"; + "ghc810-plutarch:lib:plutarch" = (self.projectMatrix.ghc810.${system}.flake { }).packages."plutarch:lib:plutarch"; + "ghc810-plutarch:lib:plutarch-test" = (self.projectMatrix.ghc810.${system}.flake { }).packages."plutarch-test:lib:plutarch-test"; hls = checkedShellScript system "hls" "${self.project.${system}.pkgs.haskell-language-server}/bin/haskell-language-server"; }); # Because `nix flake check` does not work with haskell.nix (due to IFD), @@ -544,10 +530,8 @@ apps = perSystem (system: self.flake.${system}.apps // { - test-ghc9-nodev = plutarchTestApp system "ghc9-nodev" self.projectMatrix.ghc9.nodev; - test-ghc9-dev = plutarchTestApp system "ghc9-dev" self.projectMatrix.ghc9.dev; - test-ghc810-nodev = plutarchTestApp system "ghc810-nodev" self.projectMatrix.ghc810.nodev; - test-ghc810-dev = plutarchTestApp system "ghc810-dev" self.projectMatrix.ghc810.dev; + test-ghc9 = plutarchTestApp system "ghc9" self.projectMatrix.ghc9; + test-ghc810 = plutarchTestApp system "ghc810" self.projectMatrix.ghc810; # `nix run .#docs` should be run from the Git repo. docs = plutarchWebsiteLive system "./docs"; diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index 3e575b42d..9d2ae2137 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -41,8 +41,9 @@ module Plutarch.Test ( ) where import Data.Text (Text) +import qualified Data.Text as T -import Plutarch (ClosedTerm, PCon (pcon), compile, printScript) +import Plutarch (ClosedTerm, Config (Config, tracingMode), PCon (pcon), compile, printScript, pattern DetTracing) import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evalScript) import Plutarch.Test.Benchmark ( @@ -67,13 +68,16 @@ import qualified PlutusLedgerApi.V1.Scripts as Scripts import Test.Hspec (Expectation, Spec, describe, expectationFailure, shouldBe, shouldSatisfy) import Test.Tasty.HUnit (assertFailure) +comp :: ClosedTerm a -> Scripts.Script +comp t = either (error . T.unpack) id $ compile (Config {tracingMode = DetTracing}) t + {- | Like `shouldBe` but but for Plutarch terms -} pshouldBe :: ClosedTerm a -> ClosedTerm b -> Expectation pshouldBe x y = do - p1 <- eval $ compile x - p2 <- eval $ compile y + p1 <- eval $ comp x + p2 <- eval $ comp y pscriptShouldBe p1 p2 where eval :: Scripts.Script -> IO Scripts.Script @@ -103,14 +107,14 @@ passertNot p = p #@?= pcon PFalse -- | Asserts the term evaluates successfully without failing psucceeds :: ClosedTerm a -> Expectation psucceeds p = - case evalScript (compile p) of + case evalScript $ comp p of (Left _, _, _) -> expectationFailure $ "Term failed to evaluate" (Right _, _, _) -> pure () -- | Asserts the term evaluates without success pfails :: ClosedTerm a -> Expectation pfails p = do - case evalScript (compile p) of + case evalScript $ comp p of (Left _, _, _) -> pure () (Right _, _, _) -> expectationFailure $ "Term succeeded" @@ -138,17 +142,10 @@ psatisfyWithinBenchmark bench maxBudget = do -} ptraces :: ClosedTerm a -> [Text] -> Expectation ptraces p develTraces = - case evalScript (compile p) of + case evalScript $ comp p of (Left _, _, _) -> expectationFailure $ "Term failed to evaluate" (Right _, _, traceLog) -> do -#ifdef Development traceLog `shouldBe` develTraces -#else - -- Tracing is disabled in non-developed modes, so we should expect an - -- empty trace log. - let noTraces = const [] develTraces - traceLog `shouldBe` noTraces -#endif {- | Like `describe`, but determines description from `Development` CPP flag @@ -159,21 +156,13 @@ ptraces p develTraces = Typically meant to be used in conjunction with `ptraces`. -} plutarchDevFlagDescribe :: Spec -> Spec - --- CPP support isn't great in fourmolu. -{- ORMOLU_DISABLE -} plutarchDevFlagDescribe m = -#ifdef Development describe "dev=true" m -#else - describe "dev=false" m -#endif -{- ORMOLU_ENABLE -} -- | Test that the Plutarch program evaluates to the given term (@==) :: ClosedTerm a -> ClosedTerm b -> TermExpectation a (@==) p x = p @:-> \(_, script, _) -> script `pscriptShouldBe` xScript where - xScript = fst . evalScriptAlwaysWithBenchmark $ compile x + xScript = fst . evalScriptAlwaysWithBenchmark $ comp x infixr 1 @== diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 19ad7d2a4..5e0fb7774 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -46,7 +46,7 @@ import Test.Hspec.Golden import qualified Data.List.NonEmpty as NE import Data.Set (Set) import qualified Data.Set as S -import Plutarch (compile, printScript) +import Plutarch (Config (Config, tracingMode), compile, printScript, pattern DetTracing) import Plutarch.Evaluate (evalScript) import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Prelude @@ -276,12 +276,10 @@ evalScriptAlwaysWithBenchmark script = let (res, exbudget, _traces) = evalScript script bench = mkBenchmark exbudget (scriptSize script) in ( case res of - Left _ -> compile perror + Left _ -> either undefined id $ compile (Config {tracingMode = DetTracing}) perror Right x -> x , bench ) --- TODO: Make this deterministic --- See https://github.com/Plutonomicon/plutarch/pull/297 compileD :: ClosedTerm a -> Scripts.Script -compileD = compile +compileD t = either (error . T.unpack) id $ compile (Config {tracingMode = DetTracing}) t diff --git a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs index 7d5adb4e2..4708fb1a3 100644 --- a/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs +++ b/plutarch-test/common/Plutarch/Test/Property/HaskEquiv.hs @@ -30,12 +30,13 @@ import Control.Exception (SomeException, evaluate, try) import Control.Monad.IO.Class (liftIO) import Data.SOP (NP (Nil, (:*))) import Data.Text (Text) +import qualified Data.Text as T import Hedgehog (Gen, Property, PropertyT, annotate, annotateShow, assert, forAll, property, (===)) import PlutusCore.Evaluation.Machine.ExBudget (ExBudget (ExBudget)) import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) import PlutusLedgerApi.V1.Scripts (Script (Script, unScript)) -import Plutarch (compile) +import Plutarch (Config (Config, tracingMode), compile, pattern DetTracing) import Plutarch.Evaluate (EvalError, evalScript') import Plutarch.Prelude import Plutarch.Test.Property.Marshal (Marshal (marshal)) @@ -176,7 +177,7 @@ pshouldBe x y = _ -> assert False run :: ClosedTerm h -> (Either EvalError Script, ExBudget, [Text]) -run t = evalScriptHugeBudget $ compile t +run t = evalScriptHugeBudget $ either (error . T.unpack) id $ compile (Config {tracingMode = DetTracing}) t {- | A more suitable version of `evalScript` geared towards property tests that can use lots of resources diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden b/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden deleted file mode 100644 index 1997f8efe..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.bench.golden +++ /dev/null @@ -1,4 +0,0 @@ -cont.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":290} -cont.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":286} -termcont.succeeds {"exBudgetCPU":6217368,"exBudgetMemory":16009,"scriptSizeBytes":290} -termcont.fails {"exBudgetCPU":10465180,"exBudgetMemory":21069,"scriptSizeBytes":286} \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden deleted file mode 100644 index 0070757cf..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.uplc.eval.golden +++ /dev/null @@ -1,4 +0,0 @@ -cont.succeeds (program 1.0.0 ()) -cont.fails (program 1.0.0 error) -termcont.succeeds (program 1.0.0 ()) -termcont.fails (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden b/plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden deleted file mode 100644 index 7745ac73b..000000000 --- a/plutarch-test/goldens/api.example.signatory.dev=false.uplc.golden +++ /dev/null @@ -1,4 +0,0 @@ -cont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -cont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) ((\i0 -> unListData (i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1)))) (i8 i4))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -termcont.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #ab01fe235c #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -termcont.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay (force (i7 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay False) (delay (force (i10 (equalsData (i11 i1) i3) (delay True) (delay (i2 (i12 i1))))))))) (bData i6) (unListData ((\i0 -> i9 ((\i0 -> i11 (i11 (i11 (i11 (i11 (i11 (i11 i1))))))) (i11 i1))) (i8 i4)))) (delay ()) (delay error)))) (delay error))) (i10 i2)) (force (force fstPair) i1)) (unConstrData (i5 (i6 i1)))) (i6 i1)) #41 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index 79f29f880..a427678fd 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -5,7 +5,7 @@ lookupData.hit {"exBudgetCPU":3692245,"exBudgetMemory":9090,"scriptSizeBytes":11 lookupData.miss {"exBudgetCPU":4325532,"exBudgetMemory":11122,"scriptSizeBytes":121} findWithDefault.itself {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":78} findWithDefault.hit {"exBudgetCPU":4097533,"exBudgetMemory":10354,"scriptSizeBytes":117} -findWithDefault.hit2 {"exBudgetCPU":14526543,"exBudgetMemory":38032,"scriptSizeBytes":340} +findWithDefault.hit2 {"exBudgetCPU":14457543,"exBudgetMemory":37732,"scriptSizeBytes":324} findWithDefault.miss {"exBudgetCPU":4532532,"exBudgetMemory":12022,"scriptSizeBytes":125} singleton {"exBudgetCPU":742104,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":604104,"exBudgetMemory":2228,"scriptSizeBytes":34} @@ -19,10 +19,10 @@ delete.old {"exBudgetCPU":7780191,"exBudgetMemory":25178,"scriptSizeBytes":204} difference.emptyLeft {"exBudgetCPU":2067458,"exBudgetMemory":7860,"scriptSizeBytes":162} difference.emptyRight {"exBudgetCPU":4494995,"exBudgetMemory":15848,"scriptSizeBytes":165} difference.emptyResult {"exBudgetCPU":7452717,"exBudgetMemory":22006,"scriptSizeBytes":179} -unionWith.const {"exBudgetCPU":9005337,"exBudgetMemory":28070,"scriptSizeBytes":260} -unionWith.double {"exBudgetCPU":9096814,"exBudgetMemory":27572,"scriptSizeBytes":255} -unionWith.(+) {"exBudgetCPU":8868040,"exBudgetMemory":27076,"scriptSizeBytes":262} -unionWith.flip (+) {"exBudgetCPU":8868040,"exBudgetMemory":27076,"scriptSizeBytes":262} -unionWithData.const {"exBudgetCPU":8572623,"exBudgetMemory":26474,"scriptSizeBytes":246} -unionWithData.emptyLeft {"exBudgetCPU":2757458,"exBudgetMemory":10860,"scriptSizeBytes":233} -unionWithData.emptyRight {"exBudgetCPU":4071736,"exBudgetMemory":15288,"scriptSizeBytes":233} \ No newline at end of file +unionWith.const {"exBudgetCPU":8867337,"exBudgetMemory":27470,"scriptSizeBytes":257} +unionWith.double {"exBudgetCPU":8958814,"exBudgetMemory":26972,"scriptSizeBytes":253} +unionWith.(+) {"exBudgetCPU":8730040,"exBudgetMemory":26476,"scriptSizeBytes":260} +unionWith.flip (+) {"exBudgetCPU":8730040,"exBudgetMemory":26476,"scriptSizeBytes":260} +unionWithData.const {"exBudgetCPU":8434623,"exBudgetMemory":25874,"scriptSizeBytes":244} +unionWithData.emptyLeft {"exBudgetCPU":2619458,"exBudgetMemory":10260,"scriptSizeBytes":231} +unionWithData.emptyRight {"exBudgetCPU":3933736,"exBudgetMemory":14688,"scriptSizeBytes":231} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index 7fdd69114..12bf60781 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -5,7 +5,7 @@ lookupData.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i lookupData.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData #6e6f6b6579) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) findWithDefault.itself (program 1.0.0 ((\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) (force headList))) findWithDefault.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 i2 ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) -findWithDefault.hit2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i14 (i15 i1)) i6) (delay (i4 (i10 (i15 i1)))) (delay (i2 (i13 i1)))))))) i1) (bData i1) i2 unIData) 12 i13 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i15 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i14 i6) (i14 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i15 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i23 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i9 #6b6579 42) (i9 i13 6))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6e65776b6579)) +findWithDefault.hit2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i5) (delay (force (i12 (equalsData (i14 (i15 i1)) i6) (delay (i4 (i11 (i15 i1)))) (delay (i2 (i13 i1)))))))) i1) (bData i1) i2 unIData) 12 i12 ((\i0 -> (\i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i10 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i16 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i15 i6) (i15 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i17 i4)))) (delay (force (i16 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i17 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i8 #6b6579 42) (i8 i12 6))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6e65776b6579)) findWithDefault.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) @@ -19,10 +19,10 @@ delete.old (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (bData i1)) (unBData (i7 (i8 i2))) (i10 (i8 i2) i1) (\i0 -> i2) i4) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i15 (i16 i1)) i6) (delay (i4 (force (force sndPair) (i16 i1)))) (delay (i2 (i17 i1)))))))) i1) (bData i1)) (unBData (i8 (i9 i2))) (i11 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i15 (i16 i1)) i6) (delay (i4 (force (force sndPair) (i16 i1)))) (delay (i2 (i17 i1)))))))) i1) (bData i1)) (unBData (i8 (i9 i2))) (i13 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i15 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i14 i6) (i14 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i15 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i23 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i22 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i22 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 #6b6579 42) (i9 #6e65776b6579 6)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWith.flip (+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i22 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i9 #6e65776b6579 6) (i9 #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i22 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> i2) (i9 i13 42) (i9 i13 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i20 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> i2) i10 ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (force mkCons)) [ ])) -unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i20 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i13 (mkPairData i2 i1) i14) (bData i2) (iData i1)) #6b6579 42) i10) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (force mkCons)) [ ])) \ No newline at end of file +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i15 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i11 (i14 i6) (i14 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i16 i4)))) (delay (force (i15 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i16 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i7 i11 42) (i7 i11 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i7 i11 42) (i7 i11 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i7 #6b6579 42) (i7 #6e65776b6579 6)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.flip (+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i7 #6e65776b6579 6) (i7 #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> i2) (i7 i11 42) (i7 i11 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i15 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i18 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i18 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i18 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> i2) i8 ((\i0 -> \i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i2) (iData i1)) #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (force mkCons)) [ ])) +unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i15 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i18 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i18 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i18 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i2) (iData i1)) #6b6579 42) i8) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=false.bench.golden b/plutarch-test/goldens/api.value.dev=false.bench.golden deleted file mode 100644 index 3372e12b3..000000000 --- a/plutarch-test/goldens/api.value.dev=false.bench.golden +++ /dev/null @@ -1,89 +0,0 @@ -singleton {"exBudgetCPU":1708940,"exBudgetMemory":6256,"scriptSizeBytes":68} -singletonData {"exBudgetCPU":3189793,"exBudgetMemory":7490,"scriptSizeBytes":80} -valueOf.itself {"exBudgetCPU":851100,"exBudgetMemory":3800,"scriptSizeBytes":115} -valueOf.applied {"exBudgetCPU":8887341,"exBudgetMemory":23308,"scriptSizeBytes":183} -valueOf.growing.1 {"exBudgetCPU":6189368,"exBudgetMemory":18450,"scriptSizeBytes":193} -valueOf.growing.2 {"exBudgetCPU":21178115,"exBudgetMemory":61340,"scriptSizeBytes":420} -valueOf.growing.3 {"exBudgetCPU":32067961,"exBudgetMemory":90246,"scriptSizeBytes":451} -valueOf.growing.4 {"exBudgetCPU":46575107,"exBudgetMemory":126312,"scriptSizeBytes":470} -valueOf.growing.5 {"exBudgetCPU":65044553,"exBudgetMemory":171038,"scriptSizeBytes":488} -valueOf.growing.6 {"exBudgetCPU":87476299,"exBudgetMemory":224424,"scriptSizeBytes":506} -valueOf.growing.7 {"exBudgetCPU":113870345,"exBudgetMemory":286470,"scriptSizeBytes":525} -valueOf.growing.8 {"exBudgetCPU":144226691,"exBudgetMemory":357176,"scriptSizeBytes":543} -valueOf.growing.9 {"exBudgetCPU":181299724,"exBudgetMemory":441700,"scriptSizeBytes":561} -valueOf.growing.10 {"exBudgetCPU":217162596,"exBudgetMemory":525796,"scriptSizeBytes":579} -valueOf.growing.11 {"exBudgetCPU":256987768,"exBudgetMemory":618552,"scriptSizeBytes":597} -valueOf.growing.12 {"exBudgetCPU":300775240,"exBudgetMemory":719968,"scriptSizeBytes":616} -valueOf.growing.13 {"exBudgetCPU":348525012,"exBudgetMemory":830044,"scriptSizeBytes":634} -valueOf.growing.14 {"exBudgetCPU":400237084,"exBudgetMemory":948780,"scriptSizeBytes":652} -valueOf.growing.15 {"exBudgetCPU":455911456,"exBudgetMemory":1076176,"scriptSizeBytes":671} -valueOf.growing.16 {"exBudgetCPU":515548128,"exBudgetMemory":1212232,"scriptSizeBytes":689} -valueOf.growing.17 {"exBudgetCPU":579147100,"exBudgetMemory":1356948,"scriptSizeBytes":708} -unionWith.const {"exBudgetCPU":17399570,"exBudgetMemory":52540,"scriptSizeBytes":318} -unionWith.(+).itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":232} -unionWith.(+).applied {"exBudgetCPU":17491047,"exBudgetMemory":52042,"scriptSizeBytes":314} -unionWith.tokens {"exBudgetCPU":17262429,"exBudgetMemory":51546,"scriptSizeBytes":324} -unionWith.symbols {"exBudgetCPU":10801712,"exBudgetMemory":33932,"scriptSizeBytes":316} -unionWith.growing.1 {"exBudgetCPU":10870712,"exBudgetMemory":34232,"scriptSizeBytes":320} -unionWith.growing.2 {"exBudgetCPU":25790459,"exBudgetMemory":76822,"scriptSizeBytes":354} -unionWith.growing.3 {"exBudgetCPU":37948531,"exBudgetMemory":109258,"scriptSizeBytes":375} -unionWith.growing.4 {"exBudgetCPU":53999903,"exBudgetMemory":150054,"scriptSizeBytes":393} -unionWith.growing.5 {"exBudgetCPU":74013575,"exBudgetMemory":199510,"scriptSizeBytes":412} -unionWith.growing.6 {"exBudgetCPU":97989547,"exBudgetMemory":257626,"scriptSizeBytes":430} -unionWith.growing.7 {"exBudgetCPU":125927819,"exBudgetMemory":324402,"scriptSizeBytes":449} -unionWith.growing.8 {"exBudgetCPU":157828391,"exBudgetMemory":399838,"scriptSizeBytes":467} -unionWith.growing.9 {"exBudgetCPU":200277238,"exBudgetMemory":502148,"scriptSizeBytes":482} -unionWith.growing.10 {"exBudgetCPU":236140110,"exBudgetMemory":586244,"scriptSizeBytes":501} -unionWith.growing.11 {"exBudgetCPU":275965282,"exBudgetMemory":679000,"scriptSizeBytes":519} -unionWith.growing.12 {"exBudgetCPU":319752754,"exBudgetMemory":780416,"scriptSizeBytes":537} -unionWith.growing.13 {"exBudgetCPU":367502526,"exBudgetMemory":890492,"scriptSizeBytes":556} -unionWith.growing.14 {"exBudgetCPU":419214598,"exBudgetMemory":1009228,"scriptSizeBytes":574} -unionWith.growing.15 {"exBudgetCPU":474888970,"exBudgetMemory":1136624,"scriptSizeBytes":593} -unionWith.growing.16 {"exBudgetCPU":534525642,"exBudgetMemory":1272680,"scriptSizeBytes":611} -unionWith.growing.17 {"exBudgetCPU":598124614,"exBudgetMemory":1417396,"scriptSizeBytes":629} -unionWithData const.itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":222} -unionWithData const.applied {"exBudgetCPU":17035856,"exBudgetMemory":51244,"scriptSizeBytes":307} -inv {"exBudgetCPU":8006438,"exBudgetMemory":25962,"scriptSizeBytes":175} -equality.itself {"exBudgetCPU":644100,"exBudgetMemory":2900,"scriptSizeBytes":124} -equality.triviallyTrue {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.triviallyFalse {"exBudgetCPU":9153784,"exBudgetMemory":22936,"scriptSizeBytes":213} -equality.swappedTokensTrue {"exBudgetCPU":40395280,"exBudgetMemory":111744,"scriptSizeBytes":463} -equality.swappedSymbolsTrue {"exBudgetCPU":32532768,"exBudgetMemory":84404,"scriptSizeBytes":454} -equality.growing.1 {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.growing.2 {"exBudgetCPU":40357210,"exBudgetMemory":111744,"scriptSizeBytes":458} -equality.growing.3 {"exBudgetCPU":62002536,"exBudgetMemory":167484,"scriptSizeBytes":493} -equality.growing.4 {"exBudgetCPU":91572462,"exBudgetMemory":240544,"scriptSizeBytes":528} -equality.growing.5 {"exBudgetCPU":129066988,"exBudgetMemory":330924,"scriptSizeBytes":563} -equality.growing.6 {"exBudgetCPU":174486114,"exBudgetMemory":438624,"scriptSizeBytes":599} -equality.growing.7 {"exBudgetCPU":227829840,"exBudgetMemory":563644,"scriptSizeBytes":634} -equality.growing.8 {"exBudgetCPU":289098166,"exBudgetMemory":705984,"scriptSizeBytes":669} -equality.growing.9 {"exBudgetCPU":358291092,"exBudgetMemory":865644,"scriptSizeBytes":704} -equality.growing.10 {"exBudgetCPU":435408618,"exBudgetMemory":1042624,"scriptSizeBytes":740} -equality.growing.11 {"exBudgetCPU":520450744,"exBudgetMemory":1236924,"scriptSizeBytes":775} -equality.growing.12 {"exBudgetCPU":613417470,"exBudgetMemory":1448544,"scriptSizeBytes":810} -equality.growing.13 {"exBudgetCPU":714308796,"exBudgetMemory":1677484,"scriptSizeBytes":845} -equality.growing.14 {"exBudgetCPU":823124722,"exBudgetMemory":1923744,"scriptSizeBytes":881} -equality.growing.15 {"exBudgetCPU":939865248,"exBudgetMemory":2187324,"scriptSizeBytes":916} -equality.growing.16 {"exBudgetCPU":1064530374,"exBudgetMemory":2468224,"scriptSizeBytes":951} -equality.growing.17 {"exBudgetCPU":1197120100,"exBudgetMemory":2766444,"scriptSizeBytes":986} -normalize.identity {"exBudgetCPU":35595548,"exBudgetMemory":105757,"scriptSizeBytes":530} -normalize.empty {"exBudgetCPU":24172001,"exBudgetMemory":70961,"scriptSizeBytes":444} -assertSorted.succeeds {"exBudgetCPU":30100271,"exBudgetMemory":94582,"scriptSizeBytes":474} -assertSorted.fails on malsorted symbols {"exBudgetCPU":20493435,"exBudgetMemory":62258,"scriptSizeBytes":294} -assertSorted.fails on zero quantities {"exBudgetCPU":21608385,"exBudgetMemory":62128,"scriptSizeBytes":472} -assertSorted.fails on empty token map {"exBudgetCPU":1027897,"exBudgetMemory":423,"scriptSizeBytes":215} -Ada.adaSymbol {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} -Ada.adaToken {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} -Ada.lovelaceValueOf {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":53} -Ada.isAdaOnlyValue.itself {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":45} -Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":497454,"exBudgetMemory":1532,"scriptSizeBytes":50} -Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":4349105,"exBudgetMemory":10950,"scriptSizeBytes":107} -Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":13280877,"exBudgetMemory":37926,"scriptSizeBytes":351} -Ada.adaOnlyValue.itself {"exBudgetCPU":184100,"exBudgetMemory":900,"scriptSizeBytes":52} -Ada.adaOnlyValue.on empty {"exBudgetCPU":589454,"exBudgetMemory":1932,"scriptSizeBytes":51} -Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":4356574,"exBudgetMemory":10950,"scriptSizeBytes":109} -Ada.adaOnlyValue.on Ada {"exBudgetCPU":4287574,"exBudgetMemory":10650,"scriptSizeBytes":95} -Ada.noAdaValue.itself {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":37} -Ada.noAdaValue.on empty {"exBudgetCPU":497454,"exBudgetMemory":1532,"scriptSizeBytes":43} -Ada.noAdaValue.on non-Ada {"exBudgetCPU":4082014,"exBudgetMemory":10018,"scriptSizeBytes":100} -Ada.noAdaValue.on Ada {"exBudgetCPU":4013014,"exBudgetMemory":9718,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden deleted file mode 100644 index da2128aab..000000000 --- a/plutarch-test/goldens/api.value.dev=false.uplc.eval.golden +++ /dev/null @@ -1,220 +0,0 @@ -singleton (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -singletonData (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -valueOf.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1)) i2 0 unIData (unMapData i1)) i3)) -valueOf.applied (program 1.0.0 1) -valueOf.growing.1 (program 1.0.0 0) -valueOf.growing.2 (program 1.0.0 0) -valueOf.growing.3 (program 1.0.0 0) -valueOf.growing.4 (program 1.0.0 0) -valueOf.growing.5 (program 1.0.0 0) -valueOf.growing.6 (program 1.0.0 0) -valueOf.growing.7 (program 1.0.0 0) -valueOf.growing.8 (program 1.0.0 0) -valueOf.growing.9 (program 1.0.0 1) -valueOf.growing.10 (program 1.0.0 1) -valueOf.growing.11 (program 1.0.0 1) -valueOf.growing.12 (program 1.0.0 1) -valueOf.growing.13 (program 1.0.0 1) -valueOf.growing.14 (program 1.0.0 1) -valueOf.growing.15 (program 1.0.0 1) -valueOf.growing.16 (program 1.0.0 1) -valueOf.growing.17 (program 1.0.0 1) -unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) -unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) -unionWith.tokens (program 1.0.0 [(#41c0, #a24a6f74686572746f6b656e0149736f6d65746f6b656e01)]) -unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.1 (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.2 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.3 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.4 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.5 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.6 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.7 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.8 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -unionWith.growing.9 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) ]) -unionWith.growing.10 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c8, #a145746f6b656e01) ]) -unionWith.growing.11 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c8, #a145746f6b656e01) - , (#41c9, #a145746f6b656e01) ]) -unionWith.growing.12 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c8, #a145746f6b656e01) - , (#41c9, #a145746f6b656e01) - , (#41ca, #a145746f6b656e01) ]) -unionWith.growing.13 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c8, #a145746f6b656e01) - , (#41c9, #a145746f6b656e01) - , (#41ca, #a145746f6b656e01) - , (#41cb, #a145746f6b656e01) ]) -unionWith.growing.14 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c8, #a145746f6b656e01) - , (#41c9, #a145746f6b656e01) - , (#41ca, #a145746f6b656e01) - , (#41cb, #a145746f6b656e01) - , (#41cc, #a145746f6b656e01) ]) -unionWith.growing.15 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c8, #a145746f6b656e01) - , (#41c9, #a145746f6b656e01) - , (#41ca, #a145746f6b656e01) - , (#41cb, #a145746f6b656e01) - , (#41cc, #a145746f6b656e01) - , (#41cd, #a145746f6b656e01) ]) -unionWith.growing.16 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c8, #a145746f6b656e01) - , (#41c9, #a145746f6b656e01) - , (#41ca, #a145746f6b656e01) - , (#41cb, #a145746f6b656e01) - , (#41cc, #a145746f6b656e01) - , (#41cd, #a145746f6b656e01) - , (#41ce, #a145746f6b656e01) ]) -unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c1, #a145746f6b656e01) - , (#41c2, #a145746f6b656e01) - , (#41c3, #a145746f6b656e01) - , (#41c4, #a145746f6b656e01) - , (#41c5, #a145746f6b656e01) - , (#41c6, #a145746f6b656e01) - , (#41c7, #a249736f6d65746f6b656e0145746f6b656e01) - , (#41c8, #a145746f6b656e01) - , (#41c9, #a145746f6b656e01) - , (#41ca, #a145746f6b656e01) - , (#41cb, #a145746f6b656e01) - , (#41cc, #a145746f6b656e01) - , (#41cd, #a145746f6b656e01) - , (#41ce, #a145746f6b656e01) - , (#41cf, #a145746f6b656e01) ]) -unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) -unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -inv (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e20)]) -equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) -equality.triviallyTrue (program 1.0.0 True) -equality.triviallyFalse (program 1.0.0 False) -equality.swappedTokensTrue (program 1.0.0 True) -equality.swappedSymbolsTrue (program 1.0.0 True) -equality.growing.1 (program 1.0.0 True) -equality.growing.2 (program 1.0.0 True) -equality.growing.3 (program 1.0.0 True) -equality.growing.4 (program 1.0.0 True) -equality.growing.5 (program 1.0.0 True) -equality.growing.6 (program 1.0.0 True) -equality.growing.7 (program 1.0.0 True) -equality.growing.8 (program 1.0.0 True) -equality.growing.9 (program 1.0.0 True) -equality.growing.10 (program 1.0.0 True) -equality.growing.11 (program 1.0.0 True) -equality.growing.12 (program 1.0.0 True) -equality.growing.13 (program 1.0.0 True) -equality.growing.14 (program 1.0.0 True) -equality.growing.15 (program 1.0.0 True) -equality.growing.16 (program 1.0.0 True) -equality.growing.17 (program 1.0.0 True) -normalize.identity (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -normalize.empty (program 1.0.0 []) -assertSorted.succeeds (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) - , (#41c7, #a149736f6d65746f6b656e01) ]) -assertSorted.fails on malsorted symbols (program 1.0.0 error) -assertSorted.fails on zero quantities (program 1.0.0 error) -assertSorted.fails on empty token map (program 1.0.0 error) -Ada.adaSymbol (program 1.0.0 #) -Ada.adaToken (program 1.0.0 #) -Ada.lovelaceValueOf (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (unIData (force (force sndPair) (force headList (unMapData (force (force sndPair) (force headList i1)))))) 0))))) -Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #))))))) -Ada.isAdaOnlyValue.true on empty (program 1.0.0 True) -Ada.isAdaOnlyValue.trivially false (program 1.0.0 False) -Ada.isAdaOnlyValue.less trivially false (program 1.0.0 False) -Ada.adaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) ((\i0 -> force mkCons i1 [ ]) (force headList i1)) [ ]))))) -Ada.adaOnlyValue.on empty (program 1.0.0 []) -Ada.adaOnlyValue.on non-Ada (program 1.0.0 []) -Ada.adaOnlyValue.on Ada (program 1.0.0 [(#40, #a1401a00989680)]) -Ada.noAdaValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1))))) -Ada.noAdaValue.on empty (program 1.0.0 []) -Ada.noAdaValue.on non-Ada (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -Ada.noAdaValue.on Ada (program 1.0.0 []) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=false.uplc.golden b/plutarch-test/goldens/api.value.dev=false.uplc.golden deleted file mode 100644 index e3028ff49..000000000 --- a/plutarch-test/goldens/api.value.dev=false.uplc.golden +++ /dev/null @@ -1,89 +0,0 @@ -singleton (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> force (force ifThenElse (equalsData i1 (iData 0)) (delay i6) (delay (i4 i3 (mapData (i4 i2 i1)))))) (bData #c0) (bData #736f6d65746f6b656e) (iData 1)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> i11 (bData i14) (mapData i1)) ((\i0 -> i11 (bData i15) (iData i1)) 1)) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) -valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> i12 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i12 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i14 (i15 i1)) i6) (delay (i4 (i10 (i15 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) -unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 #736f6d65746f6b656e 1)) (i10 i11 (i12 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 (i15 i19 1)) (i14 i13 (i15 #746f6b656e 1))) (i14 #c7 (i15 i19 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c6 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) -unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -inv (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> mapData (i2 (unMapData i1)))) (\i0 -> i4 (\i0 -> iData (i4 (unIData i1))) i1) i1) (\i0 -> subtractInteger 0 i1) ((\i0 -> \i0 -> i10 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i10 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay (i12 (mkPairData (i7 (i9 i1)) (i4 (i8 (i9 i1)))) (i2 (i10 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i15 (i16 i13 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i13 (i16 i20 1))) (i1 addInteger (i14 i13 (i16 i20 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i27 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i28 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i29 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i30 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i31 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i32 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i33 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i34 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i35 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i36 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i37 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i38 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i39 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i40 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i40 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i40 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay error))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i14 i2)) (\i0 -> i20 (mkPairData (i14 (i15 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i14 i2)) (\i0 -> i21 (mkPairData (i14 (i15 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i11 (i12 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i3) (delay (i19 (i14 i1) (i2 (i15 i1)))))) i2) (i12 #c7 (i13 i17 1)) (i12 #c0 (i13 i17 1)))) (\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i12 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i4 (\i0 -> \i0 -> force (i7 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay error) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i5 (i8 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 i16 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i8 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i6 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i10 (i1 i2) (delay error) (delay (i4 (i12 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i11 (i12 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay error) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i16) (bData i2) (mapData i1)) #c0 i12)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i13 i1)) (delay (i2 (i11 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay error) (delay (i4 (i9 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i8 (i9 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) [ ])) -Ada.adaSymbol (program 1.0.0 #) -Ada.adaToken (program 1.0.0 #) -Ada.lovelaceValueOf (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay 0) (delay (force ifThenElse (equalsData (force (force fstPair) (i3 i1)) (bData #)) (unIData (i2 (i3 (unMapData (i2 (i3 i1)))))) 0)))) (force (force sndPair))) (force headList))) -Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #))))))) -Ada.isAdaOnlyValue.true on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) [ ])) -Ada.isAdaOnlyValue.trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 i1 (delay True) (delay ((\i0 -> \i0 -> i7 i2 i1 False) (force nullList (i7 i1)) (equalsData (i8 (i9 i1)) (bData i16)))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 #736f6d65746f6b656e 1)) (i10 i15 (i11 i15 10000000)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) -Ada.adaOnlyValue.itself (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> force mkCons i1 i4) (i2 i1)) i3)))) (force headList)) [ ])) -Ada.adaOnlyValue.on empty (program 1.0.0 ((\i0 -> (\i0 -> force (force (force chooseList) i2 (delay i2) (delay (force ifThenElse (equalsData (force (force fstPair) (i1 i2)) (bData #)) ((\i0 -> force mkCons i1 i3) (i1 i2)) i2)))) (force headList)) [ ])) -Ada.adaOnlyValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> \i0 -> i4 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i4 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -Ada.adaOnlyValue.on Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData i6)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> i3 (bData i6) (mapData i1)) ((\i0 -> i3 (bData i6) (iData i1)) 10000000))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) -Ada.noAdaValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1))))) -Ada.noAdaValue.on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1)))) [ ])) -Ada.noAdaValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData #)) (force tailList i1) i1)))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -Ada.noAdaValue.on Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) (bData i5)) (force tailList i1) i1)))) ((\i0 -> i2 (bData i5) (mapData i1)) ((\i0 -> i2 (bData i5) (iData i1)) 10000000))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index eec264eb7..ba86996ab 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -3,74 +3,74 @@ singletonData {"exBudgetCPU":3189793,"exBudgetMemory":7490,"scriptSizeBytes":80} valueOf.itself {"exBudgetCPU":851100,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":8887341,"exBudgetMemory":23308,"scriptSizeBytes":183} valueOf.growing.1 {"exBudgetCPU":6189368,"exBudgetMemory":18450,"scriptSizeBytes":193} -valueOf.growing.2 {"exBudgetCPU":21178115,"exBudgetMemory":61340,"scriptSizeBytes":420} -valueOf.growing.3 {"exBudgetCPU":32067961,"exBudgetMemory":90246,"scriptSizeBytes":451} -valueOf.growing.4 {"exBudgetCPU":46575107,"exBudgetMemory":126312,"scriptSizeBytes":470} -valueOf.growing.5 {"exBudgetCPU":65044553,"exBudgetMemory":171038,"scriptSizeBytes":488} -valueOf.growing.6 {"exBudgetCPU":87476299,"exBudgetMemory":224424,"scriptSizeBytes":506} -valueOf.growing.7 {"exBudgetCPU":113870345,"exBudgetMemory":286470,"scriptSizeBytes":525} -valueOf.growing.8 {"exBudgetCPU":144226691,"exBudgetMemory":357176,"scriptSizeBytes":543} -valueOf.growing.9 {"exBudgetCPU":181299724,"exBudgetMemory":441700,"scriptSizeBytes":561} -valueOf.growing.10 {"exBudgetCPU":217162596,"exBudgetMemory":525796,"scriptSizeBytes":579} -valueOf.growing.11 {"exBudgetCPU":256987768,"exBudgetMemory":618552,"scriptSizeBytes":597} -valueOf.growing.12 {"exBudgetCPU":300775240,"exBudgetMemory":719968,"scriptSizeBytes":616} -valueOf.growing.13 {"exBudgetCPU":348525012,"exBudgetMemory":830044,"scriptSizeBytes":634} -valueOf.growing.14 {"exBudgetCPU":400237084,"exBudgetMemory":948780,"scriptSizeBytes":652} -valueOf.growing.15 {"exBudgetCPU":455911456,"exBudgetMemory":1076176,"scriptSizeBytes":671} -valueOf.growing.16 {"exBudgetCPU":515548128,"exBudgetMemory":1212232,"scriptSizeBytes":689} -valueOf.growing.17 {"exBudgetCPU":579147100,"exBudgetMemory":1356948,"scriptSizeBytes":708} -unionWith.const {"exBudgetCPU":17399570,"exBudgetMemory":52540,"scriptSizeBytes":318} -unionWith.(+).itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":232} -unionWith.(+).applied {"exBudgetCPU":17491047,"exBudgetMemory":52042,"scriptSizeBytes":314} -unionWith.tokens {"exBudgetCPU":17262429,"exBudgetMemory":51546,"scriptSizeBytes":324} -unionWith.symbols {"exBudgetCPU":10801712,"exBudgetMemory":33932,"scriptSizeBytes":316} -unionWith.growing.1 {"exBudgetCPU":10870712,"exBudgetMemory":34232,"scriptSizeBytes":320} -unionWith.growing.2 {"exBudgetCPU":25790459,"exBudgetMemory":76822,"scriptSizeBytes":354} -unionWith.growing.3 {"exBudgetCPU":37948531,"exBudgetMemory":109258,"scriptSizeBytes":375} -unionWith.growing.4 {"exBudgetCPU":53999903,"exBudgetMemory":150054,"scriptSizeBytes":393} -unionWith.growing.5 {"exBudgetCPU":74013575,"exBudgetMemory":199510,"scriptSizeBytes":412} -unionWith.growing.6 {"exBudgetCPU":97989547,"exBudgetMemory":257626,"scriptSizeBytes":430} -unionWith.growing.7 {"exBudgetCPU":125927819,"exBudgetMemory":324402,"scriptSizeBytes":449} -unionWith.growing.8 {"exBudgetCPU":157828391,"exBudgetMemory":399838,"scriptSizeBytes":467} -unionWith.growing.9 {"exBudgetCPU":200277238,"exBudgetMemory":502148,"scriptSizeBytes":482} -unionWith.growing.10 {"exBudgetCPU":236140110,"exBudgetMemory":586244,"scriptSizeBytes":501} -unionWith.growing.11 {"exBudgetCPU":275965282,"exBudgetMemory":679000,"scriptSizeBytes":519} -unionWith.growing.12 {"exBudgetCPU":319752754,"exBudgetMemory":780416,"scriptSizeBytes":537} -unionWith.growing.13 {"exBudgetCPU":367502526,"exBudgetMemory":890492,"scriptSizeBytes":556} -unionWith.growing.14 {"exBudgetCPU":419214598,"exBudgetMemory":1009228,"scriptSizeBytes":574} -unionWith.growing.15 {"exBudgetCPU":474888970,"exBudgetMemory":1136624,"scriptSizeBytes":593} -unionWith.growing.16 {"exBudgetCPU":534525642,"exBudgetMemory":1272680,"scriptSizeBytes":611} -unionWith.growing.17 {"exBudgetCPU":598124614,"exBudgetMemory":1417396,"scriptSizeBytes":629} -unionWithData const.itself {"exBudgetCPU":943100,"exBudgetMemory":4200,"scriptSizeBytes":222} -unionWithData const.applied {"exBudgetCPU":17035856,"exBudgetMemory":51244,"scriptSizeBytes":307} +valueOf.growing.2 {"exBudgetCPU":21454115,"exBudgetMemory":62540,"scriptSizeBytes":412} +valueOf.growing.3 {"exBudgetCPU":32481961,"exBudgetMemory":92046,"scriptSizeBytes":443} +valueOf.growing.4 {"exBudgetCPU":47127107,"exBudgetMemory":128712,"scriptSizeBytes":462} +valueOf.growing.5 {"exBudgetCPU":65734553,"exBudgetMemory":174038,"scriptSizeBytes":480} +valueOf.growing.6 {"exBudgetCPU":88304299,"exBudgetMemory":228024,"scriptSizeBytes":498} +valueOf.growing.7 {"exBudgetCPU":114836345,"exBudgetMemory":290670,"scriptSizeBytes":517} +valueOf.growing.8 {"exBudgetCPU":145330691,"exBudgetMemory":361976,"scriptSizeBytes":535} +valueOf.growing.9 {"exBudgetCPU":182541724,"exBudgetMemory":447100,"scriptSizeBytes":553} +valueOf.growing.10 {"exBudgetCPU":218542596,"exBudgetMemory":531796,"scriptSizeBytes":571} +valueOf.growing.11 {"exBudgetCPU":258505768,"exBudgetMemory":625152,"scriptSizeBytes":589} +valueOf.growing.12 {"exBudgetCPU":302431240,"exBudgetMemory":727168,"scriptSizeBytes":608} +valueOf.growing.13 {"exBudgetCPU":350319012,"exBudgetMemory":837844,"scriptSizeBytes":626} +valueOf.growing.14 {"exBudgetCPU":402169084,"exBudgetMemory":957180,"scriptSizeBytes":644} +valueOf.growing.15 {"exBudgetCPU":457981456,"exBudgetMemory":1085176,"scriptSizeBytes":663} +valueOf.growing.16 {"exBudgetCPU":517756128,"exBudgetMemory":1221832,"scriptSizeBytes":681} +valueOf.growing.17 {"exBudgetCPU":581493100,"exBudgetMemory":1367148,"scriptSizeBytes":700} +unionWith.const {"exBudgetCPU":17744570,"exBudgetMemory":54040,"scriptSizeBytes":328} +unionWith.(+).itself {"exBudgetCPU":1012100,"exBudgetMemory":4500,"scriptSizeBytes":243} +unionWith.(+).applied {"exBudgetCPU":17836047,"exBudgetMemory":53542,"scriptSizeBytes":325} +unionWith.tokens {"exBudgetCPU":17607429,"exBudgetMemory":53046,"scriptSizeBytes":334} +unionWith.symbols {"exBudgetCPU":11008712,"exBudgetMemory":34832,"scriptSizeBytes":326} +unionWith.growing.1 {"exBudgetCPU":11077712,"exBudgetMemory":35132,"scriptSizeBytes":330} +unionWith.growing.2 {"exBudgetCPU":26273459,"exBudgetMemory":78922,"scriptSizeBytes":364} +unionWith.growing.3 {"exBudgetCPU":38569531,"exBudgetMemory":111958,"scriptSizeBytes":385} +unionWith.growing.4 {"exBudgetCPU":54758903,"exBudgetMemory":153354,"scriptSizeBytes":403} +unionWith.growing.5 {"exBudgetCPU":74910575,"exBudgetMemory":203410,"scriptSizeBytes":422} +unionWith.growing.6 {"exBudgetCPU":99024547,"exBudgetMemory":262126,"scriptSizeBytes":440} +unionWith.growing.7 {"exBudgetCPU":127100819,"exBudgetMemory":329502,"scriptSizeBytes":459} +unionWith.growing.8 {"exBudgetCPU":159139391,"exBudgetMemory":405538,"scriptSizeBytes":477} +unionWith.growing.9 {"exBudgetCPU":201864238,"exBudgetMemory":509048,"scriptSizeBytes":493} +unionWith.growing.10 {"exBudgetCPU":237865110,"exBudgetMemory":593744,"scriptSizeBytes":512} +unionWith.growing.11 {"exBudgetCPU":277828282,"exBudgetMemory":687100,"scriptSizeBytes":530} +unionWith.growing.12 {"exBudgetCPU":321753754,"exBudgetMemory":789116,"scriptSizeBytes":548} +unionWith.growing.13 {"exBudgetCPU":369641526,"exBudgetMemory":899792,"scriptSizeBytes":567} +unionWith.growing.14 {"exBudgetCPU":421491598,"exBudgetMemory":1019128,"scriptSizeBytes":585} +unionWith.growing.15 {"exBudgetCPU":477303970,"exBudgetMemory":1147124,"scriptSizeBytes":604} +unionWith.growing.16 {"exBudgetCPU":537078642,"exBudgetMemory":1283780,"scriptSizeBytes":622} +unionWith.growing.17 {"exBudgetCPU":600815614,"exBudgetMemory":1429096,"scriptSizeBytes":640} +unionWithData const.itself {"exBudgetCPU":1012100,"exBudgetMemory":4500,"scriptSizeBytes":233} +unionWithData const.applied {"exBudgetCPU":17380856,"exBudgetMemory":52744,"scriptSizeBytes":318} inv {"exBudgetCPU":8006438,"exBudgetMemory":25962,"scriptSizeBytes":175} equality.itself {"exBudgetCPU":644100,"exBudgetMemory":2900,"scriptSizeBytes":124} equality.triviallyTrue {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} equality.triviallyFalse {"exBudgetCPU":9153784,"exBudgetMemory":22936,"scriptSizeBytes":213} -equality.swappedTokensTrue {"exBudgetCPU":40395280,"exBudgetMemory":111744,"scriptSizeBytes":463} -equality.swappedSymbolsTrue {"exBudgetCPU":32532768,"exBudgetMemory":84404,"scriptSizeBytes":454} +equality.swappedTokensTrue {"exBudgetCPU":41016280,"exBudgetMemory":114444,"scriptSizeBytes":457} +equality.swappedSymbolsTrue {"exBudgetCPU":32877768,"exBudgetMemory":85904,"scriptSizeBytes":448} equality.growing.1 {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.growing.2 {"exBudgetCPU":40357210,"exBudgetMemory":111744,"scriptSizeBytes":458} -equality.growing.3 {"exBudgetCPU":62002536,"exBudgetMemory":167484,"scriptSizeBytes":493} -equality.growing.4 {"exBudgetCPU":91572462,"exBudgetMemory":240544,"scriptSizeBytes":528} -equality.growing.5 {"exBudgetCPU":129066988,"exBudgetMemory":330924,"scriptSizeBytes":563} -equality.growing.6 {"exBudgetCPU":174486114,"exBudgetMemory":438624,"scriptSizeBytes":599} -equality.growing.7 {"exBudgetCPU":227829840,"exBudgetMemory":563644,"scriptSizeBytes":634} -equality.growing.8 {"exBudgetCPU":289098166,"exBudgetMemory":705984,"scriptSizeBytes":669} -equality.growing.9 {"exBudgetCPU":358291092,"exBudgetMemory":865644,"scriptSizeBytes":704} -equality.growing.10 {"exBudgetCPU":435408618,"exBudgetMemory":1042624,"scriptSizeBytes":740} -equality.growing.11 {"exBudgetCPU":520450744,"exBudgetMemory":1236924,"scriptSizeBytes":775} -equality.growing.12 {"exBudgetCPU":613417470,"exBudgetMemory":1448544,"scriptSizeBytes":810} -equality.growing.13 {"exBudgetCPU":714308796,"exBudgetMemory":1677484,"scriptSizeBytes":845} -equality.growing.14 {"exBudgetCPU":823124722,"exBudgetMemory":1923744,"scriptSizeBytes":881} -equality.growing.15 {"exBudgetCPU":939865248,"exBudgetMemory":2187324,"scriptSizeBytes":916} -equality.growing.16 {"exBudgetCPU":1064530374,"exBudgetMemory":2468224,"scriptSizeBytes":951} -equality.growing.17 {"exBudgetCPU":1197120100,"exBudgetMemory":2766444,"scriptSizeBytes":986} -normalize.identity {"exBudgetCPU":35595548,"exBudgetMemory":105757,"scriptSizeBytes":562} -normalize.empty {"exBudgetCPU":24172001,"exBudgetMemory":70961,"scriptSizeBytes":444} -assertSorted.succeeds {"exBudgetCPU":30261271,"exBudgetMemory":95282,"scriptSizeBytes":519} +equality.growing.2 {"exBudgetCPU":40978210,"exBudgetMemory":114444,"scriptSizeBytes":452} +equality.growing.3 {"exBudgetCPU":62899536,"exBudgetMemory":171384,"scriptSizeBytes":487} +equality.growing.4 {"exBudgetCPU":92745462,"exBudgetMemory":245644,"scriptSizeBytes":522} +equality.growing.5 {"exBudgetCPU":130515988,"exBudgetMemory":337224,"scriptSizeBytes":557} +equality.growing.6 {"exBudgetCPU":176211114,"exBudgetMemory":446124,"scriptSizeBytes":593} +equality.growing.7 {"exBudgetCPU":229830840,"exBudgetMemory":572344,"scriptSizeBytes":628} +equality.growing.8 {"exBudgetCPU":291375166,"exBudgetMemory":715884,"scriptSizeBytes":663} +equality.growing.9 {"exBudgetCPU":360844092,"exBudgetMemory":876744,"scriptSizeBytes":698} +equality.growing.10 {"exBudgetCPU":438237618,"exBudgetMemory":1054924,"scriptSizeBytes":734} +equality.growing.11 {"exBudgetCPU":523555744,"exBudgetMemory":1250424,"scriptSizeBytes":769} +equality.growing.12 {"exBudgetCPU":616798470,"exBudgetMemory":1463244,"scriptSizeBytes":804} +equality.growing.13 {"exBudgetCPU":717965796,"exBudgetMemory":1693384,"scriptSizeBytes":839} +equality.growing.14 {"exBudgetCPU":827057722,"exBudgetMemory":1940844,"scriptSizeBytes":875} +equality.growing.15 {"exBudgetCPU":944074248,"exBudgetMemory":2205624,"scriptSizeBytes":910} +equality.growing.16 {"exBudgetCPU":1069015374,"exBudgetMemory":2487724,"scriptSizeBytes":945} +equality.growing.17 {"exBudgetCPU":1201881100,"exBudgetMemory":2787144,"scriptSizeBytes":980} +normalize.identity {"exBudgetCPU":35733548,"exBudgetMemory":106357,"scriptSizeBytes":553} +normalize.empty {"exBudgetCPU":24448001,"exBudgetMemory":72161,"scriptSizeBytes":435} +assertSorted.succeeds {"exBudgetCPU":30399271,"exBudgetMemory":95882,"scriptSizeBytes":511} assertSorted.fails on malsorted symbols {"exBudgetCPU":20705777,"exBudgetMemory":62290,"scriptSizeBytes":340} -assertSorted.fails on zero quantities {"exBudgetCPU":21820727,"exBudgetMemory":62160,"scriptSizeBytes":519} +assertSorted.fails on zero quantities {"exBudgetCPU":21820727,"exBudgetMemory":62160,"scriptSizeBytes":510} assertSorted.fails on empty token map {"exBudgetCPU":1240239,"exBudgetMemory":455,"scriptSizeBytes":262} Ada.adaSymbol {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} Ada.adaToken {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} @@ -78,7 +78,7 @@ Ada.lovelaceValueOf {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes Ada.isAdaOnlyValue.itself {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":45} Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":497454,"exBudgetMemory":1532,"scriptSizeBytes":50} Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":4349105,"exBudgetMemory":10950,"scriptSizeBytes":107} -Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":13280877,"exBudgetMemory":37926,"scriptSizeBytes":351} +Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":13487877,"exBudgetMemory":38826,"scriptSizeBytes":361} Ada.adaOnlyValue.itself {"exBudgetCPU":184100,"exBudgetMemory":900,"scriptSizeBytes":52} Ada.adaOnlyValue.on empty {"exBudgetCPU":589454,"exBudgetMemory":1932,"scriptSizeBytes":51} Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":4356574,"exBudgetMemory":10950,"scriptSizeBytes":109} diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index da2128aab..46ab096b0 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -20,7 +20,7 @@ valueOf.growing.15 (program 1.0.0 1) valueOf.growing.16 (program 1.0.0 1) valueOf.growing.17 (program 1.0.0 1) unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) +unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) unionWith.tokens (program 1.0.0 [(#41c0, #a24a6f74686572746f6b656e0149736f6d65746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) @@ -170,7 +170,7 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cd, #a145746f6b656e01) , (#41ce, #a145746f6b656e01) , (#41cf, #a145746f6b656e01) ]) -unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i11 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) +unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) inv (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e20)]) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index 0740ab4ab..bef5bb22a 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -3,74 +3,74 @@ singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> forc valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> i11 (bData i14) (mapData i1)) ((\i0 -> i11 (bData i15) (iData i1)) 1)) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> i12 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i12 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i7 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i8 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i5) (delay (force (i11 (equalsData (i14 (i15 i1)) i6) (delay (i4 (i10 (i15 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i4 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i5) (delay (force (i14 (equalsData (i17 (i18 i1)) i6) (delay (i4 (i13 (i18 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) -unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 i11 (i12 #736f6d65746f6b656e 1)) (i10 i11 (i12 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 #c0 (i11 i15 1)) (i10 #c7 (i11 i15 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i14 i13 (i15 i19 1)) (i14 i13 (i15 #746f6b656e 1))) (i14 #c7 (i15 i19 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i16 i20 1)) (i15 i13 (i16 i14 1))) (i15 #c1 (i16 i14 1))) (i15 #c2 (i16 i14 1))) (i15 #c3 (i16 i14 1))) (i15 #c4 (i16 i14 1))) (i15 #c5 (i16 i14 1))) (i15 #c6 (i16 i14 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i15 i13 (i17 i21 1)) (i15 i13 (i17 i14 1))) (i15 #c1 (i17 i14 1))) (i15 #c2 (i17 i14 1))) (i15 #c3 (i17 i14 1))) (i15 #c4 (i17 i14 1))) (i15 #c5 (i17 i14 1))) (i15 #c6 (i17 i14 1))) (i15 i16 (i17 i14 1))) (i15 #c8 (i17 i14 1))) (i15 #c9 (i17 i14 1))) (i15 #ca (i17 i14 1))) (i15 #cb (i17 i14 1))) (i15 #cc (i17 i14 1))) (i15 #cd (i17 i14 1))) (i15 #ce (i17 i14 1))) (i15 #cf (i17 i14 1))) (i15 i16 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i12 (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i12 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i15 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i20 i5 (i17 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i15 i6 (i8 i16 i3 (i17 i4) i5))) (delay (i15 i3 (i8 i16 i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) i12 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2))) -unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i10 i11 (i12 i16 1)) (i10 i11 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i11 i1 (delay i5) (delay (force (i13 (equalsData (i15 (i16 i1)) i6) (delay (i4 (i12 (i16 i1)))) (delay (i2 (i14 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i12 i2) (i10 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i10 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i13 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i14 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i13 i6 (i8 (\i0 -> \i0 -> i1) i3 (i14 i4) i5))) (delay (i13 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i14 i4))))))))) (i14 i2)) (i13 i4)) (i13 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (force tailList)) (force (force fstPair))) (force headList))) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 i12 (i13 #736f6d65746f6b656e 1)) (i11 i12 (i13 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 #c0 (i12 i16 1)) (i11 #c7 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 #c0 (i12 i16 1)) (i11 #c7 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i15 i14 (i16 i20 1)) (i15 i14 (i16 #746f6b656e 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c4 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c4 (i17 i15 1))) (i16 #c5 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c4 (i17 i15 1))) (i16 #c5 (i17 i15 1))) (i16 #c6 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 #cd (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 #cd (i18 i15 1))) (i16 #ce (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 #cd (i18 i15 1))) (i16 #ce (i18 i15 1))) (i16 #cf (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i12 i2) (i10 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i10 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i13 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i14 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i13 i6 (i8 (\i0 -> \i0 -> i1) i3 (i14 i4) i5))) (delay (i13 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i14 i4))))))))) (i14 i2)) (i13 i4)) (i13 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (force tailList)) (force (force fstPair))) (force headList))) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) inv (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> mapData (i2 (unMapData i1)))) (\i0 -> i4 (\i0 -> iData (i4 (unIData i1))) i1) i1) (\i0 -> subtractInteger 0 i1) ((\i0 -> \i0 -> i10 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i10 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay (i12 (mkPairData (i7 (i9 i1)) (i4 (i8 (i9 i1)))) (i2 (i10 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i15 (i16 i13 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i20 1)) (i14 i13 (i16 i20 1))) (i1 addInteger (i14 i13 (i16 i20 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i16 (i17 i14 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i14 (i17 i21 1))) (i1 addInteger (i15 i14 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1))) (i1 addInteger (i14 i15 (i16 i13 1)) (i14 i15 (i16 i20 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i25 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1))) (i1 addInteger (i1 addInteger (i15 i14 (i17 i13 1)) (i15 i14 (i17 i21 1))) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i26 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i13 1)) (i16 i14 (i18 i22 1))) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i27 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i17 i14 (i19 i13 1)) (i17 i14 (i19 i23 1))) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i28 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i14 (i20 i13 1)) (i18 i14 (i20 i24 1))) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i29 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i14 (i21 i13 1)) (i19 i14 (i21 i25 1))) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i30 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i14 (i22 i13 1)) (i20 i14 (i22 i26 1))) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i31 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i14 (i23 i13 1)) (i21 i14 (i23 i27 1))) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i32 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i14 (i24 i13 1)) (i22 i14 (i24 i28 1))) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i33 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i14 (i25 i13 1)) (i23 i14 (i25 i29 1))) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i34 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i14 (i26 i13 1)) (i24 i14 (i26 i30 1))) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i35 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i14 (i27 i13 1)) (i25 i14 (i27 i31 1))) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i36 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i14 (i28 i13 1)) (i26 i14 (i28 i32 1))) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i34 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i37 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i37 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i37 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i14 (i29 i13 1)) (i27 i14 (i29 i33 1))) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i35 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i38 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i38 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i38 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i14 (i30 i13 1)) (i28 i14 (i30 i34 1))) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i36 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i39 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i39 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i39 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i8 i2 (delay (force (i8 i1 (delay True) (delay False)))) (delay (force (i8 i1 (delay False) (delay (force (i10 (force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsData (i13 (i14 i2)) (i13 (i14 i1))) (delay (equalsData (i9 (i14 i2)) (i9 (i14 i1)))))) (delay (i3 (i12 i2) (i12 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i14 (i31 i13 1)) (i29 i14 (i31 i35 1))) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i37 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i40 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i40 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i40 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i10 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i12 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i13 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay (force (force trace "Negative amount in Value" (delay error)))))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i12 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i12 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i9 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i10 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay True) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> \i0 -> i9 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i19) (delay ((\i0 -> i5 (i9 (i14 i2)) (\i0 -> i20 (mkPairData (i14 (i15 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i9 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i9 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i7 i1 (delay i20) (delay ((\i0 -> i5 (i9 (i14 i2)) (\i0 -> i21 (mkPairData (i14 (i15 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i13 (i14 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i23 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i24 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i25 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i26 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i27 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i28 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i29 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i30 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i31 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i32 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i33 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i34 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i35 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i36 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay (force (force trace "Negative amount in Value" (delay error)))))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i14 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i14 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i7 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i14 i1)))))))))) (\i0 -> \i0 -> i11 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i19) (delay ((\i0 -> i5 (i11 (i15 i2)) (\i0 -> i20 (mkPairData (i15 (i16 i3)) i1) i2) (delay i1)) (i2 (i12 i1)))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i11 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i11 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i20) (delay ((\i0 -> i5 (i11 (i15 i2)) (\i0 -> i21 (mkPairData (i15 (i16 i3)) i1) i2) (delay i1)) (i2 (i12 i1)))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i14 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i16 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i17 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i6 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i11 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i9 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i18 i1)) (delay (i2 (i16 i1)))))))))) (\i0 -> i12 i1 i2)) (delay True)) (\i0 -> i6 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i14 (i1 i2) (delay (force (i6 i7 (delay error)))) (delay (i4 (i15 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i15 i1))))))) i1 (\i0 -> False))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i8 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i21 (i16 i1) (i2 (i17 i1)))))) i2) (i14 #c7 (i15 i19 1)) (i14 #c0 (i15 i19 1)))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i13 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i7 (i10 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force trace)) "unsorted map") (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i7 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i11 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i12 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i18 (i19 i23 1)) (i17 i18 (i19 i23 1)))) (\i0 -> i5 (\i0 -> \i0 -> force (i11 i1 (delay False) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i10 i1 i2)) (delay True)) (\i0 -> i2 (\i0 -> \i0 -> force (i8 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i12 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i14 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i13 (i14 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i24 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i14 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i16 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i17 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i6 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i11 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i18 (i19 i23 1)) (i17 i18 (i19 i23 1)))) (\i0 -> i9 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i18 i1)) (delay (i2 (i16 i1)))))))))) (\i0 -> i12 i1 i2)) (delay True)) (\i0 -> i6 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i14 (i1 i2) (delay (force (i6 i7 (delay error)))) (delay (i4 (i15 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i15 i1))))))) i1 (\i0 -> False))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i10 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i18) (bData i2) (mapData i1)) #c0 i14)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay (force (i9 i10 (delay error)))) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i10 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force trace)) "unsorted map") (force tailList)) (force (force fstPair))) (force headList)) [ ])) Ada.adaSymbol (program 1.0.0 #) Ada.adaToken (program 1.0.0 #) @@ -78,7 +78,7 @@ Ada.lovelaceValueOf (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force c Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #))))))) Ada.isAdaOnlyValue.true on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) [ ])) Ada.isAdaOnlyValue.trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 i1 (delay True) (delay ((\i0 -> \i0 -> i7 i2 i1 False) (force nullList (i7 i1)) (equalsData (i8 (i9 i1)) (bData i16)))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i10 #c0 (i11 #736f6d65746f6b656e 1)) (i10 i15 (i11 i15 10000000)))) (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 i11 (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 i19 i5 (i16 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 i15 i3 (i16 i4) i5))) (delay (i23 i3 (i8 i15 i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) i11 i2 i1)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (\i0 -> \i0 -> i1)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i2)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) +Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 i1 (delay True) (delay ((\i0 -> \i0 -> i10 i2 i1 False) (force nullList (i9 i1)) (equalsData (i10 (i11 i1)) (bData i17)))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 #c0 (i12 #736f6d65746f6b656e 1)) (i11 i16 (i12 i16 10000000)))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) Ada.adaOnlyValue.itself (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> force mkCons i1 i4) (i2 i1)) i3)))) (force headList)) [ ])) Ada.adaOnlyValue.on empty (program 1.0.0 ((\i0 -> (\i0 -> force (force (force chooseList) i2 (delay i2) (delay (force ifThenElse (equalsData (force (force fstPair) (i1 i2)) (bData #)) ((\i0 -> force mkCons i1 i3) (i1 i2)) i2)))) (force headList)) [ ])) Ada.adaOnlyValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> \i0 -> i4 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i4 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/bool.bench.golden b/plutarch-test/goldens/bool.bench.golden index e2a013ad5..18bfaecc2 100644 --- a/plutarch-test/goldens/bool.bench.golden +++ b/plutarch-test/goldens/bool.bench.golden @@ -6,8 +6,6 @@ pand.tt {"exBudgetCPU":448656,"exBudgetMemory":1701,"scriptSizeBytes":19} pand.ff {"exBudgetCPU":448656,"exBudgetMemory":1701,"scriptSizeBytes":19} pand.laziness.pand {"exBudgetCPU":402656,"exBudgetMemory":1501,"scriptSizeBytes":17} pand.laziness.op {"exBudgetCPU":448656,"exBudgetMemory":1701,"scriptSizeBytes":18} -pand.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} -pand.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} pand.laziness.pand.perror.op {"exBudgetCPU":80656,"exBudgetMemory":101,"scriptSizeBytes":18} por.tf {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":16} por.ft {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":16} @@ -15,7 +13,5 @@ por.tt {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":16} por.ff {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":16} por.laziness.por {"exBudgetCPU":333656,"exBudgetMemory":1201,"scriptSizeBytes":15} por.laziness.op {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":15} -por.laziness.pand.perror.false {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} -por.laziness.pand.perror.true {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} por.laziness.pand.perror.op.true {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":15} por.laziness.pand.perror.op.false {"exBudgetCPU":80656,"exBudgetMemory":101,"scriptSizeBytes":15} \ No newline at end of file diff --git a/plutarch-test/goldens/bool.uplc.eval.golden b/plutarch-test/goldens/bool.uplc.eval.golden index 4e839c9bd..bcb8a5b68 100644 --- a/plutarch-test/goldens/bool.uplc.eval.golden +++ b/plutarch-test/goldens/bool.uplc.eval.golden @@ -6,8 +6,6 @@ pand.tt (program 1.0.0 True) pand.ff (program 1.0.0 False) pand.laziness.pand (program 1.0.0 (delay False)) pand.laziness.op (program 1.0.0 False) -pand.laziness.pand.perror.false (program 1.0.0 error) -pand.laziness.pand.perror.true (program 1.0.0 error) pand.laziness.pand.perror.op (program 1.0.0 error) por.tf (program 1.0.0 True) por.ft (program 1.0.0 True) @@ -15,7 +13,5 @@ por.tt (program 1.0.0 True) por.ff (program 1.0.0 False) por.laziness.por (program 1.0.0 (delay True)) por.laziness.op (program 1.0.0 True) -por.laziness.pand.perror.false (program 1.0.0 error) -por.laziness.pand.perror.true (program 1.0.0 error) por.laziness.pand.perror.op.true (program 1.0.0 True) por.laziness.pand.perror.op.false (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/bool.uplc.golden b/plutarch-test/goldens/bool.uplc.golden index eb80239f8..b2e70c98a 100644 --- a/plutarch-test/goldens/bool.uplc.golden +++ b/plutarch-test/goldens/bool.uplc.golden @@ -6,8 +6,6 @@ pand.tt (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay Fals pand.ff (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay False)))) pand.laziness.pand (program 1.0.0 ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error))) pand.laziness.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) False (delay error)))) -pand.laziness.pand.perror.false (program 1.0.0 error) -pand.laziness.pand.perror.true (program 1.0.0 error) pand.laziness.pand.perror.op (program 1.0.0 (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) True (delay error)))) por.tf (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay False)))) por.ft (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) False (delay True)))) @@ -15,7 +13,5 @@ por.tt (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (de por.ff (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) False (delay False)))) por.laziness.por (program 1.0.0 ((\i0 -> force ifThenElse i1 (delay True)) True (delay error))) por.laziness.op (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay error)))) -por.laziness.pand.perror.false (program 1.0.0 error) -por.laziness.pand.perror.true (program 1.0.0 error) por.laziness.pand.perror.op.true (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) True (delay error)))) por.laziness.pand.perror.op.false (program 1.0.0 (force ((\i0 -> force ifThenElse i1 (delay True)) False (delay error)))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.bench.golden b/plutarch-test/goldens/extra.api.dev=false.bench.golden deleted file mode 100644 index eb493a68a..000000000 --- a/plutarch-test/goldens/extra.api.dev=false.bench.golden +++ /dev/null @@ -1,3 +0,0 @@ -pfindOwnInput {"exBudgetCPU":5917281,"exBudgetMemory":14580,"scriptSizeBytes":319} -pgetContinuingOutputs {"exBudgetCPU":12048411,"exBudgetMemory":30186,"scriptSizeBytes":405} -pparseDatum {"exBudgetCPU":4634894,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden deleted file mode 100644 index 05021636d..000000000 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.eval.golden +++ /dev/null @@ -1,3 +0,0 @@ -pfindOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) -pgetContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) -pparseDatum (program 1.0.0 (\i0 -> \i0 -> i2 ((\i0 -> force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff)))))))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=false.uplc.golden b/plutarch-test/goldens/extra.api.dev=false.uplc.golden deleted file mode 100644 index c77ae4864..000000000 --- a/plutarch-test/goldens/extra.api.dev=false.uplc.golden +++ /dev/null @@ -1,3 +0,0 @@ -pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData i2 (i9 (i11 i1))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i15 i1)) (delay (\i0 -> \i0 -> i2 (i17 i3))) (delay (i3 i2 (i16 i1)))))))) (i11 i1) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (i12 ((\i0 -> i14 (i16 i1)) (i13 (i14 (i15 i1))))) i3) (delay error)) ((\i0 -> unListData (i10 (i12 i1))) (i9 i4)) ((\i0 -> unListData (i10 (i11 (i12 i1)))) (i9 i4)) (i9 i1))) (delay error))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (\i0 -> \i0 -> equalsData i2 (i3 (i5 i1)))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pparseDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i9 i1)) (delay (\i0 -> \i0 -> i2 (i11 i3))) (delay (i3 i2 (i8 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i7 (i8 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 ((\i0 -> i10 (i9 (i11 i4))) ((\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i9 (i8 (i10 i3))))))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i5 ((\i0 -> i5 (i5 (i5 (i5 (i5 (i5 (i5 (i5 i1)))))))) (i6 i1)))) ((\i0 -> i5 (i6 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.bench.golden b/plutarch-test/goldens/int.examples.bench.golden index 9e03a8307..c0620fbca 100644 --- a/plutarch-test/goldens/int.examples.bench.golden +++ b/plutarch-test/goldens/int.examples.bench.golden @@ -4,5 +4,4 @@ example1 {"exBudgetCPU":1860485,"exBudgetMemory":3710,"scriptSizeBytes":34} example2 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":21} fib.lam {"exBudgetCPU":322100,"exBudgetMemory":1500,"scriptSizeBytes":72} fib.app.9 {"exBudgetCPU":189953707,"exBudgetMemory":433318,"scriptSizeBytes":75} -fib.error {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} uglyDouble {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":10} \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.uplc.eval.golden b/plutarch-test/goldens/int.examples.uplc.eval.golden index 923ba5104..94d064400 100644 --- a/plutarch-test/goldens/int.examples.uplc.eval.golden +++ b/plutarch-test/goldens/int.examples.uplc.eval.golden @@ -4,5 +4,4 @@ example1 (program 1.0.0 55) example2 (program 1.0.0 (\i0 -> i1 (\i0 -> addInteger i1 1) (\i0 -> subtractInteger i1 1))) fib.lam (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 1)) ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i1 0) (delay 0) (delay (force (force ifThenElse (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) (\i0 -> i2 i2 i1)) i1) (subtractInteger i1 2)))))))))) fib.app.9 (program 1.0.0 34) -fib.error (program 1.0.0 error) uglyDouble (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/int.examples.uplc.golden b/plutarch-test/goldens/int.examples.uplc.golden index 1eb85a63f..41ef79cf6 100644 --- a/plutarch-test/goldens/int.examples.uplc.golden +++ b/plutarch-test/goldens/int.examples.uplc.golden @@ -4,5 +4,4 @@ example1 (program 1.0.0 ((\i0 -> addInteger (i1 12 32) (i1 5 4)) (\i0 -> \i0 -> example2 (program 1.0.0 (\i0 -> i1 (\i0 -> addInteger i1 1) (\i0 -> subtractInteger i1 1))) fib.lam (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2)))))))))) (force ifThenElse))) fib.app.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i3 (equalsInteger i1 0) (delay 0) (delay (force (i3 (equalsInteger i1 1) (delay 1) (delay (addInteger (i2 (subtractInteger i1 1)) (i2 (subtractInteger i1 2))))))))) 9) (force ifThenElse))) -fib.error (program 1.0.0 error) uglyDouble (program 1.0.0 (\i0 -> addInteger i1 i1)) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=false.bench.golden b/plutarch-test/goldens/list.dev=false.bench.golden deleted file mode 100644 index fbc365f7d..000000000 --- a/plutarch-test/goldens/list.dev=false.bench.golden +++ /dev/null @@ -1,25 +0,0 @@ -pmatch {"exBudgetCPU":954809,"exBudgetMemory":420,"scriptSizeBytes":63} -phead {"exBudgetCPU":11768237,"exBudgetMemory":39293,"scriptSizeBytes":79} -ptail {"exBudgetCPU":34066124,"exBudgetMemory":115806,"scriptSizeBytes":142} -pnull.empty {"exBudgetCPU":957454,"exBudgetMemory":3532,"scriptSizeBytes":64} -pnull.nonempty {"exBudgetCPU":11777860,"exBudgetMemory":39893,"scriptSizeBytes":84} -pconcat.identity {"exBudgetCPU":80305252,"exBudgetMemory":279509,"scriptSizeBytes":188} -pmap.eg {"exBudgetCPU":47260168,"exBudgetMemory":161924,"scriptSizeBytes":163} -pmap.identity {"exBudgetCPU":1334100,"exBudgetMemory":5900,"scriptSizeBytes":97} -pfilter.evens {"exBudgetCPU":42495518,"exBudgetMemory":129344,"scriptSizeBytes":175} -pfilter.gt5 {"exBudgetCPU":37045658,"exBudgetMemory":125334,"scriptSizeBytes":170} -pzipWith.double {"exBudgetCPU":60015372,"exBudgetMemory":206316,"scriptSizeBytes":174} -pfoldl.nonempty {"exBudgetCPU":21216007,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.nonempty-primed {"exBudgetCPU":21216007,"exBudgetMemory":71413,"scriptSizeBytes":96} -pfoldl.empty {"exBudgetCPU":1603387,"exBudgetMemory":5433,"scriptSizeBytes":85} -pfoldl.empty-primed {"exBudgetCPU":1603387,"exBudgetMemory":5433,"scriptSizeBytes":85} -elemAt.elemAt_3_[1..10] {"exBudgetCPU":17628654,"exBudgetMemory":56708,"scriptSizeBytes":127} -elemAt.elemAt_0_[1..10] {"exBudgetCPU":13173756,"exBudgetMemory":43796,"scriptSizeBytes":127} -elemAt.elemAt_9_[1..10] {"exBudgetCPU":26538450,"exBudgetMemory":82532,"scriptSizeBytes":127} -find.find_(==3)_[1..4] {"exBudgetCPU":8776061,"exBudgetMemory":29622,"scriptSizeBytes":100} -find.find_(==5)_[1..4] {"exBudgetCPU":10583550,"exBudgetMemory":36224,"scriptSizeBytes":100} -x1+x2.builtin {"exBudgetCPU":771257,"exBudgetMemory":2098,"scriptSizeBytes":29} -x1+x2.pmatch {"exBudgetCPU":1673965,"exBudgetMemory":4562,"scriptSizeBytes":48} -uncons.ChooseList {"exBudgetCPU":607636,"exBudgetMemory":1864,"scriptSizeBytes":26} -uncons.head-and-tail {"exBudgetCPU":383531,"exBudgetMemory":1464,"scriptSizeBytes":23} -uncons.head-and-tail-and-null {"exBudgetCPU":869178,"exBudgetMemory":2997,"scriptSizeBytes":35} \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=false.uplc.eval.golden b/plutarch-test/goldens/list.dev=false.uplc.eval.golden deleted file mode 100644 index 24db9cb06..000000000 --- a/plutarch-test/goldens/list.dev=false.uplc.eval.golden +++ /dev/null @@ -1,25 +0,0 @@ -pmatch (program 1.0.0 error) -phead (program 1.0.0 True) -ptail (program 1.0.0 True) -pnull.empty (program 1.0.0 True) -pnull.nonempty (program 1.0.0 True) -pconcat.identity (program 1.0.0 True) -pmap.eg (program 1.0.0 True) -pmap.identity (program 1.0.0 True) -pfilter.evens (program 1.0.0 True) -pfilter.gt5 (program 1.0.0 True) -pzipWith.double (program 1.0.0 True) -pfoldl.nonempty (program 1.0.0 True) -pfoldl.nonempty-primed (program 1.0.0 True) -pfoldl.empty (program 1.0.0 True) -pfoldl.empty-primed (program 1.0.0 True) -elemAt.elemAt_3_[1..10] (program 1.0.0 4) -elemAt.elemAt_0_[1..10] (program 1.0.0 1) -elemAt.elemAt_9_[1..10] (program 1.0.0 10) -find.find_(==3)_[1..4] (program 1.0.0 (\i0 -> \i0 -> i2 3)) -find.find_(==5)_[1..4] (program 1.0.0 (\i0 -> \i0 -> force i1)) -x1+x2.builtin (program 1.0.0 3) -x1+x2.pmatch (program 1.0.0 3) -uncons.ChooseList (program 1.0.0 [2,3,4,5]) -uncons.head-and-tail (program 1.0.0 [2,3,4,5]) -uncons.head-and-tail-and-null (program 1.0.0 [2,3,4,5]) \ No newline at end of file diff --git a/plutarch-test/goldens/list.dev=false.uplc.golden b/plutarch-test/goldens/list.dev=false.uplc.golden deleted file mode 100644 index d5c69ce5e..000000000 --- a/plutarch-test/goldens/list.dev=false.uplc.golden +++ /dev/null @@ -1,25 +0,0 @@ -pmatch (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,3,1] (\i0 -> \i0 -> error) (delay error))) -phead (program 1.0.0 (equalsInteger 1 ((\i0 -> i1 (\i0 -> \i0 -> i2) (delay error)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) -ptail (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i1 [2,3,4,5,6,7,8,9,10]) ((\i0 -> i1 (\i0 -> \i0 -> i1) (delay error)) (i1 [1,2,3,4,5,6,7,8,9,10]))) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pnull.empty (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) []))) -pnull.nonempty (program 1.0.0 ((\i0 -> force ifThenElse i1 False True) ((\i0 -> i1 (\i0 -> \i0 -> False) (delay True)) ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])))) -pconcat.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force ((\i0 -> \i0 -> i4 i2 i1 (delay False)) (i1 (i3 (i4 i10) (\i0 -> \i0 -> force i1)) (i3 (\i0 -> \i0 -> force i1) (i4 i10))) (delay (i1 (i3 (\i0 -> \i0 -> force i1) (i4 i10)) (i4 i10))))) (i4 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))))) (force ifThenElse)) (\i0 -> \i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i10 i2 (i4 i1)) (delay i3)) i2)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList)) [1,2,3,4,5,6,7,8,9,10])) -pmap.eg (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i3 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i9 (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> addInteger i1 i1) (i1 [1,2,3,4,5,6,7,8,9,10])) (i1 [2,4,6,8,10,12,14,16,18,20])) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pmap.identity (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i2 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (i5 i2) (i4 i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> i1) (\i0 -> \i0 -> force i1)) (\i0 -> \i0 -> force i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfilter.evens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> equalsInteger (modInteger i1 2) 0) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [2,4,6,8,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pfilter.gt5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) ((\i0 -> i4 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 (i5 i2) (delay (i10 i2 (i4 i1))) (delay (i4 i1)))) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> lessThanInteger 5 i1) (i2 [1,2,3,4,5,6,7,8,9,10])) (i2 [6,7,8,9,10])) (force ifThenElse)) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pzipWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (force ifThenElse (equalsInteger i4 i2) (delay (i7 i3 i1)) (delay False))) (delay False)) (delay (i1 (\i0 -> \i0 -> False) (delay True)))) (i3 (\i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 (addInteger i4 i2) (i7 i3 i1)) (delay (\i0 -> \i0 -> force i1))) (delay (\i0 -> \i0 -> force i1))) (i2 i1) (i2 i1)) (i2 [2,4,6,8,10,12,14,16,18,20])) [1,2,3,4,5,6,7,8,9,10]) (i1 (\i0 -> \i0 -> force (i4 i1 (delay (\i0 -> \i0 -> force i1)) (delay (i5 (i6 i1) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3)) (force headList)) (force tailList))) -pfoldl.nonempty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.nonempty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) -55) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.empty (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -pfoldl.empty-primed (program 1.0.0 ((\i0 -> equalsInteger (i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> i5 (subtractInteger i4 i2) i1) (delay i2)) 0 (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) 0) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -elemAt.elemAt_3_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 3 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -elemAt.elemAt_0_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 0 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -elemAt.elemAt_9_[1..10] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> force (i3 (lessThanInteger i2 0) (delay error) (delay (i4 (\i0 -> \i0 -> \i0 -> force (i6 (equalsInteger i2 0) (delay (i1 (\i0 -> \i0 -> i2) (delay error))) (delay (i3 (subtractInteger i2 1) (i1 (\i0 -> \i0 -> i1) (delay error)))))) i2 i1)))) 9 (i2 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4,5,6,7,8,9,10])) (force ifThenElse)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -find.find_(==3)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 3) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -find.find_(==5)_[1..4] (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force ifThenElse (i4 i2) (delay (\i0 -> \i0 -> i2 i4)) (delay (i5 i4 i1)))) (delay (\i0 -> \i0 -> force i1))) (\i0 -> equalsInteger i1 5) (i1 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3,4])) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -x1+x2.builtin (program 1.0.0 ((\i0 -> (\i0 -> addInteger (i1 (force tailList i2)) (i1 i2)) (force headList)) [1,2,3,4,5])) -x1+x2.pmatch (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i1 i3 (delay error) (delay ((\i0 -> force (i2 i1 (delay error) (delay (addInteger (i3 i4) (i3 i1))))) (force tailList i3))))) (force (force chooseList))) (force headList)) [1,2,3,4,5])) -uncons.ChooseList (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay error) (delay (force tailList i1)))) [1,2,3,4,5])) -uncons.head-and-tail (program 1.0.0 ((\i0 -> (\i0 -> force tailList i2) (force headList i1)) [1,2,3,4,5])) -uncons.head-and-tail-and-null (program 1.0.0 ((\i0 -> (\i0 -> force (force ifThenElse i1 (delay error) (delay ((\i0 -> force tailList i3) (force headList i2))))) (force nullList i1)) [1,2,3,4,5])) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=false.bench.golden b/plutarch-test/goldens/rational.dev=false.bench.golden deleted file mode 100644 index e05a841fe..000000000 --- a/plutarch-test/goldens/rational.dev=false.bench.golden +++ /dev/null @@ -1,24 +0,0 @@ -literal {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} -ops.+ {"exBudgetCPU":30296189,"exBudgetMemory":74895,"scriptSizeBytes":330} -ops.- {"exBudgetCPU":30296189,"exBudgetMemory":74895,"scriptSizeBytes":330} -ops.* {"exBudgetCPU":53593714,"exBudgetMemory":128071,"scriptSizeBytes":374} -ops.harmonic-sum {"exBudgetCPU":80085207,"exBudgetMemory":189749,"scriptSizeBytes":372} -ops.multi-product {"exBudgetCPU":89908183,"exBudgetMemory":215883,"scriptSizeBytes":385} -compare {"exBudgetCPU":25790475,"exBudgetMemory":62977,"scriptSizeBytes":320} -round.5/3 {"exBudgetCPU":17167406,"exBudgetMemory":36449,"scriptSizeBytes":338} -round.4/3 {"exBudgetCPU":15711457,"exBudgetMemory":33346,"scriptSizeBytes":338} -round.-5/2 {"exBudgetCPU":16830920,"exBudgetMemory":35349,"scriptSizeBytes":353} -round.-1/4 {"exBudgetCPU":15940934,"exBudgetMemory":33448,"scriptSizeBytes":353} -truncate.5/4 {"exBudgetCPU":13138101,"exBudgetMemory":30239,"scriptSizeBytes":289} -truncate.7/4 {"exBudgetCPU":14594050,"exBudgetMemory":33342,"scriptSizeBytes":289} -truncate.1/4 {"exBudgetCPU":11682152,"exBudgetMemory":27136,"scriptSizeBytes":289} -truncate.-7/4 {"exBudgetCPU":16577953,"exBudgetMemory":36949,"scriptSizeBytes":303} -properFraction.-1/2 {"exBudgetCPU":38497862,"exBudgetMemory":91924,"scriptSizeBytes":444} -properFraction.-3/2 {"exBudgetCPU":40252288,"exBudgetMemory":95429,"scriptSizeBytes":449} -properFraction.-4/3 {"exBudgetCPU":40252288,"exBudgetMemory":95429,"scriptSizeBytes":449} -data.id.0.5 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.2 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.11/3 {"exBudgetCPU":11680925,"exBudgetMemory":28633,"scriptSizeBytes":242} -div by 0.1/0 {"exBudgetCPU":382485,"exBudgetMemory":104,"scriptSizeBytes":242} -div by 0.recip 0 {"exBudgetCPU":289589,"exBudgetMemory":102,"scriptSizeBytes":37} -div by 0.1/(1-1) {"exBudgetCPU":8982059,"exBudgetMemory":20136,"scriptSizeBytes":312} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=false.uplc.eval.golden b/plutarch-test/goldens/rational.dev=false.uplc.eval.golden deleted file mode 100644 index 7043e1a1d..000000000 --- a/plutarch-test/goldens/rational.dev=false.uplc.eval.golden +++ /dev/null @@ -1,24 +0,0 @@ -literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 4 4)) (multiplyInteger 1 (divideInteger 4 4)))) -ops.- (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) -ops.* (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 4 1)))) -ops.harmonic-sum (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 77 1)) (multiplyInteger 1 (divideInteger 60 1)))) -ops.multi-product (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) -compare (program 1.0.0 True) -round.5/3 (program 1.0.0 2) -round.4/3 (program 1.0.0 1) -round.-5/2 (program 1.0.0 -2) -round.-1/4 (program 1.0.0 0) -truncate.5/4 (program 1.0.0 1) -truncate.7/4 (program 1.0.0 1) -truncate.1/4 (program 1.0.0 0) -truncate.-7/4 (program 1.0.0 -1) -properFraction.-1/2 (program 1.0.0 True) -properFraction.-3/2 (program 1.0.0 True) -properFraction.-4/3 (program 1.0.0 True) -data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) -data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 11 1)) (multiplyInteger 1 (divideInteger 3 1)))) -div by 0.1/0 (program 1.0.0 error) -div by 0.recip 0 (program 1.0.0 error) -div by 0.1/(1-1) (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=false.uplc.golden b/plutarch-test/goldens/rational.dev=false.uplc.golden deleted file mode 100644 index d5e8b5d4c..000000000 --- a/plutarch-test/goldens/rational.dev=false.uplc.golden +++ /dev/null @@ -1,24 +0,0 @@ -literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay error) (delay i1)))) (force ifThenElse))) -data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) -data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay error) (delay i1))) (\i0 -> i1 i2 i3))) (\i0 -> i1 0 1))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=false.bench.golden b/plutarch-test/goldens/rec.Data.dev=false.bench.golden deleted file mode 100644 index 8299cd1b1..000000000 --- a/plutarch-test/goldens/rec.Data.dev=false.bench.golden +++ /dev/null @@ -1,8 +0,0 @@ -pdata.simple {"exBudgetCPU":1958023,"exBudgetMemory":5255,"scriptSizeBytes":70} -pdata.simple-value-deconstructed {"exBudgetCPU":2036719,"exBudgetMemory":5487,"scriptSizeBytes":72} -pdata.flat-data-deconstructed {"exBudgetCPU":5446621,"exBudgetMemory":14431,"scriptSizeBytes":169} -pdata.shallow-data-deconstructed {"exBudgetCPU":6445889,"exBudgetMemory":17559,"scriptSizeBytes":200} -fieldFromData.simple {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":36} -fieldFromData.nested.flat {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":48} -fieldFromData.nested.shallow {"exBudgetCPU":529100,"exBudgetMemory":2400,"scriptSizeBytes":115} -pfromData {"exBudgetCPU":437100,"exBudgetMemory":2000,"scriptSizeBytes":83} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.Data.dev=false.uplc.eval.golden deleted file mode 100644 index 36500794c..000000000 --- a/plutarch-test/goldens/rec.Data.dev=false.uplc.eval.golden +++ /dev/null @@ -1,22 +0,0 @@ -pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) -pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) -pdata.flat-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d87980 - , #06 - , #4d53616c75742c204d6f6e646521 - , #04 - , #d87980 - , #09 - , #4d53616c75742c204d6f6e646521 - , #4c486f6c612c204d756e646f21 ] )) -pdata.shallow-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d8799fd87980064d53616c75742c204d6f6e646521ff - , #04 - , #d8799fd87980094d53616c75742c204d6f6e646521ff - , #4c486f6c612c204d756e646f21 ] )) -fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) -fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1)))) -fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) -pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=false.uplc.golden b/plutarch-test/goldens/rec.Data.dev=false.uplc.golden deleted file mode 100644 index 2e016894d..000000000 --- a/plutarch-test/goldens/rec.Data.dev=false.uplc.golden +++ /dev/null @@ -1,8 +0,0 @@ -pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) -pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) -pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) -pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) -fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay error))) (unConstrData i1)))) -fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay error))) (unConstrData i1))) (force tailList))) -fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay error))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay error))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) -pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay error))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=true.bench.golden b/plutarch-test/goldens/rec.Data.dev=true.bench.golden deleted file mode 100644 index d6fec1224..000000000 --- a/plutarch-test/goldens/rec.Data.dev=true.bench.golden +++ /dev/null @@ -1,8 +0,0 @@ -pdata.simple {"exBudgetCPU":1958023,"exBudgetMemory":5255,"scriptSizeBytes":70} -pdata.simple-value-deconstructed {"exBudgetCPU":2036719,"exBudgetMemory":5487,"scriptSizeBytes":72} -pdata.flat-data-deconstructed {"exBudgetCPU":5446621,"exBudgetMemory":14431,"scriptSizeBytes":169} -pdata.shallow-data-deconstructed {"exBudgetCPU":6445889,"exBudgetMemory":17559,"scriptSizeBytes":200} -fieldFromData.simple {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":72} -fieldFromData.nested.flat {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":84} -fieldFromData.nested.shallow {"exBudgetCPU":690100,"exBudgetMemory":3100,"scriptSizeBytes":161} -pfromData {"exBudgetCPU":437100,"exBudgetMemory":2000,"scriptSizeBytes":118} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.Data.dev=true.uplc.eval.golden deleted file mode 100644 index 54d6a5011..000000000 --- a/plutarch-test/goldens/rec.Data.dev=true.uplc.eval.golden +++ /dev/null @@ -1,22 +0,0 @@ -pdata.simple (program 1.0.0 #d8799fd87980064d53616c75742c204d6f6e646521ff) -pdata.simple-value-deconstructed (program 1.0.0 (0, [#d87980, #06, #4d53616c75742c204d6f6e646521])) -pdata.flat-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d87980 - , #06 - , #4d53616c75742c204d6f6e646521 - , #04 - , #d87980 - , #09 - , #4d53616c75742c204d6f6e646521 - , #4c486f6c612c204d756e646f21 ] )) -pdata.shallow-data-deconstructed (program 1.0.0 ( 0 -, [ #d87980 - , #d8799fd87980064d53616c75742c204d6f6e646521ff - , #04 - , #d8799fd87980094d53616c75742c204d6f6e646521ff - , #4c486f6c612c204d756e646f21 ] )) -fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) -fieldFromData.nested.flat (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force tailList (force tailList (force tailList (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) -fieldFromData.nested.shallow (program 1.0.0 (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force tailList (force tailList (force (force sndPair) i1)))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2))) -pfromData (program 1.0.0 (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (force (force fstPair) (unConstrData i1)) 1) (force headList (force (force sndPair) i2))) (unIData (force headList (force tailList (force (force sndPair) i2)))) (decodeUtf8 (unBData (force headList (force tailList (force tailList (force (force sndPair) i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.Data.dev=true.uplc.golden b/plutarch-test/goldens/rec.Data.dev=true.uplc.golden deleted file mode 100644 index 8c43e91d7..000000000 --- a/plutarch-test/goldens/rec.Data.dev=true.uplc.golden +++ /dev/null @@ -1,8 +0,0 @@ -pdata.simple (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ])))))) -pdata.simple-value-deconstructed (program 1.0.0 (unConstrData ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))))) -pdata.flat-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i9 1 0) [ ]) (force mkCons (constrData (force ifThenElse i8 1 0) [ ]) (force mkCons (iData i7) (force mkCons (bData (encodeUtf8 i6)) (force mkCons (iData i5) (force mkCons (constrData (force ifThenElse i4 1 0) [ ]) (force mkCons (iData i3) (force mkCons (bData (encodeUtf8 i2)) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))))))) "Salut, Monde!")) -pdata.shallow-data-deconstructed (program 1.0.0 ((\i0 -> unConstrData ((\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i5 1 0) [ ]) (force mkCons (i4 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (iData i3) (force mkCons (i2 (\i0 -> \i0 -> \i0 -> constrData 0 (force mkCons (constrData (force ifThenElse i3 1 0) [ ]) (force mkCons (iData i2) (force mkCons (bData (encodeUtf8 i1)) [ ]))))) (force mkCons (bData (encodeUtf8 i1)) [ ])))))))) "Salut, Monde!")) -fieldFromData.simple (program 1.0.0 (\i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (force tailList (force (force sndPair) i1)))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1)))) -fieldFromData.nested.flat (program 1.0.0 ((\i0 -> \i0 -> unIData ((\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (force headList (i3 (i3 (i3 (i3 (i3 (i3 (force (force sndPair) i1))))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1))) (force tailList))) -fieldFromData.nested.shallow (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i4 (equalsInteger (i5 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i7 (unConstrData i1)) 1) (i7 (i9 i2))) (unIData (i7 (i8 (i9 i2)))) (decodeUtf8 (unBData (i7 (i8 (i8 (i9 i2)))))))) (delay (force (i9 i10 (delay error)))))) (unConstrData i1)) ((\i0 -> force (i3 (equalsInteger (i4 i1) 0) (delay (i5 (i6 (i6 (i6 (i7 i1)))))) (delay (force (i8 i9 (delay error)))))) (unConstrData i1)) (\i0 -> \i0 -> \i0 -> i2)) (force ifThenElse)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair))) (force trace)) "verifySoleConstructor failed")) -pfromData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger (i3 i1) 0) (delay (\i0 -> i1 ((\i0 -> equalsInteger (i5 (unConstrData i1)) 1) (i5 (i7 i2))) (unIData (i5 (i6 (i7 i2)))) (decodeUtf8 (unBData (i5 (i6 (i6 (i7 i2)))))))) (delay (force (force trace "verifySoleConstructor failed" (delay error)))))) (unConstrData i1) (\i0 -> \i0 -> \i0 -> i2)) (force (force fstPair))) (force headList)) (force tailList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden b/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden deleted file mode 100644 index c31acdf7a..000000000 --- a/plutarch-test/goldens/rec.LetRec.dev=false.bench.golden +++ /dev/null @@ -1,8 +0,0 @@ -record {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":52} -record-field {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":52} -even {"exBudgetCPU":598100,"exBudgetMemory":2700,"scriptSizeBytes":82} -even.4 {"exBudgetCPU":6620453,"exBudgetMemory":19018,"scriptSizeBytes":85} -even.5 {"exBudgetCPU":7967419,"exBudgetMemory":22722,"scriptSizeBytes":85} -knownEven {"exBudgetCPU":667100,"exBudgetMemory":3000,"scriptSizeBytes":85} -knownEven.6 {"exBudgetCPU":4202521,"exBudgetMemory":12810,"scriptSizeBytes":87} -knownEven.7 {"exBudgetCPU":5618487,"exBudgetMemory":16814,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden deleted file mode 100644 index 1ccb10873..000000000 --- a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.eval.golden +++ /dev/null @@ -1,8 +0,0 @@ -record (program 1.0.0 12) -record-field (program 1.0.0 12) -even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) -even.4 (program 1.0.0 True) -even.5 (program 1.0.0 False) -knownEven (program 1.0.0 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) -knownEven.6 (program 1.0.0 True) -knownEven.7 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden b/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden deleted file mode 100644 index aba7d8cf0..000000000 --- a/plutarch-test/goldens/rec.LetRec.dev=false.uplc.golden +++ /dev/null @@ -1,8 +0,0 @@ -record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) -even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) -even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) -knownEven (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) -knownEven.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2 6) (force ifThenElse)) (\i0 -> \i0 -> i2))) -knownEven.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2 7) (force ifThenElse)) (\i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden b/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden deleted file mode 100644 index c31acdf7a..000000000 --- a/plutarch-test/goldens/rec.LetRec.dev=true.bench.golden +++ /dev/null @@ -1,8 +0,0 @@ -record {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":52} -record-field {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":52} -even {"exBudgetCPU":598100,"exBudgetMemory":2700,"scriptSizeBytes":82} -even.4 {"exBudgetCPU":6620453,"exBudgetMemory":19018,"scriptSizeBytes":85} -even.5 {"exBudgetCPU":7967419,"exBudgetMemory":22722,"scriptSizeBytes":85} -knownEven {"exBudgetCPU":667100,"exBudgetMemory":3000,"scriptSizeBytes":85} -knownEven.6 {"exBudgetCPU":4202521,"exBudgetMemory":12810,"scriptSizeBytes":87} -knownEven.7 {"exBudgetCPU":5618487,"exBudgetMemory":16814,"scriptSizeBytes":87} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden deleted file mode 100644 index 1ccb10873..000000000 --- a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.eval.golden +++ /dev/null @@ -1,8 +0,0 @@ -record (program 1.0.0 12) -record-field (program 1.0.0 12) -even (program 1.0.0 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse (equalsInteger i1 0) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) -even.4 (program 1.0.0 True) -even.5 (program 1.0.0 False) -knownEven (program 1.0.0 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) (\i0 -> (\i0 -> \i0 -> i1 (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (force ifThenElse ((\i0 -> equalsInteger i1 4) i1) (delay False) (delay (i3 (\i0 -> \i0 -> i2) (subtractInteger i1 1)))))) (\i0 -> i2 i2 i1)) i1) (\i0 -> \i0 -> i1) (subtractInteger i1 1)))))) -knownEven.6 (program 1.0.0 True) -knownEven.7 (program 1.0.0 False) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden b/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden deleted file mode 100644 index aba7d8cf0..000000000 --- a/plutarch-test/goldens/rec.LetRec.dev=true.uplc.golden +++ /dev/null @@ -1,8 +0,0 @@ -record (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -record-field (program 1.0.0 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 True 12 "Hello, World!") (\i0 -> \i0 -> \i0 -> i2))) -even (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) -even.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 4) (force ifThenElse)) (\i0 -> \i0 -> i2))) -even.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i4 (equalsInteger i1 0) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i4 (equalsInteger i1 0) (delay False) (delay (i3 i5 (subtractInteger i1 1)))))) i2 5) (force ifThenElse)) (\i0 -> \i0 -> i2))) -knownEven (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2) (force ifThenElse)) (\i0 -> \i0 -> i2))) -knownEven.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2 6) (force ifThenElse)) (\i0 -> \i0 -> i2))) -knownEven.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> force (i5 (i4 i1) (delay True) (delay (i3 (\i0 -> \i0 -> i1) (subtractInteger i1 1))))) (\i0 -> force (i5 (i4 i1) (delay False) (delay (i3 i6 (subtractInteger i1 1))))))) (\i0 -> equalsInteger i1 4) i2 7) (force ifThenElse)) (\i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=false.bench.golden b/plutarch-test/goldens/rec.nested.dev=false.bench.golden deleted file mode 100644 index a3377e5b6..000000000 --- a/plutarch-test/goldens/rec.nested.dev=false.bench.golden +++ /dev/null @@ -1,22 +0,0 @@ -flat.reconstr-with-rcon {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":60} -flat.nested-field-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.direct-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.pmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.pmatch' {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.rmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.reconstr-with-pcon {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":85} -flat.reconstr-nested-field-value {"exBudgetCPU":1472100,"exBudgetMemory":6500,"scriptSizeBytes":91} -flat.nested-record-access-term {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -flat.nested-match-term {"exBudgetCPU":1058100,"exBudgetMemory":4700,"scriptSizeBytes":77} -flat.nested-match-value {"exBudgetCPU":1058100,"exBudgetMemory":4700,"scriptSizeBytes":77} -shallow.constr-with-rcon {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":65} -shallow.nested-field-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.direct-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.pmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.pmatch' {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.rmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.reconstr-with-pcon {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":80} -shallow.reconstr-nested-field-value {"exBudgetCPU":1196100,"exBudgetMemory":5300,"scriptSizeBytes":88} -shallow.nested-record-access-term {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":70} -shallow.nested-match-term {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-match-value {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.nested.dev=false.uplc.eval.golden deleted file mode 100644 index 5806523da..000000000 --- a/plutarch-test/goldens/rec.nested.dev=false.uplc.eval.golden +++ /dev/null @@ -1,22 +0,0 @@ -flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -flat.nested-field-access (program 1.0.0 9) -flat.nested-field-value.direct-access (program 1.0.0 9) -flat.nested-field-value.pmatch (program 1.0.0 9) -flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -flat.reconstr-nested-field-value (program 1.0.0 9) -flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -flat.nested-match-term (program 1.0.0 "Salut, Monde!") -flat.nested-match-value (program 1.0.0 "Salut, Monde!") -shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -shallow.nested-field-access (program 1.0.0 9) -shallow.nested-field-value.direct-access (program 1.0.0 9) -shallow.nested-field-value.pmatch (program 1.0.0 9) -shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -shallow.reconstr-nested-field-value (program 1.0.0 9) -shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -shallow.nested-match-term (program 1.0.0 "Salut, Monde!") -shallow.nested-match-value (program 1.0.0 "Salut, Monde!") \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=false.uplc.golden b/plutarch-test/goldens/rec.nested.dev=false.uplc.golden deleted file mode 100644 index b776b3b33..000000000 --- a/plutarch-test/goldens/rec.nested.dev=false.uplc.golden +++ /dev/null @@ -1,22 +0,0 @@ -flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) -flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) -flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) -flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) -shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) -shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) -shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) -shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=true.bench.golden b/plutarch-test/goldens/rec.nested.dev=true.bench.golden deleted file mode 100644 index a3377e5b6..000000000 --- a/plutarch-test/goldens/rec.nested.dev=true.bench.golden +++ /dev/null @@ -1,22 +0,0 @@ -flat.reconstr-with-rcon {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":60} -flat.nested-field-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.direct-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.pmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.pmatch' {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.nested-field-value.rmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":67} -flat.reconstr-with-pcon {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":85} -flat.reconstr-nested-field-value {"exBudgetCPU":1472100,"exBudgetMemory":6500,"scriptSizeBytes":91} -flat.nested-record-access-term {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -flat.nested-match-term {"exBudgetCPU":1058100,"exBudgetMemory":4700,"scriptSizeBytes":77} -flat.nested-match-value {"exBudgetCPU":1058100,"exBudgetMemory":4700,"scriptSizeBytes":77} -shallow.constr-with-rcon {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":65} -shallow.nested-field-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.direct-access {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.pmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.pmatch' {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-field-value.rmatch {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.reconstr-with-pcon {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":80} -shallow.reconstr-nested-field-value {"exBudgetCPU":1196100,"exBudgetMemory":5300,"scriptSizeBytes":88} -shallow.nested-record-access-term {"exBudgetCPU":506100,"exBudgetMemory":2300,"scriptSizeBytes":70} -shallow.nested-match-term {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} -shallow.nested-match-value {"exBudgetCPU":782100,"exBudgetMemory":3500,"scriptSizeBytes":73} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.nested.dev=true.uplc.eval.golden deleted file mode 100644 index 5806523da..000000000 --- a/plutarch-test/goldens/rec.nested.dev=true.uplc.eval.golden +++ /dev/null @@ -1,22 +0,0 @@ -flat.reconstr-with-rcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -flat.nested-field-access (program 1.0.0 9) -flat.nested-field-value.direct-access (program 1.0.0 9) -flat.nested-field-value.pmatch (program 1.0.0 9) -flat.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -flat.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -flat.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False False 6 "Salut, Monde!" 4 False 9 "Salut, Monde!" "Hola, Mundo!")) -flat.reconstr-nested-field-value (program 1.0.0 9) -flat.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -flat.nested-match-term (program 1.0.0 "Salut, Monde!") -flat.nested-match-value (program 1.0.0 "Salut, Monde!") -shallow.constr-with-rcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -shallow.nested-field-access (program 1.0.0 9) -shallow.nested-field-value.direct-access (program 1.0.0 9) -shallow.nested-field-value.pmatch (program 1.0.0 9) -shallow.nested-field-value.pmatch' (program 1.0.0 "Salut, Monde!") -shallow.nested-field-value.rmatch (program 1.0.0 "Salut, Monde!") -shallow.reconstr-with-pcon (program 1.0.0 (\i0 -> i1 False (\i0 -> i1 False 6 "Salut, Monde!") 4 (\i0 -> i1 False 9 "Salut, Monde!") "Hola, Mundo!")) -shallow.reconstr-nested-field-value (program 1.0.0 9) -shallow.nested-record-access-term (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -shallow.nested-match-term (program 1.0.0 "Salut, Monde!") -shallow.nested-match-value (program 1.0.0 "Salut, Monde!") \ No newline at end of file diff --git a/plutarch-test/goldens/rec.nested.dev=true.uplc.golden b/plutarch-test/goldens/rec.nested.dev=true.uplc.golden deleted file mode 100644 index b776b3b33..000000000 --- a/plutarch-test/goldens/rec.nested.dev=true.uplc.golden +++ /dev/null @@ -1,22 +0,0 @@ -flat.reconstr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") "Salut, Monde!")) -flat.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -flat.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -flat.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -flat.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -flat.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -flat.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2)) "Salut, Monde!")) -flat.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i10 i9 i8 i7 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i3)) "Salut, Monde!")) -flat.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i9 i8 i7)) "Salut, Monde!")) -flat.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -flat.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False False 6 i2 4 False 9 i2 "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i1 i5 i4 i3) (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -shallow.constr-with-rcon (program 1.0.0 ((\i0 -> \i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") "Salut, Monde!")) -shallow.nested-field-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -shallow.nested-field-value.direct-access (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -shallow.nested-field-value.pmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i2))) "Salut, Monde!")) -shallow.nested-field-value.pmatch' (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -shallow.nested-field-value.rmatch (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -shallow.reconstr-with-pcon (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2)) "Salut, Monde!")) -shallow.reconstr-nested-field-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i1 i6 i5 i4 i3 i2) (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2) (\i0 -> \i0 -> \i0 -> i2)) "Salut, Monde!")) -shallow.nested-record-access-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i4)) "Salut, Monde!")) -shallow.nested-match-term (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) -shallow.nested-match-value (program 1.0.0 ((\i0 -> (\i0 -> i1 False (\i0 -> i1 False 6 i3) 4 (\i0 -> i1 False 9 i3) "Hola, Mundo!") (\i0 -> \i0 -> \i0 -> \i0 -> \i0 -> i2 (\i0 -> \i0 -> \i0 -> i1))) "Salut, Monde!")) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=false.bench.golden b/plutarch-test/goldens/rec.simple.dev=false.bench.golden deleted file mode 100644 index 64d79d08f..000000000 --- a/plutarch-test/goldens/rec.simple.dev=false.bench.golden +++ /dev/null @@ -1,10 +0,0 @@ -constr.pcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} -constr.pcon' {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} -constr.rcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} -field.access-term {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.direct-access {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.pmatch {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.pmatch' {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.rmatch {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -reconstr.pcon {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":39} -reconstr.field-access {"exBudgetCPU":575100,"exBudgetMemory":2600,"scriptSizeBytes":43} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=false.uplc.eval.golden b/plutarch-test/goldens/rec.simple.dev=false.uplc.eval.golden deleted file mode 100644 index 29a355d8e..000000000 --- a/plutarch-test/goldens/rec.simple.dev=false.uplc.eval.golden +++ /dev/null @@ -1,10 +0,0 @@ -constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -field.access-term (program 1.0.0 6) -field.value.direct-access (program 1.0.0 6) -field.value.pmatch (program 1.0.0 "Salut, Monde!") -field.value.pmatch' (program 1.0.0 "Salut, Monde!") -field.value.rmatch (program 1.0.0 "Salut, Monde!") -reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -reconstr.field-access (program 1.0.0 6) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=false.uplc.golden b/plutarch-test/goldens/rec.simple.dev=false.uplc.golden deleted file mode 100644 index f609e3d38..000000000 --- a/plutarch-test/goldens/rec.simple.dev=false.uplc.golden +++ /dev/null @@ -1,10 +0,0 @@ -constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) -reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=true.bench.golden b/plutarch-test/goldens/rec.simple.dev=true.bench.golden deleted file mode 100644 index 64d79d08f..000000000 --- a/plutarch-test/goldens/rec.simple.dev=true.bench.golden +++ /dev/null @@ -1,10 +0,0 @@ -constr.pcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} -constr.pcon' {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} -constr.rcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":30} -field.access-term {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.direct-access {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.pmatch {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.pmatch' {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -field.value.rmatch {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":33} -reconstr.pcon {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":39} -reconstr.field-access {"exBudgetCPU":575100,"exBudgetMemory":2600,"scriptSizeBytes":43} \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=true.uplc.eval.golden b/plutarch-test/goldens/rec.simple.dev=true.uplc.eval.golden deleted file mode 100644 index 29a355d8e..000000000 --- a/plutarch-test/goldens/rec.simple.dev=true.uplc.eval.golden +++ /dev/null @@ -1,10 +0,0 @@ -constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -field.access-term (program 1.0.0 6) -field.value.direct-access (program 1.0.0 6) -field.value.pmatch (program 1.0.0 "Salut, Monde!") -field.value.pmatch' (program 1.0.0 "Salut, Monde!") -field.value.rmatch (program 1.0.0 "Salut, Monde!") -reconstr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -reconstr.field-access (program 1.0.0 6) \ No newline at end of file diff --git a/plutarch-test/goldens/rec.simple.dev=true.uplc.golden b/plutarch-test/goldens/rec.simple.dev=true.uplc.golden deleted file mode 100644 index f609e3d38..000000000 --- a/plutarch-test/goldens/rec.simple.dev=true.uplc.golden +++ /dev/null @@ -1,10 +0,0 @@ -constr.pcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -constr.pcon' (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -constr.rcon (program 1.0.0 (\i0 -> i1 False 6 "Salut, Monde!")) -field.access-term (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -field.value.direct-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i2))) -field.value.pmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -field.value.pmatch' (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -field.value.rmatch (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> i1))) -reconstr.pcon (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2))) -reconstr.field-access (program 1.0.0 ((\i0 -> i1 False 6 "Salut, Monde!") (\i0 -> \i0 -> \i0 -> \i0 -> i1 i4 i3 i2) (\i0 -> \i0 -> \i0 -> i2))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.bench.golden b/plutarch-test/goldens/show.dev=false.bench.golden deleted file mode 100644 index faed08162..000000000 --- a/plutarch-test/goldens/show.dev=false.bench.golden +++ /dev/null @@ -1 +0,0 @@ -rational.1/2 {"exBudgetCPU":23554887,"exBudgetMemory":53494,"scriptSizeBytes":562} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.uplc.eval.golden b/plutarch-test/goldens/show.dev=false.uplc.eval.golden deleted file mode 100644 index 97ecea086..000000000 --- a/plutarch-test/goldens/show.dev=false.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -rational.1/2 (program 1.0.0 "1/2") \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=false.uplc.golden b/plutarch-test/goldens/show.dev=false.uplc.golden deleted file mode 100644 index 3f77234a2..000000000 --- a/plutarch-test/goldens/show.dev=false.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i24 (equalsInteger i2 0) (delay error) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.bench.golden b/plutarch-test/goldens/trace.dev=false.bench.golden deleted file mode 100644 index 58d2c8cdb..000000000 --- a/plutarch-test/goldens/trace.dev=false.bench.golden +++ /dev/null @@ -1,10 +0,0 @@ -ptrace.one {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -ptrace.two {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -ptraceShowId.right-42 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":10} -ptraceIfTrue.true {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -ptraceIfTrue.false {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -ptraceIfFalse.true {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -ptraceIfFalse.false {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -chained.false.true.false {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -chained.ptrace.true.false {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -chained.ptrace.true.true {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.uplc.eval.golden b/plutarch-test/goldens/trace.dev=false.uplc.eval.golden deleted file mode 100644 index 51bcda305..000000000 --- a/plutarch-test/goldens/trace.dev=false.uplc.eval.golden +++ /dev/null @@ -1,10 +0,0 @@ -ptrace.one (program 1.0.0 ()) -ptrace.two (program 1.0.0 ()) -ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) -ptraceIfTrue.true (program 1.0.0 True) -ptraceIfTrue.false (program 1.0.0 False) -ptraceIfFalse.true (program 1.0.0 True) -ptraceIfFalse.false (program 1.0.0 False) -chained.false.true.false (program 1.0.0 False) -chained.ptrace.true.false (program 1.0.0 False) -chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=false.uplc.golden b/plutarch-test/goldens/trace.dev=false.uplc.golden deleted file mode 100644 index 51bcda305..000000000 --- a/plutarch-test/goldens/trace.dev=false.uplc.golden +++ /dev/null @@ -1,10 +0,0 @@ -ptrace.one (program 1.0.0 ()) -ptrace.two (program 1.0.0 ()) -ptraceShowId.right-42 (program 1.0.0 (\i0 -> \i0 -> i1 42)) -ptraceIfTrue.true (program 1.0.0 True) -ptraceIfTrue.false (program 1.0.0 False) -ptraceIfFalse.true (program 1.0.0 True) -ptraceIfFalse.false (program 1.0.0 False) -chained.false.true.false (program 1.0.0 False) -chained.ptrace.true.false (program 1.0.0 False) -chained.ptrace.true.true (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/uplc-misc.bench.golden b/plutarch-test/goldens/uplc-misc.bench.golden index 8606bfb7a..b156cb07c 100644 --- a/plutarch-test/goldens/uplc-misc.bench.golden +++ b/plutarch-test/goldens/uplc-misc.bench.golden @@ -1,5 +1,4 @@ perror {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} -perror.arg {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":5} laziness.f.d {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} laziness.d.f.d {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} hoist.id.0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":9} diff --git a/plutarch-test/goldens/uplc-misc.uplc.eval.golden b/plutarch-test/goldens/uplc-misc.uplc.eval.golden index 016f4bba5..b1441b8f9 100644 --- a/plutarch-test/goldens/uplc-misc.uplc.eval.golden +++ b/plutarch-test/goldens/uplc-misc.uplc.eval.golden @@ -1,5 +1,4 @@ perror (program 1.0.0 error) -perror.arg (program 1.0.0 error) laziness.f.d (program 1.0.0 0) laziness.d.f.d (program 1.0.0 (delay 0)) hoist.id.0 (program 1.0.0 (\i0 -> i1 0)) diff --git a/plutarch-test/goldens/uplc-misc.uplc.golden b/plutarch-test/goldens/uplc-misc.uplc.golden index 016f4bba5..b1441b8f9 100644 --- a/plutarch-test/goldens/uplc-misc.uplc.golden +++ b/plutarch-test/goldens/uplc-misc.uplc.golden @@ -1,5 +1,4 @@ perror (program 1.0.0 error) -perror.arg (program 1.0.0 error) laziness.f.d (program 1.0.0 0) laziness.d.f.d (program 1.0.0 (delay 0)) hoist.id.0 (program 1.0.0 (\i0 -> i1 0)) diff --git a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs index 331a3ae0f..244c2949c 100644 --- a/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/BoolSpec.hs @@ -22,8 +22,9 @@ spec = do "op" @| pcon PFalse #&& perror @-> \p -> passert $ pnot # p "pand.perror" @\ do - "false" @| pand # pcon PFalse # perror @-> pfails - "true" @| pand # pcon PTrue # perror @-> pfails + -- FIXME + -- "false" @| pand # pcon PFalse # perror @-> pfails + -- "true" @| pand # pcon PTrue # perror @-> pfails "op" @| pcon PTrue #&& perror @-> pfails "por" @\ do "tf" @| pcon PTrue #|| pcon PFalse @-> passert @@ -36,7 +37,8 @@ spec = do "op" @| pcon PTrue #|| perror @-> \p -> passert p "pand.perror" @\ do - "false" @| por # pcon PFalse # perror @-> pfails - "true" @| por # pcon PTrue # perror @-> pfails + -- FIXME + -- "false" @| por # pcon PFalse # perror @-> pfails + -- "true" @| por # pcon PTrue # perror @-> pfails "op.true" @| pcon PTrue #|| perror @-> psucceeds "op.false" @| pcon PFalse #|| perror @-> pfails diff --git a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs index 1c15b3ef2..61afe7ce7 100644 --- a/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/IntegerSpec.hs @@ -20,7 +20,6 @@ spec = do "9" @| fib # 9 @:-> \(p, _script, bench) -> do p `pshouldBe` (34 :: Term _ PInteger) bench `psatisfyWithinBenchmark` Benchmark 1_000_000_000 1_000_000 100 - "error" @| fib # perror @-> pfails "uglyDouble" @| uglyDouble add1 :: Term s (PInteger :--> PInteger :--> PInteger) diff --git a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs b/plutarch-test/plutarch-base/Plutarch/RecSpec.hs deleted file mode 100644 index 093c6efca..000000000 --- a/plutarch-test/plutarch-base/Plutarch/RecSpec.hs +++ /dev/null @@ -1,322 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - -module Plutarch.RecSpec (spec) where - -import qualified Rank2.TH - -import Prelude hiding (even, odd) - -import Plutarch (pcon', pmatch') -import Plutarch.Builtin (pasConstr, pdataImpl, pforgetData, pfromDataImpl) -import Plutarch.Prelude -import Plutarch.Rec ( - DataReader (DataReader, readData), - DataWriter (DataWriter, writeData), - PRecord (PRecord), - RecordFromData, - ScottEncoded, - ScottEncoding, - field, - fieldFromData, - letrec, - rcon, - recordDataFromFieldWriters, - recordFromFieldReaders, - rmatch, - ) -import Plutarch.Rec.TH (deriveAll) -import Plutarch.Test -import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) -import Test.Hspec - -data FlatOuterRecord f = FlatOuterRecord - { flatOuterBool :: f PBool - , flatInner1 :: SampleRecord f - , flatOuterInt :: f PInteger - , flatInner2 :: SampleRecord f - , flatOuterString :: f PString - } - -data ShallowOuterRecord f = ShallowOuterRecord - { shallowOuterBool :: f PBool - , shallowInner1 :: f (PRecord SampleRecord) - , shallowOuterInt :: f PInteger - , shallowInner2 :: f (PRecord SampleRecord) - , shallowOuterString :: f PString - } - -data SampleRecord f = SampleRecord - { sampleBool :: f PBool - , sampleInt :: f PInteger - , sampleString :: f PString - } - -data EvenOdd f = EvenOdd - { even :: f (PInteger :--> PBool) - , odd :: f (PInteger :--> PBool) - } - -data ParameterizedRecord p q f = ParameterizedRecord - { p1 :: f (PInteger :--> PBool) - , p2 :: f (PInteger :--> p :--> PBool) - } - -type instance ScottEncoded EvenOdd a = (PInteger :--> PBool) :--> (PInteger :--> PBool) :--> a - -$(Rank2.TH.deriveAll ''EvenOdd) -$(deriveAll ''SampleRecord) -- also autoderives the @type instance ScottEncoded@ -$(deriveAll ''ParameterizedRecord) -$(deriveAll ''FlatOuterRecord) -$(deriveAll ''ShallowOuterRecord) -instance RecordFromData SampleRecord -instance RecordFromData FlatOuterRecord -instance RecordFromData ShallowOuterRecord - -instance PIsData (PRecord SampleRecord) where - pfromDataImpl = readData (recordFromFieldReaders sampleReader) - pdataImpl = pupcast . writeData (recordDataFromFieldWriters sampleWriter) - -instance PIsData (PRecord FlatOuterRecord) where - pfromDataImpl = readData (recordFromFieldReaders flatOuterReader) - pdataImpl = pupcast . writeData (recordDataFromFieldWriters flatOuterWriter) - -instance PIsData (PRecord ShallowOuterRecord) where - pfromDataImpl = readData (recordFromFieldReaders shallowOuterReader) - pdataImpl = pupcast . writeData (recordDataFromFieldWriters shallowOuterWriter) - -sampleReader :: SampleRecord (DataReader s) -sampleReader = - SampleRecord - { sampleBool = DataReader pfromData - , sampleInt = DataReader pfromData - , sampleString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d - } - -sampleWriter :: SampleRecord (DataWriter s) -sampleWriter = - SampleRecord - { sampleBool = DataWriter pdata - , sampleInt = DataWriter pdata - , sampleString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s - } - -flatOuterReader :: FlatOuterRecord (DataReader s) -flatOuterReader = - FlatOuterRecord - { flatOuterBool = DataReader pfromData - , flatInner1 = sampleReader - , flatOuterInt = DataReader pfromData - , flatInner2 = sampleReader - , flatOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d - } - -flatOuterWriter :: FlatOuterRecord (DataWriter s) -flatOuterWriter = - FlatOuterRecord - { flatOuterBool = DataWriter pdata - , flatInner1 = sampleWriter - , flatOuterInt = DataWriter pdata - , flatInner2 = sampleWriter - , flatOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s - } - -shallowOuterReader :: ShallowOuterRecord (DataReader s) -shallowOuterReader = - ShallowOuterRecord - { shallowOuterBool = DataReader pfromData - , shallowInner1 = DataReader pfromData - , shallowOuterInt = DataReader pfromData - , shallowInner2 = DataReader pfromData - , shallowOuterString = DataReader $ \d -> pdecodeUtf8 #$ pfromData $ punsafeCoerce d - } - -shallowOuterWriter :: ShallowOuterRecord (DataWriter s) -shallowOuterWriter = - ShallowOuterRecord - { shallowOuterBool = DataWriter pdata - , shallowInner1 = DataWriter pdata - , shallowOuterInt = DataWriter pdata - , shallowInner2 = DataWriter pdata - , shallowOuterString = DataWriter $ \s -> punsafeCoerce $ pdata $ pencodeUtf8 # s - } - -sampleFlatOuter :: Term (s :: S) (ScottEncoding FlatOuterRecord (t :: PType)) -sampleFlatOuter = rcon rawFlatOuter - -rawFlatOuter :: FlatOuterRecord (Term s) -rawFlatOuter = - FlatOuterRecord - { flatOuterBool = pcon PFalse - , flatInner1 = rawRecord - , flatOuterInt = 4 - , flatInner2 = rawRecord {sampleInt = 9} - , flatOuterString = "Hola, Mundo!" - } - -sampleShallowOuter :: Term (s :: S) (ScottEncoding ShallowOuterRecord (t :: PType)) -sampleShallowOuter = rcon rawShallowOuter - -rawShallowOuter :: ShallowOuterRecord (Term s) -rawShallowOuter = - ShallowOuterRecord - { shallowOuterBool = pcon PFalse - , shallowInner1 = pcon $ PRecord rawRecord - , shallowOuterInt = 4 - , shallowInner2 = pcon $ PRecord rawRecord {sampleInt = 9} - , shallowOuterString = "Hola, Mundo!" - } - -sampleRecord :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) -sampleRecord = rcon rawRecord - -sampleRecord' :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) -sampleRecord' = pcon' $ PRecord rawRecord - -sampleRecord'' :: Term (s :: S) (PRecord SampleRecord :: PType) -sampleRecord'' = pcon $ PRecord rawRecord - -rawRecord :: SampleRecord (Term s) -rawRecord = - SampleRecord - { sampleBool = pcon PFalse - , sampleInt = 6 - , sampleString = "Salut, Monde!" - } - -sampleRecur :: Term (s :: S) (ScottEncoding SampleRecord (t :: PType)) -sampleRecur = - letrec $ - const - SampleRecord - { sampleBool = pcon PTrue - , sampleInt = 12 - , sampleString = "Hello, World!" - } - -evenOdd :: Term (s :: S) (ScottEncoding EvenOdd (t :: PType)) -evenOdd = letrec evenOddRecursion - where - evenOddRecursion :: EvenOdd (Term s) -> EvenOdd (Term s) - evenOddRecursion EvenOdd {even, odd} = - EvenOdd - { even = plam $ \n -> pif (n #== 0) (pcon PTrue) (odd #$ n - 1) - , odd = plam $ \n -> pif (n #== 0) (pcon PFalse) (even #$ n - 1) - } - -knownEvenOdd :: Term (s :: S) ((PInteger :--> PBool) :--> ScottEncoding EvenOdd (t :: PType)) -knownEvenOdd = plam $ \knownEven -> letrec $ \EvenOdd {even, odd} -> - EvenOdd - { even = plam $ \n -> pif (knownEven # n) (pcon PTrue) (odd #$ n - 1) - , odd = plam $ \n -> pif (knownEven # n) (pcon PFalse) (even #$ n - 1) - } - -sampleData :: Term s (PAsData (PRecord SampleRecord)) -sampleData = pdata (punsafeDowncast sampleRecord) - -flatOuterData :: Term s (PAsData (PRecord FlatOuterRecord)) -flatOuterData = pdata (punsafeDowncast sampleFlatOuter) - -shallowOuterData :: Term s (PAsData (PRecord ShallowOuterRecord)) -shallowOuterData = pdata (punsafeDowncast sampleShallowOuter) - -spec :: Spec -spec = do - -- Plutarch.Rec.verifySoleConstructor uses tracing, so we must create two sets - -- of golden. - describe "rec" $ do - describe "simple" . plutarchDevFlagDescribe . pgoldenSpec $ do - -- Record construction - "constr" @\ do - "pcon" @| sampleRecord'' - "pcon'" @| sampleRecord' - "rcon" @| sampleRecord - "field" @\ do - "access-term" @| sampleRecord' # field sampleInt - "value" @\ do - "direct-access" @| sampleRecord # field sampleInt - "pmatch" @| pmatch sampleRecord'' $ \(PRecord r) -> sampleString r - "pmatch'" @| pmatch' sampleRecord $ \(PRecord r) -> sampleString r - "rmatch" @| rmatch sampleRecord $ \SampleRecord {sampleString = s} -> s - -- Record reconstruction - "reconstr" @\ do - "pcon" @| pmatch' sampleRecord' (pcon @(PRecord SampleRecord)) - -- reconstructed field access - "field-access" @| pto (pmatch' sampleRecord' (pcon @(PRecord SampleRecord))) # field sampleInt - describe "LetRec" . plutarchDevFlagDescribe . pgoldenSpec $ do - "record" @| sampleRecur # field sampleInt - "record-field" @| sampleRecur # field sampleInt - "even" @| evenOdd # field even - "even.4" @| evenOdd # field even # (4 :: Term s PInteger) - "even.5" @| evenOdd # field even # (5 :: Term s PInteger) - "knownEven" @| knownEvenOdd # plam (#== 4) # field even - "knownEven.6" @| knownEvenOdd # plam (#== 4) # field even # (6 :: Term s PInteger) - "knownEven.7" @| knownEvenOdd # plam (#== 4) # field even # (7 :: Term s PInteger) - describe "nested" . plutarchDevFlagDescribe . pgoldenSpec $ do - "flat" @\ do - "reconstr-with-rcon" @| sampleFlatOuter - "nested-field-access" @| sampleFlatOuter # field (sampleInt . flatInner2) - "nested-field-value" @\ do - "direct-access" @| sampleFlatOuter # field (sampleInt . flatInner2) - "pmatch" @| pmatch (pcon $ PRecord rawFlatOuter) $ \(PRecord r) -> sampleInt $ flatInner2 r - "pmatch'" @| pmatch' sampleFlatOuter $ \(PRecord r) -> sampleString $ flatInner2 r - "rmatch" @| rmatch sampleFlatOuter $ \FlatOuterRecord {flatInner2 = SampleRecord {sampleString = s}} -> s - "reconstr-with-pcon" @| pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord)) - "reconstr-nested-field-value" - @| pto (pmatch' sampleFlatOuter (pcon @(PRecord FlatOuterRecord))) # field (sampleInt . flatInner2) - "nested-record-access-term" - @| pmatch' (rcon rawFlatOuter) - $ \(PRecord FlatOuterRecord {flatInner1}) -> pcon $ PRecord flatInner1 - "nested-match-term" - @| rmatch (rcon rawFlatOuter) - $ \(FlatOuterRecord {flatInner2}) -> - rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> - sampleString - "nested-match-value" - @| rmatch (rcon rawFlatOuter) - $ \(FlatOuterRecord {flatInner2}) -> - rmatch (rcon flatInner2) $ \(SampleRecord {sampleString}) -> - sampleString - "shallow" @\ do - "constr-with-rcon" @| sampleShallowOuter - "nested-field-access" - @| pto (sampleShallowOuter # field shallowInner2) # field sampleInt - "nested-field-value" @\ do - "direct-access" - @| pto (sampleShallowOuter # field shallowInner2) # field sampleInt - "pmatch" - @| pmatch (pcon $ PRecord rawShallowOuter) - $ \(PRecord r) -> pto (shallowInner2 r) # field sampleInt - "pmatch'" - @| pmatch' sampleShallowOuter - $ \(PRecord r) -> pto (shallowInner2 r) # field sampleString - "rmatch" - @| rmatch sampleShallowOuter - $ \ShallowOuterRecord {shallowInner2 = inner} -> pto inner # field sampleString - "reconstr-with-pcon" - @| pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord)) - "reconstr-nested-field-value" - @| pto (pto (pmatch' sampleShallowOuter (pcon @(PRecord ShallowOuterRecord))) # field shallowInner2) # field sampleInt - "nested-record-access-term" - @| pmatch' sampleShallowOuter - $ \(PRecord ShallowOuterRecord {shallowInner1}) -> shallowInner1 - "nested-match-term" - @| pmatch' sampleShallowOuter - $ \(PRecord ShallowOuterRecord {shallowInner2}) -> - pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> - sampleString - "nested-match-value" - @| pmatch' sampleShallowOuter - $ \(PRecord ShallowOuterRecord {shallowInner2}) -> - pmatch shallowInner2 $ \(PRecord SampleRecord {sampleString}) -> - sampleString - describe "Data" . plutarchDevFlagDescribe . pgoldenSpec $ do - "pdata" @\ do - "simple" @| sampleData - "simple-value-deconstructed" @| pasConstr # pforgetData sampleData - "flat-data-deconstructed" @| pasConstr # pforgetData flatOuterData - "shallow-data-deconstructed" @| pasConstr # pforgetData shallowOuterData - "fieldFromData" @\ do - "simple" @| plam $ \dat -> plam pfromData #$ fieldFromData sampleInt # dat - "nested.flat" @| plam $ \dat -> plam pfromData #$ fieldFromData (sampleInt . flatInner2) # dat - "nested.shallow" @| plam $ \dat -> pto (plam pfromData #$ fieldFromData shallowInner2 # dat) # field sampleInt - "pfromData" @| plam $ \d -> punsafeCoerce (pfromData d :: Term _ (PRecord SampleRecord)) # field sampleInt diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index ddc078f56..5bb318da3 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -28,6 +28,7 @@ import Codec.Serialise (Serialise, encode) import Data.ByteString (ByteString) import qualified Data.ByteString.Base16 as Base16 import qualified Data.Text.Encoding as TE +import Plutarch (defaultConfig) import Plutarch.Api.V1 ( PScriptContext, mintingPolicySymbol, @@ -130,7 +131,7 @@ adminPubKeyHash = "cc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f" -} authValidatorCompiled :: Plutus.Validator authValidatorCompiled = - mkValidator authValidatorTerm + mkValidator defaultConfig authValidatorTerm authValidatorTerm :: ClosedTerm PValidator authValidatorTerm = @@ -148,7 +149,7 @@ authValidatorHash = validatorHash authValidatorCompiled -- | Similarly, for a MintingPolicy authPolicyCompiled :: Plutus.MintingPolicy authPolicyCompiled = - mkMintingPolicy authPolicyTerm + mkMintingPolicy defaultConfig authPolicyTerm authPolicyTerm :: ClosedTerm PMintingPolicy authPolicyTerm = @@ -166,7 +167,7 @@ authPolicySymbol = -- | ...And for a StakeValidator authStakeValidatorCompiled :: Plutus.StakeValidator authStakeValidatorCompiled = - mkStakeValidator authStakeValidatorTerm + mkStakeValidator defaultConfig authStakeValidatorTerm authStakeValidatorTerm :: ClosedTerm PStakeValidator authStakeValidatorTerm = diff --git a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs index 38ac616ad..cdbddb154 100644 --- a/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/UPLCSpec.hs @@ -37,7 +37,8 @@ spec = do @-> pfails describe "uplc-misc" . pgoldenSpec $ do "perror" @| perror @-> pfails - "perror.arg" @| perror # (1 :: Term s PInteger) @-> pfails + -- FIXME readd test + -- "perror.arg" @| perror # (1 :: Term s PInteger) @-> pfails "laziness" @\ do "f.d" @| (pforce . pdelay $ (0 :: Term s PInteger)) "d.f.d" @| (pdelay . pforce . pdelay $ (0 :: Term s PInteger)) diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index c3d3c1905..918b2bf13 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -13,9 +13,11 @@ common c NoStarIsType BangPatterns BinaryLiterals + BlockArguments ConstrainedClassMethods ConstraintKinds DataKinds + DefaultSignatures DeriveAnyClass DeriveDataTypeable DeriveFoldable @@ -50,17 +52,20 @@ common c OverloadedStrings PartialTypeSignatures PatternGuards + PatternSynonyms PolyKinds PostfixOperators + QuantifiedConstraints RankNTypes RelaxedPolyRec + RoleAnnotations ScopedTypeVariables StandaloneDeriving StandaloneKindSignatures TraditionalRecordSyntax TupleSections TypeApplications - TypeFamilies + TypeFamilyDependencies TypeOperators TypeSynonymInstances ViewPatterns @@ -167,7 +172,6 @@ executable plutarch-test Plutarch.PlutusTypeSpec Plutarch.POrdSpec Plutarch.RationalSpec - Plutarch.RecSpec Plutarch.RecursionSpec Plutarch.ScriptsSpec Plutarch.ShowSpec diff --git a/plutarch.cabal b/plutarch.cabal index e734e09f6..cc3ad37d7 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -55,6 +55,7 @@ common c OverloadedStrings PartialTypeSignatures PatternGuards + PatternSynonyms PolyKinds PostfixOperators QuantifiedConstraints @@ -124,8 +125,6 @@ library Plutarch.Pair Plutarch.Prelude Plutarch.Rational - Plutarch.Rec - Plutarch.Rec.TH Plutarch.Reducible Plutarch.Show Plutarch.String From d7a040bfe127ec0ee7872dda76ab28e001172d91 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Fri, 3 Jun 2022 11:46:04 +0000 Subject: [PATCH 501/584] Add `evalScriptHuge` and use it in `plift'` --- Plutarch/Evaluate.hs | 22 ++++++++-------------- Plutarch/Lift.hs | 4 ++-- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Plutarch/Evaluate.hs b/Plutarch/Evaluate.hs index 4813d0717..f98af30d1 100644 --- a/Plutarch/Evaluate.hs +++ b/Plutarch/Evaluate.hs @@ -1,6 +1,6 @@ {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} -module Plutarch.Evaluate (evaluateBudgetedScript, evaluateScript, evalScript, evalScript', EvalError) where +module Plutarch.Evaluate (evalScript, evalScriptHuge, evalScript', EvalError) where import Data.Text (Text) import qualified PlutusCore as PLC @@ -12,7 +12,6 @@ import PlutusCore.Evaluation.Machine.ExBudget ( import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultCekParameters) import PlutusCore.Evaluation.Machine.ExMemory (ExCPU (ExCPU), ExMemory (ExMemory)) import PlutusLedgerApi.V1.Scripts (Script (Script)) -import qualified PlutusLedgerApi.V1.Scripts as Scripts import UntypedPlutusCore ( Program (Program), Term, @@ -20,18 +19,6 @@ import UntypedPlutusCore ( import qualified UntypedPlutusCore as UPLC import qualified UntypedPlutusCore.Evaluation.Machine.Cek as Cek -{-# DEPRECATED evaluateScript "use evalScript" #-} -evaluateScript :: Script -> Either Scripts.ScriptError (ExBudget, [Text], Script) -evaluateScript = evaluateBudgetedScript $ ExBudget (ExCPU maxInt) (ExMemory maxInt) - where - maxInt = fromIntegral (maxBound :: Int) - -{-# DEPRECATED evaluateBudgetedScript "use evalScript'" #-} -evaluateBudgetedScript :: ExBudget -> Script -> Either Scripts.ScriptError (ExBudget, [Text], Script) -evaluateBudgetedScript budget script = case evalScript' budget script of - (Right res, remaining, logs) -> Right (remaining, logs, res) - (Left _, _, logs) -> Left $ Scripts.EvaluationError logs "evaluation failed" - type EvalError = (Cek.CekEvaluationException PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun) -- | Evaluate a script with a big budget, returning the trace log and term result. @@ -41,6 +28,13 @@ evalScript script = evalScript' budget script -- from https://github.com/input-output-hk/cardano-node/blob/master/configuration/cardano/mainnet-alonzo-genesis.json#L17 budget = ExBudget (ExCPU 10000000000) (ExMemory 10000000) +-- | Evaluate a script with a huge budget, returning the trace log and term result. +evalScriptHuge :: Script -> (Either EvalError Script, ExBudget, [Text]) +evalScriptHuge script = evalScript' budget script + where + -- from https://github.com/input-output-hk/cardano-node/blob/master/configuration/cardano/mainnet-alonzo-genesis.json#L17 + budget = ExBudget (ExCPU maxBound) (ExMemory maxBound) + -- | Evaluate a script with a specific budget, returning the trace log and term result. evalScript' :: ExBudget -> Script -> (Either (Cek.CekEvaluationException PLC.NamedDeBruijn PLC.DefaultUni PLC.DefaultFun) Script, ExBudget, [Text]) evalScript' budget (Script (Program _ _ t)) = case evalTerm budget (UPLC.termMapNames UPLC.fakeNameDeBruijn $ t) of diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 11c7729ad..1c1ed815b 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -35,7 +35,7 @@ import Data.Coerce (Coercible, coerce) import Data.Kind (Constraint, Type) import Data.Text (Text) import GHC.Stack (HasCallStack) -import Plutarch.Evaluate (EvalError, evalScript) +import Plutarch.Evaluate (EvalError, evalScriptHuge) import Plutarch.Internal (ClosedTerm, Config (Config, tracingMode), PType, Term, compile, punsafeConstantInternal, pattern DoTracing) import qualified PlutusCore as PLC import PlutusCore.Builtin (KnownTypeError, readKnownConstant) @@ -109,7 +109,7 @@ This will fully evaluate the arbitrary closed expression, and convert the result plift' :: forall p. PUnsafeLiftDecl p => Config -> ClosedTerm p -> Either LiftError (PLifted p) plift' config prog = case compile config prog of Left msg -> Left $ LiftError_CompilationError msg - Right script -> case evalScript script of + Right script -> case evalScriptHuge script of (Right (Scripts.unScript -> UPLC.Program _ _ term), _, _) -> case readKnownConstant term of Right r -> case pconstantFromRepr r of From 6d47f7d2513eebdfc9f1531d3494fc5ce7a6d5dc Mon Sep 17 00:00:00 2001 From: Las Safin Date: Fri, 3 Jun 2022 12:29:41 +0000 Subject: [PATCH 502/584] Deprecate `PCon` and `PMatch` --- Plutarch.hs | 6 ++++-- Plutarch/Api/V1/AssocMap.hs | 4 ++-- Plutarch/Internal/Other.hs | 8 +++++--- Plutarch/Internal/PlutusType.hs | 34 ++++++++++++++++++--------------- Plutarch/Prelude.hs | 6 ++++-- 5 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Plutarch.hs b/Plutarch.hs index 22ffc7417..30dce77ac 100644 --- a/Plutarch.hs +++ b/Plutarch.hs @@ -21,8 +21,10 @@ module Plutarch ( (#$), (#), pinl, - PCon (..), - PMatch (..), + PCon, + PMatch, + pcon, + pmatch, pto, pfix, POpaque (..), diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 041fbdd08..d7c818dc8 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -64,19 +64,18 @@ import Plutarch.Prelude ( PAsData, PBool (PFalse), PBuiltinPair, - PCon (pcon), PConstantData, PEq ((#==)), PIsData, PLiftData, PListLike (pcons, pnil), - PMatch (pmatch), PMaybe (PJust, PNothing), POrd ((#<)), PType, PlutusType, S, Term, + pcon, pdata, pfromData, pfstBuiltin, @@ -84,6 +83,7 @@ import Plutarch.Prelude ( pif, plam, plet, + pmatch, precList, psndBuiltin, pto, diff --git a/Plutarch/Internal/Other.hs b/Plutarch/Internal/Other.hs index 9c65153d8..014659341 100644 --- a/Plutarch/Internal/Other.hs +++ b/Plutarch/Internal/Other.hs @@ -24,8 +24,10 @@ module Plutarch.Internal.Other ( (#$), (#), pinl, - PCon (..), - PMatch (..), + PCon, + PMatch, + pcon, + pmatch, pto, pfix, POpaque (..), @@ -44,7 +46,7 @@ import GHC.Stack (HasCallStack) import Plutarch.Internal (ClosedTerm, Config, PType, Term, compile, phoistAcyclic, punsafeCoerce, (:-->)) import qualified Plutarch.Internal as PI import Plutarch.Internal.PLam (pinl, plam, (#), (#$)) -import Plutarch.Internal.PlutusType (PCon (pcon), PMatch (pmatch), PlutusType (PInner, pcon', pmatch')) +import Plutarch.Internal.PlutusType (PCon, PInner, PMatch, PlutusType, pcon, pcon', pmatch, pmatch') import PlutusCore.Pretty (prettyPlcReadableDebug) import PlutusLedgerApi.V1.Scripts (Script (Script)) diff --git a/Plutarch/Internal/PlutusType.hs b/Plutarch/Internal/PlutusType.hs index afc60261f..1e0c0bca1 100644 --- a/Plutarch/Internal/PlutusType.hs +++ b/Plutarch/Internal/PlutusType.hs @@ -3,9 +3,14 @@ {-# LANGUAGE UndecidableInstances #-} module Plutarch.Internal.PlutusType ( - PlutusType (..), - PCon (..), - PMatch (..), + PlutusType, + PCon, + PMatch, + pcon', + pmatch', + pmatch, + pcon, + PInner, ) where import Data.Kind (Type) @@ -81,7 +86,7 @@ import Plutarch.Internal.TypeFamily (ToPType, ToPType2) Further examples can be found in examples/PlutusType.hs -} -class (PCon a, PMatch a) => PlutusType (a :: PType) where +class PlutusType (a :: PType) where -- `b' :: k'` causes GHC to fail type checking at various places -- due to not being able to expand the type family. type PInner a (b' :: PType) :: PType @@ -117,19 +122,18 @@ class (PCon a, PMatch a) => PlutusType (a :: PType) where Term s b pmatch' x f = gpmatch @a x (f . gpto) -instance {-# OVERLAPPABLE #-} PlutusType a => PMatch a where - pmatch x f = pmatch' (punsafeCoerce x) f +{-# DEPRECATED PCon "Use PlutusType" #-} +type PCon = PlutusType +{-# DEPRECATED PMatch "Use PlutusType" #-} +type PMatch = PlutusType -instance PlutusType a => PCon a where - pcon x = punsafeCoerce (pcon' x) +-- | Construct a Plutarch Term via a Haskell datatype +pcon :: PlutusType a => a s -> Term s a +pcon x = punsafeCoerce (pcon' x) -class PCon a where - -- | Construct a Plutarch Term via a Haskell datatype - pcon :: a s -> Term s a - -class PMatch a where - -- | Pattern match over Plutarch Terms via a Haskell datatype - pmatch :: Term s a -> (a s -> Term s b) -> Term s b +-- | Pattern match over Plutarch Terms via a Haskell datatype +pmatch :: PlutusType a => Term s a -> (a s -> Term s b) -> Term s b +pmatch x f = pmatch' (punsafeCoerce x) f -- | Generic version of `pcon'` gpcon :: diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 2b13ace67..d68f7ab92 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -21,8 +21,10 @@ module Plutarch.Prelude ( S, PType, PlutusType (PInner), - PCon (pcon), - PMatch (pmatch), + PCon, + PMatch, + pcon, + pmatch, -- * Integers and integer utilities PInteger, From db7baab2365fa65b33dc302775fd224993bf32af Mon Sep 17 00:00:00 2001 From: Las Safin Date: Fri, 3 Jun 2022 13:16:02 +0000 Subject: [PATCH 503/584] Simplify module structure by not re-exporting from `Plutarch.Internal.Other` --- Plutarch.hs | 77 +++++++++++++------------- Plutarch/Bool.hs | 21 ++++--- Plutarch/Builtin.hs | 3 +- Plutarch/ByteString.hs | 7 +-- Plutarch/DataRepr/Internal.hs | 3 +- Plutarch/DataRepr/Internal/FromData.hs | 2 +- Plutarch/Integer.hs | 11 ++-- Plutarch/Internal/Other.hs | 33 +---------- Plutarch/Pair.hs | 3 +- Plutarch/Prelude.hs | 1 - Plutarch/Show.hs | 21 ++++--- Plutarch/String.hs | 7 +-- Plutarch/Trace.hs | 21 ++++--- Plutarch/TryFrom.hs | 7 +-- Plutarch/Unit.hs | 3 +- Plutarch/Unsafe.hs | 4 +- 16 files changed, 98 insertions(+), 126 deletions(-) diff --git a/Plutarch.hs b/Plutarch.hs index 30dce77ac..05469e28b 100644 --- a/Plutarch.hs +++ b/Plutarch.hs @@ -1,46 +1,49 @@ module Plutarch ( - (:-->), - ClosedTerm, - compile, - Dig, - hashTerm, - papp, - pdelay, - PDelayed, - perror, - pforce, - phoistAcyclic, - plam', - plet, - Term, - S, - PType, - PlutusType (..), - printTerm, - printScript, - (#$), - (#), - pinl, - PCon, - PMatch, - pcon, - pmatch, - pto, - pfix, - POpaque (..), - popaque, - plam, - DerivePNewtype (DerivePNewtype), + (PI.:-->), + PI.ClosedTerm, + PI.compile, + PI.Dig, + PI.hashTerm, + PI.papp, + PI.pdelay, + PI.PDelayed, + PI.perror, + PI.pforce, + PI.phoistAcyclic, + PI.plet, + PI.Term, + PI.S, + PI.PType, + PP.PlutusType, + PP.PInner, + PP.pcon, + PP.pmatch, + PP.PCon, + PP.PMatch, + PO.printTerm, + PO.printScript, + (PL.#$), + (PL.#), + PL.pinl, + PO.pto, + PO.pfix, + PO.POpaque (PO.POpaque), + PO.popaque, + PL.plam, + PO.DerivePNewtype (PO.DerivePNewtype), PT.TermCont (TermCont), PT.hashOpenTerm, PT.runTermCont, PT.unTermCont, - Config (Config, tracingMode), - TracingMode (NoTracing, DoTracing, DetTracing), - pgetConfig, - defaultConfig, + PI.Config (Config, tracingMode), + PI.TracingMode (NoTracing, DoTracing, DetTracing), + PI.pgetConfig, + PI.defaultConfig, ) where -import Plutarch.Internal.Other +import qualified Plutarch.Internal as PI +import qualified Plutarch.Internal.Other as PO +import qualified Plutarch.Internal.PLam as PL +import qualified Plutarch.Internal.PlutusType as PP import qualified Plutarch.TermCont as PT import Prelude () diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 58d10aaf3..e462ebb66 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -29,25 +29,24 @@ import Generics.SOP ( ccompare_NS, hcliftA2, ) -import Plutarch.Internal (plet, punsafeAsClosedTerm) -import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) -import Plutarch.Internal.Other ( - DerivePNewtype, +import Plutarch.Internal ( PDelayed, - PlutusType (PInner, pcon', pmatch'), S, Term, - pcon, pdelay, pforce, phoistAcyclic, - plam, - pmatch, + plet, + punsafeAsClosedTerm, + (:-->), + ) +import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) +import Plutarch.Internal.Other ( + DerivePNewtype, pto, - (#), - (#$), - type (:-->), ) +import Plutarch.Internal.PLam (plam, (#), (#$)) +import Plutarch.Internal.PlutusType (PInner, PlutusType, pcon, pcon', pmatch, pmatch') import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 3b9b5096e..0cc9204ff 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -42,14 +42,12 @@ import Plutarch ( S, Term, pcon, - pcon', pdelay, pforce, phoistAcyclic, plam, plet, pmatch, - pmatch', pto, (#), (#$), @@ -58,6 +56,7 @@ import Plutarch ( import Plutarch.Bool (PBool (..), PEq, pif', (#&&), (#==)) import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) +import Plutarch.Internal.PlutusType (pcon', pmatch') import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstant, diff --git a/Plutarch/ByteString.hs b/Plutarch/ByteString.hs index 0d639e779..d0bc33acd 100644 --- a/Plutarch/ByteString.hs +++ b/Plutarch/ByteString.hs @@ -18,11 +18,8 @@ import Data.Word (Word8) import GHC.Stack (HasCallStack) import Plutarch.Bool (PEq, POrd, (#<), (#<=), (#==)) import Plutarch.Integer (PInteger) -import Plutarch.Internal.Other ( - Term, - (#), - type (:-->), - ) +import Plutarch.Internal (Term, (:-->)) +import Plutarch.Internal.PLam ((#)) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index c6b18e8c9..169ff6418 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -69,7 +69,6 @@ import Plutarch ( S, Term, pcon, - pcon', pdelay, perror, pforce, @@ -77,7 +76,6 @@ import Plutarch ( plam, plet, pmatch, - pmatch', popaque, pto, (#), @@ -112,6 +110,7 @@ import Plutarch.DataRepr.Internal.HList ( import Plutarch.Integer (PInteger) import Plutarch.Internal (S (SI)) import Plutarch.Internal.Generic (MkNS, PCode, PGeneric, gpfrom, gpto, mkNS, mkSum) +import Plutarch.Internal.PlutusType (pcon', pmatch') import Plutarch.Lift ( PConstant, PConstantDecl, diff --git a/Plutarch/DataRepr/Internal/FromData.hs b/Plutarch/DataRepr/Internal/FromData.hs index 4d2b0e0a6..2c47f7464 100644 --- a/Plutarch/DataRepr/Internal/FromData.hs +++ b/Plutarch/DataRepr/Internal/FromData.hs @@ -3,7 +3,7 @@ module Plutarch.DataRepr.Internal.FromData (PFromDataable, pmaybeFromAsData) where -import Plutarch.Internal.Other (PType, Term) +import Plutarch.Internal (PType, Term) import Plutarch.Builtin (PAsData, PIsData, pfromData) diff --git a/Plutarch/Integer.hs b/Plutarch/Integer.hs index 454bacce3..a018bd8ef 100644 --- a/Plutarch/Integer.hs +++ b/Plutarch/Integer.hs @@ -4,16 +4,17 @@ module Plutarch.Integer (PInteger, PIntegral (..)) where import Plutarch.Bool (PEq, POrd, pif, (#<), (#<=), (#==)) -import Plutarch.Internal.Other ( - DerivePNewtype, +import Plutarch.Internal ( Term, phoistAcyclic, - plam, plet, + (:-->), + ) +import Plutarch.Internal.Other ( + DerivePNewtype, pto, - (#), - type (:-->), ) +import Plutarch.Internal.PLam (plam, (#)) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, diff --git a/Plutarch/Internal/Other.hs b/Plutarch/Internal/Other.hs index 014659341..09bc2bb5e 100644 --- a/Plutarch/Internal/Other.hs +++ b/Plutarch/Internal/Other.hs @@ -2,42 +2,13 @@ {-# LANGUAGE UndecidableInstances #-} module Plutarch.Internal.Other ( - (PI.:-->), - PI.ClosedTerm, - PI.compile, - PI.Dig, - PI.hashTerm, - PI.papp, - PI.pdelay, - PI.PDelayed, - PI.perror, - PI.pforce, - PI.phoistAcyclic, - PI.plam', - PI.plet, - PI.Term, - PI.S, - PI.PType, - PlutusType (..), printTerm, printScript, - (#$), - (#), - pinl, - PCon, - PMatch, - pcon, - pmatch, pto, pfix, POpaque (..), popaque, - plam, DerivePNewtype (DerivePNewtype), - PI.pgetConfig, - PI.Config (..), - PI.TracingMode (..), - PI.defaultConfig, ) where import Data.Coerce (Coercible, coerce) @@ -45,8 +16,8 @@ import qualified Data.Text as T import GHC.Stack (HasCallStack) import Plutarch.Internal (ClosedTerm, Config, PType, Term, compile, phoistAcyclic, punsafeCoerce, (:-->)) import qualified Plutarch.Internal as PI -import Plutarch.Internal.PLam (pinl, plam, (#), (#$)) -import Plutarch.Internal.PlutusType (PCon, PInner, PMatch, PlutusType, pcon, pcon', pmatch, pmatch') +import Plutarch.Internal.PLam (plam, (#)) +import Plutarch.Internal.PlutusType (PInner, PlutusType, pcon', pmatch') import PlutusCore.Pretty (prettyPlcReadableDebug) import PlutusLedgerApi.V1.Scripts (Script (Script)) diff --git a/Plutarch/Pair.hs b/Plutarch/Pair.hs index 6c696b509..eac8508ab 100644 --- a/Plutarch/Pair.hs +++ b/Plutarch/Pair.hs @@ -3,7 +3,8 @@ module Plutarch.Pair (PPair (..)) where import qualified GHC.Generics as GHC import Generics.SOP (Generic, HasDatatypeInfo, I (I)) import Plutarch.Bool (PEq) -import Plutarch.Internal.Other (PType, PlutusType, S, Term) +import Plutarch.Internal (PType, S, Term) +import Plutarch.Internal.PlutusType (PlutusType) import Plutarch.Show (PShow) {- | diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index d68f7ab92..f91d4189f 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -5,7 +5,6 @@ module Plutarch.Prelude ( Term, ClosedTerm, plam, - plam', papp, pdelay, pforce, diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs index 4a6d10ac8..98b3cb7c5 100644 --- a/Plutarch/Show.hs +++ b/Plutarch/Show.hs @@ -33,23 +33,22 @@ import Generics.SOP ( import Plutarch.Bool (PBool, PEq ((#==)), POrd ((#<)), pif) import Plutarch.ByteString (PByteString, pconsBS, pindexBS, plengthBS, psliceBS) import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) -import Plutarch.Internal (punsafeAsClosedTerm) -import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) -import Plutarch.Internal.Other ( - DerivePNewtype, - PlutusType, +import Plutarch.Internal ( Term, perror, - pfix, phoistAcyclic, - plam, plet, - pmatch, + punsafeAsClosedTerm, + (:-->), + ) +import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) +import Plutarch.Internal.Other ( + DerivePNewtype, + pfix, pto, - (#), - (#$), - type (:-->), ) +import Plutarch.Internal.PLam (plam, (#), (#$)) +import Plutarch.Internal.PlutusType (PlutusType, pmatch) import Plutarch.Lift (pconstant) import Plutarch.String (PString, pdecodeUtf8, pencodeUtf8) diff --git a/Plutarch/String.hs b/Plutarch/String.hs index 31618bc28..cf3459fa5 100644 --- a/Plutarch/String.hs +++ b/Plutarch/String.hs @@ -8,11 +8,8 @@ import Data.Text (Text) import qualified Data.Text as Txt import Plutarch.Bool (PEq, (#==)) import Plutarch.ByteString (PByteString) -import Plutarch.Internal.Other ( - Term, - (#), - type (:-->), - ) +import Plutarch.Internal (Term, (:-->)) +import Plutarch.Internal.PLam ((#)) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, diff --git a/Plutarch/Trace.hs b/Plutarch/Trace.hs index bfcb24f8f..5d3a351ef 100644 --- a/Plutarch/Trace.hs +++ b/Plutarch/Trace.hs @@ -8,15 +8,22 @@ module Plutarch.Trace ( ptraceError, ) where --- CPP support isn't great in fourmolu. -{- ORMOLU_DISABLE -} - -import Plutarch.Internal.Other (Term, perror, type (:-->), (#), phoistAcyclic, plet, pforce, pdelay, - tracingMode, - pattern NoTracing, pgetConfig) import Plutarch.Bool (PBool, pif) -import Plutarch.String (PString) +import Plutarch.Internal ( + Term, + pdelay, + perror, + pforce, + pgetConfig, + phoistAcyclic, + plet, + tracingMode, + pattern NoTracing, + type (:-->), + ) +import Plutarch.Internal.PLam ((#)) import Plutarch.Show (PShow, pshow) +import Plutarch.String (PString) import Plutarch.Unsafe (punsafeBuiltin) import qualified PlutusCore as PLC diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index b5f619641..96be385fb 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -15,15 +15,12 @@ import Data.Coerce (Coercible) import Data.Kind (Constraint) import Data.Proxy (Proxy) -import Plutarch.Internal (punsafeCoerce) +import Plutarch.Internal (PType, Term, punsafeCoerce, (:-->)) import Plutarch.Internal.Other ( DerivePNewtype, - PInner, POpaque, - PType, - Term, - (:-->), ) +import Plutarch.Internal.PlutusType (PInner) import Plutarch.Reducible (Reducible (Reduce)) diff --git a/Plutarch/Unit.hs b/Plutarch/Unit.hs index 7a7a42626..82d720bc0 100644 --- a/Plutarch/Unit.hs +++ b/Plutarch/Unit.hs @@ -3,8 +3,9 @@ module Plutarch.Unit (PUnit (..)) where -import Plutarch (PlutusType (PInner, pcon', pmatch'), Term, pcon) +import Plutarch (Term, pcon) import Plutarch.Bool (PBool (PFalse, PTrue), PEq, POrd, (#<), (#<=), (#==)) +import Plutarch.Internal.PlutusType (PInner, PlutusType, pcon', pmatch') import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, diff --git a/Plutarch/Unsafe.hs b/Plutarch/Unsafe.hs index 89fd7c65a..a0ccdc140 100644 --- a/Plutarch/Unsafe.hs +++ b/Plutarch/Unsafe.hs @@ -7,8 +7,10 @@ module Plutarch.Unsafe ( punsafeDowncast, ) where +import Plutarch.Internal (Term) import qualified Plutarch.Internal as PI -import Plutarch.Internal.Other (PInner, POpaque, Term) +import Plutarch.Internal.Other (POpaque) +import Plutarch.Internal.PlutusType (PInner) {- | Unsafely coerce from the 'PInner' representation of a Term, From 006da1237d1f1613c33e1b0b8f89e2dac02c9fcd Mon Sep 17 00:00:00 2001 From: Las Safin Date: Fri, 3 Jun 2022 15:43:53 +0000 Subject: [PATCH 504/584] Make tests work again --- plutarch-extra/Plutarch/Extra/TermCont.hs | 2 +- plutarch-test/common/Plutarch/Test.hs | 2 +- .../goldens/plutustype.example.bench.golden | 6 ++--- .../plutustype.example.uplc.eval.golden | 6 ++--- .../goldens/plutustype.example.uplc.golden | 6 ++--- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 23 ++++--------------- 6 files changed, 12 insertions(+), 33 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/TermCont.hs b/plutarch-extra/Plutarch/Extra/TermCont.hs index 63ae2527c..86e933764 100644 --- a/plutarch-extra/Plutarch/Extra/TermCont.hs +++ b/plutarch-extra/Plutarch/Extra/TermCont.hs @@ -26,7 +26,7 @@ pletC :: Term s a -> TermCont s (Term s a) pletC = tcont . plet -- | Like `pmatch` but works in a `TermCont` monad -pmatchC :: PMatch a => Term s a -> TermCont s (a s) +pmatchC :: PlutusType a => Term s a -> TermCont s (a s) pmatchC = tcont . pmatch -- | Like `pletFields` but works in a `TermCont` monad. diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index 9d2ae2137..a19319831 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -43,7 +43,7 @@ module Plutarch.Test ( import Data.Text (Text) import qualified Data.Text as T -import Plutarch (ClosedTerm, Config (Config, tracingMode), PCon (pcon), compile, printScript, pattern DetTracing) +import Plutarch (ClosedTerm, Config (Config, tracingMode), compile, pcon, printScript, pattern DetTracing) import Plutarch.Bool (PBool (PFalse, PTrue)) import Plutarch.Evaluate (evalScript) import Plutarch.Test.Benchmark ( diff --git a/plutarch-test/goldens/plutustype.example.bench.golden b/plutarch-test/goldens/plutustype.example.bench.golden index ca08b9f05..9504670e3 100644 --- a/plutarch-test/goldens/plutustype.example.bench.golden +++ b/plutarch-test/goldens/plutustype.example.bench.golden @@ -1,6 +1,4 @@ -A-as-0 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} -B-as-1 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":7} -swap.A {"exBudgetCPU":611589,"exBudgetMemory":1502,"scriptSizeBytes":21} -swap.B {"exBudgetCPU":611589,"exBudgetMemory":1502,"scriptSizeBytes":21} +swap.A {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":16} +swap.B {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":16} scottenc.PMaybe {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":14} scottenc.PPair {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":26} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.uplc.eval.golden b/plutarch-test/goldens/plutustype.example.uplc.eval.golden index 2c3a2a96e..9ecb284b8 100644 --- a/plutarch-test/goldens/plutustype.example.uplc.eval.golden +++ b/plutarch-test/goldens/plutustype.example.uplc.eval.golden @@ -1,6 +1,4 @@ -A-as-0 (program 1.0.0 0) -B-as-1 (program 1.0.0 1) -swap.A (program 1.0.0 1) -swap.B (program 1.0.0 0) +swap.A (program 1.0.0 (\i0 -> \i0 -> force i1)) +swap.B (program 1.0.0 (\i0 -> \i0 -> force i2)) scottenc.PMaybe (program 1.0.0 42) scottenc.PPair (program 1.0.0 "Universe") \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.uplc.golden b/plutarch-test/goldens/plutustype.example.uplc.golden index 01b5ecaee..51b337abf 100644 --- a/plutarch-test/goldens/plutustype.example.uplc.golden +++ b/plutarch-test/goldens/plutustype.example.uplc.golden @@ -1,6 +1,4 @@ -A-as-0 (program 1.0.0 0) -B-as-1 (program 1.0.0 1) -swap.A (program 1.0.0 (force (force ifThenElse (equalsInteger 0 0) (delay 1) (delay 0)))) -swap.B (program 1.0.0 (force (force ifThenElse (equalsInteger 1 0) (delay 1) (delay 0)))) +swap.A (program 1.0.0 ((\i0 -> \i0 -> force i2) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> force i2)))) +swap.B (program 1.0.0 ((\i0 -> \i0 -> force i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> force i2)))) scottenc.PMaybe (program 1.0.0 ((\i0 -> \i0 -> i2 42) (\i0 -> i1) (delay error))) scottenc.PPair (program 1.0.0 ((\i0 -> i1 42 "Universe") (\i0 -> \i0 -> i1))) \ No newline at end of file diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index 35879e413..ce2609ece 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -5,7 +5,8 @@ module Plutarch.PlutusTypeSpec (spec) where import Data.Functor.Compose (Compose (Compose)) import Data.SOP.NS (NS (S, Z)) -import Plutarch (pcon', pmatch') +import GHC.Generics (Generic) +import qualified Generics.SOP as SOP import Plutarch.Api.V1 ( PAddress (PAddress), PCredential (PPubKeyCredential, PScriptCredential), @@ -29,8 +30,6 @@ spec :: Spec spec = do describe "plutustype" $ do describe "example" . pgoldenSpec $ do - "A-as-0" @| pcon A @== pconstant @PInteger 0 - "B-as-1" @| pcon B @== pconstant @PInteger 1 "swap" @\ do "A" @| swap (pcon A) @== pcon B "B" @| swap (pcon B) @== pcon A @@ -289,23 +288,9 @@ describe "sanity checks" $ do it "works" $ -} -{- | - A Sum type, which can be encoded as an Enum --} data AB (s :: S) = A | B - -{- | - AB is encoded as an Enum, using values of PInteger - internally. --} -instance PlutusType AB where - type PInner AB _ = PInteger - - pcon' A = 0 - pcon' B = 1 - - pmatch' x f = - pif (x #== 0) (f A) (f B) + deriving stock (Generic) + deriving anyclass (SOP.Generic, PlutusType) {- | Instead of using `pcon'` and `pmatch'` directly, From d77994228283fc4e4df20425a2a82c639b1ff483 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Fri, 3 Jun 2022 15:53:59 +0000 Subject: [PATCH 505/584] Add `PForall` --- Plutarch.hs | 1 + Plutarch/Internal/Other.hs | 4 ++++ Plutarch/Prelude.hs | 1 + 3 files changed, 6 insertions(+) diff --git a/Plutarch.hs b/Plutarch.hs index 05469e28b..ac47f1b0e 100644 --- a/Plutarch.hs +++ b/Plutarch.hs @@ -39,6 +39,7 @@ module Plutarch ( PI.TracingMode (NoTracing, DoTracing, DetTracing), PI.pgetConfig, PI.defaultConfig, + PO.PForall (PForall), ) where import qualified Plutarch.Internal as PI diff --git a/Plutarch/Internal/Other.hs b/Plutarch/Internal/Other.hs index 09bc2bb5e..3bb16ab97 100644 --- a/Plutarch/Internal/Other.hs +++ b/Plutarch/Internal/Other.hs @@ -9,9 +9,11 @@ module Plutarch.Internal.Other ( POpaque (..), popaque, DerivePNewtype (DerivePNewtype), + PForall (PForall), ) where import Data.Coerce (Coercible, coerce) +import Data.Kind (Type) import qualified Data.Text as T import GHC.Stack (HasCallStack) import Plutarch.Internal (ClosedTerm, Config, PType, Term, compile, phoistAcyclic, punsafeCoerce, (:-->)) @@ -122,3 +124,5 @@ ptypeOuter = coerce punsafeDowncast :: (forall b. Term s (PInner a b)) -> Term s a punsafeDowncast x = PI.punsafeCoerce x + +data PForall (a :: Type) (b :: a -> PType) s = PForall (forall (x :: a). Term s (b x)) diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index f91d4189f..73a46a5df 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -24,6 +24,7 @@ module Plutarch.Prelude ( PMatch, pcon, pmatch, + PForall (PForall), -- * Integers and integer utilities PInteger, From e8fe502697ff0484a16069ff4653676a198fc73f Mon Sep 17 00:00:00 2001 From: MangoIV Date: Thu, 9 Jun 2022 01:19:08 +0200 Subject: [PATCH 506/584] adjusted the docs to work with current api --- docs/Run.md | 60 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/docs/Run.md b/docs/Run.md index 8701b9dc5..af77d2719 100644 --- a/docs/Run.md +++ b/docs/Run.md @@ -82,34 +82,44 @@ You can compile a Plutarch term using `compile` (from `Plutarch` module), making I often use these helper functions to test Plutarch quickly: ```haskell -import Data.Text (Text) -import Plutarch (ClosedTerm, compile) -import Plutarch.Evaluate (evalScript, EvalError) -import Plutus.V1.Ledger.Api (Data, ExBudget) -import Plutus.V1.Ledger.Scripts (Script (unScript), applyArguments) -import UntypedPlutusCore (DeBruijn, DefaultFun, DefaultUni, Program) - -evalT :: ClosedTerm a -> (Either EvalError (Program DeBruijn DefaultUni DefaultFun ()), ExBudget, [Text]) +module Eval (evalT, evalSerialize, evalWithArgsT, evalWithArgsT') where + +import qualified Codec.CBOR.Write as Write +import Codec.Serialise (Serialise, encode) +import Data.Bifunctor (first) +import qualified Data.ByteString.Base16 as Base16 +import Data.Text (Text, pack) +import qualified Data.Text.Encoding as TE +import Plutarch (ClosedTerm, compile, defaultConfig) +import Plutarch.Evaluate (evalScript) +import PlutusLedgerApi.V1 (Data, ExBudget) +import PlutusLedgerApi.V1.Scripts (Script (unScript), applyArguments) +import UntypedPlutusCore (DeBruijn, DefaultFun, DefaultUni, Program) + +evalSerialize :: ClosedTerm a -> Either Text Text +evalSerialize x = encodeSerialise . (\(_, _, a) -> a) <$> evalT x + where + encodeSerialise :: Serialise a => a -> Text + encodeSerialise = TE.decodeUtf8 . Base16.encode . Write.toStrictByteString . encode + +evalT :: ClosedTerm a -> Either Text (Script, ExBudget, [Text]) evalT x = evalWithArgsT x [] -evalWithArgsT :: ClosedTerm a -> [Data] -> (Either EvalError (Program DeBruijn DefaultUni DefaultFun ()), ExBudget, [Text]) -evalWithArgsT x args = (\(res, budg, trcs) -> (fmap unScript res, budg, trcs)) - . evalScript - . flip applyArguments args - $ compile x +evalWithArgsT :: ClosedTerm a -> [Data] -> Either Text (Script, ExBudget, [Text]) +evalWithArgsT x args = do + cmp <- compile defaultConfig x + let (escr, budg, trc) = evalScript $ applyArguments cmp args + scr <- first (pack . show) escr + pure (scr, budg, trc) + +evalWithArgsT' :: ClosedTerm a -> [Data] -> Either Text (Program DeBruijn DefaultUni DefaultFun (), ExBudget, [Text]) +evalWithArgsT' x args = + (\(res, budg, trcs) -> (unScript res, budg, trcs)) + <$> evalWithArgsT x args ``` -The fields in the result triple correspond to script result, execution budget (how much memory and CPU units were used), and trace log - respectively. Often you're only interested in the script result, in that case you can use: - -```haskell -evalT :: ClosedTerm a -> Either EvalError (Program DeBruijn DefaultUni DefaultFun ()) -evalT x = evalWithArgsT x [] - -evalWithArgsT :: ClosedTerm a -> [Data] -> Either EvalError (Program DeBruijn DefaultUni DefaultFun ()) -evalWithArgsT x args = (\(res, _, _) -> fmap unScript res) - . evalScript - . flip applyArguments args - $ compile x -``` +The fields in the result triple correspond to script result, execution budget (how much memory and CPU units were used), and trace log - respectively. +Of course if you're only interested in the result of the script evaluation, you can just ignore the exbudget and tracelog just like `evalSerialize` does. +`evalSerialize` is a function that you can use to quickly obtain a serialized script. > Note: You can pretty much ignore the UPLC types involved here. All it really means is that the result is a "UPLC program". When it's printed, it's pretty legible - especially for debugging purposes. Although not necessary to use Plutarch, you may find the [Plutonomicon UPLC guide](https://github.com/Plutonomicon/plutonomicon/blob/main/uplc.md) useful. From 436680b22c2e9469e041e717c89e1dab19831c28 Mon Sep 17 00:00:00 2001 From: Mango The Fourth <40720523+MangoIV@users.noreply.github.com> Date: Sat, 11 Jun 2022 10:59:20 +0200 Subject: [PATCH 507/584] Update Run.md --- docs/Run.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Run.md b/docs/Run.md index af77d2719..c1daf8c80 100644 --- a/docs/Run.md +++ b/docs/Run.md @@ -97,7 +97,7 @@ import PlutusLedgerApi.V1.Scripts (Script (unScript), applyArguments) import UntypedPlutusCore (DeBruijn, DefaultFun, DefaultUni, Program) evalSerialize :: ClosedTerm a -> Either Text Text -evalSerialize x = encodeSerialise . (\(_, _, a) -> a) <$> evalT x +evalSerialize x = encodeSerialise . (\(a, _, _) -> a) <$> evalT x where encodeSerialise :: Serialise a => a -> Text encodeSerialise = TE.decodeUtf8 . Base16.encode . Write.toStrictByteString . encode From ee776e8c91522551c3659206c020f8fdefbf8953 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 22 Jun 2022 01:32:00 +0000 Subject: [PATCH 508/584] Rework stuff --- Plutarch.hs | 21 +- Plutarch/Api/V1/Address.hs | 31 +- Plutarch/Api/V1/AssocMap.hs | 51 +-- Plutarch/Api/V1/Contexts.hs | 34 +- Plutarch/Api/V1/Crypto.hs | 4 +- Plutarch/Api/V1/DCert.hs | 13 +- Plutarch/Api/V1/Interval.hs | 41 +-- Plutarch/Api/V1/Maybe.hs | 19 +- Plutarch/Api/V1/Scripts.hs | 24 +- Plutarch/Api/V1/Time.hs | 7 +- Plutarch/Api/V1/Tx.hs | 43 +-- Plutarch/Api/V1/Value.hs | 18 +- Plutarch/Bool.hs | 31 +- Plutarch/Builtin.hs | 143 ++++---- Plutarch/ByteString.hs | 2 + Plutarch/DataRepr.hs | 5 +- Plutarch/DataRepr/Internal.hs | 392 ++++++++-------------- Plutarch/DataRepr/Internal/Field.hs | 90 +++-- Plutarch/DataRepr/Internal/FromData.hs | 6 +- Plutarch/DataRepr/Internal/HList.hs | 11 +- Plutarch/DataRepr/Internal/HList/Utils.hs | 4 +- Plutarch/Either.hs | 18 +- Plutarch/FFI.hs | 158 ++++----- Plutarch/Integer.hs | 35 +- Plutarch/Internal.hs | 14 +- Plutarch/Internal/Generic.hs | 100 +++--- Plutarch/Internal/Newtype.hs | 34 ++ Plutarch/Internal/Other.hs | 70 +--- Plutarch/Internal/PLam.hs | 6 +- Plutarch/Internal/PlutusType.hs | 366 +++++--------------- Plutarch/Internal/Quantification.hs | 12 + Plutarch/Internal/ScottEncoding.hs | 157 +++++++++ Plutarch/Internal/TypeFamily.hs | 8 +- Plutarch/Internal/Witness.hs | 8 + Plutarch/Lift.hs | 4 +- Plutarch/List.hs | 11 +- Plutarch/Maybe.hs | 12 +- Plutarch/Num.hs | 63 ++++ Plutarch/Pair.hs | 12 +- Plutarch/Prelude.hs | 11 +- Plutarch/Rational.hs | 96 +++--- Plutarch/Reducible.hs | 42 ++- Plutarch/Show.hs | 46 ++- Plutarch/String.hs | 1 + Plutarch/TryFrom.hs | 74 ++-- Plutarch/Unit.hs | 3 +- Plutarch/Unsafe.hs | 5 +- plutarch.cabal | 31 +- 48 files changed, 1096 insertions(+), 1291 deletions(-) create mode 100644 Plutarch/Internal/Newtype.hs create mode 100644 Plutarch/Internal/Quantification.hs create mode 100644 Plutarch/Internal/ScottEncoding.hs create mode 100644 Plutarch/Internal/Witness.hs create mode 100644 Plutarch/Num.hs diff --git a/Plutarch.hs b/Plutarch.hs index ac47f1b0e..caddcef72 100644 --- a/Plutarch.hs +++ b/Plutarch.hs @@ -30,7 +30,6 @@ module Plutarch ( PO.POpaque (PO.POpaque), PO.popaque, PL.plam, - PO.DerivePNewtype (PO.DerivePNewtype), PT.TermCont (TermCont), PT.hashOpenTerm, PT.runTermCont, @@ -39,12 +38,30 @@ module Plutarch ( PI.TracingMode (NoTracing, DoTracing, DetTracing), PI.pgetConfig, PI.defaultConfig, - PO.PForall (PForall), + PQ.PForall (PForall), + PQ.PSome (PSome), + PS.PScottEncoded (PScottEncoded), + PS.PlutusTypeScott, + PN.PlutusTypeNewtype, + PP.DerivePlutusType, + PP.DPTStrat, + PP.PCovariant, + PP.PCovariant', + PP.PContravariant, + PP.PContravariant', + PP.PVariant, + PP.PVariant', ) where import qualified Plutarch.Internal as PI +import qualified Plutarch.Internal.Newtype as PN import qualified Plutarch.Internal.Other as PO import qualified Plutarch.Internal.PLam as PL import qualified Plutarch.Internal.PlutusType as PP +import qualified Plutarch.Internal.Quantification as PQ +import qualified Plutarch.Internal.ScottEncoding as PS +import Plutarch.Num () import qualified Plutarch.TermCont as PT + +-- import orphan instances import Prelude () diff --git a/Plutarch/Api/V1/Address.hs b/Plutarch/Api/V1/Address.hs index 2513a5002..a90898ce2 100644 --- a/Plutarch/Api/V1/Address.hs +++ b/Plutarch/Api/V1/Address.hs @@ -7,9 +7,6 @@ module Plutarch.Api.V1.Address ( PAddress (PAddress), ) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) - import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Crypto (PPubKeyHash) @@ -18,7 +15,6 @@ import Plutarch.Api.V1.Scripts (PValidatorHash) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, - PIsDataReprInstances (PIsDataReprInstances), ) import Plutarch.Lift ( PConstantDecl, @@ -30,12 +26,9 @@ import Plutarch.Prelude data PCredential (s :: S) = PPubKeyCredential (Term s (PDataRecord '["_0" ':= PPubKeyHash])) | PScriptCredential (Term s (PDataRecord '["_0" ':= PValidatorHash])) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PEq, POrd) - via (PIsDataReprInstances PCredential) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType (PCredential) where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PCredential where type PLifted PCredential = Plutus.Credential deriving via (DerivePConstantViaData Plutus.Credential PCredential) instance PConstantDecl Plutus.Credential @@ -52,12 +45,9 @@ data PStakingCredential (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PEq, POrd) - via PIsDataReprInstances PStakingCredential + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType (PStakingCredential) where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PStakingCredential where type PLifted PStakingCredential = Plutus.StakingCredential deriving via (DerivePConstantViaData Plutus.StakingCredential PStakingCredential) instance PConstantDecl Plutus.StakingCredential @@ -72,12 +62,9 @@ newtype PAddress (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq, POrd) - via PIsDataReprInstances PAddress + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) +instance DerivePlutusType (PAddress) where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PAddress where type PLifted PAddress = Plutus.Address deriving via (DerivePConstantViaData Plutus.Address PAddress) instance PConstantDecl Plutus.Address diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index d7c818dc8..92597d590 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -45,10 +46,7 @@ import qualified PlutusTx.AssocMap as PlutusMap import qualified PlutusTx.Monoid as PlutusTx import qualified PlutusTx.Semigroup as PlutusTx -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) -import Plutarch (pfix) -import Plutarch.Builtin (PBuiltinList (PCons, PNil), PBuiltinMap, ppairDataBuiltin) +import Plutarch.Builtin (PBuiltinMap, ppairDataBuiltin) import Plutarch.Lift ( PConstantDecl, PConstantRepr, @@ -59,39 +57,7 @@ import Plutarch.Lift ( pconstantToRepr, ) import qualified Plutarch.List as List -import Plutarch.Prelude ( - DerivePNewtype (DerivePNewtype), - PAsData, - PBool (PFalse), - PBuiltinPair, - PConstantData, - PEq ((#==)), - PIsData, - PLiftData, - PListLike (pcons, pnil), - PMaybe (PJust, PNothing), - POrd ((#<)), - PType, - PlutusType, - S, - Term, - pcon, - pdata, - pfromData, - pfstBuiltin, - phoistAcyclic, - pif, - plam, - plet, - pmatch, - precList, - psndBuiltin, - pto, - ptraceError, - (#), - (#$), - type (:-->), - ) +import Plutarch.Prelude hiding (pall, pany, pfilter, pmap, pnull, psingleton) import Plutarch.Show (PShow) import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) @@ -99,9 +65,11 @@ import Prelude hiding (all, any, filter, lookup, null) data KeyGuarantees = Sorted | Unsorted -newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) - deriving (PlutusType, PIsData, PEq, PShow) via (DerivePNewtype (PMap keysort k v) (PBuiltinMap k v)) type role PMap nominal nominal nominal nominal +newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, PShow) +instance DerivePlutusType (PMap keysort k v) where type DPTStrat _ = PlutusTypeNewtype instance ( PLiftData k @@ -328,8 +296,9 @@ data MapUnionCarrier k v s = MapUnionCarrier { merge :: Term s (PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) , mergeInsert :: Term s (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) } - deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving stock (Generic) + deriving anyclass (PlutusType) +instance DerivePlutusType (MapUnionCarrier k v) where type DPTStrat _ = PlutusTypeScott mapUnionCarrier :: (POrd k, PIsData k) => Term s ((PAsData v :--> PAsData v :--> PAsData v) :--> MapUnionCarrier k v :--> MapUnionCarrier k v) mapUnionCarrier = phoistAcyclic $ plam \combine self -> diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index f449c17eb..f6fea8955 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -8,9 +8,6 @@ module Plutarch.Api.V1.Contexts ( PScriptPurpose (PMinting, PSpending, PRewarding, PCertifying), ) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) - import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Address ( @@ -31,7 +28,6 @@ import Plutarch.Api.V1.Value ( import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, - PIsDataReprInstances (PIsDataReprInstances), ) import Plutarch.Lift ( PConstantDecl, @@ -59,12 +55,10 @@ newtype PTxInfo (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq) - via PIsDataReprInstances PTxInfo + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq) + +instance DerivePlutusType PTxInfo where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxInfo where type PLifted PTxInfo = Plutus.TxInfo deriving via (DerivePConstantViaData Plutus.TxInfo PTxInfo) instance PConstantDecl Plutus.TxInfo @@ -80,12 +74,10 @@ newtype PScriptContext (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq) - via PIsDataReprInstances PScriptContext + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq) + +instance DerivePlutusType PScriptContext where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PScriptContext where type PLifted PScriptContext = Plutus.ScriptContext deriving via (DerivePConstantViaData Plutus.ScriptContext PScriptContext) instance PConstantDecl Plutus.ScriptContext @@ -98,12 +90,10 @@ data PScriptPurpose (s :: S) | PSpending (Term s (PDataRecord '["_0" ':= PTxOutRef])) | PRewarding (Term s (PDataRecord '["_0" ':= PStakingCredential])) | PCertifying (Term s (PDataRecord '["_0" ':= PDCert])) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PEq) - via (PIsDataReprInstances PScriptPurpose) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq) + +instance DerivePlutusType PScriptPurpose where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PScriptPurpose where type PLifted PScriptPurpose = Plutus.ScriptPurpose deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) instance PConstantDecl Plutus.ScriptPurpose diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index 59e359c5b..6c9b9d772 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -20,7 +20,9 @@ import Plutarch.Lift ( import Plutarch.Prelude newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PPubKeyHash PByteString) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PPubKeyHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PPubKeyHash where type PLifted PPubKeyHash = Plutus.PubKeyHash deriving via diff --git a/Plutarch/Api/V1/DCert.hs b/Plutarch/Api/V1/DCert.hs index 17bee271a..099832e9a 100644 --- a/Plutarch/Api/V1/DCert.hs +++ b/Plutarch/Api/V1/DCert.hs @@ -13,16 +13,12 @@ module Plutarch.Api.V1.DCert ( ), ) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) - import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Address (PStakingCredential) import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), - PIsDataReprInstances (PIsDataReprInstances), ) import Plutarch.Lift (PConstantDecl, PLifted, PUnsafeLiftDecl) import Plutarch.Prelude @@ -43,12 +39,9 @@ data PDCert (s :: S) | PDCertPoolRetire (Term s (PDataRecord '["_0" ':= PPubKeyHash, "_1" ':= PInteger])) | PDCertGenesis (Term s (PDataRecord '[])) | PDCertMir (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PEq, POrd) - via (PIsDataReprInstances PDCert) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PDCert where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PDCert where type PLifted PDCert = Plutus.DCert deriving via (DerivePConstantViaData Plutus.DCert PDCert) instance PConstantDecl Plutus.DCert diff --git a/Plutarch/Api/V1/Interval.hs b/Plutarch/Api/V1/Interval.hs index 7eba3d261..a305a1785 100644 --- a/Plutarch/Api/V1/Interval.hs +++ b/Plutarch/Api/V1/Interval.hs @@ -8,10 +8,7 @@ module Plutarch.Api.V1.Interval ( type PClosure, ) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) - -import Plutarch.DataRepr (PDataFields, PIsDataReprInstances (PIsDataReprInstances)) +import Plutarch.DataRepr (PDataFields) import Plutarch.Prelude type PClosure = PBool @@ -26,12 +23,9 @@ newtype PInterval a (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq, POrd) - via PIsDataReprInstances (PInterval a) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) +instance DerivePlutusType (PInterval a) where type DPTStrat _ = PlutusTypeData newtype PLowerBound a (s :: S) = PLowerBound @@ -43,12 +37,9 @@ newtype PLowerBound a (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq, POrd) - via (PIsDataReprInstances (PLowerBound a)) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) +instance DerivePlutusType (PLowerBound a) where type DPTStrat _ = PlutusTypeData newtype PUpperBound a (s :: S) = PUpperBound @@ -60,20 +51,14 @@ newtype PUpperBound a (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq, POrd) - via (PIsDataReprInstances (PUpperBound a)) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) +instance DerivePlutusType (PUpperBound a) where type DPTStrat _ = PlutusTypeData data PExtended a (s :: S) = PNegInf (Term s (PDataRecord '[])) | PFinite (Term s (PDataRecord '["_0" ':= a])) | PPosInf (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PEq, POrd) - via (PIsDataReprInstances (PExtended a)) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType (PExtended a) where type DPTStrat _ = PlutusTypeData diff --git a/Plutarch/Api/V1/Maybe.hs b/Plutarch/Api/V1/Maybe.hs index f2eb2de88..33d4810a8 100644 --- a/Plutarch/Api/V1/Maybe.hs +++ b/Plutarch/Api/V1/Maybe.hs @@ -5,16 +5,10 @@ module Plutarch.Api.V1.Maybe ( PMaybeData (PDJust, PDNothing), ) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) - import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.DataRepr.Internal ( DerivePConstantViaData (DerivePConstantViaData), - PIsDataReprInstances (PIsDataReprInstances), - PIsDataReprRepr, ) -import Plutarch.DataRepr.Internal.HList.Utils (IndexList) import Plutarch.Lift ( PConstantDecl (PConstanted), PUnsafeLiftDecl (..), @@ -26,12 +20,10 @@ import Plutarch.Unsafe (punsafeCoerce) data PMaybeData a (s :: S) = PDJust (Term s (PDataRecord '["_0" ':= a])) | PDNothing (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PEq) - via PIsDataReprInstances (PMaybeData a) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq) + +instance DerivePlutusType (PMaybeData a) where type DPTStrat _ = PlutusTypeData instance PLiftData a => PUnsafeLiftDecl (PMaybeData a) where type PLifted (PMaybeData a) = Maybe (PLifted a) @@ -47,10 +39,9 @@ instance (PIsData a, POrd a) => POrd (PMaybeData a) where x #<= y = _pmaybeLT True (#<=) # x # y _pmaybeLT :: - PIsData a => Bool -> ( forall s rec. - (rec ~ (IndexList 0 (PIsDataReprRepr (PMaybeData a)))) => + rec ~ '["_0" ':= a] => Term s (PDataRecord rec) -> Term s (PDataRecord rec) -> Term s PBool diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index a3ebd7892..c7f109aa4 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -22,25 +22,33 @@ import Plutarch.Lift ( import Plutarch.Prelude newtype PDatum (s :: S) = PDatum (Term s PData) - deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PDatum PData) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq) +instance DerivePlutusType PDatum where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PDatum where type PLifted PDatum = Plutus.Datum deriving via (DerivePConstantViaBuiltin Plutus.Datum PDatum PData) instance PConstantDecl Plutus.Datum newtype PRedeemer (s :: S) = PRedeemer (Term s PData) - deriving (PlutusType, PIsData, PEq) via (DerivePNewtype PRedeemer PData) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq) +instance DerivePlutusType PRedeemer where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PRedeemer where type PLifted PRedeemer = Plutus.Redeemer deriving via (DerivePConstantViaBuiltin Plutus.Redeemer PRedeemer PData) instance PConstantDecl Plutus.Redeemer newtype PDatumHash (s :: S) = PDatumHash (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PDatumHash PByteString) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PDatumHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PDatumHash where type PLifted PDatumHash = Plutus.DatumHash deriving via (DerivePConstantViaBuiltin Plutus.DatumHash PDatumHash PByteString) instance PConstantDecl Plutus.DatumHash newtype PStakeValidatorHash (s :: S) = PStakeValidatorHash (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PStakeValidatorHash PByteString) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PStakeValidatorHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PStakeValidatorHash where type PLifted PStakeValidatorHash = Plutus.StakeValidatorHash deriving via @@ -49,7 +57,9 @@ deriving via PConstantDecl Plutus.StakeValidatorHash newtype PRedeemerHash (s :: S) = PRedeemerHash (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PRedeemerHash PByteString) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PRedeemerHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PRedeemerHash where type PLifted PRedeemerHash = Plutus.RedeemerHash deriving via @@ -58,7 +68,9 @@ deriving via PConstantDecl Plutus.RedeemerHash newtype PValidatorHash (s :: S) = PValidatorHash (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PValidatorHash PByteString) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PValidatorHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PValidatorHash where type PLifted PValidatorHash = Plutus.ValidatorHash deriving via diff --git a/Plutarch/Api/V1/Time.hs b/Plutarch/Api/V1/Time.hs index c825ef613..b538582b5 100644 --- a/Plutarch/Api/V1/Time.hs +++ b/Plutarch/Api/V1/Time.hs @@ -6,6 +6,7 @@ module Plutarch.Api.V1.Time ( PPOSIXTimeRange, ) where +import Plutarch.Num (PNum) import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Interval (PInterval) @@ -19,9 +20,9 @@ import Plutarch.Prelude newtype PPOSIXTime (s :: S) = PPOSIXTime (Term s PInteger) - deriving (PlutusType, PIsData, PEq, POrd, PIntegral) via (DerivePNewtype PPOSIXTime PInteger) - -deriving via (Term s (DerivePNewtype PPOSIXTime PInteger)) instance Num (Term s PPOSIXTime) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd, PIntegral, PNum) +instance DerivePlutusType PPOSIXTime where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PPOSIXTime where type PLifted PPOSIXTime = Plutus.POSIXTime deriving via diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index d22081d46..ad6d199bf 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -8,9 +8,6 @@ module Plutarch.Api.V1.Tx ( PTxInInfo (PTxInInfo), ) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) - import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Address (PAddress) @@ -24,7 +21,6 @@ import Plutarch.Api.V1.Value ( import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, - PIsDataReprInstances (PIsDataReprInstances), ) import Plutarch.Lift ( PConstantDecl, @@ -35,12 +31,9 @@ import Plutarch.Prelude newtype PTxId (s :: S) = PTxId (Term s (PDataRecord '["_0" ':= PByteString])) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq, POrd) - via PIsDataReprInstances PTxId + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) +instance DerivePlutusType PTxId where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId deriving via (DerivePConstantViaData Plutus.TxId PTxId) instance PConstantDecl Plutus.TxId @@ -56,12 +49,10 @@ newtype PTxOutRef (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq, POrd) - via PIsDataReprInstances PTxOutRef + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) + +instance DerivePlutusType PTxOutRef where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxOutRef where type PLifted PTxOutRef = Plutus.TxOutRef deriving via (DerivePConstantViaData Plutus.TxOutRef PTxOutRef) instance PConstantDecl Plutus.TxOutRef @@ -77,12 +68,10 @@ newtype PTxInInfo (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq) - via PIsDataReprInstances PTxInInfo + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq) + +instance DerivePlutusType PTxInInfo where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxInInfo where type PLifted PTxInInfo = Plutus.TxInInfo deriving via (DerivePConstantViaData Plutus.TxInInfo PTxInInfo) instance PConstantDecl Plutus.TxInInfo @@ -99,12 +88,10 @@ newtype PTxOut (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic) - deriving anyclass (PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq) - via (PIsDataReprInstances PTxOut) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq) + +instance DerivePlutusType PTxOut where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxOut where type PLifted PTxOut = Plutus.TxOut deriving via (DerivePConstantViaData Plutus.TxOut PTxOut) instance PConstantDecl Plutus.TxOut diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 946230e4f..acb261b67 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE RoleAnnotations #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -69,7 +69,9 @@ import qualified PlutusTx.Semigroup as PlutusTx import Plutarch.Prelude hiding (psingleton) newtype PTokenName (s :: S) = PTokenName (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PTokenName PByteString) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PTokenName where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PTokenName where type PLifted PTokenName = Plutus.TokenName deriving via @@ -78,7 +80,9 @@ deriving via PConstantDecl Plutus.TokenName newtype PCurrencySymbol (s :: S) = PCurrencySymbol (Term s PByteString) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PCurrencySymbol PByteString) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PCurrencySymbol where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PCurrencySymbol where type PLifted PCurrencySymbol = Plutus.CurrencySymbol deriving via @@ -88,12 +92,12 @@ deriving via data AmountGuarantees = NoGuarantees | NonZero | Positive +type role PValue nominal nominal nominal newtype PValue (keys :: KeyGuarantees) (amounts :: AmountGuarantees) (s :: S) = PValue (Term s (PMap keys PCurrencySymbol (PMap keys PTokenName PInteger))) - deriving - (PlutusType, PIsData) - via (DerivePNewtype (PValue keys amounts) (PMap keys PCurrencySymbol (PMap keys PTokenName PInteger))) -type role PValue nominal nominal nominal + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData) +instance DerivePlutusType (PValue keys amounts) where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl (PValue 'Unsorted 'NonZero) where type PLifted (PValue 'Unsorted 'NonZero) = Plutus.Value diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index e462ebb66..718a190b9 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -37,12 +36,10 @@ import Plutarch.Internal ( pforce, phoistAcyclic, plet, - punsafeAsClosedTerm, (:-->), ) import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) import Plutarch.Internal.Other ( - DerivePNewtype, pto, ) import Plutarch.Internal.PLam (plam, (#), (#$)) @@ -65,7 +62,7 @@ instance PUnsafeLiftDecl PBool where type PLifted PBool = Bool deriving via (DerivePConstantDirect Bool PBool) instance PConstantDecl Bool instance PlutusType PBool where - type PInner PBool _ = PBool + type PInner PBool = PBool pcon' PTrue = pconstant True pcon' PFalse = pconstant False pmatch' b f = pforce $ pif' # b # pdelay (f PTrue) # pdelay (f PFalse) @@ -73,7 +70,7 @@ instance PlutusType PBool where class PEq t where (#==) :: Term s t -> Term s t -> Term s PBool default (#==) :: - (PGeneric s t, PlutusType t, All2 PEq (PCode s t)) => + (PGeneric t, PlutusType t, All2 PEq (PCode t)) => Term s t -> Term s t -> Term s PBool @@ -83,7 +80,11 @@ infix 4 #== class PEq t => POrd t where (#<=) :: Term s t -> Term s t -> Term s PBool + default (#<=) :: (POrd (PInner t)) => Term s t -> Term s t -> Term s PBool + x #<= y = pto x #<= pto y (#<) :: Term s t -> Term s t -> Term s PBool + default (#<) :: (POrd (PInner t)) => Term s t -> Term s t -> Term s PBool + x #< y = pto x #< pto y infix 4 #<= infix 4 #< @@ -95,13 +96,6 @@ instance POrd PBool where x #< y = pif' # x # pconstant False # y x #<= y = pif' # x # y # pconstant True -instance PEq b => PEq (DerivePNewtype a b) where - x #== y = pto x #== pto y - -instance POrd b => POrd (DerivePNewtype a b) where - x #<= y = pto x #<= pto y - x #< y = pto x #< pto y - {- | Strict version of 'pif'. Emits slightly less code. -} @@ -156,18 +150,17 @@ pands ts' = -- | Generic version of (#==) gpeq :: forall t s. - ( PGeneric s t + ( PGeneric t , PlutusType t - , All2 PEq (PCode s t) + , All2 PEq (PCode t) ) => Term s (t :--> t :--> PBool) gpeq = phoistAcyclic $ - punsafeAsClosedTerm @s $ - plam $ \x y -> - pmatch x $ \x' -> - pmatch y $ \y' -> - gpeq' (gpfrom x') (gpfrom y') + plam $ \x y -> + pmatch x $ \x' -> + pmatch y $ \y' -> + gpeq' (gpfrom x') (gpfrom y') gpeq' :: All2 PEq xss => SOP (Term s) xss -> SOP (Term s) xss -> Term s PBool gpeq' (SOP c1) (SOP c2) = diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 0cc9204ff..530f26ea5 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -1,7 +1,4 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE FunctionalDependencies #-} -{-# LANGUAGE QuantifiedConstraints #-} -{-# LANGUAGE RoleAnnotations #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -31,14 +28,20 @@ module Plutarch.Builtin ( type PBuiltinMap, ) where -import Data.Coerce (Coercible, coerce) import Data.Proxy (Proxy (Proxy)) +import GHC.Generics (Generic) import Plutarch ( - DerivePNewtype, + DPTStrat, + DerivePlutusType, + PContravariant', + PCovariant, + PCovariant', PInner, - POpaque, PType, + PVariant, + PVariant', PlutusType, + PlutusTypeNewtype, S, Term, pcon, @@ -57,6 +60,7 @@ import Plutarch.Bool (PBool (..), PEq, pif', (#&&), (#==)) import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) import Plutarch.Internal.PlutusType (pcon', pmatch') +import Plutarch.Internal.Witness (witness) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstant, @@ -95,14 +99,28 @@ import qualified PlutusTx import Plutarch.TermCont (TermCont (runTermCont), tcont, unTermCont) -import Plutarch.Reducible (Reducible (Reduce)) - import Data.Functor.Const (Const) -import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) +import Plutarch.TryFrom ( + PSubtype, + PTryFrom, + PTryFromExcess, + ptryFrom, + ptryFrom', + pupcast, + pupcastF, + ) -- | Plutus 'BuiltinPair' -data PBuiltinPair (a :: PType) (b :: PType) (s :: S) +data PBuiltinPair (a :: PType) (b :: PType) (s :: S) = PBuiltinPair (Term s (PBuiltinPair a b)) + +instance PlutusType (PBuiltinPair a b) where + type PInner (PBuiltinPair a b) = PBuiltinPair a b + type PCovariant' (PBuiltinPair a b) = (PCovariant' a, PCovariant' b) + type PContravariant' (PBuiltinPair a b) = (PContravariant' a, PContravariant' b) + type PVariant' (PBuiltinPair a b) = (PVariant' a, PVariant' b) + pcon' (PBuiltinPair x) = x + pmatch' x f = f (PBuiltinPair x) instance (PLift a, PLift b) => PUnsafeLiftDecl (PBuiltinPair a b) where type PLifted (PBuiltinPair a b) = (PLifted a, PLifted b) @@ -163,7 +181,10 @@ instance PUnsafeLiftDecl a => PUnsafeLiftDecl (PBuiltinList a) where type PLifted (PBuiltinList a) = [PLifted a] instance PLift a => PlutusType (PBuiltinList a) where - type PInner (PBuiltinList a) _ = PBuiltinList a + type PInner (PBuiltinList a) = PBuiltinList a + type PCovariant' (PBuiltinList a) = PCovariant' a + type PContravariant' (PBuiltinList a) = PContravariant' a + type PVariant' (PBuiltinList a) = PVariant' a pcon' (PCons x xs) = pconsBuiltin # x # xs pcon' PNil = pconstant [] pmatch' xs' f = plet xs' $ \xs -> @@ -185,19 +206,30 @@ instance PListLike PBuiltinList where ptail = ptailBuiltin pnull = pnullBuiltin -instance (PLift a, PEq a) => PEq (PBuiltinList a) where - (#==) xs ys = plistEquals # xs # ys +type family F (a :: PType) :: Bool where + F PData = 'True + F (PAsData _) = 'True + F _ = 'False + +class Fc (x :: Bool) (a :: PType) where + fc :: Proxy x -> Term s (PBuiltinList a) -> Term s (PBuiltinList a) -> Term s PBool -instance {-# OVERLAPPING #-} PIsData a => PEq (PBuiltinList (PAsData a)) where - xs #== ys = pdata xs #== pdata ys +instance (PLift a, PEq a) => Fc 'False a where + fc _ xs ys = plistEquals # xs # ys -instance {-# OVERLAPPING #-} PEq (PBuiltinList PData) where - xs #== ys = pdata xs #== pdata ys +instance PIsData (PBuiltinList a) => Fc 'True a where + fc _ xs ys = pdata xs #== pdata ys + +instance Fc (F a) a => PEq (PBuiltinList a) where + (#==) = fc (Proxy @(F a)) data PData (s :: S) = PData (Term s PData) instance PlutusType PData where - type PInner PData _ = PData + type PInner PData = PData + type PCovariant' PData = () + type PContravariant' PData = () + type PVariant' PData = () pcon' (PData t) = t pmatch' t f = f (PData t) @@ -236,11 +268,13 @@ pasByteStr = punsafeBuiltin PLC.UnBData pdataLiteral :: Data -> Term s PData pdataLiteral = pconstant -type role PAsData representational phantom data PAsData (a :: PType) (s :: S) = PAsData (Term s a) instance PIsData a => PlutusType (PAsData a) where - type PInner (PAsData a) _ = PData + type PInner (PAsData a) = PData + type PCovariant' (PAsData a) = PCovariant' a + type PContravariant' (PAsData a) = PContravariant' a + type PVariant' (PAsData a) = PVariant' a pcon' (PAsData t) = pforgetData $ pdata t pmatch' t f = f (PAsData $ pfromData $ punsafeCoerce t) @@ -263,16 +297,16 @@ pforgetData = pupcast {- | Like 'pforgetData', except it works for complex types. Equivalent to 'pupcastF'. -} -pforgetData' :: forall a (p :: PType -> PType) s. Proxy p -> Term s (p (PAsData a)) -> Term s (p PData) -pforgetData' _ = punsafeCoerce +pforgetData' :: forall a (p :: PType -> PType) s. PCovariant p => Proxy p -> Term s (p (PAsData a)) -> Term s (p PData) +pforgetData' = pupcastF -- | Inverse of 'pforgetData''. -prememberData :: forall (p :: PType -> PType) s. Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) -prememberData Proxy = punsafeCoerce +prememberData :: forall (p :: PType -> PType) s. PVariant p => Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) +prememberData Proxy = let _ = witness (Proxy @(PVariant p)) in punsafeCoerce -- | Like 'prememberData' but generalised. -prememberData' :: forall a (p :: PType -> PType) s. PSubtype PData a => Proxy p -> Term s (p a) -> Term s (p (PAsData a)) -prememberData' Proxy = punsafeCoerce +prememberData' :: forall a (p :: PType -> PType) s. (PSubtype PData a, PVariant p) => Proxy p -> Term s (p a) -> Term s (p (PAsData a)) +prememberData' Proxy = let _ = witness (Proxy @(PSubtype PData a, PVariant p)) in punsafeCoerce {- | Laws: - If @PSubtype PData a@, then @pdataImpl a@ must be `pupcast`. @@ -281,7 +315,12 @@ prememberData' Proxy = punsafeCoerce -} class PIsData a where pfromDataImpl :: Term s (PAsData a) -> Term s a + default pfromDataImpl :: PIsData (PInner a) => Term s (PAsData a) -> Term s a + pfromDataImpl x = punsafeDowncast $ pfromDataImpl $ (punsafeCoerce x :: Term _ (PAsData (PInner a))) + pdataImpl :: Term s a -> Term s PData + default pdataImpl :: PIsData (PInner a) => Term s a -> Term s PData + pdataImpl x = pdataImpl $ pto x pfromData :: PIsData a => Term s (PAsData a) -> Term s a pfromData = pfromDataImpl @@ -292,14 +331,17 @@ instance PIsData PData where pfromDataImpl = pupcast pdataImpl = id -instance PIsData a => PIsData (PBuiltinList (PAsData a)) where +instance PIsData (PBuiltinList (PAsData a)) where pfromDataImpl x = punsafeCoerce $ pasList # pforgetData x pdataImpl x = punsafeBuiltin PLC.ListData # x -newtype Helper2 f a s = Helper2 (PAsData (f a) s) +newtype Helper2 f a s = Helper2 (Term s (PAsData (f a))) + deriving stock (Generic) + deriving anyclass (PlutusType) +instance DerivePlutusType (Helper2 f a) where type DPTStrat _ = PlutusTypeNewtype instance PIsData (PBuiltinList PData) where - pfromDataImpl = pforgetData' @PData (Proxy @PBuiltinList) . pfromData . coerce (prememberData (Proxy @(Helper2 PBuiltinList))) + pfromDataImpl = pforgetData' @PData (Proxy @PBuiltinList) . pfromData . pto . (prememberData (Proxy @(Helper2 PBuiltinList))) . pcon . Helper2 -- pdataImpl = coerce (pforgetData' @PData (Proxy @(Helper2 PBuiltinList))) . pdata . (prememberData (Proxy @PBuiltinList)) pdataImpl = punsafeCoerce . pdata . (prememberData (Proxy @PBuiltinList)) -- FIXME @@ -354,31 +396,31 @@ instance PIsData (PBuiltinPair (PAsData a) (PAsData b)) where f = phoistAcyclic $ plam $ \pair -> pconstrBuiltin # 0 #$ pcons # (pfstBuiltin # pair) #$ pcons # (psndBuiltin # pair) # pnil -newtype Helper3 f b a s = Helper3 (PAsData (f a b) s) +newtype Helper3 f b a s = Helper3 (Term s (PAsData (f a b))) + deriving stock (Generic) + deriving anyclass (PlutusType) +instance DerivePlutusType (Helper3 f b a) where type DPTStrat _ = PlutusTypeNewtype -newtype Helper4 f b a s = Helper4 (f a b s) +newtype Helper4 f b a s = Helper4 (Term s (f a b)) + deriving stock (Generic) + deriving anyclass (PlutusType) +instance DerivePlutusType (Helper4 f b a) where type DPTStrat _ = PlutusTypeNewtype instance PIsData (PBuiltinPair PData PData) where pfromDataImpl = f . pfromData . g where g :: Term s (PAsData (PBuiltinPair PData PData)) -> Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData))) - g = - (coerce (prememberData (Proxy @(Helper3 PBuiltinPair (PAsData PData)))) :: Term s (PAsData (PBuiltinPair PData (PAsData PData))) -> Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData)))) - . coerce (prememberData (Proxy @(Helper2 (PBuiltinPair PData)))) + g x = pto $ (prememberData (Proxy @(Helper3 PBuiltinPair (PAsData PData)))) $ pcon $ Helper3 $ pto $ (prememberData (Proxy @(Helper2 (PBuiltinPair PData)))) $ pcon $ Helper2 x f :: Term s (PBuiltinPair (PAsData PData) (PAsData PData)) -> Term s (PBuiltinPair PData PData) - f = - coerce (pforgetData' (Proxy @(Helper4 PBuiltinPair PData))) - . (pforgetData' @PData (Proxy @(PBuiltinPair (PAsData PData)))) + f x = pto $ (pforgetData' (Proxy @(Helper4 PBuiltinPair PData))) $ pcon $ Helper4 $ (pforgetData' @PData (Proxy @(PBuiltinPair (PAsData PData)))) x pdataImpl = pupcast . f . pdata . g where g :: Term s (PBuiltinPair PData PData) -> Term s (PBuiltinPair (PAsData PData) (PAsData PData)) - g = coerce (prememberData (Proxy @(Helper4 PBuiltinPair (PAsData PData)))) . prememberData (Proxy @(PBuiltinPair PData)) + g x = pto $ (prememberData (Proxy @(Helper4 PBuiltinPair (PAsData PData)))) $ pcon $ Helper4 $ prememberData (Proxy @(PBuiltinPair PData)) x f :: Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData))) -> Term s (PAsData (PBuiltinPair PData PData)) - f = - (coerce (pforgetData' @PData (Proxy @(Helper3 PBuiltinPair PData))) :: Term s (PAsData (PBuiltinPair (PAsData PData) PData)) -> Term s (PAsData (PBuiltinPair PData PData))) - . coerce (pforgetData' @PData (Proxy @(Helper2 (PBuiltinPair (PAsData PData))))) + f x = pto $ (pforgetData' @PData (Proxy @(Helper3 PBuiltinPair PData))) $ pcon $ Helper3 $ pto $ pforgetData' @PData (Proxy @(Helper2 (PBuiltinPair (PAsData PData)))) $ pcon $ Helper2 x instance (PShow a, PShow b) => PShow (PBuiltinPair a b) where pshow' _ pair = "(" <> pshow (pfstBuiltin # pair) <> "," <> pshow (psndBuiltin # pair) <> ")" @@ -398,16 +440,6 @@ instance PIsData (PBuiltinPair PInteger (PBuiltinList PData)) where instance PEq (PAsData a) where x #== y = punsafeBuiltin PLC.EqualsData # x # y -instance - ( forall (s :: S). Coercible (a s) (Term s b) - , PInner a POpaque ~ b - , PIsData b - ) => - PIsData (DerivePNewtype a b) - where - pfromDataImpl x = punsafeDowncast $ (pfromDataImpl (punsafeCoerce x) :: Term _ b) - pdataImpl x = pdataImpl $ pto x - instance (PIsData a, PShow a) => PShow (PAsData a) where pshow' w x = pshow' w (pfromData x) @@ -419,12 +451,9 @@ Example: > pconstantData @PInteger 42 -} pconstantData :: forall p h s. (ToData h, PLifted p ~ h, PConstanted h ~ p) => h -> Term s (PAsData p) -pconstantData x = punsafeCoerce $ pconstant $ PlutusTx.toData x - -newtype Flip f a b = Flip (f b a) +pconstantData x = let _ = witness (Proxy @(PLifted p ~ h, PConstanted h ~ p)) in punsafeCoerce $ pconstant $ PlutusTx.toData x -instance Reducible (f x y) => Reducible (Flip f y x) where - type Reduce (Flip f y x) = Reduce (f x y) +newtype Flip f a b = Flip (f b a) deriving stock (Generic) instance PTryFrom PData (PAsData PInteger) where type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger diff --git a/Plutarch/ByteString.hs b/Plutarch/ByteString.hs index d0bc33acd..1efa6276a 100644 --- a/Plutarch/ByteString.hs +++ b/Plutarch/ByteString.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -89,6 +90,7 @@ pindexBS = punsafeBuiltin PLC.IndexByteString hexDigitToWord8 :: HasCallStack => Char -> Word8 hexDigitToWord8 = f . toLower where + f :: Char -> Word8 f '0' = 0 f '1' = 1 f '2' = 2 diff --git a/Plutarch/DataRepr.hs b/Plutarch/DataRepr.hs index edd2c2a5b..b0f5abf25 100644 --- a/Plutarch/DataRepr.hs +++ b/Plutarch/DataRepr.hs @@ -8,15 +8,12 @@ module Plutarch.DataRepr ( I.pdcons, I.pdnil, I.PLabeledType ((:=)), - I.PIsDataRepr (type PIsDataReprRepr, pmatchRepr), - I.pmatchDataSum, - I.PIsDataReprInstances (PIsDataReprInstances), I.pindexDataRecord, I.pdropDataRecord, I.DerivePConstantViaData (DerivePConstantViaData), - I.pasDataSum, I.PConstantData, I.PLiftData, + I.PlutusTypeData, -- * Fields F.PDataFields (ptoFields, type PFields), diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 169ff6418..27a58ee47 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -1,14 +1,11 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE DefaultSignatures #-} -{-# LANGUAGE QuantifiedConstraints #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} -{-# OPTIONS_GHC -Wno-orphans #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Plutarch.DataRepr.Internal ( PDataSum (..), punDataSum, ptryIndexDataSum, - pmatchDataSum, pdcons, pdnil, DataReprHandlers (..), @@ -19,13 +16,11 @@ module Plutarch.DataRepr.Internal ( type PLabelIndex, type PUnLabel, type PLookupLabel, - PIsDataRepr (..), - PIsDataReprInstances (..), pindexDataRecord, pdropDataRecord, DerivePConstantViaData (..), - pasDataSum, DualReprHandler (..), + PlutusTypeData, ) where import Data.Coerce (coerce) @@ -35,30 +30,27 @@ import Data.Kind (Constraint, Type) import Data.List (groupBy, maximumBy, sortOn) import Data.Proxy (Proxy (Proxy)) import Data.SOP.NP (cana_NP) +import GHC.Generics (Generic) import GHC.TypeLits ( - ErrorMessage (ShowType, Text, (:<>:)), KnownNat, Nat, Symbol, - TypeError, natVal, type (+), ) import Generics.SOP ( All, - All2, - Code, Compose, - Generic, K (K), NP (Nil, (:*)), - NS, + NS (S, Z), SListI, SOP (SOP), - hcmap, + case_SList, hcollapse, hindex, hmap, + para_SList, ) import Plutarch ( Dig, @@ -86,7 +78,6 @@ import Plutarch.Bool (PBool, PEq, POrd, pif, (#<), (#<=), (#==)) import Plutarch.Builtin ( PAsData, PBuiltinList, - PBuiltinPair, PData, PIsData, pasConstr, @@ -108,9 +99,16 @@ import Plutarch.DataRepr.Internal.HList ( type IndexList, ) import Plutarch.Integer (PInteger) -import Plutarch.Internal (S (SI)) -import Plutarch.Internal.Generic (MkNS, PCode, PGeneric, gpfrom, gpto, mkNS, mkSum) -import Plutarch.Internal.PlutusType (pcon', pmatch') +import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom, gpto) +import Plutarch.Internal.PlutusType ( + DerivedPInner, + PlutusTypeStrat, + PlutusTypeStratConstraint, + derivedPCon, + derivedPMatch, + pcon', + pmatch', + ) import Plutarch.Lift ( PConstant, PConstantDecl, @@ -123,48 +121,46 @@ import Plutarch.Lift ( pconstantToRepr, ) import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) -import Plutarch.TermCont (TermCont (TermCont), hashOpenTerm, runTermCont, tcont, unTermCont) +import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont, tcont, unTermCont) import Plutarch.Trace (ptraceError) -import Plutarch.TryFrom (PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) +import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) import Plutarch.Unit (PUnit (PUnit)) -import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) +import Plutarch.Unsafe (punsafeCoerce) import qualified PlutusLedgerApi.V1 as Ledger -import Plutarch.Reducible (Reduce, Reducible) +import Plutarch.Reducible (NoReduce, Reduce) {- | A "record" of `exists a. PAsData a`. The underlying representation is `PBuiltinList PData`. -} data PDataRecord (as :: [PLabeledType]) (s :: S) where PDCons :: - forall name x xs s. + forall name_x x xs s. + PUnLabel name_x ~ x => Term s (PAsData x) -> (Term s (PDataRecord xs)) -> - PDataRecord ((name ':= x) ': xs) s + -- GHC bug prevents `name ':= x` from working well + PDataRecord (name_x ': xs) s PDNil :: PDataRecord '[] s -instance {-# OVERLAPPABLE #-} PlutusType (PDataRecord l) where - type PInner (PDataRecord l) _ = PBuiltinList PData +newtype H s (l :: [PLabeledType]) = H {unH :: forall r. (PDataRecord l s -> Term s r) -> Term s r} + +instance SListI l => PlutusType (PDataRecord l) where + type PInner (PDataRecord l) = PBuiltinList PData pcon' :: PDataRecord l s -> Term s (PBuiltinList PData) - pcon' (PDCons x xs) = pcon' $ PDCons x xs + pcon' (PDCons x xs) = pcons # pforgetData x # pto xs pcon' PDNil = pcon' PDNil pmatch' :: Term s (PBuiltinList PData) -> (PDataRecord l s -> Term s b) -> Term s b - pmatch' _ _ = error "PDataRecord l: pmatch' unsupported ('l' should be more specific)" - -instance PlutusType (PDataRecord ((name ':= x) ': xs)) where - type PInner (PDataRecord ((name ':= x) ': xs)) _ = PBuiltinList PData - pcon' (PDCons x xs) = pcons # pforgetData x # pto xs - pmatch' l' f = plet l' $ \l -> - let x :: Term _ (PAsData x) - x = punsafeCoerce $ phead # l - xs :: Term _ (PDataRecord xs) - xs = punsafeCoerce $ ptail # l - in f $ PDCons x xs - -instance PlutusType (PDataRecord '[]) where - type PInner (PDataRecord '[]) _ = PBuiltinList PData - pcon' PDNil = pnil - pmatch' _ f = f PDNil + pmatch' l' = unH $ + case_SList + (H $ \f -> f PDNil) + $ H $ \f -> + plet l' \l -> + let x :: Term _ (PAsData x) + x = punsafeCoerce $ phead # l + xs :: Term _ (PDataRecord xs) + xs = punsafeCoerce $ ptail # l + in f $ PDCons x xs -- | This uses data equality. 'PEq' instances of elements don't make any difference. instance PEq (PDataRecord xs) where @@ -182,13 +178,14 @@ instance (POrd x, PIsData x) => POrd (PDataRecord '[label ':= x]) where PDCons y _ <- tcont $ pmatch l2 pure $ pfromData x #< pfromData y + l1 #<= l2 = unTermCont $ do PDCons x _ <- tcont $ pmatch l1 PDCons y _ <- tcont $ pmatch l2 pure $ pfromData x #<= pfromData y -instance (POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord ((label ':= x) ': x' ': xs)) where +instance (SListI xs, POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord ((label ':= x) ': x' ': xs)) where l1 #< l2 = unTermCont $ do PDCons x xs <- tcont $ pmatch l1 PDCons y ys <- tcont $ pmatch l2 @@ -197,6 +194,7 @@ instance (POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord b <- tcont . plet $ pfromData y pure $ pif (a #< b) (pconstant True) $ pif (a #== b) (xs #< ys) $ pconstant False + l1 #<= l2 = unTermCont $ do PDCons x xs <- tcont $ pmatch l1 PDCons y ys <- tcont $ pmatch l2 @@ -226,37 +224,19 @@ pdnil = punsafeCoerce $ pnil @PBuiltinList @PData data PLabeledType = Symbol := PType -{- Get the product types of a data record sum constructor --} -type PDataRecordFields :: [PType] -> [PLabeledType] -type family PDataRecordFields as where - PDataRecordFields '[] = '[] - PDataRecordFields '[(PDataRecord fs)] = fs - PDataRecordFields '[t] = TypeError ( 'Text "Expected PDataRecord" ':<>: 'Text "but got" ':<>: 'ShowType t) - PDataRecordFields ts = TypeError ( 'Text "Expected none or PDataRecord" ':<>: 'Text "but got" ':<>: 'ShowType ts) - -{- Return the table of data records for a sum type. - -NOTE: Unfortunately we can't write a generic FMap due to ghc's arity limitations. --} -type PDataRecordFields2 :: [[PType]] -> [[PLabeledType]] -type family PDataRecordFields2 as where - PDataRecordFields2 '[] = '[] - PDataRecordFields2 (a ': as) = PDataRecordFields a ': PDataRecordFields2 as - type family PLabelIndex (name :: Symbol) (as :: [PLabeledType]) :: Nat where - PLabelIndex name ((name ':= a) ': as) = 0 + PLabelIndex name ((name ':= _) ': _) = 0 PLabelIndex name (_ ': as) = (PLabelIndex name as) + 1 type PLookupLabel :: Symbol -> [PLabeledType] -> PType type family PLookupLabel name as where - PLookupLabel name ((name ':= a) ': as) = a + PLookupLabel name ((name ':= a) ': _) = a PLookupLabel name (_ ': as) = PLookupLabel name as type family PUnLabel (a :: PLabeledType) :: PType where - PUnLabel (name ':= a) = a + PUnLabel (_ ':= a) = a -instance {-# OVERLAPPABLE #-} PIsData (PDataRecord xs) where +instance PIsData (PDataRecord xs) where pfromDataImpl x = punsafeCoerce $ (pfromData (punsafeCoerce x) :: Term _ (PBuiltinList PData)) pdataImpl x = pupcast $ pdata (pupcast x :: Term _ (PBuiltinList PData)) @@ -266,22 +246,70 @@ where the integer is the index of the variant and the list is the record. type PDataSum :: [[PLabeledType]] -> PType newtype PDataSum defs s = PDataSum (NS (F.Compose (Term s) PDataRecord) defs) +class IsPDataSum (a :: [[PType]]) where + type IsPDataSumDefs a :: [[PLabeledType]] + toSum :: SOP (Term s) a -> PDataSum (IsPDataSumDefs a) s + fromSum :: PDataSum (IsPDataSumDefs a) s -> SOP (Term s) a + +instance IsPDataSum '[] where + type IsPDataSumDefs '[] = '[] + toSum (SOP x) = case x of {} + fromSum (PDataSum x) = case x of {} + +instance IsPDataSum xs => IsPDataSum ('[PDataRecord l] : xs) where + type IsPDataSumDefs ('[PDataRecord l] : xs) = (l : IsPDataSumDefs xs) + toSum (SOP (Z (x :* Nil))) = PDataSum $ Z $ coerce x + toSum (SOP (S x)) = case toSum (SOP x) of + PDataSum y -> PDataSum $ S y + fromSum (PDataSum (Z x)) = SOP $ Z $ (coerce x) :* Nil + fromSum (PDataSum (S x)) = case fromSum (PDataSum x) of + SOP y -> SOP $ S y + +data DataReprHandlers (out :: PType) (defs :: [[PLabeledType]]) (s :: S) where + DRHNil :: DataReprHandlers out '[] s + DRHCons :: (Term s (PDataRecord def) -> Term s out) -> DataReprHandlers out defs s -> DataReprHandlers out (def : defs) s + +newtype A s out defs = A {unA :: (PDataSum defs s -> Term s out) -> DataReprHandlers out defs s} + instance ( SListI defs - , forall s. MkDataSumHandler s defs 0 defs ) => PlutusType (PDataSum defs) where - type PInner (PDataSum defs) _ = PData + type PInner (PDataSum defs) = PData pcon' (PDataSum xss) = let constrIx = fromIntegral $ hindex xss datRec = hcollapse $ hmap (K . (\x -> pto x) . F.getCompose) xss in pforgetData $ pconstrBuiltin # pconstant constrIx # datRec - - pmatch' d = pmatchDataSum target . mkDataSumHandler @_ @defs @0 @defs + pmatch' d f = + let handlers = conv f + in case handlers of + DRHCons handler DRHNil -> handler $ punDataSum # (punsafeCoerce d :: Term _ (PDataSum defs)) + _ -> plet (pasConstr #$ d) $ \d' -> + plet (pfstBuiltin # d') $ \constr -> + plet (psndBuiltin # d') $ \args -> + let handlers' = applyHandlers args handlers + in runTermCont (findCommon handlers') $ \common -> + reprHandlersGo + common + 0 + handlers' + constr where - target :: Term _ (PDataSum defs) - target = punsafeCoerce d + applyHandlers :: forall out s defs. Term s (PBuiltinList PData) -> DataReprHandlers out defs s -> [Term s out] + applyHandlers _ DRHNil = [] + applyHandlers args (DRHCons handler rest) = handler (punsafeCoerce args) : applyHandlers args rest + + conv :: forall out s defs. SListI defs => (PDataSum defs s -> Term s out) -> DataReprHandlers out defs s + conv = + unA $ + para_SList + (A \_ -> DRHNil) + ( \(A prev) -> A \f -> + DRHCons + (\x -> f (PDataSum (Z $ coerce x))) + $ prev (\(PDataSum x) -> f (PDataSum (S x))) + ) instance PIsData (PDataSum defs) where pfromDataImpl = punsafeCoerce @@ -293,14 +321,13 @@ instance PEq (PDataSum defs) where instance All (Compose POrd PDataRecord) defs => POrd (PDataSum defs) where x' #< y' = f # x' # y' where + f :: Term s (PDataSum defs :--> PDataSum defs :--> PBool) f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLTHandler x' #<= y' = f # x' # y' where + f :: Term s (PDataSum defs :--> PDataSum defs :--> PBool) f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLTEHandler -pasDataSum :: PIsDataRepr a => Term s a -> Term s (PDataSum (PIsDataReprRepr a)) -pasDataSum = punsafeCoerce - -- | If there is only a single variant, then we can safely extract it. punDataSum :: Term s (PDataSum '[def] :--> PDataRecord def) punDataSum = phoistAcyclic $ @@ -330,125 +357,26 @@ pdropDataRecord n xs = punsafeCoerce $ pdrop @PBuiltinList @PData (fromInteger $ natVal n) (punsafeCoerce xs) --- | This is used to define the handlers for 'pmatchDataSum'. -data DataReprHandlers (out :: PType) (defs :: [[PLabeledType]]) (s :: S) where - DRHNil :: DataReprHandlers out '[] s - DRHCons :: (Term s (PDataRecord def) -> Term s out) -> DataReprHandlers out defs s -> DataReprHandlers out (def : defs) s +data PlutusTypeData --- | Pattern match on a 'PDataSum' manually. The common case only appears once in the generated code. -pmatchDataSum :: Term s (PDataSum defs) -> DataReprHandlers out defs s -> Term s out -pmatchDataSum d (DRHCons handler DRHNil) = handler $ punDataSum # d -pmatchDataSum d handlers = - plet (pasConstr #$ pforgetData $ pdata d) $ \d' -> - plet (pfstBuiltin # d') $ \constr -> - plet (psndBuiltin # d') $ \args -> - let handlers' = applyHandlers args handlers - in runTermCont (findCommon handlers') $ \common -> - reprHandlersGo - common - 0 - handlers' - constr - where - applyHandlers :: Term s (PBuiltinList PData) -> DataReprHandlers out defs s -> [Term s out] - applyHandlers _ DRHNil = [] - applyHandlers args (DRHCons handler rest) = handler (punsafeCoerce args) : applyHandlers args rest - -class (PlutusType a, PIsData a) => PIsDataRepr (a :: PType) where - type PIsDataReprRepr a :: [[PLabeledType]] - type PIsDataReprRepr a = PDataRecordFields2 (PCode 'SI a) - - pconRepr :: a s -> Term s (PDataSum (PIsDataReprRepr a)) - default pconRepr :: - forall s code pcode. - ( PGeneric s a - , code ~ Code (a s) - , pcode ~ PCode s a - , All SListI pcode - , All Singleton code - , All2 IsBuiltinList pcode - ) => - a s -> - Term s (PDataSum (PIsDataReprRepr a)) - pconRepr x = punsafeCoerce expected - where - expected :: Term _ (PAsData (PBuiltinPair PInteger (PBuiltinList PData))) - expected = gpconRepr @a $ gpfrom x - - pmatchRepr :: forall s b. Term s (PDataSum (PIsDataReprRepr a)) -> (a s -> Term s b) -> Term s b - default pmatchRepr :: - forall s b code pcode. - ( code ~ Code (a s) - , pcode ~ PCode s a - , PDataRecordFields2 pcode ~ PIsDataReprRepr a - , MkDataReprHandler s a 0 pcode - ) => - Term s (PDataSum (PIsDataReprRepr a)) -> - (a s -> Term s b) -> - Term s b - pmatchRepr dat = - pmatchDataSum dat . mkDataReprHandler @s @a @0 @pcode - -gpconRepr :: - forall a s code pcode. - ( Generic (a s) - , code ~ Code (a s) - , pcode ~ PCode s a - , All SListI pcode - , All Singleton code - , All2 IsBuiltinList pcode +class + ( IsPDataSum (PCode a) + , SListI (IsPDataSumDefs (PCode a)) + , PGeneric a ) => - SOP (Term s) pcode -> - Term s (PAsData (PBuiltinPair PInteger (PBuiltinList PData))) -gpconRepr x = pconstrBuiltin # pconstant (toInteger $ hindex sop) # head (hcollapse sop) - where - sop :: SOP (K (Term s (PBuiltinList PData))) pcode - sop = hcmap (Proxy @IsBuiltinList) (K . dataListFrom) x - --- | Create a `DataReprhandlers` starting from `n`th sum constructor -class MkDataReprHandler (s :: S) (a :: PType) (n :: Nat) (rest :: [[PType]]) where - mkDataReprHandler :: forall out. (a s -> Term s out) -> DataReprHandlers out (PDataRecordFields2 rest) s - -instance MkDataReprHandler s a n '[] where - mkDataReprHandler _ = DRHNil - + PlutusTypeDataConstraint a instance - ( PGeneric s a - , code ~ Code (a s) - , pcode ~ PCode s a - , r ~ IndexList n pcode - , r ~ '[(PDataRecord fs)] - , MkNS n pcode (NP (Term s)) - , MkDataReprHandler s a (n + 1) rs + ( IsPDataSum (PCode a) + , SListI (IsPDataSumDefs (PCode a)) + , PGeneric a ) => - MkDataReprHandler s a n (r ': rs) - where - mkDataReprHandler f = - DRHCons (f . gpto . mkSOP . mkProduct) $ - mkDataReprHandler @s @a @(n + 1) @rs f - where - mkProduct :: Term s (PDataRecord fs) -> NP (Term s) r - mkProduct x = x :* Nil - mkSOP :: NP (Term s) r -> SOP (Term s) (PCode s a) - mkSOP = SOP . mkSum @n @pcode - -class MkDataSumHandler s a (n :: Nat) rest where - mkDataSumHandler :: forall out. (PDataSum a s -> Term s out) -> DataReprHandlers out rest s + PlutusTypeDataConstraint a -instance MkDataSumHandler s a n '[] where - mkDataSumHandler _ = DRHNil - -instance - ( MkDataSumHandler s a (n + 1) defs - , IndexList n a ~ def - , MkNS n a (F.Compose (Term s) PDataRecord) - ) => - MkDataSumHandler s a n (def : defs) - where - mkDataSumHandler f = DRHCons (f . dataSumFrom) $ mkDataSumHandler @s @a @(n + 1) @defs f - where - dataSumFrom :: Term s (PDataRecord def) -> PDataSum a s - dataSumFrom = PDataSum . mkNS @_ @n . F.Compose +instance PlutusTypeStrat PlutusTypeData where + type PlutusTypeStratConstraint PlutusTypeData = PlutusTypeDataConstraint + type DerivedPInner PlutusTypeData a = PDataSum (IsPDataSumDefs (PCode a)) + derivedPCon x = pcon $ toSum $ gpfrom x + derivedPMatch x f = pmatch x (\y -> f $ gpto $ fromSum $ y) newtype DualReprHandler s out def = DualRepr (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s out) @@ -539,20 +467,6 @@ mkLTEHandler = cana_NP (Proxy @(Compose POrd PDataRecord)) rer $ Const () (DualReprHandler s PBool y, Const () ys) rer _ = (DualRepr (#<=), Const ()) -{- | Use this for implementing the necessary instances for getting the `Data` representation. - You must implement 'PIsDataRepr' to use this. --} -newtype PIsDataReprInstances (a :: PType) (s :: S) = PIsDataReprInstances (a s) - -instance PIsDataRepr a => PIsData (PIsDataReprInstances a) where - pfromDataImpl = punsafeCoerce - pdataImpl = punsafeCoerce - -instance PIsDataRepr a => PlutusType (PIsDataReprInstances a) where - type PInner (PIsDataReprInstances a) _ = PDataSum (PIsDataReprRepr a) - pcon' (PIsDataReprInstances x) = pconRepr x - pmatch' x f = pmatchRepr x (f . PIsDataReprInstances) - {- | Type synonym to simplify deriving of @PConstant@ via @DerivePConstantViaData@. A type @Foo a@ is considered "ConstantableData" if: @@ -624,17 +538,8 @@ newtype = -- | The Haskell type for which @PConstant is being derived. DerivePConstantViaData h --- | This uses data equality. 'PEq' instances of elements don't make any difference. -instance PIsDataRepr a => PEq (PIsDataReprInstances a) where - x #== y = pdata x #== pdata y - --- | This uses lexicographic ordering. Actually uses PDataSum '(#<)' implementation. -instance (PIsDataRepr a, All (Compose POrd PDataRecord) (PIsDataReprRepr a)) => POrd (PIsDataReprInstances a) where - x #< y = pto x #< pto y - x #<= y = pto x #<= pto y - instance - ( PIsDataRepr p + ( PSubtype PData p , PLift p , Ledger.FromData h , Ledger.ToData h @@ -646,39 +551,23 @@ instance pconstantToRepr (DerivePConstantViaData x) = Ledger.toData x pconstantFromRepr x = DerivePConstantViaData <$> Ledger.fromData x --- I wish type families could be applied partially.... -class Singleton a -instance Singleton (x ': '[]) - -class IsBuiltinList a where - dataListFrom :: Term s a -> Term s (PBuiltinList PData) - -instance IsBuiltinList (PDataRecord l) where - dataListFrom = punsafeCoerce - ----------------------- HRecP and friends ----------------------------------------------- type HRecPApply :: [(Symbol, PType)] -> S -> [(Symbol, Type)] type family HRecPApply as s where HRecPApply ('(name, ty) ': rest) s = '(name, Reduce (ty s)) ': HRecPApply rest s - HRecPApply '[] s = '[] - -newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (HRecGeneric (HRecPApply as s)) + HRecPApply '[] _ = '[] -instance Reducible (HRecP as s) where type Reduce (HRecP as s) = HRecGeneric (HRecPApply as s) +newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (NoReduce (HRecGeneric (HRecPApply as s))) + deriving stock (Generic) newtype Flip f a b = Flip (f b a) - -instance Reducible (f x y) => Reducible (Flip f y x) where - type Reduce (Flip f y x) = Reduce (f x y) + deriving stock (Generic) -- We could have a more advanced instance but it's not needed really. newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) + deriving stock (Generic) -instance Reducible (PTryFromExcess PData (PAsData a) s) => Reducible (ExcessForField a s) where - type Reduce (ExcessForField a s) = (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) - --- FIXME: Should we always succede? If we always succede, performance would increase a lot. instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where type PTryFromExcess (PBuiltinList PData) (PDataRecord '[]) = HRecP '[] ptryFrom' opq = runTermCont $ do @@ -710,10 +599,7 @@ instance tv <- tcont $ ptryFrom @(PDataRecord as) @(PBuiltinList PData) t pure (punsafeCoerce opq, HRecGeneric (HCons (Labeled hv) (coerce $ snd tv))) -newtype Helper a b s = Helper (a s, b s) - -instance (Reducible (a s), Reducible (b s)) => Reducible (Helper a b s) where - type Reduce (Helper a b s) = (Reduce (a s), Reduce (b s)) +newtype Helper a b s = Helper (Reduce (a s), Reduce (b s)) deriving stock (Generic) instance ( PTryFrom (PBuiltinList PData) (PDataRecord as) @@ -730,19 +616,18 @@ instance pure (punsafeCoerce opq, r) class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where - validateSum :: Term s PInteger -> Term s (PBuiltinList PData) -> Term s POpaque + validateSum :: Proxy n -> Proxy sum -> Term s PInteger -> Term s (PBuiltinList PData) -> Term s POpaque -instance {-# OVERLAPPING #-} SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where +instance SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where type PTryFromExcess PData (PAsData (PDataSum ys)) = Const () ptryFrom' opq = runTermCont $ do x <- tcont $ plet $ pasConstr # opq constr <- tcont $ plet $ pfstBuiltin # x fields <- tcont $ plet $ psndBuiltin # x - _ <- tcont $ plet $ validateSum @0 @ys constr fields + _ <- tcont $ plet $ validateSum (Proxy @0) (Proxy @ys) constr fields pure (punsafeCoerce opq, ()) instance - {-# OVERLAPPABLE #-} forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). ( PTryFrom (PBuiltinList PData) (PDataRecord x) , SumValidation (n + 1) xs @@ -750,27 +635,14 @@ instance ) => SumValidation n (x ': xs) where - validateSum constr fields = + validateSum _ _ constr fields = pif (fromInteger (natVal $ Proxy @n) #== constr) ( unTermCont $ do _ <- tcont $ ptryFrom @(PDataRecord x) fields pure $ popaque $ pcon PUnit ) - (validateSum @(n + 1) @xs constr fields) + (validateSum (Proxy @(n + 1)) (Proxy @xs) constr fields) -instance {-# OVERLAPPING #-} SumValidation n '[] where - validateSum _ _ = ptraceError "reached end of sum while still not having found the constructor" - -instance - ( PIsDataRepr a - , SumValidation 0 (PIsDataReprRepr a) - , PInner a b ~ PDataSum (PIsDataReprRepr a) - ) => - PTryFrom PData (PAsData (PIsDataReprInstances a)) - where - type PTryFromExcess PData (PAsData (PIsDataReprInstances a)) = Const () - ptryFrom' opq = runTermCont $ do - let reprsum :: Term _ (PDataSum (PIsDataReprRepr a)) - reprsum = pfromData $ unTermCont $ fst <$> TermCont (ptryFrom opq) - pure $ (pdata $ punsafeDowncast reprsum, ()) +instance SumValidation n '[] where + validateSum _ _ _ _ = ptraceError "reached end of sum while still not having found the constructor" diff --git a/Plutarch/DataRepr/Internal/Field.hs b/Plutarch/DataRepr/Internal/Field.hs index 488c08f38..d856ef39b 100644 --- a/Plutarch/DataRepr/Internal/Field.hs +++ b/Plutarch/DataRepr/Internal/Field.hs @@ -1,4 +1,5 @@ {-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.DataRepr.Internal.Field ( @@ -30,11 +31,13 @@ import GHC.TypeLits ( import Data.Kind (Constraint, Type) import Plutarch ( + PInner, PType, S, Term, plam, plet, + pto, (#), (#$), type (:-->), @@ -48,10 +51,7 @@ import Plutarch.Builtin ( import Plutarch.DataRepr.Internal ( PDataRecord, PDataSum, - PIsDataRepr (type PIsDataReprRepr), - PIsDataReprInstances, PLabeledType ((:=)), - pasDataSum, pdropDataRecord, pindexDataRecord, punDataSum, @@ -68,14 +68,16 @@ import Plutarch.DataRepr.Internal.HList ( type ElemOf, type IndexLabel, type IndexList, - type SingleItem, ) -import Plutarch.Internal (punsafeCoerce) +import Plutarch.Internal.Witness (witness) import Plutarch.TermCont (TermCont (TermCont), runTermCont) -------------------------------------------------------------------------------- ---------- PDataField class & deriving utils +type family Helper (x :: PType) :: [PLabeledType] where + Helper (PDataSum '[y]) = y + {- | Class allowing 'letFields' to work for a PType, usually via `PIsDataRepr`, but is derived for some other types for convenience. @@ -84,8 +86,12 @@ class PDataFields (a :: PType) where -- | Fields in HRec bound by 'letFields' type PFields a :: [PLabeledType] + type PFields a = Helper (PInner a) + -- | Convert a Term to a 'PDataList' ptoFields :: Term s a -> Term s (PDataRecord (PFields a)) + default ptoFields :: PInner a ~ PDataSum '[PFields a] => Term s a -> Term s (PDataRecord (PFields a)) + ptoFields x = punDataSum #$ pto x instance PDataFields (PDataRecord as) where type PFields (PDataRecord as) = as @@ -95,20 +101,6 @@ instance PDataFields (PDataSum '[as]) where type PFields (PDataSum '[as]) = as ptoFields = (punDataSum #) -instance - forall a fields. - ( PIsDataRepr a - , PIsDataReprRepr a ~ '[fields] - , SingleItem (PIsDataReprRepr a) ~ fields - ) => - PDataFields (PIsDataReprInstances a) - where - type - PFields (PIsDataReprInstances a) = - SingleItem (PIsDataReprRepr a) - - ptoFields x = punDataSum #$ pasDataSum (punsafeCoerce x :: Term _ a) - instance forall a. ( PIsData a @@ -180,7 +172,7 @@ pletFields :: Term s b pletFields t = runTermCont $ - bindFields @ps @bs $ ptoFields @a t + bindFields (Proxy @bs) $ ptoFields @a t data ToBind = Bind | Skip @@ -220,45 +212,45 @@ class BindFields (ps :: [PLabeledType]) (bs :: [ToBind]) where -- -- A continuation is returned to enable sharing of -- the generated bound-variables. - bindFields :: Term s (PDataRecord ps) -> TermCont s (HRec (BoundTerms ps bs s)) + bindFields :: Proxy bs -> Term s (PDataRecord ps) -> TermCont s (HRec (BoundTerms ps bs s)) -instance {-# OVERLAPPING #-} BindFields ((l ':= p) ': ps) ( 'Bind ': '[]) where - bindFields t = +instance {-# OVERLAPPABLE #-} BindFields ((l ':= p) ': ps) ( 'Bind ': '[]) where + bindFields _ t = pure $ HCons (Labeled $ pindexDataRecord (Proxy @0) t) HNil instance {-# OVERLAPPABLE #-} (BindFields ps bs) => BindFields ((l ':= p) ': ps) ( 'Bind ': bs) where - bindFields t = do + bindFields _ t = do t' <- TermCont $ plet t - xs <- bindFields @ps @bs (pdropDataRecord (Proxy @1) t') + xs <- bindFields (Proxy @bs) (pdropDataRecord (Proxy @1) t') pure $ HCons (Labeled $ pindexDataRecord (Proxy @0) t') xs -instance {-# OVERLAPPING #-} (BindFields ps bs) => BindFields (p1 ': ps) ( 'Skip ': bs) where - bindFields t = do - bindFields @ps @bs $ pdropDataRecord (Proxy @1) t +instance {-# OVERLAPPABLE #-} (BindFields ps bs) => BindFields (p1 ': ps) ( 'Skip ': bs) where + bindFields _ t = do + bindFields (Proxy @bs) $ pdropDataRecord (Proxy @1) t -instance {-# OVERLAPPING #-} (BindFields ps bs) => BindFields (p1 ': p2 ': ps) ( 'Skip ': 'Skip ': bs) where - bindFields t = do - bindFields @ps @bs $ pdropDataRecord (Proxy @2) t +instance {-# OVERLAPPABLE #-} (BindFields ps bs) => BindFields (p1 ': p2 ': ps) ( 'Skip ': 'Skip ': bs) where + bindFields _ t = do + bindFields (Proxy @bs) $ pdropDataRecord (Proxy @2) t -instance {-# OVERLAPPING #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': ps) ( 'Skip ': 'Skip ': 'Skip ': bs) where - bindFields t = do - bindFields @ps @bs $ pdropDataRecord (Proxy @3) t +instance {-# OVERLAPPABLE #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': ps) ( 'Skip ': 'Skip ': 'Skip ': bs) where + bindFields _ t = do + bindFields (Proxy @bs) $ pdropDataRecord (Proxy @3) t -instance {-# OVERLAPPING #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': p4 ': ps) ( 'Skip ': 'Skip ': 'Skip ': 'Skip ': bs) where - bindFields t = do - bindFields @ps @bs $ pdropDataRecord (Proxy @4) t +instance {-# OVERLAPPABLE #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': p4 ': ps) ( 'Skip ': 'Skip ': 'Skip ': 'Skip ': bs) where + bindFields _ t = do + bindFields (Proxy @bs) $ pdropDataRecord (Proxy @4) t -instance {-# OVERLAPPING #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': p4 ': p5 ': ps) ( 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': bs) where - bindFields t = do - bindFields @ps @bs $ pdropDataRecord (Proxy @5) t +instance {-# OVERLAPPABLE #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': p4 ': p5 ': ps) ( 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': bs) where + bindFields _ t = do + bindFields (Proxy @bs) $ pdropDataRecord (Proxy @5) t -instance {-# OVERLAPPING #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': p4 ': p5 ': p6 ': ps) ( 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': bs) where - bindFields t = do - bindFields @ps @bs $ pdropDataRecord (Proxy @6) t +instance {-# OVERLAPPABLE #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': p4 ': p5 ': p6 ': ps) ( 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': bs) where + bindFields _ t = do + bindFields (Proxy @bs) $ pdropDataRecord (Proxy @6) t -instance {-# OVERLAPPING #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': p4 ': p5 ': p6 ': p7 ': ps) ( 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': bs) where - bindFields t = do - bindFields @ps @bs $ pdropDataRecord (Proxy @7) t +instance {-# OVERLAPPABLE #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ': p4 ': p5 ': p6 ': p7 ': ps) ( 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': 'Skip ': bs) where + bindFields _ t = do + bindFields (Proxy @bs) $ pdropDataRecord (Proxy @7) t -------------------------------------------------------------------------------- @@ -279,5 +271,7 @@ pfield :: , PFromDataable a b ) => Term s (p :--> b) -pfield = plam $ \i -> - pmaybeFromAsData $ pindexDataRecord (Proxy @n) $ ptoFields @p i +pfield = + let _ = witness (Proxy @(n ~ (PLabelIndex name as))) + in plam $ \i -> + pmaybeFromAsData $ pindexDataRecord (Proxy @n) $ ptoFields @p i diff --git a/Plutarch/DataRepr/Internal/FromData.hs b/Plutarch/DataRepr/Internal/FromData.hs index 2c47f7464..48768b94b 100644 --- a/Plutarch/DataRepr/Internal/FromData.hs +++ b/Plutarch/DataRepr/Internal/FromData.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE FunctionalDependencies #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.DataRepr.Internal.FromData (PFromDataable, pmaybeFromAsData) where @@ -22,8 +22,8 @@ import Plutarch.Builtin (PAsData, PIsData, pfromData) class PFromDataable (a :: PType) (b :: PType) | b -> a, a -> b where pmaybeFromAsData :: Term s (PAsData a) -> Term s b -instance {-# OVERLAPS #-} PFromDataable a (PAsData a) where +instance {-# OVERLAPPING #-} PFromDataable a (PAsData a) where pmaybeFromAsData = id -instance {-# OVERLAPPABLE #-} (PIsData a, b ~ a) => PFromDataable a b where +instance {-# OVERLAPPING #-} (PIsData a, b ~ a) => PFromDataable a b where pmaybeFromAsData = pfromData diff --git a/Plutarch/DataRepr/Internal/HList.hs b/Plutarch/DataRepr/Internal/HList.hs index 87ef844c8..110c358bd 100644 --- a/Plutarch/DataRepr/Internal/HList.hs +++ b/Plutarch/DataRepr/Internal/HList.hs @@ -1,5 +1,5 @@ {-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE FunctionalDependencies #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.DataRepr.Internal.HList ( @@ -64,9 +64,7 @@ indexHRec HNil impossible = case impossible of {} -} hrecField' :: forall name a as. - ( (IndexLabel name as ~ a) - , ElemOf name a as - ) => + ElemOf name a as => HRec as -> a hrecField' xs = indexHRec xs $ elemOf @name @a @as @@ -92,7 +90,7 @@ class IndexLabel name as ~ a => ElemOf name a as | as name -> a where -- There (There (There Here)) elemOf :: Elem '(name, a) as -instance {-# OVERLAPPING #-} ElemOf name a ('(name, a) ': as) where +instance ElemOf name a ('(name, a) ': as) where elemOf :: Elem '(name, a) ('(name, a) ': as) elemOf = Here @@ -116,8 +114,7 @@ instance -} hrecField :: forall name a as b c s. - ( IndexLabel name as ~ a - , ElemOf name a as + ( ElemOf name a as , Term s (PAsData b) ~ a , PFromDataable b c ) => diff --git a/Plutarch/DataRepr/Internal/HList/Utils.hs b/Plutarch/DataRepr/Internal/HList/Utils.hs index 61a54ae9f..ef582e91c 100644 --- a/Plutarch/DataRepr/Internal/HList/Utils.hs +++ b/Plutarch/DataRepr/Internal/HList/Utils.hs @@ -31,7 +31,7 @@ data Elem (a :: k) (as :: [k]) where type family IndexList (n :: Nat) (l :: [k]) :: k where IndexList _ '[] = TypeError ( 'Text "IndexList: index out of bounds") IndexList 0 (x ': _) = x - IndexList n (x : xs) = IndexList (n - 1) xs + IndexList n (_ : xs) = IndexList (n - 1) xs -- | Indexing list of labeled pairs by label type IndexLabel :: Symbol -> [(Symbol, Type)] -> Type @@ -46,4 +46,4 @@ type family SingleItem (as :: [k]) :: k where -- | Drop first n fields of a list type family Drop (n :: Nat) (as :: [k]) :: [k] where Drop 0 xs = xs - Drop n (x ': xs) = Drop (n - 1) xs + Drop n (_ ': xs) = Drop (n - 1) xs diff --git a/Plutarch/Either.hs b/Plutarch/Either.hs index 73ea08d61..466982554 100644 --- a/Plutarch/Either.hs +++ b/Plutarch/Either.hs @@ -1,13 +1,21 @@ module Plutarch.Either (PEither (PLeft, PRight)) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, HasDatatypeInfo, I (I)) -import Plutarch (PType, PlutusType, S, Term) +import GHC.Generics (Generic) +import Plutarch ( + DPTStrat, + DerivePlutusType, + PType, + PlutusType, + PlutusTypeScott, + S, + Term, + ) import Plutarch.Bool (PEq) import Plutarch.Show (PShow) data PEither (a :: PType) (b :: PType) (s :: S) = PLeft (Term s a) | PRight (Term s b) - deriving stock (GHC.Generic) - deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) + deriving stock (Generic) + deriving anyclass (PlutusType, PEq, PShow) +instance DerivePlutusType (PEither a b) where type DPTStrat _ = PlutusTypeScott diff --git a/Plutarch/FFI.hs b/Plutarch/FFI.hs index 317228048..00724ecc2 100644 --- a/Plutarch/FFI.hs +++ b/Plutarch/FFI.hs @@ -16,13 +16,11 @@ module Plutarch.FFI ( unsafeForeignImport, ) where -import Data.ByteString (ByteString) import Data.Kind (Constraint, Type) -import Data.Text (Text) +import Data.Proxy (Proxy (Proxy)) import qualified Data.Text as T import Data.Void (Void) import GHC.Generics (Generic) -import GHC.TypeLits (TypeError) import qualified GHC.TypeLits as TypeLits import qualified Generics.SOP as SOP import Generics.SOP.GGP (GCode, GDatatypeInfoOf) @@ -34,9 +32,14 @@ import Generics.SOP.Type.Metadata ( import Plutarch ( ClosedTerm, Config, + DPTStrat, + DerivePlutusType, PDelayed, + PForall (PForall), POpaque, PType, + PlutusTypeNewtype, + PlutusTypeScott, S, compile, pcon, @@ -50,7 +53,7 @@ import Plutarch ( (:-->), ) import Plutarch.Bool (PBool, PEq, (#==)) -import Plutarch.Builtin (PAsData, PData) +import Plutarch.Builtin (PData) import Plutarch.ByteString (PByteString) import Plutarch.Integer (PInteger) import Plutarch.Internal ( @@ -58,7 +61,9 @@ import Plutarch.Internal ( Term (Term), TermResult (TermResult), ) +import Plutarch.Internal.Generic (PCode) import Plutarch.Internal.PlutusType (PlutusType (PInner, pcon', pmatch')) +import Plutarch.Internal.Witness (witness) import Plutarch.List (PList, PListLike (PElemConstraint, pcons, pelimList, pnil), pconvertLists, plistEquals) import Plutarch.Maybe (PMaybe (PJust, PNothing)) import Plutarch.Show (PShow) @@ -71,12 +76,6 @@ import PlutusTx.Prelude (BuiltinString) import UntypedPlutusCore (fakeNameDeBruijn) import qualified UntypedPlutusCore as UPLC -data ForallPhantom :: Type -data PhorallPhantom :: PType - -data Delayed :: Type -> Type -data DelayedList :: Type -> Type - {- | Plutarch type of lists compatible with the PlutusTx encoding of Haskell lists and convertible with the regular 'PList' using 'plistToTx' and 'plistFromTx'. @@ -100,12 +99,12 @@ instance PEq a => PEq (PTxList a) where (#==) xs ys = plistEquals # xs # ys -- | Compile and export a Plutarch term so it can be used by `PlutusTx.applyCode`. -foreignExport :: p >~< t => Config -> ClosedTerm p -> CompiledCode t -foreignExport = unsafeForeignExport +foreignExport :: forall p t. p >~< t => Config -> ClosedTerm p -> CompiledCode t +foreignExport = let _ = witness (Proxy @(p >~< t)) in unsafeForeignExport -- | Import compiled UPLC code (such as a spliced `PlutusTx.compile` result) as a Plutarch term. -foreignImport :: p >~< t => CompiledCode t -> ClosedTerm p -foreignImport = unsafeForeignImport +foreignImport :: forall p t. p >~< t => CompiledCode t -> ClosedTerm p +foreignImport = let _ = witness (Proxy @(p >~< t)) in unsafeForeignImport -- | Export Plutarch term of any type as @CompiledCode Void@. opaqueExport :: Config -> ClosedTerm p -> CompiledCode Void @@ -154,67 +153,63 @@ pmaybeFromTx = PTxNothing -> PNothing PTxJust x -> PJust x +newtype PTxList' a r s = PTxList' (Term s (PDelayed (r :--> (a :--> PTxList a :--> r) :--> r))) + deriving stock (Generic) + deriving anyclass (PlutusType) +instance DerivePlutusType (PTxList' a r) where type DPTStrat _ = PlutusTypeNewtype + instance PlutusType (PTxList a) where - type PInner (PTxList a) r = PDelayed (r :--> (a :--> PTxList a :--> r) :--> r) - pcon' (PTxCons x xs) = pdelay $ plam $ \_nil cons -> cons # x # xs - pcon' PTxNil = phoistAcyclic $ pdelay $ plam $ \nil _cons -> nil - pmatch' elim f = pforce elim # f PTxNil # (plam $ \x xs -> f $ PTxCons x xs) + type PInner (PTxList a) = PForall (PTxList' a) + pcon' (PTxCons x xs) = pcon $ PForall $ pcon $ PTxList' $ pdelay $ plam $ \_nil cons -> cons # x # xs + pcon' PTxNil = pcon $ PForall $ pcon $ PTxList' $ phoistAcyclic $ pdelay $ plam $ \nil _cons -> nil + pmatch' elim f = pmatch elim \(PForall elim) -> pforce (pto elim) # f PTxNil # (plam $ \x xs -> f $ PTxCons x xs) instance PListLike PTxList where type PElemConstraint PTxList _ = () - pelimList cons nil list = pforce (pto list) # nil # plam cons + pelimList cons nil list = pmatch (pto list) \(PForall list) -> pforce (pto list) # nil # plam cons pcons = phoistAcyclic $ plam $ \x xs -> pcon (PTxCons x xs) pnil = pcon PTxNil -instance PlutusType (PTxMaybe a) where - type PInner (PTxMaybe a) r = PDelayed ((a :--> r) :--> r :--> r) - pcon' (PTxJust x) = pdelay $ plam $ \just _nothing -> just # x - pcon' PTxNothing = phoistAcyclic $ pdelay $ plam $ \_just nothing -> nothing - pmatch' elim f = pforce elim # (plam $ f . PTxJust) # f PTxNothing - --- | Equality of inner types - Plutarch on the left and Haskell on the right. -type p >~< t = PlutarchInner p PhorallPhantom ~~ PlutusTxInner t ForallPhantom +newtype PTxMaybe' a r s = PTxMaybe' (Term s (PDelayed ((a :--> r) :--> r :--> r))) + deriving stock (Generic) + deriving anyclass (PlutusType) +instance DerivePlutusType (PTxMaybe' a r) where type DPTStrat _ = PlutusTypeNewtype -type family a ~~ b :: Constraint where - ForallPhantom ~~ _ = () - _ ~~ ForallPhantom = () - Delayed a ~~ Delayed b = a ~~ b - a ~~ b = a ~ b +instance PlutusType (PTxMaybe a) where + type PInner (PTxMaybe a) = PForall (PTxMaybe' a) + pcon' (PTxJust x) = pcon $ PForall $ pcon $ PTxMaybe' $ pdelay $ plam $ \just _nothing -> just # x + pcon' PTxNothing = pcon $ PForall $ pcon $ PTxMaybe' $ phoistAcyclic $ pdelay $ plam $ \_just nothing -> nothing + pmatch' elim f = pmatch elim \(PForall elim) -> pforce (pto elim) # (plam $ f . PTxJust) # f PTxNothing -type family PlutarchInner (p :: PType) (any :: PType) :: Type where - PlutarchInner PBool _ = BuiltinBool - PlutarchInner PInteger _ = Integer - PlutarchInner PString _ = Text - PlutarchInner PByteString _ = ByteString - PlutarchInner PData _ = BuiltinData - PlutarchInner PUnit _ = () - PlutarchInner PhorallPhantom _ = ForallPhantom - PlutarchInner (PAsData a :--> PAsData b) x = PlutarchInner (PData :--> PData) x - PlutarchInner (PAsData a :--> b) x = PlutarchInner (PData :--> b) x - PlutarchInner (a :--> b) x = PlutarchInner a x -> PlutarchInner b x - PlutarchInner (PDelayed a) x = Delayed (PlutarchInner a x) - PlutarchInner (PTxList a) x = DelayedList (PlutarchInner a x) - PlutarchInner p x = PlutarchInner (PInner p x) x +type family F (p :: [PType]) (t :: [Type]) :: Constraint where + F '[] '[] = () + F (x : xs) (y : ys) = (x >~< y, F xs ys) -type family PlutusTxInner (t :: Type) (any :: Type) :: Type where - PlutusTxInner BuiltinBool _ = BuiltinBool - PlutusTxInner Integer _ = Integer - PlutusTxInner BuiltinString _ = Text - PlutusTxInner BuiltinByteString _ = ByteString - PlutusTxInner BuiltinData _ = BuiltinData - PlutusTxInner BuiltinUnit _ = () - PlutusTxInner ForallPhantom _ = ForallPhantom - PlutusTxInner (a -> b) x = PlutusTxInner a x -> PlutusTxInner b x - PlutusTxInner (Delayed a) x = Delayed (PlutusTxInner a x) - PlutusTxInner [a] x = DelayedList (PlutusTxInner a x) - PlutusTxInner a x = TypeEncoding (GCode a) (GDatatypeInfoOf a) x +type family G (p :: [[PType]]) (t :: [[Type]]) :: Constraint where + G '[] '[] = () + G (x : xs) (y : ys) = (F x y, G xs ys) -type TypeEncoding :: [[Type]] -> DatatypeInfo -> Type -> Type -type family TypeEncoding a rep x where - TypeEncoding '[ '[b]] ( 'Newtype _ _ _) x = PlutusTxInner b x +-- | Equality of inner types - Plutarch on the left and Haskell on the right. +type family (p :: PType) >~< (t :: Type) :: Constraint where + PBool >~< BuiltinBool = () + PInteger >~< Integer = () + PString >~< BuiltinString = () + PByteString >~< BuiltinByteString = () + PData >~< BuiltinData = () + PUnit >~< BuiltinUnit = () + (a :--> b) >~< (a' -> b') = (a >~< a', b >~< b') + (PTxList a) >~< [a'] = a >~< a' + (PTxMaybe a) >~< Maybe a' = a >~< a' + (PDelayed p) >~< t = (DPTStrat p ~ PlutusTypeScott, G (PCode p) (TypeEncoding t)) + +type TypeEncoding a = (TypeEncoding' (GCode a) (GDatatypeInfoOf a)) + +type TypeEncoding' :: [[Type]] -> DatatypeInfo -> [[Type]] +type family TypeEncoding' a rep where + TypeEncoding' '[ '[b]] ( 'Newtype _ _ _) = TypeEncoding b -- Matching the behaviour of PlutusTx.Lift.Class.sortedCons - TypeEncoding sop ( 'ADT _ "Bool" _ _) x = Delayed (PlutusTxInner (ScottFn (ScottList sop x) x) x) - TypeEncoding sop ( 'ADT _ _ cons _) x = Delayed (PlutusTxInner (ScottFn (ScottList (Fst (SortedBy '(sop, NamesOf cons))) x) x) x) + TypeEncoding' sop ( 'ADT _ "Bool" _ _) = sop + TypeEncoding' sop ( 'ADT _ _ cons _) = Fst (SortedBy '(sop, NamesOf cons)) type Fst :: (a, b) -> a type family Fst x where @@ -245,40 +240,3 @@ type family NamesOf cs where NamesOf ( 'Infix name _ _ ': cs) = name ': NamesOf cs NamesOf ( 'Record name _ ': cs) = name ': NamesOf cs NamesOf '[] = '[] - -{- | - List of scott-encoded constructors of a Haskell type (represented by 'SOP.Code') - - ScottList (Code (Either a b)) c = '[a -> c, b -> c] --} -type ScottList :: [[Type]] -> Type -> [Type] -type family ScottList code c where --- We disallow certain shapes because Scott encoding is not appropriate for them. - ScottList '[] c = TypeError ( 'TypeLits.Text "PlutusType(scott encoding): Data type without constructors not accepted") - ScottList '[ '[]] c = - TypeError - ( 'TypeLits.Text - "PlutusType(scott encoding): Data type with single nullary constructor not accepted" - ) - ScottList '[ '[_]] c = - TypeError - ( 'TypeLits.Text - "PlutusType(scott encoding): Data type with single unary constructor not accepted; use newtype!" - ) - ScottList (xs ': xss) c = ScottFn xs c ': ScottList' xss c - -type ScottList' :: [[Type]] -> Type -> [Type] -type family ScottList' code c where - ScottList' '[] c = '[] - ScottList' (xs ': xss) c = ScottFn xs c ': ScottList' xss c - -{- | - An individual constructor function of a Scott encoding. - - ScottFn '[a, b] c = (a -> b -> c) - ScottFn '[] c = c --} -type ScottFn :: [Type] -> Type -> Type -type family ScottFn xs b where - ScottFn '[] b = b - ScottFn (x ': xs) b = x -> ScottFn xs b diff --git a/Plutarch/Integer.hs b/Plutarch/Integer.hs index a018bd8ef..ccd9f569a 100644 --- a/Plutarch/Integer.hs +++ b/Plutarch/Integer.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -7,14 +8,13 @@ import Plutarch.Bool (PEq, POrd, pif, (#<), (#<=), (#==)) import Plutarch.Internal ( Term, phoistAcyclic, - plet, (:-->), ) import Plutarch.Internal.Other ( - DerivePNewtype, pto, ) import Plutarch.Internal.PLam (plam, (#)) +import Plutarch.Internal.PlutusType (PInner) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, @@ -22,6 +22,7 @@ import Plutarch.Lift ( PUnsafeLiftDecl, pconstant, ) +import Plutarch.Num (PNum, pabs, pfromInteger, pnegate, psignum, (#*), (#+), (#-)) import Plutarch.Unsafe (punsafeBuiltin, punsafeDowncast) import qualified PlutusCore as PLC @@ -33,9 +34,17 @@ deriving via (DerivePConstantDirect Integer PInteger) instance PConstantDecl Int class PIntegral a where pdiv :: Term s (a :--> a :--> a) + default pdiv :: PIntegral (PInner a) => Term s (a :--> a :--> a) + pdiv = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ pdiv # pto x # pto y pmod :: Term s (a :--> a :--> a) + default pmod :: PIntegral (PInner a) => Term s (a :--> a :--> a) + pmod = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ pmod # pto x # pto y pquot :: Term s (a :--> a :--> a) + default pquot :: PIntegral (PInner a) => Term s (a :--> a :--> a) + pquot = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ pquot # pto x # pto y prem :: Term s (a :--> a :--> a) + default prem :: PIntegral (PInner a) => Term s (a :--> a :--> a) + prem = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ prem # pto x # pto y instance PIntegral PInteger where pdiv = punsafeBuiltin PLC.DivideInteger @@ -50,13 +59,13 @@ instance POrd PInteger where x #<= y = punsafeBuiltin PLC.LessThanEqualsInteger # x # y x #< y = punsafeBuiltin PLC.LessThanInteger # x # y -instance Num (Term s PInteger) where - x + y = punsafeBuiltin PLC.AddInteger # x # y - x - y = punsafeBuiltin PLC.SubtractInteger # x # y - x * y = punsafeBuiltin PLC.MultiplyInteger # x # y - abs x' = plet x' $ \x -> pif (x #<= -1) (negate x) x - negate x = 0 - x - signum x' = plet x' $ \x -> +instance PNum PInteger where + x #+ y = punsafeBuiltin PLC.AddInteger # x # y + x #- y = punsafeBuiltin PLC.SubtractInteger # x # y + x #* y = punsafeBuiltin PLC.MultiplyInteger # x # y + pabs = phoistAcyclic $ plam \x -> pif (x #<= -1) (negate x) x + pnegate = phoistAcyclic $ plam \x -> 0 #- x + psignum = plam \x -> pif (x #== 0) 0 @@ -64,10 +73,4 @@ instance Num (Term s PInteger) where (x #<= 0) (-1) 1 - fromInteger = pconstant - -instance PIntegral b => PIntegral (DerivePNewtype a b) where - pdiv = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ pdiv # pto x # pto y - pmod = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ pmod # pto x # pto y - pquot = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ pquot # pto x # pto y - prem = phoistAcyclic $ plam $ \x y -> punsafeDowncast $ prem # pto x # pto y + pfromInteger = pconstant diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 3d202b4b2..e061d6981 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -2,7 +2,7 @@ module Plutarch.Internal ( -- | $hoisted - (:-->), + (:-->) (PLam), PDelayed, -- | $term Term (..), @@ -14,7 +14,6 @@ module Plutarch.Internal ( pdelay, pforce, phoistAcyclic, - punsafeAsClosedTerm, perror, punsafeCoerce, punsafeBuiltin, @@ -54,7 +53,6 @@ import qualified Flat.Run as F import GHC.Stack (HasCallStack, callStack, prettyCallStack) import GHC.Word (Word64) import Plutarch.Evaluate (evalScript) -import Plutarch.Reducible (Reducible (Reduce)) import PlutusCore (Some (Some), ValueOf (ValueOf)) import qualified PlutusCore as PLC import PlutusCore.DeBruijn (DeBruijn (DeBruijn), Index (Index)) @@ -134,8 +132,6 @@ data S = SI -- | Shorthand for Plutarch types. type PType = S -> Type -type role Term phantom representational - data Config = Config { tracingMode :: TracingMode } @@ -152,6 +148,8 @@ defaultConfig = newtype TermMonad m = TermMonad {runTermMonad :: ReaderT Config (Either Text) m} deriving newtype (Functor, Applicative, Monad) +type role Term nominal nominal + {- $term Source: Unembedding Domain-Specific Languages by Robert Atkey, Sam Lindley, Jeremy Yallop Thanks! @@ -168,14 +166,13 @@ newtype TermMonad m = TermMonad {runTermMonad :: ReaderT Config (Either Text) m} -} newtype Term (s :: S) (a :: PType) = Term {asRawTerm :: Word64 -> TermMonad TermResult} -instance Reducible (Term s a) where type Reduce (Term s a) = Term s a - {- | *Closed* terms with no free variables. -} type ClosedTerm (a :: PType) = forall (s :: S). Term s a data (:-->) (a :: PType) (b :: PType) (s :: S) + = PLam (Term s a -> Term s b) infixr 0 :--> data PDelayed (a :: PType) (s :: S) @@ -379,9 +376,6 @@ phoistAcyclic t = Term \_ -> in pure $ TermResult (RHoisted hoisted) (hoisted : getDeps t') (Left e, _, _) -> pthrow' $ "Hoisted term errs! " <> fromString (show e) -punsafeAsClosedTerm :: forall s a. Term s a -> ClosedTerm a -punsafeAsClosedTerm (Term t) = (Term t) - -- Couldn't find a definition for this in plutus-core subst :: Word64 -> (Word64 -> UTerm) -> UTerm -> UTerm subst idx x (UPLC.Apply () yx yy) = UPLC.Apply () (subst idx x yx) (subst idx x yy) diff --git a/Plutarch/Internal/Generic.hs b/Plutarch/Internal/Generic.hs index 72068e297..e55bd986b 100644 --- a/Plutarch/Internal/Generic.hs +++ b/Plutarch/Internal/Generic.hs @@ -1,5 +1,6 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} {- Common generics-sop utilities for use in Plutarch. -} @@ -9,69 +10,60 @@ module Plutarch.Internal.Generic ( PCode, gpfrom, gpto, - - -- * Helpers for when existing generics-sop combinators are insufficient. - MkNS, - mkNS, - mkSum, ) where -import Data.Kind (Constraint, Type) -import GHC.TypeLits (Nat, type (-)) -import Generics.SOP (All, AllZip, Code, Generic (from, to), I, LiftedCoercible, NP, NS (S, Z), SOP, SameShapeAs, Top, hfromI, htoI) -import Generics.SOP.Constraint (AllZipF) -import Plutarch.DataRepr.Internal.HList.Utils (IndexList) +import Data.Kind (Constraint) +import GHC.Exts (Any) +import GHC.Generics (Generic) +import Generics.SOP (All2, I, SOP, Top) +import Generics.SOP.GGP (GCode, GDatatypeInfo, GFrom, GTo, gfrom, gto) import Plutarch.Internal (PType, S, Term) import Plutarch.Internal.TypeFamily (ToPType2) +import Unsafe.Coerce (unsafeCoerce) -- lol --- | `Generic` constraint extended to work with Plutarch types. -type PGeneric :: S -> PType -> Constraint -type PGeneric s a = - ( Generic (a s) - , SameShapeAs (Code (a s)) (PCode s a) - , SameShapeAs (PCode s a) (Code (a s)) - , AllZipF (AllZip (LiftedCoercible I (Term s))) (Code (a s)) (PCode s a) - , AllZipF (AllZip (LiftedCoercible (Term s) I)) (PCode s a) (Code (a s)) - , All Top (PCode s a) - ) - --- | Like `Code` but for Plutarch types -type PCode s a = ToPType2 (Code (a s)) +class GFrom a => GFrom' a +instance GFrom a => GFrom' a -{- | Like `from` but for Plutarch terms +class GTo a => GTo' a +instance GTo a => GTo' a - Instead of `I`, this uses `Term s` as the container type. --} -gpfrom :: PGeneric s a => a s -> SOP (Term s) (PCode s a) -gpfrom = hfromI . from - --- | Like `to` but for Plutarch terms. Analogous to `gpfrom`. -gpto :: PGeneric s a => SOP (Term s) (PCode s a) -> a s -gpto = to . htoI +type PGeneric' :: PType -> S -> Constraint +class + ( Generic (a s) + , GFrom (a s) + , GTo (a s) + , All2 Top (PCode a) -- DO NOT REMOVE! Will cause unsound behavior otherwise. See `unsafeCoerce` below. + , All2 Top (GCode (a s)) + , GDatatypeInfo (a s) + ) => + PGeneric' a s +instance + ( Generic (a s) + , GFrom (a s) + , GTo (a s) + , All2 Top (PCode a) -- DO NOT REMOVE! Will cause unsound behavior otherwise. See `unsafeCoerce` below. + , All2 Top (GCode (a s)) + , GDatatypeInfo (a s) + ) => + PGeneric' a s -{- | -Infrastructure to create a single sum constructor given its type index and value. +-- | `Generic` constraint extended to work with Plutarch types. +type PGeneric :: PType -> Constraint +class (forall s. PGeneric' a s) => PGeneric a -- `mkSum @0 @(Code a) x` creates the first sum constructor; -- `mkSum @1 @(Code a) x` creates the second sum constructor; -- etc. +instance (forall s. PGeneric' a s) => PGeneric a -It is type-checked that the `x` here matches the type of nth constructor of `a`. --} -class MkNS (idx :: Nat) (xs :: [k]) (f :: k -> Type) where - mkNS :: f (IndexList idx xs) -> NS f xs +type PCode :: PType -> [[PType]] -instance {-# OVERLAPPING #-} MkNS 0 (x ': xs) f where - mkNS = Z +-- | Like `Code` but for Plutarch types +type PCode a = ToPType2 (GCode (a Any)) -instance - {-# OVERLAPPABLE #-} - ( MkNS (idx - 1) xs f - , IndexList idx (x ': xs) ~ IndexList (idx - 1) xs - ) => - MkNS idx (x ': xs) f - where - mkNS x = S $ mkNS @_ @(idx - 1) @xs x +gpfrom :: forall a s. PGeneric a => a s -> SOP (Term s) (PCode a) +-- This could be done safely, but it's a PITA. +-- Depends on `All` constraint above. +gpfrom x = unsafeCoerce $ (gfrom x :: SOP I (GCode (a s))) -mkSum :: forall idx xss f. MkNS idx xss (NP f) => NP f (IndexList idx xss) -> NS (NP f) xss -mkSum = mkNS @_ @idx @xss @(NP f) +gpto :: forall a s. PGeneric a => SOP (Term s) (PCode a) -> a s +-- This could be done safely, but it's a PITA. +-- Depends on `All` constraint above. +gpto x = gto (unsafeCoerce x :: SOP I (GCode (a s))) diff --git a/Plutarch/Internal/Newtype.hs b/Plutarch/Internal/Newtype.hs new file mode 100644 index 000000000..b98d72228 --- /dev/null +++ b/Plutarch/Internal/Newtype.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.Internal.Newtype (PlutusTypeNewtype) where + +import qualified Generics.SOP as SOP +import Plutarch.Internal (PType) +import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom, gpto) +import Plutarch.Internal.PlutusType ( + DerivedPInner, + PlutusTypeStrat, + PlutusTypeStratConstraint, + derivedPCon, + derivedPMatch, + ) + +data PlutusTypeNewtype + +class (PGeneric a, PCode a ~ '[ '[GetPNewtype a]]) => Helper (a :: PType) +instance (PGeneric a, PCode a ~ '[ '[GetPNewtype a]]) => Helper (a :: PType) + +instance PlutusTypeStrat PlutusTypeNewtype where + type PlutusTypeStratConstraint PlutusTypeNewtype = Helper + type DerivedPInner PlutusTypeNewtype a = GetPNewtype a + derivedPCon x = case gpfrom x of + SOP.SOP (SOP.Z (x SOP.:* SOP.Nil)) -> x + SOP.SOP (SOP.S x) -> case x of {} + derivedPMatch x f = f (gpto $ SOP.SOP $ SOP.Z $ x SOP.:* SOP.Nil) + +type family GetPNewtype' (a :: [[PType]]) :: PType where + GetPNewtype' '[ '[a]] = a + +type family GetPNewtype (a :: PType) :: PType where + GetPNewtype a = GetPNewtype' (PCode a) diff --git a/Plutarch/Internal/Other.hs b/Plutarch/Internal/Other.hs index 3bb16ab97..8a369e9a3 100644 --- a/Plutarch/Internal/Other.hs +++ b/Plutarch/Internal/Other.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.Internal.Other ( @@ -8,18 +7,21 @@ module Plutarch.Internal.Other ( pfix, POpaque (..), popaque, - DerivePNewtype (DerivePNewtype), - PForall (PForall), ) where -import Data.Coerce (Coercible, coerce) -import Data.Kind (Type) import qualified Data.Text as T import GHC.Stack (HasCallStack) -import Plutarch.Internal (ClosedTerm, Config, PType, Term, compile, phoistAcyclic, punsafeCoerce, (:-->)) -import qualified Plutarch.Internal as PI +import Plutarch.Internal (ClosedTerm, Config, Term, compile, phoistAcyclic, punsafeCoerce, (:-->)) import Plutarch.Internal.PLam (plam, (#)) -import Plutarch.Internal.PlutusType (PInner, PlutusType, pcon', pmatch') +import Plutarch.Internal.PlutusType ( + PContravariant', + PCovariant', + PInner, + PVariant', + PlutusType, + pcon', + pmatch', + ) import PlutusCore.Pretty (prettyPlcReadableDebug) import PlutusLedgerApi.V1.Scripts (Script (Script)) @@ -41,14 +43,17 @@ printTerm config term = printScript $ either (error . T.unpack) id $ compile con {- | Safely coerce from a Term to it's 'PInner' representation. -} -pto :: Term s a -> (forall b. Term s (PInner a b)) +pto :: Term s a -> Term s (PInner a) pto x = punsafeCoerce x -- | An Arbitrary Term with an unknown type data POpaque s = POpaque (Term s POpaque) instance PlutusType POpaque where - type PInner POpaque _ = POpaque + type PInner POpaque = POpaque + type PCovariant' POpaque = () + type PContravariant' POpaque = () + type PVariant' POpaque = () pcon' (POpaque x) = x pmatch' x f = f (POpaque x) @@ -81,48 +86,3 @@ pfix = phoistAcyclic $ plam $ \f -> (plam $ \(x :: Term s POpaque) -> f # (plam $ \(v :: Term s POpaque) -> (punsafeCoerce x) # x # v)) # punsafeCoerce (plam $ \(x :: Term s POpaque) -> f # (plam $ \(v :: Term s POpaque) -> (punsafeCoerce x) # x # v)) - -{- | Facilitates deriving 'PlutusType' and 'PIsData' for newtypes. - -For any newtype represented as- -> newtype PFoo (s :: S) = PFoo (Term s PBar) - -where 'PBar' has a 'PIsData' instance, you can derive 'PlutusType' and 'PIsData' using- -> deriving (PlutusType, PIsData) via (DerivePNewtype PFoo PBar) - -This will make 'PFoo' simply be represnted as 'PBar' under the hood. --} -type role DerivePNewtype representational representational nominal - -newtype DerivePNewtype (a :: PType) (b :: PType) (s :: PI.S) = DerivePNewtype (a s) - -instance (forall (s :: PI.S). Coercible (a s) (Term s b)) => PlutusType (DerivePNewtype a b) where - type PInner (DerivePNewtype a b) _ = b - pcon' (DerivePNewtype t) = ptypeInner t - pmatch' x f = f . DerivePNewtype $ ptypeOuter x - -instance Semigroup (Term s b) => Semigroup (Term s (DerivePNewtype a b)) where - x <> y = punsafeDowncast $ pto x <> pto y - -instance Monoid (Term s b) => Monoid (Term s (DerivePNewtype a b)) where - mempty = punsafeDowncast $ mempty @(Term s b) - -instance Num (Term s b) => Num (Term s (DerivePNewtype a b)) where - x + y = punsafeDowncast $ pto x + pto y - x - y = punsafeDowncast $ pto x - pto y - x * y = punsafeDowncast $ pto x * pto y - abs x = punsafeDowncast $ abs $ pto x - negate x = punsafeDowncast $ negate $ pto x - signum x = punsafeDowncast $ signum $ pto x - fromInteger x = punsafeDowncast $ fromInteger @(Term s b) x - -ptypeInner :: forall (x :: PType) y s. Coercible (x s) (Term s y) => x s -> Term s y -ptypeInner = coerce - -ptypeOuter :: forall (x :: PType) y s. Coercible (x s) (Term s y) => Term s y -> x s -ptypeOuter = coerce - -punsafeDowncast :: (forall b. Term s (PInner a b)) -> Term s a -punsafeDowncast x = PI.punsafeCoerce x - -data PForall (a :: Type) (b :: a -> PType) s = PForall (forall (x :: a). Term s (b x)) diff --git a/Plutarch/Internal/PLam.hs b/Plutarch/Internal/PLam.hs index 479de755b..89a9b20e5 100644 --- a/Plutarch/Internal/PLam.hs +++ b/Plutarch/Internal/PLam.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE FunctionalDependencies #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} module Plutarch.Internal.PLam ( @@ -52,10 +52,10 @@ infixr 0 #$ class PLamN (a :: Type) (b :: PType) (s :: S) | a -> b, s b -> a where plam :: forall c. (Term s c -> a) -> Term s (c :--> b) -instance (a' ~ Term s a) => PLamN a' a s where +instance {-# OVERLAPPABLE #-} (a' ~ Term s a) => PLamN a' a s where plam = plam' -instance {-# OVERLAPPING #-} (a' ~ Term s a, PLamN b' b s) => PLamN (a' -> b') (a :--> b) s where +instance (a' ~ Term s a, PLamN b' b s) => PLamN (a' -> b') (a :--> b) s where plam f = plam' $ \x -> plam (f x) pinl :: Term s a -> (Term s a -> Term s b) -> Term s b diff --git a/Plutarch/Internal/PlutusType.hs b/Plutarch/Internal/PlutusType.hs index 1e0c0bca1..e4ee2b890 100644 --- a/Plutarch/Internal/PlutusType.hs +++ b/Plutarch/Internal/PlutusType.hs @@ -1,9 +1,11 @@ {-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Plutarch.Internal.PlutusType ( PlutusType, + PlutusTypeStratConstraint, PCon, PMatch, pcon', @@ -11,116 +13,62 @@ module Plutarch.Internal.PlutusType ( pmatch, pcon, PInner, + PlutusTypeStrat, + DerivePlutusType, + DPTStrat, + DerivedPInner, + derivedPCon, + derivedPMatch, + PVariant, + PCovariant, + PContravariant, + PVariant', + PCovariant', + PContravariant', ) where -import Data.Kind (Type) -import GHC.TypeLits (ErrorMessage (Text), Nat, TypeError, type (+)) -import Generics.SOP ( - All, - Generic (Code), - NP (Nil, (:*)), - NS (S, Z), - SOP (SOP), - Top, - ) -import Plutarch.DataRepr.Internal.HList.Utils (IndexList) -import Plutarch.Internal (PType, S, Term, pforce, plam', punsafeCoerce, (:-->)) -import qualified Plutarch.Internal as PI -import Plutarch.Internal.Generic (MkNS, PCode, PGeneric, gpfrom, gpto, mkSum) +import Data.Kind (Constraint, Type) +import Data.Proxy (Proxy (Proxy)) +import Generics.SOP (All2) +import Plutarch.Internal (PType, Term, plam', plet, punsafeCoerce, (:-->) (PLam)) +import Plutarch.Internal.Generic (PCode) import Plutarch.Internal.PLam ((#)) -import Plutarch.Internal.TypeFamily (ToPType, ToPType2) - -{- | - - The 'PlutusType' class allows encoding Haskell data-types as plutus terms - via constructors and destructors. - - Typically, you want to use scott encoding to represent the data type, which - can be automatically derived as follows: - - > import qualified GHC.Generics as GHC - > import Generics.SOP - > - > data MyType (a :: PType) (b :: PType) (s :: S) - > = One (Term s a) - > | Two (Term s b) - > deriving stock (GHC.Generic) - > deriving anyclass (Generic, PlutusType) - - If you instead want to use data encoding, you should first implement "Plutarch.PDataRepr.PIsDataRepr", and then - derive 'PlutusType' via "Plutarch.PDataRepr.PIsDataReprInstances": - - > import qualified GHC.Generics as GHC - > import Generics.SOP - > import Plutarch.DataRepr - > - > data MyType (a :: PType) (b :: PType) (s :: S) - > = One (Term s (PDataRecord '[ "_0" ':= a ])) - > | Two (Term s (PDataRecord '[ "_0" ':= b ])) - > deriving stock (GHC.Generic) - > deriving anyclass (Generic, PIsDataRepr) - > deriving (PlutusType, PIsData) via PIsDataReprInstances (MyType a b) - - Alternatively, you may derive 'PlutusType' by hand as well. A simple example, encoding a - Sum type as an Enum via PInteger: - - > data AB (s :: S) = A | B - > - > instance PlutusType AB where - > type PInner AB _ = PInteger - > - > pcon' A = 0 - > pcon' B = 1 - > - > pmatch' x f = - > pif (x #== 0) (f A) (f B) - > - - instead of using `pcon'` and `pmatch'` directly, - use 'pcon' and 'pmatch', to hide the `PInner` type: - - > swap :: Term s AB -> Term s AB - > swap x = pmatch x $ \case - > A -> pcon B - > B -> pcon A +import Plutarch.Internal.Quantification (PFix (PFix), PForall (PForall), PSome (PSome)) +import Plutarch.Internal.Witness (witness) + +class PlutusTypeStrat (strategy :: Type) where + type PlutusTypeStratConstraint strategy :: PType -> Constraint + type DerivedPInner strategy (a :: PType) :: PType + derivedPCon :: forall a s. (DerivePlutusType a, DPTStrat a ~ strategy) => a s -> Term s (DerivedPInner strategy a) + derivedPMatch :: forall a s b. (DerivePlutusType a, DPTStrat a ~ strategy) => (Term s (DerivedPInner strategy a)) -> (a s -> Term s b) -> Term s b + +class + ( PInner a ~ DerivedPInner (DPTStrat a) a + , PlutusTypeStrat (DPTStrat a) + , PlutusTypeStratConstraint (DPTStrat a) a + , PlutusType a + ) => + DerivePlutusType (a :: PType) + where + type DPTStrat a :: Type - Further examples can be found in examples/PlutusType.hs --} class PlutusType (a :: PType) where - -- `b' :: k'` causes GHC to fail type checking at various places - -- due to not being able to expand the type family. - type PInner a (b' :: PType) :: PType - type PInner a (b' :: PType) = ScottFn (ScottList 'PI.SI (ToPType2 (Code (a 'PI.SI))) b') b' - pcon' :: forall s b. a s -> Term s (PInner a b) - default pcon' :: - forall s b code pcode. - ( code ~ Code (a s) - , pcode ~ PCode s a - , PGeneric s a - , GPCon pcode b s - , PLamL (ScottList' s pcode b) b s - , ScottFn' (ScottList s pcode b) b ~ PInner a b - , ScottFn (ScottList' s pcode b) b ~ PInner a b - , All Top pcode - ) => - a s -> - Term s (PInner a b) - pcon' x = gpcon @a @b $ gpfrom x - - pmatch' :: forall s b. (Term s (PInner a b)) -> (a s -> Term s b) -> Term s b - default pmatch' :: - forall s b code pcode. - ( code ~ Code (a s) - , pcode ~ PCode s a - , PGeneric s a - , AppL b (ScottList' s pcode b) - , GPMatch a 0 code b s - , PInner a b ~ ScottFn (ScottList' s pcode b) b - ) => - (Term s (PInner a b)) -> - (a s -> Term s b) -> - Term s b - pmatch' x f = gpmatch @a x (f . gpto) + type PInner a :: PType + type PInner a = DerivedPInner (DPTStrat a) a + type PCovariant' a :: Constraint + type PCovariant' a = All2 PCovariant'' (PCode a) + type PContravariant' a :: Constraint + type PContravariant' a = All2 PContravariant'' (PCode a) + type PVariant' a :: Constraint + type PVariant' a = All2 PVariant'' (PCode a) + pcon' :: forall s. a s -> Term s (PInner a) + default pcon' :: DerivePlutusType a => forall s. a s -> Term s (PInner a) + pcon' = let _ = witness (Proxy @(PlutusType a)) in derivedPCon + + pmatch' :: forall s b. (Term s (PInner a)) -> (a s -> Term s b) -> Term s b + -- FIXME buggy GHC, needs AllowAmbiguousTypes + default pmatch' :: DerivePlutusType a => forall s b. (Term s (PInner a)) -> (a s -> Term s b) -> Term s b + pmatch' = derivedPMatch {-# DEPRECATED PCon "Use PlutusType" #-} type PCon = PlutusType @@ -135,187 +83,43 @@ pcon x = punsafeCoerce (pcon' x) pmatch :: PlutusType a => Term s a -> (a s -> Term s b) -> Term s b pmatch x f = pmatch' (punsafeCoerce x) f --- | Generic version of `pcon'` -gpcon :: - forall a c s code pcode. - ( PlutusType a - , PGeneric s a - , code ~ Code (a s) - , pcode ~ PCode s a - , GPCon pcode c s - , PLamL (ScottList' s pcode c) c s - , ScottFn (ScottList' s pcode c) c ~ ScottFn' (ScottList s pcode c) c - ) => - SOP (Term s) pcode -> - Term s (ScottFn' (ScottList s pcode c) c) -gpcon (SOP val) = - plamL @(ScottList' s pcode c) @c $ \(f :: NP (Term s) (ScottList' s pcode c)) -> - gpcon' @pcode @c @s f val - -{- | - `gpcon'`, given a *partial* scott encoding (as a `PLamL`) and a sum choice, applies - that encoding to the sum choice. - - The partial encoding is any tail of the full scott encoded function, such that - one of its elements corresponds to the sum choice. --} -class GPCon (xss :: [[PType]]) (c :: PType) (s :: S) where - gpcon' :: NP (Term s) (ScottList' s xss c) -> NS (NP (Term s)) xss -> Term s c - -instance GPCon '[] c s where - gpcon' Nil = \case {} - -instance (GPCon xs c s, AppL c x) => GPCon (x ': xs) c s where - gpcon' (f :* fs) = \case - Z x -> f `appL` x - S xs -> gpcon' fs xs - -{- | - Generic version of `pmatch'` --} -gpmatch :: - forall a s c code pcode. - ( PGeneric s a - , code ~ Code (a s) - , pcode ~ PCode s a - , AppL c (ScottList' s pcode c) - , GPMatch a 0 code c s - ) => - Term s (ScottFn (ScottList' s pcode c) c) -> - (SOP (Term s) pcode -> Term s c) -> - Term s c -gpmatch x f = - x `appL` gpmatch' @a @0 @code @c @s f - -{- | - `gpmatch'` returns a hlist of lambdas (or delayed terms) to be applied on the - scott encoding function. --} -class GPMatch (a :: PType) (n :: Nat) (xss :: [[Type]]) (c :: PType) (s :: S) where - gpmatch' :: (SOP (Term s) (PCode s a) -> Term s c) -> NP (Term s) (ScottList' s (ToPType2 xss) c) - -instance GPMatch a n '[] c s where - gpmatch' _ = Nil - -instance - ( code ~ Code (a s) - , ToPType xs ~ IndexList n (PCode s a) - , GPMatch a (n + 1) xss c s - , PLamL (ToPType xs) c s - , MkNS n (PCode s a) (NP (Term s)) - , All Top (ToPType xs) - , All Top xs - ) => - GPMatch a n (xs : xss) c s - where - gpmatch' f = - plamL @(ToPType xs) @c (f . SOP . mkSum @n @(PCode s a) @(Term s)) - :* gpmatch' @a @(n + 1) @xss @c @s f - -{- | - `plamL` is like `plamL'`, but pdelays the 0-arity case. - - ``` - plamL $ \Nil -> pcon 42 -- Equivalent to: `pdelay (pcon 42)`. --} -class PLamL (as :: [PType]) (b :: PType) (s :: S) where - plamL :: (NP (Term s) as -> Term s b) -> Term s (ScottFn as b) - -instance PLamL '[] b s where - plamL f = PI.pdelay $ f Nil - -instance PLamL' as b s => PLamL (a ': as) b s where - plamL f = plam' $ \a -> plamL' $ \as -> f (a :* as) - -{- | - `plamL'` produces a multi-arity plam, but taking a HList of Plutarch terms as - arguments. - - ``` - plamL $ \(x :* y :* Nil) -> - x + y - ``` - - - `NP (Term s) '[x, y]` corresponds to `x :* y :* Nil`. - - `ScottFn' '[x, y] b` corresponds to `x :--> y :--> b`. --} -class PLamL' (as :: [PType]) (b :: PType) (s :: S) where - plamL' :: (NP (Term s) as -> Term s b) -> Term s (ScottFn' as b) - -instance PLamL' '[] b s where - plamL' f = f Nil - -instance PLamL' as b s => PLamL' (a ': as) b s where - plamL' f = plam' $ \a -> plamL' $ \as -> f (a :* as) - -{- | - `appL` is like `appL'`, but pforce's the 0-arity case. - - ``` - f = plamL $ \Nil -> pdelay $ pcon 42 - g = f `appL` Ni - ``` --} -class AppL (c :: PType) (xs :: [PType]) where - appL :: Term s (ScottFn xs c) -> NP (Term s) xs -> Term s c - -instance AppL c '[] where - appL f Nil = pforce f - -instance (AppL' c xs, AppL c xs) => AppL c (x ': xs) where - appL f (x :* xs) = (f # x) `appL'` xs - -{- | - `appL'` takes a multi-argument lambda (produced by `plamL`) and applies it to - the associated list of values. +class PCovariant' a => PCovariant'' a +instance PCovariant' a => PCovariant'' a - ``` - f = plamL $ \(x :* y :* z :* Nil) -> x + y + z - g = f `appL'` (1 :* 2 :* 3 :* Nil) - ``` --} -class AppL' (c :: PType) (xs :: [PType]) where - appL' :: Term s (ScottFn' xs c) -> NP (Term s) xs -> Term s c +class PContravariant' a => PContravariant'' a +instance PContravariant' a => PContravariant'' a -instance AppL' c '[] where - appL' f Nil = f +class PVariant' a => PVariant'' a +instance PVariant' a => PVariant'' a -instance AppL' c xs => AppL' c (x ': xs) where - appL' f (x :* xs) = (f # x) `appL'` xs +class (forall t. PCovariant'' t => PCovariant'' (a t)) => PCovariant a +instance (forall t. PCovariant'' t => PCovariant'' (a t)) => PCovariant a -{- | - List of scott-encoded constructors of a Plutarch type (represented by `Code`) +class (forall t. PCovariant'' t => PContravariant'' (a t)) => PContravariant a +instance (forall t. PCovariant'' t => PContravariant'' (a t)) => PContravariant a - ScottList s (Code (PEither a b s)) c = '[a :--> c, b :--> c] --} -type ScottList :: S -> [[PType]] -> PType -> [PType] -type family ScottList s code c where --- We disallow certain shapes because Scott encoding is not appropriate for them. - ScottList _ '[] c = TypeError ( 'Text "PlutusType(scott encoding): Data type without constructors not accepted") - ScottList _ '[ '[]] c = TypeError ( 'Text "PlutusType(scott encoding): Data type with single nullary constructor not accepted") - ScottList _ '[ '[_]] c = TypeError ( 'Text "PlutusType(scott encoding): Data type with single unary constructor not accepted; use newtype!") - ScottList s (xs ': xss) c = ScottFn xs c ': ScottList' s xss c +class (forall t. PVariant'' t => PVariant'' (a t)) => PVariant a +instance (forall t. PVariant'' t => PVariant'' (a t)) => PVariant a -type ScottList' :: S -> [[PType]] -> PType -> [PType] -type family ScottList' s code c where - ScottList' _ '[] c = '[] - ScottList' s (xs ': xss) c = ScottFn xs c ': ScottList' s xss c +instance PlutusType (a :--> b) where + type PInner (a :--> b) = a :--> b + type PCovariant' (a :--> b) = (PContravariant' a, PCovariant' b) + type PContravariant' (a :--> b) = (PCovariant' a, PContravariant' b) + type PVariant' (a :--> b) = (PVariant' a, PVariant' b) + pcon' (PLam f) = plam' f + pmatch' f g = plet f \f' -> g (PLam (f' #)) -{- | - An individual constructor function of a Scott encoding. +instance PlutusType (PForall f) where + type PInner (PForall f) = PForall f + pcon' (PForall x) = punsafeCoerce x + pmatch' x f = f (PForall $ punsafeCoerce x) - ScottFn '[a, b] c = (a :--> b :--> c) - ScottFn '[] c = PDelayed c --} -type ScottFn :: [PType] -> PType -> PType -type family ScottFn xs b where - ScottFn '[] b = PI.PDelayed b - ScottFn (x ': xs) b = x :--> ScottFn' xs b +instance PlutusType (PSome f) where + type PInner (PSome f) = PSome f + pcon' (PSome x) = punsafeCoerce x + pmatch' x f = f (PSome $ punsafeCoerce x) -{- | - Like `ScottFn`, but without the PDelayed case. --} -type ScottFn' :: [PType] -> PType -> PType -type family ScottFn' xs b where - ScottFn' '[] b = b - ScottFn' (x ': xs) b = x :--> ScottFn' xs b +instance PlutusType (PFix f) where + type PInner (PFix f) = f (PFix f) + pcon' (PFix x) = x + pmatch' x f = f (PFix x) diff --git a/Plutarch/Internal/Quantification.hs b/Plutarch/Internal/Quantification.hs new file mode 100644 index 000000000..0bf68fdfb --- /dev/null +++ b/Plutarch/Internal/Quantification.hs @@ -0,0 +1,12 @@ +module Plutarch.Internal.Quantification (PForall (PForall), PSome (PSome), PFix (PFix)) where + +import Plutarch.Internal (PType, Term) + +type PForall :: (a -> PType) -> PType +newtype PForall (b :: a -> PType) s = PForall (forall (x :: a). Term s (b x)) + +type PSome :: (a -> PType) -> PType +data PSome (b :: a -> PType) s = forall (x :: a). PSome (Term s (b x)) + +type PFix :: (PType -> PType) -> PType +newtype PFix f s = PFix (Term s (f (PFix f))) diff --git a/Plutarch/Internal/ScottEncoding.hs b/Plutarch/Internal/ScottEncoding.hs new file mode 100644 index 000000000..59df0fe98 --- /dev/null +++ b/Plutarch/Internal/ScottEncoding.hs @@ -0,0 +1,157 @@ +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} + +module Plutarch.Internal.ScottEncoding (PlutusTypeScott, PScottEncoded (PScottEncoded)) where + +import Data.Proxy (Proxy (Proxy)) +import Generics.SOP ( + All, + NP (Nil, (:*)), + NS (S, Z), + SListI, + SOP (SOP), + case_SList, + cpara_SList, + para_SList, + ) +import Plutarch.Internal (PDelayed, PType, Term, pdelay, pforce, plam', plet, (:-->)) +import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom, gpto) +import Plutarch.Internal.PLam ((#)) +import Plutarch.Internal.PlutusType ( + DerivedPInner, + PInner, + PlutusType, + PlutusTypeStrat, + PlutusTypeStratConstraint, + derivedPCon, + derivedPMatch, + pcon, + pcon', + pmatch, + pmatch', + ) +import Plutarch.Internal.Quantification (PForall (PForall)) + +data PlutusTypeScott + +type ScottFn' :: [PType] -> PType -> PType +type family ScottFn' xs r where + ScottFn' '[] r = r + ScottFn' (x ': xs) r = x :--> ScottFn' xs r + +type ScottFn :: [PType] -> PType -> PType +type family ScottFn xs r where + ScottFn '[] r = PDelayed r + ScottFn xs r = ScottFn' xs r + +-- scottList l r = map (flip scottFn r) l +type ScottList :: [[PType]] -> PType -> [PType] +type family ScottList code r where + ScottList '[] _ = '[] + ScottList (xs ': xss) r = ScottFn xs r ': ScottList xss r + +newtype PScottEncoded a r s = PScottEncoded (Term s (ScottFn (ScottList a r) r)) + +instance PlutusType (PScottEncoded a r) where + type PInner (PScottEncoded a r) = ScottFn (ScottList a r) r + pcon' (PScottEncoded x) = x + pmatch' x f = f (PScottEncoded x) + +newtype PLamL' s b as = PLamL' {unPLamL' :: (NP (Term s) as -> Term s b) -> Term s (ScottFn' as b)} + +-- Explicitly variadic `plam`. +plamL' :: SListI as => (NP (Term s) as -> Term s b) -> Term s (ScottFn' as b) +plamL' = unPLamL' $ para_SList (PLamL' \f -> f Nil) (\(PLamL' prev) -> PLamL' \f -> plam' \a -> prev \as -> f (a :* as)) + +newtype PLamL s b as = PLamL {unPLamL :: (NP (Term s) as -> Term s b) -> Term s (ScottFn as b)} + +-- `pdelay`s the 0-arity case. +plamL :: SListI as => (NP (Term s) as -> Term s b) -> Term s (ScottFn as b) +plamL = unPLamL $ case_SList (PLamL \f -> pdelay $ f Nil) (PLamL plamL') + +newtype PAppL' s r as = PAppL' {unPAppL' :: Term s (ScottFn' as r) -> NP (Term s) as -> Term s r} + +pappL' :: SListI as => Term s (ScottFn' as c) -> NP (Term s) as -> Term s c +pappL' = unPAppL' $ para_SList (PAppL' \f Nil -> f) (\(PAppL' prev) -> PAppL' \f (x :* xs) -> prev (f # x) xs) + +newtype PAppL s r as = PAppL {unPAppL :: Term s (ScottFn as r) -> NP (Term s) as -> Term s r} + +pappL :: SListI as => Term s (ScottFn as r) -> NP (Term s) as -> Term s r +pappL = unPAppL $ case_SList (PAppL \f Nil -> pforce f) (PAppL pappL') + +newtype PLetL s r as = PLetL {unPLetL :: NP (Term s) as -> (NP (Term s) as -> Term s r) -> Term s r} + +pletL' :: SListI as => NP (Term s) as -> (NP (Term s) as -> Term s r) -> Term s r +pletL' = unPLetL $ para_SList + (PLetL \Nil f -> f Nil) + \(PLetL prev) -> PLetL \(x :* xs) f -> plet x \x' -> + prev xs (\xs' -> f (x' :* xs')) + +pletL :: All SListI as => SOP (Term s) as -> (SOP (Term s) as -> Term s r) -> Term s r +pletL (SOP (Z x)) f = pletL' x \x' -> f (SOP $ Z x') +pletL (SOP (S xs)) f = pletL (SOP xs) \(SOP xs') -> f (SOP $ S xs') + +newtype GPCon' s r as = GPCon' {unGPCon' :: NP (Term s) (ScottList as r) -> NS (NP (Term s)) as -> Term s r} + +{- | + `gpcon'`, given a *partial* scott encoding (as a `PLamL`) and a sum choice, applies + that encoding to the sum choice. + + The partial encoding is any tail of the full scott encoded function, such that + one of its elements corresponds to the sum choice. +-} +gpcon' :: All SListI as => NP (Term s) (ScottList as r) -> NS (NP (Term s)) as -> Term s r +gpcon' = unGPCon' $ cpara_SList (Proxy @SListI) (GPCon' \Nil -> \case {}) \(GPCon' prev) -> GPCon' \(arg :* args) -> \case + Z x -> pappL arg x + S xs -> prev args xs + +-- | Generic version of `pcon'` +gpcon :: + forall as r s. + (SListI (ScottList as r), All SListI as) => + SOP (Term s) as -> + Term s (PScottEncoded as r) +gpcon fields' = + pletL fields' \(SOP fields) -> + pcon $ PScottEncoded $ plamL \args -> (gpcon' args fields :: Term s r) + +newtype GPMatch' s r as = GPMatch' {unGPMatch' :: (SOP (Term s) as -> Term s r) -> NP (Term s) (ScottList as r)} + +gpmatch' :: + forall as r s. + All SListI as => + (SOP (Term s) as -> Term s r) -> + NP (Term s) (ScottList as r) +gpmatch' = unGPMatch' $ cpara_SList (Proxy @SListI) (GPMatch' \_ -> Nil) \(GPMatch' prev) -> GPMatch' \f -> + plamL (\args -> f (SOP $ Z args)) :* prev (\(SOP x) -> f (SOP (S x))) + +gpmatch :: + forall as r s. + (SListI (ScottList as r), All SListI as) => + Term s (PScottEncoded as r) -> + (SOP (Term s) as -> Term s r) -> + Term s r +gpmatch x' f = pmatch x' \(PScottEncoded x) -> pappL x (gpmatch' f) + +class SListI (ScottList (PCode a) r) => SListIScottList a r +instance SListI (ScottList (PCode a) r) => SListIScottList a r + +class + ( forall r. SListIScottList a r + , All SListI (PCode a) + , PGeneric a + ) => + PlutusTypeScottConstraint a +instance + ( forall r. SListIScottList a r + , All SListI (PCode a) + , PGeneric a + ) => + PlutusTypeScottConstraint a + +instance PlutusTypeStrat PlutusTypeScott where + type PlutusTypeStratConstraint PlutusTypeScott = PlutusTypeScottConstraint + type DerivedPInner PlutusTypeScott a = PForall (PScottEncoded (PCode a)) + derivedPCon x = pcon $ PForall $ gpcon $ gpfrom x + derivedPMatch x' f = pmatch x' \(PForall x) -> gpmatch x (f . gpto) diff --git a/Plutarch/Internal/TypeFamily.hs b/Plutarch/Internal/TypeFamily.hs index a020b48fa..4d107f5de 100644 --- a/Plutarch/Internal/TypeFamily.hs +++ b/Plutarch/Internal/TypeFamily.hs @@ -1,6 +1,9 @@ +{-# LANGUAGE UndecidableInstances #-} + module Plutarch.Internal.TypeFamily (ToPType, ToPType2, UnTerm, Snd) where import Data.Kind (Type) +import GHC.TypeLits (ErrorMessage (Text), TypeError) import Plutarch.Internal (PType, Term) -- | Convert a list of `Term s a` to a list of `a`. @@ -16,7 +19,8 @@ type family ToPType2 as where type UnTerm :: Type -> PType type family UnTerm x where - UnTerm (Term s a) = a + UnTerm (Term _ a) = a + UnTerm _ = TypeError ( 'Text "Non-term in Plutarch data type not allowed") type family Snd ab where - Snd '(a, b) = b + Snd '(_, b) = b diff --git a/Plutarch/Internal/Witness.hs b/Plutarch/Internal/Witness.hs new file mode 100644 index 000000000..48d231010 --- /dev/null +++ b/Plutarch/Internal/Witness.hs @@ -0,0 +1,8 @@ +{-# OPTIONS_GHC -Wno-redundant-constraints #-} + +module Plutarch.Internal.Witness (witness) where + +import Data.Proxy (Proxy) + +witness :: c => Proxy c -> () +witness _ = () diff --git a/Plutarch/Lift.hs b/Plutarch/Lift.hs index 1c1ed815b..a747dfa30 100644 --- a/Plutarch/Lift.hs +++ b/Plutarch/Lift.hs @@ -1,5 +1,4 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE FunctionalDependencies #-} +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableSuperClasses #-} @@ -208,6 +207,7 @@ class ToBuiltin' a arep | a -> arep where class FromBuiltin' arep a | arep -> a where fromBuiltin' :: arep -> a +-- FIXME this overlappable instance is nonsense and disregards the fundep instance {-# OVERLAPPABLE #-} ToBuiltin a arep => ToBuiltin' a arep where toBuiltin' = toBuiltin diff --git a/Plutarch/List.hs b/Plutarch/List.hs index 2e7ca20c6..373ecead5 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -50,13 +50,15 @@ module Plutarch.List ( import Numeric.Natural (Natural) -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +import GHC.Generics (Generic) import Plutarch ( ClosedTerm, + DPTStrat, + DerivePlutusType, PDelayed, PType, PlutusType, + PlutusTypeScott, S, Term, pcon, @@ -85,8 +87,9 @@ import Plutarch.Trace (ptraceError) data PList (a :: PType) (s :: S) = PSCons (Term s a) (Term s (PList a)) | PSNil - deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving stock (Generic) + deriving anyclass (PlutusType) +instance DerivePlutusType (PList a) where type DPTStrat _ = PlutusTypeScott instance PShow a => PShow (PList a) where pshow' _ x = pshowList @PList @a # x diff --git a/Plutarch/Maybe.hs b/Plutarch/Maybe.hs index de30f94f4..e2a3cbdfd 100644 --- a/Plutarch/Maybe.hs +++ b/Plutarch/Maybe.hs @@ -3,11 +3,13 @@ module Plutarch.Maybe ( pfromJust, ) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, HasDatatypeInfo, I (I)) +import GHC.Generics (Generic) import Plutarch ( + DPTStrat, + DerivePlutusType, PType, PlutusType, + PlutusTypeScott, S, Term, perror, @@ -23,8 +25,10 @@ import Plutarch.Show (PShow) data PMaybe (a :: PType) (s :: S) = PJust (Term s a) | PNothing - deriving stock (GHC.Generic) - deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) + deriving stock (Generic) + deriving anyclass (PlutusType, PEq, PShow) + +instance DerivePlutusType (PMaybe a) where type DPTStrat _ = PlutusTypeScott {- | fallible unwrapping from @PMaybe@ diff --git a/Plutarch/Num.hs b/Plutarch/Num.hs new file mode 100644 index 000000000..ba07db8f1 --- /dev/null +++ b/Plutarch/Num.hs @@ -0,0 +1,63 @@ +{-# OPTIONS_GHC -Wno-orphans #-} + +module Plutarch.Num (PNum (..), PFractional (..)) where + +import Plutarch.Internal ( + PType, + Term, + pthrow, + punsafeCoerce, + (:-->), + ) +import Plutarch.Internal.Other (pto) +import Plutarch.Internal.PLam ((#)) +import Plutarch.Internal.PlutusType (PInner) +import Plutarch.Unsafe (punsafeDowncast) + +class PNum (a :: PType) where + (#+) :: Term s a -> Term s a -> Term s a + default (#+) :: PNum (PInner a) => Term s a -> Term s a -> Term s a + x #+ y = punsafeDowncast $ pto x #+ pto y + + (#-) :: Term s a -> Term s a -> Term s a + default (#-) :: PNum (PInner a) => Term s a -> Term s a -> Term s a + x #- y = punsafeDowncast $ pto x #- pto y + + (#*) :: Term s a -> Term s a -> Term s a + default (#*) :: PNum (PInner a) => Term s a -> Term s a -> Term s a + x #* y = punsafeDowncast $ pto x #* pto y + + pnegate :: Term s (a :--> a) + default pnegate :: PNum (PInner a) => Term s (a :--> a) + pnegate = punsafeCoerce (pnegate :: Term s (PInner a :--> PInner a)) + + pabs :: Term s (a :--> a) + default pabs :: PNum (PInner a) => Term s (a :--> a) + pabs = punsafeCoerce (pabs :: Term s (PInner a :--> PInner a)) + + psignum :: Term s (a :--> a) + default psignum :: PNum (PInner a) => Term s (a :--> a) + psignum = punsafeCoerce (psignum :: Term s (PInner a :--> PInner a)) + + pfromInteger :: Integer -> Term s a + default pfromInteger :: PNum (PInner a) => Integer -> Term s a + pfromInteger x = punsafeDowncast $ pfromInteger x + +-- orphan instance, but only visibly orphan when importing internal modules +instance PNum a => Num (Term s a) where + (+) = (#+) + (-) = (#-) + (*) = (#*) + abs x = pabs # x + negate x = pnegate # x + signum x = psignum # x + fromInteger = pfromInteger + +class PFractional (a :: PType) where + (#/) :: Term s a -> Term s a -> Term s a + precip :: Term s (a :--> a) + +instance (PNum a, PFractional a) => Fractional (Term s a) where + (/) = (#/) + recip x = precip # x + fromRational _ = pthrow "unsupported operation" diff --git a/Plutarch/Pair.hs b/Plutarch/Pair.hs index eac8508ab..c66c27f20 100644 --- a/Plutarch/Pair.hs +++ b/Plutarch/Pair.hs @@ -1,10 +1,10 @@ module Plutarch.Pair (PPair (..)) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, HasDatatypeInfo, I (I)) +import GHC.Generics (Generic) import Plutarch.Bool (PEq) import Plutarch.Internal (PType, S, Term) -import Plutarch.Internal.PlutusType (PlutusType) +import Plutarch.Internal.PlutusType (DPTStrat, DerivePlutusType, PlutusType) +import Plutarch.Internal.ScottEncoding (PlutusTypeScott) import Plutarch.Show (PShow) {- | @@ -14,5 +14,7 @@ import Plutarch.Show (PShow) -} data PPair (a :: PType) (b :: PType) (s :: S) = PPair (Term s a) (Term s b) - deriving stock (GHC.Generic) - deriving anyclass (Generic, HasDatatypeInfo, PlutusType, PEq, PShow) + deriving stock (Generic) + deriving anyclass (PlutusType, PEq, PShow) + +instance DerivePlutusType (PPair a b) where type DPTStrat _ = PlutusTypeScott diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 73a46a5df..604fcbb07 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -20,6 +20,11 @@ module Plutarch.Prelude ( S, PType, PlutusType (PInner), + DerivePlutusType, + DPTStrat, + PlutusTypeScott, + PlutusTypeNewtype, + PlutusTypeData, PCon, PMatch, pcon, @@ -117,7 +122,6 @@ module Plutarch.Prelude ( -- * DataRepr and related functions PDataRecord, PDataSum, - PIsDataRepr, PLabeledType ((:=)), pdcons, pdnil, @@ -147,9 +151,6 @@ module Plutarch.Prelude ( PConstantData, PLiftData, - -- * Typeclass derivers. - DerivePNewtype (DerivePNewtype), - -- * Continuation monad TermCont (TermCont, runTermCont), unTermCont, @@ -158,11 +159,13 @@ module Plutarch.Prelude ( ptryFrom, PTryFrom, PSubtype, + Generic, ) where import Prelude () import Data.Kind (Type) +import GHC.Generics (Generic) import GHC.Records (getField) import Plutarch import Plutarch.Bool diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index ed6140c97..b74dffa4e 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -1,19 +1,22 @@ +{-# LANGUAGE FlexibleInstances #-} + module Plutarch.Rational ( PRational (..), preduce, pnumerator, pdenominator, - pfromInteger, + Plutarch.Rational.pfromInteger, pround, ptruncate, pproperFraction, ) where -import Data.Ratio (denominator, numerator) -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) +import GHC.Generics (Generic) import Plutarch ( - PlutusType (..), + DPTStrat, + DerivePlutusType, + PlutusType, + PlutusTypeScott, Term, pcon, pfix, @@ -40,6 +43,7 @@ import Plutarch.Builtin ( ) import Plutarch.Integer (PInteger, PIntegral (pdiv, pmod)) import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) +import Plutarch.Num (PFractional, PNum, pabs, pfromInteger, pnegate, precip, psignum, (#*), (#+), (#-), (#/)) import Plutarch.Pair (PPair (..)) import Plutarch.Show (PShow (pshow'), pshow) import Plutarch.Trace (ptraceError) @@ -47,8 +51,9 @@ import Plutarch.Unsafe (punsafeCoerce) data PRational s = PRational (Term s PInteger) (Term s PInteger) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PlutusType) + deriving stock (Generic) + deriving anyclass (PlutusType) +instance DerivePlutusType PRational where type DPTStrat _ = PlutusTypeScott instance PShow PRational where pshow' _ x = @@ -106,8 +111,8 @@ instance POrd PRational where # l' # r' -instance Num (Term s PRational) where - x' + y' = +instance PNum PRational where + x' #+ y' = phoistAcyclic ( plam $ \x y -> preduce #$ pmatch x $ @@ -118,7 +123,7 @@ instance Num (Term s PRational) where # x' # y' - x' - y' = + x' #- y' = phoistAcyclic ( plam $ \x y -> preduce @@ -130,7 +135,7 @@ instance Num (Term s PRational) where # x' # y' - x' * y' = + x' #* y' = phoistAcyclic ( plam $ \x y -> preduce @@ -142,47 +147,39 @@ instance Num (Term s PRational) where # x' # y' - negate x' = - phoistAcyclic - ( plam $ \x -> - pmatch x $ \(PRational xn xd) -> - pcon $ PRational (negate xn) xd - ) - # x' + pnegate = + phoistAcyclic $ + plam $ \x -> + pmatch x $ \(PRational xn xd) -> + pcon $ PRational (negate xn) xd - abs x' = - phoistAcyclic - ( plam $ \x -> - pmatch x $ \(PRational xn xd) -> - pcon $ PRational (abs xn) (abs xd) - ) - # x' + pabs = + phoistAcyclic $ + plam $ \x -> + pmatch x $ \(PRational xn xd) -> + pcon $ PRational (abs xn) (abs xd) - signum x'' = - phoistAcyclic - ( plam $ \x' -> plet x' $ \x -> - pif - (x #== 0) - 0 - $ pif - (x #< 0) - (-1) - 1 - ) - # x'' + psignum = + phoistAcyclic $ + plam $ \x' -> plet x' $ \x -> + pif + (x #== 0) + 0 + $ pif + (x #< 0) + (-1) + 1 - fromInteger n = pcon $ PRational (fromInteger n) 1 + pfromInteger n = pcon $ PRational (fromInteger n) 1 -instance Fractional (Term s PRational) where - recip x' = - phoistAcyclic - ( plam $ \x -> - pmatch x $ \(PRational xn xd) -> - pfailOnZero # xn # (pcon (PRational xd xn)) - ) - # x' +instance PFractional PRational where + precip = + phoistAcyclic $ + plam $ \x -> + pmatch x $ \(PRational xn xd) -> + pfailOnZero # xn # (pcon (PRational xd xn)) - x' / y' = + x' #/ y' = phoistAcyclic ( plam $ \x y -> preduce @@ -196,9 +193,6 @@ instance Fractional (Term s PRational) where # x' # y' - fromRational r = - pcon $ PRational (fromInteger $ numerator r) (fromInteger $ denominator r) - pfailOnZero :: Term s (PInteger :--> a :--> a) pfailOnZero = phoistAcyclic $ plam $ \n x -> @@ -279,4 +273,4 @@ pproperFraction :: Term s (PRational :--> PPair PInteger PRational) pproperFraction = phoistAcyclic $ plam $ \x -> plet (ptruncate # x) $ \q -> - pcon $ PPair q (x - pfromInteger # q) + pcon $ PPair q (x - Plutarch.Rational.pfromInteger # q) diff --git a/Plutarch/Reducible.hs b/Plutarch/Reducible.hs index 70f28dd7c..ce5c54e7a 100644 --- a/Plutarch/Reducible.hs +++ b/Plutarch/Reducible.hs @@ -1,17 +1,37 @@ +{-# LANGUAGE UndecidableInstances #-} + -- FIXME: This should be its own package as it's not related to Plutarch at all. -module Plutarch.Reducible (Reducible (Reduce)) where +module Plutarch.Reducible (Reduce, NoReduce (..), reduce) where + +import Data.Coerce (Coercible, coerce) +import Data.Kind (Type) +import GHC.Generics (C1, D1, Rec0, Rep, S1, pattern MetaData) +import Plutarch.Internal (Term) -import Data.Coerce (Coercible) -import Data.Functor.Const (Const (Const)) -import Data.Functor.Identity (Identity (Identity)) +newtype NoReduce a = NoReduce a -class (Coercible (Reduce x) x) => Reducible (x :: k) where - type Reduce x :: k +type family GReduce (def :: Type) (rep :: Type -> Type) :: Type where +-- newtype + GReduce _ (D1 ( 'MetaData _ _ _ 'True) (C1 _ (S1 _ (Rec0 (x :: Type))))) = Reduce x +-- data + GReduce def _ = def -instance Reducible () where type Reduce () = () +{- | This class provides a work-around for partially applying + type families of kind @a@, where @a@ is either 'Type' or + @b -> c@ where @c@ satisfies the same constraint. -instance Reducible a => Reducible (Const a b) where - type Reduce (Const a b) = Reduce a + Given a type family @F : A -> Type@, you can make the following + @ + type F' :: A -> Type + newtype F' (a :: A) = F' (NoReduce (F a)) deriving stock Generic + @ + It is then true that @forall a. Reduce (F' a) ~ F a@. +-} +type family Reduce (x :: Type) :: Type where + Reduce (NoReduce a) = a + Reduce (Term s a) = Term s a -- FIXME remove + Reduce (a -> b) = a -> b + Reduce x = GReduce x (Rep x) -instance Reducible a => Reducible (Identity a) where - type Reduce (Identity a) = Reduce a +reduce :: Coercible a (Reduce a) => a -> Reduce a +reduce = coerce diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs index 98b3cb7c5..b95da7297 100644 --- a/Plutarch/Show.hs +++ b/Plutarch/Show.hs @@ -1,6 +1,3 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} -{-# LANGUAGE DefaultSignatures #-} - module Plutarch.Show ( PShow (pshow'), pshow, @@ -16,7 +13,6 @@ import Generics.SOP ( All, All2, ConstructorName, - HasDatatypeInfo, K (K), NP, NS, @@ -24,12 +20,12 @@ import Generics.SOP ( SOP (SOP), constructorInfo, constructorName, - datatypeInfo, hcmap, hcollapse, hindex, hmap, ) +import Generics.SOP.GGP (gdatatypeInfo) import Plutarch.Bool (PBool, PEq ((#==)), POrd ((#<)), pif) import Plutarch.ByteString (PByteString, pconsBS, pindexBS, plengthBS, psliceBS) import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) @@ -38,14 +34,11 @@ import Plutarch.Internal ( perror, phoistAcyclic, plet, - punsafeAsClosedTerm, (:-->), ) import Plutarch.Internal.Generic (PCode, PGeneric, gpfrom) import Plutarch.Internal.Other ( - DerivePNewtype, pfix, - pto, ) import Plutarch.Internal.PLam (plam, (#), (#$)) import Plutarch.Internal.PlutusType (PlutusType, pmatch) @@ -58,7 +51,7 @@ class PShow t where -- If the wrap argument is True, optionally wrap the output in `(..)` if it -- represents multiple parameters. pshow' :: Bool -> Term s t -> Term s PString - default pshow' :: (PGeneric s t, PlutusType t, HasDatatypeInfo (t s), All2 PShow (PCode s t)) => Bool -> Term s t -> Term s PString + default pshow' :: (PGeneric t, PlutusType t, All2 PShow (PCode t)) => Bool -> Term s t -> Term s PString pshow' wrap x = gpshow wrap # x -- | Return the string representation of a Plutarch value @@ -82,8 +75,8 @@ instance PShow PString where -- Non-ascii byte sequence will not use bytes < 128. -- So we are safe to rewrite the lower byte values. -- https://en.wikipedia.org/wiki/UTF-8#Encoding - let doubleQuote = 34 :: Term _ PInteger -- `"` - escapeSlash = 92 :: Term _ PInteger -- `\` + let doubleQuote :: Term _ PInteger = 34 -- `"` + escapeSlash :: Term _ PInteger = 92 -- `\` rec = pconsBS # x #$ self # xs in pif (x #== doubleQuote) @@ -93,6 +86,7 @@ instance PShow PString where instance PShow PBool where pshow' _ x = pshowBool # x where + pshowBool :: Term s (PBool :--> PString) pshowBool = phoistAcyclic $ plam $ \x -> -- Delegate to Haskell's Show instance @@ -101,6 +95,7 @@ instance PShow PBool where instance PShow PInteger where pshow' _ x = pshowInt # x where + pshowInt :: Term s (PInteger :--> PString) pshowInt = phoistAcyclic $ pfix #$ plam $ \self n -> let sign = pif (n #< 0) "-" "" @@ -124,9 +119,11 @@ instance PShow PInteger where instance PShow PByteString where pshow' _ x = showByteString # x where + showByteString :: Term s (PByteString :--> PString) showByteString = phoistAcyclic $ plam $ \bs -> "0x" <> showByteString' # bs + showByteString' :: Term s (PByteString :--> PString) showByteString' = phoistAcyclic $ pfix #$ plam $ \self bs -> pelimBS # bs @@ -148,9 +145,6 @@ instance PShow PByteString where , pconstant @PString $ T.pack $ intToDigit x : [] ) -instance PShow b => PShow (DerivePNewtype a b) where - pshow' w x = pshow' w (pto x) - -- | Case matching on bytestring, as if a list. pelimBS :: Term @@ -176,29 +170,29 @@ pcase otherwise x = \case -- | Generic version of `pshow` gpshow :: forall a s. - (PGeneric s a, HasDatatypeInfo (a s), PlutusType a, All2 PShow (PCode s a)) => + (PGeneric a, PlutusType a, All2 PShow (PCode a)) => Bool -> Term s (a :--> PString) gpshow wrap = - phoistAcyclic $ - punsafeAsClosedTerm @s $ - plam $ \x -> - pmatch x $ \x' -> - productGroup wrap " " $ gpshow' @a (gpfrom x') + let constructorNames :: [ConstructorName] = + hcollapse $ hmap (K . constructorName) $ constructorInfo $ gdatatypeInfo (Proxy @(a s)) + in phoistAcyclic $ + plam $ \x -> + pmatch x $ \x' -> + productGroup wrap " " $ gpshow' constructorNames (gpfrom x') -- | Like `gpshow`, but returns the individual parameters list gpshow' :: forall a s. - (PGeneric s a, HasDatatypeInfo (a s), All2 PShow (PCode s a)) => - SOP (Term s) (PCode s a) -> + All2 PShow a => + [ConstructorName] -> + SOP (Term s) a -> NonEmpty (Term s PString) -gpshow' (SOP x) = +gpshow' constructorNames (SOP x) = let cName = constructorNames !! hindex x in pconstant @PString (T.pack cName) :| showSum x where - constructorNames :: [ConstructorName] = - hcollapse $ hmap (K . constructorName) $ constructorInfo $ datatypeInfo (Proxy @(a s)) - showSum :: NS (NP (Term s)) (PCode s a) -> [Term s PString] + showSum :: NS (NP (Term s)) a -> [Term s PString] showSum = hcollapse . hcmap (Proxy @(All PShow)) showProd showProd :: All PShow xs => NP (Term s) xs -> K [Term s PString] xs diff --git a/Plutarch/String.hs b/Plutarch/String.hs index cf3459fa5..19056f290 100644 --- a/Plutarch/String.hs +++ b/Plutarch/String.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 96be385fb..4fc2c5b38 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -1,4 +1,6 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Plutarch.TryFrom ( PTryFrom (..), @@ -7,32 +9,16 @@ module Plutarch.TryFrom ( pupcast, pupcastF, pdowncastF, - POp (..), - POpArrow (..), ) where -import Data.Coerce (Coercible) import Data.Kind (Constraint) -import Data.Proxy (Proxy) +import Data.Proxy (Proxy (Proxy)) -import Plutarch.Internal (PType, Term, punsafeCoerce, (:-->)) -import Plutarch.Internal.Other ( - DerivePNewtype, - POpaque, - ) -import Plutarch.Internal.PlutusType (PInner) +import Plutarch.Internal (PType, Term, punsafeCoerce) +import Plutarch.Internal.PlutusType (PContravariant, PCovariant, PInner) +import Plutarch.Internal.Witness (witness) -import Plutarch.Reducible (Reducible (Reduce)) - -class PSubtypeDecl (a :: PType) (b :: PType) - --- Not `OVERLAPPABLE` or `OVERLAPPING` on purpose -instance {-# OVERLAPS #-} PSubtypeDecl a a - --- FIXME: Relax subtyping constraint to a @c@ rather than all @c@. --- This is currently not really possible because a type must have --- exactly one super type and no more. -instance {-# OVERLAPS #-} (PSubtypeDecl a b, PInner c POpaque ~ b) => PSubtypeDecl a c +import Plutarch.Reducible (Reduce) {- | @PSubtype a b@ constitutes a subtyping relation between @a@ and @b@. This concretely means that `\(x :: Term s b) -> punsafeCoerce x :: Term s a` @@ -46,8 +32,9 @@ instance {-# OVERLAPS #-} (PSubtypeDecl a b, PInner c POpaque ~ b) => PSubtypeDe Subtyping is transitive. -} -type PSubtype :: PType -> PType -> Constraint -type PSubtype = PSubtypeDecl +type family PSubtype (a :: PType) (b :: PType) :: Constraint where + PSubtype a a = () + PSubtype a b = PSubtype a (PInner b) {- | @PTryFrom a b@ represents a subtyping relationship between @a@ and @b@, @@ -57,40 +44,25 @@ Laws: -} class PSubtype a b => PTryFrom (a :: PType) (b :: PType) where type PTryFromExcess a b :: PType + type PTryFromExcess a b = PTryFromExcess a (PInner b) ptryFrom' :: forall s r. Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r + default ptryFrom' :: forall s r. (PTryFrom a (PInner b), PTryFromExcess a b ~ PTryFromExcess a (PInner b)) => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r + ptryFrom' opq f = ptryFrom @(PInner b) @a opq \(inn, exc) -> f (punsafeCoerce inn, exc) ptryFrom :: forall b a s r. PTryFrom a b => Term s a -> ((Term s b, Reduce (PTryFromExcess a b s)) -> Term s r) -> Term s r ptryFrom = ptryFrom' -instance - ( PTryFrom a b - , (forall s. Coercible (c s) (Term s b)) - ) => - PTryFrom a (DerivePNewtype c b) - where - type PTryFromExcess a (DerivePNewtype c b) = PTryFromExcess a b - ptryFrom' opq f = ptryFrom @b @a opq $ \(inn, exc) -> f (punsafeCoerce inn, exc) - -pupcast :: PSubtype a b => Term s b -> Term s a -pupcast = punsafeCoerce - --- FIXME: Add safe way of deriving using `PlutusType` -class PUnsafeContravariantDecl (a :: PType -> PType) -type PContravariant = PUnsafeContravariantDecl - --- FIXME: Add safe way of deriving using `PlutusType` -class PUnsafeCovariantDecl (a :: PType -> PType) -type PCovariant = PUnsafeCovariantDecl -- Really just PFunctor - -newtype POpArrow b a s = POpArrow (Term s a -> Term s b) -newtype POp b a s = POp ((a :--> b) s) - -instance PUnsafeContravariantDecl (POpArrow b) -instance PUnsafeContravariantDecl (POp b) -instance PUnsafeCovariantDecl ((:-->) a) +pupcast :: forall a b s. PSubtype a b => Term s b -> Term s a +pupcast = let _ = witness (Proxy @(PSubtype a b)) in punsafeCoerce pupcastF :: forall a b (p :: PType -> PType) s. (PSubtype a b, PCovariant p) => Proxy p -> Term s (p b) -> Term s (p a) -pupcastF _ = punsafeCoerce +pupcastF _ = + let _ = witness (Proxy @(PSubtype a b)) + _ = witness (Proxy @(PCovariant p)) + in punsafeCoerce pdowncastF :: forall a b (p :: PType -> PType) s. (PSubtype a b, PContravariant p) => Proxy p -> Term s (p a) -> Term s (p b) -pdowncastF _ = punsafeCoerce +pdowncastF _ = + let _ = witness (Proxy @(PSubtype a b)) + _ = witness (Proxy @(PContravariant p)) + in punsafeCoerce diff --git a/Plutarch/Unit.hs b/Plutarch/Unit.hs index 82d720bc0..b240c2de9 100644 --- a/Plutarch/Unit.hs +++ b/Plutarch/Unit.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -21,7 +22,7 @@ instance PUnsafeLiftDecl PUnit where type PLifted PUnit = () deriving via (DerivePConstantDirect () PUnit) instance PConstantDecl () instance PlutusType PUnit where - type PInner PUnit _ = PUnit + type PInner PUnit = PUnit pcon' PUnit = pconstant () pmatch' _ f = f PUnit diff --git a/Plutarch/Unsafe.hs b/Plutarch/Unsafe.hs index a0ccdc140..487527958 100644 --- a/Plutarch/Unsafe.hs +++ b/Plutarch/Unsafe.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE AllowAmbiguousTypes #-} - module Plutarch.Unsafe ( PI.punsafeBuiltin, PI.punsafeCoerce, @@ -9,12 +7,11 @@ module Plutarch.Unsafe ( import Plutarch.Internal (Term) import qualified Plutarch.Internal as PI -import Plutarch.Internal.Other (POpaque) import Plutarch.Internal.PlutusType (PInner) {- | Unsafely coerce from the 'PInner' representation of a Term, assuming that the value is a safe construction of the Term. -} -punsafeDowncast :: PInner b POpaque ~ a => Term s a -> Term s b +punsafeDowncast :: Term s (PInner a) -> Term s a punsafeDowncast x = PI.punsafeCoerce x diff --git a/plutarch.cabal b/plutarch.cabal index cc3ad37d7..768cb3468 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -5,11 +5,6 @@ author: Las Safin license: MIT extra-source-files: README.md -flag development - description: Enable tracing functions within plutarch. - manual: True - default: False - common c default-language: Haskell2010 default-extensions: @@ -21,6 +16,7 @@ common c ConstraintKinds DataKinds DefaultSignatures + DefaultSignatures DeriveAnyClass DeriveDataTypeable DeriveFoldable @@ -30,14 +26,12 @@ common c DeriveTraversable DerivingStrategies DerivingVia - DoAndIfThenElse EmptyCase EmptyDataDecls EmptyDataDeriving ExistentialQuantification ExplicitForAll FlexibleContexts - FlexibleInstances ForeignFunctionInterface FunctionalDependencies GADTSyntax @@ -74,11 +68,13 @@ common c ViewPatterns ghc-options: - -Wall -Wcompat -Wincomplete-uni-patterns -Wno-unused-do-bind - -Wno-partial-type-signatures -Wmissing-export-lists -Werror - -Wincomplete-record-updates -Wmissing-deriving-strategies - -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls - -fprint-explicit-kinds + -Weverything -Wno-unused-do-bind -Wno-missing-kind-signatures + -Wno-partial-type-signatures -Werror -Wno-implicit-prelude + -Wno-name-shadowing -Wno-unsafe -Wno-missing-safe-haskell-mode + -Wno-missing-local-signatures -Wno-prepositive-qualified-module + -Wno-missing-import-lists -fprint-explicit-foralls + -fprint-equality-relations -fprint-explicit-kinds + -fprint-explicit-coercions library import: c @@ -114,14 +110,19 @@ library Plutarch.Integer Plutarch.Internal Plutarch.Internal.Generic + Plutarch.Internal.Newtype Plutarch.Internal.Other Plutarch.Internal.PLam Plutarch.Internal.PlutusType + Plutarch.Internal.Quantification + Plutarch.Internal.ScottEncoding Plutarch.Internal.TypeFamily + Plutarch.Internal.Witness Plutarch.Lift Plutarch.List Plutarch.Maybe Plutarch.Monadic + Plutarch.Num Plutarch.Pair Plutarch.Prelude Plutarch.Rational @@ -137,7 +138,6 @@ library build-depends: , base , bytestring - , constraints , containers , cryptonite , flat @@ -149,12 +149,7 @@ library , plutus-core , plutus-ledger-api , plutus-tx - , rank2classes , serialise , sop-core - , template-haskell , text , transformers - - if flag(development) - cpp-options: -DDevelopment From 1142a273d201a7f8de19759c4026a56dda1707b3 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 22 Jun 2022 01:38:26 +0000 Subject: [PATCH 509/584] Fix nix --- flake.lock | 7 ++++--- flake.nix | 14 +++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 86eba7375..e61a22d5b 100644 --- a/flake.lock +++ b/flake.lock @@ -449,15 +449,16 @@ ] }, "locked": { - "lastModified": 1653405678, - "narHash": "sha256-fPpPxuCZDF5b/iQgmUg2jspPObsK0mpcchUti/LR8D0=", + "lastModified": 1655143375, + "narHash": "sha256-yU+HPLwGPf5IeLj9IBQ1zrPBTYEwvYbuMnADs4T8RLQ=", "owner": "mlabs-haskell", "repo": "haskell-nix-extra-hackage", - "rev": "cf4613eb0d883a8c12c86d7cdbdaaf15fdc70128", + "rev": "03ee7afdc1ad982e059e3941db80f7a5b30a2757", "type": "github" }, "original": { "owner": "mlabs-haskell", + "ref": "separate-hackages", "repo": "haskell-nix-extra-hackage", "type": "github" } diff --git a/flake.nix b/flake.nix index 642a5956d..85237aad2 100644 --- a/flake.nix +++ b/flake.nix @@ -7,7 +7,7 @@ inputs.hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; - inputs.haskell-nix-extra-hackage.url = "github:mlabs-haskell/haskell-nix-extra-hackage"; + inputs.haskell-nix-extra-hackage.url = "github:mlabs-haskell/haskell-nix-extra-hackage?ref=separate-hackages"; inputs.haskell-nix-extra-hackage.inputs.haskell-nix.follows = "haskell-nix"; inputs.haskell-nix-extra-hackage.inputs.nixpkgs.follows = "nixpkgs"; @@ -107,7 +107,7 @@ pkgs.haskell-nix.cabalProject' { modules = [{ inherit nonReinstallablePkgs; - reinstallableLibGhc = true; + reinstallableLibGhc = false; }]; inherit compiler-nix-name; src = "${inputs.haskell-language-server}"; @@ -136,7 +136,7 @@ }) ]; - myhackage = system: compiler-nix-name: haskell-nix-extra-hackage.mkHackageFor system compiler-nix-name ( + myhackages = system: compiler-nix-name: haskell-nix-extra-hackage.mkHackagesFor system compiler-nix-name ( [ "${inputs.flat}" "${inputs.protolude}" @@ -155,11 +155,11 @@ ); applyPlutarchDep = pkgs: o: - let h = myhackage pkgs.system o.compiler-nix-name; in + let h = myhackages pkgs.system o.compiler-nix-name; in o // { - modules = haskellModules ++ [ h.module ] ++ (o.modules or [ ]); - extra-hackages = [ (import h.hackageNix) ] ++ (o.extra-hackages or [ ]); - extra-hackage-tarballs = { _xNJUd_plutarch-hackage = h.hackageTarball; } // (o.extra-hackage-tarballs or { }); + modules = haskellModules ++ h.modules ++ (o.modules or [ ]); + extra-hackages = h.extra-hackages ++ (o.extra-hackages or [ ]); + extra-hackage-tarballs = h.extra-hackage-tarballs // (o.extra-hackage-tarballs or { }); cabalProjectLocal = (o.cabalProjectLocal or "") + ( '' allow-newer: From 31ffe47cec2cb4ca76b08a3a6af21f6afb4bb01f Mon Sep 17 00:00:00 2001 From: MangoIV Date: Thu, 23 Jun 2022 00:18:23 +0200 Subject: [PATCH 510/584] made things compile --- plutarch.cabal | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plutarch.cabal b/plutarch.cabal index 768cb3468..5b618fd9a 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -74,7 +74,7 @@ common c -Wno-missing-local-signatures -Wno-prepositive-qualified-module -Wno-missing-import-lists -fprint-explicit-foralls -fprint-equality-relations -fprint-explicit-kinds - -fprint-explicit-coercions + -fprint-explicit-coercions -Wno-all-missed-specializations library import: c @@ -142,7 +142,6 @@ library , cryptonite , flat , generics-sop - , hashable , lens , memory , mtl @@ -152,4 +151,3 @@ library , serialise , sop-core , text - , transformers From d120098f9fde5085014f82c98c2b5fa45e9b1750 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 27 Jun 2022 11:09:23 +0000 Subject: [PATCH 511/584] Add `PTryFrom` instance for un-dataed `PDataSum` --- Plutarch/DataRepr/Internal.hs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 27a58ee47..aeb74a4fa 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -618,15 +618,6 @@ instance class SumValidation (n :: Nat) (sum :: [[PLabeledType]]) where validateSum :: Proxy n -> Proxy sum -> Term s PInteger -> Term s (PBuiltinList PData) -> Term s POpaque -instance SumValidation 0 ys => PTryFrom PData (PAsData (PDataSum ys)) where - type PTryFromExcess PData (PAsData (PDataSum ys)) = Const () - ptryFrom' opq = runTermCont $ do - x <- tcont $ plet $ pasConstr # opq - constr <- tcont $ plet $ pfstBuiltin # x - fields <- tcont $ plet $ psndBuiltin # x - _ <- tcont $ plet $ validateSum (Proxy @0) (Proxy @ys) constr fields - pure (punsafeCoerce opq, ()) - instance forall (n :: Nat) (x :: [PLabeledType]) (xs :: [[PLabeledType]]). ( PTryFrom (PBuiltinList PData) (PDataRecord x) @@ -646,3 +637,18 @@ instance instance SumValidation n '[] where validateSum _ _ _ _ = ptraceError "reached end of sum while still not having found the constructor" + +instance SumValidation 0 ys => PTryFrom PData (PDataSum ys) where + type PTryFromExcess _ _ = Const () + ptryFrom' opq = runTermCont $ do + x <- tcont $ plet $ pasConstr # opq + constr <- tcont $ plet $ pfstBuiltin # x + fields <- tcont $ plet $ psndBuiltin # x + _ <- tcont $ plet $ validateSum (Proxy @0) (Proxy @ys) constr fields + pure (punsafeCoerce opq, ()) + +instance PTryFrom PData (PDataSum ys) => PTryFrom PData (PAsData (PDataSum ys)) where + type PTryFromExcess _ _ = Const () + ptryFrom' x = runTermCont $ do + (y, exc) <- tcont $ ptryFrom x + pure (pdata y, exc) From e9cfbc777d88023c668eeea9a7b6979938b196b3 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 27 Jun 2022 11:12:38 +0000 Subject: [PATCH 512/584] Remove mistaken use of `OVERLAPPING` --- Plutarch/DataRepr/Internal/FromData.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/DataRepr/Internal/FromData.hs b/Plutarch/DataRepr/Internal/FromData.hs index 48768b94b..cb8383520 100644 --- a/Plutarch/DataRepr/Internal/FromData.hs +++ b/Plutarch/DataRepr/Internal/FromData.hs @@ -22,8 +22,8 @@ import Plutarch.Builtin (PAsData, PIsData, pfromData) class PFromDataable (a :: PType) (b :: PType) | b -> a, a -> b where pmaybeFromAsData :: Term s (PAsData a) -> Term s b -instance {-# OVERLAPPING #-} PFromDataable a (PAsData a) where +instance {-# OVERLAPPABLE #-} PFromDataable a (PAsData a) where pmaybeFromAsData = id -instance {-# OVERLAPPING #-} (PIsData a, b ~ a) => PFromDataable a b where +instance (PIsData a, b ~ a) => PFromDataable a b where pmaybeFromAsData = pfromData From ee2798d5b0537a6211932db7a7ae4acb63a5adbe Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 27 Jun 2022 12:39:31 +0000 Subject: [PATCH 513/584] Try to fix `pfield` --- Plutarch/DataRepr/Internal/FromData.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/DataRepr/Internal/FromData.hs b/Plutarch/DataRepr/Internal/FromData.hs index cb8383520..912f26e55 100644 --- a/Plutarch/DataRepr/Internal/FromData.hs +++ b/Plutarch/DataRepr/Internal/FromData.hs @@ -25,5 +25,5 @@ class PFromDataable (a :: PType) (b :: PType) | b -> a, a -> b where instance {-# OVERLAPPABLE #-} PFromDataable a (PAsData a) where pmaybeFromAsData = id -instance (PIsData a, b ~ a) => PFromDataable a b where +instance {-# OVERLAPPABLE #-} (PIsData a, b ~ a) => PFromDataable a b where pmaybeFromAsData = pfromData From e4a02f6c25d98c15644639dda12fa629fc86bbef Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 27 Jun 2022 13:14:07 +0000 Subject: [PATCH 514/584] Fix `PTryFrom` for `PDataSum` --- Plutarch/DataRepr/Internal.hs | 24 +++++++++++++++++++----- Plutarch/TryFrom.hs | 12 ++++++++++-- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index aeb74a4fa..bf527c34e 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -123,7 +123,7 @@ import Plutarch.Lift ( import Plutarch.List (PListLike (pnil), pcons, pdrop, phead, ptail, ptryIndex) import Plutarch.TermCont (TermCont, hashOpenTerm, runTermCont, tcont, unTermCont) import Plutarch.Trace (ptraceError) -import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) +import Plutarch.TryFrom (PSubtype, PSubtype', PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) import Plutarch.Unit (PUnit (PUnit)) import Plutarch.Unsafe (punsafeCoerce) import qualified PlutusLedgerApi.V1 as Ledger @@ -564,8 +564,22 @@ newtype HRecP (as :: [(Symbol, PType)]) (s :: S) = HRecP (NoReduce (HRecGeneric newtype Flip f a b = Flip (f b a) deriving stock (Generic) +class Helper2 (b :: Bool) a where + type Helper2Excess b a :: PType + ptryFromData' :: forall s r. Proxy b -> Term s PData -> ((Term s (PAsData a), Reduce (Helper2Excess b a s)) -> Term s r) -> Term s r + +instance PTryFrom PData (PAsData a) => Helper2 'False a where + type Helper2Excess 'False a = PTryFromExcess PData (PAsData a) + ptryFromData' _ = ptryFrom' + +instance PTryFrom PData a => Helper2 'True a where + type Helper2Excess 'True a = PTryFromExcess PData a + ptryFromData' _ x = runTermCont $ do + (y, exc) <- tcont $ ptryFrom @a @PData x + pure (punsafeCoerce y, exc) + -- We could have a more advanced instance but it's not needed really. -newtype ExcessForField (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (PTryFromExcess PData (PAsData a) s)) +newtype ExcessForField (b :: Bool) (a :: PType) (s :: S) = ExcessForField (Term s (PAsData a), Reduce (Helper2Excess b a s)) deriving stock (Generic) instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where @@ -580,7 +594,7 @@ type family UnHRecP (x :: PType) :: [(Symbol, PType)] where UnHRecP (HRecP as) = as instance - ( PTryFrom PData (PAsData pty) + ( Helper2 (PSubtype' PData pty) pty , PTryFrom (PBuiltinList PData) (PDataRecord as) , PTryFromExcess (PBuiltinList PData) (PDataRecord as) ~ HRecP ase ) => @@ -589,12 +603,12 @@ instance type PTryFromExcess (PBuiltinList PData) (PDataRecord ((name ':= pty) ': as)) = HRecP - ( '(name, ExcessForField pty) + ( '(name, ExcessForField (PSubtype' PData pty) pty) ': UnHRecP (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) ) ptryFrom' opq = runTermCont $ do h <- tcont $ plet $ phead # opq - hv <- tcont $ ptryFrom @(PAsData pty) @PData h + hv <- tcont $ ptryFromData' (Proxy @(PSubtype' PData pty)) h t <- tcont $ plet $ ptail # opq tv <- tcont $ ptryFrom @(PDataRecord as) @(PBuiltinList PData) t pure (punsafeCoerce opq, HRecGeneric (HCons (Labeled hv) (coerce $ snd tv))) diff --git a/Plutarch/TryFrom.hs b/Plutarch/TryFrom.hs index 4fc2c5b38..d2ee1b87c 100644 --- a/Plutarch/TryFrom.hs +++ b/Plutarch/TryFrom.hs @@ -6,6 +6,7 @@ module Plutarch.TryFrom ( PTryFrom (..), ptryFrom, PSubtype, + PSubtype', pupcast, pupcastF, pdowncastF, @@ -20,6 +21,14 @@ import Plutarch.Internal.Witness (witness) import Plutarch.Reducible (Reduce) +type family Helper (a :: PType) (b :: PType) (bi :: PType) :: Bool where + Helper _ b b = 'False + Helper a _ bi = PSubtype' a bi + +type family PSubtype' (a :: PType) (b :: PType) :: Bool where + PSubtype' a a = 'True + PSubtype' a b = Helper a b (PInner b) + {- | @PSubtype a b@ constitutes a subtyping relation between @a@ and @b@. This concretely means that `\(x :: Term s b) -> punsafeCoerce x :: Term s a` is legal and sound. @@ -33,8 +42,7 @@ import Plutarch.Reducible (Reduce) Subtyping is transitive. -} type family PSubtype (a :: PType) (b :: PType) :: Constraint where - PSubtype a a = () - PSubtype a b = PSubtype a (PInner b) + PSubtype a b = PSubtype' a b ~ 'True {- | @PTryFrom a b@ represents a subtyping relationship between @a@ and @b@, From 1362c3292230451a8d2a28cdd9e5d586f7a94947 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 27 Jun 2022 16:31:02 +0000 Subject: [PATCH 515/584] Add `PlutusType` for `PString`, `PByteString`, and `PInteger` --- Plutarch/ByteString.hs | 10 +++++++++- Plutarch/Integer.hs | 14 +++++++++----- Plutarch/String.hs | 10 +++++++++- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Plutarch/ByteString.hs b/Plutarch/ByteString.hs index 1efa6276a..d0b369a8d 100644 --- a/Plutarch/ByteString.hs +++ b/Plutarch/ByteString.hs @@ -16,11 +16,15 @@ import Data.ByteString (ByteString) import qualified Data.ByteString as BS import Data.Char (toLower) import Data.Word (Word8) +import GHC.Generics (Generic) import GHC.Stack (HasCallStack) import Plutarch.Bool (PEq, POrd, (#<), (#<=), (#==)) import Plutarch.Integer (PInteger) import Plutarch.Internal (Term, (:-->)) +import Plutarch.Internal.Newtype (PlutusTypeNewtype) +import Plutarch.Internal.Other (POpaque) import Plutarch.Internal.PLam ((#)) +import Plutarch.Internal.PlutusType (DPTStrat, DerivePlutusType, PlutusType) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, @@ -32,7 +36,11 @@ import Plutarch.Unsafe (punsafeBuiltin) import qualified PlutusCore as PLC -- | Plutus 'BuiltinByteString' -data PByteString s +data PByteString s = PByteString (Term s POpaque) + deriving stock (Generic) + deriving anyclass (PlutusType) + +instance DerivePlutusType PByteString where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PByteString where type PLifted PByteString = ByteString deriving via (DerivePConstantDirect ByteString PByteString) instance PConstantDecl ByteString diff --git a/Plutarch/Integer.hs b/Plutarch/Integer.hs index ccd9f569a..2e3a69048 100644 --- a/Plutarch/Integer.hs +++ b/Plutarch/Integer.hs @@ -4,17 +4,17 @@ module Plutarch.Integer (PInteger, PIntegral (..)) where +import GHC.Generics (Generic) import Plutarch.Bool (PEq, POrd, pif, (#<), (#<=), (#==)) import Plutarch.Internal ( Term, phoistAcyclic, (:-->), ) -import Plutarch.Internal.Other ( - pto, - ) +import Plutarch.Internal.Newtype (PlutusTypeNewtype) +import Plutarch.Internal.Other (POpaque, pto) import Plutarch.Internal.PLam (plam, (#)) -import Plutarch.Internal.PlutusType (PInner) +import Plutarch.Internal.PlutusType (DPTStrat, DerivePlutusType, PInner, PlutusType) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, @@ -27,7 +27,11 @@ import Plutarch.Unsafe (punsafeBuiltin, punsafeDowncast) import qualified PlutusCore as PLC -- | Plutus BuiltinInteger -data PInteger s +data PInteger s = PInteger (Term s POpaque) + deriving stock (Generic) + deriving anyclass (PlutusType) + +instance DerivePlutusType PInteger where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PInteger where type PLifted PInteger = Integer deriving via (DerivePConstantDirect Integer PInteger) instance PConstantDecl Integer diff --git a/Plutarch/String.hs b/Plutarch/String.hs index 19056f290..5648fa69b 100644 --- a/Plutarch/String.hs +++ b/Plutarch/String.hs @@ -7,10 +7,14 @@ module Plutarch.String (PString, pfromText, pencodeUtf8, pdecodeUtf8) where import Data.String (IsString, fromString) import Data.Text (Text) import qualified Data.Text as Txt +import GHC.Generics (Generic) import Plutarch.Bool (PEq, (#==)) import Plutarch.ByteString (PByteString) import Plutarch.Internal (Term, (:-->)) +import Plutarch.Internal.Newtype (PlutusTypeNewtype) +import Plutarch.Internal.Other (POpaque) import Plutarch.Internal.PLam ((#)) +import Plutarch.Internal.PlutusType (DPTStrat, DerivePlutusType, PlutusType) import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), PConstantDecl, @@ -22,7 +26,11 @@ import Plutarch.Unsafe (punsafeBuiltin) import qualified PlutusCore as PLC -- | Plutus 'BuiltinString' values -data PString s +data PString s = PString (Term s POpaque) + deriving stock (Generic) + deriving anyclass (PlutusType) + +instance DerivePlutusType PString where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PString where type PLifted PString = Text deriving via (DerivePConstantDirect Text PString) instance PConstantDecl Text From 43ad01467d376dc196b41c882f88b44275ddb83f Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 27 Jun 2022 16:31:21 +0000 Subject: [PATCH 516/584] Fix `PUnit` implementation --- Plutarch/Unit.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Plutarch/Unit.hs b/Plutarch/Unit.hs index b240c2de9..bb2b7b5c6 100644 --- a/Plutarch/Unit.hs +++ b/Plutarch/Unit.hs @@ -4,7 +4,7 @@ module Plutarch.Unit (PUnit (..)) where -import Plutarch (Term, pcon) +import Plutarch (Term, pcon, plet) import Plutarch.Bool (PBool (PFalse, PTrue), PEq, POrd, (#<), (#<=), (#==)) import Plutarch.Internal.PlutusType (PInner, PlutusType, pcon', pmatch') import Plutarch.Lift ( @@ -24,20 +24,20 @@ deriving via (DerivePConstantDirect () PUnit) instance PConstantDecl () instance PlutusType PUnit where type PInner PUnit = PUnit pcon' PUnit = pconstant () - pmatch' _ f = f PUnit + pmatch' x f = plet x \_ -> f PUnit instance PEq PUnit where - _ #== _ = pcon PTrue + x #== y = plet x \_ -> plet y \_ -> pcon PTrue instance POrd PUnit where - _ #<= _ = pcon PTrue - _ #< _ = pcon PFalse + x #<= y = plet x \_ -> plet y \_ -> pcon PTrue + x #< y = plet x \_ -> plet y \_ -> pcon PFalse instance Semigroup (Term s PUnit) where - _ <> _ = pcon PUnit + x <> y = plet x \_ -> plet y \_ -> pcon PUnit instance Monoid (Term s PUnit) where mempty = pcon PUnit instance PShow PUnit where - pshow' _ _ = "()" + pshow' _ x = plet x \_ -> "()" From 63baa194a41977f702d469ff5bc875108b2a96f9 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 28 Jun 2022 11:53:25 +0000 Subject: [PATCH 517/584] Make `PInner (PAsData a)` finer This allows you to derive instances for `PAsData a` --- Plutarch/Builtin.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 530f26ea5..c64b3e253 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -108,7 +108,6 @@ import Plutarch.TryFrom ( ptryFrom, ptryFrom', pupcast, - pupcastF, ) -- | Plutus 'BuiltinPair' @@ -270,12 +269,16 @@ pdataLiteral = pconstant data PAsData (a :: PType) (s :: S) = PAsData (Term s a) +type family IfSameThenData (a :: PType) (b :: PType) :: PType where + IfSameThenData a a = PData + IfSameThenData _ b = PAsData b + instance PIsData a => PlutusType (PAsData a) where - type PInner (PAsData a) = PData + type PInner (PAsData a) = IfSameThenData a (PInner a) type PCovariant' (PAsData a) = PCovariant' a type PContravariant' (PAsData a) = PContravariant' a type PVariant' (PAsData a) = PVariant' a - pcon' (PAsData t) = pforgetData $ pdata t + pcon' (PAsData t) = punsafeCoerce $ pdata t pmatch' t f = f (PAsData $ pfromData $ punsafeCoerce t) type role PAsDataLifted nominal @@ -290,7 +293,7 @@ instance PConstantDecl (PAsDataLifted a) where instance PUnsafeLiftDecl (PAsData a) where type PLifted (PAsData a) = PAsDataLifted a pforgetData :: forall s a. Term s (PAsData a) -> Term s PData -pforgetData = pupcast +pforgetData = punsafeCoerce -- FIXME: remove, broken @@ -298,7 +301,7 @@ pforgetData = pupcast Equivalent to 'pupcastF'. -} pforgetData' :: forall a (p :: PType -> PType) s. PCovariant p => Proxy p -> Term s (p (PAsData a)) -> Term s (p PData) -pforgetData' = pupcastF +pforgetData' _ = let _ = witness (Proxy @(PCovariant p)) in punsafeCoerce -- | Inverse of 'pforgetData''. prememberData :: forall (p :: PType -> PType) s. PVariant p => Proxy p -> Term s (p PData) -> Term s (p (PAsData PData)) From c8ad2b845afeaf90b0fe4522ae39bcd621275185 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Tue, 28 Jun 2022 16:33:21 +0200 Subject: [PATCH 518/584] started tests fixing, minor changes --- Plutarch/Api/V1/Address.hs | 4 +-- Plutarch/DataRepr/Internal.hs | 14 ++++----- Plutarch/Internal.hs | 6 +++- Plutarch/Internal/PlutusType.hs | 10 ++++--- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 30 ++++++++++++------- .../plutarch-base/Plutarch/SpecTypes.hs | 15 ++++------ 6 files changed, 44 insertions(+), 35 deletions(-) diff --git a/Plutarch/Api/V1/Address.hs b/Plutarch/Api/V1/Address.hs index a90898ce2..19bb4363d 100644 --- a/Plutarch/Api/V1/Address.hs +++ b/Plutarch/Api/V1/Address.hs @@ -47,7 +47,7 @@ data PStakingCredential (s :: S) ) deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PEq, POrd) -instance DerivePlutusType (PStakingCredential) where type DPTStrat _ = PlutusTypeData +instance DerivePlutusType PStakingCredential where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PStakingCredential where type PLifted PStakingCredential = Plutus.StakingCredential deriving via (DerivePConstantViaData Plutus.StakingCredential PStakingCredential) instance PConstantDecl Plutus.StakingCredential @@ -58,7 +58,7 @@ newtype PAddress (s :: S) s ( PDataRecord '[ "credential" ':= PCredential - , "stakingCredential" ':= (PMaybeData PStakingCredential) + , "stakingCredential" ':= PMaybeData PStakingCredential ] ) ) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index aeb74a4fa..9ac9d8c50 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -226,7 +226,7 @@ data PLabeledType = Symbol := PType type family PLabelIndex (name :: Symbol) (as :: [PLabeledType]) :: Nat where PLabelIndex name ((name ':= _) ': _) = 0 - PLabelIndex name (_ ': as) = (PLabelIndex name as) + 1 + PLabelIndex name (_ ': as) = PLabelIndex name as + 1 type PLookupLabel :: Symbol -> [PLabeledType] -> PType type family PLookupLabel name as where @@ -237,7 +237,7 @@ type family PUnLabel (a :: PLabeledType) :: PType where PUnLabel (_ ':= a) = a instance PIsData (PDataRecord xs) where - pfromDataImpl x = punsafeCoerce $ (pfromData (punsafeCoerce x) :: Term _ (PBuiltinList PData)) + pfromDataImpl x = punsafeCoerce (pfromData (punsafeCoerce x) :: Term _ (PBuiltinList PData)) pdataImpl x = pupcast $ pdata (pupcast x :: Term _ (PBuiltinList PData)) {- | A sum of 'PDataRecord's. The underlying representation is the `Constr` constructor, @@ -261,7 +261,7 @@ instance IsPDataSum xs => IsPDataSum ('[PDataRecord l] : xs) where toSum (SOP (Z (x :* Nil))) = PDataSum $ Z $ coerce x toSum (SOP (S x)) = case toSum (SOP x) of PDataSum y -> PDataSum $ S y - fromSum (PDataSum (Z x)) = SOP $ Z $ (coerce x) :* Nil + fromSum (PDataSum (Z x)) = SOP $ Z $ coerce x :* Nil fromSum (PDataSum (S x)) = case fromSum (PDataSum x) of SOP y -> SOP $ S y @@ -279,7 +279,7 @@ instance type PInner (PDataSum defs) = PData pcon' (PDataSum xss) = let constrIx = fromIntegral $ hindex xss - datRec = hcollapse $ hmap (K . (\x -> pto x) . F.getCompose) xss + datRec = hcollapse $ hmap (K . pto . F.getCompose) xss in pforgetData $ pconstrBuiltin # pconstant constrIx # datRec pmatch' d f = let handlers = conv f @@ -304,7 +304,7 @@ instance conv = unA $ para_SList - (A \_ -> DRHNil) + (A $ const DRHNil) ( \(A prev) -> A \f -> DRHCons (\x -> f (PDataSum (Z $ coerce x))) @@ -376,7 +376,7 @@ instance PlutusTypeStrat PlutusTypeData where type PlutusTypeStratConstraint PlutusTypeData = PlutusTypeDataConstraint type DerivedPInner PlutusTypeData a = PDataSum (IsPDataSumDefs (PCode a)) derivedPCon x = pcon $ toSum $ gpfrom x - derivedPMatch x f = pmatch x (\y -> f $ gpto $ fromSum $ y) + derivedPMatch x f = pmatch x (f . gpto . fromSum) newtype DualReprHandler s out def = DualRepr (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s out) @@ -611,7 +611,7 @@ instance PTryFromExcess PData (PAsData (PDataRecord as)) = Helper (Flip Term (PDataRecord as)) (PTryFromExcess (PBuiltinList PData) (PDataRecord as)) ptryFrom' opq = runTermCont $ do - l <- snd <$> (tcont $ ptryFrom @(PAsData (PBuiltinList PData)) opq) + l <- snd <$> tcont (ptryFrom @(PAsData (PBuiltinList PData)) opq) r <- tcont $ ptryFrom @(PDataRecord as) l pure (punsafeCoerce opq, r) diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index e061d6981..773da7abf 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -15,6 +15,7 @@ module Plutarch.Internal ( pforce, phoistAcyclic, perror, + punsafeAsClosedTerm, punsafeCoerce, punsafeBuiltin, punsafeConstant, @@ -191,7 +192,7 @@ plam' f = Term \i -> t@(getTerm -> RApply t'@(getArity -> Just _) [RVar 0]) -> t {getTerm = t'} -- eta-reduce for arity 2 + n t@(getTerm -> RLamAbs n (RApply t'@(getArity -> Just n') args)) - | (maybe False (== [0 .. n + 1]) $ traverse (\case RVar n -> Just n; _ -> Nothing) args) + | (== Just [0 .. n + 1]) (traverse (\case RVar n -> Just n; _ -> Nothing) args) && n' >= n + 1 -> t {getTerm = t'} -- increment arity @@ -387,6 +388,9 @@ subst idx _ y@(UPLC.Var () (DeBruijn (Index idx'))) | idx > idx' = y subst idx _ (UPLC.Var () (DeBruijn (Index idx'))) | idx < idx' = UPLC.Var () (DeBruijn . Index $ idx' - 1) subst _ _ y = y +punsafeAsClosedTerm :: forall s a. Term s a -> ClosedTerm a +punsafeAsClosedTerm (Term t) = Term t + rawTermToUPLC :: (HoistedTerm -> Word64 -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> Word64 -> diff --git a/Plutarch/Internal/PlutusType.hs b/Plutarch/Internal/PlutusType.hs index e4ee2b890..30dd28311 100644 --- a/Plutarch/Internal/PlutusType.hs +++ b/Plutarch/Internal/PlutusType.hs @@ -35,12 +35,13 @@ import Plutarch.Internal.Generic (PCode) import Plutarch.Internal.PLam ((#)) import Plutarch.Internal.Quantification (PFix (PFix), PForall (PForall), PSome (PSome)) import Plutarch.Internal.Witness (witness) +import GHC.TypeLits (TypeError, ErrorMessage (ShowType, Text, (:<>:))) class PlutusTypeStrat (strategy :: Type) where type PlutusTypeStratConstraint strategy :: PType -> Constraint type DerivedPInner strategy (a :: PType) :: PType derivedPCon :: forall a s. (DerivePlutusType a, DPTStrat a ~ strategy) => a s -> Term s (DerivedPInner strategy a) - derivedPMatch :: forall a s b. (DerivePlutusType a, DPTStrat a ~ strategy) => (Term s (DerivedPInner strategy a)) -> (a s -> Term s b) -> Term s b + derivedPMatch :: forall a s b. (DerivePlutusType a, DPTStrat a ~ strategy) => Term s (DerivedPInner strategy a) -> (a s -> Term s b) -> Term s b class ( PInner a ~ DerivedPInner (DPTStrat a) a @@ -51,6 +52,7 @@ class DerivePlutusType (a :: PType) where type DPTStrat a :: Type + type DPTStrat a = TypeError ('Text "Please specify a strategy for deriving PlutusType for type " ':<>: 'ShowType a) class PlutusType (a :: PType) where type PInner a :: PType @@ -65,9 +67,9 @@ class PlutusType (a :: PType) where default pcon' :: DerivePlutusType a => forall s. a s -> Term s (PInner a) pcon' = let _ = witness (Proxy @(PlutusType a)) in derivedPCon - pmatch' :: forall s b. (Term s (PInner a)) -> (a s -> Term s b) -> Term s b + pmatch' :: forall s b. Term s (PInner a) -> (a s -> Term s b) -> Term s b -- FIXME buggy GHC, needs AllowAmbiguousTypes - default pmatch' :: DerivePlutusType a => forall s b. (Term s (PInner a)) -> (a s -> Term s b) -> Term s b + default pmatch' :: DerivePlutusType a => forall s b. Term s (PInner a) -> (a s -> Term s b) -> Term s b pmatch' = derivedPMatch {-# DEPRECATED PCon "Use PlutusType" #-} @@ -81,7 +83,7 @@ pcon x = punsafeCoerce (pcon' x) -- | Pattern match over Plutarch Terms via a Haskell datatype pmatch :: PlutusType a => Term s a -> (a s -> Term s b) -> Term s b -pmatch x f = pmatch' (punsafeCoerce x) f +pmatch x = pmatch' (punsafeCoerce x) class PCovariant' a => PCovariant'' a instance PCovariant' a => PCovariant'' a diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index ce2609ece..7f421ffe2 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -5,17 +5,18 @@ module Plutarch.PlutusTypeSpec (spec) where import Data.Functor.Compose (Compose (Compose)) import Data.SOP.NS (NS (S, Z)) -import GHC.Generics (Generic) -import qualified Generics.SOP as SOP import Plutarch.Api.V1 ( PAddress (PAddress), PCredential (PPubKeyCredential, PScriptCredential), PScriptPurpose (PCertifying, PMinting, PRewarding, PSpending), + PMaybeData, + PStakingCredential, ) import Plutarch.Builtin (pasByteStr, pasConstr) -import Plutarch.DataRepr (PDataSum (PDataSum), pasDataSum) +import Plutarch.DataRepr (PDataSum (PDataSum)) import Plutarch.Prelude import Plutarch.Test +import Plutarch.Unsafe (punsafeCoerce) import PlutusLedgerApi.V1 (DCert (DCertGenesis), toData) import PlutusLedgerApi.V1.Address (Address (Address)) import PlutusLedgerApi.V1.Contexts (ScriptPurpose (Certifying, Minting, Rewarding, Spending), TxOutRef (TxOutRef)) @@ -70,12 +71,17 @@ deconstrSpec = do ) # pconstant addrPC "datasum" - @| plam - ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + @|(plam + ( \x -> pmatch (pupcast @(PDataSum '[ '[ "credential" ':= PCredential + , "stakingCredential" ':= PMaybeData PStakingCredential + ]]) x) $ \(PDataSum datsum) -> case datsum of Z (Compose addrFields) -> addrFields _ -> perror ) - # pconstant addrPC + # (pconstant addrPC :: Term _ PAddress) :: Term _ (PDataRecord + '[ "credential" ':= PCredential + , "stakingCredential" ':= PMaybeData PStakingCredential + ])) "sumtype(ignore-fields)" @\ do "normal" @| plam @@ -86,11 +92,11 @@ deconstrSpec = do # pconstant minting "datasum" @| plam - ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + ( \x -> pmatch (pupcast x) $ \(PDataSum datsum) -> case datsum of Z _ -> pconstant () _ -> perror ) - # pconstant minting + # (pconstant minting :: Term _ PScriptPurpose) "sumtype(partial-match)" @\ do "normal" @| plam @@ -101,7 +107,7 @@ deconstrSpec = do # pconstant minting "datasum" @| plam - ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + ( \x -> pmatch (pupcast x) $ \(PDataSum datsum) -> case datsum of Z (Compose hs) -> hs _ -> perror ) @@ -289,8 +295,10 @@ describe "sanity checks" $ do -} data AB (s :: S) = A | B - deriving stock (Generic) - deriving anyclass (SOP.Generic, PlutusType) + deriving stock Generic + deriving anyclass PlutusType + +instance DerivePlutusType AB where type DPTStrat _ = PlutusTypeData {- | Instead of using `pcon'` and `pmatch'` directly, diff --git a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs index 0bb078f78..6d9b49646 100644 --- a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs +++ b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs @@ -3,14 +3,10 @@ module Plutarch.SpecTypes (Triplet (..), PTriplet (..)) where -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I)) import qualified PlutusTx import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), - PDataFields, - PIsDataReprInstances (PIsDataReprInstances), ) import Plutarch.Lift ( PConstantDecl (PConstanted), @@ -39,13 +35,12 @@ newtype PTriplet (a :: PType) (s :: S) ] ) ) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData, PDataFields, PEq, POrd) - via (PIsDataReprInstances (PTriplet a)) + deriving stock Generic + deriving anyclass (PlutusType) -PlutusTx.makeIsDataIndexed ''Triplet ([('Triplet, 0)]) +instance DerivePlutusType (PTriplet a) where type DPTStrat _ = PlutusTypeData + +PlutusTx.makeIsDataIndexed ''Triplet [('Triplet, 0)] instance PLiftData a => PUnsafeLiftDecl (PTriplet a) where type PLifted (PTriplet a) = Triplet (PLifted a) From f9ced912ac8cc65b96a7c6ad02a4eab1e26948a7 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Tue, 28 Jun 2022 19:07:25 +0200 Subject: [PATCH 519/584] tests compile --- Plutarch/Builtin.hs | 34 ++++++++------ Plutarch/Internal/PlutusType.hs | 4 +- .../conditional/Plutarch/TryFromSpec.hs | 47 +++++++------------ .../plutarch-base/Plutarch/PIsDataSpec.hs | 32 ++++++------- .../plutarch-base/Plutarch/POrdSpec.hs | 28 ++++++----- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 43 ++++++++--------- .../plutarch-base/Plutarch/SpecTypes.hs | 5 +- 7 files changed, 89 insertions(+), 104 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index c64b3e253..a6e4986b6 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -319,7 +319,7 @@ prememberData' Proxy = let _ = witness (Proxy @(PSubtype PData a, PVariant p)) i class PIsData a where pfromDataImpl :: Term s (PAsData a) -> Term s a default pfromDataImpl :: PIsData (PInner a) => Term s (PAsData a) -> Term s a - pfromDataImpl x = punsafeDowncast $ pfromDataImpl $ (punsafeCoerce x :: Term _ (PAsData (PInner a))) + pfromDataImpl x = punsafeDowncast $ pfromDataImpl (punsafeCoerce x :: Term _ (PAsData (PInner a))) pdataImpl :: Term s a -> Term s PData default pdataImpl :: PIsData (PInner a) => Term s a -> Term s PData @@ -344,10 +344,10 @@ newtype Helper2 f a s = Helper2 (Term s (PAsData (f a))) instance DerivePlutusType (Helper2 f a) where type DPTStrat _ = PlutusTypeNewtype instance PIsData (PBuiltinList PData) where - pfromDataImpl = pforgetData' @PData (Proxy @PBuiltinList) . pfromData . pto . (prememberData (Proxy @(Helper2 PBuiltinList))) . pcon . Helper2 + pfromDataImpl = pforgetData' @PData (Proxy @PBuiltinList) . pfromData . pto . prememberData (Proxy @(Helper2 PBuiltinList)) . pcon . Helper2 -- pdataImpl = coerce (pforgetData' @PData (Proxy @(Helper2 PBuiltinList))) . pdata . (prememberData (Proxy @PBuiltinList)) - pdataImpl = punsafeCoerce . pdata . (prememberData (Proxy @PBuiltinList)) -- FIXME + pdataImpl = punsafeCoerce . pdata . prememberData (Proxy @PBuiltinList) -- FIXME instance PIsData (PBuiltinMap k v) where pfromDataImpl x = punsafeCoerce $ pasMap # pforgetData x @@ -368,13 +368,13 @@ instance PIsData PByteString where -} instance PIsData PBool where pfromDataImpl x = - (phoistAcyclic $ plam toBool) # pforgetData x + phoistAcyclic (plam toBool) # pforgetData x where toBool :: Term s PData -> Term s PBool toBool d = pfstBuiltin # (pasConstr # d) #== 1 pdataImpl x = - (phoistAcyclic $ plam toData) # x + phoistAcyclic (plam toData) # x where toData :: Term s PBool -> Term s PData toData b = @@ -413,17 +413,17 @@ instance PIsData (PBuiltinPair PData PData) where pfromDataImpl = f . pfromData . g where g :: Term s (PAsData (PBuiltinPair PData PData)) -> Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData))) - g x = pto $ (prememberData (Proxy @(Helper3 PBuiltinPair (PAsData PData)))) $ pcon $ Helper3 $ pto $ (prememberData (Proxy @(Helper2 (PBuiltinPair PData)))) $ pcon $ Helper2 x + g x = pto $ prememberData (Proxy @(Helper3 PBuiltinPair (PAsData PData))) $ pcon $ Helper3 $ pto $ prememberData (Proxy @(Helper2 (PBuiltinPair PData))) $ pcon $ Helper2 x f :: Term s (PBuiltinPair (PAsData PData) (PAsData PData)) -> Term s (PBuiltinPair PData PData) - f x = pto $ (pforgetData' (Proxy @(Helper4 PBuiltinPair PData))) $ pcon $ Helper4 $ (pforgetData' @PData (Proxy @(PBuiltinPair (PAsData PData)))) x + f x = pto $ pforgetData' (Proxy @(Helper4 PBuiltinPair PData)) $ pcon $ Helper4 $ pforgetData' @PData (Proxy @(PBuiltinPair (PAsData PData))) x pdataImpl = pupcast . f . pdata . g where g :: Term s (PBuiltinPair PData PData) -> Term s (PBuiltinPair (PAsData PData) (PAsData PData)) - g x = pto $ (prememberData (Proxy @(Helper4 PBuiltinPair (PAsData PData)))) $ pcon $ Helper4 $ prememberData (Proxy @(PBuiltinPair PData)) x + g x = pto $ prememberData (Proxy @(Helper4 PBuiltinPair (PAsData PData))) $ pcon $ Helper4 $ prememberData (Proxy @(PBuiltinPair PData)) x f :: Term s (PAsData (PBuiltinPair (PAsData PData) (PAsData PData))) -> Term s (PAsData (PBuiltinPair PData PData)) - f x = pto $ (pforgetData' @PData (Proxy @(Helper3 PBuiltinPair PData))) $ pcon $ Helper3 $ pto $ pforgetData' @PData (Proxy @(Helper2 (PBuiltinPair (PAsData PData)))) $ pcon $ Helper2 x + f x = pto $ pforgetData' @PData (Proxy @(Helper3 PBuiltinPair PData)) $ pcon $ Helper3 $ pto $ pforgetData' @PData (Proxy @(Helper2 (PBuiltinPair (PAsData PData)))) $ pcon $ Helper2 x instance (PShow a, PShow b) => PShow (PBuiltinPair a b) where pshow' _ pair = "(" <> pshow (pfstBuiltin # pair) <> "," <> pshow (psndBuiltin # pair) <> ")" @@ -447,7 +447,7 @@ instance (PIsData a, PShow a) => PShow (PAsData a) where pshow' w x = pshow' w (pfromData x) pconstrBuiltin :: Term s (PInteger :--> PBuiltinList PData :--> PAsData (PBuiltinPair PInteger (PBuiltinList PData))) -pconstrBuiltin = punsafeBuiltin $ PLC.ConstrData +pconstrBuiltin = punsafeBuiltin PLC.ConstrData {- | Create a Plutarch-level 'PAsData' constant, from a Haskell value. Example: @@ -462,13 +462,13 @@ instance PTryFrom PData (PAsData PInteger) where type PTryFromExcess PData (PAsData PInteger) = Flip Term PInteger ptryFrom' opq = runTermCont $ do ver <- tcont $ plet (pasInt # opq) - pure $ (punsafeCoerce opq, ver) + pure (punsafeCoerce opq, ver) instance PTryFrom PData (PAsData PByteString) where type PTryFromExcess PData (PAsData PByteString) = Flip Term PByteString ptryFrom' opq = runTermCont $ do ver <- tcont $ plet (pasByteStr # opq) - pure $ (punsafeCoerce opq, ver) + pure (punsafeCoerce opq, ver) instance ( PTryFrom PData (PAsData a) @@ -498,7 +498,7 @@ instance PTryFrom PData (PAsData (PBuiltinList PData)) where type PTryFromExcess PData (PAsData (PBuiltinList PData)) = Flip Term (PBuiltinList PData) ptryFrom' opq = runTermCont $ do ver <- tcont $ plet (pasList # opq) - pure $ (punsafeCoerce opq, ver) + pure (punsafeCoerce opq, ver) {- | Recover a `PBuiltinList (PAsData a)` @@ -519,7 +519,7 @@ instance (wrapped, _) <- tcont $ ptryFrom @(PAsData a) $ e pure wrapped ver <- tcont $ plet $ pmap # verify # lst - pure $ (punsafeCoerce opq, ver) + pure (punsafeCoerce opq, ver) {- | Recover a `PAsData (PBuiltinPair a b)` @@ -542,10 +542,14 @@ instance snd' :: Term _ b snd' = unTermCont $ fst <$> tcont (ptryFrom @b $ pforgetData $ psndBuiltin # tup) ver <- tcont $ plet $ ppairDataBuiltin # fst' # snd' - pure $ (punsafeCoerce opq, ver) + pure (punsafeCoerce opq, ver) ----------------------- other utility functions ----------------------------------------- instance PTryFrom PData (PAsData PData) where type PTryFromExcess PData (PAsData PData) = Const () ptryFrom' opq = runTermCont $ pure (pdata opq, ()) + +instance PTryFrom PData PData where + type PTryFromExcess PData PData = Const () + ptryFrom' opq f = f (opq, ()) diff --git a/Plutarch/Internal/PlutusType.hs b/Plutarch/Internal/PlutusType.hs index 30dd28311..f2c03e019 100644 --- a/Plutarch/Internal/PlutusType.hs +++ b/Plutarch/Internal/PlutusType.hs @@ -29,13 +29,13 @@ module Plutarch.Internal.PlutusType ( import Data.Kind (Constraint, Type) import Data.Proxy (Proxy (Proxy)) +import GHC.TypeLits (ErrorMessage (ShowType, Text, (:<>:)), TypeError) import Generics.SOP (All2) import Plutarch.Internal (PType, Term, plam', plet, punsafeCoerce, (:-->) (PLam)) import Plutarch.Internal.Generic (PCode) import Plutarch.Internal.PLam ((#)) import Plutarch.Internal.Quantification (PFix (PFix), PForall (PForall), PSome (PSome)) import Plutarch.Internal.Witness (witness) -import GHC.TypeLits (TypeError, ErrorMessage (ShowType, Text, (:<>:))) class PlutusTypeStrat (strategy :: Type) where type PlutusTypeStratConstraint strategy :: PType -> Constraint @@ -52,7 +52,7 @@ class DerivePlutusType (a :: PType) where type DPTStrat a :: Type - type DPTStrat a = TypeError ('Text "Please specify a strategy for deriving PlutusType for type " ':<>: 'ShowType a) + type DPTStrat a = TypeError ( 'Text "Please specify a strategy for deriving PlutusType for type " ':<>: 'ShowType a) class PlutusType (a :: PType) where type PInner a :: PType diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index efc6ace53..6a9083ab6 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -3,13 +3,6 @@ module Plutarch.TryFromSpec (spec) where -import Data.Coerce (coerce) - --- Haskell imports -import qualified GHC.Generics as GHC - -import Generics.SOP (Generic, I (I)) - -- Plutus and PlutusTx imports import PlutusTx ( @@ -23,6 +16,7 @@ import Plutarch.Test import Plutarch.Unsafe ( punsafeCoerce, + punsafeDowncast, ) import Plutarch.Api.V1 ( @@ -51,10 +45,7 @@ import Plutarch.TryFrom ( ptryFrom', ) -import Plutarch.Reducible (Reduce, Reducible) - import Plutarch.ApiSpec (invalidContext1, validContext0) -import Plutarch.DataRepr (PIsDataReprInstances (PIsDataReprInstances)) import Test.Hspec @@ -265,23 +256,23 @@ fullCheck = unTermCont $ fst <$> TermCont (ptryFrom $ pforgetData sampleStructur ------------------- Example: untrusted Redeemer ------------------------------------ newtype PNatural (s :: S) = PMkNatural (Term s PInteger) - deriving (PlutusType, PIsData, PEq, POrd) via (DerivePNewtype PNatural PInteger) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PNatural where type DPTStrat _ = PlutusTypeNewtype -- | partial pmkNatural :: Term s (PInteger :--> PNatural) pmkNatural = plam $ \i -> pif (i #< 0) (ptraceError "could not make natural") (pcon $ PMkNatural i) newtype Flip f b a = Flip (f a b) - -instance Reducible (f a b) => Reducible (Flip f b a) where - type Reduce (Flip f b a) = Reduce (f a b) + deriving stock (Generic) instance PTryFrom PData (PAsData PNatural) where type PTryFromExcess PData (PAsData PNatural) = Flip Term PNatural ptryFrom' opq = runTermCont $ do (ter, exc) <- TermCont $ ptryFrom @(PAsData PInteger) opq ver <- tcont $ plet $ pmkNatural #$ exc - pure $ (punsafeCoerce ter, ver) + pure (punsafeDowncast ter, ver) validator :: Term s PValidator validator = phoistAcyclic $ @@ -399,20 +390,15 @@ sampleABdata :: Term s PData sampleABdata = pforgetData sampleAB recoverAB :: Term s (PAsData PAB) -recoverAB = unTermCont $ fst <$> (tcont $ ptryFrom sampleABdata) +recoverAB = unTermCont $ fst <$> tcont (ptryFrom sampleABdata) data PAB (s :: S) = PA (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PByteString])) | PB (Term s (PDataRecord '["_0" ':= PBuiltinList (PAsData PInteger), "_1" ':= PByteString])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData) - via PIsDataReprInstances PAB - --- here we can derive the `PTryFrom` instance for PAB via the newtype wrapper --- `PIsDataReprInstances` -deriving via PAsData (PIsDataReprInstances PAB) instance PTryFrom PData (PAsData PAB) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData) +instance DerivePlutusType PAB where type DPTStrat _ = PlutusTypeData +instance PTryFrom PData (PAsData PAB) ------------------- Sample usage with recovered record type ------------------------ @@ -429,9 +415,8 @@ theField = unTermCont $ do ------------------- Sample usage DerivePNewType ------------------------------------ -newtype PWrapInt (s :: S) = PWrapInt (PInteger s) - deriving newtype (PIsData, PEq, POrd) - -instance PTryFrom PData (PAsData PWrapInt) where - type PTryFromExcess PData (PAsData PWrapInt) = PTryFromExcess PData (PAsData PInteger) - ptryFrom' t f = ptryFrom' t $ \(t', exc) -> f (coerce (t' :: Term _ (PAsData PInteger)), exc) +newtype PWrapInt (s :: S) = PWrapInt (Term s PInteger) + deriving stock (Generic) + deriving anyclass (PlutusType, PEq, POrd) +instance DerivePlutusType PWrapInt where type DPTStrat _ = PlutusTypeNewtype +instance PTryFrom PData (PAsData PWrapInt) diff --git a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs index d64e51d15..3b08a35aa 100644 --- a/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PIsDataSpec.hs @@ -7,8 +7,6 @@ import Data.Text.Encoding (encodeUtf8) import Data.Functor.Compose (Compose (Compose)) import Data.String (fromString) -import qualified GHC.Generics as GHC -import Generics.SOP (Generic, I (I), NS (S, Z)) import PlutusLedgerApi.V1 ( Address (Address), Credential (PubKeyCredential, ScriptCredential), @@ -17,6 +15,8 @@ import PlutusLedgerApi.V1 ( StakingCredential (StakingHash), TxOutRef (TxOutRef), ) + +import Generics.SOP (NS (S, Z)) import qualified PlutusTx import Test.Tasty.QuickCheck (Arbitrary, property) @@ -24,7 +24,7 @@ import Test.Tasty.QuickCheck (Arbitrary, property) import Plutarch.Api.V1 import Plutarch.Api.V1.Tuple (pbuiltinPairFromTuple, ptupleFromBuiltin) import Plutarch.Builtin (pforgetData, ppairDataBuiltin) -import Plutarch.DataRepr (PDataSum (PDataSum), PIsDataRepr (PIsDataReprRepr), PIsDataReprInstances (PIsDataReprInstances)) +import Plutarch.DataRepr (PDataSum (PDataSum)) import Plutarch.Lift (PLifted) import Plutarch.Prelude import Plutarch.SpecTypes (PTriplet (PTriplet)) @@ -92,21 +92,21 @@ spec = do "normal" @| pcon (PFourWheeler datrec) @== expected "pdatasum" - @| pcon @(PDataSum (PIsDataReprRepr PVehicle)) (PDataSum . Z $ Compose datrec) @== expected + @| pcon @(PInner PVehicle) (PDataSum . Z $ Compose datrec) @== expected "2wheeler" @\ do let datrec = pdcons # pconstantData @PInteger 5 #$ pdcons # pconstantData @PInteger 0 # pdnil expected = pconstant $ PlutusTx.Constr 1 [PlutusTx.I 5, PlutusTx.I 0] "normal" @| pcon (PTwoWheeler datrec) @== expected "pdatasum" - @| pcon @(PDataSum (PIsDataReprRepr PVehicle)) (PDataSum . S . Z $ Compose datrec) @== expected + @| pcon @(PInner PVehicle) (PDataSum . S . Z $ Compose datrec) @== expected "immovable" @\ do let datrec = pdnil expected = pconstant $ PlutusTx.Constr 2 [] "normal" @| pcon (PImmovableBox datrec) @== expected "pdatasum" - @| pcon @(PDataSum (PIsDataReprRepr PVehicle)) (PDataSum . S . S . Z $ Compose datrec) @== expected + @| pcon @(PInner PVehicle) (PDataSum . S . S . Z $ Compose datrec) @== expected -- Product construction "prod" @\ do "1" @\ do @@ -127,7 +127,7 @@ spec = do "normal" @| pcon (PTriplet datrec) @== expected "pdatasum" - @| pcon @(PDataSum (PIsDataReprRepr (PTriplet PCurrencySymbol))) (PDataSum . Z $ Compose datrec) + @| pcon @(PInner (PTriplet PCurrencySymbol)) (PDataSum . Z $ Compose datrec) @== expected "2" @\ do let minting = Minting "" @@ -148,7 +148,7 @@ spec = do "normal" @| pcon (PTriplet datrec) @== expected "datasum" - @| pcon @(PDataSum (PIsDataReprRepr (PTriplet PScriptPurpose))) (PDataSum . Z $ Compose datrec) + @| pcon @(PInner (PTriplet PScriptPurpose)) (PDataSum . Z $ Compose datrec) @== expected -- Enumerable sum type construction "enum" @\ do @@ -225,17 +225,13 @@ data PVehicle (s :: S) = PFourWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger, "_2" ':= PInteger, "_3" ':= PInteger])) | PTwoWheeler (Term s (PDataRecord '["_0" ':= PInteger, "_1" ':= PInteger])) | PImmovableBox (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData) - via PIsDataReprInstances PVehicle + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData) +instance DerivePlutusType PVehicle where type DPTStrat _ = PlutusTypeData data PEnumType (s :: S) = PA (Term s (PDataRecord '[])) | PB (Term s (PDataRecord '[])) - deriving stock (GHC.Generic) - deriving anyclass (Generic, PIsDataRepr) - deriving - (PlutusType, PIsData) - via PIsDataReprInstances PEnumType + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData) +instance DerivePlutusType PEnumType where type DPTStrat _ = PlutusTypeData diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index 77c047d54..03f8a57ac 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -12,7 +12,7 @@ import PlutusLedgerApi.V1 ( StakingCredential (StakingHash, StakingPtr), ValidatorHash (ValidatorHash), ) -import qualified PlutusTx as PlutusTx +import qualified PlutusTx import qualified PlutusTx.Builtins as PlutusTx import Test.QuickCheck.Instances () @@ -129,7 +129,9 @@ peqIso :: forall p. (PLift p, PEq p, Arbitrary (PLifted p), Eq (PLifted p)) => P peqIso a b = plift (pconstant @p a #== pconstant b) `shouldBe` (a == b) newtype PAddress' s = PAddress' (Term s PAddress) - deriving (PlutusType, PIsData, PEq, POrd) via DerivePNewtype PAddress' PAddress + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PAddress' where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PAddress' where type PLifted PAddress' = Address' @@ -211,11 +213,12 @@ ltTrip trip1 trip2 = unTermCont $ do pure $ x #< x' #|| ( x #== x' - #&& ( unTermCont $ do - y <- tcont . plet . pfromData $ getField @"y" a - y' <- tcont . plet . pfromData $ getField @"y" b - pure $ y #< y' #|| (y #== y' #&& pfromData (getField @"z" a) #< pfromData (getField @"z" b)) - ) + #&& unTermCont + ( do + y <- tcont . plet . pfromData $ getField @"y" a + y' <- tcont . plet . pfromData $ getField @"y" b + pure $ y #< y' #|| (y #== y' #&& pfromData (getField @"z" a) #< pfromData (getField @"z" b)) + ) ) lteTrip :: Term s (PTriplet PInteger) -> Term s (PTriplet PInteger) -> Term s PBool @@ -228,11 +231,12 @@ lteTrip trip1 trip2 = unTermCont $ do pure $ x #< x' #|| ( x #== x' - #&& ( unTermCont $ do - y <- tcont . plet . pfromData $ getField @"y" a - y' <- tcont . plet . pfromData $ getField @"y" b - pure $ y #< y' #|| (y #== y' #&& pfromData (getField @"z" a) #<= pfromData (getField @"z" b)) - ) + #&& unTermCont + ( do + y <- tcont . plet . pfromData $ getField @"y" a + y' <- tcont . plet . pfromData $ getField @"y" b + pure $ y #< y' #|| (y #== y' #&& pfromData (getField @"z" a) #<= pfromData (getField @"z" b)) + ) ) -- manual 'pmatch' + 'PDataRecord' Ord impl. diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index 7f421ffe2..437d89716 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -9,14 +9,12 @@ import Plutarch.Api.V1 ( PAddress (PAddress), PCredential (PPubKeyCredential, PScriptCredential), PScriptPurpose (PCertifying, PMinting, PRewarding, PSpending), - PMaybeData, - PStakingCredential, ) import Plutarch.Builtin (pasByteStr, pasConstr) import Plutarch.DataRepr (PDataSum (PDataSum)) import Plutarch.Prelude import Plutarch.Test -import Plutarch.Unsafe (punsafeCoerce) +import Plutarch.Unit () import PlutusLedgerApi.V1 (DCert (DCertGenesis), toData) import PlutusLedgerApi.V1.Address (Address (Address)) import PlutusLedgerApi.V1.Contexts (ScriptPurpose (Certifying, Minting, Rewarding, Spending), TxOutRef (TxOutRef)) @@ -71,17 +69,13 @@ deconstrSpec = do ) # pconstant addrPC "datasum" - @|(plam - ( \x -> pmatch (pupcast @(PDataSum '[ '[ "credential" ':= PCredential - , "stakingCredential" ':= PMaybeData PStakingCredential - ]]) x) $ \(PDataSum datsum) -> case datsum of - Z (Compose addrFields) -> addrFields - _ -> perror - ) - # (pconstant addrPC :: Term _ PAddress) :: Term _ (PDataRecord - '[ "credential" ':= PCredential - , "stakingCredential" ':= PMaybeData PStakingCredential - ])) + @| ( plam + ( \x -> pmatch (pupcast @(PInner PAddress) x) $ \(PDataSum datsum) -> case datsum of + Z (Compose addrFields) -> addrFields + _ -> perror + ) + # pconstant addrPC + ) "sumtype(ignore-fields)" @\ do "normal" @| plam @@ -92,11 +86,11 @@ deconstrSpec = do # pconstant minting "datasum" @| plam - ( \x -> pmatch (pupcast x) $ \(PDataSum datsum) -> case datsum of + ( \x -> pmatch (pupcast @(PInner PScriptPurpose) x) $ \(PDataSum datsum) -> case datsum of Z _ -> pconstant () _ -> perror ) - # (pconstant minting :: Term _ PScriptPurpose) + # pconstant minting "sumtype(partial-match)" @\ do "normal" @| plam @@ -107,7 +101,7 @@ deconstrSpec = do # pconstant minting "datasum" @| plam - ( \x -> pmatch (pupcast x) $ \(PDataSum datsum) -> case datsum of + ( \x -> pmatch (pupcast @(PInner PScriptPurpose) x) $ \(PDataSum datsum) -> case datsum of Z (Compose hs) -> hs _ -> perror ) @@ -125,7 +119,7 @@ deconstrSpec = do ("datasum" @\) $ benchPurpose $ plam - ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + ( \x -> pmatch (pupcast @(PInner PScriptPurpose) x) $ \(PDataSum datsum) -> case datsum of Z (Compose f) -> plet f $ const $ phexByteStr "01" S (Z (Compose f)) -> plet f $ const $ phexByteStr "02" S (S (Z (Compose f))) -> plet f $ const $ phexByteStr "03" @@ -145,7 +139,7 @@ deconstrSpec = do ("datasum" @\) $ benchPurpose $ plam - ( \x -> pmatch (pasDataSum x) $ \(PDataSum datsum) -> case datsum of + ( \x -> pmatch (pupcast @(PInner PScriptPurpose) x) $ \(PDataSum datsum) -> case datsum of Z _ -> phexByteStr "01" S (Z _) -> phexByteStr "02" S (S (Z _)) -> phexByteStr "03" @@ -294,11 +288,12 @@ describe "sanity checks" $ do it "works" $ -} -data AB (s :: S) = A | B - deriving stock Generic - deriving anyclass PlutusType - -instance DerivePlutusType AB where type DPTStrat _ = PlutusTypeData +data AB (s :: S) + = A + | B + deriving stock (Generic) + deriving anyclass (PlutusType) +instance DerivePlutusType AB where type DPTStrat _ = PlutusTypeScott {- | Instead of using `pcon'` and `pmatch'` directly, diff --git a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs index 6d9b49646..41a9cd503 100644 --- a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs +++ b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs @@ -7,6 +7,7 @@ import qualified PlutusTx import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), + PDataFields, ) import Plutarch.Lift ( PConstantDecl (PConstanted), @@ -35,8 +36,8 @@ newtype PTriplet (a :: PType) (s :: S) ] ) ) - deriving stock Generic - deriving anyclass (PlutusType) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd, PDataFields) instance DerivePlutusType (PTriplet a) where type DPTStrat _ = PlutusTypeData From 8acb3d9d7af7d423dcda96a321323f052b562e8d Mon Sep 17 00:00:00 2001 From: mangoiv Date: Tue, 28 Jun 2022 20:00:03 +0200 Subject: [PATCH 520/584] fix tests; fix rational, regenerate goldens (bench and code) --- Plutarch/Num.hs | 12 +- Plutarch/Rational.hs | 21 ++- plutarch-test/goldens/api.ctx.bench.golden | 2 +- plutarch-test/goldens/api.ctx.uplc.golden | 2 +- plutarch-test/goldens/api.map.bench.golden | 26 ++-- .../goldens/api.map.uplc.eval.golden | 7 +- plutarch-test/goldens/api.map.uplc.golden | 26 ++-- .../goldens/api.value.dev=true.bench.golden | 132 +++++++++--------- .../api.value.dev=true.uplc.eval.golden | 4 +- .../goldens/api.value.dev=true.uplc.golden | 132 +++++++++--------- plutarch-test/goldens/either.bench.golden | 10 +- plutarch-test/goldens/either.uplc.golden | 10 +- .../goldens/extra.api.dev=true.bench.golden | 6 +- .../extra.api.dev=true.uplc.eval.golden | 4 +- .../goldens/extra.api.dev=true.uplc.golden | 6 +- plutarch-test/goldens/maybe.bench.golden | 8 +- plutarch-test/goldens/maybe.uplc.golden | 8 +- plutarch-test/goldens/pair.bench.golden | 8 +- plutarch-test/goldens/pair.uplc.golden | 8 +- .../goldens/plutustype.deconstr.bench.golden | 4 +- .../plutustype.deconstr.uplc.eval.golden | 5 +- .../goldens/plutustype.deconstr.uplc.golden | 4 +- .../goldens/plutustype.example.bench.golden | 4 +- .../goldens/plutustype.example.uplc.golden | 4 +- .../goldens/rational.dev=true.bench.golden | 48 +++---- .../rational.dev=true.uplc.eval.golden | 12 +- .../goldens/rational.dev=true.uplc.golden | 48 +++---- plutarch-test/goldens/show.bench.golden | 42 +++--- .../goldens/show.dev=true.bench.golden | 2 +- .../goldens/show.dev=true.uplc.golden | 2 +- plutarch-test/goldens/show.uplc.golden | 42 +++--- .../goldens/trace.dev=true.bench.golden | 2 +- .../goldens/trace.dev=true.uplc.golden | 2 +- plutarch-test/goldens/unit.bench.golden | 8 +- plutarch-test/goldens/unit.uplc.golden | 8 +- 35 files changed, 337 insertions(+), 332 deletions(-) diff --git a/Plutarch/Num.hs b/Plutarch/Num.hs index ba07db8f1..20f480798 100644 --- a/Plutarch/Num.hs +++ b/Plutarch/Num.hs @@ -1,11 +1,10 @@ {-# OPTIONS_GHC -Wno-orphans #-} -module Plutarch.Num (PNum (..), PFractional (..)) where +module Plutarch.Num (PNum (..)) where import Plutarch.Internal ( PType, Term, - pthrow, punsafeCoerce, (:-->), ) @@ -52,12 +51,3 @@ instance PNum a => Num (Term s a) where negate x = pnegate # x signum x = psignum # x fromInteger = pfromInteger - -class PFractional (a :: PType) where - (#/) :: Term s a -> Term s a -> Term s a - precip :: Term s (a :--> a) - -instance (PNum a, PFractional a) => Fractional (Term s a) where - (/) = (#/) - recip x = precip # x - fromRational _ = pthrow "unsupported operation" diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index b74dffa4e..3591967db 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleInstances #-} +{-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Rational ( PRational (..), @@ -9,8 +10,10 @@ module Plutarch.Rational ( pround, ptruncate, pproperFraction, + PFractional (..), ) where +import Data.Ratio (denominator, numerator) import GHC.Generics (Generic) import Plutarch ( DPTStrat, @@ -42,19 +45,31 @@ import Plutarch.Builtin ( pfromDataImpl, ) import Plutarch.Integer (PInteger, PIntegral (pdiv, pmod)) +import Plutarch.Internal (PType) +import Plutarch.Lift (pconstant) import Plutarch.List (PListLike (pcons, phead, pnil, ptail), pmap) -import Plutarch.Num (PFractional, PNum, pabs, pfromInteger, pnegate, precip, psignum, (#*), (#+), (#-), (#/)) +import Plutarch.Num (PNum, pabs, pfromInteger, pnegate, psignum, (#*), (#+), (#-)) import Plutarch.Pair (PPair (..)) import Plutarch.Show (PShow (pshow'), pshow) import Plutarch.Trace (ptraceError) import Plutarch.Unsafe (punsafeCoerce) +class PFractional (a :: PType) where + (#/) :: Term s a -> Term s a -> Term s a + precip :: Term s (a :--> a) + pfromRational :: Term s (PRational :--> a) + data PRational s = PRational (Term s PInteger) (Term s PInteger) deriving stock (Generic) deriving anyclass (PlutusType) instance DerivePlutusType PRational where type DPTStrat _ = PlutusTypeScott +instance (PNum a, PFractional a) => Fractional (Term s a) where + (/) = (#/) + recip x = precip # x + fromRational x = pfromRational #$ pcon $ PRational (pconstant (numerator x)) (pconstant (denominator x)) + instance PShow PRational where pshow' _ x = pshowRat # x @@ -177,7 +192,7 @@ instance PFractional PRational where phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational xn xd) -> - pfailOnZero # xn # (pcon (PRational xd xn)) + pfailOnZero # xn # pcon (PRational xd xn) x' #/ y' = phoistAcyclic @@ -193,6 +208,8 @@ instance PFractional PRational where # x' # y' + pfromRational = phoistAcyclic $ plam id + pfailOnZero :: Term s (PInteger :--> a :--> a) pfailOnZero = phoistAcyclic $ plam $ \n x -> diff --git a/plutarch-test/goldens/api.ctx.bench.golden b/plutarch-test/goldens/api.ctx.bench.golden index 2071f1ae2..50b3f05c1 100644 --- a/plutarch-test/goldens/api.ctx.bench.golden +++ b/plutarch-test/goldens/api.ctx.bench.golden @@ -2,6 +2,6 @@ term {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":140} get.txInfo {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":149} get.mint {"exBudgetCPU":1597398,"exBudgetMemory":5388,"scriptSizeBytes":177} get.credentials {"exBudgetCPU":4834417,"exBudgetMemory":15200,"scriptSizeBytes":242} -get.sym {"exBudgetCPU":10470781,"exBudgetMemory":30823,"scriptSizeBytes":337} +get.sym {"exBudgetCPU":10539781,"exBudgetMemory":31123,"scriptSizeBytes":339} ScriptPurpose.literal {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":48} ScriptPurpose.decode {"exBudgetCPU":1247652,"exBudgetMemory":3498,"scriptSizeBytes":74} \ No newline at end of file diff --git a/plutarch-test/goldens/api.ctx.uplc.golden b/plutarch-test/goldens/api.ctx.uplc.golden index 6d232dd12..5ab986e7b 100644 --- a/plutarch-test/goldens/api.ctx.uplc.golden +++ b/plutarch-test/goldens/api.ctx.uplc.golden @@ -2,6 +2,6 @@ term (program 1.0.0 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9 get.txInfo (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) get.mint (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 ((\i0 -> i3 (i3 (i3 i1))) (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) get.credentials (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (i5 i1)) (i2 (i4 i1))))))) (\i0 -> i3 (i5 (unConstrData ((\i0 -> i4 (i5 i1)) ((\i0 -> i4 (i5 i1)) (i3 (i2 (i4 i1)))))))) ((\i0 -> unListData (i3 (i4 i1))) ((\i0 -> i3 (i4 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -get.sym (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> i7 (i10 i1)) ((\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i10 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i10 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) (unMapData ((\i0 -> i10 ((\i0 -> i10 (i10 (i10 i1))) (i11 i1))) ((\i0 -> i10 (i11 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)))))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i7) (delay ((\i0 -> i5 (i15 (i13 i2)) (\i0 -> i10 (mkPairData (i11 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force (force fstPair))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +get.sym (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> unBData ((\i0 -> i7 (i10 i1)) ((\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (mapData i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i10 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i10 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) (unMapData ((\i0 -> i10 ((\i0 -> i10 (i10 (i10 i1))) (i11 i1))) ((\i0 -> i10 (i11 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff80a0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff80d8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)))))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i7) (delay ((\i0 -> i5 (i15 (i13 i2)) (\i0 -> i10 (mkPairData (i11 (i14 i3)) i1) i2) (delay i1)) (i2 (i11 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) [ ]) (force mkCons)) (force (force fstPair))) (force ifThenElse)) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) ScriptPurpose.literal (program 1.0.0 #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff) ScriptPurpose.decode (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 0 i2) (delay i1) (delay error))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData #d8799f58201111111111111111111111111111111111111111111111111111111111111111ff))) \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.bench.golden b/plutarch-test/goldens/api.map.bench.golden index a427678fd..621b85d53 100644 --- a/plutarch-test/goldens/api.map.bench.golden +++ b/plutarch-test/goldens/api.map.bench.golden @@ -1,11 +1,11 @@ -lookup.itself {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":82} -lookup.hit {"exBudgetCPU":3692245,"exBudgetMemory":9090,"scriptSizeBytes":116} -lookup.miss {"exBudgetCPU":4394532,"exBudgetMemory":11422,"scriptSizeBytes":126} -lookupData.hit {"exBudgetCPU":3692245,"exBudgetMemory":9090,"scriptSizeBytes":114} -lookupData.miss {"exBudgetCPU":4325532,"exBudgetMemory":11122,"scriptSizeBytes":121} +lookup.itself {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":85} +lookup.hit {"exBudgetCPU":4028533,"exBudgetMemory":10054,"scriptSizeBytes":119} +lookup.miss {"exBudgetCPU":4394532,"exBudgetMemory":11422,"scriptSizeBytes":128} +lookupData.hit {"exBudgetCPU":3939176,"exBudgetMemory":9822,"scriptSizeBytes":117} +lookupData.miss {"exBudgetCPU":4325532,"exBudgetMemory":11122,"scriptSizeBytes":124} findWithDefault.itself {"exBudgetCPU":115100,"exBudgetMemory":600,"scriptSizeBytes":78} findWithDefault.hit {"exBudgetCPU":4097533,"exBudgetMemory":10354,"scriptSizeBytes":117} -findWithDefault.hit2 {"exBudgetCPU":14457543,"exBudgetMemory":37732,"scriptSizeBytes":324} +findWithDefault.hit2 {"exBudgetCPU":14871543,"exBudgetMemory":39532,"scriptSizeBytes":329} findWithDefault.miss {"exBudgetCPU":4532532,"exBudgetMemory":12022,"scriptSizeBytes":125} singleton {"exBudgetCPU":742104,"exBudgetMemory":2828,"scriptSizeBytes":39} singletonData {"exBudgetCPU":604104,"exBudgetMemory":2228,"scriptSizeBytes":34} @@ -19,10 +19,10 @@ delete.old {"exBudgetCPU":7780191,"exBudgetMemory":25178,"scriptSizeBytes":204} difference.emptyLeft {"exBudgetCPU":2067458,"exBudgetMemory":7860,"scriptSizeBytes":162} difference.emptyRight {"exBudgetCPU":4494995,"exBudgetMemory":15848,"scriptSizeBytes":165} difference.emptyResult {"exBudgetCPU":7452717,"exBudgetMemory":22006,"scriptSizeBytes":179} -unionWith.const {"exBudgetCPU":8867337,"exBudgetMemory":27470,"scriptSizeBytes":257} -unionWith.double {"exBudgetCPU":8958814,"exBudgetMemory":26972,"scriptSizeBytes":253} -unionWith.(+) {"exBudgetCPU":8730040,"exBudgetMemory":26476,"scriptSizeBytes":260} -unionWith.flip (+) {"exBudgetCPU":8730040,"exBudgetMemory":26476,"scriptSizeBytes":260} -unionWithData.const {"exBudgetCPU":8434623,"exBudgetMemory":25874,"scriptSizeBytes":244} -unionWithData.emptyLeft {"exBudgetCPU":2619458,"exBudgetMemory":10260,"scriptSizeBytes":231} -unionWithData.emptyRight {"exBudgetCPU":3933736,"exBudgetMemory":14688,"scriptSizeBytes":231} \ No newline at end of file +unionWith.const {"exBudgetCPU":9281337,"exBudgetMemory":29270,"scriptSizeBytes":263} +unionWith.double {"exBudgetCPU":9372814,"exBudgetMemory":28772,"scriptSizeBytes":259} +unionWith.(+) {"exBudgetCPU":9144040,"exBudgetMemory":28276,"scriptSizeBytes":265} +unionWith.flip (+) {"exBudgetCPU":9144040,"exBudgetMemory":28276,"scriptSizeBytes":265} +unionWithData.const {"exBudgetCPU":8848623,"exBudgetMemory":27674,"scriptSizeBytes":249} +unionWithData.emptyLeft {"exBudgetCPU":2757458,"exBudgetMemory":10860,"scriptSizeBytes":236} +unionWithData.emptyRight {"exBudgetCPU":4209736,"exBudgetMemory":15888,"scriptSizeBytes":236} \ No newline at end of file diff --git a/plutarch-test/goldens/api.map.uplc.eval.golden b/plutarch-test/goldens/api.map.uplc.eval.golden index 1277a37b0..43bb1f298 100644 --- a/plutarch-test/goldens/api.map.uplc.eval.golden +++ b/plutarch-test/goldens/api.map.uplc.eval.golden @@ -1,8 +1,7 @@ -lookup.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i1))) -lookup.hit (program 1.0.0 (\i0 -> \i0 -> i2 (unIData (force (force sndPair) ( #436b6579 -, #182a ))))) +lookup.itself (program 1.0.0 (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i4) (delay (i5 (force headList i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (unIData (force (force sndPair) i1))) (bData i1))) +lookup.hit (program 1.0.0 (\i0 -> \i0 -> i2 42)) lookup.miss (program 1.0.0 (\i0 -> \i0 -> force i1)) -lookupData.hit (program 1.0.0 (\i0 -> \i0 -> i2 (force (force sndPair) (#436b6579, #182a)))) +lookupData.hit (program 1.0.0 (\i0 -> \i0 -> i2 #182a)) lookupData.miss (program 1.0.0 (\i0 -> \i0 -> force i1)) findWithDefault.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (force headList i1)) i6) (delay (i4 (force (force sndPair) (force headList i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData)) findWithDefault.hit (program 1.0.0 42) diff --git a/plutarch-test/goldens/api.map.uplc.golden b/plutarch-test/goldens/api.map.uplc.golden index 12bf60781..67e5340a9 100644 --- a/plutarch-test/goldens/api.map.uplc.golden +++ b/plutarch-test/goldens/api.map.uplc.golden @@ -1,11 +1,11 @@ -lookup.itself (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i7 i1)) i4) (delay (i5 (i7 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i1)) (force headList))) -lookup.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) -lookup.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i7 i1)) i4) (delay (i5 (i7 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (unIData (force (force sndPair) i3))) (bData i1)) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) -lookupData.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) -lookupData.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> \i0 -> \i0 -> i2 (force (force sndPair) i3)) (bData #6e6f6b6579) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) +lookup.itself (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i7 i1)) i4) (delay (i5 (i7 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (unIData (force (force sndPair) i1))) (bData i1)) (force headList))) +lookup.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (unIData (force (force sndPair) i1))) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) +lookup.miss (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i7 i1)) i4) (delay (i5 (i7 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (unIData (force (force sndPair) i1))) (bData i1)) #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) +lookupData.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (force (force sndPair) i1)) (bData i2) ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) +lookupData.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i6 i1)) i4) (delay (i5 (i6 i1))) (delay (i2 (force tailList i1)))))))) i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (force (force sndPair) i1)) (bData #6e6f6b6579) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) findWithDefault.itself (program 1.0.0 ((\i0 -> \i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) (force headList))) findWithDefault.hit (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 i2 ((\i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i3) (iData i1)) 42)) (force headList)) #6b6579)) -findWithDefault.hit2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay i5) (delay (force (i12 (equalsData (i14 (i15 i1)) i6) (delay (i4 (i11 (i15 i1)))) (delay (i2 (i13 i1)))))))) i1) (bData i1) i2 unIData) 12 i12 ((\i0 -> (\i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i10 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i15 i2) (i13 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i16 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i15 i6) (i15 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i17 i4)))) (delay (force (i16 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i17 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i17 i4))))))))) (i17 i2)) (i16 i4)) (i16 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i8 #6b6579 42) (i8 i12 6))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6e65776b6579)) +findWithDefault.hit2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (i11 (equalsData (i12 (i14 i1)) i6) (delay (i4 (i10 (i14 i1)))) (delay (i2 (i15 i1)))))))) i1) (bData i1) i2 unIData) 12 i12 ((\i0 -> (\i0 -> \i0 -> \i0 -> i5 (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i14 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i15 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i11 (i14 i6) (i14 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i19 i4)))) (delay (force (i15 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i19 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i19 i4))))))))) (i15 i2)) (i14 i4)) (i15 i1)))))) (\i0 -> \i0 -> force (i12 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i13 i2) (i14 i2) i1))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i8 #6b6579 42) (i8 i12 6))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6e65776b6579)) findWithDefault.miss (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i5) (delay (force (force ifThenElse (equalsData (force (force fstPair) (i9 i1)) i6) (delay (i4 (force (force sndPair) (i9 i1)))) (delay (i2 (force tailList i1)))))))) i1) (bData i1) i2 unIData) 12 #6e6f6b6579 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) (force headList))) singleton (program 1.0.0 ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData i2) (iData i1)) #6b6579 42)) singletonData (program 1.0.0 ((\i0 -> \i0 -> force mkCons (mkPairData i2 i1) [ ]) (bData #6b6579) (iData 42))) @@ -19,10 +19,10 @@ delete.old (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 difference.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i14 (i15 i1)) i6) (delay (i4 (force (force sndPair) (i15 i1)))) (delay (i2 (i16 i1)))))))) i1) (bData i1)) (unBData (i7 (i8 i2))) (i10 (i8 i2) i1) (\i0 -> i2) i4) (i2 (i8 i1)))))) i8) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i11) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i15 (i16 i1)) i6) (delay (i4 (force (force sndPair) (i16 i1)))) (delay (i2 (i17 i1)))))))) i1) (bData i1)) (unBData (i8 (i9 i2))) (i11 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i10 (mkPairData i2 i1) i11) (bData i2) (iData i1)) #6b6579 42) i7) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (force mkCons)) [ ])) difference.emptyResult (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay ((\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i11 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (force ifThenElse (equalsData (i15 (i16 i1)) i6) (delay (i4 (force (force sndPair) (i16 i1)))) (delay (i2 (i17 i1)))))))) i1) (bData i1)) (unBData (i8 (i9 i2))) (i13 (i9 i2) i1) (\i0 -> i2) i4) (i2 (i9 i1)))))) i2) (i6 i10 42) (i6 i10 84)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i14 i2) (i12 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i15 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i11 (i14 i6) (i14 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i16 i4)))) (delay (force (i15 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i16 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i16 i4))))))))) (i16 i2)) (i15 i4)) (i15 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i7 i11 42) (i7 i11 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i7 i11 42) (i7 i11 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i7 #6b6579 42) (i7 #6e65776b6579 6)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWith.flip (+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i7 #6e65776b6579 6) (i7 #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> i2) (i7 i11 42) (i7 i11 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) -unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i15 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i18 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i18 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i18 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> i2) i8 ((\i0 -> \i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i2) (iData i1)) #6b6579 42)) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (force mkCons)) [ ])) -unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i13 i2) (i11 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i9 i1 (delay (i15 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i18 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i18 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i18 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i15 i2)) (i14 i4)) (i14 i1)))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i2) (iData i1)) #6b6579 42) i8) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (force mkCons)) [ ])) \ No newline at end of file +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i13 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i14 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i11 (i13 i6) (i13 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i18 i4)))) (delay (force (i14 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i18 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i18 i4))))))))) (i14 i2)) (i13 i4)) (i14 i1)))))) (\i0 -> \i0 -> force (i11 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i12 i2) (i13 i2) i1))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1)))) (\i0 -> \i0 -> i2) (i7 i11 42) (i7 i11 42)) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.double (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i12 i6) (i12 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i17 i4)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i17 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i17 i4))))))))) (i13 i2)) (i12 i4)) (i13 i1)))))) (\i0 -> \i0 -> force (i10 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i11 i2) (i12 i2) i1))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i7 i11 42) (i7 i11 42)) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWith.(+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i12 i6) (i12 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i17 i4)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i17 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i17 i4))))))))) (i13 i2)) (i12 i4)) (i13 i1)))))) (\i0 -> \i0 -> force (i10 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i11 i2) (i12 i2) i1))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i7 #6b6579 42) (i7 #6e65776b6579 6)) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.flip (+) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i12 i6) (i12 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i17 i4)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i17 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i17 i4))))))))) (i13 i2)) (i12 i4)) (i13 i1)))))) (\i0 -> \i0 -> force (i10 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i11 i2) (i12 i2) i1))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) (i7 #6e65776b6579 6) (i7 #6b6579 42)) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWithData.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i11 (i12 i6) (i12 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i17 i4)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i17 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i17 i4))))))))) (i13 i2)) (i12 i4)) (i13 i1)))))) (\i0 -> \i0 -> force (i10 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i11 i2) (i12 i2) i1))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> i2) (i7 i11 42) (i7 i11 42)) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #6b6579)) +unionWithData.emptyLeft (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (i15 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i18 (mkPairData i2 (i11 (i12 i6) (i12 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i17 i4)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i18 i6 (i8 (\i0 -> \i0 -> i1) i3 (i17 i4) i5))) (delay (i18 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i17 i4))))))))) (i13 i2)) (i12 i4)) (i13 i1)))))) (\i0 -> \i0 -> force (i10 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i11 i2) (i12 i2) i1))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> i2) i8 ((\i0 -> \i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i2) (iData i1)) #6b6579 42)) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (force mkCons)) [ ])) +unionWithData.emptyRight (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (i15 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i13 (equalsData i2 i1) (delay (i18 (mkPairData i2 (i11 (i12 i6) (i12 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i17 i4)))) (delay (force (i13 (lessThanByteString (unBData i2) (unBData i1)) (delay (i18 i6 (i8 (\i0 -> \i0 -> i1) i3 (i17 i4) i5))) (delay (i18 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i17 i4))))))))) (i13 i2)) (i12 i4)) (i13 i1)))))) (\i0 -> \i0 -> force (i10 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i11 i2) (i12 i2) i1))))) (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> i2) ((\i0 -> \i0 -> (\i0 -> \i0 -> i11 (mkPairData i2 i1) i12) (bData i2) (iData i1)) #6b6579 42) i8) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (force mkCons)) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.dev=true.bench.golden index ba86996ab..e003a6afa 100644 --- a/plutarch-test/goldens/api.value.dev=true.bench.golden +++ b/plutarch-test/goldens/api.value.dev=true.bench.golden @@ -3,74 +3,74 @@ singletonData {"exBudgetCPU":3189793,"exBudgetMemory":7490,"scriptSizeBytes":80} valueOf.itself {"exBudgetCPU":851100,"exBudgetMemory":3800,"scriptSizeBytes":115} valueOf.applied {"exBudgetCPU":8887341,"exBudgetMemory":23308,"scriptSizeBytes":183} valueOf.growing.1 {"exBudgetCPU":6189368,"exBudgetMemory":18450,"scriptSizeBytes":193} -valueOf.growing.2 {"exBudgetCPU":21454115,"exBudgetMemory":62540,"scriptSizeBytes":412} -valueOf.growing.3 {"exBudgetCPU":32481961,"exBudgetMemory":92046,"scriptSizeBytes":443} -valueOf.growing.4 {"exBudgetCPU":47127107,"exBudgetMemory":128712,"scriptSizeBytes":462} -valueOf.growing.5 {"exBudgetCPU":65734553,"exBudgetMemory":174038,"scriptSizeBytes":480} -valueOf.growing.6 {"exBudgetCPU":88304299,"exBudgetMemory":228024,"scriptSizeBytes":498} -valueOf.growing.7 {"exBudgetCPU":114836345,"exBudgetMemory":290670,"scriptSizeBytes":517} -valueOf.growing.8 {"exBudgetCPU":145330691,"exBudgetMemory":361976,"scriptSizeBytes":535} -valueOf.growing.9 {"exBudgetCPU":182541724,"exBudgetMemory":447100,"scriptSizeBytes":553} -valueOf.growing.10 {"exBudgetCPU":218542596,"exBudgetMemory":531796,"scriptSizeBytes":571} -valueOf.growing.11 {"exBudgetCPU":258505768,"exBudgetMemory":625152,"scriptSizeBytes":589} -valueOf.growing.12 {"exBudgetCPU":302431240,"exBudgetMemory":727168,"scriptSizeBytes":608} -valueOf.growing.13 {"exBudgetCPU":350319012,"exBudgetMemory":837844,"scriptSizeBytes":626} -valueOf.growing.14 {"exBudgetCPU":402169084,"exBudgetMemory":957180,"scriptSizeBytes":644} -valueOf.growing.15 {"exBudgetCPU":457981456,"exBudgetMemory":1085176,"scriptSizeBytes":663} -valueOf.growing.16 {"exBudgetCPU":517756128,"exBudgetMemory":1221832,"scriptSizeBytes":681} -valueOf.growing.17 {"exBudgetCPU":581493100,"exBudgetMemory":1367148,"scriptSizeBytes":700} -unionWith.const {"exBudgetCPU":17744570,"exBudgetMemory":54040,"scriptSizeBytes":328} -unionWith.(+).itself {"exBudgetCPU":1012100,"exBudgetMemory":4500,"scriptSizeBytes":243} -unionWith.(+).applied {"exBudgetCPU":17836047,"exBudgetMemory":53542,"scriptSizeBytes":325} -unionWith.tokens {"exBudgetCPU":17607429,"exBudgetMemory":53046,"scriptSizeBytes":334} -unionWith.symbols {"exBudgetCPU":11008712,"exBudgetMemory":34832,"scriptSizeBytes":326} -unionWith.growing.1 {"exBudgetCPU":11077712,"exBudgetMemory":35132,"scriptSizeBytes":330} -unionWith.growing.2 {"exBudgetCPU":26273459,"exBudgetMemory":78922,"scriptSizeBytes":364} -unionWith.growing.3 {"exBudgetCPU":38569531,"exBudgetMemory":111958,"scriptSizeBytes":385} -unionWith.growing.4 {"exBudgetCPU":54758903,"exBudgetMemory":153354,"scriptSizeBytes":403} -unionWith.growing.5 {"exBudgetCPU":74910575,"exBudgetMemory":203410,"scriptSizeBytes":422} -unionWith.growing.6 {"exBudgetCPU":99024547,"exBudgetMemory":262126,"scriptSizeBytes":440} -unionWith.growing.7 {"exBudgetCPU":127100819,"exBudgetMemory":329502,"scriptSizeBytes":459} -unionWith.growing.8 {"exBudgetCPU":159139391,"exBudgetMemory":405538,"scriptSizeBytes":477} -unionWith.growing.9 {"exBudgetCPU":201864238,"exBudgetMemory":509048,"scriptSizeBytes":493} -unionWith.growing.10 {"exBudgetCPU":237865110,"exBudgetMemory":593744,"scriptSizeBytes":512} -unionWith.growing.11 {"exBudgetCPU":277828282,"exBudgetMemory":687100,"scriptSizeBytes":530} -unionWith.growing.12 {"exBudgetCPU":321753754,"exBudgetMemory":789116,"scriptSizeBytes":548} -unionWith.growing.13 {"exBudgetCPU":369641526,"exBudgetMemory":899792,"scriptSizeBytes":567} -unionWith.growing.14 {"exBudgetCPU":421491598,"exBudgetMemory":1019128,"scriptSizeBytes":585} -unionWith.growing.15 {"exBudgetCPU":477303970,"exBudgetMemory":1147124,"scriptSizeBytes":604} -unionWith.growing.16 {"exBudgetCPU":537078642,"exBudgetMemory":1283780,"scriptSizeBytes":622} -unionWith.growing.17 {"exBudgetCPU":600815614,"exBudgetMemory":1429096,"scriptSizeBytes":640} -unionWithData const.itself {"exBudgetCPU":1012100,"exBudgetMemory":4500,"scriptSizeBytes":233} -unionWithData const.applied {"exBudgetCPU":17380856,"exBudgetMemory":52744,"scriptSizeBytes":318} +valueOf.growing.2 {"exBudgetCPU":22282115,"exBudgetMemory":66140,"scriptSizeBytes":417} +valueOf.growing.3 {"exBudgetCPU":33723961,"exBudgetMemory":97446,"scriptSizeBytes":448} +valueOf.growing.4 {"exBudgetCPU":48921107,"exBudgetMemory":136512,"scriptSizeBytes":467} +valueOf.growing.5 {"exBudgetCPU":68218553,"exBudgetMemory":184838,"scriptSizeBytes":485} +valueOf.growing.6 {"exBudgetCPU":91616299,"exBudgetMemory":242424,"scriptSizeBytes":503} +valueOf.growing.7 {"exBudgetCPU":119114345,"exBudgetMemory":309270,"scriptSizeBytes":522} +valueOf.growing.8 {"exBudgetCPU":150712691,"exBudgetMemory":385376,"scriptSizeBytes":540} +valueOf.growing.9 {"exBudgetCPU":189165724,"exBudgetMemory":475900,"scriptSizeBytes":558} +valueOf.growing.10 {"exBudgetCPU":226546596,"exBudgetMemory":566596,"scriptSizeBytes":576} +valueOf.growing.11 {"exBudgetCPU":268027768,"exBudgetMemory":666552,"scriptSizeBytes":594} +valueOf.growing.12 {"exBudgetCPU":313609240,"exBudgetMemory":775768,"scriptSizeBytes":613} +valueOf.growing.13 {"exBudgetCPU":363291012,"exBudgetMemory":894244,"scriptSizeBytes":631} +valueOf.growing.14 {"exBudgetCPU":417073084,"exBudgetMemory":1021980,"scriptSizeBytes":649} +valueOf.growing.15 {"exBudgetCPU":474955456,"exBudgetMemory":1158976,"scriptSizeBytes":668} +valueOf.growing.16 {"exBudgetCPU":536938128,"exBudgetMemory":1305232,"scriptSizeBytes":686} +valueOf.growing.17 {"exBudgetCPU":603021100,"exBudgetMemory":1460748,"scriptSizeBytes":705} +unionWith.const {"exBudgetCPU":18572570,"exBudgetMemory":57640,"scriptSizeBytes":333} +unionWith.(+).itself {"exBudgetCPU":1012100,"exBudgetMemory":4500,"scriptSizeBytes":248} +unionWith.(+).applied {"exBudgetCPU":18664047,"exBudgetMemory":57142,"scriptSizeBytes":330} +unionWith.tokens {"exBudgetCPU":18435429,"exBudgetMemory":56646,"scriptSizeBytes":339} +unionWith.symbols {"exBudgetCPU":11422712,"exBudgetMemory":36632,"scriptSizeBytes":331} +unionWith.growing.1 {"exBudgetCPU":11491712,"exBudgetMemory":36932,"scriptSizeBytes":335} +unionWith.growing.2 {"exBudgetCPU":27515459,"exBudgetMemory":84322,"scriptSizeBytes":369} +unionWith.growing.3 {"exBudgetCPU":40363531,"exBudgetMemory":119758,"scriptSizeBytes":390} +unionWith.growing.4 {"exBudgetCPU":57242903,"exBudgetMemory":164154,"scriptSizeBytes":408} +unionWith.growing.5 {"exBudgetCPU":78222575,"exBudgetMemory":217810,"scriptSizeBytes":427} +unionWith.growing.6 {"exBudgetCPU":103302547,"exBudgetMemory":280726,"scriptSizeBytes":445} +unionWith.growing.7 {"exBudgetCPU":132482819,"exBudgetMemory":352902,"scriptSizeBytes":464} +unionWith.growing.8 {"exBudgetCPU":165763391,"exBudgetMemory":434338,"scriptSizeBytes":482} +unionWith.growing.9 {"exBudgetCPU":210282238,"exBudgetMemory":545648,"scriptSizeBytes":498} +unionWith.growing.10 {"exBudgetCPU":247663110,"exBudgetMemory":636344,"scriptSizeBytes":517} +unionWith.growing.11 {"exBudgetCPU":289144282,"exBudgetMemory":736300,"scriptSizeBytes":535} +unionWith.growing.12 {"exBudgetCPU":334725754,"exBudgetMemory":845516,"scriptSizeBytes":553} +unionWith.growing.13 {"exBudgetCPU":384407526,"exBudgetMemory":963992,"scriptSizeBytes":572} +unionWith.growing.14 {"exBudgetCPU":438189598,"exBudgetMemory":1091728,"scriptSizeBytes":590} +unionWith.growing.15 {"exBudgetCPU":496071970,"exBudgetMemory":1228724,"scriptSizeBytes":609} +unionWith.growing.16 {"exBudgetCPU":558054642,"exBudgetMemory":1374980,"scriptSizeBytes":627} +unionWith.growing.17 {"exBudgetCPU":624137614,"exBudgetMemory":1530496,"scriptSizeBytes":645} +unionWithData const.itself {"exBudgetCPU":1012100,"exBudgetMemory":4500,"scriptSizeBytes":238} +unionWithData const.applied {"exBudgetCPU":18208856,"exBudgetMemory":56344,"scriptSizeBytes":323} inv {"exBudgetCPU":8006438,"exBudgetMemory":25962,"scriptSizeBytes":175} equality.itself {"exBudgetCPU":644100,"exBudgetMemory":2900,"scriptSizeBytes":124} -equality.triviallyTrue {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.triviallyFalse {"exBudgetCPU":9153784,"exBudgetMemory":22936,"scriptSizeBytes":213} -equality.swappedTokensTrue {"exBudgetCPU":41016280,"exBudgetMemory":114444,"scriptSizeBytes":457} -equality.swappedSymbolsTrue {"exBudgetCPU":32877768,"exBudgetMemory":85904,"scriptSizeBytes":448} -equality.growing.1 {"exBudgetCPU":10460856,"exBudgetMemory":26864,"scriptSizeBytes":203} -equality.growing.2 {"exBudgetCPU":40978210,"exBudgetMemory":114444,"scriptSizeBytes":452} -equality.growing.3 {"exBudgetCPU":62899536,"exBudgetMemory":171384,"scriptSizeBytes":487} -equality.growing.4 {"exBudgetCPU":92745462,"exBudgetMemory":245644,"scriptSizeBytes":522} -equality.growing.5 {"exBudgetCPU":130515988,"exBudgetMemory":337224,"scriptSizeBytes":557} -equality.growing.6 {"exBudgetCPU":176211114,"exBudgetMemory":446124,"scriptSizeBytes":593} -equality.growing.7 {"exBudgetCPU":229830840,"exBudgetMemory":572344,"scriptSizeBytes":628} -equality.growing.8 {"exBudgetCPU":291375166,"exBudgetMemory":715884,"scriptSizeBytes":663} -equality.growing.9 {"exBudgetCPU":360844092,"exBudgetMemory":876744,"scriptSizeBytes":698} -equality.growing.10 {"exBudgetCPU":438237618,"exBudgetMemory":1054924,"scriptSizeBytes":734} -equality.growing.11 {"exBudgetCPU":523555744,"exBudgetMemory":1250424,"scriptSizeBytes":769} -equality.growing.12 {"exBudgetCPU":616798470,"exBudgetMemory":1463244,"scriptSizeBytes":804} -equality.growing.13 {"exBudgetCPU":717965796,"exBudgetMemory":1693384,"scriptSizeBytes":839} -equality.growing.14 {"exBudgetCPU":827057722,"exBudgetMemory":1940844,"scriptSizeBytes":875} -equality.growing.15 {"exBudgetCPU":944074248,"exBudgetMemory":2205624,"scriptSizeBytes":910} -equality.growing.16 {"exBudgetCPU":1069015374,"exBudgetMemory":2487724,"scriptSizeBytes":945} -equality.growing.17 {"exBudgetCPU":1201881100,"exBudgetMemory":2787144,"scriptSizeBytes":980} -normalize.identity {"exBudgetCPU":35733548,"exBudgetMemory":106357,"scriptSizeBytes":553} -normalize.empty {"exBudgetCPU":24448001,"exBudgetMemory":72161,"scriptSizeBytes":435} -assertSorted.succeeds {"exBudgetCPU":30399271,"exBudgetMemory":95882,"scriptSizeBytes":511} +equality.triviallyTrue {"exBudgetCPU":10598856,"exBudgetMemory":27464,"scriptSizeBytes":208} +equality.triviallyFalse {"exBudgetCPU":9291784,"exBudgetMemory":23536,"scriptSizeBytes":218} +equality.swappedTokensTrue {"exBudgetCPU":42810280,"exBudgetMemory":122244,"scriptSizeBytes":467} +equality.swappedSymbolsTrue {"exBudgetCPU":33843768,"exBudgetMemory":90104,"scriptSizeBytes":458} +equality.growing.1 {"exBudgetCPU":10598856,"exBudgetMemory":27464,"scriptSizeBytes":208} +equality.growing.2 {"exBudgetCPU":42772210,"exBudgetMemory":122244,"scriptSizeBytes":462} +equality.growing.3 {"exBudgetCPU":65521536,"exBudgetMemory":182784,"scriptSizeBytes":497} +equality.growing.4 {"exBudgetCPU":96471462,"exBudgetMemory":261844,"scriptSizeBytes":532} +equality.growing.5 {"exBudgetCPU":135621988,"exBudgetMemory":359424,"scriptSizeBytes":567} +equality.growing.6 {"exBudgetCPU":182973114,"exBudgetMemory":475524,"scriptSizeBytes":603} +equality.growing.7 {"exBudgetCPU":238524840,"exBudgetMemory":610144,"scriptSizeBytes":638} +equality.growing.8 {"exBudgetCPU":302277166,"exBudgetMemory":763284,"scriptSizeBytes":673} +equality.growing.9 {"exBudgetCPU":374230092,"exBudgetMemory":934944,"scriptSizeBytes":708} +equality.growing.10 {"exBudgetCPU":454383618,"exBudgetMemory":1125124,"scriptSizeBytes":744} +equality.growing.11 {"exBudgetCPU":542737744,"exBudgetMemory":1333824,"scriptSizeBytes":779} +equality.growing.12 {"exBudgetCPU":639292470,"exBudgetMemory":1561044,"scriptSizeBytes":814} +equality.growing.13 {"exBudgetCPU":744047796,"exBudgetMemory":1806784,"scriptSizeBytes":849} +equality.growing.14 {"exBudgetCPU":857003722,"exBudgetMemory":2071044,"scriptSizeBytes":885} +equality.growing.15 {"exBudgetCPU":978160248,"exBudgetMemory":2353824,"scriptSizeBytes":920} +equality.growing.16 {"exBudgetCPU":1107517374,"exBudgetMemory":2655124,"scriptSizeBytes":955} +equality.growing.17 {"exBudgetCPU":1245075100,"exBudgetMemory":2974944,"scriptSizeBytes":990} +normalize.identity {"exBudgetCPU":36285548,"exBudgetMemory":108757,"scriptSizeBytes":560} +normalize.empty {"exBudgetCPU":25276001,"exBudgetMemory":75761,"scriptSizeBytes":443} +assertSorted.succeeds {"exBudgetCPU":30813271,"exBudgetMemory":97682,"scriptSizeBytes":516} assertSorted.fails on malsorted symbols {"exBudgetCPU":20705777,"exBudgetMemory":62290,"scriptSizeBytes":340} -assertSorted.fails on zero quantities {"exBudgetCPU":21820727,"exBudgetMemory":62160,"scriptSizeBytes":510} +assertSorted.fails on zero quantities {"exBudgetCPU":21820727,"exBudgetMemory":62160,"scriptSizeBytes":515} assertSorted.fails on empty token map {"exBudgetCPU":1240239,"exBudgetMemory":455,"scriptSizeBytes":262} Ada.adaSymbol {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} Ada.adaToken {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":8} @@ -78,7 +78,7 @@ Ada.lovelaceValueOf {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes Ada.isAdaOnlyValue.itself {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":45} Ada.isAdaOnlyValue.true on empty {"exBudgetCPU":497454,"exBudgetMemory":1532,"scriptSizeBytes":50} Ada.isAdaOnlyValue.trivially false {"exBudgetCPU":4349105,"exBudgetMemory":10950,"scriptSizeBytes":107} -Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":13487877,"exBudgetMemory":38826,"scriptSizeBytes":361} +Ada.isAdaOnlyValue.less trivially false {"exBudgetCPU":13901877,"exBudgetMemory":40626,"scriptSizeBytes":366} Ada.adaOnlyValue.itself {"exBudgetCPU":184100,"exBudgetMemory":900,"scriptSizeBytes":52} Ada.adaOnlyValue.on empty {"exBudgetCPU":589454,"exBudgetMemory":1932,"scriptSizeBytes":51} Ada.adaOnlyValue.on non-Ada {"exBudgetCPU":4356574,"exBudgetMemory":10950,"scriptSizeBytes":109} diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden index 46ab096b0..2ea8db90c 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden @@ -20,7 +20,7 @@ valueOf.growing.15 (program 1.0.0 1) valueOf.growing.16 (program 1.0.0 1) valueOf.growing.17 (program 1.0.0 1) unionWith.const (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) -unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) +unionWith.(+).itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1)) unionWith.(+).applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e02)]) unionWith.tokens (program 1.0.0 [(#41c0, #a24a6f74686572746f6b656e0149736f6d65746f6b656e01)]) unionWith.symbols (program 1.0.0 [ (#41c0, #a149736f6d65746f6b656e01) @@ -170,7 +170,7 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 , (#41cd, #a145746f6b656e01) , (#41ce, #a145746f6b656e01) , (#41cf, #a145746f6b656e01) ]) -unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1)))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) +unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) inv (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e20)]) equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.dev=true.uplc.golden index bef5bb22a..897a5db56 100644 --- a/plutarch-test/goldens/api.value.dev=true.uplc.golden +++ b/plutarch-test/goldens/api.value.dev=true.uplc.golden @@ -3,74 +3,74 @@ singletonData (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> forc valueOf.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) valueOf.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> i11 (bData i14) (mapData i1)) ((\i0 -> i11 (bData i15) (iData i1)) 1)) i13 i14) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c0) #736f6d65746f6b656e)) valueOf.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> i12 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i12 (bData i2) (iData i1)) #736f6d65746f6b656e 1)) #c7 #746f6b656e) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay i5) (delay (force (i9 (equalsData (i10 (i12 i1)) i6) (delay (i4 (i11 (i12 i1)))) (delay (i2 (i13 i1)))))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i11 i1 (delay i5) (delay (force (i13 (equalsData (i15 (i16 i1)) i6) (delay (i4 (i12 (i16 i1)))) (delay (i2 (i14 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i16 (equalsData (i18 (i19 i1)) i6) (delay (i4 (i15 (i19 i1)))) (delay (i2 (i17 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) -unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i12 i2) (i10 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i10 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i13 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i14 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i13 i6 (i8 (\i0 -> \i0 -> i1) i3 (i14 i4) i5))) (delay (i13 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i14 i4))))))))) (i14 i2)) (i13 i4)) (i13 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (force tailList)) (force (force fstPair))) (force headList))) -unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 i12 (i13 #736f6d65746f6b656e 1)) (i11 i12 (i13 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 #c0 (i12 i16 1)) (i11 #c7 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 #c0 (i12 i16 1)) (i11 #c7 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i15 i14 (i16 i20 1)) (i15 i14 (i16 #746f6b656e 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c4 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c4 (i17 i15 1))) (i16 #c5 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c4 (i17 i15 1))) (i16 #c5 (i17 i15 1))) (i16 #c6 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 #cd (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 #cd (i18 i15 1))) (i16 #ce (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 #cd (i18 i15 1))) (i16 #ce (i18 i15 1))) (i16 #cf (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i12 i2) (i10 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i10 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i13 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i14 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i13 i6 (i8 (\i0 -> \i0 -> i1) i3 (i14 i4) i5))) (delay (i13 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i14 i4))))))))) (i14 i2)) (i13 i4)) (i13 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (force tailList)) (force (force fstPair))) (force headList))) -unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +valueOf.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) ((\i0 -> \i0 -> (\i0 -> i6 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i7 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i13 i14 (i15 #736f6d65746f6b656e 1)) (i13 i14 (i15 i19 1))) #c7 i19) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i7 (\i0 -> \i0 -> force (i14 i1 (delay i5) (delay (force (i12 (equalsData (i13 (i15 i1)) i6) (delay (i4 (i11 (i15 i1)))) (delay (i2 (i16 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i22 1))) (i17 #c1 (i18 i22 1))) (i17 #c2 (i18 i22 1))) (i17 #c3 (i18 i22 1))) (i17 #c4 (i18 i22 1))) (i17 #c5 (i18 i22 1))) (i17 #c6 (i18 i22 1))) #c7 i22) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +valueOf.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +valueOf.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> i4 i2 0 (\i0 -> i5 i2 0 unIData (unMapData i1)) i3) (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i3 addInteger (i17 i16 (i18 #736f6d65746f6b656e 1)) (i17 i16 (i18 i23 1))) (i17 #c1 (i18 i23 1))) (i17 #c2 (i18 i23 1))) (i17 #c3 (i18 i23 1))) (i17 #c4 (i18 i23 1))) (i17 #c5 (i18 i23 1))) (i17 #c6 (i18 i23 1))) (i17 i22 (i18 i23 1))) (i17 #c8 (i18 i23 1))) (i17 #c9 (i18 i23 1))) (i17 #ca (i18 i23 1))) (i17 #cb (i18 i23 1))) (i17 #cc (i18 i23 1))) (i17 #cd (i18 i23 1))) (i17 #ce (i18 i23 1))) (i17 #cf (i18 i23 1))) i22 i23) (\i0 -> i2 (bData i1))) (\i0 -> \i0 -> \i0 -> \i0 -> i10 (\i0 -> \i0 -> force (i17 i1 (delay i5) (delay (force (i15 (equalsData (i16 (i18 i1)) i6) (delay (i4 (i14 (i18 i1)))) (delay (i2 (i19 i1)))))))) i1)) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #c7) #746f6b656e)) +unionWith.const (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.(+).itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (i9 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i12 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i16 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i12 i6 (i8 (\i0 -> \i0 -> i1) i3 (i16 i4) i5))) (delay (i12 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i16 i4))))))))) (i12 i2)) (i11 i4)) (i12 i1)))))) (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i10 i2) (i11 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList))) +unionWith.(+).applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.tokens (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 i12 (i13 #736f6d65746f6b656e 1)) (i11 i12 (i13 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +unionWith.symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 #c0 (i12 i16 1)) (i11 #c7 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (i7 (unIData i2) (unIData i1))) i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 #c0 (i12 i16 1)) (i11 #c7 (i12 i16 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i15 i14 (i16 i20 1)) (i15 i14 (i16 #746f6b656e 1))) (i15 #c7 (i16 i20 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c4 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c4 (i17 i15 1))) (i16 #c5 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i17 i21 1)) (i16 i14 (i17 i15 1))) (i16 #c1 (i17 i15 1))) (i16 #c2 (i17 i15 1))) (i16 #c3 (i17 i15 1))) (i16 #c4 (i17 i15 1))) (i16 #c5 (i17 i15 1))) (i16 #c6 (i17 i15 1))) (i16 #c7 (i17 i21 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 #cd (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 #cd (i18 i15 1))) (i16 #ce (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> i2) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i16 i14 (i18 i22 1)) (i16 i14 (i18 i15 1))) (i16 #c1 (i18 i15 1))) (i16 #c2 (i18 i15 1))) (i16 #c3 (i18 i15 1))) (i16 #c4 (i18 i15 1))) (i16 #c5 (i18 i15 1))) (i16 #c6 (i18 i15 1))) (i16 i17 (i18 i15 1))) (i16 #c8 (i18 i15 1))) (i16 #c9 (i18 i15 1))) (i16 #ca (i18 i15 1))) (i16 #cb (i18 i15 1))) (i16 #cc (i18 i15 1))) (i16 #cd (i18 i15 1))) (i16 #ce (i18 i15 1))) (i16 #cf (i18 i15 1))) (i16 i17 (i18 i22 1))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c0) #746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (i9 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i12 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i16 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i12 i6 (i8 (\i0 -> \i0 -> i1) i3 (i16 i4) i5))) (delay (i12 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i16 i4))))))))) (i12 i2)) (i11 i4)) (i12 i1)))))) (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i10 i2) (i11 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList))) +unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) inv (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> mapData (i2 (unMapData i1)))) (\i0 -> i4 (\i0 -> iData (i4 (unIData i1))) i1) i1) (\i0 -> subtractInteger 0 i1) ((\i0 -> \i0 -> i10 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i10 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay (i12 (mkPairData (i7 (i9 i1)) (i4 (i8 (i9 i1)))) (i2 (i10 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i16 (i17 i14 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i14 (i17 i21 1))) (i1 addInteger (i15 i14 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i4 i2 (delay (force (i4 i1 (delay True) (delay False)))) (delay (force (i4 i1 (delay False) (delay (force (i5 (force ((\i0 -> \i0 -> i7 i2 i1 (delay False)) (equalsData (i6 (i8 i2)) (i6 (i8 i1))) (delay (equalsData (i7 (i8 i2)) (i7 (i8 i1)))))) (delay (i3 (i9 i2) (i9 i1))) (delay False))))))))) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i23 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i24 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i25 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i26 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i27 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i28 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i29 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i30 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i31 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i32 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i33 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i34 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i35 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i6 (\i0 -> \i0 -> \i0 -> force (i11 i2 (delay (force (i11 i1 (delay True) (delay False)))) (delay (force (i11 i1 (delay False) (delay (force (i13 (force ((\i0 -> \i0 -> i15 i2 i1 (delay False)) (equalsData (i15 (i16 i2)) (i15 (i16 i1))) (delay (equalsData (i12 (i16 i2)) (i12 (i16 i1)))))) (delay (i3 (i14 i2) (i14 i1))) (delay False))))))))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i36 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i12 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i14 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i15 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay (force (force trace "Negative amount in Value" (delay error)))))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i14 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i14 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i7 (\i0 -> \i0 -> force (i11 i1 (delay True) (delay (force (i4 (i3 (i16 i1)) (delay (i2 (i14 i1)))))))))) (\i0 -> \i0 -> i11 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i19) (delay ((\i0 -> i5 (i11 (i15 i2)) (\i0 -> i20 (mkPairData (i15 (i16 i3)) i1) i2) (delay i1)) (i2 (i12 i1)))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> \i0 -> \i0 -> i2 (mapData i3)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i11 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i11 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i9 i1 (delay i20) (delay ((\i0 -> i5 (i11 (i15 i2)) (\i0 -> i21 (mkPairData (i15 (i16 i3)) i1) i2) (delay i1)) (i2 (i12 i1)))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i14 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i16 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i17 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i6 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i11 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i9 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i18 i1)) (delay (i2 (i16 i1)))))))))) (\i0 -> i12 i1 i2)) (delay True)) (\i0 -> i6 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i14 (i1 i2) (delay (force (i6 i7 (delay error)))) (delay (i4 (i15 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i15 i1))))))) i1 (\i0 -> False))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i16 (i17 i14 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i14 (i17 i21 1))) (i1 addInteger (i15 i14 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i23 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i24 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i25 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i26 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i27 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i28 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i29 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i30 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i31 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i32 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i33 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i34 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i35 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i36 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay (force (force trace "Negative amount in Value" (delay error)))))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (mapData i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i13 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i13 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i7 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i16 i1)))))))))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i19) (delay ((\i0 -> i5 (i10 (i14 i2)) (\i0 -> i20 (mkPairData (i13 (i15 i3)) i1) i2) (delay i1)) (i2 (i14 i1)))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (mapData i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i10 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i10 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i20) (delay ((\i0 -> i5 (i10 (i14 i2)) (\i0 -> i21 (mkPairData (i13 (i15 i3)) i1) i2) (delay i1)) (i2 (i14 i1)))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i13 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i15 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i16 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i6 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i11 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i9 (\i0 -> \i0 -> force (i16 i1 (delay False) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> i11 i1 i2)) (delay True)) (\i0 -> i6 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i13 (i1 i2) (delay (force (i6 i7 (delay error)))) (delay (i4 (i17 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i14 i1))))))) i1 (\i0 -> False))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on malsorted symbols (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i8 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i3) (delay (i21 (i16 i1) (i2 (i17 i1)))))) i2) (i14 #c7 (i15 i19 1)) (i14 #c0 (i15 i19 1)))) (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i14 i1)) (delay (i2 (i15 i1)))))))))) (\i0 -> i5 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i6 (i1 i2) (delay (force (i7 i8 (delay error)))) (delay (i4 (i13 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i7 (i10 i1))))))) i1 (\i0 -> False))) (force ifThenElse)) (force trace)) "unsorted map") (force (force fstPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i14 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i16 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i17 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i6 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i11 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i18 (i19 i23 1)) (i17 i18 (i19 i23 1)))) (\i0 -> i9 (\i0 -> \i0 -> force (i13 i1 (delay False) (delay (force (i4 (i3 (i18 i1)) (delay (i2 (i16 i1)))))))))) (\i0 -> i12 i1 i2)) (delay True)) (\i0 -> i6 (\i0 -> \i0 -> force (i10 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i14 (i1 i2) (delay (force (i6 i7 (delay error)))) (delay (i4 (i15 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i14 (i15 i1))))))) i1 (\i0 -> False))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +assertSorted.fails on zero quantities (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i13 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i15 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i16 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i6 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i11 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 i18 (i19 i23 1)) (i17 i18 (i19 i23 1)))) (\i0 -> i9 (\i0 -> \i0 -> force (i16 i1 (delay False) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> i11 i1 i2)) (delay True)) (\i0 -> i6 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i13 (i1 i2) (delay (force (i6 i7 (delay error)))) (delay (i4 (i17 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i14 i1))))))) i1 (\i0 -> False))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.fails on empty token map (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i8 i1))) i1) (\i0 -> force (i4 (force nullList (i7 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i9 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i10 "Abnormal Value" (delay error)))) (delay (i6 i1)))) ((\i0 -> \i0 -> (\i0 -> \i0 -> force mkCons (mkPairData i2 i1) i18) (bData i2) (mapData i1)) #c0 i14)) (\i0 -> i6 (\i0 -> \i0 -> force (i9 i1 (delay False) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i13 i1)))))))))) (\i0 -> i7 i1 i2)) (delay True)) (force (force sndPair))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i8 (i1 i2) (delay (force (i9 i10 (delay error)))) (delay (i4 (i11 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i10 (i11 i1))))))) i1 (\i0 -> False))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (force trace)) "unsorted map") (force tailList)) (force (force fstPair))) (force headList)) [ ])) Ada.adaSymbol (program 1.0.0 #) Ada.adaToken (program 1.0.0 #) @@ -78,7 +78,7 @@ Ada.lovelaceValueOf (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force c Ada.isAdaOnlyValue.itself (program 1.0.0 (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #))))))) Ada.isAdaOnlyValue.true on empty (program 1.0.0 ((\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) [ ])) Ada.isAdaOnlyValue.trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay True) (delay ((\i0 -> \i0 -> force ifThenElse i2 i1 False) (force nullList (force tailList i1)) (equalsData (force (force fstPair) (force headList i1)) (bData #)))))) ((\i0 -> \i0 -> i3 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i3 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 i1 (delay True) (delay ((\i0 -> \i0 -> i10 i2 i1 False) (force nullList (i9 i1)) (equalsData (i10 (i11 i1)) (bData i17)))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 #c0 (i12 #736f6d65746f6b656e 1)) (i11 i16 (i12 i16 10000000)))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> \i0 -> i1 (\i0 -> \i0 -> force (i6 i2 (delay i1) (delay (i4 (\i0 -> \i0 -> i1) (i11 i2) (i9 i2) i1)))) (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i12 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i11 i6) (i11 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i13 i4)))) (delay (force (i12 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i13 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i13 i4))))))))) (i13 i2)) (i12 i4)) (i12 i1))))))) (force (force chooseList))) (force (force sndPair))) (force ifThenElse)) (force tailList)) (force (force fstPair))) (force headList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) +Ada.isAdaOnlyValue.less trivially false (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i9 i1 (delay True) (delay ((\i0 -> \i0 -> i9 i2 i1 False) (force nullList (i11 i1)) (equalsData (i8 (i10 i1)) (bData i17)))))) ((\i0 -> \i0 -> (\i0 -> i4 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i11 #c0 (i12 #736f6d65746f6b656e 1)) (i11 i16 (i12 i16 10000000)))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #)) Ada.adaOnlyValue.itself (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> force mkCons i1 i4) (i2 i1)) i3)))) (force headList)) [ ])) Ada.adaOnlyValue.on empty (program 1.0.0 ((\i0 -> (\i0 -> force (force (force chooseList) i2 (delay i2) (delay (force ifThenElse (equalsData (force (force fstPair) (i1 i2)) (bData #)) ((\i0 -> force mkCons i1 i3) (i1 i2)) i2)))) (force headList)) [ ])) Ada.adaOnlyValue.on non-Ada (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force (force chooseList) i1 (delay i1) (delay (force ifThenElse (equalsData (force (force fstPair) (i2 i1)) (bData #)) ((\i0 -> i5 i1 i6) (i2 i1)) i5)))) ((\i0 -> \i0 -> i4 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i4 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (force headList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/either.bench.golden b/plutarch-test/goldens/either.bench.golden index e6c9b510a..92d18aaa2 100644 --- a/plutarch-test/goldens/either.bench.golden +++ b/plutarch-test/goldens/either.bench.golden @@ -1,5 +1,5 @@ -eq.true.left {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":42} -eq.true.right {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":42} -eq.false.left-right {"exBudgetCPU":575100,"exBudgetMemory":2600,"scriptSizeBytes":42} -eq.false.left-left {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":42} -eq.false.right-right {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":42} \ No newline at end of file +eq.true.left {"exBudgetCPU":1014033,"exBudgetMemory":3601,"scriptSizeBytes":47} +eq.true.right {"exBudgetCPU":1014033,"exBudgetMemory":3601,"scriptSizeBytes":47} +eq.false.left-right {"exBudgetCPU":713100,"exBudgetMemory":3200,"scriptSizeBytes":47} +eq.false.left-left {"exBudgetCPU":1014033,"exBudgetMemory":3601,"scriptSizeBytes":47} +eq.false.right-right {"exBudgetCPU":1014033,"exBudgetMemory":3601,"scriptSizeBytes":47} \ No newline at end of file diff --git a/plutarch-test/goldens/either.uplc.golden b/plutarch-test/goldens/either.uplc.golden index 588755f46..e36de994e 100644 --- a/plutarch-test/goldens/either.uplc.golden +++ b/plutarch-test/goldens/either.uplc.golden @@ -1,5 +1,5 @@ -eq.true.left (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42))) -eq.true.right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i1 42) (\i0 -> \i0 -> i1 42))) -eq.false.left-right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i1 42))) -eq.false.left-left (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) -eq.false.right-right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) (\i0 -> \i0 -> i1 24) (\i0 -> \i0 -> i1 42))) \ No newline at end of file +eq.true.left (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) ((\i0 -> \i0 -> \i0 -> i2 i3) 42) ((\i0 -> \i0 -> \i0 -> i2 i3) 42))) +eq.true.right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 i3) 42) ((\i0 -> \i0 -> \i0 -> i1 i3) 42))) +eq.false.left-right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) ((\i0 -> \i0 -> \i0 -> i2 i3) 42) ((\i0 -> \i0 -> \i0 -> i1 i3) 42))) +eq.false.left-left (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) ((\i0 -> \i0 -> \i0 -> i2 i3) 24) ((\i0 -> \i0 -> \i0 -> i2 i3) 42))) +eq.false.right-right (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (\i0 -> False)) (\i0 -> i2 (\i0 -> False) (\i0 -> equalsInteger i2 i1))) ((\i0 -> \i0 -> \i0 -> i1 i3) 24) ((\i0 -> \i0 -> \i0 -> i1 i3) 42))) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.dev=true.bench.golden index f733a7669..8c386c3a8 100644 --- a/plutarch-test/goldens/extra.api.dev=true.bench.golden +++ b/plutarch-test/goldens/extra.api.dev=true.bench.golden @@ -1,3 +1,3 @@ -pfindOwnInput {"exBudgetCPU":5917281,"exBudgetMemory":14580,"scriptSizeBytes":319} -pgetContinuingOutputs {"exBudgetCPU":12048411,"exBudgetMemory":30186,"scriptSizeBytes":444} -pparseDatum {"exBudgetCPU":4634894,"exBudgetMemory":14706,"scriptSizeBytes":373} \ No newline at end of file +pfindOwnInput {"exBudgetCPU":6900718,"exBudgetMemory":17404,"scriptSizeBytes":332} +pgetContinuingOutputs {"exBudgetCPU":13974787,"exBudgetMemory":35970,"scriptSizeBytes":462} +pparseDatum {"exBudgetCPU":18732961,"exBudgetMemory":59226,"scriptSizeBytes":378} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden index 05021636d..bd18c98bb 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden @@ -1,3 +1,3 @@ -pfindOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 (force headList [ #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff ]))) +pfindOwnInput (program 1.0.0 (\i0 -> \i0 -> i2 #d8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffff)) pgetContinuingOutputs (program 1.0.0 [#d8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffff]) -pparseDatum (program 1.0.0 (\i0 -> \i0 -> i2 ((\i0 -> force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay [ ]) (delay (force mkCons (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (force headList (force tailList ((\i0 -> force (force sndPair) (unConstrData i1)) #d8799f41d09f0102030405060708090affff)))))))) \ No newline at end of file +pparseDatum (program 1.0.0 (\i0 -> \i0 -> i2 #9f0102030405060708090aff)) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.dev=true.uplc.golden index 79e29deb2..85bdbaf83 100644 --- a/plutarch-test/goldens/extra.api.dev=true.uplc.golden +++ b/plutarch-test/goldens/extra.api.dev=true.uplc.golden @@ -1,3 +1,3 @@ -pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay (\i0 -> \i0 -> i2 (i13 i3))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> equalsData i2 (i9 (i11 i1))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i15 i1)) (delay (\i0 -> \i0 -> i2 (i17 i3))) (delay (i3 i2 (i16 i1)))))))) (i11 i1) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (i12 ((\i0 -> i14 (i16 i1)) (i13 (i14 (i15 i1))))) i3) (delay (force (force trace "can't get any continuing outputs" (delay error))))) ((\i0 -> unListData (i10 (i12 i1))) (i9 i4)) ((\i0 -> unListData (i10 (i11 (i12 i1)))) (i9 i4)) (i9 i1))) (delay error))) (i11 i2)) (force (force fstPair) i1)) (unConstrData (i6 (i7 i1)))) (i7 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (\i0 -> \i0 -> equalsData i2 (i3 (i5 i1)))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) -pparseDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i9 i1)) (delay (\i0 -> \i0 -> i2 (i11 i3))) (delay (i3 i2 (i8 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i7 (i8 i1)))) i1 (\i0 -> \i0 -> \i0 -> i2 ((\i0 -> i10 (i9 (i11 i4))) ((\i0 -> i7 (\i0 -> \i0 -> force (i10 i1 (delay [ ]) (delay (force mkCons (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i9 (i8 (i10 i3))))))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i5 ((\i0 -> i5 (i5 (i5 (i5 (i5 (i5 (i5 (i5 i1)))))))) (i6 i1)))) ((\i0 -> i5 (i6 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file +pfindOwnInput (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i5 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i10 (i2 (i11 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i11 i1))) (delay (i3 i2 (i12 i1)))))))) (\i0 -> (\i0 -> equalsData (listData (i12 i3)) (listData (i12 i1))) (i9 (i11 i1))) i2) ((\i0 -> unListData (i7 (i9 i1))) (i6 i4)) (i6 i1))) (delay error))) (i8 i2)) (force (force fstPair) i1)) (unConstrData (i3 (i4 i1)))) (i4 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (force ifThenElse)) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pgetContinuingOutputs (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i12 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i13 (i2 (i16 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i16 i1))) (delay (i3 i2 (i17 i1)))))))) (i11 i1) i3 (\i0 -> (\i0 -> i10 (\i0 -> \i0 -> force (i13 i1 (delay [ ]) (delay ((\i0 -> force (i15 (i4 i1) (delay (force mkCons i1 (i3 (i19 i2)))) (delay (i3 (i19 i2))))) (i17 i1)))))) (i12 ((\i0 -> i15 (i17 i1)) (i14 (i15 (i16 i1))))) i3) (delay (force (force trace "can't get any continuing outputs" (delay error))))) ((\i0 -> unListData (i11 (i13 i1))) (i10 i4)) ((\i0 -> unListData (i11 (i12 (i13 i1)))) (i10 i4)) (i10 i1))) (delay error))) (i12 i2)) (force (force fstPair) i1)) (unConstrData (i7 (i8 i1)))) (i8 #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force ifThenElse)) (\i0 -> \i0 -> i3 i2 (i4 (i6 i1)))) (\i0 -> \i0 -> equalsData (listData (i5 i2)) (listData (i5 i1)))) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) +pparseDatum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> force (i7 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (force ifThenElse (i2 (i9 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i9 i1))) (delay (i3 i2 (i8 i1)))))))) (\i0 -> equalsByteString i3 (unBData (i7 (i8 i1)))) i1 (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) ((\i0 -> i8 (i7 (i9 i2))) ((\i0 -> i5 (\i0 -> \i0 -> force (i8 i1 (delay [ ]) (delay (force mkCons (i3 (i10 i1)) (i2 (i9 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (i7 (i6 (i8 i1))))))) (delay (\i0 -> \i0 -> force i1))) #d0 ((\i0 -> unListData (i5 ((\i0 -> i5 (i5 (i5 (i5 (i5 (i5 (i5 (i5 i1)))))))) (i6 i1)))) ((\i0 -> i5 (i6 i1)) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force tailList)) (force headList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.bench.golden b/plutarch-test/goldens/maybe.bench.golden index 5f3c793cc..fb0145e39 100644 --- a/plutarch-test/goldens/maybe.bench.golden +++ b/plutarch-test/goldens/maybe.bench.golden @@ -1,6 +1,6 @@ eq.true.nothing {"exBudgetCPU":529100,"exBudgetMemory":2400,"scriptSizeBytes":34} -eq.true.just {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":38} -eq.false.nothing-just {"exBudgetCPU":552100,"exBudgetMemory":2500,"scriptSizeBytes":36} -eq.false.just-just {"exBudgetCPU":876033,"exBudgetMemory":3001,"scriptSizeBytes":38} +eq.true.just {"exBudgetCPU":1014033,"exBudgetMemory":3601,"scriptSizeBytes":43} +eq.false.nothing-just {"exBudgetCPU":621100,"exBudgetMemory":2800,"scriptSizeBytes":38} +eq.false.just-just {"exBudgetCPU":1014033,"exBudgetMemory":3601,"scriptSizeBytes":43} pfromJust.nothing {"exBudgetCPU":100,"exBudgetMemory":100,"scriptSizeBytes":14} -pfromJust.just {"exBudgetCPU":600033,"exBudgetMemory":1801,"scriptSizeBytes":21} \ No newline at end of file +pfromJust.just {"exBudgetCPU":669033,"exBudgetMemory":2101,"scriptSizeBytes":23} \ No newline at end of file diff --git a/plutarch-test/goldens/maybe.uplc.golden b/plutarch-test/goldens/maybe.uplc.golden index f868bbed2..baa62a58d 100644 --- a/plutarch-test/goldens/maybe.uplc.golden +++ b/plutarch-test/goldens/maybe.uplc.golden @@ -1,6 +1,6 @@ eq.true.nothing (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> force i1))) -eq.true.just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 42) (\i0 -> \i0 -> i2 42))) -eq.false.nothing-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) (\i0 -> \i0 -> i2 42))) -eq.false.just-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> i2 24) (\i0 -> \i0 -> i2 42))) +eq.true.just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> i2 i3) 42) ((\i0 -> \i0 -> \i0 -> i2 i3) 42))) +eq.false.nothing-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) (\i0 -> \i0 -> force i1) ((\i0 -> \i0 -> \i0 -> i2 i3) 42))) +eq.false.just-just (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> i2 (\i0 -> equalsInteger i2 i1) (delay False)) (delay (i1 (\i0 -> False) (delay True)))) ((\i0 -> \i0 -> \i0 -> i2 i3) 24) ((\i0 -> \i0 -> \i0 -> i2 i3) 42))) pfromJust.nothing (program 1.0.0 ((\i0 -> i1 (\i0 -> i1) (delay error)) (\i0 -> \i0 -> force i1))) -pfromJust.just (program 1.0.0 (equalsInteger ((\i0 -> i1 (\i0 -> i1) (delay error)) (\i0 -> \i0 -> i2 42)) 42)) \ No newline at end of file +pfromJust.just (program 1.0.0 (equalsInteger ((\i0 -> i1 (\i0 -> i1) (delay error)) ((\i0 -> \i0 -> \i0 -> i2 i3) 42)) 42)) \ No newline at end of file diff --git a/plutarch-test/goldens/pair.bench.golden b/plutarch-test/goldens/pair.bench.golden index 44b4da15a..b5d9560cf 100644 --- a/plutarch-test/goldens/pair.bench.golden +++ b/plutarch-test/goldens/pair.bench.golden @@ -1,4 +1,4 @@ -eq.true {"exBudgetCPU":1728579,"exBudgetMemory":5203,"scriptSizeBytes":59} -eq.false.fst {"exBudgetCPU":1370589,"exBudgetMemory":4802,"scriptSizeBytes":59} -eq.false.snd {"exBudgetCPU":1659579,"exBudgetMemory":4903,"scriptSizeBytes":64} -eq.false.both {"exBudgetCPU":1301589,"exBudgetMemory":4502,"scriptSizeBytes":64} \ No newline at end of file +eq.true {"exBudgetCPU":1866579,"exBudgetMemory":5803,"scriptSizeBytes":64} +eq.false.fst {"exBudgetCPU":1508589,"exBudgetMemory":5402,"scriptSizeBytes":64} +eq.false.snd {"exBudgetCPU":1797579,"exBudgetMemory":5503,"scriptSizeBytes":69} +eq.false.both {"exBudgetCPU":1439589,"exBudgetMemory":5102,"scriptSizeBytes":69} \ No newline at end of file diff --git a/plutarch-test/goldens/pair.uplc.golden b/plutarch-test/goldens/pair.uplc.golden index f522de39b..93ccba025 100644 --- a/plutarch-test/goldens/pair.uplc.golden +++ b/plutarch-test/goldens/pair.uplc.golden @@ -1,4 +1,4 @@ -eq.true (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i2) (\i0 -> i1 42 i2)) "Hello")) -eq.false.fst (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 i2) (\i0 -> i1 24 i2)) "Hello")) -eq.false.snd (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 42 "World"))) -eq.false.both (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) (\i0 -> i1 42 "Hello") (\i0 -> i1 24 "World"))) \ No newline at end of file +eq.true (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) ((\i0 -> \i0 -> i1 i2 i3) 42) ((\i0 -> \i0 -> i1 i2 i3) 42)) "Hello")) +eq.false.fst (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) ((\i0 -> \i0 -> i1 i2 i3) 42) ((\i0 -> \i0 -> i1 i2 i3) 24)) "Hello")) +eq.false.snd (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) ((\i0 -> \i0 -> i1 i2 "Hello") 42) ((\i0 -> \i0 -> i1 i2 "World") 42))) +eq.false.both (program 1.0.0 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsString i3 i1)))))) ((\i0 -> \i0 -> i1 i2 "Hello") 42) ((\i0 -> \i0 -> i1 i2 "World") 24))) \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.bench.golden b/plutarch-test/goldens/plutustype.deconstr.bench.golden index 87d1ebb45..e654e76e3 100644 --- a/plutarch-test/goldens/plutustype.deconstr.bench.golden +++ b/plutarch-test/goldens/plutustype.deconstr.bench.golden @@ -33,5 +33,5 @@ matching.raw.sumtype(exhaustive)(ignore-fields).rewarding {"exBudgetCPU":1635210 matching.raw.sumtype(exhaustive)(ignore-fields).certifying {"exBudgetCPU":2200699,"exBudgetMemory":5470,"scriptSizeBytes":77} fields.typed.extract-single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} fields.raw.extract-single {"exBudgetCPU":460976,"exBudgetMemory":1496,"scriptSizeBytes":32} -combined.typed.toValidatorHash {"exBudgetCPU":1777528,"exBudgetMemory":5194,"scriptSizeBytes":72} -combined.raw.toValidatorHash {"exBudgetCPU":1507597,"exBudgetMemory":4362,"scriptSizeBytes":67} \ No newline at end of file +combined.typed.toValidatorHash {"exBudgetCPU":2012997,"exBudgetMemory":5958,"scriptSizeBytes":75} +combined.raw.toValidatorHash {"exBudgetCPU":1874997,"exBudgetMemory":5358,"scriptSizeBytes":70} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden b/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden index 05fea6e3a..55e989cb6 100644 --- a/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden +++ b/plutarch-test/goldens/plutustype.deconstr.uplc.eval.golden @@ -33,6 +33,5 @@ matching.raw.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 #03) matching.raw.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 #04) fields.typed.extract-single (program 1.0.0 #d87a9f41abff) fields.raw.extract-single (program 1.0.0 #d87a9f41abff) -combined.typed.toValidatorHash (program 1.0.0 (\i0 -> \i0 -> i2 (unBData (force headList [#41ab])))) -combined.raw.toValidatorHash (program 1.0.0 (\i0 -> \i0 -> i2 (unBData (force headList (force (force sndPair) ( 1 -, [#41ab] )))))) \ No newline at end of file +combined.typed.toValidatorHash (program 1.0.0 (\i0 -> \i0 -> i2 #ab)) +combined.raw.toValidatorHash (program 1.0.0 (\i0 -> \i0 -> i2 #ab)) \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.deconstr.uplc.golden b/plutarch-test/goldens/plutustype.deconstr.uplc.golden index b3cddc722..54b466db0 100644 --- a/plutarch-test/goldens/plutustype.deconstr.uplc.golden +++ b/plutarch-test/goldens/plutustype.deconstr.uplc.golden @@ -33,5 +33,5 @@ matching.raw.sumtype(exhaustive)(ignore-fields).rewarding (program 1.0.0 ((\i0 - matching.raw.sumtype(exhaustive)(ignore-fields).certifying (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> force (i3 (equalsInteger i1 1) (delay #02) (delay (force (i3 (equalsInteger i1 2) (delay #03) (delay (force (i3 (equalsInteger i1 3) (delay #04) (delay #01))))))))) (force (force fstPair) (unConstrData i1))) #d87c9fd87e80ff) (force ifThenElse))) fields.typed.extract-single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd87a9f41abffd87a80ff)) fields.raw.extract-single (program 1.0.0 ((\i0 -> force headList (force (force sndPair) (unConstrData i1))) #d8799fd87a9f41abffd87a80ff)) -combined.typed.toValidatorHash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 1 i2) (delay (\i0 -> \i0 -> i2 (unBData (i7 i3)))) (delay (\i0 -> \i0 -> force i1)))) (i5 i2)) (force (force fstPair) i1)) (unConstrData (i2 (i3 (unConstrData i1))))) #d8799fd87a9f41abffd87a80ff) (force headList)) (force (force sndPair)))) -combined.raw.toValidatorHash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 (unBData (i5 (i6 i3))))))) (unConstrData (i2 (i3 (unConstrData i1))))) #d8799fd87a9f41abffd87a80ff) (force headList)) (force (force sndPair)))) \ No newline at end of file +combined.typed.toValidatorHash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger 1 i2) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (unBData (i5 i1)))) (delay (\i0 -> \i0 -> force i1)))) (i5 i2)) (force (force fstPair) i1)) (unConstrData (i2 (i3 (unConstrData i1))))) #d8799fd87a9f41abffd87a80ff) (force headList)) (force (force sndPair)))) +combined.raw.toValidatorHash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsInteger (force (force fstPair) i1) 0) (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (unBData (i3 (i4 i1))))))) (unConstrData (i2 (i3 (unConstrData i1))))) #d8799fd87a9f41abffd87a80ff) (force headList)) (force (force sndPair)))) \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.bench.golden b/plutarch-test/goldens/plutustype.example.bench.golden index 9504670e3..8a9450622 100644 --- a/plutarch-test/goldens/plutustype.example.bench.golden +++ b/plutarch-test/goldens/plutustype.example.bench.golden @@ -1,4 +1,4 @@ swap.A {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":16} swap.B {"exBudgetCPU":207100,"exBudgetMemory":1000,"scriptSizeBytes":16} -scottenc.PMaybe {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":14} -scottenc.PPair {"exBudgetCPU":230100,"exBudgetMemory":1100,"scriptSizeBytes":26} \ No newline at end of file +scottenc.PMaybe {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":16} +scottenc.PPair {"exBudgetCPU":299100,"exBudgetMemory":1400,"scriptSizeBytes":28} \ No newline at end of file diff --git a/plutarch-test/goldens/plutustype.example.uplc.golden b/plutarch-test/goldens/plutustype.example.uplc.golden index 51b337abf..aa593fc09 100644 --- a/plutarch-test/goldens/plutustype.example.uplc.golden +++ b/plutarch-test/goldens/plutustype.example.uplc.golden @@ -1,4 +1,4 @@ swap.A (program 1.0.0 ((\i0 -> \i0 -> force i2) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> force i2)))) swap.B (program 1.0.0 ((\i0 -> \i0 -> force i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> force i2)))) -scottenc.PMaybe (program 1.0.0 ((\i0 -> \i0 -> i2 42) (\i0 -> i1) (delay error))) -scottenc.PPair (program 1.0.0 ((\i0 -> i1 42 "Universe") (\i0 -> \i0 -> i1))) \ No newline at end of file +scottenc.PMaybe (program 1.0.0 ((\i0 -> \i0 -> \i0 -> i2 i3) 42 (\i0 -> i1) (delay error))) +scottenc.PPair (program 1.0.0 ((\i0 -> \i0 -> i1 i2 "Universe") 42 (\i0 -> \i0 -> i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.bench.golden b/plutarch-test/goldens/rational.dev=true.bench.golden index b79f77209..3453ada43 100644 --- a/plutarch-test/goldens/rational.dev=true.bench.golden +++ b/plutarch-test/goldens/rational.dev=true.bench.golden @@ -1,24 +1,24 @@ -literal {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} -ops.+ {"exBudgetCPU":30457189,"exBudgetMemory":75595,"scriptSizeBytes":369} -ops.- {"exBudgetCPU":30457189,"exBudgetMemory":75595,"scriptSizeBytes":369} -ops.* {"exBudgetCPU":53754714,"exBudgetMemory":128771,"scriptSizeBytes":413} -ops.harmonic-sum {"exBudgetCPU":80246207,"exBudgetMemory":190449,"scriptSizeBytes":412} -ops.multi-product {"exBudgetCPU":90069183,"exBudgetMemory":216583,"scriptSizeBytes":424} -compare {"exBudgetCPU":25951475,"exBudgetMemory":63677,"scriptSizeBytes":359} -round.5/3 {"exBudgetCPU":17167406,"exBudgetMemory":36449,"scriptSizeBytes":372} -round.4/3 {"exBudgetCPU":15711457,"exBudgetMemory":33346,"scriptSizeBytes":372} -round.-5/2 {"exBudgetCPU":16830920,"exBudgetMemory":35349,"scriptSizeBytes":387} -round.-1/4 {"exBudgetCPU":15940934,"exBudgetMemory":33448,"scriptSizeBytes":387} -truncate.5/4 {"exBudgetCPU":13138101,"exBudgetMemory":30239,"scriptSizeBytes":323} -truncate.7/4 {"exBudgetCPU":14594050,"exBudgetMemory":33342,"scriptSizeBytes":323} -truncate.1/4 {"exBudgetCPU":11682152,"exBudgetMemory":27136,"scriptSizeBytes":323} -truncate.-7/4 {"exBudgetCPU":16577953,"exBudgetMemory":36949,"scriptSizeBytes":337} -properFraction.-1/2 {"exBudgetCPU":38658862,"exBudgetMemory":92624,"scriptSizeBytes":483} -properFraction.-3/2 {"exBudgetCPU":40413288,"exBudgetMemory":96129,"scriptSizeBytes":488} -properFraction.-4/3 {"exBudgetCPU":40413288,"exBudgetMemory":96129,"scriptSizeBytes":488} -data.id.0.5 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.2 {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":12} -data.id.11/3 {"exBudgetCPU":11680925,"exBudgetMemory":28633,"scriptSizeBytes":277} -div by 0.1/0 {"exBudgetCPU":594827,"exBudgetMemory":136,"scriptSizeBytes":277} -div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":71} -div by 0.1/(1-1) {"exBudgetCPU":9194401,"exBudgetMemory":20168,"scriptSizeBytes":346} \ No newline at end of file +literal {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} +ops.+ {"exBudgetCPU":34125901,"exBudgetMemory":86801,"scriptSizeBytes":387} +ops.- {"exBudgetCPU":34125901,"exBudgetMemory":86801,"scriptSizeBytes":387} +ops.* {"exBudgetCPU":58941426,"exBudgetMemory":146577,"scriptSizeBytes":446} +ops.harmonic-sum {"exBudgetCPU":86536919,"exBudgetMemory":213055,"scriptSizeBytes":449} +ops.multi-product {"exBudgetCPU":97670895,"exBudgetMemory":244889,"scriptSizeBytes":472} +compare {"exBudgetCPU":27607475,"exBudgetMemory":70877,"scriptSizeBytes":372} +round.5/3 {"exBudgetCPU":18064406,"exBudgetMemory":40349,"scriptSizeBytes":375} +round.4/3 {"exBudgetCPU":16608457,"exBudgetMemory":37246,"scriptSizeBytes":375} +round.-5/2 {"exBudgetCPU":17865920,"exBudgetMemory":39849,"scriptSizeBytes":389} +round.-1/4 {"exBudgetCPU":16975934,"exBudgetMemory":37948,"scriptSizeBytes":389} +truncate.5/4 {"exBudgetCPU":14035101,"exBudgetMemory":34139,"scriptSizeBytes":325} +truncate.7/4 {"exBudgetCPU":15491050,"exBudgetMemory":37242,"scriptSizeBytes":325} +truncate.1/4 {"exBudgetCPU":12579152,"exBudgetMemory":31036,"scriptSizeBytes":325} +truncate.-7/4 {"exBudgetCPU":17612953,"exBudgetMemory":41449,"scriptSizeBytes":340} +properFraction.-1/2 {"exBudgetCPU":41051385,"exBudgetMemory":103922,"scriptSizeBytes":506} +properFraction.-3/2 {"exBudgetCPU":42874811,"exBudgetMemory":107727,"scriptSizeBytes":508} +properFraction.-4/3 {"exBudgetCPU":42874811,"exBudgetMemory":107727,"scriptSizeBytes":508} +data.id.0.5 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} +data.id.2 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} +data.id.11/3 {"exBudgetCPU":14038637,"exBudgetMemory":34139,"scriptSizeBytes":280} +div by 0.1/0 {"exBudgetCPU":687723,"exBudgetMemory":138,"scriptSizeBytes":280} +div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":76} +div by 0.1/(1-1) {"exBudgetCPU":9287297,"exBudgetMemory":20170,"scriptSizeBytes":359} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.uplc.eval.golden b/plutarch-test/goldens/rational.dev=true.uplc.eval.golden index 7043e1a1d..07186d02c 100644 --- a/plutarch-test/goldens/rational.dev=true.uplc.eval.golden +++ b/plutarch-test/goldens/rational.dev=true.uplc.eval.golden @@ -1,9 +1,9 @@ literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 4 4)) (multiplyInteger 1 (divideInteger 4 4)))) -ops.- (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) -ops.* (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 4 1)))) -ops.harmonic-sum (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 77 1)) (multiplyInteger 1 (divideInteger 60 1)))) -ops.multi-product (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 1 1)) (multiplyInteger 1 (divideInteger 6 1)))) +ops.+ (program 1.0.0 (\i0 -> i1 1 1)) +ops.- (program 1.0.0 (\i0 -> i1 1 6)) +ops.* (program 1.0.0 (\i0 -> i1 1 4)) +ops.harmonic-sum (program 1.0.0 (\i0 -> i1 77 60)) +ops.multi-product (program 1.0.0 (\i0 -> i1 1 6)) compare (program 1.0.0 True) round.5/3 (program 1.0.0 2) round.4/3 (program 1.0.0 1) @@ -18,7 +18,7 @@ properFraction.-3/2 (program 1.0.0 True) properFraction.-4/3 (program 1.0.0 True) data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 (\i0 -> i1 (multiplyInteger 1 (divideInteger 11 1)) (multiplyInteger 1 (divideInteger 3 1)))) +data.id.11/3 (program 1.0.0 (\i0 -> i1 11 3)) div by 0.1/0 (program 1.0.0 error) div by 0.recip 0 (program 1.0.0 error) div by 0.1/(1-1) (program 1.0.0 error) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.uplc.golden b/plutarch-test/goldens/rational.dev=true.uplc.golden index 91818aea0..1286b3eb3 100644 --- a/plutarch-test/goldens/rational.dev=true.uplc.golden +++ b/plutarch-test/goldens/rational.dev=true.uplc.golden @@ -1,24 +1,24 @@ -literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i7 (i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i14 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i14 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i14 i2 i1 (delay False)) (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i14 i1 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) -data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i7 (equalsInteger i2 0) (delay 0) (delay (force (i7 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i9 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i6 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 i2 i3))) (\i0 -> i1 0 1))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i15 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force ifThenElse))) \ No newline at end of file +literal (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 6)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 9)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 10))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +data.id.0.5 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) +data.id.2 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 i2 i3))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (i12 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index ad2e1cecd..4d2f33849 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -1,15 +1,15 @@ -unit {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":11} +unit {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":13} bool.true {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":33} bool.false {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":33} -int.0 {"exBudgetCPU":5982998,"exBudgetMemory":14021,"scriptSizeBytes":317} -int.5 {"exBudgetCPU":8810443,"exBudgetMemory":20031,"scriptSizeBytes":317} -int.-5 {"exBudgetCPU":9431574,"exBudgetMemory":20836,"scriptSizeBytes":317} -int.10 {"exBudgetCPU":11891916,"exBudgetMemory":26051,"scriptSizeBytes":317} -int.-10 {"exBudgetCPU":12513047,"exBudgetMemory":26856,"scriptSizeBytes":317} -int.14 {"exBudgetCPU":14153872,"exBudgetMemory":30859,"scriptSizeBytes":317} -int.-14 {"exBudgetCPU":14775003,"exBudgetMemory":31664,"scriptSizeBytes":317} -int.102 {"exBudgetCPU":18414677,"exBudgetMemory":39285,"scriptSizeBytes":318} -int.-102 {"exBudgetCPU":19035808,"exBudgetMemory":40090,"scriptSizeBytes":318} +int.0 {"exBudgetCPU":6396998,"exBudgetMemory":15821,"scriptSizeBytes":306} +int.5 {"exBudgetCPU":9224443,"exBudgetMemory":21831,"scriptSizeBytes":306} +int.-5 {"exBudgetCPU":9983574,"exBudgetMemory":23236,"scriptSizeBytes":306} +int.10 {"exBudgetCPU":12581916,"exBudgetMemory":29051,"scriptSizeBytes":306} +int.-10 {"exBudgetCPU":13341047,"exBudgetMemory":30456,"scriptSizeBytes":306} +int.14 {"exBudgetCPU":14843872,"exBudgetMemory":33859,"scriptSizeBytes":306} +int.-14 {"exBudgetCPU":15603003,"exBudgetMemory":35264,"scriptSizeBytes":306} +int.102 {"exBudgetCPU":19380677,"exBudgetMemory":43485,"scriptSizeBytes":307} +int.-102 {"exBudgetCPU":20139808,"exBudgetMemory":44890,"scriptSizeBytes":307} bytestring.empty {"exBudgetCPU":2593943,"exBudgetMemory":9918,"scriptSizeBytes":414} bytestring.1 {"exBudgetCPU":10473299,"exBudgetMemory":27270,"scriptSizeBytes":416} bytestring.2 {"exBudgetCPU":29710789,"exBudgetMemory":68664,"scriptSizeBytes":417} @@ -22,14 +22,14 @@ str.quoted {"exBudgetCPU":30518590,"exBudgetMemory":72910,"scriptSizeBytes":138} str.slash {"exBudgetCPU":23919293,"exBudgetMemory":57643,"scriptSizeBytes":136} str.unicode {"exBudgetCPU":33189676,"exBudgetMemory":79932,"scriptSizeBytes":139} str.unicode-quoted {"exBudgetCPU":40139276,"exBudgetMemory":95604,"scriptSizeBytes":141} -maybe.nothing {"exBudgetCPU":1127100,"exBudgetMemory":5000,"scriptSizeBytes":354} -maybe.just {"exBudgetCPU":15447308,"exBudgetMemory":34080,"scriptSizeBytes":356} -either.right {"exBudgetCPU":15540485,"exBudgetMemory":34381,"scriptSizeBytes":370} -maybe.either {"exBudgetCPU":17345450,"exBudgetMemory":37542,"scriptSizeBytes":431} -list.nil {"exBudgetCPU":2825985,"exBudgetMemory":11343,"scriptSizeBytes":410} -list.1 {"exBudgetCPU":9659511,"exBudgetMemory":26464,"scriptSizeBytes":411} -list.1,2,3 {"exBudgetCPU":27175986,"exBudgetMemory":66756,"scriptSizeBytes":413} -builtinlist.nil {"exBudgetCPU":2618985,"exBudgetMemory":10443,"scriptSizeBytes":401} -builtinlist.1,2,3 {"exBudgetCPU":25171058,"exBudgetMemory":56284,"scriptSizeBytes":404} -pair.int-str {"exBudgetCPU":34106639,"exBudgetMemory":77405,"scriptSizeBytes":464} -pair.int-list {"exBudgetCPU":40738700,"exBudgetMemory":86414,"scriptSizeBytes":443} \ No newline at end of file +maybe.nothing {"exBudgetCPU":1265100,"exBudgetMemory":5600,"scriptSizeBytes":342} +maybe.just {"exBudgetCPU":16206308,"exBudgetMemory":37380,"scriptSizeBytes":347} +either.right {"exBudgetCPU":16299485,"exBudgetMemory":37681,"scriptSizeBytes":360} +maybe.either {"exBudgetCPU":18173450,"exBudgetMemory":41142,"scriptSizeBytes":423} +list.nil {"exBudgetCPU":2963985,"exBudgetMemory":11943,"scriptSizeBytes":397} +list.1 {"exBudgetCPU":10073511,"exBudgetMemory":28264,"scriptSizeBytes":398} +list.1,2,3 {"exBudgetCPU":28141986,"exBudgetMemory":70956,"scriptSizeBytes":401} +builtinlist.nil {"exBudgetCPU":2756985,"exBudgetMemory":11043,"scriptSizeBytes":389} +builtinlist.1,2,3 {"exBudgetCPU":26137058,"exBudgetMemory":60484,"scriptSizeBytes":392} +pair.int-str {"exBudgetCPU":34865639,"exBudgetMemory":80705,"scriptSizeBytes":454} +pair.int-list {"exBudgetCPU":42325700,"exBudgetMemory":93314,"scriptSizeBytes":434} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.bench.golden b/plutarch-test/goldens/show.dev=true.bench.golden index c78c3c541..325204863 100644 --- a/plutarch-test/goldens/show.dev=true.bench.golden +++ b/plutarch-test/goldens/show.dev=true.bench.golden @@ -1 +1 @@ -rational.1/2 {"exBudgetCPU":23554887,"exBudgetMemory":53494,"scriptSizeBytes":595} \ No newline at end of file +rational.1/2 {"exBudgetCPU":25003887,"exBudgetMemory":59794,"scriptSizeBytes":560} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.uplc.golden b/plutarch-test/goldens/show.dev=true.uplc.golden index 328405ea7..e395a2a0d 100644 --- a/plutarch-test/goldens/show.dev=true.uplc.golden +++ b/plutarch-test/goldens/show.dev=true.uplc.golden @@ -1 +1 @@ -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i22 (equalsInteger i2 0) (delay 0) (delay (force (i22 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i28 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i24 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i23 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (force (i22 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i21 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i24 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (i14 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse))) \ No newline at end of file +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i24 (equalsInteger i2 0) (delay 0) (delay (force (i24 (lessThanEqualsInteger i2 0) (delay (i23 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i30 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i26 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i25 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i22 i2)) (i21 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i14 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) "-") "") (\i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (force (i15 (equalsInteger i1 1) (delay i3) (delay (force (i15 (equalsInteger i1 2) (delay i4) (delay (force (i15 (equalsInteger i1 3) (delay i5) (delay (force (i15 (equalsInteger i1 4) (delay i6) (delay (force (i15 (equalsInteger i1 5) (delay i7) (delay (force (i15 (equalsInteger i1 6) (delay i8) (delay (force (i15 (equalsInteger i1 7) (delay i9) (delay (force (i15 (equalsInteger i1 8) (delay i10) (delay (force (i15 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index f8fcfce97..0fde74b37 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -1,15 +1,15 @@ -unit (program 1.0.0 "()") +unit (program 1.0.0 ((\i0 -> "()") ())) bool.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay "PTrue") (delay "PFalse"))) True)) bool.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay "PTrue") (delay "PFalse"))) False)) -int.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 0) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -int.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -int.-5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -5) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -int.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 10) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -int.-10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -10) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -int.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 14) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -int.-14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -14) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -int.102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) 102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -int.-102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i14 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (force (i15 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i14 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) -102) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +int.0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (i15 i2) 10)) (quotientInteger (i14 i1) 10))) 0) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +int.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (i15 i2) 10)) (quotientInteger (i14 i1) 10))) 5) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +int.-5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (i15 i2) 10)) (quotientInteger (i14 i1) 10))) -5) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +int.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (i15 i2) 10)) (quotientInteger (i14 i1) 10))) 10) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +int.-10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (i15 i2) 10)) (quotientInteger (i14 i1) 10))) -10) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +int.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (i15 i2) 10)) (quotientInteger (i14 i1) 10))) 14) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +int.-14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (i15 i2) 10)) (quotientInteger (i14 i1) 10))) -14) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +int.102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (i15 i2) 10)) (quotientInteger (i14 i1) 10))) 102) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +int.-102 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i5 i1)) (delay ((\i0 -> appendString i1 (i6 i2)) (i4 i2))))) (remainderInteger (i15 i2) 10)) (quotientInteger (i14 i1) 10))) -102) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) bytestring.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) bytestring.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #14) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) bytestring.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "0x" ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i5)) (indexByteString i4 0))))) (lengthOfByteString i3)) "" (\i0 -> \i0 -> appendString ((\i0 -> (\i0 -> appendString (i8 i2) (i8 i1)) (remainderInteger i3 16)) (quotientInteger i2 16)) (i4 i1))) i1)) #14af) (\i0 -> force (i17 (equalsInteger i1 0) (delay i2) (delay (force (i17 (equalsInteger i1 1) (delay i3) (delay (force (i17 (equalsInteger i1 2) (delay i4) (delay (force (i17 (equalsInteger i1 3) (delay i5) (delay (force (i17 (equalsInteger i1 4) (delay i6) (delay (force (i17 (equalsInteger i1 5) (delay i7) (delay (force (i17 (equalsInteger i1 6) (delay i8) (delay (force (i17 (equalsInteger i1 7) (delay i9) (delay (force (i17 (equalsInteger i1 8) (delay i10) (delay (force (i17 (equalsInteger i1 9) (delay i11) (delay (force (i17 (equalsInteger i1 10) (delay i12) (delay (force (i17 (equalsInteger i1 11) (delay i13) (delay (force (i17 (equalsInteger i1 12) (delay i14) (delay (force (i17 (equalsInteger i1 13) (delay i15) (delay (force (i17 (equalsInteger i1 14) (delay i16) (delay (force (i17 (equalsInteger i1 15) (delay i18) (delay error))))))))))))))))))))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") "a") "b") "c") "d") "e") (force ifThenElse)) "f")) @@ -22,14 +22,14 @@ str.quoted (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString str.slash (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "foo\\bar") (force ifThenElse)) "\"")) str.unicode (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "vis-\224-vis") (force ifThenElse)) "\"")) str.unicode-quoted (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> appendString i3 (appendString (decodeUtf8 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i6 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i3)) "vis-\"\224\"-vis") (force ifThenElse)) "\"")) -maybe.nothing (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> force i1)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -maybe.just (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (force (i17 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i16 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> i2 42)) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) -maybe.either (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString i16 (i1 (\i0 -> appendString i16 (appendString (appendString "PLeft" (appendString i17 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1))) i18)) (\i0 -> appendString i16 (appendString (appendString "PRight" (appendString i17 "()")) i18))))) (delay "PNothing")) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i2 42))) (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "(") " ") ")")) -list.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -list.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i17 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i18)) i1) "]")) (i16 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3])) (i15 (\i0 -> \i0 -> appendString (force (i15 (lessThanInteger i1 0) (delay i3) (delay i16))) ((\i0 -> (\i0 -> force (i17 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (force (i16 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i15 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) "-") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) -builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) []) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) -builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i22 i2))) (delay (appendString (i6 (i22 i2)) (appendString ", " (i3 (i23 i2))))))) (i22 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) -pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i15 (appendString (i16 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i20 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i19 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i2) (appendString i15 (appendString i18 (appendString (decodeUtf8 (i16 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i21 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i18))))))) (\i0 -> i1 42 "hello")) (\i0 -> force (i14 (equalsInteger i1 0) (delay i2) (delay (force (i14 (equalsInteger i1 1) (delay i3) (delay (force (i14 (equalsInteger i1 2) (delay i4) (delay (force (i14 (equalsInteger i1 3) (delay i5) (delay (force (i14 (equalsInteger i1 4) (delay i6) (delay (force (i14 (equalsInteger i1 5) (delay i7) (delay (force (i14 (equalsInteger i1 6) (delay i8) (delay (force (i14 (equalsInteger i1 7) (delay i9) (delay (force (i14 (equalsInteger i1 8) (delay i10) (delay (force (i14 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") " ") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse)) "\"")) -pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i25 i2))) (delay (appendString (i9 (i25 i2)) (appendString ", " (i3 (i26 i2))))))) (i25 i1))))) i1) "]"))))))) (\i0 -> i1 42 [1,2,3])) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse)) (force headList)) (force tailList))) \ No newline at end of file +maybe.nothing (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i17 i2) 10)) (quotientInteger (i16 i1) 10))) i1))) (delay "PNothing")) (\i0 -> \i0 -> force i1)) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +maybe.just (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString " " ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i17 i2) 10)) (quotientInteger (i16 i1) 10))) i1))) (delay "PNothing")) ((\i0 -> \i0 -> \i0 -> i2 i3) 42)) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +either.right (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))) i1)))) ((\i0 -> \i0 -> \i0 -> i1 i3) 42)) " ") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +maybe.either (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> appendString "PJust" (appendString i18 (i1 (\i0 -> appendString i18 (appendString (appendString "PLeft" (appendString i19 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))) i1))) i20)) (\i0 -> appendString i18 (appendString (appendString "PRight" (appendString i19 "()")) i20))))) (delay "PNothing")) ((\i0 -> \i0 -> \i0 -> i2 i3) ((\i0 -> \i0 -> \i0 -> i2 i3) 42))) (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) "(") " ") ")")) +list.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i19 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i20)) i1) "]")) (i18 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [])) (i17 (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay i3) (delay i18))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (i16 i2) 10)) (quotientInteger (i15 i1) 10))))) "-") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +list.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i19 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i20)) i1) "]")) (i18 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1])) (i17 (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay i3) (delay i18))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (i16 i2) 10)) (quotientInteger (i15 i1) 10))))) "-") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i19 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> i1 (\i0 -> \i0 -> appendString (i8 i4) (appendString ", " (i6 i3))) (delay (i6 i2))) (delay i20)) i1) "]")) (i18 (\i0 -> \i0 -> force (force (force chooseList) i1 (delay (\i0 -> \i0 -> force i1)) (delay ((\i0 -> \i0 -> \i0 -> \i0 -> i2 i4 i3) (force headList i1) (i2 (force tailList i1)))))) [1,2,3])) (i17 (\i0 -> \i0 -> appendString (force (i16 (lessThanInteger i1 0) (delay i3) (delay i18))) ((\i0 -> (\i0 -> force (i18 (equalsInteger i2 0) (delay (i6 i1)) (delay ((\i0 -> appendString i1 (i7 i2)) (i4 i2))))) (remainderInteger (i16 i2) 10)) (quotientInteger (i15 i1) 10))))) "-") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) "") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))))) +builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i24 i2))) (delay (appendString (i6 (i24 i2)) (appendString ", " (i3 (i25 i2))))))) (i24 i1))))) i1) "]")) []) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) +builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i24 i2))) (delay (appendString (i6 (i24 i2)) (appendString ", " (i3 (i25 i2))))))) (i24 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) +pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i17 (appendString (i18 (\i0 -> \i0 -> appendString (force (i21 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i23 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))) i2) (appendString i17 (appendString i20 (appendString (decodeUtf8 (i18 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i23 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i20))))))) ((\i0 -> \i0 -> i1 i2 "hello") 42)) (\i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (force (i16 (equalsInteger i1 1) (delay i3) (delay (force (i16 (equalsInteger i1 2) (delay i4) (delay (force (i16 (equalsInteger i1 3) (delay i5) (delay (force (i16 (equalsInteger i1 4) (delay i6) (delay (force (i16 (equalsInteger i1 5) (delay i7) (delay (force (i16 (equalsInteger i1 6) (delay i8) (delay (force (i16 (equalsInteger i1 7) (delay i9) (delay (force (i16 (equalsInteger i1 8) (delay i10) (delay (force (i16 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i5 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) " ") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse)) "\"")) +pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i27 i2))) (delay (appendString (i9 (i27 i2)) (appendString ", " (i3 (i28 i2))))))) (i27 i1))))) i1) "]"))))))) ((\i0 -> \i0 -> i1 i2 [1,2,3]) 42)) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.bench.golden b/plutarch-test/goldens/trace.dev=true.bench.golden index 228f67498..8ca483b2c 100644 --- a/plutarch-test/goldens/trace.dev=true.bench.golden +++ b/plutarch-test/goldens/trace.dev=true.bench.golden @@ -1,6 +1,6 @@ ptrace.one {"exBudgetCPU":396442,"exBudgetMemory":932,"scriptSizeBytes":16} ptrace.two {"exBudgetCPU":815784,"exBudgetMemory":1864,"scriptSizeBytes":30} -ptraceShowId.right-42 {"exBudgetCPU":15913827,"exBudgetMemory":35113,"scriptSizeBytes":379} +ptraceShowId.right-42 {"exBudgetCPU":16741827,"exBudgetMemory":38713,"scriptSizeBytes":373} ptraceIfTrue.true {"exBudgetCPU":706998,"exBudgetMemory":1933,"scriptSizeBytes":27} ptraceIfTrue.false {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":27} ptraceIfFalse.true {"exBudgetCPU":379656,"exBudgetMemory":1401,"scriptSizeBytes":27} diff --git a/plutarch-test/goldens/trace.dev=true.uplc.golden b/plutarch-test/goldens/trace.dev=true.uplc.golden index 5a77c4925..e1625b0be 100644 --- a/plutarch-test/goldens/trace.dev=true.uplc.golden +++ b/plutarch-test/goldens/trace.dev=true.uplc.golden @@ -1,6 +1,6 @@ ptrace.one (program 1.0.0 (force (force trace "foo" (delay ())))) ptrace.two (program 1.0.0 ((\i0 -> force (i1 "foo" (delay (force (i1 "bar" (delay ())))))) (force trace))) -ptraceShowId.right-42 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force trace ((\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i17 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i19 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (force (i18 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))) 10)) (quotientInteger (force (i17 (lessThanEqualsInteger i1 (subtractInteger 0 1)) (delay (subtractInteger 0 i1)) (delay i1))) 10))) i1)))) (\i0 -> \i0 -> i1 42)) (delay (\i0 -> \i0 -> i1 42)))) " ") (\i0 -> force (i12 (equalsInteger i1 0) (delay i2) (delay (force (i12 (equalsInteger i1 1) (delay i3) (delay (force (i12 (equalsInteger i1 2) (delay i4) (delay (force (i12 (equalsInteger i1 3) (delay i5) (delay (force (i12 (equalsInteger i1 4) (delay i6) (delay (force (i12 (equalsInteger i1 5) (delay i7) (delay (force (i12 (equalsInteger i1 6) (delay i8) (delay (force (i12 (equalsInteger i1 7) (delay i9) (delay (force (i12 (equalsInteger i1 8) (delay i10) (delay (force (i12 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (force ifThenElse))) +ptraceShowId.right-42 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (force trace ((\i0 -> i1 (\i0 -> appendString "PLeft" (appendString i3 "()")) (\i0 -> appendString "PRight" (appendString i3 ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))) i1)))) ((\i0 -> \i0 -> \i0 -> i1 i3) 42)) (delay ((\i0 -> \i0 -> \i0 -> i1 i3) 42)))) " ") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) ptraceIfTrue.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) True)) ptraceIfTrue.false (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay (force trace "foo" i1)) (delay i1))) False)) ptraceIfFalse.true (program 1.0.0 ((\i0 -> force (force ifThenElse i1 (delay i1) (delay (force trace "foo" i1)))) True)) diff --git a/plutarch-test/goldens/unit.bench.golden b/plutarch-test/goldens/unit.bench.golden index 172f52e91..cd41099b4 100644 --- a/plutarch-test/goldens/unit.bench.golden +++ b/plutarch-test/goldens/unit.bench.golden @@ -1,5 +1,5 @@ pcon {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -pmatch {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -compare.== {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -compare.< {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} -compare.<= {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":6} \ No newline at end of file +pmatch {"exBudgetCPU":92100,"exBudgetMemory":500,"scriptSizeBytes":8} +compare.== {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":10} +compare.< {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":10} +compare.<= {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":10} \ No newline at end of file diff --git a/plutarch-test/goldens/unit.uplc.golden b/plutarch-test/goldens/unit.uplc.golden index 25660b104..e282c9cd3 100644 --- a/plutarch-test/goldens/unit.uplc.golden +++ b/plutarch-test/goldens/unit.uplc.golden @@ -1,5 +1,5 @@ pcon (program 1.0.0 ()) -pmatch (program 1.0.0 True) -compare.== (program 1.0.0 True) -compare.< (program 1.0.0 False) -compare.<= (program 1.0.0 True) \ No newline at end of file +pmatch (program 1.0.0 ((\i0 -> True) ())) +compare.== (program 1.0.0 ((\i0 -> (\i0 -> True) ()) ())) +compare.< (program 1.0.0 ((\i0 -> (\i0 -> False) ()) ())) +compare.<= (program 1.0.0 ((\i0 -> (\i0 -> True) ()) ())) \ No newline at end of file From 0222fc6019b8aff500516f25a9bad258c868ede3 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Tue, 28 Jun 2022 20:08:21 +0200 Subject: [PATCH 521/584] set -Wno-unrecognised-warning-flags --- plutarch-extra/plutarch-extra.cabal | 2 +- plutarch-test/plutarch-test.cabal | 2 +- plutarch.cabal | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index 2c372f042..d0e97bb1c 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -64,7 +64,7 @@ common c -Wno-partial-type-signatures -Wmissing-export-lists -Werror -Wincomplete-record-updates -Wmissing-deriving-strategies -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls - -fprint-explicit-kinds + -fprint-explicit-kinds -Wno-unrecognised-warning-flags common deps build-depends: diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 918b2bf13..c137aa7b3 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -75,7 +75,7 @@ common c -Wno-partial-type-signatures -Wmissing-export-lists -Werror -Wincomplete-record-updates -Wmissing-deriving-strategies -Wno-name-shadowing -Wunused-foralls -fprint-explicit-foralls - -fprint-explicit-kinds + -fprint-explicit-kinds -Wno-unrecognised-warning-flags common deps build-depends: diff --git a/plutarch.cabal b/plutarch.cabal index 5b618fd9a..bcba2fc9d 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -75,6 +75,7 @@ common c -Wno-missing-import-lists -fprint-explicit-foralls -fprint-equality-relations -fprint-explicit-kinds -fprint-explicit-coercions -Wno-all-missed-specializations + -Wno-unrecognised-warning-flags library import: c From ca38fdc6b987ae8278f121ffad431b91c86e9177 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Tue, 28 Jun 2022 20:26:10 +0200 Subject: [PATCH 522/584] revert change that broke 8.10 --- Plutarch/DataRepr/Internal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 040e74d64..77c93c025 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -376,7 +376,7 @@ instance PlutusTypeStrat PlutusTypeData where type PlutusTypeStratConstraint PlutusTypeData = PlutusTypeDataConstraint type DerivedPInner PlutusTypeData a = PDataSum (IsPDataSumDefs (PCode a)) derivedPCon x = pcon $ toSum $ gpfrom x - derivedPMatch x f = pmatch x (f . gpto . fromSum) + derivedPMatch x f = pmatch x (\y -> f $ gpto $ fromSum $ y) newtype DualReprHandler s out def = DualRepr (Term s (PDataRecord def) -> Term s (PDataRecord def) -> Term s out) From 12f4e5e75d5fafee0c3e717868dd62716bdd1d94 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Tue, 28 Jun 2022 23:08:06 +0200 Subject: [PATCH 523/584] added ghc810 devShell --- flake.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 85237aad2..2b05bff43 100644 --- a/flake.nix +++ b/flake.nix @@ -498,6 +498,7 @@ flake = perSystem (system: self.project.${system}.flake { }); haddockProject = self.project; + ghc810Flake = perSystem (system: self.projectMatrix.ghc810.${system}.flake { }); packages = perSystem (system: self.flake.${system}.packages // { haddock = haddock system; @@ -510,8 +511,8 @@ formatCheck = formatCheckFor system; test-ghc9 = flakeApp2Derivation system "test-ghc9"; test-ghc810 = flakeApp2Derivation system "test-ghc810"; - "ghc810-plutarch:lib:plutarch" = (self.projectMatrix.ghc810.${system}.flake { }).packages."plutarch:lib:plutarch"; - "ghc810-plutarch:lib:plutarch-test" = (self.projectMatrix.ghc810.${system}.flake { }).packages."plutarch-test:lib:plutarch-test"; + "ghc810-plutarch:lib:plutarch" = (self.ghc810Flake.${system}).packages."plutarch:lib:plutarch"; + "ghc810-plutarch:lib:plutarch-test" = (self.ghc810Flake.${system}).packages."plutarch-test:lib:plutarch-test"; hls = checkedShellScript system "hls" "${self.project.${system}.pkgs.haskell-language-server}/bin/haskell-language-server"; }); # Because `nix flake check` does not work with haskell.nix (due to IFD), @@ -539,7 +540,14 @@ website = plutarchWebsiteLive system "${self}/docs"; } ); - devShell = perSystem (system: self.flake.${system}.devShell); + + devShells = perSystem (system: + { + "ghc810" = self.ghc810Flake.${system}.devShell; + "ghc9" = self.flake.${system}.devShell; + }); + + devShell = perSystem (system: self.devShells.${system}."ghc9"); effects = { ref, ... }: let From 076d3e49cee40d3c560b04bbad7a684e22c291ea Mon Sep 17 00:00:00 2001 From: mangoiv Date: Wed, 29 Jun 2022 00:46:25 +0200 Subject: [PATCH 524/584] fix haskell-language-server in ghc8107 devShell --- flake.nix | 64 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/flake.nix b/flake.nix index 2b05bff43..5f0e58465 100644 --- a/flake.nix +++ b/flake.nix @@ -102,8 +102,7 @@ "xhtml" ]; - hlsFor' = compiler-nix-name: system: - let pkgs = pkgsFor system; in + hlsFor' = compiler-nix-name: pkgs: pkgs.haskell-nix.cabalProject' { modules = [{ inherit nonReinstallablePkgs; @@ -113,7 +112,18 @@ src = "${inputs.haskell-language-server}"; sha256map."https://github.com/pepeiborra/ekg-json"."7a0af7a8fd38045fd15fb13445bdcc7085325460" = "fVwKxGgM0S4Kv/4egVAAiAjV7QB5PBqMVMCfsv7otIQ="; }; - hlsFor = compiler-nix-name: system: (hlsFor' compiler-nix-name system).hsPkgs.haskell-language-server.components.exes.haskell-language-server; + hlsFor = compiler-nix-name: system: + let + pkgs = pkgsFor system; + oldGhc = "8107"; + in + if (compiler-nix-name == "ghc${oldGhc}") then + pkgs.haskell-language-server.override + { + supportedGhcVersions = [ oldGhc ]; + } + else + (hlsFor' compiler-nix-name pkgs).hsPkgs.haskell-language-server.components.exes.haskell-language-server; haskellModules = [ ({ config, pkgs, hsPkgs, ... }: { @@ -347,29 +357,31 @@ }; projectForGhc = compiler-nix-name: system: - let pkgs = pkgsFor system; in - let pkgs' = pkgsFor' system; in - let pkgSet = pkgs.haskell-nix.cabalProject' (applyPlutarchDep pkgs { - src = ./.; - inherit compiler-nix-name; - shell = { - withHoogle = true; - - exactDeps = true; - - # We use the ones from Nixpkgs, since they are cached reliably. - # Eventually we will probably want to build these with haskell.nix. - nativeBuildInputs = [ - pkgs'.cabal-install - pkgs'.hlint - pkgs'.haskellPackages.cabal-fmt - (fourmoluFor system) - pkgs'.nixpkgs-fmt - pkgSet.hsPkgs.hspec-discover.components.exes.hspec-discover - (hlsFor compiler-nix-name system) - ]; - }; - }); in + let + pkgs = pkgsFor system; + pkgs' = pkgsFor' system; + pkgSet = pkgs.haskell-nix.cabalProject' (applyPlutarchDep pkgs { + src = ./.; + inherit compiler-nix-name; + shell = { + withHoogle = true; + + exactDeps = true; + + # We use the ones from Nixpkgs, since they are cached reliably. + # Eventually we will probably want to build these with haskell.nix. + nativeBuildInputs = [ + pkgs'.cabal-install + pkgs'.hlint + pkgs'.haskellPackages.cabal-fmt + (fourmoluFor system) + pkgs'.nixpkgs-fmt + pkgSet.hsPkgs.hspec-discover.components.exes.hspec-discover + (hlsFor compiler-nix-name system) + ]; + }; + }); + in pkgSet; projectFor = projectForGhc defaultGhcVersion; From ff6afc680b09b42f2f2108fd9ab9ca807bd02707 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 29 Jun 2022 11:00:43 +0000 Subject: [PATCH 525/584] Remove `punsafeAsClosedTerm` again --- Plutarch/Internal.hs | 4 ---- plutarch-test/common/Plutarch/Test/Golden.hs | 11 +++++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 773da7abf..8c08f34e1 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -15,7 +15,6 @@ module Plutarch.Internal ( pforce, phoistAcyclic, perror, - punsafeAsClosedTerm, punsafeCoerce, punsafeBuiltin, punsafeConstant, @@ -388,9 +387,6 @@ subst idx _ y@(UPLC.Var () (DeBruijn (Index idx'))) | idx > idx' = y subst idx _ (UPLC.Var () (DeBruijn (Index idx'))) | idx < idx' = UPLC.Var () (DeBruijn . Index $ idx' - 1) subst _ _ y = y -punsafeAsClosedTerm :: forall s a. Term s a -> ClosedTerm a -punsafeAsClosedTerm (Term t) = Term t - rawTermToUPLC :: (HoistedTerm -> Word64 -> UPLC.Term DeBruijn UPLC.DefaultUni UPLC.DefaultFun ()) -> Word64 -> diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index 5e0fb7774..c5297d647 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -48,7 +48,6 @@ import Data.Set (Set) import qualified Data.Set as S import Plutarch (Config (Config, tracingMode), compile, printScript, pattern DetTracing) import Plutarch.Evaluate (evalScript) -import Plutarch.Internal (punsafeAsClosedTerm) import Plutarch.Prelude import Plutarch.Test.Benchmark (Benchmark, mkBenchmark, scriptSize) import Plutarch.Test.ListSyntax (ListSyntax, listSyntaxAdd, listSyntaxAddSubList, runListSyntax) @@ -105,20 +104,20 @@ mkGoldenValue' p mexp = -- `ClosedTerm a`. In practice, this instance should be used only for closed -- terms. instance HasGoldenValue Term where - mkGoldenValue p = mkGoldenValue' (punsafeAsClosedTerm p) Nothing + mkGoldenValue p = mkGoldenValue' p Nothing {- | A `Term` paired with its evaluation/benchmark expectation Example: >>> TermExpectation (pcon PTrue) $ \(p, _script, _benchmark) -> pshouldBe (pcon PTrue) -} -data TermExpectation' s a = TermExpectation (Term s a) ((Term s a, Script, Benchmark) -> Expectation) +data TermExpectation' (s :: S) a = TermExpectation (ClosedTerm a) ((ClosedTerm a, Script, Benchmark) -> Expectation) type TermExpectation a = forall s. TermExpectation' s a -- | Test an expectation on a golden Plutarch program (@->) :: ClosedTerm a -> (ClosedTerm a -> Expectation) -> TermExpectation a -(@->) p f = p @:-> \(p', _, _) -> f $ punsafeAsClosedTerm p' +(@->) p f = p @:-> \(p', _, _) -> f p' infixr 1 @-> @@ -130,13 +129,13 @@ infixr 1 @-> re-evaluating the program). -} (@:->) :: ClosedTerm a -> ((ClosedTerm a, Script, Benchmark) -> Expectation) -> TermExpectation a -(@:->) p f = TermExpectation p (\(p', pe, b) -> f (punsafeAsClosedTerm p', pe, b)) +(@:->) p f = TermExpectation p (\(p', pe, b) -> f (p', pe, b)) infixr 1 @:-> instance HasGoldenValue TermExpectation' where mkGoldenValue (TermExpectation p f) = - mkGoldenValue' (punsafeAsClosedTerm p) (Just $ (\pe b -> f (p, pe, b))) + mkGoldenValue' p (Just $ (\pe b -> f (p, pe, b))) -- | The key used in the .golden files containing multiple golden values newtype GoldenKey = GoldenKey Text From e8be176f275fd26307eb134cf2dcb18cf5df6e49 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Wed, 29 Jun 2022 17:22:40 +0200 Subject: [PATCH 526/584] fixed some bugs in ghc810 and simplified some stuff but it's still broken and will be for now --- Plutarch/Internal/Generic.hs | 11 ++++++++--- Plutarch/Internal/ScottEncoding.hs | 15 ++++++++------- plutarch.cabal | 1 + 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Plutarch/Internal/Generic.hs b/Plutarch/Internal/Generic.hs index e55bd986b..438ffe613 100644 --- a/Plutarch/Internal/Generic.hs +++ b/Plutarch/Internal/Generic.hs @@ -7,11 +7,14 @@ module Plutarch.Internal.Generic ( -- * Plutarch adapters for generics-sop API PGeneric, + PGeneric', PCode, gpfrom, gpto, ) where +-- lol +import Data.Constraint (Dict (Dict)) import Data.Kind (Constraint) import GHC.Exts (Any) import GHC.Generics (Generic) @@ -19,7 +22,7 @@ import Generics.SOP (All2, I, SOP, Top) import Generics.SOP.GGP (GCode, GDatatypeInfo, GFrom, GTo, gfrom, gto) import Plutarch.Internal (PType, S, Term) import Plutarch.Internal.TypeFamily (ToPType2) -import Unsafe.Coerce (unsafeCoerce) -- lol +import Unsafe.Coerce (unsafeCoerce) class GFrom a => GFrom' a instance GFrom a => GFrom' a @@ -61,9 +64,11 @@ type PCode a = ToPType2 (GCode (a Any)) gpfrom :: forall a s. PGeneric a => a s -> SOP (Term s) (PCode a) -- This could be done safely, but it's a PITA. -- Depends on `All` constraint above. -gpfrom x = unsafeCoerce $ (gfrom x :: SOP I (GCode (a s))) +gpfrom x = case (Dict :: Dict (PGeneric' a s)) of + Dict -> unsafeCoerce (gfrom x :: SOP I (GCode (a s))) gpto :: forall a s. PGeneric a => SOP (Term s) (PCode a) -> a s -- This could be done safely, but it's a PITA. -- Depends on `All` constraint above. -gpto x = gto (unsafeCoerce x :: SOP I (GCode (a s))) +gpto x = case (Dict :: Dict (PGeneric' a s)) of + Dict -> gto (unsafeCoerce x :: SOP I (GCode (a s))) diff --git a/Plutarch/Internal/ScottEncoding.hs b/Plutarch/Internal/ScottEncoding.hs index 59df0fe98..65aba9f33 100644 --- a/Plutarch/Internal/ScottEncoding.hs +++ b/Plutarch/Internal/ScottEncoding.hs @@ -10,6 +10,7 @@ import Generics.SOP ( NP (Nil, (:*)), NS (S, Z), SListI, + SListI2, SOP (SOP), case_SList, cpara_SList, @@ -101,7 +102,7 @@ newtype GPCon' s r as = GPCon' {unGPCon' :: NP (Term s) (ScottList as r) -> NS ( The partial encoding is any tail of the full scott encoded function, such that one of its elements corresponds to the sum choice. -} -gpcon' :: All SListI as => NP (Term s) (ScottList as r) -> NS (NP (Term s)) as -> Term s r +gpcon' :: SListI2 as => NP (Term s) (ScottList as r) -> NS (NP (Term s)) as -> Term s r gpcon' = unGPCon' $ cpara_SList (Proxy @SListI) (GPCon' \Nil -> \case {}) \(GPCon' prev) -> GPCon' \(arg :* args) -> \case Z x -> pappL arg x S xs -> prev args xs @@ -109,7 +110,7 @@ gpcon' = unGPCon' $ cpara_SList (Proxy @SListI) (GPCon' \Nil -> \case {}) \(GPCo -- | Generic version of `pcon'` gpcon :: forall as r s. - (SListI (ScottList as r), All SListI as) => + (SListI (ScottList as r), SListI2 as) => SOP (Term s) as -> Term s (PScottEncoded as r) gpcon fields' = @@ -120,15 +121,15 @@ newtype GPMatch' s r as = GPMatch' {unGPMatch' :: (SOP (Term s) as -> Term s r) gpmatch' :: forall as r s. - All SListI as => + SListI2 as => (SOP (Term s) as -> Term s r) -> NP (Term s) (ScottList as r) -gpmatch' = unGPMatch' $ cpara_SList (Proxy @SListI) (GPMatch' \_ -> Nil) \(GPMatch' prev) -> GPMatch' \f -> +gpmatch' = unGPMatch' $ cpara_SList (Proxy @SListI) (GPMatch' (const Nil)) \(GPMatch' prev) -> GPMatch' \f -> plamL (\args -> f (SOP $ Z args)) :* prev (\(SOP x) -> f (SOP (S x))) gpmatch :: forall as r s. - (SListI (ScottList as r), All SListI as) => + (SListI (ScottList as r), SListI2 as) => Term s (PScottEncoded as r) -> (SOP (Term s) as -> Term s r) -> Term s r @@ -139,13 +140,13 @@ instance SListI (ScottList (PCode a) r) => SListIScottList a r class ( forall r. SListIScottList a r - , All SListI (PCode a) + , SListI2 (PCode a) , PGeneric a ) => PlutusTypeScottConstraint a instance ( forall r. SListIScottList a r - , All SListI (PCode a) + , SListI2 (PCode a) , PGeneric a ) => PlutusTypeScottConstraint a diff --git a/plutarch.cabal b/plutarch.cabal index bcba2fc9d..b49b919df 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -139,6 +139,7 @@ library build-depends: , base , bytestring + , constraints , containers , cryptonite , flat From cbc61ebe40a8de29c86dae9d9822d7cc6ed3aabf Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 2 Jul 2022 18:30:36 +0200 Subject: [PATCH 527/584] some more additions, commiting to save some other changes to another branch, revert this --- Plutarch/Api/V1.hs | 40 +++++++------- Plutarch/Api/V1/Scripts.hs | 24 +++++++++ Plutarch/Api/V2.hs | 12 +++++ Plutarch/Api/V2/Contexts.hs | 51 ++++++++++++++++++ Plutarch/Api/V2/EvaluationContext.hs | 0 Plutarch/Api/V2/ParamName.hs | 0 Plutarch/Api/V2/Tx.hs | 80 ++++++++++++++++++++++++++++ plutarch.cabal | 3 ++ 8 files changed, 190 insertions(+), 20 deletions(-) create mode 100644 Plutarch/Api/V2.hs create mode 100644 Plutarch/Api/V2/Contexts.hs create mode 100644 Plutarch/Api/V2/EvaluationContext.hs create mode 100644 Plutarch/Api/V2/ParamName.hs create mode 100644 Plutarch/Api/V2/Tx.hs diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 7ee79a599..74f07a609 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -99,8 +99,8 @@ import qualified Plutarch.Api.V1.Value as Value import Data.Coerce (coerce) -import qualified PlutusLedgerApi.V1 as Plutus -import qualified PlutusLedgerApi.V1.Scripts as Plutus +import qualified PlutusLedgerApi.V1 as PlutusV1 +import qualified PlutusLedgerApi.V1.Scripts as PlutusV1 import Plutarch (Config, compile) import Plutarch.Api.Internal.Hashing (hashData, hashScriptWithPrefix) @@ -122,41 +122,41 @@ type PMintingPolicy = PData :--> PScriptContext :--> POpaque type PStakeValidator = PData :--> PScriptContext :--> POpaque -- | Compile a Validator -mkValidator :: HasCallStack => Config -> ClosedTerm PValidator -> Plutus.Validator -mkValidator config s = Plutus.Validator $ either (error . T.unpack) id $ compile config s +mkValidator :: HasCallStack => Config -> ClosedTerm PValidator -> PlutusV1.Validator +mkValidator config s = PlutusV1.Validator $ either (error . T.unpack) id $ compile config s -- | Compile a MintingPolicy -mkMintingPolicy :: HasCallStack => Config -> ClosedTerm PMintingPolicy -> Plutus.MintingPolicy -mkMintingPolicy config s = Plutus.MintingPolicy $ either (error . T.unpack) id $ compile config s +mkMintingPolicy :: HasCallStack => Config -> ClosedTerm PMintingPolicy -> PlutusV1.MintingPolicy +mkMintingPolicy config s = PlutusV1.MintingPolicy $ either (error . T.unpack) id $ compile config s -- | Compile a StakeValidator -mkStakeValidator :: HasCallStack => Config -> ClosedTerm PStakeValidator -> Plutus.StakeValidator -mkStakeValidator config s = Plutus.StakeValidator $ either (error . T.unpack) id $ compile config s +mkStakeValidator :: HasCallStack => Config -> ClosedTerm PStakeValidator -> PlutusV1.StakeValidator +mkStakeValidator config s = PlutusV1.StakeValidator $ either (error . T.unpack) id $ compile config s --- | Hash a Script, with the correct prefix for Plutus V1 -scriptHash :: Plutus.Script -> Plutus.ScriptHash +-- | Hash a Script, with the correct prefix for PlutusV1 V1 +scriptHash :: PlutusV1.Script -> PlutusV1.ScriptHash scriptHash = hashScriptWithPrefix "\x01" --- | Hash a Validator, with the correct prefix for Plutus V1 -validatorHash :: Plutus.Validator -> Plutus.ValidatorHash +-- | Hash a Validator, with the correct prefix for PlutusV1 V1 +validatorHash :: PlutusV1.Validator -> PlutusV1.ValidatorHash validatorHash = coerce scriptHash --- | Hash a MintingPolicy, with the correct prefix for Plutus V1 -mintingPolicySymbol :: Plutus.MintingPolicy -> Plutus.CurrencySymbol +-- | Hash a MintingPolicy, with the correct prefix for PlutusV1 V1 +mintingPolicySymbol :: PlutusV1.MintingPolicy -> PlutusV1.CurrencySymbol mintingPolicySymbol = coerce scriptHash --- | Hash a StakeValidator, with the correct prefix for Plutus V1 -stakeValidatorHash :: Plutus.StakeValidator -> Plutus.StakeValidatorHash +-- | Hash a StakeValidator, with the correct prefix for PlutusV1 V1 +stakeValidatorHash :: PlutusV1.StakeValidator -> PlutusV1.StakeValidatorHash stakeValidatorHash = coerce scriptHash -- | Hash a Datum. -datumHash :: Plutus.Datum -> Plutus.DatumHash +datumHash :: PlutusV1.Datum -> PlutusV1.DatumHash datumHash = coerce . dataHash -- | Hash a Redeemer. -redeemerHash :: Plutus.Redeemer -> Plutus.RedeemerHash +redeemerHash :: PlutusV1.Redeemer -> PlutusV1.RedeemerHash redeemerHash = coerce . dataHash -- | Hash the data encoded representation of given argument. -dataHash :: Plutus.ToData a => a -> Plutus.BuiltinByteString -dataHash = hashData . Plutus.toData +dataHash :: PlutusV1.ToData a => a -> PlutusV1.BuiltinByteString +dataHash = hashData . PlutusV1.toData diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index c7f109aa4..c392afe99 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -9,9 +9,11 @@ module Plutarch.Api.V1.Scripts ( PRedeemerHash (PRedeemerHash), PStakeValidatorHash (PStakeValidatorHash), PValidatorHash (PValidatorHash), + PScriptHash (PScriptHash), ) where import qualified PlutusLedgerApi.V1 as Plutus +import qualified PlutusLedgerApi.V1.Scripts as Plutus import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), @@ -77,3 +79,25 @@ deriving via (DerivePConstantViaBuiltin Plutus.ValidatorHash PValidatorHash PByteString) instance PConstantDecl Plutus.ValidatorHash + +newtype PMintingPolicyHash (s :: S) = PMintingPolicyHash (Term s PByteString) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PMintingPolicyHash where type DPTStrat _ = PlutusTypeNewtype + +instance PUnsafeLiftDecl PMintingPolicyHash where type PLifted PMintingPolicyHash = Plutus.MintingPolicyHash +deriving via + (DerivePConstantViaBuiltin Plutus.MintingPolicyHash PMintingPolicyHash PByteString) + instance + PConstantDecl Plutus.MintingPolicyHash + +newtype PScriptHash (s :: S) = PScriptHash (Term s PByteString) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd) +instance DerivePlutusType PScriptHash where type DPTStrat _ = PlutusTypeNewtype + +instance PUnsafeLiftDecl PScriptHash where type PLifted PScriptHash = Plutus.ScriptHash +deriving via + (DerivePConstantViaBuiltin Plutus.ScriptHash PScriptHash PByteString) + instance + PConstantDecl Plutus.ScriptHash diff --git a/Plutarch/Api/V2.hs b/Plutarch/Api/V2.hs new file mode 100644 index 000000000..33214e8e9 --- /dev/null +++ b/Plutarch/Api/V2.hs @@ -0,0 +1,12 @@ +module Plutarch.Api.V2 ( + ) where + +import qualified Plutarch.Api.V1 as V1 +import qualified Plutus.Api.V2 as PlutusV2 + +{- TODO: + - scriptHash and + (validatorHash, stakeValidatorHash, mintingPolicyHash) + - dataHash and + (datumHash, redeemerHash) +-} diff --git a/Plutarch/Api/V2/Contexts.hs b/Plutarch/Api/V2/Contexts.hs new file mode 100644 index 000000000..83426c088 --- /dev/null +++ b/Plutarch/Api/V2/Contexts.hs @@ -0,0 +1,51 @@ +module Plutarch.Api.V2.Contexts ( + PScriptContext (PScriptContext), +) where + +import qualified Plutarch.Api.V1.Value as V1 +import Plutarch.Api.V2.Tx (PTxInInfo) +import qualified PlutusLedgerApi.V2 as Plutus + +import Plutarch.DataRepr (PDataFields) +import Plutarch.Prelude + +-- FIXME: add PDataFields to Prelude + +-- | Script context consists of the script purpose and the pending transaction info. +newtype PScriptContext (s :: S) + = PScriptContext + ( Term + s + ( PDataRecord + '[ "txInfo" ':= PTxInfo + , "purpose" ':= PScriptPurpose + ] + ) + ) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq) + +-- | A pending transaction. This is the view as seen by the validator script. +newtype PTxInfo (s :: S) + = PTxInfo + ( Term + s + ( PDataRecord + '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- Transaction inputs + , "refInputs" ':= PBuiltinList (PAsData PTxInInfo) + , "outputs" ':= PBuiltinList (PAsData PTxOut) -- Transaction outputs + , "fee" ':= V1.PValue V1.Sorted V1.Positive -- The fee paid by this transaction. + , "mint" ':= V1.PValue V1.Sorted V1.NoGuarantees -- The value minted by the transaction. + , "dcert" ':= PBuiltinList (PAsData PDCert) -- Digests of the certificates included in this transaction. + , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- Staking withdrawals + , "validRange" ':= PPOSIXTimeRange -- The valid range for the transaction. + , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) -- Signatories attesting that they all signed the tx. + , "datums" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) + , "id" ':= PTxId -- The hash of the pending transaction. + ] + ) + ) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq) + +instance DerivePlutusType PTxInfo where type DPTStrat _ = PlutusTypeData diff --git a/Plutarch/Api/V2/EvaluationContext.hs b/Plutarch/Api/V2/EvaluationContext.hs new file mode 100644 index 000000000..e69de29bb diff --git a/Plutarch/Api/V2/ParamName.hs b/Plutarch/Api/V2/ParamName.hs new file mode 100644 index 000000000..e69de29bb diff --git a/Plutarch/Api/V2/Tx.hs b/Plutarch/Api/V2/Tx.hs new file mode 100644 index 000000000..e2aab0064 --- /dev/null +++ b/Plutarch/Api/V2/Tx.hs @@ -0,0 +1,80 @@ +{-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-orphans #-} +module Plutarch.Api.V2.Tx ( + PTxInInfo (PTxInInfo), + PTxOut (PTxOut), + POutputDatum (POutputDatumHash, PNoOutputDatum, POutputDatum), + V1.PTxId (V1.PTxId), + V1.PTxOutRef (V1.PTxOutRef), +) where + +import qualified Plutarch.Api.V1.Address as V1 +import qualified Plutarch.Api.V1.Maybe as V1 +import qualified Plutarch.Api.V1.Scripts as V1 +import qualified Plutarch.Api.V1.Tx as V1 +import qualified Plutarch.Api.V1.Value as V1 +import Plutarch.DataRepr ( + PDataFields, + DerivePConstantViaData (DerivePConstantViaData), + ) +import Plutarch.Prelude +import qualified PlutusLedgerApi.V2 as Plutus +import Plutarch.Lift ( + PConstantDecl, + PLifted, + PUnsafeLiftDecl, + ) + +-- | A input of the pending transaction. +newtype PTxInInfo (s :: S) + = PTxInInfo + ( Term + s + ( PDataRecord + '[ "outRef" ':= V1.PTxOutRef + , "resolved" ':= PTxOut + ] + ) + ) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq) + +instance DerivePlutusType PTxInInfo where type DPTStrat _ = PlutusTypeData + +instance PUnsafeLiftDecl PTxInInfo where type PLifted PTxInInfo = Plutus.TxInInfo +deriving via (DerivePConstantViaData Plutus.TxInInfo PTxInInfo) instance PConstantDecl Plutus.TxInInfo + +-- | A transaction output. This consists of a target address, value and maybe a datum hash +newtype PTxOut (s :: S) + = PTxOut + ( Term + s + ( PDataRecord + '[ "address" ':= V1.PAddress + , -- negative values may appear in a future Cardano version + "value" ':= V1.PValue 'V1.Sorted 'V1.Positive + , "datum" ':= POutputDatum + , "referenceScript" ':= V1.PMaybeData V1.PScriptHash + ] + ) + ) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq) +instance DerivePlutusType PTxOut where type DPTStrat _ = PlutusTypeData + + +instance PUnsafeLiftDecl PTxOut where type PLifted PTxOut = Plutus.TxOut +deriving via (DerivePConstantViaData Plutus.TxOut PTxOut) instance PConstantDecl Plutus.TxOut + +-- | The datum attached to an output: either nothing, a datum hash or an inline datum (CIP 32) +data POutputDatum (s :: S) + = PNoOutputDatum (Term s (PDataRecord '[])) + | POutputDatumHash (Term s (PDataRecord '["datumHash" ':= V1.PDatumHash])) + | POutputDatum (Term s (PDataRecord '["outputDatum" ':= V1.PDatum])) + deriving stock Generic + deriving anyclass (PlutusType, PIsData, PEq) +-- FIXME: can we just anyclass derive DerivePlutusNewtype by applying it to strategy? +instance DerivePlutusType POutputDatum where type DPTStrat _ = PlutusTypeData + +instance PUnsafeLiftDecl POutputDatum where type PLifted POutputDatum = Plutus.OutputDatum +deriving via (DerivePConstantViaData Plutus.OutputDatum POutputDatum) instance PConstantDecl Plutus.OutputDatum diff --git a/plutarch.cabal b/plutarch.cabal index b49b919df..b774b0525 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -95,6 +95,9 @@ library Plutarch.Api.V1.Tuple Plutarch.Api.V1.Tx Plutarch.Api.V1.Value + Plutarch.Api.V2 + Plutarch.Api.V2.Contexts + Plutarch.Api.V2.Tx Plutarch.Bool Plutarch.Builtin Plutarch.ByteString From 5176221f0392186695d597952188ef72d3a8cd4f Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sun, 3 Jul 2022 13:36:12 +0200 Subject: [PATCH 528/584] finished adding types --- Plutarch/Api/V2/Contexts.hs | 60 ++++++++++++++++++++----- Plutarch/Api/V2/EvaluationContext.hs | 0 Plutarch/Api/V2/ParamName.hs | 0 Plutarch/Api/V2/Tx.hs | 66 ++++++++++++++++++++-------- 4 files changed, 97 insertions(+), 29 deletions(-) delete mode 100644 Plutarch/Api/V2/EvaluationContext.hs delete mode 100644 Plutarch/Api/V2/ParamName.hs diff --git a/Plutarch/Api/V2/Contexts.hs b/Plutarch/Api/V2/Contexts.hs index 83426c088..5e2624ec5 100644 --- a/Plutarch/Api/V2/Contexts.hs +++ b/Plutarch/Api/V2/Contexts.hs @@ -1,12 +1,31 @@ +{-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-orphans #-} + module Plutarch.Api.V2.Contexts ( PScriptContext (PScriptContext), + PTxInfo (PTxInfo), + PScriptPurpose (PMinting, PSpending, PRewarding, PCertifying), ) where +import qualified Plutarch.Api.V1.Address as V1 +import qualified Plutarch.Api.V1.Crypto as V1 +import qualified Plutarch.Api.V1.DCert as V1 +import qualified Plutarch.Api.V1.Scripts as V1 +import qualified Plutarch.Api.V1.Time as V1 +import qualified Plutarch.Api.V1.Tuple as V1 import qualified Plutarch.Api.V1.Value as V1 -import Plutarch.Api.V2.Tx (PTxInInfo) +import Plutarch.Api.V2.Tx (PTxId, PTxInInfo, PTxOut, PTxOutRef) import qualified PlutusLedgerApi.V2 as Plutus -import Plutarch.DataRepr (PDataFields) +import Plutarch.DataRepr ( + DerivePConstantViaData (DerivePConstantViaData), + PDataFields, + ) +import Plutarch.Lift ( + PConstantDecl, + PLifted, + PUnsafeLiftDecl, + ) import Plutarch.Prelude -- FIXME: add PDataFields to Prelude @@ -25,6 +44,11 @@ newtype PScriptContext (s :: S) deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PDataFields, PEq) +instance DerivePlutusType PScriptContext where type DPTStrat _ = PlutusTypeData + +instance PUnsafeLiftDecl PScriptContext where type PLifted _ = Plutus.ScriptContext +deriving via (DerivePConstantViaData Plutus.ScriptContext PScriptContext) instance PConstantDecl Plutus.ScriptContext + -- | A pending transaction. This is the view as seen by the validator script. newtype PTxInfo (s :: S) = PTxInfo @@ -32,15 +56,15 @@ newtype PTxInfo (s :: S) s ( PDataRecord '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- Transaction inputs - , "refInputs" ':= PBuiltinList (PAsData PTxInInfo) + , "referenceInputs" ':= PBuiltinList (PAsData PTxInInfo) , "outputs" ':= PBuiltinList (PAsData PTxOut) -- Transaction outputs - , "fee" ':= V1.PValue V1.Sorted V1.Positive -- The fee paid by this transaction. - , "mint" ':= V1.PValue V1.Sorted V1.NoGuarantees -- The value minted by the transaction. - , "dcert" ':= PBuiltinList (PAsData PDCert) -- Digests of the certificates included in this transaction. - , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- Staking withdrawals - , "validRange" ':= PPOSIXTimeRange -- The valid range for the transaction. - , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) -- Signatories attesting that they all signed the tx. - , "datums" ':= PBuiltinList (PAsData (PTuple PDatumHash PDatum)) + , "fee" ':= V1.PValue 'V1.Sorted 'V1.Positive -- The fee paid by this transaction. + , "mint" ':= V1.PValue 'V1.Sorted 'V1.NoGuarantees -- The value minted by the transaction. + , "dcert" ':= PBuiltinList (PAsData V1.PDCert) -- Digests of the certificates included in this transaction. + , "wdrl" ':= PBuiltinList (PAsData (V1.PTuple V1.PStakingCredential PInteger)) -- Staking withdrawals + , "validRange" ':= V1.PPOSIXTimeRange -- The valid range for the transaction. + , "signatories" ':= PBuiltinList (PAsData V1.PPubKeyHash) -- Signatories attesting that they all signed the tx. + , "datums" ':= PBuiltinList (PAsData (V1.PTuple V1.PDatumHash V1.PDatum)) , "id" ':= PTxId -- The hash of the pending transaction. ] ) @@ -49,3 +73,19 @@ newtype PTxInfo (s :: S) deriving anyclass (PlutusType, PIsData, PDataFields, PEq) instance DerivePlutusType PTxInfo where type DPTStrat _ = PlutusTypeData + +instance PUnsafeLiftDecl PTxInfo where type PLifted _ = Plutus.TxInfo +deriving via (DerivePConstantViaData Plutus.TxInfo PTxInfo) instance PConstantDecl Plutus.TxInfo + +data PScriptPurpose (s :: S) + = PMinting (Term s (PDataRecord '["_0" ':= V1.PCurrencySymbol])) + | PSpending (Term s (PDataRecord '["_0" ':= PTxOutRef])) + | PRewarding (Term s (PDataRecord '["_0" ':= V1.PStakingCredential])) + | PCertifying (Term s (PDataRecord '["_0" ':= V1.PDCert])) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq) + +instance DerivePlutusType PScriptPurpose where type DPTStrat _ = PlutusTypeData + +instance PUnsafeLiftDecl PScriptPurpose where type PLifted PScriptPurpose = Plutus.ScriptPurpose +deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) instance PConstantDecl Plutus.ScriptPurpose diff --git a/Plutarch/Api/V2/EvaluationContext.hs b/Plutarch/Api/V2/EvaluationContext.hs deleted file mode 100644 index e69de29bb..000000000 diff --git a/Plutarch/Api/V2/ParamName.hs b/Plutarch/Api/V2/ParamName.hs deleted file mode 100644 index e69de29bb..000000000 diff --git a/Plutarch/Api/V2/Tx.hs b/Plutarch/Api/V2/Tx.hs index e2aab0064..e52c88f66 100644 --- a/Plutarch/Api/V2/Tx.hs +++ b/Plutarch/Api/V2/Tx.hs @@ -1,48 +1,48 @@ {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} + module Plutarch.Api.V2.Tx ( - PTxInInfo (PTxInInfo), + PTxOutRef (PTxOutRef), PTxOut (PTxOut), + PTxId (PTxId), + PTxInInfo (PTxInInfo), POutputDatum (POutputDatumHash, PNoOutputDatum, POutputDatum), - V1.PTxId (V1.PTxId), - V1.PTxOutRef (V1.PTxOutRef), ) where import qualified Plutarch.Api.V1.Address as V1 import qualified Plutarch.Api.V1.Maybe as V1 import qualified Plutarch.Api.V1.Scripts as V1 -import qualified Plutarch.Api.V1.Tx as V1 import qualified Plutarch.Api.V1.Value as V1 import Plutarch.DataRepr ( - PDataFields, DerivePConstantViaData (DerivePConstantViaData), + PDataFields, ) -import Plutarch.Prelude -import qualified PlutusLedgerApi.V2 as Plutus import Plutarch.Lift ( PConstantDecl, PLifted, PUnsafeLiftDecl, ) +import Plutarch.Prelude +import qualified PlutusLedgerApi.V2 as Plutus --- | A input of the pending transaction. -newtype PTxInInfo (s :: S) - = PTxInInfo +-- | Reference to a transaction output with a index referencing which of the outputs is being referred to. +newtype PTxOutRef (s :: S) + = PTxOutRef ( Term s ( PDataRecord - '[ "outRef" ':= V1.PTxOutRef - , "resolved" ':= PTxOut + '[ "id" ':= PTxId + , "idx" ':= PInteger ] ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) -instance DerivePlutusType PTxInInfo where type DPTStrat _ = PlutusTypeData +instance DerivePlutusType PTxOutRef where type DPTStrat _ = PlutusTypeData -instance PUnsafeLiftDecl PTxInInfo where type PLifted PTxInInfo = Plutus.TxInInfo -deriving via (DerivePConstantViaData Plutus.TxInInfo PTxInInfo) instance PConstantDecl Plutus.TxInInfo +instance PUnsafeLiftDecl PTxOutRef where type PLifted PTxOutRef = Plutus.TxOutRef +deriving via (DerivePConstantViaData Plutus.TxOutRef PTxOutRef) instance PConstantDecl Plutus.TxOutRef -- | A transaction output. This consists of a target address, value and maybe a datum hash newtype PTxOut (s :: S) @@ -60,20 +60,48 @@ newtype PTxOut (s :: S) ) deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PDataFields, PEq) -instance DerivePlutusType PTxOut where type DPTStrat _ = PlutusTypeData +instance DerivePlutusType PTxOut where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxOut where type PLifted PTxOut = Plutus.TxOut deriving via (DerivePConstantViaData Plutus.TxOut PTxOut) instance PConstantDecl Plutus.TxOut +newtype PTxId (s :: S) + = PTxId (Term s (PDataRecord '["_0" ':= PByteString])) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) +instance DerivePlutusType PTxId where type DPTStrat _ = PlutusTypeData + +instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId +deriving via (DerivePConstantViaData Plutus.TxId PTxId) instance PConstantDecl Plutus.TxId + +-- | A input of the pending transaction. +newtype PTxInInfo (s :: S) + = PTxInInfo + ( Term + s + ( PDataRecord + '[ "outRef" ':= PTxOutRef + , "resolved" ':= PTxOut + ] + ) + ) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq) + +instance DerivePlutusType PTxInInfo where type DPTStrat _ = PlutusTypeData + +instance PUnsafeLiftDecl PTxInInfo where type PLifted PTxInInfo = Plutus.TxInInfo +deriving via (DerivePConstantViaData Plutus.TxInInfo PTxInInfo) instance PConstantDecl Plutus.TxInInfo + -- | The datum attached to an output: either nothing, a datum hash or an inline datum (CIP 32) data POutputDatum (s :: S) = PNoOutputDatum (Term s (PDataRecord '[])) | POutputDatumHash (Term s (PDataRecord '["datumHash" ':= V1.PDatumHash])) | POutputDatum (Term s (PDataRecord '["outputDatum" ':= V1.PDatum])) - deriving stock Generic + deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PEq) --- FIXME: can we just anyclass derive DerivePlutusNewtype by applying it to strategy? + instance DerivePlutusType POutputDatum where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl POutputDatum where type PLifted POutputDatum = Plutus.OutputDatum From c4e359bcfff4e9aee73aec51045aadd15c793df6 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sun, 3 Jul 2022 13:39:34 +0200 Subject: [PATCH 529/584] removed nonsense from V2.hs and added TODO list --- Plutarch/Api/V2.hs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Plutarch/Api/V2.hs b/Plutarch/Api/V2.hs index 33214e8e9..fae6b5cbc 100644 --- a/Plutarch/Api/V2.hs +++ b/Plutarch/Api/V2.hs @@ -1,12 +1,6 @@ module Plutarch.Api.V2 ( ) where -import qualified Plutarch.Api.V1 as V1 -import qualified Plutus.Api.V2 as PlutusV2 - -{- TODO: - - scriptHash and - (validatorHash, stakeValidatorHash, mintingPolicyHash) - - dataHash and - (datumHash, redeemerHash) --} +-- TODO: +-- - meaningful reesports +-- - add util functions that are also part of PlutusLedgerApi.V2 From 38fcbb36de40aa6c1335914be76ad272240d5639 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sun, 3 Jul 2022 16:27:44 +0200 Subject: [PATCH 530/584] some reexports to make working with the new types easier --- Plutarch/Api/V1.hs | 41 +++++++++++++++++++------------------ Plutarch/Api/V2.hs | 38 ++++++++++++++++++++++++++++++++-- Plutarch/Api/V2/Contexts.hs | 21 ++++--------------- Plutarch/Api/V2/Tx.hs | 35 ++++--------------------------- Plutarch/Builtin.hs | 2 +- 5 files changed, 66 insertions(+), 71 deletions(-) diff --git a/Plutarch/Api/V1.hs b/Plutarch/Api/V1.hs index 74f07a609..32a21c8a6 100644 --- a/Plutarch/Api/V1.hs +++ b/Plutarch/Api/V1.hs @@ -99,8 +99,9 @@ import qualified Plutarch.Api.V1.Value as Value import Data.Coerce (coerce) -import qualified PlutusLedgerApi.V1 as PlutusV1 -import qualified PlutusLedgerApi.V1.Scripts as PlutusV1 +-- note about V2: This should there are no changes in Scripts or V1 itself that affect this module +import qualified PlutusLedgerApi.V1 as Plutus +import qualified PlutusLedgerApi.V1.Scripts as Plutus import Plutarch (Config, compile) import Plutarch.Api.Internal.Hashing (hashData, hashScriptWithPrefix) @@ -122,41 +123,41 @@ type PMintingPolicy = PData :--> PScriptContext :--> POpaque type PStakeValidator = PData :--> PScriptContext :--> POpaque -- | Compile a Validator -mkValidator :: HasCallStack => Config -> ClosedTerm PValidator -> PlutusV1.Validator -mkValidator config s = PlutusV1.Validator $ either (error . T.unpack) id $ compile config s +mkValidator :: HasCallStack => Config -> ClosedTerm PValidator -> Plutus.Validator +mkValidator config s = Plutus.Validator $ either (error . T.unpack) id $ compile config s -- | Compile a MintingPolicy -mkMintingPolicy :: HasCallStack => Config -> ClosedTerm PMintingPolicy -> PlutusV1.MintingPolicy -mkMintingPolicy config s = PlutusV1.MintingPolicy $ either (error . T.unpack) id $ compile config s +mkMintingPolicy :: HasCallStack => Config -> ClosedTerm PMintingPolicy -> Plutus.MintingPolicy +mkMintingPolicy config s = Plutus.MintingPolicy $ either (error . T.unpack) id $ compile config s -- | Compile a StakeValidator -mkStakeValidator :: HasCallStack => Config -> ClosedTerm PStakeValidator -> PlutusV1.StakeValidator -mkStakeValidator config s = PlutusV1.StakeValidator $ either (error . T.unpack) id $ compile config s +mkStakeValidator :: HasCallStack => Config -> ClosedTerm PStakeValidator -> Plutus.StakeValidator +mkStakeValidator config s = Plutus.StakeValidator $ either (error . T.unpack) id $ compile config s --- | Hash a Script, with the correct prefix for PlutusV1 V1 -scriptHash :: PlutusV1.Script -> PlutusV1.ScriptHash +-- | Hash a Script, with the correct prefix for Plutus V1 +scriptHash :: Plutus.Script -> Plutus.ScriptHash scriptHash = hashScriptWithPrefix "\x01" --- | Hash a Validator, with the correct prefix for PlutusV1 V1 -validatorHash :: PlutusV1.Validator -> PlutusV1.ValidatorHash +-- | Hash a Validator, with the correct prefix for Plutus V1 +validatorHash :: Plutus.Validator -> Plutus.ValidatorHash validatorHash = coerce scriptHash --- | Hash a MintingPolicy, with the correct prefix for PlutusV1 V1 -mintingPolicySymbol :: PlutusV1.MintingPolicy -> PlutusV1.CurrencySymbol +-- | Hash a MintingPolicy, with the correct prefix for Plutus V1 +mintingPolicySymbol :: Plutus.MintingPolicy -> Plutus.CurrencySymbol mintingPolicySymbol = coerce scriptHash --- | Hash a StakeValidator, with the correct prefix for PlutusV1 V1 -stakeValidatorHash :: PlutusV1.StakeValidator -> PlutusV1.StakeValidatorHash +-- | Hash a StakeValidator, with the correct prefix for Plutus V1 +stakeValidatorHash :: Plutus.StakeValidator -> Plutus.StakeValidatorHash stakeValidatorHash = coerce scriptHash -- | Hash a Datum. -datumHash :: PlutusV1.Datum -> PlutusV1.DatumHash +datumHash :: Plutus.Datum -> Plutus.DatumHash datumHash = coerce . dataHash -- | Hash a Redeemer. -redeemerHash :: PlutusV1.Redeemer -> PlutusV1.RedeemerHash +redeemerHash :: Plutus.Redeemer -> Plutus.RedeemerHash redeemerHash = coerce . dataHash -- | Hash the data encoded representation of given argument. -dataHash :: PlutusV1.ToData a => a -> PlutusV1.BuiltinByteString -dataHash = hashData . PlutusV1.toData +dataHash :: Plutus.ToData a => a -> Plutus.BuiltinByteString +dataHash = hashData . Plutus.toData diff --git a/Plutarch/Api/V2.hs b/Plutarch/Api/V2.hs index fae6b5cbc..bf27200f6 100644 --- a/Plutarch/Api/V2.hs +++ b/Plutarch/Api/V2.hs @@ -1,6 +1,40 @@ module Plutarch.Api.V2 ( - ) where + -- ** Contexts + Contexts.PScriptContext (PScriptContext), + Contexts.PTxInfo (PTxInfo), + Contexts.PScriptPurpose (PMinting, PSpending, PRewarding, PCertifying), + + -- ** Tx + Tx.PTxOutRef (PTxOutRef), + Tx.PTxOut (PTxOut), + Tx.PTxId (PTxId), + Tx.PTxInInfo (PTxInInfo), + Tx.POutputDatum (PNoOutputDatum, POutputDatumHash, POutputDatum), + + -- *** reexports for V2 Tx and Contexts + V1.PMaybeData (PDNothing, PDJust), + V1.PTuple, + V1.PDatum (PDatum), + V1.PDatumHash (PDatumHash), + V1.PAddress (PAddress), + V1.KeyGuarantees (Sorted, Unsorted), + V1.AmountGuarantees (NoGuarantees, Positive), + V1.PScriptHash (PScriptHash), + V1.PPubKeyHash (PPubKeyHash), + V1.PStakingCredential (PStakingHash, PStakingPtr), + type V1.PPOSIXTimeRange, +) where + +import qualified Plutarch.Api.V2.Contexts as Contexts +import qualified Plutarch.Api.V2.Tx as Tx + +import qualified Plutarch.Api.V1.Address as V1 +import qualified Plutarch.Api.V1.Crypto as V1 +import qualified Plutarch.Api.V1.Maybe as V1 +import qualified Plutarch.Api.V1.Scripts as V1 +import qualified Plutarch.Api.V1.Time as V1 +import qualified Plutarch.Api.V1.Tuple as V1 +import qualified Plutarch.Api.V1.Value as V1 -- TODO: --- - meaningful reesports -- - add util functions that are also part of PlutusLedgerApi.V2 diff --git a/Plutarch/Api/V2/Contexts.hs b/Plutarch/Api/V2/Contexts.hs index 5e2624ec5..c77b4f9b8 100644 --- a/Plutarch/Api/V2/Contexts.hs +++ b/Plutarch/Api/V2/Contexts.hs @@ -4,17 +4,17 @@ module Plutarch.Api.V2.Contexts ( PScriptContext (PScriptContext), PTxInfo (PTxInfo), - PScriptPurpose (PMinting, PSpending, PRewarding, PCertifying), + V1.PScriptPurpose (PMinting, PSpending, PRewarding, PCertifying), ) where import qualified Plutarch.Api.V1.Address as V1 +import qualified Plutarch.Api.V1.Contexts as V1 import qualified Plutarch.Api.V1.Crypto as V1 import qualified Plutarch.Api.V1.DCert as V1 import qualified Plutarch.Api.V1.Scripts as V1 import qualified Plutarch.Api.V1.Time as V1 -import qualified Plutarch.Api.V1.Tuple as V1 import qualified Plutarch.Api.V1.Value as V1 -import Plutarch.Api.V2.Tx (PTxId, PTxInInfo, PTxOut, PTxOutRef) +import Plutarch.Api.V2.Tx (PTxId, PTxInInfo, PTxOut) import qualified PlutusLedgerApi.V2 as Plutus import Plutarch.DataRepr ( @@ -37,7 +37,7 @@ newtype PScriptContext (s :: S) s ( PDataRecord '[ "txInfo" ':= PTxInfo - , "purpose" ':= PScriptPurpose + , "purpose" ':= V1.PScriptPurpose ] ) ) @@ -76,16 +76,3 @@ instance DerivePlutusType PTxInfo where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxInfo where type PLifted _ = Plutus.TxInfo deriving via (DerivePConstantViaData Plutus.TxInfo PTxInfo) instance PConstantDecl Plutus.TxInfo - -data PScriptPurpose (s :: S) - = PMinting (Term s (PDataRecord '["_0" ':= V1.PCurrencySymbol])) - | PSpending (Term s (PDataRecord '["_0" ':= PTxOutRef])) - | PRewarding (Term s (PDataRecord '["_0" ':= V1.PStakingCredential])) - | PCertifying (Term s (PDataRecord '["_0" ':= V1.PDCert])) - deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq) - -instance DerivePlutusType PScriptPurpose where type DPTStrat _ = PlutusTypeData - -instance PUnsafeLiftDecl PScriptPurpose where type PLifted PScriptPurpose = Plutus.ScriptPurpose -deriving via (DerivePConstantViaData Plutus.ScriptPurpose PScriptPurpose) instance PConstantDecl Plutus.ScriptPurpose diff --git a/Plutarch/Api/V2/Tx.hs b/Plutarch/Api/V2/Tx.hs index e52c88f66..231106576 100644 --- a/Plutarch/Api/V2/Tx.hs +++ b/Plutarch/Api/V2/Tx.hs @@ -2,9 +2,9 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V2.Tx ( - PTxOutRef (PTxOutRef), + V1.PTxOutRef (PTxOutRef), PTxOut (PTxOut), - PTxId (PTxId), + V1.PTxId (PTxId), PTxInInfo (PTxInInfo), POutputDatum (POutputDatumHash, PNoOutputDatum, POutputDatum), ) where @@ -12,6 +12,7 @@ module Plutarch.Api.V2.Tx ( import qualified Plutarch.Api.V1.Address as V1 import qualified Plutarch.Api.V1.Maybe as V1 import qualified Plutarch.Api.V1.Scripts as V1 +import qualified Plutarch.Api.V1.Tx as V1 import qualified Plutarch.Api.V1.Value as V1 import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), @@ -25,25 +26,6 @@ import Plutarch.Lift ( import Plutarch.Prelude import qualified PlutusLedgerApi.V2 as Plutus --- | Reference to a transaction output with a index referencing which of the outputs is being referred to. -newtype PTxOutRef (s :: S) - = PTxOutRef - ( Term - s - ( PDataRecord - '[ "id" ':= PTxId - , "idx" ':= PInteger - ] - ) - ) - deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) - -instance DerivePlutusType PTxOutRef where type DPTStrat _ = PlutusTypeData - -instance PUnsafeLiftDecl PTxOutRef where type PLifted PTxOutRef = Plutus.TxOutRef -deriving via (DerivePConstantViaData Plutus.TxOutRef PTxOutRef) instance PConstantDecl Plutus.TxOutRef - -- | A transaction output. This consists of a target address, value and maybe a datum hash newtype PTxOut (s :: S) = PTxOut @@ -66,22 +48,13 @@ instance DerivePlutusType PTxOut where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxOut where type PLifted PTxOut = Plutus.TxOut deriving via (DerivePConstantViaData Plutus.TxOut PTxOut) instance PConstantDecl Plutus.TxOut -newtype PTxId (s :: S) - = PTxId (Term s (PDataRecord '["_0" ':= PByteString])) - deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) -instance DerivePlutusType PTxId where type DPTStrat _ = PlutusTypeData - -instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId -deriving via (DerivePConstantViaData Plutus.TxId PTxId) instance PConstantDecl Plutus.TxId - -- | A input of the pending transaction. newtype PTxInInfo (s :: S) = PTxInInfo ( Term s ( PDataRecord - '[ "outRef" ':= PTxOutRef + '[ "outRef" ':= V1.PTxOutRef , "resolved" ':= PTxOut ] ) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index a6e4986b6..dec909beb 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -174,7 +174,7 @@ instance PConstant a => PConstantDecl [a] where type PConstantRepr [a] = [PConstantRepr a] type PConstanted [a] = PBuiltinList (PConstanted a) pconstantToRepr x = pconstantToRepr <$> x - pconstantFromRepr x = traverse (pconstantFromRepr @a) x + pconstantFromRepr = traverse (pconstantFromRepr @a) instance PUnsafeLiftDecl a => PUnsafeLiftDecl (PBuiltinList a) where type PLifted (PBuiltinList a) = [PLifted a] From 079a8733278449e8771a6cd49b27c0c8dfd00bbd Mon Sep 17 00:00:00 2001 From: mangoiv Date: Mon, 4 Jul 2022 15:55:18 +0200 Subject: [PATCH 531/584] fix assocmap --- Plutarch/Api/V1/AssocMap.hs | 10 +++++----- Plutarch/Api/V2/Contexts.hs | 14 +++++--------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 92597d590..59e0c64af 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -105,12 +105,12 @@ plookup :: (PIsData k, PIsData v) => Term s (k :--> PMap _ k v :--> PMaybe v) plookup = phoistAcyclic $ plam $ \key -> plookupDataWith - # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ pfromData $ psndBuiltin # pair) + # phoistAcyclic (plam $ \pair -> pcon $ PJust $ pfromData $ psndBuiltin # pair) # pdata key -- | Look up the given key data in a 'PMap'. plookupData :: (PIsData k, PIsData v) => Term s (PAsData k :--> PMap _ k v :--> PMaybe (PAsData v)) -plookupData = plookupDataWith # (phoistAcyclic $ plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) +plookupData = plookupDataWith # phoistAcyclic (plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) -- | Look up the given key data in a 'PMap', applying the given function to the found key-value pair. plookupDataWith :: @@ -167,7 +167,7 @@ foldAtData = phoistAcyclic $ pinsert :: (POrd k, PIsData k, PIsData v) => Term s (k :--> v :--> PMap 'Sorted k v :--> PMap 'Sorted k v) pinsert = phoistAcyclic $ plam $ \key val -> - rebuildAtKey # (plam (pcons # (ppairDataBuiltin # pdata key # pdata val) #)) # key + rebuildAtKey # plam (pcons # (ppairDataBuiltin # pdata key # pdata val) #) # key -- | Insert a new data-encoded key/value pair into the map, overiding the previous if any. pinsertData :: @@ -175,7 +175,7 @@ pinsertData :: Term s (PAsData k :--> PAsData v :--> PMap 'Sorted k v :--> PMap 'Sorted k v) pinsertData = phoistAcyclic $ plam $ \key val -> - rebuildAtKey # (plam (pcons # (ppairDataBuiltin # key # val) #)) # pfromData key + rebuildAtKey # plam (pcons # (ppairDataBuiltin # key # val) #) # pfromData key -- | Delete a key from the map. pdelete :: (POrd k, PIsData k) => Term s (k :--> PMap 'Sorted k v :--> PMap 'Sorted k v) @@ -338,7 +338,7 @@ mapUnionCarrier = phoistAcyclic $ plam \combine self -> } mapUnion :: forall k v s. (POrd k, PIsData k) => Term s ((PAsData v :--> PAsData v :--> PAsData v) :--> MapUnionCarrier k v) -mapUnion = phoistAcyclic $ plam \combine -> (punsafeCoerce pfix) # (mapUnionCarrier # combine :: Term _ (MapUnionCarrier k v :--> MapUnionCarrier k v)) +mapUnion = phoistAcyclic $ plam \combine -> punsafeCoerce pfix # (mapUnionCarrier # combine :: Term _ (MapUnionCarrier k v :--> MapUnionCarrier k v)) {- | Combine two 'PMap's applying the given function to any two data-encoded values that share the same key. diff --git a/Plutarch/Api/V2/Contexts.hs b/Plutarch/Api/V2/Contexts.hs index c77b4f9b8..b6aa37bd1 100644 --- a/Plutarch/Api/V2/Contexts.hs +++ b/Plutarch/Api/V2/Contexts.hs @@ -7,13 +7,7 @@ module Plutarch.Api.V2.Contexts ( V1.PScriptPurpose (PMinting, PSpending, PRewarding, PCertifying), ) where -import qualified Plutarch.Api.V1.Address as V1 -import qualified Plutarch.Api.V1.Contexts as V1 -import qualified Plutarch.Api.V1.Crypto as V1 -import qualified Plutarch.Api.V1.DCert as V1 -import qualified Plutarch.Api.V1.Scripts as V1 -import qualified Plutarch.Api.V1.Time as V1 -import qualified Plutarch.Api.V1.Value as V1 +import qualified Plutarch.Api.V1 as V1 import Plutarch.Api.V2.Tx (PTxId, PTxInInfo, PTxOut) import qualified PlutusLedgerApi.V2 as Plutus @@ -21,6 +15,7 @@ import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, ) + import Plutarch.Lift ( PConstantDecl, PLifted, @@ -61,10 +56,11 @@ newtype PTxInfo (s :: S) , "fee" ':= V1.PValue 'V1.Sorted 'V1.Positive -- The fee paid by this transaction. , "mint" ':= V1.PValue 'V1.Sorted 'V1.NoGuarantees -- The value minted by the transaction. , "dcert" ':= PBuiltinList (PAsData V1.PDCert) -- Digests of the certificates included in this transaction. - , "wdrl" ':= PBuiltinList (PAsData (V1.PTuple V1.PStakingCredential PInteger)) -- Staking withdrawals + , "wdrl" ':= V1.PMap 'V1.Unsorted V1.PStakingCredential PInteger -- Staking withdrawals , "validRange" ':= V1.PPOSIXTimeRange -- The valid range for the transaction. , "signatories" ':= PBuiltinList (PAsData V1.PPubKeyHash) -- Signatories attesting that they all signed the tx. - , "datums" ':= PBuiltinList (PAsData (V1.PTuple V1.PDatumHash V1.PDatum)) + , "redeemers" ':= V1.PMap 'V1.Unsorted V1.PScriptPurpose V1.PRedeemer + , "datums" ':= V1.PMap 'V1.Unsorted V1.PDatumHash V1.PDatum , "id" ':= PTxId -- The hash of the pending transaction. ] ) From 45123c4faa8ee82e54c6204c66ebf36725aab4d2 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Mon, 4 Jul 2022 16:02:03 +0200 Subject: [PATCH 532/584] stop building ghc810 --- flake.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/flake.nix b/flake.nix index 5f0e58465..0c0e8159c 100644 --- a/flake.nix +++ b/flake.nix @@ -522,9 +522,6 @@ // { formatCheck = formatCheckFor system; test-ghc9 = flakeApp2Derivation system "test-ghc9"; - test-ghc810 = flakeApp2Derivation system "test-ghc810"; - "ghc810-plutarch:lib:plutarch" = (self.ghc810Flake.${system}).packages."plutarch:lib:plutarch"; - "ghc810-plutarch:lib:plutarch-test" = (self.ghc810Flake.${system}).packages."plutarch-test:lib:plutarch-test"; hls = checkedShellScript system "hls" "${self.project.${system}.pkgs.haskell-language-server}/bin/haskell-language-server"; }); # Because `nix flake check` does not work with haskell.nix (due to IFD), @@ -544,7 +541,6 @@ self.flake.${system}.apps // { test-ghc9 = plutarchTestApp system "ghc9" self.projectMatrix.ghc9; - test-ghc810 = plutarchTestApp system "ghc810" self.projectMatrix.ghc810; # `nix run .#docs` should be run from the Git repo. docs = plutarchWebsiteLive system "./docs"; @@ -555,7 +551,6 @@ devShells = perSystem (system: { - "ghc810" = self.ghc810Flake.${system}.devShell; "ghc9" = self.flake.${system}.devShell; }); From 25329db3516ced9e1ba50df491e417958c51ff8b Mon Sep 17 00:00:00 2001 From: mangoiv Date: Mon, 4 Jul 2022 16:29:06 +0200 Subject: [PATCH 533/584] add back ghc810 devShell because why not (hls is reliably cached and if we wanna revive support for 810 at some point we will probably need a devShell) --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 0c0e8159c..0950d3b0c 100644 --- a/flake.nix +++ b/flake.nix @@ -552,6 +552,7 @@ devShells = perSystem (system: { "ghc9" = self.flake.${system}.devShell; + "ghc810" = self.ghc810Flake.${system}.devShell; }); devShell = perSystem (system: self.devShells.${system}."ghc9"); From 42d848aa96fa479b1c615bbc49f2d477c541ea8a Mon Sep 17 00:00:00 2001 From: mangoiv Date: Mon, 4 Jul 2022 21:39:28 +0200 Subject: [PATCH 534/584] bump plutus version --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index e61a22d5b..4cd7d19e9 100644 --- a/flake.lock +++ b/flake.lock @@ -874,11 +874,11 @@ "sphinxcontrib-haddock": "sphinxcontrib-haddock" }, "locked": { - "lastModified": 1653669501, - "narHash": "sha256-qJrjEeo9Jmar1TwihDFzKQNC1ui4M03iClJM1zMd5Uk=", + "lastModified": 1656595231, + "narHash": "sha256-3EBhSroECMOSP02qZGT0Zb3QHWibI/tYjdcaT5/YotY=", "owner": "input-output-hk", "repo": "plutus", - "rev": "fed48a71550a12290efc84eefb74305d93cde69d", + "rev": "b39a526e983cb931d0cc49b7d073d6d43abd22b5", "type": "github" }, "original": { From 7e4e71c747aa66573f9e8dbd70417bd2270034a1 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Wed, 6 Jul 2022 17:45:12 +0000 Subject: [PATCH 535/584] Remove ghc 8.10 dev shell --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index 0950d3b0c..0c0e8159c 100644 --- a/flake.nix +++ b/flake.nix @@ -552,7 +552,6 @@ devShells = perSystem (system: { "ghc9" = self.flake.${system}.devShell; - "ghc810" = self.ghc810Flake.${system}.devShell; }); devShell = perSystem (system: self.devShells.${system}."ghc9"); From a747bcfdb0dbadde33492d4d2f2cb41654095c50 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Jul 2022 13:53:52 +0530 Subject: [PATCH 536/584] Tests and development flag related cleanup --- README.md | 12 -- flake.nix | 2 +- plutarch-test/README.md | 6 - plutarch-test/common/Plutarch/Test.hs | 22 +-- plutarch-test/common/Plutarch/Test/Golden.hs | 2 +- .../conditional/Plutarch/MonadicSpec.hs | 2 +- .../conditional/Plutarch/TryFromSpec.hs | 2 +- ...den => api.example.signatory.bench.golden} | 0 ...=> api.example.signatory.uplc.eval.golden} | 0 ...lden => api.example.signatory.uplc.golden} | 0 ...ue.bench.golden => api.value.bench.golden} | 0 ...eval.golden => api.value.uplc.eval.golden} | 0 ...true.uplc.golden => api.value.uplc.golden} | 0 plutarch-test/goldens/data-verif.bench.golden | 36 +++++ .../goldens/data-verif.dev=false.bench.golden | 31 ---- .../goldens/data-verif.dev=false.uplc.golden | 31 ---- .../goldens/data-verif.dev=true.bench.golden | 31 ---- .../data-verif.dev=true.uplc.eval.golden | 31 ---- ...val.golden => data-verif.uplc.eval.golden} | 5 + ...rue.uplc.golden => data-verif.uplc.golden} | 13 +- ...ue.bench.golden => extra.api.bench.golden} | 0 ...eval.golden => extra.api.uplc.eval.golden} | 0 ...true.uplc.golden => extra.api.uplc.golden} | 0 ...ev=true.bench.golden => list.bench.golden} | 0 ...uplc.eval.golden => list.uplc.eval.golden} | 0 ....dev=true.uplc.golden => list.uplc.golden} | 0 ...onadic.api.example.signatory.bench.golden} | 0 ...ic.api.example.signatory.uplc.eval.golden} | 0 ...monadic.api.example.signatory.uplc.golden} | 0 plutarch-test/goldens/rational.bench.golden | 24 ++++ .../goldens/rational.dev=true.bench.golden | 24 ---- .../goldens/rational.dev=true.uplc.golden | 24 ---- ....eval.golden => rational.uplc.eval.golden} | 0 plutarch-test/goldens/rational.uplc.golden | 24 ++++ plutarch-test/goldens/show.bench.golden | 3 +- .../goldens/show.dev=true.bench.golden | 1 - .../goldens/show.dev=true.uplc.eval.golden | 1 - .../goldens/show.dev=true.uplc.golden | 1 - plutarch-test/goldens/show.uplc.eval.golden | 3 +- plutarch-test/goldens/show.uplc.golden | 3 +- ...v=true.bench.golden => trace.bench.golden} | 0 ...plc.eval.golden => trace.uplc.eval.golden} | 0 ...dev=true.uplc.golden => trace.uplc.golden} | 0 .../plutarch-base/Plutarch/ApiSpec.hs | 4 +- .../plutarch-base/Plutarch/ListSpec.hs | 2 +- .../plutarch-base/Plutarch/PlutusTypeSpec.hs | 1 - .../plutarch-base/Plutarch/RationalSpec.hs | 2 +- .../plutarch-base/Plutarch/ShowSpec.hs | 132 +++++++++--------- .../plutarch-base/Plutarch/TraceSpec.hs | 2 +- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 2 +- plutarch-test/plutarch-test.cabal | 11 -- 51 files changed, 181 insertions(+), 309 deletions(-) rename plutarch-test/goldens/{api.example.signatory.dev=true.bench.golden => api.example.signatory.bench.golden} (100%) rename plutarch-test/goldens/{api.example.signatory.dev=true.uplc.eval.golden => api.example.signatory.uplc.eval.golden} (100%) rename plutarch-test/goldens/{api.example.signatory.dev=true.uplc.golden => api.example.signatory.uplc.golden} (100%) rename plutarch-test/goldens/{api.value.dev=true.bench.golden => api.value.bench.golden} (100%) rename plutarch-test/goldens/{api.value.dev=true.uplc.eval.golden => api.value.uplc.eval.golden} (100%) rename plutarch-test/goldens/{api.value.dev=true.uplc.golden => api.value.uplc.golden} (100%) create mode 100644 plutarch-test/goldens/data-verif.bench.golden delete mode 100644 plutarch-test/goldens/data-verif.dev=false.bench.golden delete mode 100644 plutarch-test/goldens/data-verif.dev=false.uplc.golden delete mode 100644 plutarch-test/goldens/data-verif.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/data-verif.dev=true.uplc.eval.golden rename plutarch-test/goldens/{data-verif.dev=false.uplc.eval.golden => data-verif.uplc.eval.golden} (89%) rename plutarch-test/goldens/{data-verif.dev=true.uplc.golden => data-verif.uplc.golden} (60%) rename plutarch-test/goldens/{extra.api.dev=true.bench.golden => extra.api.bench.golden} (100%) rename plutarch-test/goldens/{extra.api.dev=true.uplc.eval.golden => extra.api.uplc.eval.golden} (100%) rename plutarch-test/goldens/{extra.api.dev=true.uplc.golden => extra.api.uplc.golden} (100%) rename plutarch-test/goldens/{list.dev=true.bench.golden => list.bench.golden} (100%) rename plutarch-test/goldens/{list.dev=true.uplc.eval.golden => list.uplc.eval.golden} (100%) rename plutarch-test/goldens/{list.dev=true.uplc.golden => list.uplc.golden} (100%) rename plutarch-test/goldens/{monadic.api.example.signatory.dev=true.bench.golden => monadic.api.example.signatory.bench.golden} (100%) rename plutarch-test/goldens/{monadic.api.example.signatory.dev=true.uplc.eval.golden => monadic.api.example.signatory.uplc.eval.golden} (100%) rename plutarch-test/goldens/{monadic.api.example.signatory.dev=true.uplc.golden => monadic.api.example.signatory.uplc.golden} (100%) create mode 100644 plutarch-test/goldens/rational.bench.golden delete mode 100644 plutarch-test/goldens/rational.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/rational.dev=true.uplc.golden rename plutarch-test/goldens/{rational.dev=true.uplc.eval.golden => rational.uplc.eval.golden} (100%) create mode 100644 plutarch-test/goldens/rational.uplc.golden delete mode 100644 plutarch-test/goldens/show.dev=true.bench.golden delete mode 100644 plutarch-test/goldens/show.dev=true.uplc.eval.golden delete mode 100644 plutarch-test/goldens/show.dev=true.uplc.golden rename plutarch-test/goldens/{trace.dev=true.bench.golden => trace.bench.golden} (100%) rename plutarch-test/goldens/{trace.dev=true.uplc.eval.golden => trace.uplc.eval.golden} (100%) rename plutarch-test/goldens/{trace.dev=true.uplc.golden => trace.uplc.golden} (100%) diff --git a/README.md b/README.md index 6ef33cb65..2094bc783 100644 --- a/README.md +++ b/README.md @@ -26,18 +26,6 @@ More benchmarks, with reproducible code, soon to follow. * Add this repo as a source repository package to your `cabal.project`. * Add the `plutarch` package as a dependency to your cabal file. -This package takes in a flag, `development`, that defaults to false. It's used to turn on "development mode". Following is a list of effects and their variations based on whether or not development mode is on. - -| On | Off | -| -- | --- | -| Tracing functions from `Plutarch.Trace` log given message to the trace log. | Tracing functions from `Plutarch.Trace` do not log. They merely return their argument. | - -You can turn on development mode by passing in the `development` flag in your `cabal.project` file: -```hs -package plutarch - flags: +development -``` - # Benchmarks See the [`plutarch-test`](./plutarch-test) for testing and golden files containing benchmarks and UPLCs. diff --git a/flake.nix b/flake.nix index 0c0e8159c..b39f49f8a 100644 --- a/flake.nix +++ b/flake.nix @@ -499,7 +499,7 @@ { inherit hlsFor hlsFor' applyPlutarchDep; - # Build matrix. Plutarch is built against different GHC versions, and 'development' flag. + # Build matrix. Plutarch is built against different GHC versions. projectMatrix = { ghc9 = perSystem projectFor; ghc810 = perSystem projectFor810; diff --git a/plutarch-test/README.md b/plutarch-test/README.md index e49aeadc6..ac0dbebd9 100644 --- a/plutarch-test/README.md +++ b/plutarch-test/README.md @@ -25,12 +25,6 @@ bin/ghcid test:dev Note: `cabal run` should be run inside `./plutarch-test` directory. -## The `development` flag - -Plutarch has a `development` flag. Right now, the flag is used to control tracing functions, wherein turning on the flag will inject `Trace` instructions in the generated UPLC. - -Since this will impact the printTerm goldens in tests, we provide `plutarchDevFlagDescribe` that should be used everywhere in the test hierarchy where the immediate sub-tree of tests are known to use tracing functions (or any other development-flag-specific features to use tracing functions (or any other development-flag-specific features). - ## Goldens ### Navigation diff --git a/plutarch-test/common/Plutarch/Test.hs b/plutarch-test/common/Plutarch/Test.hs index a19319831..65c092b15 100644 --- a/plutarch-test/common/Plutarch/Test.hs +++ b/plutarch-test/common/Plutarch/Test.hs @@ -15,9 +15,6 @@ module Plutarch.Test ( -- * Budget expectation psatisfyWithinBenchmark, - -- * For Development flag tests - plutarchDevFlagDescribe, - -- * Golden testing (@|), (@\), @@ -65,7 +62,7 @@ import Plutarch.Test.Golden ( ) import Plutarch.Test.Run (hspecAndReturnForest, noUnusedGoldens, noUnusedGoldens') import qualified PlutusLedgerApi.V1.Scripts as Scripts -import Test.Hspec (Expectation, Spec, describe, expectationFailure, shouldBe, shouldSatisfy) +import Test.Hspec (Expectation, expectationFailure, shouldBe, shouldSatisfy) import Test.Tasty.HUnit (assertFailure) comp :: ClosedTerm a -> Scripts.Script @@ -136,10 +133,7 @@ psatisfyWithinBenchmark bench maxBudget = do shouldSatisfy bench $ \_ -> scriptSizeBytes bench <= scriptSizeBytes maxBudget -{- | Asserts that the term evaluates successfully with the given trace sequence - - See also: `plutarchDevFlagDescribe` --} +-- | Asserts that the term evaluates successfully with the given trace sequence ptraces :: ClosedTerm a -> [Text] -> Expectation ptraces p develTraces = case evalScript $ comp p of @@ -147,18 +141,6 @@ ptraces p develTraces = (Right _, _, traceLog) -> do traceLog `shouldBe` develTraces -{- | Like `describe`, but determines description from `Development` CPP flag - - Useful to create two sets of othersise identical group of tests that differ - only by `Development` flag. This has the effect of creating two sets of golden - tests (with different filepaths) for corresponding flag values. - - Typically meant to be used in conjunction with `ptraces`. --} -plutarchDevFlagDescribe :: Spec -> Spec -plutarchDevFlagDescribe m = - describe "dev=true" m - -- | Test that the Plutarch program evaluates to the given term (@==) :: ClosedTerm a -> ClosedTerm b -> TermExpectation a (@==) p x = p @:-> \(_, script, _) -> script `pscriptShouldBe` xScript diff --git a/plutarch-test/common/Plutarch/Test/Golden.hs b/plutarch-test/common/Plutarch/Test/Golden.hs index c5297d647..12b7179bc 100644 --- a/plutarch-test/common/Plutarch/Test/Golden.hs +++ b/plutarch-test/common/Plutarch/Test/Golden.hs @@ -135,7 +135,7 @@ infixr 1 @:-> instance HasGoldenValue TermExpectation' where mkGoldenValue (TermExpectation p f) = - mkGoldenValue' p (Just $ (\pe b -> f (p, pe, b))) + mkGoldenValue' p (Just $ \pe b -> f (p, pe, b)) -- | The key used in the .golden files containing multiple golden values newtype GoldenKey = GoldenKey Text diff --git a/plutarch-test/conditional/Plutarch/MonadicSpec.hs b/plutarch-test/conditional/Plutarch/MonadicSpec.hs index a5ac241ad..3c082bb4e 100644 --- a/plutarch-test/conditional/Plutarch/MonadicSpec.hs +++ b/plutarch-test/conditional/Plutarch/MonadicSpec.hs @@ -65,7 +65,7 @@ spec = do describe "api.example" $ do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. - describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "signatory" . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" "do" @\ do "succeeds" @| checkSignatory # pconstant aSig # ApiSpec.ctx @-> psucceeds diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 233ed0e81..eda4a13b6 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -51,7 +51,7 @@ import Test.Hspec spec :: Spec spec = do - describe "data-verif" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "data-verif" . pgoldenSpec $ do "erroneous" @\ do "(String, Integer) /= (String, String)" @| checkDeep diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/api.example.signatory.bench.golden similarity index 100% rename from plutarch-test/goldens/api.example.signatory.dev=true.bench.golden rename to plutarch-test/goldens/api.example.signatory.bench.golden diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.example.signatory.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/api.example.signatory.dev=true.uplc.eval.golden rename to plutarch-test/goldens/api.example.signatory.uplc.eval.golden diff --git a/plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/api.example.signatory.uplc.golden similarity index 100% rename from plutarch-test/goldens/api.example.signatory.dev=true.uplc.golden rename to plutarch-test/goldens/api.example.signatory.uplc.golden diff --git a/plutarch-test/goldens/api.value.dev=true.bench.golden b/plutarch-test/goldens/api.value.bench.golden similarity index 100% rename from plutarch-test/goldens/api.value.dev=true.bench.golden rename to plutarch-test/goldens/api.value.bench.golden diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/api.value.dev=true.uplc.eval.golden rename to plutarch-test/goldens/api.value.uplc.eval.golden diff --git a/plutarch-test/goldens/api.value.dev=true.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden similarity index 100% rename from plutarch-test/goldens/api.value.dev=true.uplc.golden rename to plutarch-test/goldens/api.value.uplc.golden diff --git a/plutarch-test/goldens/data-verif.bench.golden b/plutarch-test/goldens/data-verif.bench.golden new file mode 100644 index 000000000..11377ff09 --- /dev/null +++ b/plutarch-test/goldens/data-verif.bench.golden @@ -0,0 +1,36 @@ +erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":911716,"exBudgetMemory":612,"scriptSizeBytes":123} +erroneous.[String] /= [Integer] {"exBudgetCPU":467623,"exBudgetMemory":388,"scriptSizeBytes":101} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":304406,"exBudgetMemory":356,"scriptSizeBytes":128} +erroneous.Map Int String /= Map Int Int {"exBudgetCPU":733650,"exBudgetMemory":548,"scriptSizeBytes":165} +erroneous.PDataSum constr 2 {"exBudgetCPU":700994,"exBudgetMemory":230,"scriptSizeBytes":197} +erroneous.PDataSum wrong record type {"exBudgetCPU":990483,"exBudgetMemory":232,"scriptSizeBytes":256} +erroneous.[ByteString] (with length == 2) /= PRational {"exBudgetCPU":1656457,"exBudgetMemory":554,"scriptSizeBytes":231} +erroneous.[Integer] (with length == 0) /= PRational {"exBudgetCPU":761999,"exBudgetMemory":230,"scriptSizeBytes":193} +erroneous.[Integer] (with length == 3) /= PRational {"exBudgetCPU":2227517,"exBudgetMemory":524,"scriptSizeBytes":239} +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational {"exBudgetCPU":2156288,"exBudgetMemory":524,"scriptSizeBytes":225} +working.(String, String) == (String, String) {"exBudgetCPU":4806613,"exBudgetMemory":14428,"scriptSizeBytes":123} +working.[String] == [String] {"exBudgetCPU":4994603,"exBudgetMemory":16904,"scriptSizeBytes":114} +working.[Integer] (with length == 2) == PRational {"exBudgetCPU":9654221,"exBudgetMemory":28350,"scriptSizeBytes":385} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":128} +working.Map Int String == Map Int String {"exBudgetCPU":7666648,"exBudgetMemory":23744,"scriptSizeBytes":165} +working.PDataSum constr 0 {"exBudgetCPU":3276445,"exBudgetMemory":10722,"scriptSizeBytes":256} +working.PDataSum constr 1 {"exBudgetCPU":3841934,"exBudgetMemory":11924,"scriptSizeBytes":256} +working.recover PWrapInt {"exBudgetCPU":460390,"exBudgetMemory":1065,"scriptSizeBytes":15} +recovering a record partially vs completely.partially {"exBudgetCPU":2860826,"exBudgetMemory":9644,"scriptSizeBytes":124} +recovering a record partially vs completely.completely {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":128} +removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":899579,"exBudgetMemory":612,"scriptSizeBytes":117} +removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":479760,"exBudgetMemory":388,"scriptSizeBytes":114} +removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":4806613,"exBudgetMemory":14428,"scriptSizeBytes":123} +removing the data wrapper.working.[String] == [String] {"exBudgetCPU":4994603,"exBudgetMemory":16904,"scriptSizeBytes":114} +removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":167380333,"exBudgetMemory":531268,"scriptSizeBytes":1524} +removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":44823600,"exBudgetMemory":145544,"scriptSizeBytes":1494} +removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":3700361,"exBudgetMemory":12008,"scriptSizeBytes":142} +removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":419232,"exBudgetMemory":420,"scriptSizeBytes":142} +removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":3442374,"exBudgetMemory":10849,"scriptSizeBytes":132} +example.concatenate two lists, legal {"exBudgetCPU":40490231,"exBudgetMemory":108115,"scriptSizeBytes":893} +example.concatenate two lists, illegal (list too short) {"exBudgetCPU":34624552,"exBudgetMemory":84921,"scriptSizeBytes":886} +example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":40012573,"exBudgetMemory":105147,"scriptSizeBytes":893} +example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":26315696,"exBudgetMemory":63576,"scriptSizeBytes":914} +example2.recovering a record succeeds {"exBudgetCPU":4617699,"exBudgetMemory":14942,"scriptSizeBytes":341} \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=false.bench.golden b/plutarch-test/goldens/data-verif.dev=false.bench.golden deleted file mode 100644 index e138d9741..000000000 --- a/plutarch-test/goldens/data-verif.dev=false.bench.golden +++ /dev/null @@ -1,31 +0,0 @@ -erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} -erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":97} -erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} -erroneous.PDataSum constr 2 {"exBudgetCPU":587969,"exBudgetMemory":198,"scriptSizeBytes":92} -erroneous.PDataSum wrong record type {"exBudgetCPU":725838,"exBudgetMemory":200,"scriptSizeBytes":145} -working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} -working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":5439216,"exBudgetMemory":9876,"scriptSizeBytes":90} -working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":5439216,"exBudgetMemory":9876,"scriptSizeBytes":90} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":5528535,"exBudgetMemory":10176,"scriptSizeBytes":97} -working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} -working.PDataSum constr 0 {"exBudgetCPU":4496177,"exBudgetMemory":10022,"scriptSizeBytes":145} -working.PDataSum constr 1 {"exBudgetCPU":4991322,"exBudgetMemory":11224,"scriptSizeBytes":145} -working.recover PWrapInt {"exBudgetCPU":705925,"exBudgetMemory":1065,"scriptSizeBytes":15} -recovering a record partially vs completely.partially {"exBudgetCPU":5229670,"exBudgetMemory":9644,"scriptSizeBytes":92} -recovering a record partially vs completely.completely {"exBudgetCPU":5528535,"exBudgetMemory":10176,"scriptSizeBytes":96} -removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} -removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} -removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} -removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} -removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} -removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":6006038,"exBudgetMemory":11308,"scriptSizeBytes":100} -removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":100} -removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":5096176,"exBudgetMemory":10149,"scriptSizeBytes":90} -example.concatenate two lists, legal {"exBudgetCPU":54126198,"exBudgetMemory":103259,"scriptSizeBytes":700} -example.concatenate two lists, illegal (list too short) {"exBudgetCPU":47367778,"exBudgetMemory":84633,"scriptSizeBytes":694} -example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":48647966,"exBudgetMemory":84859,"scriptSizeBytes":700} -example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35022714,"exBudgetMemory":63352,"scriptSizeBytes":721} -example2.recovering a record succeeds {"exBudgetCPU":7157324,"exBudgetMemory":14242,"scriptSizeBytes":227} \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=false.uplc.golden b/plutarch-test/goldens/data-verif.dev=false.uplc.golden deleted file mode 100644 index 1a99db26e..000000000 --- a/plutarch-test/goldens/data-verif.dev=false.uplc.golden +++ /dev/null @@ -1,31 +0,0 @@ -erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) -erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay error)))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i3)) (force tailList)) (force headList)) #d87a9f0543666f6fff)) -erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unBData i1)) (i7 i1))) (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i5)) (force ifThenElse)) (force (force chooseList))) (force tailList)) (force headList)) #d87b9f0543666f6fff)) -working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) -working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) -working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i5)) (force ifThenElse)) (force (force chooseList))) (force tailList)) (force headList)) #d8799f0543666f6fff)) -working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i9) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i5)) (force ifThenElse)) (force (force chooseList))) (force tailList)) (force headList)) #d87a9f0543666f6fff)) -working.recover PWrapInt (program 1.0.0 (equalsInteger 42 (unIData (iData 42)))) -recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (iData 3) (i10 (bData i11) i12))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i6 i2)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) -recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 3) (i11 (bData i12) i13))) (force (force (force chooseList) i1 (delay ()) (delay error)))) (i7 i3)) (unBData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) -removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) -removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) -removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i13 (listData (i13 (iData 42) i14)) i14)) (force (i9 i1 (delay ()) (delay error)))) (i9 i7)) (force (i7 i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (unListData i1)) (i4 i1)) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5)))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i13 (listData (i13 (iData 42) i14)) i14)) (force (i9 i1 (delay ()) (delay error)))) (i9 i7)) (force (i7 i1 (delay ()) (delay error)))) (i7 i3)) (unBData i1)) (i6 i1)) (unListData i1)) (i4 i1)) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5)))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (force (i9 i1 (delay ()) (delay error)))) (i9 i7)) (force (i7 i1 (delay ()) (delay error)))) (i7 i3)) (unIData i1)) (i6 i1)) (unListData i1)) (i4 i1)) (unListData (listData (i4 (listData (i4 (iData 42) i5)) i5))))) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) [ ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) i10))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 8) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay error))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i20) (delay ((\i0 -> force (i19 (i4 i1) (delay (i20 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i19) (delay ((\i0 -> force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay error))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (i19 (i16 (i17 i1)) (i3 (i17 i2)))) (delay (i3 (i17 i2))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i20 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay error))) (i8 (i12 (i13 (i8 i1))))) (delay error)) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i16) (delay (i15 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay error) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i9 (iData 1) (i9 (iData 2) (i9 (iData 3) (i9 (iData 4) (i9 (iData 5) i10)))))) (listData (i9 (iData 6) (i9 (iData 7) (i9 (iData 8) (i9 (iData 9) (i9 (iData 10) i10)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force mkCons)) [ ])) -example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i9 (iData 4) (i9 (bData i10) i11))) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) (unIData i1)) (i7 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay error)))) (i11 i3)) (unBData i1)) (i10 i1)) (i8 i3)) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i9 i1 (delay i14) (delay (i12 (i3 (i11 i1)) (i2 (i10 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (i7 i1))) (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData (constrData 0 (i5 (iData 4) (i5 (bData i6) i7))))) (force ifThenElse)) (force (force chooseList))) (force tailList)) (force headList)) (force mkCons)) #666f6f) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=true.bench.golden b/plutarch-test/goldens/data-verif.dev=true.bench.golden deleted file mode 100644 index f23dae053..000000000 --- a/plutarch-test/goldens/data-verif.dev=true.bench.golden +++ /dev/null @@ -1,31 +0,0 @@ -erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":123} -erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":101} -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":1200100,"exBudgetMemory":356,"scriptSizeBytes":128} -erroneous.Map Int String /= Map Int Int {"exBudgetCPU":2100100,"exBudgetMemory":548,"scriptSizeBytes":165} -erroneous.PDataSum constr 2 {"exBudgetCPU":737969,"exBudgetMemory":230,"scriptSizeBytes":197} -erroneous.PDataSum wrong record type {"exBudgetCPU":875838,"exBudgetMemory":232,"scriptSizeBytes":256} -working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} -working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":5439216,"exBudgetMemory":9876,"scriptSizeBytes":122} -working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":5439216,"exBudgetMemory":9876,"scriptSizeBytes":122} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":5528535,"exBudgetMemory":10176,"scriptSizeBytes":128} -working.Map Int String == Map Int String {"exBudgetCPU":12939479,"exBudgetMemory":23744,"scriptSizeBytes":165} -working.PDataSum constr 0 {"exBudgetCPU":4704588,"exBudgetMemory":10722,"scriptSizeBytes":256} -working.PDataSum constr 1 {"exBudgetCPU":5199733,"exBudgetMemory":11924,"scriptSizeBytes":256} -working.recover PWrapInt {"exBudgetCPU":705925,"exBudgetMemory":1065,"scriptSizeBytes":15} -recovering a record partially vs completely.partially {"exBudgetCPU":5229670,"exBudgetMemory":9644,"scriptSizeBytes":124} -recovering a record partially vs completely.completely {"exBudgetCPU":5528535,"exBudgetMemory":10176,"scriptSizeBytes":128} -removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":2400100,"exBudgetMemory":612,"scriptSizeBytes":117} -removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":1350100,"exBudgetMemory":388,"scriptSizeBytes":114} -removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":8339682,"exBudgetMemory":14428,"scriptSizeBytes":123} -removing the data wrapper.working.[String] == [String] {"exBudgetCPU":8093553,"exBudgetMemory":16904,"scriptSizeBytes":114} -removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":287941468,"exBudgetMemory":531268,"scriptSizeBytes":1524} -removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":101880233,"exBudgetMemory":145544,"scriptSizeBytes":1494} -removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":6214449,"exBudgetMemory":12008,"scriptSizeBytes":142} -removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":1500100,"exBudgetMemory":420,"scriptSizeBytes":142} -removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":5304587,"exBudgetMemory":10849,"scriptSizeBytes":132} -example.concatenate two lists, legal {"exBudgetCPU":54902566,"exBudgetMemory":104923,"scriptSizeBytes":1096} -example.concatenate two lists, illegal (list too short) {"exBudgetCPU":47817778,"exBudgetMemory":84729,"scriptSizeBytes":1089} -example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":55052566,"exBudgetMemory":104955,"scriptSizeBytes":1096} -example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":35172714,"exBudgetMemory":63384,"scriptSizeBytes":1117} -example2.recovering a record succeeds {"exBudgetCPU":7365735,"exBudgetMemory":14942,"scriptSizeBytes":341} \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=true.uplc.eval.golden b/plutarch-test/goldens/data-verif.dev=true.uplc.eval.golden deleted file mode 100644 index 7a6315f76..000000000 --- a/plutarch-test/goldens/data-verif.dev=true.uplc.eval.golden +++ /dev/null @@ -1,31 +0,0 @@ -erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) -erroneous.[String] /= [Integer] (program 1.0.0 error) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 error) -erroneous.Map Int String /= Map Int Int (program 1.0.0 error) -erroneous.PDataSum constr 2 (program 1.0.0 error) -erroneous.PDataSum wrong record type (program 1.0.0 error) -working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) -working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) -working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) -working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) -working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) -working.recover PWrapInt (program 1.0.0 True) -recovering a record partially vs completely.partially (program 1.0.0 #9f034362617aff) -recovering a record partially vs completely.completely (program 1.0.0 #9f034362617aff) -removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) -removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 error) -removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) -removing the data wrapper.working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) -removing the data wrapper.partial checks.check whole structure (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) -removing the data wrapper.partial checks.check structure partly (program 1.0.0 #9f9f9f0102030405060708090a0b0c0d0e0f101112131415161718181819181a181b181c181d181e181f1820182118221823182418251826182718281829182a182b182c182d182e182f1830183118321833183418351836183718381839183a183b183c183d183e183f1840184118421843184418451846184718481849184a184b184c184d184e184f1850185118521853185418551856185718581859185a185b185c185d185e185f18601861186218631864ffffff) -removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 #9f9f182affff) -removing the data wrapper.recovering a nested record.fails (program 1.0.0 error) -removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 True) -example.concatenate two lists, legal (program 1.0.0 ()) -example.concatenate two lists, illegal (list too short) (program 1.0.0 error) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 error) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 error) -example2.recovering a record succeeds (program 1.0.0 #d8799f0443666f6fff) \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.dev=false.uplc.eval.golden b/plutarch-test/goldens/data-verif.uplc.eval.golden similarity index 89% rename from plutarch-test/goldens/data-verif.dev=false.uplc.eval.golden rename to plutarch-test/goldens/data-verif.uplc.eval.golden index 7a6315f76..e45348c28 100644 --- a/plutarch-test/goldens/data-verif.dev=false.uplc.eval.golden +++ b/plutarch-test/goldens/data-verif.uplc.eval.golden @@ -4,8 +4,13 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int (program 1.0.0 error) erroneous.PDataSum constr 2 (program 1.0.0 error) erroneous.PDataSum wrong record type (program 1.0.0 error) +erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 error) +erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 error) +erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 error) +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 error) working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) +working.[Integer] (with length == 2) == PRational (program 1.0.0 ()) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) diff --git a/plutarch-test/goldens/data-verif.dev=true.uplc.golden b/plutarch-test/goldens/data-verif.uplc.golden similarity index 60% rename from plutarch-test/goldens/data-verif.dev=true.uplc.golden rename to plutarch-test/goldens/data-verif.uplc.golden index cc6df7795..19d330b46 100644 --- a/plutarch-test/goldens/data-verif.dev=true.uplc.golden +++ b/plutarch-test/goldens/data-verif.uplc.golden @@ -4,8 +4,13 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i8) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay (force (i12 "list is longer than zero" (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i4)) (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unBData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87b9f0543666f6fff)) +erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (bData i9) i10))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 (bData i4) (i5 (bData i6) i7))))) (force ifThenElse)) (force tailList)) (force trace)) #41) (force mkCons)) #2b) [ ])) +erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData i7) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData i4))) (force ifThenElse)) (force tailList)) (force trace)) [ ])) +erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i9 i7 (i9 i8 (i9 i10 i11)))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i4 (i6 i5 (i6 i7 i8)))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) #07) (force mkCons)) #00) [ ])) +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 i7 (i8 i9 i10))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 i4 (i5 i6 i7))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) (force mkCons)) #00) [ ])) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) +working.[Integer] (with length == 2) == PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i7 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> force (i4 (equalsInteger i1 (unIData i10)) (delay (force (i4 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (unIData (i8 (i9 i2)))) (unIData (i7 i1))) (unListData i1)) (listData (i9 i8 (i9 i10 i11)))) ((\i0 -> \i0 -> i1 i2 i3) (unIData i8))) (delay ()) (delay (force (i7 "drat should be as expected" (delay error))))))) (delay (force (i7 "non-zero should be as expected" (delay error)))))) (force (i3 (equalsInteger i1 0) (delay (force (i6 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (i3 (i4 i1))))) (delay (force (i5 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i5 (i6 i7 i8))))) (force ifThenElse)) (force headList)) (force tailList)) (force trace)) #182a) (force mkCons)) #181f) [ ])) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) @@ -24,8 +29,8 @@ removing the data wrapper.partial checks.check structure partly (program 1.0.0 ( removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i15 (listData (i15 (iData 42) i16)) i16)) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unIData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force trace)) "list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i15 (listData (i15 (iData 42) i16)) i16)) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force trace)) "list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unIData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7))))) (force (force chooseList))) (force trace)) "list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) -example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:355:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:305:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:296:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:355:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:305:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:296:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) i11))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:355:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:305:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:296:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 8) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i17 (equalsInteger 1 i2) (delay (i13 (\i0 -> \i0 -> \i0 -> force (i17 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i20 (i2 (i18 i1)) (delay (\i0 -> \i0 -> i2 (i20 i3))) (delay (i3 i2 (i19 i1)))))))) (\i0 -> equalsData (i16 i2) (i16 (i12 i1))) ((\i0 -> unListData (i16 (i12 i1))) (i15 i4)))) (delay (force (i18 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:355:5-22" (delay error)))))) (i11 i2)) (i8 i1)) (unConstrData (i12 (i13 i1)))) (i7 i3) (\i0 -> (\i0 -> force (i15 (force (i15 (force nullList (i14 ((\i0 -> i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i19 (i4 i1) (delay (i21 i1 (i3 (i18 i2)))) (delay (i3 (i18 i2))))) (i16 i1)))))) (\i0 -> equalsData (i14 (i10 i1)) (i14 i2)) (unListData (i13 (i14 (i9 i3))))))) (delay (equalsData (i13 (i11 (\i0 -> \i0 -> force (i14 i1 (delay i20) (delay ((\i0 -> force (i19 "iteration" (delay (force (i18 (equalsByteString (unBData (i16 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i21 (equalsInteger 0 i2) (delay (unBData (i19 i1))) (delay (force (i22 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:305:11-22" (delay error)))))) (i15 i2)) (i12 i1)) (unConstrData (i16 (i17 (i17 i4)))))) (delay (force (i19 "appended something" (delay i20)) (i16 (i17 i1)) (i3 (i17 i2)))) (delay (force (i19 "called without appending" (delay i3)) (i17 i2)))))))) (i11 (i15 i1)))))) (unListData (i13 ((\i0 -> i15 (i15 (i15 (i15 (i15 (i15 (i15 (i15 i1)))))))) (i9 i3)))))) (listData ((\i0 -> \i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i3) (delay (i21 (i17 i1) (i2 (i18 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i16 "not valid" (delay error)))))) (i8 (i12 (i13 (i8 i1))))) (delay (force (i14 "Pattern match failure in 'do' block at conditional/Plutarch/TryFromSpec.hs:296:5-18" (delay error))))) (i10 (i6 i2))) ((\i0 -> i8 (\i0 -> \i0 -> force (i11 i1 (delay i17) (delay (i16 (i3 (i12 i1)) (i2 (i13 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i13 (lessThanInteger i1 0) (delay (force (i14 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i10 (iData 1) (i10 (iData 2) (i10 (iData 3) (i10 (iData 4) (i10 (iData 5) i11)))))) (listData (i10 (iData 6) (i10 (iData 7) (i10 (iData 8) (i10 (iData 9) (i10 (iData 10) i11)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (equalsInteger 1 i2) (delay (i14 (\i0 -> \i0 -> \i0 -> force (i18 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i21 (i2 (i19 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i19 i1))) (delay (i3 i2 (i20 i1)))))))) (\i0 -> (\i0 -> \i0 -> equalsData (listData (i15 i2)) (listData (i15 i1))) (i17 i2) (i17 (i13 i1))) ((\i0 -> unListData (i17 (i13 i1))) (i16 i4)))) (delay (force (i19 i11 (delay error)))))) (i12 i2)) (i8 i1)) (unConstrData (i13 (i14 i1)))) (i8 i3) (\i0 -> (\i0 -> force (i16 (force (i16 (force nullList (i15 ((\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i22) (delay ((\i0 -> force (i20 (i4 i1) (delay (i22 i1 (i3 (i19 i2)))) (delay (i3 (i19 i2))))) (i17 i1)))))) (\i0 -> equalsData (i15 (i11 i1)) (i15 i2)) (unListData (i14 (i15 (i10 i3))))))) (delay (equalsData (i14 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i20 "iteration" (delay (force (i19 (equalsByteString (unBData (i17 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 i15 (delay error)))))) (i16 i2)) (i12 i1)) (unConstrData (i17 (i18 (i18 i4)))))) (delay (force (i20 "appended something" (delay i21)) (i17 (i18 i1)) (i3 (i18 i2)))) (delay (force (i20 "called without appending" (delay i3)) (i18 i2)))))))) (i12 (i16 i1)))))) (unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i16 (i16 i1)))))))) (i10 i3)))))) (listData ((\i0 -> \i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay i3) (delay (i22 (i18 i1) (i2 (i19 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i17 "not valid" (delay error)))))) (i9 (i13 (i14 (i9 i1))))) (delay (force (i15 i7 (delay error))))) (i11 (i7 i2))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i18) (delay (i17 (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i14 (lessThanInteger i1 0) (delay (force (i15 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) "Pattern matching failure in TermCont") (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (equalsInteger 1 i2) (delay (i14 (\i0 -> \i0 -> \i0 -> force (i18 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i21 (i2 (i19 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i19 i1))) (delay (i3 i2 (i20 i1)))))))) (\i0 -> (\i0 -> \i0 -> equalsData (listData (i15 i2)) (listData (i15 i1))) (i17 i2) (i17 (i13 i1))) ((\i0 -> unListData (i17 (i13 i1))) (i16 i4)))) (delay (force (i19 i11 (delay error)))))) (i12 i2)) (i8 i1)) (unConstrData (i13 (i14 i1)))) (i8 i3) (\i0 -> (\i0 -> force (i16 (force (i16 (force nullList (i15 ((\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i22) (delay ((\i0 -> force (i20 (i4 i1) (delay (i22 i1 (i3 (i19 i2)))) (delay (i3 (i19 i2))))) (i17 i1)))))) (\i0 -> equalsData (i15 (i11 i1)) (i15 i2)) (unListData (i14 (i15 (i10 i3))))))) (delay (equalsData (i14 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i20 "iteration" (delay (force (i19 (equalsByteString (unBData (i17 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 i15 (delay error)))))) (i16 i2)) (i12 i1)) (unConstrData (i17 (i18 (i18 i4)))))) (delay (force (i20 "appended something" (delay i21)) (i17 (i18 i1)) (i3 (i18 i2)))) (delay (force (i20 "called without appending" (delay i3)) (i18 i2)))))))) (i12 (i16 i1)))))) (unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i16 (i16 i1)))))))) (i10 i3)))))) (listData ((\i0 -> \i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay i3) (delay (i22 (i18 i1) (i2 (i19 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i17 "not valid" (delay error)))))) (i9 (i13 (i14 (i9 i1))))) (delay (force (i15 i7 (delay error))))) (i11 (i7 i2))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i18) (delay (i17 (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i14 (lessThanInteger i1 0) (delay (force (i15 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) i12))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) "Pattern matching failure in TermCont") (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (equalsInteger 1 i2) (delay (i14 (\i0 -> \i0 -> \i0 -> force (i18 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i21 (i2 (i19 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i19 i1))) (delay (i3 i2 (i20 i1)))))))) (\i0 -> (\i0 -> \i0 -> equalsData (listData (i15 i2)) (listData (i15 i1))) (i17 i2) (i17 (i13 i1))) ((\i0 -> unListData (i17 (i13 i1))) (i16 i4)))) (delay (force (i19 i11 (delay error)))))) (i12 i2)) (i8 i1)) (unConstrData (i13 (i14 i1)))) (i8 i3) (\i0 -> (\i0 -> force (i16 (force (i16 (force nullList (i15 ((\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i22) (delay ((\i0 -> force (i20 (i4 i1) (delay (i22 i1 (i3 (i19 i2)))) (delay (i3 (i19 i2))))) (i17 i1)))))) (\i0 -> equalsData (i15 (i11 i1)) (i15 i2)) (unListData (i14 (i15 (i10 i3))))))) (delay (equalsData (i14 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i20 "iteration" (delay (force (i19 (equalsByteString (unBData (i17 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 i15 (delay error)))))) (i16 i2)) (i12 i1)) (unConstrData (i17 (i18 (i18 i4)))))) (delay (force (i20 "appended something" (delay i21)) (i17 (i18 i1)) (i3 (i18 i2)))) (delay (force (i20 "called without appending" (delay i3)) (i18 i2)))))))) (i12 (i16 i1)))))) (unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i16 (i16 i1)))))))) (i10 i3)))))) (listData ((\i0 -> \i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay i3) (delay (i22 (i18 i1) (i2 (i19 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i17 "not valid" (delay error)))))) (i9 (i13 (i14 (i9 i1))))) (delay (force (i15 i7 (delay error))))) (i11 (i7 i2))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i18) (delay (i17 (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i14 (lessThanInteger i1 0) (delay (force (i15 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 8) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) "Pattern matching failure in TermCont") (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) +example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (equalsInteger 1 i2) (delay (i14 (\i0 -> \i0 -> \i0 -> force (i18 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i21 (i2 (i19 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i19 i1))) (delay (i3 i2 (i20 i1)))))))) (\i0 -> (\i0 -> \i0 -> equalsData (listData (i15 i2)) (listData (i15 i1))) (i17 i2) (i17 (i13 i1))) ((\i0 -> unListData (i17 (i13 i1))) (i16 i4)))) (delay (force (i19 i11 (delay error)))))) (i12 i2)) (i8 i1)) (unConstrData (i13 (i14 i1)))) (i8 i3) (\i0 -> (\i0 -> force (i16 (force (i16 (force nullList (i15 ((\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i22) (delay ((\i0 -> force (i20 (i4 i1) (delay (i22 i1 (i3 (i19 i2)))) (delay (i3 (i19 i2))))) (i17 i1)))))) (\i0 -> equalsData (i15 (i11 i1)) (i15 i2)) (unListData (i14 (i15 (i10 i3))))))) (delay (equalsData (i14 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i20 "iteration" (delay (force (i19 (equalsByteString (unBData (i17 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 i15 (delay error)))))) (i16 i2)) (i12 i1)) (unConstrData (i17 (i18 (i18 i4)))))) (delay (force (i20 "appended something" (delay i21)) (i17 (i18 i1)) (i3 (i18 i2)))) (delay (force (i20 "called without appending" (delay i3)) (i18 i2)))))))) (i12 (i16 i1)))))) (unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i16 (i16 i1)))))))) (i10 i3)))))) (listData ((\i0 -> \i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay i3) (delay (i22 (i18 i1) (i2 (i19 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i17 "not valid" (delay error)))))) (i9 (i13 (i14 (i9 i1))))) (delay (force (i15 i7 (delay error))))) (i11 (i7 i2))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i18) (delay (i17 (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i14 (lessThanInteger i1 0) (delay (force (i15 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) "Pattern matching failure in TermCont") (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i11 (iData 4) (i11 (bData i12) i13))) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i12 i1 (delay ()) (delay (force (i15 i11 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i12 i1 (delay ()) (delay (force (i15 i11 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i10 i1 (delay i16) (delay (i14 (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData (constrData 0 (i7 (iData 4) (i7 (bData i8) i9))))) (force ifThenElse)) "list is longer than zero") (force (force chooseList))) (force tailList)) (force headList)) (force trace)) (force mkCons)) #666f6f) [ ])) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.api.dev=true.bench.golden b/plutarch-test/goldens/extra.api.bench.golden similarity index 100% rename from plutarch-test/goldens/extra.api.dev=true.bench.golden rename to plutarch-test/goldens/extra.api.bench.golden diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden b/plutarch-test/goldens/extra.api.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/extra.api.dev=true.uplc.eval.golden rename to plutarch-test/goldens/extra.api.uplc.eval.golden diff --git a/plutarch-test/goldens/extra.api.dev=true.uplc.golden b/plutarch-test/goldens/extra.api.uplc.golden similarity index 100% rename from plutarch-test/goldens/extra.api.dev=true.uplc.golden rename to plutarch-test/goldens/extra.api.uplc.golden diff --git a/plutarch-test/goldens/list.dev=true.bench.golden b/plutarch-test/goldens/list.bench.golden similarity index 100% rename from plutarch-test/goldens/list.dev=true.bench.golden rename to plutarch-test/goldens/list.bench.golden diff --git a/plutarch-test/goldens/list.dev=true.uplc.eval.golden b/plutarch-test/goldens/list.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/list.dev=true.uplc.eval.golden rename to plutarch-test/goldens/list.uplc.eval.golden diff --git a/plutarch-test/goldens/list.dev=true.uplc.golden b/plutarch-test/goldens/list.uplc.golden similarity index 100% rename from plutarch-test/goldens/list.dev=true.uplc.golden rename to plutarch-test/goldens/list.uplc.golden diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden b/plutarch-test/goldens/monadic.api.example.signatory.bench.golden similarity index 100% rename from plutarch-test/goldens/monadic.api.example.signatory.dev=true.bench.golden rename to plutarch-test/goldens/monadic.api.example.signatory.bench.golden diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden b/plutarch-test/goldens/monadic.api.example.signatory.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.eval.golden rename to plutarch-test/goldens/monadic.api.example.signatory.uplc.eval.golden diff --git a/plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden b/plutarch-test/goldens/monadic.api.example.signatory.uplc.golden similarity index 100% rename from plutarch-test/goldens/monadic.api.example.signatory.dev=true.uplc.golden rename to plutarch-test/goldens/monadic.api.example.signatory.uplc.golden diff --git a/plutarch-test/goldens/rational.bench.golden b/plutarch-test/goldens/rational.bench.golden new file mode 100644 index 000000000..57bcdf69e --- /dev/null +++ b/plutarch-test/goldens/rational.bench.golden @@ -0,0 +1,24 @@ +literal {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} +ops.+ {"exBudgetCPU":33573901,"exBudgetMemory":84401,"scriptSizeBytes":378} +ops.- {"exBudgetCPU":33573901,"exBudgetMemory":84401,"scriptSizeBytes":378} +ops.* {"exBudgetCPU":58113426,"exBudgetMemory":142977,"scriptSizeBytes":437} +ops.harmonic-sum {"exBudgetCPU":85294919,"exBudgetMemory":207655,"scriptSizeBytes":441} +ops.multi-product {"exBudgetCPU":96083895,"exBudgetMemory":237989,"scriptSizeBytes":463} +compare {"exBudgetCPU":27193475,"exBudgetMemory":69077,"scriptSizeBytes":363} +round.5/3 {"exBudgetCPU":17926406,"exBudgetMemory":39749,"scriptSizeBytes":369} +round.4/3 {"exBudgetCPU":16470457,"exBudgetMemory":36646,"scriptSizeBytes":369} +round.-5/2 {"exBudgetCPU":17727920,"exBudgetMemory":39249,"scriptSizeBytes":383} +round.-1/4 {"exBudgetCPU":16837934,"exBudgetMemory":37348,"scriptSizeBytes":383} +truncate.5/4 {"exBudgetCPU":13897101,"exBudgetMemory":33539,"scriptSizeBytes":320} +truncate.7/4 {"exBudgetCPU":15353050,"exBudgetMemory":36642,"scriptSizeBytes":320} +truncate.1/4 {"exBudgetCPU":12441152,"exBudgetMemory":30436,"scriptSizeBytes":320} +truncate.-7/4 {"exBudgetCPU":17474953,"exBudgetMemory":40849,"scriptSizeBytes":334} +properFraction.-1/2 {"exBudgetCPU":40971082,"exBudgetMemory":103120,"scriptSizeBytes":504} +properFraction.-3/2 {"exBudgetCPU":42794508,"exBudgetMemory":106925,"scriptSizeBytes":506} +properFraction.-4/3 {"exBudgetCPU":42794508,"exBudgetMemory":106925,"scriptSizeBytes":506} +data.id.0.5 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} +data.id.2 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} +data.id.11/3 {"exBudgetCPU":13900637,"exBudgetMemory":33539,"scriptSizeBytes":274} +div by 0.1/0 {"exBudgetCPU":594827,"exBudgetMemory":136,"scriptSizeBytes":274} +div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":75} +div by 0.1/(1-1) {"exBudgetCPU":9194401,"exBudgetMemory":20168,"scriptSizeBytes":353} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.bench.golden b/plutarch-test/goldens/rational.dev=true.bench.golden deleted file mode 100644 index 3453ada43..000000000 --- a/plutarch-test/goldens/rational.dev=true.bench.golden +++ /dev/null @@ -1,24 +0,0 @@ -literal {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} -ops.+ {"exBudgetCPU":34125901,"exBudgetMemory":86801,"scriptSizeBytes":387} -ops.- {"exBudgetCPU":34125901,"exBudgetMemory":86801,"scriptSizeBytes":387} -ops.* {"exBudgetCPU":58941426,"exBudgetMemory":146577,"scriptSizeBytes":446} -ops.harmonic-sum {"exBudgetCPU":86536919,"exBudgetMemory":213055,"scriptSizeBytes":449} -ops.multi-product {"exBudgetCPU":97670895,"exBudgetMemory":244889,"scriptSizeBytes":472} -compare {"exBudgetCPU":27607475,"exBudgetMemory":70877,"scriptSizeBytes":372} -round.5/3 {"exBudgetCPU":18064406,"exBudgetMemory":40349,"scriptSizeBytes":375} -round.4/3 {"exBudgetCPU":16608457,"exBudgetMemory":37246,"scriptSizeBytes":375} -round.-5/2 {"exBudgetCPU":17865920,"exBudgetMemory":39849,"scriptSizeBytes":389} -round.-1/4 {"exBudgetCPU":16975934,"exBudgetMemory":37948,"scriptSizeBytes":389} -truncate.5/4 {"exBudgetCPU":14035101,"exBudgetMemory":34139,"scriptSizeBytes":325} -truncate.7/4 {"exBudgetCPU":15491050,"exBudgetMemory":37242,"scriptSizeBytes":325} -truncate.1/4 {"exBudgetCPU":12579152,"exBudgetMemory":31036,"scriptSizeBytes":325} -truncate.-7/4 {"exBudgetCPU":17612953,"exBudgetMemory":41449,"scriptSizeBytes":340} -properFraction.-1/2 {"exBudgetCPU":41051385,"exBudgetMemory":103922,"scriptSizeBytes":506} -properFraction.-3/2 {"exBudgetCPU":42874811,"exBudgetMemory":107727,"scriptSizeBytes":508} -properFraction.-4/3 {"exBudgetCPU":42874811,"exBudgetMemory":107727,"scriptSizeBytes":508} -data.id.0.5 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} -data.id.2 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} -data.id.11/3 {"exBudgetCPU":14038637,"exBudgetMemory":34139,"scriptSizeBytes":280} -div by 0.1/0 {"exBudgetCPU":687723,"exBudgetMemory":138,"scriptSizeBytes":280} -div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":76} -div by 0.1/(1-1) {"exBudgetCPU":9287297,"exBudgetMemory":20170,"scriptSizeBytes":359} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.uplc.golden b/plutarch-test/goldens/rational.dev=true.uplc.golden deleted file mode 100644 index 1286b3eb3..000000000 --- a/plutarch-test/goldens/rational.dev=true.uplc.golden +++ /dev/null @@ -1,24 +0,0 @@ -literal (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 6)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 9)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 10))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -data.id.0.5 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) -data.id.2 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 i2 i3))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (i12 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=true.uplc.eval.golden b/plutarch-test/goldens/rational.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/rational.dev=true.uplc.eval.golden rename to plutarch-test/goldens/rational.uplc.eval.golden diff --git a/plutarch-test/goldens/rational.uplc.golden b/plutarch-test/goldens/rational.uplc.golden new file mode 100644 index 000000000..4a57770e1 --- /dev/null +++ b/plutarch-test/goldens/rational.uplc.golden @@ -0,0 +1,24 @@ +literal (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 6)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 9)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 10))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +data.id.0.5 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) +data.id.2 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (equalsInteger i2 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i15 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (i12 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index 4d2f33849..24a27bd4d 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -32,4 +32,5 @@ list.1,2,3 {"exBudgetCPU":28141986,"exBudgetMemory":70956,"scriptSizeBytes":401} builtinlist.nil {"exBudgetCPU":2756985,"exBudgetMemory":11043,"scriptSizeBytes":389} builtinlist.1,2,3 {"exBudgetCPU":26137058,"exBudgetMemory":60484,"scriptSizeBytes":392} pair.int-str {"exBudgetCPU":34865639,"exBudgetMemory":80705,"scriptSizeBytes":454} -pair.int-list {"exBudgetCPU":42325700,"exBudgetMemory":93314,"scriptSizeBytes":434} \ No newline at end of file +pair.int-list {"exBudgetCPU":42325700,"exBudgetMemory":93314,"scriptSizeBytes":434} +rational.1/2 {"exBudgetCPU":24865887,"exBudgetMemory":59194,"scriptSizeBytes":553} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.bench.golden b/plutarch-test/goldens/show.dev=true.bench.golden deleted file mode 100644 index 325204863..000000000 --- a/plutarch-test/goldens/show.dev=true.bench.golden +++ /dev/null @@ -1 +0,0 @@ -rational.1/2 {"exBudgetCPU":25003887,"exBudgetMemory":59794,"scriptSizeBytes":560} \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.uplc.eval.golden b/plutarch-test/goldens/show.dev=true.uplc.eval.golden deleted file mode 100644 index 97ecea086..000000000 --- a/plutarch-test/goldens/show.dev=true.uplc.eval.golden +++ /dev/null @@ -1 +0,0 @@ -rational.1/2 (program 1.0.0 "1/2") \ No newline at end of file diff --git a/plutarch-test/goldens/show.dev=true.uplc.golden b/plutarch-test/goldens/show.dev=true.uplc.golden deleted file mode 100644 index e395a2a0d..000000000 --- a/plutarch-test/goldens/show.dev=true.uplc.golden +++ /dev/null @@ -1 +0,0 @@ -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i24 (equalsInteger i2 0) (delay 0) (delay (force (i24 (lessThanEqualsInteger i2 0) (delay (i23 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i30 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i26 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i25 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i22 i2)) (i21 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i14 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) "-") "") (\i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (force (i15 (equalsInteger i1 1) (delay i3) (delay (force (i15 (equalsInteger i1 2) (delay i4) (delay (force (i15 (equalsInteger i1 3) (delay i5) (delay (force (i15 (equalsInteger i1 4) (delay i6) (delay (force (i15 (equalsInteger i1 5) (delay i7) (delay (force (i15 (equalsInteger i1 6) (delay i8) (delay (force (i15 (equalsInteger i1 7) (delay i9) (delay (force (i15 (equalsInteger i1 8) (delay i10) (delay (force (i15 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.eval.golden b/plutarch-test/goldens/show.uplc.eval.golden index d1efb455b..fe0f3a9aa 100644 --- a/plutarch-test/goldens/show.uplc.eval.golden +++ b/plutarch-test/goldens/show.uplc.eval.golden @@ -32,4 +32,5 @@ list.1,2,3 (program 1.0.0 "[1, 2, 3]") builtinlist.nil (program 1.0.0 "[]") builtinlist.1,2,3 (program 1.0.0 "[1, 2, 3]") pair.int-str (program 1.0.0 "PPair 42 \"hello\"") -pair.int-list (program 1.0.0 "PPair 42 [1, 2, 3]") \ No newline at end of file +pair.int-list (program 1.0.0 "PPair 42 [1, 2, 3]") +rational.1/2 (program 1.0.0 "1/2") \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index 0fde74b37..8c09cf958 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -32,4 +32,5 @@ list.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i24 i2))) (delay (appendString (i6 (i24 i2)) (appendString ", " (i3 (i25 i2))))))) (i24 i1))))) i1) "]")) []) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i24 i2))) (delay (appendString (i6 (i24 i2)) (appendString ", " (i3 (i25 i2))))))) (i24 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i17 (appendString (i18 (\i0 -> \i0 -> appendString (force (i21 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i23 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))) i2) (appendString i17 (appendString i20 (appendString (decodeUtf8 (i18 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i23 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i20))))))) ((\i0 -> \i0 -> i1 i2 "hello") 42)) (\i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (force (i16 (equalsInteger i1 1) (delay i3) (delay (force (i16 (equalsInteger i1 2) (delay i4) (delay (force (i16 (equalsInteger i1 3) (delay i5) (delay (force (i16 (equalsInteger i1 4) (delay i6) (delay (force (i16 (equalsInteger i1 5) (delay i7) (delay (force (i16 (equalsInteger i1 6) (delay i8) (delay (force (i16 (equalsInteger i1 7) (delay i9) (delay (force (i16 (equalsInteger i1 8) (delay i10) (delay (force (i16 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i5 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) " ") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse)) "\"")) -pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i27 i2))) (delay (appendString (i9 (i27 i2)) (appendString ", " (i3 (i28 i2))))))) (i27 i1))))) i1) "]"))))))) ((\i0 -> \i0 -> i1 i2 [1,2,3]) 42)) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) \ No newline at end of file +pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i27 i2))) (delay (appendString (i9 (i27 i2)) (appendString ", " (i3 (i28 i2))))))) (i27 i1))))) i1) "]"))))))) ((\i0 -> \i0 -> i1 i2 [1,2,3]) 42)) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i29 (equalsInteger i2 0) (delay 0) (delay (force (i29 (lessThanEqualsInteger i2 0) (delay (i28 1)) (delay 1))))))) ((\i0 -> (\i0 -> i27 (\i0 -> \i0 -> \i0 -> force (i33 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i27 i2)) (i26 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i25 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i14 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) "-") "") (\i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (force (i15 (equalsInteger i1 1) (delay i3) (delay (force (i15 (equalsInteger i1 2) (delay i4) (delay (force (i15 (equalsInteger i1 3) (delay i5) (delay (force (i15 (equalsInteger i1 4) (delay i6) (delay (force (i15 (equalsInteger i1 5) (delay i7) (delay (force (i15 (equalsInteger i1 6) (delay i8) (delay (force (i15 (equalsInteger i1 7) (delay i9) (delay (force (i15 (equalsInteger i1 8) (delay i10) (delay (force (i15 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/trace.dev=true.bench.golden b/plutarch-test/goldens/trace.bench.golden similarity index 100% rename from plutarch-test/goldens/trace.dev=true.bench.golden rename to plutarch-test/goldens/trace.bench.golden diff --git a/plutarch-test/goldens/trace.dev=true.uplc.eval.golden b/plutarch-test/goldens/trace.uplc.eval.golden similarity index 100% rename from plutarch-test/goldens/trace.dev=true.uplc.eval.golden rename to plutarch-test/goldens/trace.uplc.eval.golden diff --git a/plutarch-test/goldens/trace.dev=true.uplc.golden b/plutarch-test/goldens/trace.uplc.golden similarity index 100% rename from plutarch-test/goldens/trace.dev=true.uplc.golden rename to plutarch-test/goldens/trace.uplc.golden diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 2b8d74f6f..4e5efd938 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -68,7 +68,7 @@ spec = do PMinting c -> popaque c _ -> perror describe "value" $ do - plutarchDevFlagDescribe . pgoldenSpec $ do + pgoldenSpec $ do let pmint = PValue.pconstantPositiveSingleton (pconstant "c0") (pconstant "sometoken") 1 pmintOtherToken = PValue.pconstantPositiveSingleton (pconstant "c0") (pconstant "othertoken") 1 pmintOtherSymbol = PValue.pconstantPositiveSingleton (pconstant "c7") (pconstant "sometoken") 1 @@ -260,7 +260,7 @@ spec = do -- The checkSignatory family of functions implicitly use tracing due to -- monadic syntax, and as such we need two sets of tests here. -- See Plutarch.MonadicSpec for GHC9 only syntax. - describe "signatory" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "signatory" . pgoldenSpec $ do let aSig :: PubKeyHash = "ab01fe235c" "cont" @\ do "succeeds" @| checkSignatoryCont # pconstant aSig # ctx @-> psucceeds diff --git a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs index 36a7ecb26..0556d2aac 100644 --- a/plutarch-test/plutarch-base/Plutarch/ListSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ListSpec.hs @@ -26,7 +26,7 @@ spec = do it "plutarch level find mirrors haskell level find" . hedgehog . propertyTest $ prop_pfindEquiv describe "elemAt" $ do it "plutarch level elemAt mirrors haskell level elemAt" . hedgehog . propertyTest $ prop_pelemAtEquiv - plutarchDevFlagDescribe . pgoldenSpec $ do + pgoldenSpec $ do let xs10 :: Term _ (PList PInteger) xs10 = integerList [1 .. 10] numList :: Term _ (PBuiltinList PInteger) diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index 437d89716..fc43a91db 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -47,7 +47,6 @@ spec = do in pmatch (pcon (PPair a b) :: Term s (PPair PInteger PString)) $ \(PPair _ y) -> y ) describe "instances-sanity" $ do - plutarchDevFlagDescribe $ do it "PBuiltinList" $ do pmatchTargetEval $ pconstant [1 :: Integer, 2, 3, 4] deconstrSpec diff --git a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs index a5f8d295f..64aff8ff6 100644 --- a/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/RationalSpec.hs @@ -11,7 +11,7 @@ spec = do rat = id assertRat :: ClosedTerm PRational -> ClosedTerm PRational -> Expectation assertRat x p = passert $ p #== x - describe "rational" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "rational" . pgoldenSpec $ do "literal" @| rat 0.5 "ops" @\ do "+" @| rat (1 / 2 + 1 / 2) @-> assertRat 1 diff --git a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs index a954ba258..ab4fcba6f 100644 --- a/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ShowSpec.hs @@ -12,70 +12,68 @@ import Test.Hspec spec :: Spec spec = do let str x = pconstant @PString x - describe "show" $ do - pgoldenSpec $ do - "unit" @| pshow (pcon PUnit) @== str "()" - "bool" @\ do - "true" @| pshow (pcon PTrue) @== str "PTrue" - "false" @| pshow (pcon PFalse) @== str "PFalse" - "int" @\ do - "0" @| pshow (pconstant @PInteger 0) @== str "0" - forM_ [5, 10, 14, 102] $ \n -> do - (fromString $ show n) - @| pshow (pconstant @PInteger n) - @== pconstant (T.pack $ show n) - (fromString $ show (-n)) - @| pshow (pconstant @PInteger (-n)) - @== pconstant (T.pack $ show (-n)) - "bytestring" @\ do - "empty" @| pshow (phexByteStr "") @== str "0x" - "1" @| pshow (phexByteStr "14") @== str "0x14" - "2" @| pshow (phexByteStr "14AF") @== str "0x14af" - "3" @| pshow (phexByteStr "14AF03") @== str "0x14af03" - "n" @| pshow (phexByteStr "FFFFFF") @== str "0xffffff" - "0" @| pshow (phexByteStr "000000") @== str "0x000000" - "str" @\ do - "empty" @| pshow (str "") @== str "\"\"" - "hello123" @| pshow (str "hello123") @== str "\"hello123\"" - "quoted" @| pshow (str "hello\"123") @== str "\"hello\\\"123\"" - "slash" @| pshow (str "foo\\bar") @== str "\"foo\\bar\"" - "unicode" @| pshow (str "vis-à-vis") @== str "\"vis-à-vis\"" - "unicode-quoted" @| pshow (str "vis-\"à\"-vis") @== str "\"vis-\\\"à\\\"-vis\"" - "maybe" @\ do - "nothing" - @| pshow @(PMaybe PInteger) (pcon PNothing) - @== str "PNothing" - "just" - @| pshow @(PMaybe PInteger) (pcon $ PJust $ pconstant @PInteger 42) - @== str "PJust 42" - "either" @\ do - "right" - @| pshow (pcon @(PEither PUnit PInteger) $ PRight 42) - @== str "PRight 42" - -- Test automatic injection of `(..)`. - "maybe.either" - @| pshow (pcon $ PJust $ pcon @(PEither PInteger PUnit) $ PLeft 42) - @== str "PJust (PLeft 42)" - "list" @\ do - "nil" @| pshow (integerList []) @== str "[]" - "1" @| pshow (integerList [1]) @== str "[1]" - "1,2,3" @| pshow (integerList [1, 2, 3]) @== str "[1, 2, 3]" - "builtinlist" @\ do - let xs3 = pconstant @(PBuiltinList PInteger) [1, 2, 3] - xs0 = pconstant @(PBuiltinList PInteger) [] - "nil" @| pshow xs0 @== str "[]" - "1,2,3" @| pshow xs3 @== str "[1, 2, 3]" - "pair" @\ do - "int-str" - @| pshow (pcon @(PPair PInteger PString) $ PPair 42 "hello") - @== str "PPair 42 \"hello\"" - "int-list" - @| pshow (pcon @(PPair PInteger (PBuiltinList PInteger)) $ PPair 42 $ pconstant [1, 2, 3]) - @== str "PPair 42 [1, 2, 3]" - plutarchDevFlagDescribe . pgoldenSpec $ do - "rational" @\ do - let rat :: Term s PRational -> Term s PRational - rat = id - "1/2" - @| pshow (rat $ 1 / 2) - @== str "1/2" + describe "show" . pgoldenSpec $ do + "unit" @| pshow (pcon PUnit) @== str "()" + "bool" @\ do + "true" @| pshow (pcon PTrue) @== str "PTrue" + "false" @| pshow (pcon PFalse) @== str "PFalse" + "int" @\ do + "0" @| pshow (pconstant @PInteger 0) @== str "0" + forM_ [5, 10, 14, 102] $ \n -> do + (fromString $ show n) + @| pshow (pconstant @PInteger n) + @== pconstant (T.pack $ show n) + (fromString $ show (-n)) + @| pshow (pconstant @PInteger (-n)) + @== pconstant (T.pack $ show (-n)) + "bytestring" @\ do + "empty" @| pshow (phexByteStr "") @== str "0x" + "1" @| pshow (phexByteStr "14") @== str "0x14" + "2" @| pshow (phexByteStr "14AF") @== str "0x14af" + "3" @| pshow (phexByteStr "14AF03") @== str "0x14af03" + "n" @| pshow (phexByteStr "FFFFFF") @== str "0xffffff" + "0" @| pshow (phexByteStr "000000") @== str "0x000000" + "str" @\ do + "empty" @| pshow (str "") @== str "\"\"" + "hello123" @| pshow (str "hello123") @== str "\"hello123\"" + "quoted" @| pshow (str "hello\"123") @== str "\"hello\\\"123\"" + "slash" @| pshow (str "foo\\bar") @== str "\"foo\\bar\"" + "unicode" @| pshow (str "vis-à-vis") @== str "\"vis-à-vis\"" + "unicode-quoted" @| pshow (str "vis-\"à\"-vis") @== str "\"vis-\\\"à\\\"-vis\"" + "maybe" @\ do + "nothing" + @| pshow @(PMaybe PInteger) (pcon PNothing) + @== str "PNothing" + "just" + @| pshow @(PMaybe PInteger) (pcon $ PJust $ pconstant @PInteger 42) + @== str "PJust 42" + "either" @\ do + "right" + @| pshow (pcon @(PEither PUnit PInteger) $ PRight 42) + @== str "PRight 42" + -- Test automatic injection of `(..)`. + "maybe.either" + @| pshow (pcon $ PJust $ pcon @(PEither PInteger PUnit) $ PLeft 42) + @== str "PJust (PLeft 42)" + "list" @\ do + "nil" @| pshow (integerList []) @== str "[]" + "1" @| pshow (integerList [1]) @== str "[1]" + "1,2,3" @| pshow (integerList [1, 2, 3]) @== str "[1, 2, 3]" + "builtinlist" @\ do + let xs3 = pconstant @(PBuiltinList PInteger) [1, 2, 3] + xs0 = pconstant @(PBuiltinList PInteger) [] + "nil" @| pshow xs0 @== str "[]" + "1,2,3" @| pshow xs3 @== str "[1, 2, 3]" + "pair" @\ do + "int-str" + @| pshow (pcon @(PPair PInteger PString) $ PPair 42 "hello") + @== str "PPair 42 \"hello\"" + "int-list" + @| pshow (pcon @(PPair PInteger (PBuiltinList PInteger)) $ PPair 42 $ pconstant [1, 2, 3]) + @== str "PPair 42 [1, 2, 3]" + "rational" @\ do + let rat :: Term s PRational -> Term s PRational + rat = id + "1/2" + @| pshow (rat $ 1 / 2) + @== str "1/2" diff --git a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs index 4bb5c5577..32a334c9c 100644 --- a/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/TraceSpec.hs @@ -6,7 +6,7 @@ import Test.Hspec spec :: Spec spec = do - describe "trace" . plutarchDevFlagDescribe . pgoldenSpec $ do + describe "trace" . pgoldenSpec $ do "ptrace" @\ do "one" @| ptrace "foo" (pcon PUnit) @-> \p -> ptraces p ["foo"] diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index bf014cf9f..9d36000f9 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -14,7 +14,7 @@ spec :: Spec spec = do describe "extra.api" $ do let ctx = validContext0 - plutarchDevFlagDescribe . pgoldenSpec $ do + pgoldenSpec $ do "pfindOwnInput" @| ( unTermCont $ do ctxF <- tcont $ pletFields @["txInfo", "purpose"] ctx diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index c137aa7b3..f7a40bd2e 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -2,11 +2,6 @@ cabal-version: 2.4 name: plutarch-test version: 1.1.0 -flag development - description: Enable tracing functions within plutarch. - manual: True - default: False - common c default-language: Haskell2010 default-extensions: @@ -125,9 +120,6 @@ library Plutarch.Test.Property.Marshal Plutarch.Test.Run - if flag(development) - cpp-options: -DDevelopment - executable plutarch-test import: c, deps main-is: Main.hs @@ -191,8 +183,5 @@ executable plutarch-test Plutarch.UnitSpec Plutarch.UPLCSpec - if flag(development) - cpp-options: -DDevelopment - -- FIXME remove -Wwarn=deprecations ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wwarn=deprecations From 4070f11f46971c696ee65774396d403422ec5af9 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:47:07 +0530 Subject: [PATCH 537/584] Add `Default` instance for `Config` --- Plutarch.hs | 1 - Plutarch/Internal.hs | 14 ++++++------ docs/Run.md | 9 ++++---- .../plutarch-base/Plutarch/ScriptsSpec.hs | 22 ++++++++----------- plutarch.cabal | 1 + 5 files changed, 22 insertions(+), 25 deletions(-) diff --git a/Plutarch.hs b/Plutarch.hs index caddcef72..bf3f6b9c0 100644 --- a/Plutarch.hs +++ b/Plutarch.hs @@ -37,7 +37,6 @@ module Plutarch ( PI.Config (Config, tracingMode), PI.TracingMode (NoTracing, DoTracing, DetTracing), PI.pgetConfig, - PI.defaultConfig, PQ.PForall (PForall), PQ.PSome (PSome), PS.PScottEncoded (PScottEncoded), diff --git a/Plutarch/Internal.hs b/Plutarch/Internal.hs index 8c08f34e1..a9a63f755 100644 --- a/Plutarch/Internal.hs +++ b/Plutarch/Internal.hs @@ -32,7 +32,6 @@ module Plutarch.Internal ( pthrow, Config (..), TracingMode (..), - defaultConfig, pgetConfig, TermMonad (..), ) where @@ -42,6 +41,7 @@ import Crypto.Hash (Context, Digest, hashFinalize, hashInit, hashUpdate) import Crypto.Hash.Algorithms (Blake2b_160) import Crypto.Hash.IO (HashAlgorithm) import qualified Data.ByteString as BS +import Data.Default (Default (def)) import Data.Functor ((<&>)) import Data.Kind (Type) import Data.List (foldl', groupBy, sortOn) @@ -138,12 +138,12 @@ data Config = Config data TracingMode = NoTracing | DoTracing | DetTracing --- Default is to be efficient -defaultConfig :: Config -defaultConfig = - Config - { tracingMode = NoTracing - } +-- | Default is to be efficient +instance Default Config where + def = + Config + { tracingMode = NoTracing + } newtype TermMonad m = TermMonad {runTermMonad :: ReaderT Config (Either Text) m} deriving newtype (Functor, Applicative, Monad) diff --git a/docs/Run.md b/docs/Run.md index c1daf8c80..57b97a5a4 100644 --- a/docs/Run.md +++ b/docs/Run.md @@ -88,6 +88,7 @@ import qualified Codec.CBOR.Write as Write import Codec.Serialise (Serialise, encode) import Data.Bifunctor (first) import qualified Data.ByteString.Base16 as Base16 +import Data.Default (def) import Data.Text (Text, pack) import qualified Data.Text.Encoding as TE import Plutarch (ClosedTerm, compile, defaultConfig) @@ -107,7 +108,7 @@ evalT x = evalWithArgsT x [] evalWithArgsT :: ClosedTerm a -> [Data] -> Either Text (Script, ExBudget, [Text]) evalWithArgsT x args = do - cmp <- compile defaultConfig x + cmp <- compile def x let (escr, budg, trc) = evalScript $ applyArguments cmp args scr <- first (pack . show) escr pure (scr, budg, trc) @@ -118,8 +119,8 @@ evalWithArgsT' x args = <$> evalWithArgsT x args ``` -The fields in the result triple correspond to script result, execution budget (how much memory and CPU units were used), and trace log - respectively. -Of course if you're only interested in the result of the script evaluation, you can just ignore the exbudget and tracelog just like `evalSerialize` does. -`evalSerialize` is a function that you can use to quickly obtain a serialized script. +The fields in the result triple correspond to script result, execution budget (how much memory and CPU units were used), and trace log - respectively. +Of course if you're only interested in the result of the script evaluation, you can just ignore the exbudget and tracelog just like `evalSerialize` does. +`evalSerialize` is a function that you can use to quickly obtain a serialized script. > Note: You can pretty much ignore the UPLC types involved here. All it really means is that the result is a "UPLC program". When it's printed, it's pretty legible - especially for debugging purposes. Although not necessary to use Plutarch, you may find the [Plutonomicon UPLC guide](https://github.com/Plutonomicon/plutonomicon/blob/main/uplc.md) useful. diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 5bb318da3..1ab99a7e5 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -17,18 +17,17 @@ module Plutarch.ScriptsSpec ( spec, ) where -import Data.Text (Text) - -import qualified PlutusLedgerApi.V1 as Plutus - -import Data.Coerce (coerce) - import qualified Codec.CBOR.Write as Write import Codec.Serialise (Serialise, encode) import Data.ByteString (ByteString) import qualified Data.ByteString.Base16 as Base16 +import Data.Coerce (coerce) +import Data.Default (def) +import Data.Text (Text) import qualified Data.Text.Encoding as TE -import Plutarch (defaultConfig) + +import qualified PlutusLedgerApi.V1 as Plutus + import Plutarch.Api.V1 ( PScriptContext, mintingPolicySymbol, @@ -130,8 +129,7 @@ adminPubKeyHash = "cc1360b04bdd0825e0c6552abb2af9b4df75b71f0c7cca20256b1f4f" `pwrapValidatorFromData` -} authValidatorCompiled :: Plutus.Validator -authValidatorCompiled = - mkValidator defaultConfig authValidatorTerm +authValidatorCompiled = mkValidator def authValidatorTerm authValidatorTerm :: ClosedTerm PValidator authValidatorTerm = @@ -148,8 +146,7 @@ authValidatorHash = validatorHash authValidatorCompiled -- | Similarly, for a MintingPolicy authPolicyCompiled :: Plutus.MintingPolicy -authPolicyCompiled = - mkMintingPolicy defaultConfig authPolicyTerm +authPolicyCompiled = mkMintingPolicy def authPolicyTerm authPolicyTerm :: ClosedTerm PMintingPolicy authPolicyTerm = @@ -166,8 +163,7 @@ authPolicySymbol = -- | ...And for a StakeValidator authStakeValidatorCompiled :: Plutus.StakeValidator -authStakeValidatorCompiled = - mkStakeValidator defaultConfig authStakeValidatorTerm +authStakeValidatorCompiled = mkStakeValidator def authStakeValidatorTerm authStakeValidatorTerm :: ClosedTerm PStakeValidator authStakeValidatorTerm = diff --git a/plutarch.cabal b/plutarch.cabal index b774b0525..97a3e1802 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -145,6 +145,7 @@ library , constraints , containers , cryptonite + , data-default , flat , generics-sop , lens From 7ce1976498596d08ffa2eaf21cec48e135c751dd Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:48:36 +0530 Subject: [PATCH 538/584] Add V2 script utils --- Plutarch/Api/V2.hs | 69 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/Plutarch/Api/V2.hs b/Plutarch/Api/V2.hs index bf27200f6..25bf06d14 100644 --- a/Plutarch/Api/V2.hs +++ b/Plutarch/Api/V2.hs @@ -11,7 +11,7 @@ module Plutarch.Api.V2 ( Tx.PTxInInfo (PTxInInfo), Tx.POutputDatum (PNoOutputDatum, POutputDatumHash, POutputDatum), - -- *** reexports for V2 Tx and Contexts + -- *** reexports for unchanged V1 ledger types V1.PMaybeData (PDNothing, PDJust), V1.PTuple, V1.PDatum (PDatum), @@ -23,11 +23,37 @@ module Plutarch.Api.V2 ( V1.PPubKeyHash (PPubKeyHash), V1.PStakingCredential (PStakingHash, PStakingPtr), type V1.PPOSIXTimeRange, + + -- ** Script Utils + validatorHash, + mintingPolicySymbol, + stakeValidatorHash, + scriptHash, + datumHash, + redeemerHash, + dataHash, + mkValidator, + mkStakeValidator, + mkMintingPolicy, + type PValidator, + type PMintingPolicy, + type PStakeValidator, ) where +import Data.Coerce (coerce) +import qualified Data.Text as T +import GHC.Stack (HasCallStack) + +import qualified PlutusLedgerApi.V1.Scripts as Plutus + +import Plutarch (Config, compile) +import Plutarch.Prelude + import qualified Plutarch.Api.V2.Contexts as Contexts import qualified Plutarch.Api.V2.Tx as Tx +import Plutarch.Api.Internal.Hashing (hashScriptWithPrefix) +import Plutarch.Api.V1 (datumHash, redeemerHash, dataHash) import qualified Plutarch.Api.V1.Address as V1 import qualified Plutarch.Api.V1.Crypto as V1 import qualified Plutarch.Api.V1.Maybe as V1 @@ -35,6 +61,43 @@ import qualified Plutarch.Api.V1.Scripts as V1 import qualified Plutarch.Api.V1.Time as V1 import qualified Plutarch.Api.V1.Tuple as V1 import qualified Plutarch.Api.V1.Value as V1 +import qualified PlutusLedgerApi.V1.Value as Plutus + +-- On-chain Script Types + +-- | a Validator Term +type PValidator = PData :--> PData :--> Contexts.PScriptContext :--> POpaque + +-- | a MintingPolicy Term +type PMintingPolicy = PData :--> Contexts.PScriptContext :--> POpaque + +-- | a StakeValidator Term +type PStakeValidator = PData :--> Contexts.PScriptContext :--> POpaque + +-- | Compile a Validator +mkValidator :: HasCallStack => Config -> ClosedTerm PValidator -> Plutus.Validator +mkValidator config s = Plutus.Validator $ either (error . T.unpack) id $ compile config s + +-- | Compile a MintingPolicy +mkMintingPolicy :: HasCallStack => Config -> ClosedTerm PMintingPolicy -> Plutus.MintingPolicy +mkMintingPolicy config s = Plutus.MintingPolicy $ either (error . T.unpack) id $ compile config s + +-- | Compile a StakeValidator +mkStakeValidator :: HasCallStack => Config -> ClosedTerm PStakeValidator -> Plutus.StakeValidator +mkStakeValidator config s = Plutus.StakeValidator $ either (error . T.unpack) id $ compile config s + +-- | Hash a Script, with the correct prefix for Plutus V2 +scriptHash :: Plutus.Script -> Plutus.ScriptHash +scriptHash = hashScriptWithPrefix "\x02" + +-- | Hash a Validator, with the correct prefix for Plutus V2 +validatorHash :: Plutus.Validator -> Plutus.ValidatorHash +validatorHash = coerce scriptHash + +-- | Hash a MintingPolicy, with the correct prefix for Plutus V2 +mintingPolicySymbol :: Plutus.MintingPolicy -> Plutus.CurrencySymbol +mintingPolicySymbol = coerce scriptHash --- TODO: --- - add util functions that are also part of PlutusLedgerApi.V2 +-- | Hash a StakeValidator, with the correct prefix for Plutus V2 +stakeValidatorHash :: Plutus.StakeValidator -> Plutus.StakeValidatorHash +stakeValidatorHash = coerce scriptHash From ee6d21e9109b379c5500ce86597fe2994e40dc8a Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Jul 2022 14:48:50 +0530 Subject: [PATCH 539/584] Fix formatting --- Plutarch/Api/V2.hs | 2 +- plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Plutarch/Api/V2.hs b/Plutarch/Api/V2.hs index 25bf06d14..eb349b7e1 100644 --- a/Plutarch/Api/V2.hs +++ b/Plutarch/Api/V2.hs @@ -53,7 +53,7 @@ import qualified Plutarch.Api.V2.Contexts as Contexts import qualified Plutarch.Api.V2.Tx as Tx import Plutarch.Api.Internal.Hashing (hashScriptWithPrefix) -import Plutarch.Api.V1 (datumHash, redeemerHash, dataHash) +import Plutarch.Api.V1 (dataHash, datumHash, redeemerHash) import qualified Plutarch.Api.V1.Address as V1 import qualified Plutarch.Api.V1.Crypto as V1 import qualified Plutarch.Api.V1.Maybe as V1 diff --git a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs index fc43a91db..eedb9de56 100644 --- a/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/PlutusTypeSpec.hs @@ -47,8 +47,8 @@ spec = do in pmatch (pcon (PPair a b) :: Term s (PPair PInteger PString)) $ \(PPair _ y) -> y ) describe "instances-sanity" $ do - it "PBuiltinList" $ do - pmatchTargetEval $ pconstant [1 :: Integer, 2, 3, 4] + it "PBuiltinList" $ do + pmatchTargetEval $ pconstant [1 :: Integer, 2, 3, 4] deconstrSpec {- | For comparing typed and untyped data deconstruction approaches. From 9176363e8c796c97b1068aa5d96de89f5e940fe9 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Thu, 7 Jul 2022 15:38:31 +0530 Subject: [PATCH 540/584] Update goldens --- plutarch-test/goldens/data-verif.bench.golden | 5 --- .../goldens/data-verif.uplc.eval.golden | 5 --- plutarch-test/goldens/data-verif.uplc.golden | 5 --- plutarch-test/goldens/rational.bench.golden | 42 +++++++++---------- plutarch-test/goldens/rational.uplc.golden | 42 +++++++++---------- plutarch-test/goldens/show.bench.golden | 2 +- plutarch-test/goldens/show.uplc.golden | 2 +- 7 files changed, 44 insertions(+), 59 deletions(-) diff --git a/plutarch-test/goldens/data-verif.bench.golden b/plutarch-test/goldens/data-verif.bench.golden index 11377ff09..6c157b645 100644 --- a/plutarch-test/goldens/data-verif.bench.golden +++ b/plutarch-test/goldens/data-verif.bench.golden @@ -4,13 +4,8 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int {"exBudgetCPU":733650,"exBudgetMemory":548,"scriptSizeBytes":165} erroneous.PDataSum constr 2 {"exBudgetCPU":700994,"exBudgetMemory":230,"scriptSizeBytes":197} erroneous.PDataSum wrong record type {"exBudgetCPU":990483,"exBudgetMemory":232,"scriptSizeBytes":256} -erroneous.[ByteString] (with length == 2) /= PRational {"exBudgetCPU":1656457,"exBudgetMemory":554,"scriptSizeBytes":231} -erroneous.[Integer] (with length == 0) /= PRational {"exBudgetCPU":761999,"exBudgetMemory":230,"scriptSizeBytes":193} -erroneous.[Integer] (with length == 3) /= PRational {"exBudgetCPU":2227517,"exBudgetMemory":524,"scriptSizeBytes":239} -erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational {"exBudgetCPU":2156288,"exBudgetMemory":524,"scriptSizeBytes":225} working.(String, String) == (String, String) {"exBudgetCPU":4806613,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":4994603,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.[Integer] (with length == 2) == PRational {"exBudgetCPU":9654221,"exBudgetMemory":28350,"scriptSizeBytes":385} working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":128} diff --git a/plutarch-test/goldens/data-verif.uplc.eval.golden b/plutarch-test/goldens/data-verif.uplc.eval.golden index e45348c28..7a6315f76 100644 --- a/plutarch-test/goldens/data-verif.uplc.eval.golden +++ b/plutarch-test/goldens/data-verif.uplc.eval.golden @@ -4,13 +4,8 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int (program 1.0.0 error) erroneous.PDataSum constr 2 (program 1.0.0 error) erroneous.PDataSum wrong record type (program 1.0.0 error) -erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 error) -erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 error) -erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 error) -erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 error) working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) -working.[Integer] (with length == 2) == PRational (program 1.0.0 ()) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) diff --git a/plutarch-test/goldens/data-verif.uplc.golden b/plutarch-test/goldens/data-verif.uplc.golden index 19d330b46..3219beff8 100644 --- a/plutarch-test/goldens/data-verif.uplc.golden +++ b/plutarch-test/goldens/data-verif.uplc.golden @@ -4,13 +4,8 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i8) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay (force (i12 "list is longer than zero" (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i4)) (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unBData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87b9f0543666f6fff)) -erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (bData i9) i10))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 (bData i4) (i5 (bData i6) i7))))) (force ifThenElse)) (force tailList)) (force trace)) #41) (force mkCons)) #2b) [ ])) -erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData i7) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData i4))) (force ifThenElse)) (force tailList)) (force trace)) [ ])) -erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i9 i7 (i9 i8 (i9 i10 i11)))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i4 (i6 i5 (i6 i7 i8)))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) #07) (force mkCons)) #00) [ ])) -erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 i7 (i8 i9 i10))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 i4 (i5 i6 i7))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) (force mkCons)) #00) [ ])) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.[Integer] (with length == 2) == PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i7 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> force (i4 (equalsInteger i1 (unIData i10)) (delay (force (i4 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (unIData (i8 (i9 i2)))) (unIData (i7 i1))) (unListData i1)) (listData (i9 i8 (i9 i10 i11)))) ((\i0 -> \i0 -> i1 i2 i3) (unIData i8))) (delay ()) (delay (force (i7 "drat should be as expected" (delay error))))))) (delay (force (i7 "non-zero should be as expected" (delay error)))))) (force (i3 (equalsInteger i1 0) (delay (force (i6 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (i3 (i4 i1))))) (delay (force (i5 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i5 (i6 i7 i8))))) (force ifThenElse)) (force headList)) (force tailList)) (force trace)) #182a) (force mkCons)) #181f) [ ])) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/rational.bench.golden b/plutarch-test/goldens/rational.bench.golden index 57bcdf69e..3453ada43 100644 --- a/plutarch-test/goldens/rational.bench.golden +++ b/plutarch-test/goldens/rational.bench.golden @@ -1,24 +1,24 @@ literal {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} -ops.+ {"exBudgetCPU":33573901,"exBudgetMemory":84401,"scriptSizeBytes":378} -ops.- {"exBudgetCPU":33573901,"exBudgetMemory":84401,"scriptSizeBytes":378} -ops.* {"exBudgetCPU":58113426,"exBudgetMemory":142977,"scriptSizeBytes":437} -ops.harmonic-sum {"exBudgetCPU":85294919,"exBudgetMemory":207655,"scriptSizeBytes":441} -ops.multi-product {"exBudgetCPU":96083895,"exBudgetMemory":237989,"scriptSizeBytes":463} -compare {"exBudgetCPU":27193475,"exBudgetMemory":69077,"scriptSizeBytes":363} -round.5/3 {"exBudgetCPU":17926406,"exBudgetMemory":39749,"scriptSizeBytes":369} -round.4/3 {"exBudgetCPU":16470457,"exBudgetMemory":36646,"scriptSizeBytes":369} -round.-5/2 {"exBudgetCPU":17727920,"exBudgetMemory":39249,"scriptSizeBytes":383} -round.-1/4 {"exBudgetCPU":16837934,"exBudgetMemory":37348,"scriptSizeBytes":383} -truncate.5/4 {"exBudgetCPU":13897101,"exBudgetMemory":33539,"scriptSizeBytes":320} -truncate.7/4 {"exBudgetCPU":15353050,"exBudgetMemory":36642,"scriptSizeBytes":320} -truncate.1/4 {"exBudgetCPU":12441152,"exBudgetMemory":30436,"scriptSizeBytes":320} -truncate.-7/4 {"exBudgetCPU":17474953,"exBudgetMemory":40849,"scriptSizeBytes":334} -properFraction.-1/2 {"exBudgetCPU":40971082,"exBudgetMemory":103120,"scriptSizeBytes":504} -properFraction.-3/2 {"exBudgetCPU":42794508,"exBudgetMemory":106925,"scriptSizeBytes":506} -properFraction.-4/3 {"exBudgetCPU":42794508,"exBudgetMemory":106925,"scriptSizeBytes":506} +ops.+ {"exBudgetCPU":34125901,"exBudgetMemory":86801,"scriptSizeBytes":387} +ops.- {"exBudgetCPU":34125901,"exBudgetMemory":86801,"scriptSizeBytes":387} +ops.* {"exBudgetCPU":58941426,"exBudgetMemory":146577,"scriptSizeBytes":446} +ops.harmonic-sum {"exBudgetCPU":86536919,"exBudgetMemory":213055,"scriptSizeBytes":449} +ops.multi-product {"exBudgetCPU":97670895,"exBudgetMemory":244889,"scriptSizeBytes":472} +compare {"exBudgetCPU":27607475,"exBudgetMemory":70877,"scriptSizeBytes":372} +round.5/3 {"exBudgetCPU":18064406,"exBudgetMemory":40349,"scriptSizeBytes":375} +round.4/3 {"exBudgetCPU":16608457,"exBudgetMemory":37246,"scriptSizeBytes":375} +round.-5/2 {"exBudgetCPU":17865920,"exBudgetMemory":39849,"scriptSizeBytes":389} +round.-1/4 {"exBudgetCPU":16975934,"exBudgetMemory":37948,"scriptSizeBytes":389} +truncate.5/4 {"exBudgetCPU":14035101,"exBudgetMemory":34139,"scriptSizeBytes":325} +truncate.7/4 {"exBudgetCPU":15491050,"exBudgetMemory":37242,"scriptSizeBytes":325} +truncate.1/4 {"exBudgetCPU":12579152,"exBudgetMemory":31036,"scriptSizeBytes":325} +truncate.-7/4 {"exBudgetCPU":17612953,"exBudgetMemory":41449,"scriptSizeBytes":340} +properFraction.-1/2 {"exBudgetCPU":41051385,"exBudgetMemory":103922,"scriptSizeBytes":506} +properFraction.-3/2 {"exBudgetCPU":42874811,"exBudgetMemory":107727,"scriptSizeBytes":508} +properFraction.-4/3 {"exBudgetCPU":42874811,"exBudgetMemory":107727,"scriptSizeBytes":508} data.id.0.5 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} data.id.2 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} -data.id.11/3 {"exBudgetCPU":13900637,"exBudgetMemory":33539,"scriptSizeBytes":274} -div by 0.1/0 {"exBudgetCPU":594827,"exBudgetMemory":136,"scriptSizeBytes":274} -div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":75} -div by 0.1/(1-1) {"exBudgetCPU":9194401,"exBudgetMemory":20168,"scriptSizeBytes":353} \ No newline at end of file +data.id.11/3 {"exBudgetCPU":14038637,"exBudgetMemory":34139,"scriptSizeBytes":280} +div by 0.1/0 {"exBudgetCPU":687723,"exBudgetMemory":138,"scriptSizeBytes":280} +div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":76} +div by 0.1/(1-1) {"exBudgetCPU":9287297,"exBudgetMemory":20170,"scriptSizeBytes":359} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.uplc.golden b/plutarch-test/goldens/rational.uplc.golden index 4a57770e1..1286b3eb3 100644 --- a/plutarch-test/goldens/rational.uplc.golden +++ b/plutarch-test/goldens/rational.uplc.golden @@ -1,24 +1,24 @@ literal (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 6)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 9)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 10))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 6)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 9)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 10))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) data.id.0.5 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) data.id.2 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (equalsInteger i2 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i15 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (i12 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) \ No newline at end of file +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 i2 i3))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (i12 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index 24a27bd4d..bd0283f36 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -33,4 +33,4 @@ builtinlist.nil {"exBudgetCPU":2756985,"exBudgetMemory":11043,"scriptSizeBytes": builtinlist.1,2,3 {"exBudgetCPU":26137058,"exBudgetMemory":60484,"scriptSizeBytes":392} pair.int-str {"exBudgetCPU":34865639,"exBudgetMemory":80705,"scriptSizeBytes":454} pair.int-list {"exBudgetCPU":42325700,"exBudgetMemory":93314,"scriptSizeBytes":434} -rational.1/2 {"exBudgetCPU":24865887,"exBudgetMemory":59194,"scriptSizeBytes":553} \ No newline at end of file +rational.1/2 {"exBudgetCPU":25003887,"exBudgetMemory":59794,"scriptSizeBytes":560} \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index 8c09cf958..c6a104ad5 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -33,4 +33,4 @@ builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i24 i2))) (delay (appendString (i6 (i24 i2)) (appendString ", " (i3 (i25 i2))))))) (i24 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i17 (appendString (i18 (\i0 -> \i0 -> appendString (force (i21 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i23 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))) i2) (appendString i17 (appendString i20 (appendString (decodeUtf8 (i18 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i23 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i20))))))) ((\i0 -> \i0 -> i1 i2 "hello") 42)) (\i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (force (i16 (equalsInteger i1 1) (delay i3) (delay (force (i16 (equalsInteger i1 2) (delay i4) (delay (force (i16 (equalsInteger i1 3) (delay i5) (delay (force (i16 (equalsInteger i1 4) (delay i6) (delay (force (i16 (equalsInteger i1 5) (delay i7) (delay (force (i16 (equalsInteger i1 6) (delay i8) (delay (force (i16 (equalsInteger i1 7) (delay i9) (delay (force (i16 (equalsInteger i1 8) (delay i10) (delay (force (i16 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i5 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) " ") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse)) "\"")) pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i27 i2))) (delay (appendString (i9 (i27 i2)) (appendString ", " (i3 (i28 i2))))))) (i27 i1))))) i1) "]"))))))) ((\i0 -> \i0 -> i1 i2 [1,2,3]) 42)) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i29 (equalsInteger i2 0) (delay 0) (delay (force (i29 (lessThanEqualsInteger i2 0) (delay (i28 1)) (delay 1))))))) ((\i0 -> (\i0 -> i27 (\i0 -> \i0 -> \i0 -> force (i33 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i27 i2)) (i26 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i25 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i14 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) "-") "") (\i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (force (i15 (equalsInteger i1 1) (delay i3) (delay (force (i15 (equalsInteger i1 2) (delay i4) (delay (force (i15 (equalsInteger i1 3) (delay i5) (delay (force (i15 (equalsInteger i1 4) (delay i6) (delay (force (i15 (equalsInteger i1 5) (delay i7) (delay (force (i15 (equalsInteger i1 6) (delay i8) (delay (force (i15 (equalsInteger i1 7) (delay i9) (delay (force (i15 (equalsInteger i1 8) (delay i10) (delay (force (i15 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) \ No newline at end of file +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i24 (equalsInteger i2 0) (delay 0) (delay (force (i24 (lessThanEqualsInteger i2 0) (delay (i23 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i30 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i26 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i25 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i22 i2)) (i21 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i14 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) "-") "") (\i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (force (i15 (equalsInteger i1 1) (delay i3) (delay (force (i15 (equalsInteger i1 2) (delay i4) (delay (force (i15 (equalsInteger i1 3) (delay i5) (delay (force (i15 (equalsInteger i1 4) (delay i6) (delay (force (i15 (equalsInteger i1 5) (delay i7) (delay (force (i15 (equalsInteger i1 6) (delay i8) (delay (force (i15 (equalsInteger i1 7) (delay i9) (delay (force (i15 (equalsInteger i1 8) (delay i10) (delay (force (i15 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) \ No newline at end of file From ef1e083232966721587940bc388e28c1af8fd52c Mon Sep 17 00:00:00 2001 From: mangoiv Date: Thu, 7 Jul 2022 17:25:53 +0200 Subject: [PATCH 541/584] add builtin functions --- Plutarch/Builtin.hs | 5 +++++ Plutarch/Crypto.hs | 28 ++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index dec909beb..0da93f541 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -23,6 +23,7 @@ module Plutarch.Builtin ( pforgetData, prememberData, prememberData', + pserialiseData, ppairDataBuiltin, pchooseListBuiltin, type PBuiltinMap, @@ -263,6 +264,10 @@ pasInt = punsafeBuiltin PLC.UnIData pasByteStr :: Term s (PData :--> PByteString) pasByteStr = punsafeBuiltin PLC.UnBData +-- | Serialise any builtin data to its cbor represented by a builtin bytestring +pserialiseData :: Term s (PData :--> PByteString) +pserialiseData = punsafeBuiltin PLC.SerialiseData + {-# DEPRECATED pdataLiteral "Use `pconstant` instead." #-} pdataLiteral :: Data -> Term s PData pdataLiteral = pconstant diff --git a/Plutarch/Crypto.hs b/Plutarch/Crypto.hs index 01e117119..f0b441e70 100644 --- a/Plutarch/Crypto.hs +++ b/Plutarch/Crypto.hs @@ -1,8 +1,14 @@ module Plutarch.Crypto ( + -- ** from V1 psha2_256, psha3_256, pblake2b_256, pverifySignature, + pverifyEd25519Signature, + + -- ** from V2 + pverifyEcdsaSecp256k1Signature, + pverifySchnorrSecp256k1Signature, ) where import Plutarch ( @@ -11,7 +17,6 @@ import Plutarch ( ) import Plutarch.Unsafe (punsafeBuiltin) --- import Plutarch.Api.V1 (PDatumHash, PPubKey (..), PPubKeyHash (..), PSignature (..)) import Plutarch.Bool (PBool) import Plutarch.ByteString (PByteString) import qualified PlutusCore as PLC @@ -30,4 +35,23 @@ pblake2b_256 = punsafeBuiltin PLC.Blake2b_256 -- | Verify the signature against the public key and message. pverifySignature :: Term s (PByteString :--> PByteString :--> PByteString :--> PBool) -pverifySignature = punsafeBuiltin PLC.VerifyEd25519Signature +pverifySignature = pverifyEd25519Signature +{-# DEPRECATED pverifySignature "use one of the Ed25519, Schnorr- or ECDSA Secp256k1 signature verification functions" #-} + +{- | Verify an ED25519 signature + arguments are in this order: pubkey, message, signature +-} +pverifyEd25519Signature :: Term s (PByteString :--> PByteString :--> PByteString :--> PBool) +pverifyEd25519Signature = punsafeBuiltin PLC.VerifyEd25519Signature + +{- | Verify an ECDSA SECP256k1 signature + arguments are in this order: pubkey, message, signature +-} +pverifyEcdsaSecp256k1Signature :: Term s (PByteString :--> PByteString :--> PByteString :--> PBool) +pverifyEcdsaSecp256k1Signature = punsafeBuiltin PLC.VerifyEcdsaSecp256k1Signature + +{- | Verify a Schnorr SECP256k1 signature + arguments are in this order: pubkey, message, signature +-} +pverifySchnorrSecp256k1Signature :: Term s (PByteString :--> PByteString :--> PByteString :--> PBool) +pverifySchnorrSecp256k1Signature = punsafeBuiltin PLC.VerifySchnorrSecp256k1Signature From b539f9b7d8e009b9715a556b9159b2ec99653239 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Jul 2022 01:05:05 +0530 Subject: [PATCH 542/584] Build fixes and update goldens --- Plutarch/Builtin.hs | 10 ----- .../conditional/Plutarch/TryFromSpec.hs | 3 +- plutarch-test/goldens/data-verif.bench.golden | 5 +++ .../goldens/data-verif.uplc.eval.golden | 5 +++ plutarch-test/goldens/data-verif.uplc.golden | 5 +++ plutarch-test/goldens/rational.bench.golden | 42 +++++++++---------- .../goldens/rational.dev=false.uplc.golden | 24 ----------- plutarch-test/goldens/rational.uplc.golden | 42 +++++++++---------- plutarch-test/goldens/show.bench.golden | 2 +- plutarch-test/goldens/show.uplc.golden | 2 +- 10 files changed, 61 insertions(+), 79 deletions(-) delete mode 100644 plutarch-test/goldens/rational.dev=false.uplc.golden diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index f1decd94b..352a8efcb 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -92,7 +92,6 @@ import Plutarch.List ( pshowList, ptail, ) -import Plutarch.Reducible (Flip) import Plutarch.Show (PShow (pshow'), pshow) import Plutarch.TermCont (TermCont (runTermCont), tcont, unTermCont) import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) @@ -101,15 +100,6 @@ import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce, punsafeDowncast) import qualified PlutusCore as PLC import PlutusTx (Data (Constr), ToData) import qualified PlutusTx -import Plutarch.TermCont (TermCont (runTermCont), tcont, unTermCont) -import Plutarch.TryFrom ( - PSubtype, - PTryFrom, - PTryFromExcess, - ptryFrom, - ptryFrom', - pupcast, - ) -- | Plutus 'BuiltinPair' data PBuiltinPair (a :: PType) (b :: PType) (s :: S) = PBuiltinPair (Term s (PBuiltinPair a b)) diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 6c2114112..8c413b2b6 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -46,6 +46,7 @@ import Plutarch.TryFrom ( ) import Plutarch.ApiSpec (invalidContext1, validContext0) +import Plutarch.Reducible (Reduce) import Plutarch.Extra.TermCont import Test.Hspec @@ -131,7 +132,7 @@ spec = do checkDeep' @PRational @(PBuiltinList (PAsData PInteger)) (pdata $ pcons # numr #$ pcons # denm # pnil) pguardC "non-zero should be as expected" $ pto nz #== pfromData denm - pguardC "drat should be as expected" $ pfromData drat #== prational # pfromData numr # nz + pguardC "drat should be as expected" $ pfromData drat #== pcon (PRational (pfromData numr) nz) pure $ pconstant () ) @-> psucceeds diff --git a/plutarch-test/goldens/data-verif.bench.golden b/plutarch-test/goldens/data-verif.bench.golden index 6c157b645..11377ff09 100644 --- a/plutarch-test/goldens/data-verif.bench.golden +++ b/plutarch-test/goldens/data-verif.bench.golden @@ -4,8 +4,13 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int {"exBudgetCPU":733650,"exBudgetMemory":548,"scriptSizeBytes":165} erroneous.PDataSum constr 2 {"exBudgetCPU":700994,"exBudgetMemory":230,"scriptSizeBytes":197} erroneous.PDataSum wrong record type {"exBudgetCPU":990483,"exBudgetMemory":232,"scriptSizeBytes":256} +erroneous.[ByteString] (with length == 2) /= PRational {"exBudgetCPU":1656457,"exBudgetMemory":554,"scriptSizeBytes":231} +erroneous.[Integer] (with length == 0) /= PRational {"exBudgetCPU":761999,"exBudgetMemory":230,"scriptSizeBytes":193} +erroneous.[Integer] (with length == 3) /= PRational {"exBudgetCPU":2227517,"exBudgetMemory":524,"scriptSizeBytes":239} +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational {"exBudgetCPU":2156288,"exBudgetMemory":524,"scriptSizeBytes":225} working.(String, String) == (String, String) {"exBudgetCPU":4806613,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":4994603,"exBudgetMemory":16904,"scriptSizeBytes":114} +working.[Integer] (with length == 2) == PRational {"exBudgetCPU":9654221,"exBudgetMemory":28350,"scriptSizeBytes":385} working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":128} diff --git a/plutarch-test/goldens/data-verif.uplc.eval.golden b/plutarch-test/goldens/data-verif.uplc.eval.golden index 7a6315f76..e45348c28 100644 --- a/plutarch-test/goldens/data-verif.uplc.eval.golden +++ b/plutarch-test/goldens/data-verif.uplc.eval.golden @@ -4,8 +4,13 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int (program 1.0.0 error) erroneous.PDataSum constr 2 (program 1.0.0 error) erroneous.PDataSum wrong record type (program 1.0.0 error) +erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 error) +erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 error) +erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 error) +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 error) working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) +working.[Integer] (with length == 2) == PRational (program 1.0.0 ()) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) diff --git a/plutarch-test/goldens/data-verif.uplc.golden b/plutarch-test/goldens/data-verif.uplc.golden index 3219beff8..19d330b46 100644 --- a/plutarch-test/goldens/data-verif.uplc.golden +++ b/plutarch-test/goldens/data-verif.uplc.golden @@ -4,8 +4,13 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i8) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay (force (i12 "list is longer than zero" (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i4)) (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unBData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87b9f0543666f6fff)) +erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (bData i9) i10))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 (bData i4) (i5 (bData i6) i7))))) (force ifThenElse)) (force tailList)) (force trace)) #41) (force mkCons)) #2b) [ ])) +erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData i7) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData i4))) (force ifThenElse)) (force tailList)) (force trace)) [ ])) +erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i9 i7 (i9 i8 (i9 i10 i11)))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i4 (i6 i5 (i6 i7 i8)))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) #07) (force mkCons)) #00) [ ])) +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 i7 (i8 i9 i10))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 i4 (i5 i6 i7))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) (force mkCons)) #00) [ ])) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) +working.[Integer] (with length == 2) == PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i7 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> force (i4 (equalsInteger i1 (unIData i10)) (delay (force (i4 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (unIData (i8 (i9 i2)))) (unIData (i7 i1))) (unListData i1)) (listData (i9 i8 (i9 i10 i11)))) ((\i0 -> \i0 -> i1 i2 i3) (unIData i8))) (delay ()) (delay (force (i7 "drat should be as expected" (delay error))))))) (delay (force (i7 "non-zero should be as expected" (delay error)))))) (force (i3 (equalsInteger i1 0) (delay (force (i6 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (i3 (i4 i1))))) (delay (force (i5 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i5 (i6 i7 i8))))) (force ifThenElse)) (force headList)) (force tailList)) (force trace)) #182a) (force mkCons)) #181f) [ ])) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/rational.bench.golden b/plutarch-test/goldens/rational.bench.golden index d4119d411..57bcdf69e 100644 --- a/plutarch-test/goldens/rational.bench.golden +++ b/plutarch-test/goldens/rational.bench.golden @@ -1,24 +1,24 @@ literal {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} -ops.+ {"exBudgetCPU":34125901,"exBudgetMemory":86801,"scriptSizeBytes":387} -ops.- {"exBudgetCPU":34125901,"exBudgetMemory":86801,"scriptSizeBytes":387} -ops.* {"exBudgetCPU":58941426,"exBudgetMemory":146577,"scriptSizeBytes":446} -ops.harmonic-sum {"exBudgetCPU":86536919,"exBudgetMemory":213055,"scriptSizeBytes":449} -ops.multi-product {"exBudgetCPU":97670895,"exBudgetMemory":244889,"scriptSizeBytes":472} -compare {"exBudgetCPU":27607475,"exBudgetMemory":70877,"scriptSizeBytes":372} -round.5/3 {"exBudgetCPU":18064406,"exBudgetMemory":40349,"scriptSizeBytes":375} -round.4/3 {"exBudgetCPU":16608457,"exBudgetMemory":37246,"scriptSizeBytes":375} -round.-5/2 {"exBudgetCPU":17865920,"exBudgetMemory":39849,"scriptSizeBytes":389} -round.-1/4 {"exBudgetCPU":16975934,"exBudgetMemory":37948,"scriptSizeBytes":389} -truncate.5/4 {"exBudgetCPU":14035101,"exBudgetMemory":34139,"scriptSizeBytes":325} -truncate.7/4 {"exBudgetCPU":15491050,"exBudgetMemory":37242,"scriptSizeBytes":325} -truncate.1/4 {"exBudgetCPU":12579152,"exBudgetMemory":31036,"scriptSizeBytes":325} -truncate.-7/4 {"exBudgetCPU":17612953,"exBudgetMemory":41449,"scriptSizeBytes":340} -properFraction.-1/2 {"exBudgetCPU":41051385,"exBudgetMemory":103922,"scriptSizeBytes":506} -properFraction.-3/2 {"exBudgetCPU":42874811,"exBudgetMemory":107727,"scriptSizeBytes":508} -properFraction.-4/3 {"exBudgetCPU":42874811,"exBudgetMemory":107727,"scriptSizeBytes":508} +ops.+ {"exBudgetCPU":33573901,"exBudgetMemory":84401,"scriptSizeBytes":378} +ops.- {"exBudgetCPU":33573901,"exBudgetMemory":84401,"scriptSizeBytes":378} +ops.* {"exBudgetCPU":58113426,"exBudgetMemory":142977,"scriptSizeBytes":437} +ops.harmonic-sum {"exBudgetCPU":85294919,"exBudgetMemory":207655,"scriptSizeBytes":441} +ops.multi-product {"exBudgetCPU":96083895,"exBudgetMemory":237989,"scriptSizeBytes":463} +compare {"exBudgetCPU":27193475,"exBudgetMemory":69077,"scriptSizeBytes":363} +round.5/3 {"exBudgetCPU":17926406,"exBudgetMemory":39749,"scriptSizeBytes":369} +round.4/3 {"exBudgetCPU":16470457,"exBudgetMemory":36646,"scriptSizeBytes":369} +round.-5/2 {"exBudgetCPU":17727920,"exBudgetMemory":39249,"scriptSizeBytes":383} +round.-1/4 {"exBudgetCPU":16837934,"exBudgetMemory":37348,"scriptSizeBytes":383} +truncate.5/4 {"exBudgetCPU":13897101,"exBudgetMemory":33539,"scriptSizeBytes":320} +truncate.7/4 {"exBudgetCPU":15353050,"exBudgetMemory":36642,"scriptSizeBytes":320} +truncate.1/4 {"exBudgetCPU":12441152,"exBudgetMemory":30436,"scriptSizeBytes":320} +truncate.-7/4 {"exBudgetCPU":17474953,"exBudgetMemory":40849,"scriptSizeBytes":334} +properFraction.-1/2 {"exBudgetCPU":40971082,"exBudgetMemory":103120,"scriptSizeBytes":504} +properFraction.-3/2 {"exBudgetCPU":42794508,"exBudgetMemory":106925,"scriptSizeBytes":506} +properFraction.-4/3 {"exBudgetCPU":42794508,"exBudgetMemory":106925,"scriptSizeBytes":506} data.id.0.5 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} data.id.2 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} -data.id.11/3 {"exBudgetCPU":14038637,"exBudgetMemory":34139,"scriptSizeBytes":280} -div by 0.1/0 {"exBudgetCPU":687723,"exBudgetMemory":138,"scriptSizeBytes":280} -div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":76} -div by 0.1/(1-1) {"exBudgetCPU":9287297,"exBudgetMemory":20170,"scriptSizeBytes":359} +data.id.11/3 {"exBudgetCPU":13900637,"exBudgetMemory":33539,"scriptSizeBytes":274} +div by 0.1/0 {"exBudgetCPU":594827,"exBudgetMemory":136,"scriptSizeBytes":274} +div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":75} +div by 0.1/(1-1) {"exBudgetCPU":9194401,"exBudgetMemory":20168,"scriptSizeBytes":353} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.dev=false.uplc.golden b/plutarch-test/goldens/rational.dev=false.uplc.golden deleted file mode 100644 index d96ef65ad..000000000 --- a/plutarch-test/goldens/rational.dev=false.uplc.golden +++ /dev/null @@ -1,24 +0,0 @@ -literal (program 1.0.0 (\i0 -> i1 1 2)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i1 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2))))) (i1 (\i0 -> i1 1 1) (i2 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (i1 (\i0 -> i1 2 1) (i2 (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (i2 (\i0 -> i1 1 1) (\i0 -> i1 3 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (i2 (\i0 -> i1 1 1) (\i0 -> i1 5 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (addInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 (\i0 -> i1 1 1) (\i0 -> i1 2 1)) (\i0 -> i1 2 1)) (\i0 -> i1 3 1)) (\i0 -> i1 3 1)) (\i0 -> i1 4 1)) (\i0 -> i1 4 1)) (\i0 -> i1 5 1)) (\i0 -> i1 5 1)) (\i0 -> i1 6 1)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 (\i0 -> i1 (multiplyInteger i5 i3) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 (\i0 -> i1 2 1) (\i0 -> i1 9 1)) (i1 (\i0 -> i1 3 1) (\i0 -> i1 10 1))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 2 1)))) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i6 (equalsInteger (modInteger i3 2) 1) (delay (force (i6 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i6 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i6 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 5 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 4 1))) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i5 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i5 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2)) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 7 1) (\i0 -> i1 4 1)))) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 1 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 3 1) (\i0 -> i1 2 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 2 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i2 ((\i0 -> i4 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i13 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 i3 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 (\i0 -> i1 4 1) (\i0 -> i1 3 1))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (subtractInteger 0 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 (\i0 -> i1 1 1) (\i0 -> i1 3 1)))))))) (\i0 -> \i0 -> i13 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> \i0 -> i1 (subtractInteger 0 i3) i2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) (i13 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i9 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (equalsInteger i1 0) (delay error) (delay i1)))) (force ifThenElse))) -data.id.0.5 (program 1.0.0 (\i0 -> i1 1 2)) -data.id.2 (program 1.0.0 (\i0 -> i1 2 1)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 11 1) (\i0 -> i1 3 1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i12 (equalsInteger i2 0) (delay 0) (delay (force (i12 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i13 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force (i12 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i11 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))))) (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i8 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 0 1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (equalsInteger i2 0) (delay error) (delay i2))))) (\i0 -> i1 0 1))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 (\i0 -> i1 (multiplyInteger i6 i3) i2)) ((\i0 -> force (i14 (equalsInteger i1 0) (delay error) (delay i1))) (multiplyInteger i3 i2))))) (\i0 -> i1 1 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 (\i0 -> i1 (subtractInteger (multiplyInteger i5 i2) (multiplyInteger i3 i4)) (multiplyInteger i4 i2))))) (\i0 -> i1 1 1) (\i0 -> i1 1 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 (multiplyInteger i2 (divideInteger i5 i3)) (multiplyInteger i2 (divideInteger i4 i3))) (force (i10 (equalsInteger i2 0) (delay 0) (delay (force (i10 (lessThanEqualsInteger i2 0) (delay (subtractInteger 0 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (force (i8 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2)))) (force (i7 (lessThanEqualsInteger i2 (subtractInteger 0 1)) (delay (subtractInteger 0 i2)) (delay i2))))) (i1 (\i0 -> \i0 -> \i0 -> force (i7 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i3 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch-test/goldens/rational.uplc.golden b/plutarch-test/goldens/rational.uplc.golden index 3688e5851..4a57770e1 100644 --- a/plutarch-test/goldens/rational.uplc.golden +++ b/plutarch-test/goldens/rational.uplc.golden @@ -1,24 +1,24 @@ literal (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i5 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5))) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 6)) (\i0 -> \i0 -> i4 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 9)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 10))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i6 (i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i16 i1 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay (force (i4 i5 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pfailOnZero: division by 0")) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 6)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 9)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 10))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) data.id.0.5 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) data.id.2 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i9 (equalsInteger i2 0) (delay 0) (delay (force (i9 (lessThanEqualsInteger i2 0) (delay (i8 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i11 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i10 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i7 i2)) (i6 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i11 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (force ifThenElse (equalsInteger i3 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) (\i0 -> i1 i2 i3))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i16 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> \i0 -> i3 (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (i12 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i7 i2 i1) (i8 i3 i2)) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (equalsInteger i2 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i15 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (i12 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index bd0283f36..24a27bd4d 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -33,4 +33,4 @@ builtinlist.nil {"exBudgetCPU":2756985,"exBudgetMemory":11043,"scriptSizeBytes": builtinlist.1,2,3 {"exBudgetCPU":26137058,"exBudgetMemory":60484,"scriptSizeBytes":392} pair.int-str {"exBudgetCPU":34865639,"exBudgetMemory":80705,"scriptSizeBytes":454} pair.int-list {"exBudgetCPU":42325700,"exBudgetMemory":93314,"scriptSizeBytes":434} -rational.1/2 {"exBudgetCPU":25003887,"exBudgetMemory":59794,"scriptSizeBytes":560} \ No newline at end of file +rational.1/2 {"exBudgetCPU":24865887,"exBudgetMemory":59194,"scriptSizeBytes":553} \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index c6a104ad5..8c09cf958 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -33,4 +33,4 @@ builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i24 i2))) (delay (appendString (i6 (i24 i2)) (appendString ", " (i3 (i25 i2))))))) (i24 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i17 (appendString (i18 (\i0 -> \i0 -> appendString (force (i21 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i23 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))) i2) (appendString i17 (appendString i20 (appendString (decodeUtf8 (i18 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i23 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i20))))))) ((\i0 -> \i0 -> i1 i2 "hello") 42)) (\i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (force (i16 (equalsInteger i1 1) (delay i3) (delay (force (i16 (equalsInteger i1 2) (delay i4) (delay (force (i16 (equalsInteger i1 3) (delay i5) (delay (force (i16 (equalsInteger i1 4) (delay i6) (delay (force (i16 (equalsInteger i1 5) (delay i7) (delay (force (i16 (equalsInteger i1 6) (delay i8) (delay (force (i16 (equalsInteger i1 7) (delay i9) (delay (force (i16 (equalsInteger i1 8) (delay i10) (delay (force (i16 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i5 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) " ") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse)) "\"")) pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i27 i2))) (delay (appendString (i9 (i27 i2)) (appendString ", " (i3 (i28 i2))))))) (i27 i1))))) i1) "]"))))))) ((\i0 -> \i0 -> i1 i2 [1,2,3]) 42)) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i24 (equalsInteger i2 0) (delay 0) (delay (force (i24 (lessThanEqualsInteger i2 0) (delay (i23 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i24 (\i0 -> \i0 -> \i0 -> force (i30 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) i2 i1) (force (i26 (lessThanEqualsInteger i3 i2) (delay i3) (delay i2)))) (force (i25 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (i22 i2)) (i21 i2)))) (i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i26 (equalsInteger i2 0) (delay (force (force trace "pfailOnZero: division by 0" (delay error)))) (delay i1))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i14 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) "-") "") (\i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (force (i15 (equalsInteger i1 1) (delay i3) (delay (force (i15 (equalsInteger i1 2) (delay i4) (delay (force (i15 (equalsInteger i1 3) (delay i5) (delay (force (i15 (equalsInteger i1 4) (delay i6) (delay (force (i15 (equalsInteger i1 5) (delay i7) (delay (force (i15 (equalsInteger i1 6) (delay i8) (delay (force (i15 (equalsInteger i1 7) (delay i9) (delay (force (i15 (equalsInteger i1 8) (delay i10) (delay (force (i15 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) \ No newline at end of file +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i29 (equalsInteger i2 0) (delay 0) (delay (force (i29 (lessThanEqualsInteger i2 0) (delay (i28 1)) (delay 1))))))) ((\i0 -> (\i0 -> i27 (\i0 -> \i0 -> \i0 -> force (i33 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i27 i2)) (i26 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i25 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i14 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) "-") "") (\i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (force (i15 (equalsInteger i1 1) (delay i3) (delay (force (i15 (equalsInteger i1 2) (delay i4) (delay (force (i15 (equalsInteger i1 3) (delay i5) (delay (force (i15 (equalsInteger i1 4) (delay i6) (delay (force (i15 (equalsInteger i1 5) (delay i7) (delay (force (i15 (equalsInteger i1 6) (delay i8) (delay (force (i15 (equalsInteger i1 7) (delay i9) (delay (force (i15 (equalsInteger i1 8) (delay i10) (delay (force (i15 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) \ No newline at end of file From a385c8dac508318df8f51e334738d284f046a9b6 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 8 Jul 2022 01:07:56 +0530 Subject: [PATCH 543/584] Fix formatting --- Plutarch/Rational.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 364f28579..6013a5717 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -150,8 +150,9 @@ instance PNum PRational where yd <- tcont $ plet yd' pure $ preduce - #$ pcon $ PRational (xn * pto yd + yn * pto xd) - $ punsafeDowncast $ pto xd * pto yd + #$ pcon + $ PRational (xn * pto yd + yn * pto xd) $ + punsafeDowncast $ pto xd * pto yd ) # x' # y' @@ -165,8 +166,9 @@ instance PNum PRational where yd <- tcont $ plet yd' pure $ preduce - #$ pcon $ PRational (xn * pto yd - yn * pto xd) - $ punsafeDowncast $ pto xd * pto yd + #$ pcon + $ PRational (xn * pto yd - yn * pto xd) $ + punsafeDowncast $ pto xd * pto yd ) # x' # y' @@ -178,8 +180,9 @@ instance PNum PRational where PRational yn yd <- tcont $ pmatch y pure $ preduce - #$ pcon $ PRational (xn * yn) - $ punsafeDowncast $ pto xd * pto yd + #$ pcon + $ PRational (xn * yn) $ + punsafeDowncast $ pto xd * pto yd ) # x' # y' From c657d011bba2528d9820d51cb0dc18f08f5069b1 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 8 Jul 2022 16:09:31 +0200 Subject: [PATCH 544/584] fix passertSorted --- Plutarch/Api/V1/AssocMap.hs | 37 +++++++++++-------- Plutarch/List.hs | 4 +- .../plutarch-base/Plutarch/ScriptsSpec.hs | 3 +- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 59e0c64af..8349bf5cc 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -47,6 +47,7 @@ import qualified PlutusTx.Monoid as PlutusTx import qualified PlutusTx.Semigroup as PlutusTx import Plutarch.Builtin (PBuiltinMap, ppairDataBuiltin) +import Plutarch.Internal.Witness (witness) import Plutarch.Lift ( PConstantDecl, PConstantRepr, @@ -63,6 +64,8 @@ import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import Prelude hiding (all, any, filter, lookup, null) +import Data.Proxy (Proxy (Proxy)) + data KeyGuarantees = Sorted | Unsorted type role PMap nominal nominal nominal nominal @@ -231,21 +234,25 @@ pfromAscList :: (POrd k, PIsData k, PIsData v) => Term s (PBuiltinMap k v :--> P pfromAscList = plam $ (passertSorted #) . pcon . PMap -- | Assert the map is properly sorted. -passertSorted :: (POrd k, PIsData k, PIsData v) => Term s (PMap _ k v :--> PMap 'Sorted k v) -passertSorted = phoistAcyclic $ - plam $ \map -> - precList - ( \self x xs -> - plet (pfromData $ pfstBuiltin # x) $ \k -> - plam $ \badKey -> - pif - (badKey # k) - (ptraceError "unsorted map") - (self # xs # plam (#< k)) - ) - (const $ plam $ const map) - # pto map - # plam (const $ pcon PFalse) +passertSorted :: forall k v any s. (POrd k, PIsData k, PIsData v) => Term s (PMap any k v :--> PMap 'Sorted k v) +passertSorted = + let _ = witness (Proxy :: Proxy (PIsData v)) + in phoistAcyclic $ + plam $ \map -> + precList + ( \self x xs -> + plet (pfromData $ pfstBuiltin # x) $ \k -> + plam $ \badKey -> + pif + (badKey # k) + (ptraceError "unsorted map") + (self # xs # plam (#< k)) + ) + -- this is actually the empty map so we can + -- safely assum that it is sorted + (const . plam . const $ punsafeCoerce map) + # pto map + # plam (const $ pcon PFalse) -- | Forget the knowledge that keys were sorted. pforgetSorted :: Term s (PMap 'Sorted k v) -> Term s (PMap g k v) diff --git a/Plutarch/List.hs b/Plutarch/List.hs index 373ecead5..6a20a8bce 100644 --- a/Plutarch/List.hs +++ b/Plutarch/List.hs @@ -110,7 +110,7 @@ pshowList' = (pshow x) xs ) - (\_self -> "") + (const "") instance PEq a => PEq (PList a) where (#==) xs ys = plistEquals # xs # ys @@ -121,7 +121,7 @@ instance PEq a => PEq (PList a) where type PIsListLike list a = (PListLike list, PElemConstraint list a) -- | Plutarch types that behave like lists. -class PListLike (list :: (PType) -> PType) where +class PListLike (list :: PType -> PType) where type PElemConstraint list (a :: PType) :: Constraint -- | Canonical eliminator for list-likes. diff --git a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs index 1ab99a7e5..fe8e570d2 100644 --- a/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ScriptsSpec.hs @@ -42,6 +42,7 @@ import Plutarch.Api.V1 ( ) import Plutarch.Api.V1.Crypto (PPubKeyHash) import Plutarch.Builtin (pasByteStr) +import Plutarch.Crypto (pverifyEd25519Signature) import Plutarch.Prelude import Plutarch.Test import Test.Hspec @@ -78,7 +79,7 @@ authorizedValidator :: Term s POpaque authorizedValidator authKey datumMessage redeemerSig _ctx = pif - (pverifySignature # authKey # datumMessage # redeemerSig) + (pverifyEd25519Signature # authKey # datumMessage # redeemerSig) (popaque $ pcon PUnit) perror From 421b1c8a3175be04a91a627ee19ff47680fa812c Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 8 Jul 2022 16:31:00 +0200 Subject: [PATCH 545/584] make map use data equality --- Plutarch/Api/V1/AssocMap.hs | 10 ++++- plutarch-test/goldens/api.value.bench.golden | 44 +++++++++---------- .../goldens/api.value.uplc.eval.golden | 2 +- plutarch-test/goldens/api.value.uplc.golden | 44 +++++++++---------- 4 files changed, 54 insertions(+), 46 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 8349bf5cc..1521d03a6 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -71,9 +71,17 @@ data KeyGuarantees = Sorted | Unsorted type role PMap nominal nominal nominal nominal newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, PShow) + deriving anyclass (PlutusType, PIsData, PShow) instance DerivePlutusType (PMap keysort k v) where type DPTStrat _ = PlutusTypeNewtype +instance PEq (PMap 'Unsorted k v) + +instance PEq (PMap 'Sorted k v) where + x #== y = peqViaData # x # y + where + peqViaData :: Term s (PMap 'Sorted k v :--> PMap 'Sorted k v :--> PBool) + peqViaData = phoistAcyclic $ plam $ \m0 m1 -> pdata m0 #== pdata m1 + instance ( PLiftData k , PLiftData v diff --git a/plutarch-test/goldens/api.value.bench.golden b/plutarch-test/goldens/api.value.bench.golden index e003a6afa..1a6bb1a1b 100644 --- a/plutarch-test/goldens/api.value.bench.golden +++ b/plutarch-test/goldens/api.value.bench.golden @@ -44,28 +44,28 @@ unionWith.growing.17 {"exBudgetCPU":624137614,"exBudgetMemory":1530496,"scriptSi unionWithData const.itself {"exBudgetCPU":1012100,"exBudgetMemory":4500,"scriptSizeBytes":238} unionWithData const.applied {"exBudgetCPU":18208856,"exBudgetMemory":56344,"scriptSizeBytes":323} inv {"exBudgetCPU":8006438,"exBudgetMemory":25962,"scriptSizeBytes":175} -equality.itself {"exBudgetCPU":644100,"exBudgetMemory":2900,"scriptSizeBytes":124} -equality.triviallyTrue {"exBudgetCPU":10598856,"exBudgetMemory":27464,"scriptSizeBytes":208} -equality.triviallyFalse {"exBudgetCPU":9291784,"exBudgetMemory":23536,"scriptSizeBytes":218} -equality.swappedTokensTrue {"exBudgetCPU":42810280,"exBudgetMemory":122244,"scriptSizeBytes":467} -equality.swappedSymbolsTrue {"exBudgetCPU":33843768,"exBudgetMemory":90104,"scriptSizeBytes":458} -equality.growing.1 {"exBudgetCPU":10598856,"exBudgetMemory":27464,"scriptSizeBytes":208} -equality.growing.2 {"exBudgetCPU":42772210,"exBudgetMemory":122244,"scriptSizeBytes":462} -equality.growing.3 {"exBudgetCPU":65521536,"exBudgetMemory":182784,"scriptSizeBytes":497} -equality.growing.4 {"exBudgetCPU":96471462,"exBudgetMemory":261844,"scriptSizeBytes":532} -equality.growing.5 {"exBudgetCPU":135621988,"exBudgetMemory":359424,"scriptSizeBytes":567} -equality.growing.6 {"exBudgetCPU":182973114,"exBudgetMemory":475524,"scriptSizeBytes":603} -equality.growing.7 {"exBudgetCPU":238524840,"exBudgetMemory":610144,"scriptSizeBytes":638} -equality.growing.8 {"exBudgetCPU":302277166,"exBudgetMemory":763284,"scriptSizeBytes":673} -equality.growing.9 {"exBudgetCPU":374230092,"exBudgetMemory":934944,"scriptSizeBytes":708} -equality.growing.10 {"exBudgetCPU":454383618,"exBudgetMemory":1125124,"scriptSizeBytes":744} -equality.growing.11 {"exBudgetCPU":542737744,"exBudgetMemory":1333824,"scriptSizeBytes":779} -equality.growing.12 {"exBudgetCPU":639292470,"exBudgetMemory":1561044,"scriptSizeBytes":814} -equality.growing.13 {"exBudgetCPU":744047796,"exBudgetMemory":1806784,"scriptSizeBytes":849} -equality.growing.14 {"exBudgetCPU":857003722,"exBudgetMemory":2071044,"scriptSizeBytes":885} -equality.growing.15 {"exBudgetCPU":978160248,"exBudgetMemory":2353824,"scriptSizeBytes":920} -equality.growing.16 {"exBudgetCPU":1107517374,"exBudgetMemory":2655124,"scriptSizeBytes":955} -equality.growing.17 {"exBudgetCPU":1245075100,"exBudgetMemory":2974944,"scriptSizeBytes":990} +equality.itself {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":15} +equality.triviallyTrue {"exBudgetCPU":5254875,"exBudgetMemory":13977,"scriptSizeBytes":100} +equality.triviallyFalse {"exBudgetCPU":5185875,"exBudgetMemory":13677,"scriptSizeBytes":109} +equality.swappedTokensTrue {"exBudgetCPU":38087299,"exBudgetMemory":111457,"scriptSizeBytes":393} +equality.swappedSymbolsTrue {"exBudgetCPU":24037139,"exBudgetMemory":70829,"scriptSizeBytes":384} +equality.growing.1 {"exBudgetCPU":5254875,"exBudgetMemory":13977,"scriptSizeBytes":100} +equality.growing.2 {"exBudgetCPU":38049229,"exBudgetMemory":111457,"scriptSizeBytes":388} +equality.growing.3 {"exBudgetCPU":55714907,"exBudgetMemory":163509,"scriptSizeBytes":423} +equality.growing.4 {"exBudgetCPU":81581185,"exBudgetMemory":234081,"scriptSizeBytes":459} +equality.growing.5 {"exBudgetCPU":115648063,"exBudgetMemory":323173,"scriptSizeBytes":494} +equality.growing.6 {"exBudgetCPU":157915541,"exBudgetMemory":430785,"scriptSizeBytes":529} +equality.growing.7 {"exBudgetCPU":208383619,"exBudgetMemory":556917,"scriptSizeBytes":564} +equality.growing.8 {"exBudgetCPU":267052297,"exBudgetMemory":701569,"scriptSizeBytes":600} +equality.growing.9 {"exBudgetCPU":333921575,"exBudgetMemory":864741,"scriptSizeBytes":635} +equality.growing.10 {"exBudgetCPU":408991453,"exBudgetMemory":1046433,"scriptSizeBytes":670} +equality.growing.11 {"exBudgetCPU":492261931,"exBudgetMemory":1246645,"scriptSizeBytes":705} +equality.growing.12 {"exBudgetCPU":583733009,"exBudgetMemory":1465377,"scriptSizeBytes":741} +equality.growing.13 {"exBudgetCPU":683404687,"exBudgetMemory":1702629,"scriptSizeBytes":776} +equality.growing.14 {"exBudgetCPU":791276965,"exBudgetMemory":1958401,"scriptSizeBytes":811} +equality.growing.15 {"exBudgetCPU":907349843,"exBudgetMemory":2232693,"scriptSizeBytes":846} +equality.growing.16 {"exBudgetCPU":1031623321,"exBudgetMemory":2525505,"scriptSizeBytes":882} +equality.growing.17 {"exBudgetCPU":1164097399,"exBudgetMemory":2836837,"scriptSizeBytes":917} normalize.identity {"exBudgetCPU":36285548,"exBudgetMemory":108757,"scriptSizeBytes":560} normalize.empty {"exBudgetCPU":25276001,"exBudgetMemory":75761,"scriptSizeBytes":443} assertSorted.succeeds {"exBudgetCPU":30813271,"exBudgetMemory":97682,"scriptSizeBytes":516} diff --git a/plutarch-test/goldens/api.value.uplc.eval.golden b/plutarch-test/goldens/api.value.uplc.eval.golden index 2ea8db90c..909f1b246 100644 --- a/plutarch-test/goldens/api.value.uplc.eval.golden +++ b/plutarch-test/goldens/api.value.uplc.eval.golden @@ -173,7 +173,7 @@ unionWith.growing.17 (program 1.0.0 [ (#41c0, #a249736f6d65746f6b656e0145746f6b6 unionWithData const.itself (program 1.0.0 (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) ((\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay (force mkCons i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (force ifThenElse (equalsData i2 i1) (delay (force mkCons (mkPairData i2 (i9 (force (force sndPair) i6) (force (force sndPair) i3))) (i8 (\i0 -> \i0 -> i2) i5 (force tailList i4)))) (delay (force (force ifThenElse (lessThanByteString (unBData i2) (unBData i1)) (delay (force mkCons i6 (i8 (\i0 -> \i0 -> i1) i3 (force tailList i4) i5))) (delay (force mkCons i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (force tailList i4))))))))) (force (force fstPair) i2)) (force (force fstPair) i4)) (force headList i1)))))) (\i0 -> \i0 -> force (force (force chooseList) i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (force headList i2) (force tailList i2) i1))))) i1)) i3 (\i0 -> \i0 -> i2) i2 i1) i5 i2 i1) i2 i1)) unionWithData const.applied (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e01)]) inv (program 1.0.0 [(#41c0, #a149736f6d65746f6b656e20)]) -equality.itself (program 1.0.0 (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i2 (delay (force (force (force chooseList) i1 (delay True) (delay False)))) (delay (force (force (force chooseList) i1 (delay False) (delay (force (force ifThenElse (force ((\i0 -> \i0 -> force ifThenElse i2 i1 (delay False)) (equalsData (force (force fstPair) (force headList i2)) (force (force fstPair) (force headList i1))) (delay (equalsData (force (force sndPair) (force headList i2)) (force (force sndPair) (force headList i1)))))) (delay (i3 (force tailList i2) (force tailList i1))) (delay False))))))))) i2 i1)) +equality.itself (program 1.0.0 (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1))) equality.triviallyTrue (program 1.0.0 True) equality.triviallyFalse (program 1.0.0 False) equality.swappedTokensTrue (program 1.0.0 True) diff --git a/plutarch-test/goldens/api.value.uplc.golden b/plutarch-test/goldens/api.value.uplc.golden index 897a5db56..7dfc38699 100644 --- a/plutarch-test/goldens/api.value.uplc.golden +++ b/plutarch-test/goldens/api.value.uplc.golden @@ -44,28 +44,28 @@ unionWith.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i unionWithData const.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i11 i1 (delay (i9 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i12 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i16 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i12 i6 (i8 (\i0 -> \i0 -> i1) i3 (i16 i4) i5))) (delay (i12 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i16 i4))))))))) (i12 i2)) (i11 i4)) (i12 i1)))))) (\i0 -> \i0 -> force (i9 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i10 i2) (i11 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force mkCons)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList))) unionWithData const.applied (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 i5 i2 i1) i2 i1) (\i0 -> \i0 -> i2) (i11 i12 (i13 i17 1)) (i11 i12 (i13 i17 1))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) inv (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> i4 (\i0 -> mapData (i2 (unMapData i1)))) (\i0 -> i4 (\i0 -> iData (i4 (unIData i1))) i1) i1) (\i0 -> subtractInteger 0 i1) ((\i0 -> \i0 -> i10 (bData i2) (mapData i1)) #c0 ((\i0 -> \i0 -> i10 (bData i2) (iData i1)) #736f6d65746f6b656e 1))) (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i6 i1 (delay i13) (delay (i12 (mkPairData (i7 (i9 i1)) (i4 (i8 (i9 i1)))) (i2 (i10 i1)))))) i1)) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.itself (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList))) -equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (i7 i8 (i9 #736f6d65746f6b656e 1)) (i7 i8 (i9 #6f74686572746f6b656e 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) -equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i16 (i17 i14 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i14 (i17 i21 1))) (i1 addInteger (i15 i14 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i6 i2 (delay (force (i6 i1 (delay True) (delay False)))) (delay (force (i6 i1 (delay False) (delay (force (i7 (force ((\i0 -> \i0 -> i9 i2 i1 (delay False)) (equalsData (i8 (i10 i2)) (i8 (i10 i1))) (delay (equalsData (i9 (i10 i2)) (i9 (i10 i1)))))) (delay (i3 (i11 i2) (i11 i1))) (delay False))))))))) i2 i1) (i7 i8 (i9 i13 1)) (i7 i8 (i9 i13 1))) (force (force chooseList))) (force ifThenElse)) (force (force fstPair))) (force (force sndPair))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) -equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i23 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i24 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i25 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i26 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i27 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i28 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i29 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i30 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i31 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i32 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i33 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i34 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i35 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) -equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i8 (\i0 -> \i0 -> \i0 -> force (i16 i2 (delay (force (i16 i1 (delay True) (delay False)))) (delay (force (i16 i1 (delay False) (delay (force (i14 (force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsData (i15 (i17 i2)) (i15 (i17 i1))) (delay (equalsData (i13 (i17 i2)) (i13 (i17 i1)))))) (delay (i3 (i18 i2) (i18 i1))) (delay False))))))))) i2 i1) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i36 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.itself (program 1.0.0 (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1))) +equality.triviallyTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 i2 (i3 i7 1)) (i1 i2 (i3 i7 1))) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.triviallyFalse (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 i2 (i3 #736f6d65746f6b656e 1)) (i1 i2 (i3 #6f74686572746f6b656e 1))) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ])) +equality.swappedTokensTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i16 (i17 i14 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #6f74686572746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.swappedSymbolsTrue (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i15 i16 (i17 i21 1)) (i15 i14 (i17 i21 1))) (i1 addInteger (i15 i14 (i17 i21 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 i2 (i3 i7 1)) (i1 i2 (i3 i7 1))) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) +equality.growing.2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1))) (i1 addInteger (i15 i16 (i17 i14 1)) (i15 i16 (i17 i21 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i18 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i21 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i21 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i21 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1))) (i1 addInteger (i1 addInteger (i16 i15 (i18 i14 1)) (i16 i15 (i18 i22 1))) (i16 i17 (i18 i22 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i19 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i22 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i22 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i22 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c1) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i17 i15 (i19 i14 1)) (i17 i15 (i19 i23 1))) (i17 i16 (i19 i23 1))) (i17 i18 (i19 i23 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i20 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i23 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i23 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i23 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c2) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i18 i15 (i20 i14 1)) (i18 i15 (i20 i24 1))) (i18 i16 (i20 i24 1))) (i18 i17 (i20 i24 1))) (i18 i19 (i20 i24 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i21 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i24 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i24 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i24 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c3) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.6 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i19 i15 (i21 i14 1)) (i19 i15 (i21 i25 1))) (i19 i16 (i21 i25 1))) (i19 i17 (i21 i25 1))) (i19 i18 (i21 i25 1))) (i19 i20 (i21 i25 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i22 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i25 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i25 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i25 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c4) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.7 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i20 i15 (i22 i14 1)) (i20 i15 (i22 i26 1))) (i20 i16 (i22 i26 1))) (i20 i17 (i22 i26 1))) (i20 i18 (i22 i26 1))) (i20 i19 (i22 i26 1))) (i20 i21 (i22 i26 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i23 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i26 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i26 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i26 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c5) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.8 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i21 i15 (i23 i14 1)) (i21 i15 (i23 i27 1))) (i21 i16 (i23 i27 1))) (i21 i17 (i23 i27 1))) (i21 i18 (i23 i27 1))) (i21 i19 (i23 i27 1))) (i21 i20 (i23 i27 1))) (i21 i22 (i23 i27 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i24 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i27 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i27 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i27 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c6) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.9 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i22 i15 (i24 i14 1)) (i22 i15 (i24 i28 1))) (i22 i16 (i24 i28 1))) (i22 i17 (i24 i28 1))) (i22 i18 (i24 i28 1))) (i22 i19 (i24 i28 1))) (i22 i20 (i24 i28 1))) (i22 i21 (i24 i28 1))) (i22 i23 (i24 i28 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i25 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i28 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i28 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i28 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c7) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.10 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i23 i15 (i25 i14 1)) (i23 i15 (i25 i29 1))) (i23 i16 (i25 i29 1))) (i23 i17 (i25 i29 1))) (i23 i18 (i25 i29 1))) (i23 i19 (i25 i29 1))) (i23 i20 (i25 i29 1))) (i23 i21 (i25 i29 1))) (i23 i22 (i25 i29 1))) (i23 i24 (i25 i29 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i26 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i29 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i29 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i29 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c8) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.11 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i24 i15 (i26 i14 1)) (i24 i15 (i26 i30 1))) (i24 i16 (i26 i30 1))) (i24 i17 (i26 i30 1))) (i24 i18 (i26 i30 1))) (i24 i19 (i26 i30 1))) (i24 i20 (i26 i30 1))) (i24 i21 (i26 i30 1))) (i24 i22 (i26 i30 1))) (i24 i23 (i26 i30 1))) (i24 i25 (i26 i30 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i27 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i30 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i30 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i30 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c9) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.12 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i25 i15 (i27 i14 1)) (i25 i15 (i27 i31 1))) (i25 i16 (i27 i31 1))) (i25 i17 (i27 i31 1))) (i25 i18 (i27 i31 1))) (i25 i19 (i27 i31 1))) (i25 i20 (i27 i31 1))) (i25 i21 (i27 i31 1))) (i25 i22 (i27 i31 1))) (i25 i23 (i27 i31 1))) (i25 i24 (i27 i31 1))) (i25 i26 (i27 i31 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i28 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i31 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i31 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i31 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ca) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.13 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i26 i15 (i28 i14 1)) (i26 i15 (i28 i32 1))) (i26 i16 (i28 i32 1))) (i26 i17 (i28 i32 1))) (i26 i18 (i28 i32 1))) (i26 i19 (i28 i32 1))) (i26 i20 (i28 i32 1))) (i26 i21 (i28 i32 1))) (i26 i22 (i28 i32 1))) (i26 i23 (i28 i32 1))) (i26 i24 (i28 i32 1))) (i26 i25 (i28 i32 1))) (i26 i27 (i28 i32 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i29 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i32 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i32 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i32 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cb) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.14 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i27 i15 (i29 i14 1)) (i27 i15 (i29 i33 1))) (i27 i16 (i29 i33 1))) (i27 i17 (i29 i33 1))) (i27 i18 (i29 i33 1))) (i27 i19 (i29 i33 1))) (i27 i20 (i29 i33 1))) (i27 i21 (i29 i33 1))) (i27 i22 (i29 i33 1))) (i27 i23 (i29 i33 1))) (i27 i24 (i29 i33 1))) (i27 i25 (i29 i33 1))) (i27 i26 (i29 i33 1))) (i27 i28 (i29 i33 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i30 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i33 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i33 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i33 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cc) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.15 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i28 i15 (i30 i14 1)) (i28 i15 (i30 i34 1))) (i28 i16 (i30 i34 1))) (i28 i17 (i30 i34 1))) (i28 i18 (i30 i34 1))) (i28 i19 (i30 i34 1))) (i28 i20 (i30 i34 1))) (i28 i21 (i30 i34 1))) (i28 i22 (i30 i34 1))) (i28 i23 (i30 i34 1))) (i28 i24 (i30 i34 1))) (i28 i25 (i30 i34 1))) (i28 i26 (i30 i34 1))) (i28 i27 (i30 i34 1))) (i28 i29 (i30 i34 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i31 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i34 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i34 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i34 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cd) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.16 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i29 i15 (i31 i14 1)) (i29 i15 (i31 i35 1))) (i29 i16 (i31 i35 1))) (i29 i17 (i31 i35 1))) (i29 i18 (i31 i35 1))) (i29 i19 (i31 i35 1))) (i29 i20 (i31 i35 1))) (i29 i21 (i31 i35 1))) (i29 i22 (i31 i35 1))) (i29 i23 (i31 i35 1))) (i29 i24 (i31 i35 1))) (i29 i25 (i31 i35 1))) (i29 i26 (i31 i35 1))) (i29 i27 (i31 i35 1))) (i29 i28 (i31 i35 1))) (i29 i30 (i31 i35 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i32 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i35 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i35 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i35 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #ce) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) +equality.growing.17 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> equalsData (mapData i2) (mapData i1)) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1))) (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i1 addInteger (i30 i15 (i32 i14 1)) (i30 i15 (i32 i36 1))) (i30 i16 (i32 i36 1))) (i30 i17 (i32 i36 1))) (i30 i18 (i32 i36 1))) (i30 i19 (i32 i36 1))) (i30 i20 (i32 i36 1))) (i30 i21 (i32 i36 1))) (i30 i22 (i32 i36 1))) (i30 i23 (i32 i36 1))) (i30 i24 (i32 i36 1))) (i30 i25 (i32 i36 1))) (i30 i26 (i32 i36 1))) (i30 i27 (i32 i36 1))) (i30 i28 (i32 i36 1))) (i30 i29 (i32 i36 1))) (i30 i31 (i32 i36 1)))) (\i0 -> \i0 -> \i0 -> i4 (\i0 -> \i0 -> i7 i5 i2 i1) i2 i1)) (\i0 -> i3 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1))))) (\i0 -> i2 (\i0 -> \i0 -> iData (i3 (unIData i2) (unIData i1))))) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i33 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i36 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i36 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i36 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) #736f6d65746f6b656e) #c0) #c1) #c2) #c3) #c4) #c5) #c6) #c7) #c8) #c9) #ca) #cb) #cc) #cd) #ce) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #cf) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #746f6b656e)) normalize.identity (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i11 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i13 i1))) i1) (\i0 -> (\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i14 i1))) i1) (\i0 -> lessThanInteger 0 i1) i1) i1) (delay i1) (delay (force (force trace "Negative amount in Value" (delay error)))))) ((\i0 -> (\i0 -> i6 (\i0 -> i2 (unMapData i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (mapData i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i13 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i6 (\i0 -> force (i13 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i8 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i9 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i15 #c0 (i16 i20 1)) (i15 #c7 (i16 i20 1))))) (\i0 -> i7 (\i0 -> \i0 -> force (i14 i1 (delay True) (delay (force (i4 (i3 (i15 i1)) (delay (i2 (i16 i1)))))))))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i19) (delay ((\i0 -> i5 (i10 (i14 i2)) (\i0 -> i20 (mkPairData (i13 (i15 i3)) i1) i2) (delay i1)) (i2 (i14 i1)))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) normalize.empty (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i3 (\i0 -> i2 (unMapData i1) (\i0 -> (\i0 -> \i0 -> \i0 -> i2 i3) (mapData i1)) (delay (\i0 -> \i0 -> force i1)))) (\i0 -> (\i0 -> force (i10 (force nullList i1) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) (i3 (\i0 -> force (i10 (equalsData i1 (iData 0)) (delay (\i0 -> \i0 -> force i1)) (delay (\i0 -> \i0 -> i2 i3)))) i1)) i1) ((\i0 -> \i0 -> (\i0 -> i5 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i6 (\i0 -> \i0 -> iData (subtractInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i12 i13 (i14 i18 1)) (i12 i13 (i14 i18 1)))) (\i0 -> \i0 -> i5 (\i0 -> \i0 -> force (i12 i1 (delay i20) (delay ((\i0 -> i5 (i10 (i14 i2)) (\i0 -> i21 (mkPairData (i13 (i15 i3)) i1) i2) (delay i1)) (i2 (i14 i1)))))) i1)) (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i17 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i20 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i20 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i20 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i5 (bData i2) (mapData i1))) #c0) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) assertSorted.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i13 ((\i0 -> \i0 -> i4 (\i0 -> i3 (unMapData (i15 i1))) i1) (\i0 -> force (i4 (force nullList (i6 i1)) (delay ((\i0 -> \i0 -> i5 (\i0 -> i3 (unIData (i16 i1))) i1) (\i0 -> equalsInteger i1 0) i1)))) i1) (delay (force (i6 "Abnormal Value" (delay error)))) (delay (i5 i1)))) ((\i0 -> \i0 -> (\i0 -> i10 (\i0 -> \i0 -> mapData (i3 (unMapData i2) (unMapData i1)))) (\i0 -> \i0 -> i11 (\i0 -> \i0 -> iData (addInteger (unIData i2) (unIData i1))) i2 i1) i2 i1) (i17 #c0 (i18 i22 1)) (i17 #c7 (i18 i22 1)))) (\i0 -> i9 (\i0 -> \i0 -> force (i16 i1 (delay False) (delay (force (i4 (i3 (i17 i1)) (delay (i2 (i18 i1)))))))))) (\i0 -> i11 i1 i2)) (delay True)) (\i0 -> i6 (\i0 -> \i0 -> force (i13 i1 (delay (\i0 -> i4)) (delay ((\i0 -> \i0 -> force (i13 (i1 i2) (delay (force (i6 i7 (delay error)))) (delay (i4 (i17 i3) (\i0 -> lessThanByteString i1 i3))))) (unBData (i12 (i14 i1))))))) i1 (\i0 -> False))) (force trace)) "unsorted map") (\i0 -> \i0 -> \i0 -> i4 i3 (\i0 -> \i0 -> i2) i2 i1)) (\i0 -> i2 (i3 i1))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (\i0 -> \i0 -> \i0 -> force (i10 i1 (delay (i16 i3 i2)) (delay ((\i0 -> (\i0 -> (\i0 -> force (i11 (equalsData i2 i1) (delay (i19 (mkPairData i2 (i9 (i10 i6) (i10 i3))) (i8 (\i0 -> \i0 -> i2) i5 (i15 i4)))) (delay (force (i11 (lessThanByteString (unBData i2) (unBData i1)) (delay (i19 i6 (i8 (\i0 -> \i0 -> i1) i3 (i15 i4) i5))) (delay (i19 i3 (i8 (\i0 -> \i0 -> i1) i6 i5 (i15 i4))))))))) (i11 i2)) (i10 i4)) (i11 i1)))))) (\i0 -> \i0 -> force (i8 i2 (delay i1) (delay (i3 (\i0 -> \i0 -> i1) (i9 i2) (i10 i2) i1)))))) (force (force sndPair))) (force ifThenElse)) (force (force fstPair))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> \i0 -> i4 (bData i2) (mapData i1))) (\i0 -> \i0 -> i3 (bData i2) (iData i1))) (\i0 -> \i0 -> i3 (mkPairData i2 i1) i4)) (force mkCons)) [ ]) #736f6d65746f6b656e)) From 1162618f7bf63faecc7fdf155c17f67323d82e96 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Fri, 8 Jul 2022 18:07:20 +0200 Subject: [PATCH 546/584] formatting --- plutarch-extra/Plutarch/Extra/Interval.hs | 10 +++++----- .../plutarch-extra/Plutarch/Extra/IntervalSpec.hs | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plutarch-extra/Plutarch/Extra/Interval.hs b/plutarch-extra/Plutarch/Extra/Interval.hs index 8d4b9924d..fea750252 100644 --- a/plutarch-extra/Plutarch/Extra/Interval.hs +++ b/plutarch-extra/Plutarch/Extra/Interval.hs @@ -27,11 +27,11 @@ import qualified Plutarch.Monadic as P import Plutarch.Prelude -- check if `a` belongs to interval `i` -member :: - forall a (s :: S). - (PEq a, POrd a, PIsData a) => - Term s a -> - Term s (PInterval a) -> +member :: + forall a (s :: S). + (PEq a, POrd a, PIsData a) => + Term s a -> + Term s (PInterval a) -> Term s PBool member a i = i `contains` (singleton a) diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs index eefde8b11..050e0a6b5 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs @@ -38,8 +38,9 @@ spec = do it "hull of a and b contains a and b" . hedgehog . propertyTest $ prop_hull describe "intersection" $ do - it "intersection of a and b is contained in a and b" . hedgehog - . propertyTest $ prop_intersection + it "intersection of a and b is contained in a and b" . hedgehog + . propertyTest + $ prop_intersection describe "contains" $ do describe "contains on bounded intervals" $ do it "[a, b] contains [c, d] iff a <= c and d <= b" . hedgehog From db3dc154aa50198a046941e5028d1ad7983dbd85 Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 9 Jul 2022 12:48:46 +0200 Subject: [PATCH 547/584] fix pinterval and pinterval tests, add goldens --- Plutarch/Api/V1/Interval.hs | 46 +- plutarch-extra/Plutarch/Extra/Interval.hs | 543 ++++++++++-------- plutarch-extra/plutarch-extra.cabal | 1 + .../extra.intervalutils.fixtures.bench.golden | 16 + ...ra.intervalutils.fixtures.uplc.eval.golden | 16 + .../extra.intervalutils.fixtures.uplc.golden | 16 + .../Plutarch/Extra/IntervalSpec.hs | 104 +++- 7 files changed, 461 insertions(+), 281 deletions(-) create mode 100644 plutarch-test/goldens/extra.intervalutils.fixtures.bench.golden create mode 100644 plutarch-test/goldens/extra.intervalutils.fixtures.uplc.eval.golden create mode 100644 plutarch-test/goldens/extra.intervalutils.fixtures.uplc.golden diff --git a/Plutarch/Api/V1/Interval.hs b/Plutarch/Api/V1/Interval.hs index a305a1785..ae7e66086 100644 --- a/Plutarch/Api/V1/Interval.hs +++ b/Plutarch/Api/V1/Interval.hs @@ -1,4 +1,5 @@ {-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V1.Interval ( PInterval (PInterval), @@ -8,8 +9,18 @@ module Plutarch.Api.V1.Interval ( type PClosure, ) where -import Plutarch.DataRepr (PDataFields) +import Plutarch.DataRepr ( + DerivePConstantViaData (DerivePConstantViaData), + PDataFields, + ) import Plutarch.Prelude +import qualified PlutusLedgerApi.V1.Interval as Plutus + +import Plutarch.Lift ( + PConstantDecl (PConstanted), + PLifted, + PUnsafeLiftDecl, + ) type PClosure = PBool @@ -27,6 +38,17 @@ newtype PInterval a (s :: S) deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) instance DerivePlutusType (PInterval a) where type DPTStrat _ = PlutusTypeData +instance + (PLiftData a) => + PUnsafeLiftDecl (PInterval a) + where + type PLifted (PInterval a) = (Plutus.Interval (PLifted a)) +deriving via + (DerivePConstantViaData (Plutus.Interval a) (PInterval (PConstanted a))) + instance + (PConstantData a) => + PConstantDecl (Plutus.Interval a) + newtype PLowerBound a (s :: S) = PLowerBound ( Term @@ -41,6 +63,17 @@ newtype PLowerBound a (s :: S) deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) instance DerivePlutusType (PLowerBound a) where type DPTStrat _ = PlutusTypeData +instance + (PLiftData a) => + PUnsafeLiftDecl (PLowerBound a) + where + type PLifted (PLowerBound a) = (Plutus.LowerBound (PLifted a)) +deriving via + (DerivePConstantViaData (Plutus.LowerBound a) (PLowerBound (PConstanted a))) + instance + (PConstantData a) => + PConstantDecl (Plutus.LowerBound a) + newtype PUpperBound a (s :: S) = PUpperBound ( Term @@ -62,3 +95,14 @@ data PExtended a (s :: S) deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PEq, POrd) instance DerivePlutusType (PExtended a) where type DPTStrat _ = PlutusTypeData + +instance + (PLiftData a) => + PUnsafeLiftDecl (PUpperBound a) + where + type PLifted (PUpperBound a) = (Plutus.UpperBound (PLifted a)) +deriving via + (DerivePConstantViaData (Plutus.UpperBound a) (PUpperBound (PConstanted a))) + instance + (PConstantData a) => + PConstantDecl (Plutus.UpperBound a) diff --git a/plutarch-extra/Plutarch/Extra/Interval.hs b/plutarch-extra/Plutarch/Extra/Interval.hs index fea750252..c329af7ae 100644 --- a/plutarch-extra/Plutarch/Extra/Interval.hs +++ b/plutarch-extra/Plutarch/Extra/Interval.hs @@ -2,18 +2,18 @@ {-# LANGUAGE QualifiedDo #-} module Plutarch.Extra.Interval ( - member, - interval, - from, - to, - always, - never, - singleton, - hull, - intersection, - contains, - before, - after, + pmember, + pinterval, + pfrom, + pto, + palways, + pnever, + psingleton, + phull, + pintersection, + pcontains, + pbefore, + pafter, ) where import Plutarch.Api.V1.Interval ( @@ -23,317 +23,361 @@ import Plutarch.Api.V1.Interval ( PLowerBound (PLowerBound), PUpperBound (PUpperBound), ) +import Plutarch.Bool (pif') import qualified Plutarch.Monadic as P -import Plutarch.Prelude +import Plutarch.Prelude hiding (psingleton, pto) +import qualified PlutusLedgerApi.V1.Interval as Plutus -- check if `a` belongs to interval `i` -member :: +pmember :: forall a (s :: S). (PEq a, POrd a, PIsData a) => - Term s a -> - Term s (PInterval a) -> - Term s PBool -member a i = i `contains` (singleton a) + Term + s + ( PAsData a + :--> PInterval a + :--> PBool + ) +pmember = phoistAcyclic $ plam $ \a i -> pcontains # i # (psingleton # a) {- | create an interval that includes all values that are greater than or equal - to a and smaller than or equal to b -} -interval :: +pinterval :: forall a (s :: S). PIsData a => - Term s a -> - Term s a -> - Term s (PInterval a) -interval a b = closedInterval start end - where - start :: Term s (PExtended a) - start = pcon $ PFinite $ pdcons @"_0" # (pdata a) # pdnil - - end :: Term s (PExtended a) - end = pcon $ PFinite $ pdcons @"_0" # (pdata b) # pdnil + Term + s + ( PAsData a + :--> PAsData a + :--> PInterval a + ) +pinterval = phoistAcyclic $ + plam $ \a b -> + let start :: Term _ (PExtended a) + start = pcon $ PFinite $ pdcons @"_0" # a # pdnil + + end :: Term _ (PExtended a) + end = pcon $ PFinite $ pdcons @"_0" # b # pdnil + in pclosedInterval # start # end {- | create an interval that includes all values that are greater than or equal - to a -} -from :: forall a s. PIsData a => Term s a -> Term s (PInterval a) -from a = closedInterval start end - where - start :: Term s (PExtended a) - start = pcon $ PFinite $ pdcons @"_0" # (pdata a) # pdnil - - end :: Term s (PExtended a) - end = pcon $ PPosInf pdnil +pfrom :: forall a s. PIsData a => Term s (PAsData a :--> PInterval a) +pfrom = phoistAcyclic $ + plam $ \a -> + let start :: Term _ (PExtended a) + start = pcon $ PFinite $ pdcons @"_0" # a # pdnil + end :: Term _ (PExtended a) + end = pcon $ PPosInf pdnil + in pclosedInterval # start # end {- | create an interval that includes all values that are smaller than or equal - to a -} -to :: forall a (s :: S). PIsData a => Term s a -> Term s (PInterval a) -to a = closedInterval start end - where - start :: Term s (PExtended a) - start = pcon $ PNegInf pdnil +pto :: forall a (s :: S). PIsData a => Term s (PAsData a :--> PInterval a) +pto = phoistAcyclic $ + plam $ \a -> + let start :: Term _ (PExtended a) + start = pcon $ PNegInf pdnil - end :: Term s (PExtended a) - end = pcon $ PFinite $ pdcons @"_0" # (pdata a) # pdnil + end :: Term _ (PExtended a) + end = pcon $ PFinite $ pdcons @"_0" # a # pdnil + in pclosedInterval # start # end -- | create an interval that covers every slot -always :: forall a (s :: S). PIsData a => Term s (PInterval a) -always = closedInterval start end - where - start :: Term s (PExtended a) - start = pcon $ PNegInf pdnil - - end :: Term s (PExtended a) - end = pcon $ PPosInf pdnil +palways :: forall a (s :: S). (PIsData a, PLiftData a) => Term s (PInterval a) +palways = pconstant Plutus.always -- | create an interval that is empty -never :: forall a (s :: S). PIsData a => Term s (PInterval a) -never = closedInterval start end - where - start :: Term s (PExtended a) - start = pcon $ PPosInf pdnil - - end :: Term s (PExtended a) - end = pcon $ PNegInf pdnil +pnever :: forall a (s :: S). (PIsData a, PLiftData a) => Term s (PInterval a) +pnever = pconstant Plutus.never -- | create and interval [a, a] -singleton :: forall a (s :: S). PIsData a => Term s a -> Term s (PInterval a) -singleton a = closedInterval start start - where - start :: Term s (PExtended a) - start = pcon $ PFinite $ pdcons @"_0" # (pdata a) # pdnil +psingleton :: forall a (s :: S). PIsData a => Term s (PAsData a :--> PInterval a) +psingleton = phoistAcyclic $ + plam $ \a -> + plet (pcon $ PFinite $ pdcons @"_0" # a # pdnil) $ \start -> + pclosedInterval # start # start -- | `hull i1 i2` is the smallest interval containing `i1` and `i2` -hull :: +phull :: forall a (s :: S). (PEq a, POrd a, PIsData a) => - Term s (PInterval a) -> - Term s (PInterval a) -> - Term s (PInterval a) -hull x' y' = P.do - x <- pletFields @'["from", "to"] x' - y <- pletFields @'["from", "to"] y' - - lowerX <- plet x.from - upperX <- plet x.to - - lowerY <- plet y.from - upperY <- plet y.to - - let lower = pcon $ PLowerBound $ minP (lToE lowerX) (lToE lowerY) - upper = pcon $ PUpperBound $ maxP (uToE upperX) (uToE upperY) - - interval' lower upper + Term + s + ( PInterval a + :--> PInterval a + :--> PInterval a + ) +phull = phoistAcyclic $ + plam $ \x' y' -> P.do + x <- pletFields @'["from", "to"] x' + y <- pletFields @'["from", "to"] y' + + let lowerX = x.from + upperX = x.to + lowerY = y.from + upperY = y.to + + lower = pcon $ PLowerBound $ minP # (lToE # lowerX) # (lToE # lowerY) + upper = pcon $ PUpperBound $ maxP # (uToE # upperX) # (uToE # upperY) + + pinterval' # pdata lower # pdata upper -- | `intersecion i1 i2` is the largest interval contained in `i1` and `i2` -intersection :: +pintersection :: forall a (s :: S). (PEq a, POrd a, PIsData a) => - Term s (PInterval a) -> - Term s (PInterval a) -> - Term s (PInterval a) -intersection x' y' = P.do - x <- pletFields @'["from", "to"] x' - y <- pletFields @'["from", "to"] y' - - lowerX <- plet x.from - upperX <- plet x.to - - lowerY <- plet y.from - upperY <- plet y.to - - let lower = pcon $ PLowerBound $ maxP (lToE lowerX) (lToE lowerY) - upper = pcon $ PUpperBound $ minP (uToE upperX) (uToE upperY) - - interval' lower upper - --- | `a` contains `b` is true if the interval `b` is entirely contained in `a` -contains :: + Term + s + ( PInterval a + :--> PInterval a + :--> PInterval a + ) +pintersection = phoistAcyclic $ + plam $ \x' y' -> P.do + x <- pletFields @'["from", "to"] x' + y <- pletFields @'["from", "to"] y' + + let lowerX = x.from + upperX = x.to + + lowerY = y.from + upperY = y.to + + lower = pcon $ PLowerBound $ maxP # (lToE # lowerX) # (lToE # lowerY) + upper = pcon $ PUpperBound $ minP # (uToE # upperX) # (uToE # upperY) + + pinterval' # pdata lower # pdata upper + +-- | pcontains # a # b is true if the interval `b` is entirely contained in `a` +pcontains :: forall a (s :: S). (PEq a, POrd a, PIsData a) => - Term s (PInterval a) -> - Term s (PInterval a) -> - Term s PBool -contains x' y' = P.do - x <- pletFields @'["from", "to"] x' - y <- pletFields @'["from", "to"] y' - - lowerX <- plet x.from - upperX <- plet x.to - - lowerY <- plet y.from - upperY <- plet y.to - - (leqP (lToE lowerX) (lToE lowerY)) #&& (leqP (uToE upperY) (uToE upperX)) + Term + s + ( PInterval a + :--> PInterval a + :--> PBool + ) +pcontains = phoistAcyclic $ + plam $ \x' y' -> P.do + x <- pletFields @'["from", "to"] x' + y <- pletFields @'["from", "to"] y' + let lowerX = x.from + upperX = x.to + + lowerY = y.from + upperY = y.to + + leqP # (lToE # lowerX) # (lToE # lowerY) #&& leqP # (uToE # upperY) # (uToE # upperX) -- | `a` before interval `i` is true if `a` is earlier than the start of `i` -before :: +pbefore :: forall a (s :: S). (PEq a, POrd a, PIsData a) => - Term s a -> - Term s (PInterval a) -> - Term s PBool -before a y = P.do - lower <- plet $ pfield @"from" # y - before' a (lToE lower) + Term + s + ( a + :--> PInterval a + :--> PBool + ) +pbefore = phoistAcyclic $ + plam $ \a y -> + let lower = pfield @"from" # y + in pbefore' # a # (lToE # lower) -- | `a` after interval `i` is true if `a` is later than the end of `i` -after :: +pafter :: forall a s. (PEq a, POrd a, PIsData a) => - Term s a -> - Term s (PInterval a) -> - Term s PBool -after a y = P.do - upper <- plet $ pfield @"to" # y - after' a (uToE upper) + Term + s + ( a + :--> PInterval a + :--> PBool + ) +pafter = phoistAcyclic $ + plam $ \a y -> + let upper = pfield @"to" # y + in pafter' # a # (uToE # upper) -- | interval from upper and lower -interval' :: +pinterval' :: forall a (s :: S). PIsData a => - Term s (PLowerBound a) -> - Term s (PUpperBound a) -> - Term s (PInterval a) -interval' lower upper = - pcon $ - PInterval $ - pdcons @"from" # pdata lower - #$ pdcons @"to" # pdata upper # pdnil + Term + s + ( PAsData (PLowerBound a) + :--> PAsData (PUpperBound a) + :--> PInterval a + ) +pinterval' = phoistAcyclic $ + plam $ \lower upper -> + pcon $ + PInterval $ + pdcons @"from" # lower + #$ pdcons @"to" # upper # pdnil -- | closed interval from PExtended -closedInterval :: +pclosedInterval :: forall a (s :: S). PIsData a => - Term s (PExtended a) -> - Term s (PExtended a) -> - Term s (PInterval a) -closedInterval start end = interval' lower upper - where - closure :: Term s PClosure - closure = pconstant True - - upper :: Term s (PUpperBound a) - upper = - pcon $ - PUpperBound $ - pdcons @"_0" # pdata end #$ pdcons @"_1" - # pdata closure - # pdnil - - lower :: Term s (PLowerBound a) - lower = - pcon $ - PLowerBound $ - pdcons @"_0" # pdata start #$ pdcons @"_1" - # pdata closure - # pdnil + Term + s + ( PExtended a + :--> PExtended a + :--> PInterval a + ) +pclosedInterval = phoistAcyclic $ + plam $ \start end -> + let closure :: Term _ (PAsData PClosure) + closure = pconstantData True + + upper :: Term _ (PUpperBound a) + upper = + pcon $ + PUpperBound $ + pdcons @"_0" # pdata end #$ pdcons @"_1" + # closure + # pdnil + + lower :: Term _ (PLowerBound a) + lower = + pcon $ + PLowerBound $ + pdcons @"_0" # pdata start #$ pdcons @"_1" + # closure + # pdnil + in pinterval' # pdata lower # pdata upper -- | value < endpoint -before' :: +pbefore' :: forall a (s :: S). (PIsData a, POrd a, PEq a) => - Term s a -> - Term s (EndPoint a) -> - Term s PBool -before' a y' = P.do - y <- pletFields @'["_0", "_1"] y' - yt <- plet $ y._0 - yc <- plet $ y._1 - - pif - yc - (pmatch yt (ltE' a)) - (pmatch yt (leqE' a)) + Term + s + ( a + :--> EndPoint a + :--> PBool + ) +pbefore' = phoistAcyclic $ + plam $ \a y' -> P.do + y <- pletFields @'["_0", "_1"] y' + yt <- plet $ y._0 + let yc = y._1 + + pif + yc + (pmatch yt (ltE' a)) + (pmatch yt (leqE' a)) -- | value > endpoint -after' :: +pafter' :: forall a (s :: S). (PIsData a, POrd a, PEq a) => - Term s a -> - Term s (EndPoint a) -> - Term s PBool -after' a y' = P.do - y <- pletFields @'["_0", "_1"] y' - yt <- plet $ y._0 - yc <- plet $ y._1 - - pif - yc - (pmatch yt (gtE' a)) - (pmatch yt (geqE' a)) + Term + s + ( a + :--> EndPoint a + :--> PBool + ) +pafter' = phoistAcyclic $ + plam $ \a y' -> P.do + y <- pletFields @'["_0", "_1"] y' + yt <- plet $ y._0 + let yc = y._1 + + pif + yc + (pmatch yt (gtE' a)) + (pmatch yt (geqE' a)) -- | (x :: Term s (EndPoint a)) <= (y :: Term s (EndPoint a)) leqP :: forall a (s :: S). (PIsData a, POrd a, PEq a) => - Term s (EndPoint a) -> - Term s (EndPoint a) -> - Term s PBool -leqP x' y' = P.do - x <- pletFields @'["_0", "_1"] x' - y <- pletFields @'["_0", "_1"] y' - - xt <- plet $ x._0 - yt <- plet $ y._0 - - xc <- plet $ x._1 - yc <- plet $ y._1 - - pif - (xc #&& yc #|| (pnot # xc) #&& (pnot # yc)) - (leqE xt yt) - (ltE xt yt) + Term + s + ( EndPoint a + :--> EndPoint a + :--> PBool + ) +leqP = phoistAcyclic $ + plam $ \x' y' -> P.do + x <- pletFields @'["_0", "_1"] x' + y <- pletFields @'["_0", "_1"] y' + + xt <- plet $ x._0 + yt <- plet $ y._0 + + xc <- plet $ x._1 + yc <- plet $ y._1 + + pif + (xc #&& yc #|| (pnot # xc) #&& (pnot # yc)) + (leqE # xt # yt) + (ltE # xt # yt) minP :: forall a (s :: S). (PIsData a, POrd a, PEq a) => - Term s (EndPoint a) -> - Term s (EndPoint a) -> - Term s (EndPoint a) -minP x y = pif (leqP x y) x y + Term + s + ( EndPoint a + :--> EndPoint a + :--> EndPoint a + ) +minP = phoistAcyclic $ plam $ \x y -> pif' # (leqP # x # y) # x # y maxP :: forall a (s :: S). (PIsData a, POrd a, PEq a) => - Term s (EndPoint a) -> - Term s (EndPoint a) -> - Term s (EndPoint a) -maxP x y = pif (leqP x y) y x + Term + s + ( EndPoint a + :--> EndPoint a + :--> EndPoint a + ) +maxP = phoistAcyclic $ plam $ \x y -> pif' # (leqP # x # y) # y # x -- | (x :: Term s (PExtended a)) < (y :: Term s (PExtended b)) ltE :: forall a (s :: S). (POrd a, PIsData a) => - Term s (PExtended a) -> - Term s (PExtended a) -> - Term s PBool -ltE x y = pmatch x (cont y) + Term + s + ( PExtended a + :--> PExtended a + :--> PBool + ) +ltE = phoistAcyclic $ plam $ \x y -> pmatch x (cont y) where - cont :: Term s (PExtended a) -> PExtended a s -> Term s PBool + cont :: Term _ (PExtended a) -> PExtended a _ -> Term _ PBool cont y' x' = case x' of PNegInf _ -> pconstant True PPosInf _ -> pmatch y' isPosInf - PFinite l -> P.do - a <- plet $ pfield @"_0" # l - pmatch y' (ltE' a) + PFinite l -> pmatch y' (ltE' $ pfield @"_0" # l) -- | (x :: Term s (PExtended a)) = (y :: Term s (PExtended b)) eqE :: forall a (s :: S). (PEq a, PIsData a) => - Term s (PExtended a) -> - Term s (PExtended a) -> - Term s PBool -eqE x y = pmatch x cont - where - cont :: PExtended a s -> Term s PBool - cont x' = case x' of - PNegInf _ -> pmatch y isNegInf - PPosInf _ -> pmatch y isPosInf - PFinite l -> P.do - a <- plet $ pfield @"_0" # l - pmatch y (eqE' a) + Term + s + ( PExtended a + :--> PExtended a + :--> PBool + ) +eqE = phoistAcyclic $ + plam $ \x y -> + let cont x' = case x' of + PNegInf _ -> pmatch y isNegInf + PPosInf _ -> pmatch y isPosInf + PFinite l -> pmatch y (eqE' (pfield @"_0" # l)) + in pmatch x cont -- | value < PExtended ltE' :: @@ -345,9 +389,7 @@ ltE' :: ltE' a y' = case y' of PNegInf _ -> pconstant False PPosInf _ -> pconstant True - PFinite r -> P.do - b <- plet $ pfield @"_0" # r - a #< b + PFinite r -> a #< pfield @"_0" # r -- | value > PExtended gtE' :: @@ -383,7 +425,7 @@ leqE' :: Term s a -> PExtended a s -> Term s PBool -leqE' a y = (ltE' a y) #|| (eqE' a y) +leqE' a y = ltE' a y #|| eqE' a y -- | value >= PExtended geqE' :: @@ -392,16 +434,19 @@ geqE' :: Term s a -> PExtended a s -> Term s PBool -geqE' a y = (gtE' a y) #|| (eqE' a y) +geqE' a y = gtE' a y #|| eqE' a y -- | (x :: Term s (PExtended a)) <= (y :: Term s (PExtended b)) leqE :: forall a (s :: S). (PEq a, POrd a, PIsData a) => - Term s (PExtended a) -> - Term s (PExtended a) -> - Term s PBool -leqE x y = (ltE x y) #|| (eqE x y) + Term + s + ( PExtended a + :--> PExtended a + :--> PBool + ) +leqE = phoistAcyclic $ plam $ \x y -> ltE # x # y #|| eqE # x # y isNegInf :: PExtended a s -> Term s PBool isNegInf x = case x of @@ -419,8 +464,8 @@ type EndPoint a = , "_1" ':= PClosure ] -uToE :: Term s (PUpperBound a) -> Term s (EndPoint a) -uToE x = pmatch x (\(PUpperBound a) -> a) +uToE :: Term s (PUpperBound a :--> EndPoint a) +uToE = phoistAcyclic $ plam $ \x -> pmatch x (\(PUpperBound a) -> a) -lToE :: Term s (PLowerBound a) -> Term s (EndPoint a) -lToE x = pmatch x (\(PLowerBound a) -> a) +lToE :: Term s (PLowerBound a :--> EndPoint a) +lToE = phoistAcyclic $ plam $ \x -> pmatch x (\(PLowerBound a) -> a) diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index a854e700a..2e7985ea5 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -70,6 +70,7 @@ common deps build-depends: , base , plutarch + , plutus-ledger-api library plutarch-preludes import: c, deps diff --git a/plutarch-test/goldens/extra.intervalutils.fixtures.bench.golden b/plutarch-test/goldens/extra.intervalutils.fixtures.bench.golden new file mode 100644 index 000000000..1cb99a739 --- /dev/null +++ b/plutarch-test/goldens/extra.intervalutils.fixtures.bench.golden @@ -0,0 +1,16 @@ +constants.always {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":34} +constants.never {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":34} +constants.always {"exBudgetCPU":18925489,"exBudgetMemory":56043,"scriptSizeBytes":566} +constants.never {"exBudgetCPU":15555211,"exBudgetMemory":45859,"scriptSizeBytes":566} +contains.in interval {"exBudgetCPU":25338906,"exBudgetMemory":72519,"scriptSizeBytes":558} +contains.out interval {"exBudgetCPU":20362113,"exBudgetMemory":58635,"scriptSizeBytes":557} +member.[b,c], a < b {"exBudgetCPU":19885479,"exBudgetMemory":57171,"scriptSizeBytes":567} +member.[b,c], a = b {"exBudgetCPU":28443010,"exBudgetMemory":79782,"scriptSizeBytes":561} +member.[b,c], a > b, a < c {"exBudgetCPU":24862272,"exBudgetMemory":71055,"scriptSizeBytes":567} +member.[b,c], a = c {"exBudgetCPU":28512010,"exBudgetMemory":80082,"scriptSizeBytes":563} +member.[b,c], a > c {"exBudgetCPU":28512010,"exBudgetMemory":80082,"scriptSizeBytes":567} +hull.hull 3 5 contains 3 5 {"exBudgetCPU":54095236,"exBudgetMemory":149209,"scriptSizeBytes":645} +hull.2 not member of hull 3 5 {"exBudgetCPU":41549333,"exBudgetMemory":116707,"scriptSizeBytes":627} +hull.6 not member of hull 3 5 {"exBudgetCPU":41549333,"exBudgetMemory":116707,"scriptSizeBytes":627} +intersection.intesection [2,4] [3,5] contains [3,4] {"exBudgetCPU":54910504,"exBudgetMemory":151537,"scriptSizeBytes":645} +intersection.intesection [3,5] [2,4] contains [3,4] {"exBudgetCPU":62209980,"exBudgetMemory":169591,"scriptSizeBytes":645} \ No newline at end of file diff --git a/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.eval.golden b/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.eval.golden new file mode 100644 index 000000000..56e53089a --- /dev/null +++ b/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.eval.golden @@ -0,0 +1,16 @@ +constants.always (program 1.0.0 #d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff) +constants.never (program 1.0.0 #d8799fd8799fd87b80d87a80ffd8799fd87980d87a80ffff) +constants.always (program 1.0.0 True) +constants.never (program 1.0.0 False) +contains.in interval (program 1.0.0 True) +contains.out interval (program 1.0.0 False) +member.[b,c], a < b (program 1.0.0 False) +member.[b,c], a = b (program 1.0.0 True) +member.[b,c], a > b, a < c (program 1.0.0 True) +member.[b,c], a = c (program 1.0.0 True) +member.[b,c], a > c (program 1.0.0 False) +hull.hull 3 5 contains 3 5 (program 1.0.0 True) +hull.2 not member of hull 3 5 (program 1.0.0 False) +hull.6 not member of hull 3 5 (program 1.0.0 False) +intersection.intesection [2,4] [3,5] contains [3,4] (program 1.0.0 True) +intersection.intesection [3,5] [2,4] contains [3,4] (program 1.0.0 True) \ No newline at end of file diff --git a/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.golden b/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.golden new file mode 100644 index 000000000..bcdf2b1da --- /dev/null +++ b/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.golden @@ -0,0 +1,16 @@ +constants.always (program 1.0.0 #d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff) +constants.never (program 1.0.0 #d8799fd8799fd87b80d87a80ffd8799fd87980d87a80ffff) +constants.always (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) #d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff ((\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> constrData 0 (i25 i2 (i25 i1 i26))) (constrData 0 (i23 i2 (i23 i22 i24))) (constrData 0 (i23 i1 (i23 i22 i24)))) (constrData 1 (i21 i2 i22)) (constrData 1 (i21 i1 i22))) #01 #02)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d87a80) (force mkCons)) [ ])) +constants.never (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) #d8799fd8799fd87b80d87a80ffd8799fd87980d87a80ffff ((\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> constrData 0 (i25 i2 (i25 i1 i26))) (constrData 0 (i23 i2 (i23 i22 i24))) (constrData 0 (i23 i1 (i23 i22 i24)))) (constrData 1 (i21 i2 i22)) (constrData 1 (i21 i1 i22))) #01 #02)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d87a80) (force mkCons)) [ ])) +contains.in interval (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) (i18 #03 #05) (i18 i24 i24)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 1 (i6 i2 i7)) (constrData 1 (i6 i1 i7)))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ]) #04)) +contains.out interval (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) (i19 i18 i18) (i19 #03 #05)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #04) (\i0 -> \i0 -> i3 (constrData 1 (i6 i2 i7)) (constrData 1 (i6 i1 i7)))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ])) +member.[b,c], a < b (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (i6 (i18 (i19 i2)) (i18 (i19 i1))) (delay (i6 (i18 (i19 (i20 i1))) (i18 (i19 (i20 i2))))))) (i20 i2)) (i19 i2)) ((\i0 -> i21 i1 i1) (constrData 1 (i23 i2 i24)))) #01 ((\i0 -> \i0 -> i20 (constrData 1 (i23 i2 i24)) (constrData 1 (i23 i1 i24))) #02 #04)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ])) +member.[b,c], a = b (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) ((\i0 -> i20 i1 i1) (constrData 1 (i22 i24 i23)))) ((\i0 -> i19 (constrData 1 (i22 i24 i23)) (constrData 1 (i22 i1 i23))) #04)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ]) #02)) +member.[b,c], a > b, a < c (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (i6 (i18 (i19 i2)) (i18 (i19 i1))) (delay (i6 (i18 (i19 (i20 i1))) (i18 (i19 (i20 i2))))))) (i20 i2)) (i19 i2)) ((\i0 -> i21 i1 i1) (constrData 1 (i23 i2 i24)))) #03 ((\i0 -> \i0 -> i20 (constrData 1 (i23 i2 i24)) (constrData 1 (i23 i1 i24))) #02 #04)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ])) +member.[b,c], a = c (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) ((\i0 -> i20 i1 i1) (constrData 1 (i22 i24 i23)))) ((\i0 -> \i0 -> i20 (constrData 1 (i23 i2 i24)) (constrData 1 (i23 i1 i24))) #02 i23)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ]) #04)) +member.[b,c], a > c (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (i6 (i18 (i19 i2)) (i18 (i19 i1))) (delay (i6 (i18 (i19 (i20 i1))) (i18 (i19 (i20 i2))))))) (i20 i2)) (i19 i2)) ((\i0 -> i21 i1 i1) (constrData 1 (i23 i2 i24)))) #05 ((\i0 -> \i0 -> i20 (constrData 1 (i23 i2 i24)) (constrData 1 (i23 i1 i24))) #02 #04)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ])) +hull.hull 3 5 contains 3 5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) ((\i0 -> \i0 -> (\i0 -> (\i0 -> i24 (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i2 i1) (i17 (i18 i2)) (i17 (i18 i1)))) (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i1 i2) (i17 (i18 (i19 i2))) (i17 (i18 (i19 i1)))))) (i19 i2)) (i18 i2)) (i18 i24) (i18 i25)) (i19 (constrData 1 (i22 i24 i23)) (constrData 1 (i22 i25 i23)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i3 i1 i1) (constrData 1 (i5 i1 i6)))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ]) #03) #05)) +hull.2 not member of hull 3 5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (i6 (i18 (i19 i2)) (i18 (i19 i1))) (delay (i6 (i18 (i19 (i20 i1))) (i18 (i19 (i20 i2))))))) (i20 i2)) (i19 i2)) (i20 i2)) #02 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i24 (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i2 i1) (i17 (i18 i2)) (i17 (i18 i1)))) (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i1 i2) (i17 (i18 (i19 i2))) (i17 (i18 (i19 i1)))))) (i19 i2)) (i18 i2)) (i18 #03) (i18 #05))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i3 i1 i1) (constrData 1 (i5 i1 i6)))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ])) +hull.6 not member of hull 3 5 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (i6 (i18 (i19 i2)) (i18 (i19 i1))) (delay (i6 (i18 (i19 (i20 i1))) (i18 (i19 (i20 i2))))))) (i20 i2)) (i19 i2)) (i20 i2)) #02 ((\i0 -> \i0 -> (\i0 -> (\i0 -> i24 (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i2 i1) (i17 (i18 i2)) (i17 (i18 i1)))) (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i1 i2) (i17 (i18 (i19 i2))) (i17 (i18 (i19 i1)))))) (i19 i2)) (i18 i2)) (i18 #03) (i18 #05))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i3 i1 i1) (constrData 1 (i5 i1 i6)))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ])) +intersection.intesection [2,4] [3,5] contains [3,4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) ((\i0 -> \i0 -> (\i0 -> (\i0 -> i24 (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i1 i2) (i17 (i18 i2)) (i17 (i18 i1)))) (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i2 i1) (i17 (i18 (i19 i2))) (i17 (i18 (i19 i1)))))) (i19 i2)) (i18 i2)) (i18 #02 i25) (i18 i24 #05)) (i18 i24 i25)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 1 (i6 i2 i7)) (constrData 1 (i6 i1 i7)))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ]) #03) #04)) +intersection.intesection [3,5] [2,4] contains [3,4] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) ((\i0 -> \i0 -> (\i0 -> (\i0 -> i24 (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i1 i2) (i17 (i18 i2)) (i17 (i18 i1)))) (constrData 0 ((\i0 -> \i0 -> i16 (i7 i2 i1) i2 i1) (i17 (i18 (i19 i2))) (i17 (i18 (i19 i1)))))) (i19 i2)) (i18 i2)) (i18 i24 #05) (i18 #02 i25)) (i18 i24 i25)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 1 (i6 i2 i7)) (constrData 1 (i6 i1 i7)))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ]) #03) #04)) \ No newline at end of file diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs index 050e0a6b5..b8dac8ba0 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs @@ -2,30 +2,70 @@ module Plutarch.Extra.IntervalSpec (spec) where import Plutarch.Api.V1.Interval (PInterval) import Plutarch.Extra.Interval ( - after, - always, - before, - contains, - from, - hull, - intersection, - interval, - member, - never, - to, + pafter, + palways, + pbefore, + pcontains, + pfrom, + phull, + pintersection, + pinterval, + pmember, + pnever, + psingleton, + pto, ) -import Plutarch.Prelude +import Plutarch.Prelude hiding (psingleton, pto) import Hedgehog (Property, PropertyT, assert, forAll, property) import qualified Hedgehog.Gen as Gen (int, list) import Hedgehog.Internal.Property (propertyTest) import qualified Hedgehog.Range as Range (constantBounded, singleton) +import Plutarch.Test (passert, passertNot, pgoldenSpec, psucceeds, (@->), (@\), (@|)) import Test.Hspec (Spec, describe, it) import Test.Hspec.Hedgehog (hedgehog) spec :: Spec spec = do describe "extra.intervalutils" $ do + describe "fixtures" $ do + let i1 :: Term s (PInterval PInteger) + i1 = mkInterval 1 2 + i2 :: Term s (PInterval PInteger) + i2 = mkInterval 3 5 + i3 :: Term s (PInterval PInteger) + i3 = mkInterval 2 4 + i4 :: Term s (PInterval PInteger) + i4 = mkInterval 4 4 + i5 :: Term s (PInterval PInteger) + i5 = mkInterval 3 4 + pgoldenSpec $ do + "constants" @\ do + "always" @| palways @PInteger @-> psucceeds + "never" @| pnever @PInteger @-> psucceeds + "always" @| pcontains # palways @PInteger # i1 @-> passert + "never" @| pcontains # pnever @PInteger # i1 @-> passertNot + "contains" @\ do + "in interval" @| pcontains # i2 # i4 @-> passert + "out interval" @| pcontains # i4 # i2 @-> passertNot + "member" @\ do + "[b,c], a < b" @| pmember # pconstantData 1 # i3 @-> passertNot + "[b,c], a = b" @| pmember # pconstantData 2 # i3 @-> passert + "[b,c], a > b, a < c" @| pmember # pconstantData 3 # i3 @-> passert + "[b,c], a = c" @| pmember # pconstantData 4 # i3 @-> passert + "[b,c], a > c" @| pmember # pconstantData 5 # i3 @-> passertNot + "hull" @\ do + let theHull :: Term s (PInterval PInteger) + theHull = phull # (psingleton # pconstantData 3) # (psingleton # pconstantData 5) + "hull 3 5 contains 3 5" @| pcontains # theHull # i2 @-> passert + "2 not member of hull 3 5" @| pmember # pconstantData 2 # theHull @-> passertNot + "6 not member of hull 3 5" @| pmember # pconstantData 2 # theHull @-> passertNot + "intersection" @\ do + "intesection [2,4] [3,5] contains [3,4]" + @| pcontains # (pintersection # i3 # i2) # i5 + "intesection [3,5] [2,4] contains [3,4]" + @| pcontains # (pintersection # i2 # i3) # i5 + describe "member" $ do it "a is a member of [b, c] iff b <= a and a <= c" . hedgehog . propertyTest @@ -119,23 +159,23 @@ checkMember a b c = actual == expected i :: Term s (PInterval PInteger) i = mkInterval b c - actual = plift $ (pconstant a) `member` i + actual = plift $ pmember # pconstantData a # i expected = (min b c <= a) && (a <= max b c) checkAlways :: Integer -> Integer -> Bool -checkAlways a b = plift $ always `contains` i +checkAlways a b = plift $ pcontains # palways # i where i :: Term s (PInterval PInteger) i = mkInterval a b checkNever :: Integer -> Integer -> Bool -checkNever a b = not (plift $ never `contains` i) +checkNever a b = not (plift $ pcontains # pnever # i) where i :: Term s (PInterval PInteger) i = mkInterval a b checkHull :: Integer -> Integer -> Integer -> Integer -> Bool -checkHull a b c d = plift $ (i3 `contains` i1) #&& (i3 `contains` i2) +checkHull a b c d = plift $ (pcontains # i3 # i1) #&& (pcontains # i3 # i2) where i1 :: Term s (PInterval PInteger) i1 = mkInterval a b @@ -143,10 +183,11 @@ checkHull a b c d = plift $ (i3 `contains` i1) #&& (i3 `contains` i2) i2 :: Term s (PInterval PInteger) i2 = mkInterval c d - i3 = hull i1 i2 + i3 :: Term s (PInterval PInteger) + i3 = phull # i1 # i2 checkIntersection :: Integer -> Integer -> Integer -> Integer -> Bool -checkIntersection a b c d = plift $ (i1 `contains` i3) #&& (i2 `contains` i3) +checkIntersection a b c d = plift $ (pcontains # i1 # i3) #&& (pcontains # i2 # i3) where i1 :: Term s (PInterval PInteger) i1 = mkInterval a b @@ -154,7 +195,8 @@ checkIntersection a b c d = plift $ (i1 `contains` i3) #&& (i2 `contains` i3) i2 :: Term s (PInterval PInteger) i2 = mkInterval c d - i3 = intersection i1 i2 + i3 :: Term s (PInterval PInteger) + i3 = pintersection # i1 # i2 checkBoundedContains :: Integer -> Integer -> Integer -> Integer -> Bool checkBoundedContains a b c d = actual == expected @@ -168,37 +210,37 @@ checkBoundedContains a b c d = actual == expected expected = (min a b <= min c d) && (max c d <= max a b) actual' :: ClosedTerm PBool - actual' = i1 `contains` i2 + actual' = pcontains # i1 # i2 actual = plift actual' checkUnboundedUpperContains :: Integer -> Integer -> Integer -> Bool checkUnboundedUpperContains a b c = actual == expected where i1 :: Term s (PInterval PInteger) - i1 = from (pconstant a) + i1 = pfrom # pconstantData a i2 :: Term s (PInterval PInteger) i2 = mkInterval b c expected :: Bool - expected = a <= (min b c) + expected = a <= min b c actual' :: ClosedTerm PBool - actual' = i1 `contains` i2 + actual' = pcontains # i1 # i2 actual = plift actual' checkUnboundedLowerContains :: Integer -> Integer -> Integer -> Bool checkUnboundedLowerContains a b c = actual == expected where i1 :: Term s (PInterval PInteger) - i1 = to (pconstant a) + i1 = pto # pconstantData a i2 :: Term s (PInterval PInteger) i2 = mkInterval b c expected :: Bool - expected = a >= (max b c) + expected = a >= max b c actual' :: ClosedTerm PBool - actual' = i1 `contains` i2 + actual' = pcontains # i1 # i2 actual = plift actual' checkBefore :: Integer -> Integer -> Integer -> Bool @@ -208,10 +250,10 @@ checkBefore a b c = actual == expected i = mkInterval b c expected :: Bool - expected = a < (min b c) + expected = a < min b c actual' :: ClosedTerm PBool - actual' = (pconstant a) `before` i + actual' = pbefore # pconstant a # i actual = plift actual' checkAfter :: Integer -> Integer -> Integer -> Bool @@ -221,14 +263,14 @@ checkAfter a b c = actual == expected i = mkInterval b c expected :: Bool - expected = (max b c) < a + expected = max b c < a actual' :: ClosedTerm PBool - actual' = (pconstant a) `after` i + actual' = pafter # pconstant a # i actual = plift actual' mkInterval :: forall s. Integer -> Integer -> Term s (PInterval PInteger) -mkInterval a' b' = interval (pconstant a) (pconstant b) +mkInterval a' b' = pinterval # pconstantData a # pconstantData b where a = min a' b' b = max a' b' From 9b48ad8805f613e9851ec8a3112ff91658b4ed9b Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 9 Jul 2022 13:19:53 +0200 Subject: [PATCH 548/584] fix order of type variables for hrecField and pfield and deprecate hrecField --- Plutarch/DataRepr/Internal/Field.hs | 10 +++++----- Plutarch/DataRepr/Internal/HList.hs | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Plutarch/DataRepr/Internal/Field.hs b/Plutarch/DataRepr/Internal/Field.hs index d856ef39b..c9e0b9bf3 100644 --- a/Plutarch/DataRepr/Internal/Field.hs +++ b/Plutarch/DataRepr/Internal/Field.hs @@ -262,16 +262,16 @@ instance {-# OVERLAPPABLE #-} (BindFields ps bs) => BindFields (p1 ': p2 ': p3 ' which will generate the bindings more efficiently. -} pfield :: - forall name p s a as n b. + forall name b p s a as n. ( PDataFields p - , as ~ (PFields p) - , n ~ (PLabelIndex name as) + , as ~ PFields p + , n ~ PLabelIndex name as , KnownNat n - , a ~ (PUnLabel (IndexList n as)) + , a ~ PUnLabel (IndexList n as) , PFromDataable a b ) => Term s (p :--> b) pfield = - let _ = witness (Proxy @(n ~ (PLabelIndex name as))) + let _ = witness (Proxy @(n ~ PLabelIndex name as)) in plam $ \i -> pmaybeFromAsData $ pindexDataRecord (Proxy @n) $ ptoFields @p i diff --git a/Plutarch/DataRepr/Internal/HList.hs b/Plutarch/DataRepr/Internal/HList.hs index 110c358bd..bc7b969f8 100644 --- a/Plutarch/DataRepr/Internal/HList.hs +++ b/Plutarch/DataRepr/Internal/HList.hs @@ -113,7 +113,7 @@ instance >>> 2 -} hrecField :: - forall name a as b c s. + forall name c as a b s. ( ElemOf name a as , Term s (PAsData b) ~ a , PFromDataable b c @@ -121,10 +121,11 @@ hrecField :: HRec as -> Term s c hrecField xs = pmaybeFromAsData $ hrecField' @name xs +{-# DEPRECATED hrecField "please use getField from GHC.Records" #-} ---------- HasField instances instance - forall name a as b c s. + forall name c as a b s. ( IndexLabel name as ~ a , ElemOf name a as , Term s (PAsData b) ~ a From 2779abf984eaebe356420479e260f60bc102f5fc Mon Sep 17 00:00:00 2001 From: mangoiv Date: Sat, 9 Jul 2022 17:17:21 +0200 Subject: [PATCH 549/584] remove notion of equality for unsorted Maps --- Plutarch/Api/V1/AssocMap.hs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 1521d03a6..c4917a086 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -74,8 +74,6 @@ newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMa deriving anyclass (PlutusType, PIsData, PShow) instance DerivePlutusType (PMap keysort k v) where type DPTStrat _ = PlutusTypeNewtype -instance PEq (PMap 'Unsorted k v) - instance PEq (PMap 'Sorted k v) where x #== y = peqViaData # x # y where From b336549d5878040854137b2e47a71bb5dbd13760 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sun, 10 Jul 2022 18:55:17 +0530 Subject: [PATCH 550/584] Improve `freshVarName` --- Plutarch/Pretty/Internal/Name.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Plutarch/Pretty/Internal/Name.hs b/Plutarch/Pretty/Internal/Name.hs index c899b085a..0b4622460 100644 --- a/Plutarch/Pretty/Internal/Name.hs +++ b/Plutarch/Pretty/Internal/Name.hs @@ -52,13 +52,16 @@ freshVarName = do stGen <- ask PrettyState {ps'names} <- get let existingNames = Set.union ps'names keywords - nameLen <- lift . lift $ randomRM (1 :: Int, 7) stGen - newName <- fmap Txt.pack . for [1 .. nameLen] $ \_ -> do - chosenIx <- lift . lift $ uniformRM (1, Txt.length chars - 1) stGen - pure $ Txt.index chars chosenIx + nameTailLen <- lift . lift $ randomRM (0 :: Int, 7) stGen + beginChar <- chooseChar starterChars + newName <- fmap (Txt.pack . (beginChar:)) . for [0 .. nameTailLen] . const $ chooseChar chars if Set.member newName existingNames then freshVarName else modify' (memorizeName newName) $> newName where - chars :: Text - chars = "abcdefghijkmnprstuvwxyz" + chooseChar x = do + stGen <- ask + chosenIx <- lift . lift $ uniformRM (0, Txt.length x - 1) stGen + pure $ Txt.index x chosenIx + starterChars = Txt.pack ['a' .. 'z'] + chars = Txt.append starterChars . Txt.pack $ ['A' .. 'Z'] ++ ['0' .. '9'] ++ ['_', '\''] From da5e7db2aa6ac9969863232369055a3b8816608d Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sun, 10 Jul 2022 18:55:48 +0530 Subject: [PATCH 551/584] General imrpovements --- Plutarch/Pretty/Internal/BuiltinConstant.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plutarch/Pretty/Internal/BuiltinConstant.hs b/Plutarch/Pretty/Internal/BuiltinConstant.hs index 5a0fb2d3f..c11280a92 100644 --- a/Plutarch/Pretty/Internal/BuiltinConstant.hs +++ b/Plutarch/Pretty/Internal/BuiltinConstant.hs @@ -17,8 +17,8 @@ import Plutarch.Pretty.Internal.Config (indentWidth) prettyConstant :: PLC.Some (PLC.ValueOf DefaultUni) -> PP.Doc () prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniInteger n)) = PP.pretty n -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniByteString b)) = PP.pretty $ fromHex b -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniString s)) = PP.pretty $ show s +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniByteString b)) = PP.pretty $ encodeHex b +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniString s)) = PP.pretty s prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniUnit _)) = "()" prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniBool b)) = PP.pretty b prettyConstant (PLC.Some (PLC.ValueOf (PLC.DefaultUniList a) l)) = @@ -51,5 +51,5 @@ prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniData (Plutus.I i))) = prettyConstant (PLC.Some (PLC.ValueOf uni _)) = error $ "prettyConstant(impossible): " <> show uni -fromHex :: ByteString -> Text -fromHex = ("0x" <>) . TxtEnc.decodeUtf8 . LBS.toStrict . BSB.toLazyByteString . BSB.byteStringHex +encodeHex :: ByteString -> Text +encodeHex = ("0x" <>) . TxtEnc.decodeUtf8 . LBS.toStrict . BSB.toLazyByteString . BSB.byteStringHex From 581ff7041c2606675136bb94ed538c27813a1e0f Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sun, 10 Jul 2022 18:55:55 +0530 Subject: [PATCH 552/584] Add semantics documentation --- Plutarch/Pretty.hs | 107 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 103 insertions(+), 4 deletions(-) diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index 954b8cf04..462c7e311 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -1,6 +1,6 @@ {-# LANGUAGE PatternSynonyms #-} -module Plutarch.Pretty (prettyTerm, prettyScript) where +module Plutarch.Pretty (prettyTerm, prettyTerm', prettyScript) where import Control.Monad.Reader (ReaderT (runReaderT)) import Control.Monad.ST (runST) @@ -8,13 +8,15 @@ import Control.Monad.State (MonadState (get, put), StateT (runStateT), modify, m import Data.Foldable (fold) import Data.Functor (($>), (<&>)) import Data.Traversable (for) +import Data.Text (Text) +import qualified Data.Text as Txt import System.Random.Stateful (mkStdGen, newSTGenM) import Prettyprinter ((<+>)) import qualified Prettyprinter as PP -import Plutarch.Internal (ClosedTerm, compile) +import Plutarch.Internal (ClosedTerm, compile, Config) import PlutusLedgerApi.V1.Scripts (Script (unScript)) import qualified PlutusCore as PLC import UntypedPlutusCore ( @@ -49,11 +51,108 @@ import Plutarch.Pretty.Internal.Types ( unaryCursor, ) +-- | 'prettyTerm' for pre-compiled 'Script's. prettyScript :: Script -> PP.Doc () prettyScript = prettyUPLC . _progTerm . unScript -prettyTerm :: ClosedTerm a -> PP.Doc () -prettyTerm x = prettyScript $ compile x +{- | Prettify a Plutarch term. + +== Semantics == + +=== Constants === + +- Builtin integers are printed as regular integers. [0-9]+ +- Builtin bytestrings are printed in hex notation, prefixed by `0x`. 0x[0-9a-f]+/i +- Builtin strings are printed as is. +- Builtin unit is printed as the unit literal. () +- Builtin booleans are printed as the literal `True` or `False`. +- Builtin lists are prettified as list literals, i.e delimited with `[` and `]`. +- Builtin pairs are prettified as 2-ary tuple literals, e.g. `(a, b)`. +- `I` data (i.e data encoded integers) are prettified like builtin integers with a `#` prefix. #[0-9]+ +- `B` data (i.e data encoded bytestrings) are prettified like builtin bytestrings with a `#` prefix. #0x[0-9a-f]+/i +- `List` data (i.e data encoded lists) are prettified like builtin lists with a `#` prefix. +- `Map` data is printed like record literals. Delimited by `{` and `}`. + + Each key value pair is prettified like = and multiple pairs are joined with `,`. + + For example, `Map [(I 42, I 0), (I 100, I 1)]` is prettified as `{ #42 = #0, #100 = #1 }` +- Constr data has two core elements in its prettified form: + + - The constructor index, prettified as an integer prefixed with `Σ` (sigma). + - Its fields, prettified as a list. + + These two elements are then joined with a `.` (period). + + For example, `Constr 1 [I 42]` is prettified as "Σ1.[#42]". + +=== Builtin functions === + +Builtin functions are prettified into their name, in title case. + +=== Forced term === + +Forced terms are prefixed with a `!`. The unary operator `!` has higher fixity than function application. + +=== Delayed term === + +Delayed terms are prefixed with a `~`. The unary operator `~` has higher fixity than function application. + +=== Var === + +Random names are generated for all variable bindings, and these names are used to refer to them. + +Names are always unique, between 1 and 8 characters in length, and begin with a lowercase letter. + +Names may consist of alphanumeric characters, underscore, or single quotes. + +=== LamAbs === + +Lambdas are prettified similar to haskell lambdas, i.e `\x -> ...`. + +Lambdas with multiple arguments are detected and simplified: `\x y z -> ...`. + +=== Apply === + +Application is, simply, a space - just like haskell. `f x`. + +Multi arg applications to the same function are detected and simplified: `f x y`. + +=== Error term === + +`perror` is represented by the literal `ERROR`. + +=== Special handling === + +To achieve better prettification, certain AST structures are given special handling logic. + +- The AST structure produced by `plet` (Single `Apply` + `LamAbs` pair) is prettified into Haskell-like let bindings. +- Lazy if/then/else (`pif` in particular, not `pif'`) is detected and prettified into Haskell-like syntax: + `if cond then expr1 else expr2`. + + Chains of if/then/else are nested: + + @ + if cond + then expr1 + else if cond + then expr2 + else expr3 + @ +- When generating names for bindings, well known structures are identified and given special names. + + This machinery is made to be extensible in the future. + + For example, the structure of the `pfix` function is well known and constant - so it is simply called `fix` in the output. + + Bindings to forced builtin functions inherit the builtin function name, prefixed with a `fr`. + +-} +prettyTerm :: Config -> ClosedTerm a -> Either Text (PP.Doc ()) +prettyTerm conf x = prettyScript <$> compile conf x + +-- | Partial version of 'prettyTerm'. Calls 'error' upon compilation failure. +prettyTerm' :: Config -> ClosedTerm a -> PP.Doc () +prettyTerm' conf x = either (error . Txt.unpack) prettyScript $ compile conf x {- This isn't suitable for pretty printing UPLC from any source. It's primarily suited for Plutarch output. Practically speaking though, it should work with any _idiomatic_ UPLC. From cd74c2e62c33ed0dd8ef67392b878f72965635b9 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sun, 10 Jul 2022 18:58:47 +0530 Subject: [PATCH 553/584] Fix formatting --- Plutarch.hs | 2 +- Plutarch/Pretty.hs | 7 +++---- Plutarch/Pretty/Internal/BuiltinConstant.hs | 2 +- Plutarch/Pretty/Internal/Name.hs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Plutarch.hs b/Plutarch.hs index e02491062..41465c29b 100644 --- a/Plutarch.hs +++ b/Plutarch.hs @@ -61,8 +61,8 @@ import qualified Plutarch.Internal.PLam as PL import qualified Plutarch.Internal.PlutusType as PP import qualified Plutarch.Internal.Quantification as PQ import qualified Plutarch.Internal.ScottEncoding as PS -import qualified Plutarch.Pretty as PPR import Plutarch.Num () +import qualified Plutarch.Pretty as PPR import qualified Plutarch.TermCont as PT -- import orphan instances diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index 462c7e311..9f56da607 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -7,18 +7,18 @@ import Control.Monad.ST (runST) import Control.Monad.State (MonadState (get, put), StateT (runStateT), modify, modify') import Data.Foldable (fold) import Data.Functor (($>), (<&>)) -import Data.Traversable (for) import Data.Text (Text) import qualified Data.Text as Txt +import Data.Traversable (for) import System.Random.Stateful (mkStdGen, newSTGenM) import Prettyprinter ((<+>)) import qualified Prettyprinter as PP -import Plutarch.Internal (ClosedTerm, compile, Config) -import PlutusLedgerApi.V1.Scripts (Script (unScript)) +import Plutarch.Internal (ClosedTerm, Config, compile) import qualified PlutusCore as PLC +import PlutusLedgerApi.V1.Scripts (Script (unScript)) import UntypedPlutusCore ( DeBruijn (DeBruijn), DefaultFun, @@ -145,7 +145,6 @@ To achieve better prettification, certain AST structures are given special handl For example, the structure of the `pfix` function is well known and constant - so it is simply called `fix` in the output. Bindings to forced builtin functions inherit the builtin function name, prefixed with a `fr`. - -} prettyTerm :: Config -> ClosedTerm a -> Either Text (PP.Doc ()) prettyTerm conf x = prettyScript <$> compile conf x diff --git a/Plutarch/Pretty/Internal/BuiltinConstant.hs b/Plutarch/Pretty/Internal/BuiltinConstant.hs index c11280a92..15ef24d92 100644 --- a/Plutarch/Pretty/Internal/BuiltinConstant.hs +++ b/Plutarch/Pretty/Internal/BuiltinConstant.hs @@ -9,8 +9,8 @@ import qualified Data.Text.Encoding as TxtEnc import Prettyprinter ((<+>)) import qualified Prettyprinter as PP -import qualified PlutusLedgerApi.V1 as Plutus import qualified PlutusCore as PLC +import qualified PlutusLedgerApi.V1 as Plutus import UntypedPlutusCore (DefaultUni) import Plutarch.Pretty.Internal.Config (indentWidth) diff --git a/Plutarch/Pretty/Internal/Name.hs b/Plutarch/Pretty/Internal/Name.hs index 0b4622460..2da634503 100644 --- a/Plutarch/Pretty/Internal/Name.hs +++ b/Plutarch/Pretty/Internal/Name.hs @@ -54,7 +54,7 @@ freshVarName = do let existingNames = Set.union ps'names keywords nameTailLen <- lift . lift $ randomRM (0 :: Int, 7) stGen beginChar <- chooseChar starterChars - newName <- fmap (Txt.pack . (beginChar:)) . for [0 .. nameTailLen] . const $ chooseChar chars + newName <- fmap (Txt.pack . (beginChar :)) . for [0 .. nameTailLen] . const $ chooseChar chars if Set.member newName existingNames then freshVarName else modify' (memorizeName newName) $> newName From ac6b59afac37bd20d77e03c690380034989e8e52 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sun, 10 Jul 2022 19:06:46 +0530 Subject: [PATCH 554/584] Fix builtin string prettification --- Plutarch/Pretty/Internal/BuiltinConstant.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plutarch/Pretty/Internal/BuiltinConstant.hs b/Plutarch/Pretty/Internal/BuiltinConstant.hs index 15ef24d92..8907beceb 100644 --- a/Plutarch/Pretty/Internal/BuiltinConstant.hs +++ b/Plutarch/Pretty/Internal/BuiltinConstant.hs @@ -18,7 +18,9 @@ import Plutarch.Pretty.Internal.Config (indentWidth) prettyConstant :: PLC.Some (PLC.ValueOf DefaultUni) -> PP.Doc () prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniInteger n)) = PP.pretty n prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniByteString b)) = PP.pretty $ encodeHex b -prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniString s)) = PP.pretty s +prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniString s)) = + -- Have to `show` first to get a quoted string. + PP.pretty $ show s prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniUnit _)) = "()" prettyConstant (PLC.Some (PLC.ValueOf PLC.DefaultUniBool b)) = PP.pretty b prettyConstant (PLC.Some (PLC.ValueOf (PLC.DefaultUniList a) l)) = From b12ede0fec7a1bcbd3b96a6f7f82b3544b2f85af Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sun, 10 Jul 2022 19:23:05 +0530 Subject: [PATCH 555/584] Add example --- Plutarch/Pretty.hs | 79 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 74 insertions(+), 5 deletions(-) diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index 9f56da607..19b0261d5 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -57,6 +57,75 @@ prettyScript = prettyUPLC . _progTerm . unScript {- | Prettify a Plutarch term. +This will call 'error' if there's a compilation failure. Use 'prettyTerm'' for a non-partial version. + +== Example == + +@ +import Plutarch.Prelude +import Plutarch.Api.V1 +import Plutarch.Extra.TermCont + +checkSignatory :: Term s (PPubKeyHash :--> PScriptContext :--> PUnit) +checkSignatory = plam $ \ph ctx' -> unTermCont $ do + ctx <- pletFieldsC @["txInfo", "purpose"] ctx' + purph <- pmatchC ctx.purpose + pure $ case purph of + PSpending _ -> + let signatories = pfield @"signatories" # ctx.txInfo + in pif + (pelem # pdata ph # pfromData signatories) + -- Success! + (pconstant ()) + -- Signature not present. + perror + _ -> ptraceError "checkSignatoryCont: not a spending tx" +@ + +Prettification result: + +@ +let frSndPair = !!sndPair + unDataSum = (\xF -> frSndPair (unConstrData xF)) + frTailList = !tailList + frHeadList = !headList + frIfThenElse = !ifThenElse +in (\oP4ECBT qsrxlF0Y7 -> + let cjlB6yrGk = unDataSum qsrxlF0Y7 + cRFO = unConstrData (frHeadList (frTailList cjlB6yrGk)) + cs9iR = !!fstPair cRFO + w4 = frSndPair cRFO + in if equalsInteger 1 cs9iR + then if (\vModHwqYB -> + let blM6d67 = + (\x5sad ePDSInSEC -> + !(!!chooseList + ePDSInSEC + ~False + ~(if equalsData + (frHeadList ePDSInSEC) + vModHwqYB + then True + else x5sad (frTailList ePDSInSEC)))) + mC = (\jfZs -> blM6d67 (\itzT -> jfZs jfZs itzT)) + in blM6d67 (\ispwp_oeT -> mC mC ispwp_oeT)) + (bData oP4ECBT) + (unListData + let q6X3 = frHeadList cjlB6yrGk + in frHeadList + let olbZ = unDataSum q6X3 + in frTailList + (frTailList + (frTailList + (frTailList + (frTailList + (frTailList + (frTailList olbZ))))))) + then () + else ERROR + else !(!trace "checkSignatoryCont: not a spending tx" ~ERROR)) +@ + == Semantics == === Constants === @@ -146,12 +215,12 @@ To achieve better prettification, certain AST structures are given special handl Bindings to forced builtin functions inherit the builtin function name, prefixed with a `fr`. -} -prettyTerm :: Config -> ClosedTerm a -> Either Text (PP.Doc ()) -prettyTerm conf x = prettyScript <$> compile conf x +prettyTerm :: Config -> ClosedTerm a -> PP.Doc () +prettyTerm conf x = either (error . Txt.unpack) id $ prettyTerm' conf x --- | Partial version of 'prettyTerm'. Calls 'error' upon compilation failure. -prettyTerm' :: Config -> ClosedTerm a -> PP.Doc () -prettyTerm' conf x = either (error . Txt.unpack) prettyScript $ compile conf x +-- | Non-partial 'prettyTerm'. +prettyTerm' :: Config -> ClosedTerm p -> Either Text (PP.Doc ()) +prettyTerm' conf x = prettyScript <$> compile conf x {- This isn't suitable for pretty printing UPLC from any source. It's primarily suited for Plutarch output. Practically speaking though, it should work with any _idiomatic_ UPLC. From 0729fedec7cfb9ac3a194caf6bc2c80882d6a1bd Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:27:15 +0530 Subject: [PATCH 556/584] Actually export `pthrow` --- Plutarch.hs | 1 + Plutarch/Prelude.hs | 1 + 2 files changed, 2 insertions(+) diff --git a/Plutarch.hs b/Plutarch.hs index bf3f6b9c0..72aa46cae 100644 --- a/Plutarch.hs +++ b/Plutarch.hs @@ -11,6 +11,7 @@ module Plutarch ( PI.pforce, PI.phoistAcyclic, PI.plet, + PI.pthrow, PI.Term, PI.S, PI.PType, diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index 1e454511b..eb88d4c89 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -16,6 +16,7 @@ module Plutarch.Prelude ( pinl, pto, pfix, + pthrow, Type, S, PType, From cb73a12ddf756a761c48123e7bbeda9ec22a2c8b Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:27:18 +0530 Subject: [PATCH 557/584] Use `pthrow` for compilation error --- Plutarch/NonZero.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Plutarch/NonZero.hs b/Plutarch/NonZero.hs index b2c0fc14c..304bc12dd 100644 --- a/Plutarch/NonZero.hs +++ b/Plutarch/NonZero.hs @@ -23,6 +23,7 @@ import Plutarch ( plam, plet, pto, + pthrow, (#), (#$), type (:-->), @@ -41,7 +42,7 @@ instance DerivePlutusType PNonZero where type DPTStrat _ = PlutusTypeNewtype instance PNum PNonZero where x #- y = ptryNonZero #$ pto x #- pto y - pfromInteger 0 = error "pnonZero.pfromInteger: encountered 0" + pfromInteger 0 = pthrow "pnonZero.pfromInteger: encountered 0" pfromInteger x = pcon $ PNonZero $ pfromInteger x instance PTryFrom PInteger PNonZero where From 03fe4ecfa73d46c1da25b0bd317a0b575ed090e4 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:29:18 +0530 Subject: [PATCH 558/584] Don't use `punsafeCoerce` unless necessary --- Plutarch/Rational.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 6013a5717..21d16594d 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -103,7 +103,7 @@ instance PIsData PRational where PRational a b <- tcont $ pmatch x let res :: Term _ (PBuiltinList (PAsData PInteger)) res = pcons # pdata a #$ pcons # pdata (pto b) #$ pnil - pure $ punsafeCoerce $ pdata res + pure $ pdataImpl res ) # x' From 74b01ac43e5d754160be0c7420992cb6ef6a25ef Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:29:43 +0530 Subject: [PATCH 559/584] Fix formatting --- Plutarch/NonZero.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plutarch/NonZero.hs b/Plutarch/NonZero.hs index 304bc12dd..c0d8944f2 100644 --- a/Plutarch/NonZero.hs +++ b/Plutarch/NonZero.hs @@ -22,8 +22,8 @@ import Plutarch ( phoistAcyclic, plam, plet, - pto, pthrow, + pto, (#), (#$), type (:-->), From 92e3d6d946f2f8e7051187231df82bcfaef370df Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 12 Jul 2022 11:56:42 +0000 Subject: [PATCH 560/584] Add link to Discord Replaces #488 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 2094bc783..a7c7a3c02 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ Read the [Plutarch guide](./docs/README.md) to get started! # Contributing Contributions are more than welcome! Alongside the [User guide](#usage) above, you may also find the [Developers' guide](./docs/DEVGUIDE.md) useful for understanding the codebase. +## Developer communication channels + +We're in the Plutonomicon Discord: https://discord.gg/722KnTC8jF + # License ``` From 9f437c195e9e34cbd15ff5769bf3392cb3e9c65c Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 12 Jul 2022 13:54:38 +0000 Subject: [PATCH 561/584] Remove `PBuiltinMap` This type alias was confusing to users, since it was not clear what the difference between this and `PMap` was. `PMap` was a newtype of `PBuiltinMap`, but almost in any case where you have `PBuiltinMap`, you really want the newtype `PBuiltinMap`. The issue is that there are instances on `PBuiltinMap` that work very differently from the ones on `PBuiltinList`, even though it's just a type alias! When these instances are instead made to be instances on the newtype, then there's not much point in keeping `PBuiltinMap` around, especially when it only serves to increase confusion. Closes #513 --- Plutarch/Api/V1/AssocMap.hs | 20 ++++++++---- Plutarch/Builtin.hs | 32 ------------------- .../conditional/Plutarch/TryFromSpec.hs | 25 --------------- 3 files changed, 14 insertions(+), 63 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index c4917a086..52f758101 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -46,7 +46,8 @@ import qualified PlutusTx.AssocMap as PlutusMap import qualified PlutusTx.Monoid as PlutusTx import qualified PlutusTx.Semigroup as PlutusTx -import Plutarch.Builtin (PBuiltinMap, ppairDataBuiltin) +import Plutarch.Builtin (pasMap, pdataImpl, pforgetData, pfromDataImpl, ppairDataBuiltin) +import Plutarch.Internal (punsafeBuiltin) import Plutarch.Internal.Witness (witness) import Plutarch.Lift ( PConstantDecl, @@ -61,6 +62,7 @@ import qualified Plutarch.List as List import Plutarch.Prelude hiding (pall, pany, pfilter, pmap, pnull, psingleton) import Plutarch.Show (PShow) import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) +import qualified PlutusCore as PLC import Prelude hiding (all, any, filter, lookup, null) @@ -68,12 +70,18 @@ import Data.Proxy (Proxy (Proxy)) data KeyGuarantees = Sorted | Unsorted +type PBuiltinListOfPairs k v = PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)) + type role PMap nominal nominal nominal nominal -newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinMap k v)) +newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)))) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PShow) + deriving anyclass (PlutusType, PShow) instance DerivePlutusType (PMap keysort k v) where type DPTStrat _ = PlutusTypeNewtype +instance PIsData (PMap keysort k v) where + pfromDataImpl x = punsafeCoerce $ pasMap # pforgetData x + pdataImpl x = punsafeBuiltin PLC.MapData # x + instance PEq (PMap 'Sorted k v) where x #== y = peqViaData # x # y where @@ -236,7 +244,7 @@ psingletonData = phoistAcyclic $ plam $ \key value -> punsafeDowncast (pcons # (ppairDataBuiltin # key # value) # pnil) -- | Construct a 'PMap' from a list of key-value pairs, sorted by ascending key data. -pfromAscList :: (POrd k, PIsData k, PIsData v) => Term s (PBuiltinMap k v :--> PMap 'Sorted k v) +pfromAscList :: (POrd k, PIsData k, PIsData v) => Term s (PBuiltinListOfPairs k v :--> PMap 'Sorted k v) pfromAscList = plam $ (passertSorted #) . pcon . PMap -- | Assert the map is properly sorted. @@ -306,8 +314,8 @@ punionWith = phoistAcyclic $ \x y -> pdata (combine # pfromData x # pfromData y) data MapUnionCarrier k v s = MapUnionCarrier - { merge :: Term s (PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) - , mergeInsert :: Term s (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinMap k v :--> PBuiltinMap k v :--> PBuiltinMap k v) + { merge :: Term s (PBuiltinListOfPairs k v :--> PBuiltinListOfPairs k v :--> PBuiltinListOfPairs k v) + , mergeInsert :: Term s (PBuiltinPair (PAsData k) (PAsData v) :--> PBuiltinListOfPairs k v :--> PBuiltinListOfPairs k v :--> PBuiltinListOfPairs k v) } deriving stock (Generic) deriving anyclass (PlutusType) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 0da93f541..c8e6a37a5 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -26,7 +26,6 @@ module Plutarch.Builtin ( pserialiseData, ppairDataBuiltin, pchooseListBuiltin, - type PBuiltinMap, ) where import Data.Proxy (Proxy (Proxy)) @@ -239,16 +238,6 @@ deriving via (DerivePConstantDirect Data PData) instance PConstantDecl Data instance PEq PData where x #== y = punsafeBuiltin PLC.EqualsData # x # y -{- | - Map type used for Plutus `Data`'s Map constructor. - - Note that the Plutus API doesn't use this most of the time, - instead encoding as a List of Tuple constructors. - - Not to be confused with `PlutusTx.AssocMap.Map` / `PMap` --} -type PBuiltinMap a b = (PBuiltinList (PBuiltinPair (PAsData a) (PAsData b))) - pasConstr :: Term s (PData :--> PBuiltinPair PInteger (PBuiltinList PData)) pasConstr = punsafeBuiltin PLC.UnConstrData @@ -354,10 +343,6 @@ instance PIsData (PBuiltinList PData) where -- pdataImpl = coerce (pforgetData' @PData (Proxy @(Helper2 PBuiltinList))) . pdata . (prememberData (Proxy @PBuiltinList)) pdataImpl = punsafeCoerce . pdata . prememberData (Proxy @PBuiltinList) -- FIXME -instance PIsData (PBuiltinMap k v) where - pfromDataImpl x = punsafeCoerce $ pasMap # pforgetData x - pdataImpl x = punsafeBuiltin PLC.MapData # x - instance PIsData PInteger where pfromDataImpl x = pasInt # pforgetData x pdataImpl x = punsafeBuiltin PLC.IData # x @@ -475,23 +460,6 @@ instance PTryFrom PData (PAsData PByteString) where ver <- tcont $ plet (pasByteStr # opq) pure (punsafeCoerce opq, ver) -instance - ( PTryFrom PData (PAsData a) - , PTryFrom PData (PAsData b) - ) => - PTryFrom PData (PAsData (PBuiltinMap a b)) - where - type PTryFromExcess PData (PAsData (PBuiltinMap a b)) = Flip Term (PBuiltinMap a b) - ptryFrom' opq = runTermCont $ do - verMap <- tcont $ plet (pasMap # opq) - let verifyPair :: Term _ (PBuiltinPair PData PData :--> PBuiltinPair (PAsData a) (PAsData b)) - verifyPair = plam $ \tup -> unTermCont $ do - (verfst, _) <- tcont $ ptryFrom @(PAsData a) $ pfstBuiltin # tup - (versnd, _) <- tcont $ ptryFrom @(PAsData b) $ psndBuiltin # tup - pure $ ppairDataBuiltin # verfst # versnd - ver <- tcont $ plet $ pmap # verifyPair # verMap - pure (punsafeCoerce opq, ver) - {- | This verifies a list to be indeed a list but doesn't recover the inner data use this instance instead of the one for `PData (PAsData (PBuiltinList (PAsData a)))` diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index eda4a13b6..fbfd32bd8 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -35,7 +35,6 @@ import Plutarch.Api.V1 ( ) import Plutarch.Builtin ( - PBuiltinMap, pforgetData, ppairDataBuiltin, ) @@ -71,8 +70,6 @@ spec = do @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) @-> pfails - "Map Int String /= Map Int Int" - @| mapTestFails @-> pfails "PDataSum constr 2" @| checkDeep @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString]]) @@ -116,8 +113,6 @@ spec = do @(PDataRecord (("foo" ':= PByteString) ': ("bar" ':= PInteger) ': '[])) (pdata (pdcons @"foo" # (pdata $ pconstant "baz") #$ pdcons @"bar" # (pdata $ pconstant 42) # pdnil)) @-> psucceeds - "Map Int String == Map Int String" - @| mapTestSucceeds @-> psucceeds "PDataSum constr 0" @| checkDeep @(PDataSum '[ '["i1" ':= PInteger, "b2" ':= PByteString], '["i3" ':= PInteger, "b4" ':= PByteString]]) @@ -361,26 +356,6 @@ toDatadList = pdata . (foldr go pnil) go :: Integer -> Term _ (PBuiltinList (PAsData PInteger)) -> Term _ (PBuiltinList (PAsData PInteger)) go i acc = pcons # (pdata $ pconstant i) # acc -------------------- Special cases for maps ----------------------------------------- - -mapTestSucceeds :: ClosedTerm (PAsData (PBuiltinMap PByteString PInteger)) -mapTestSucceeds = unTermCont $ do - (val, _) <- TermCont $ ptryFrom $ pforgetData sampleMap - pure val - -mapTestFails :: ClosedTerm (PAsData (PBuiltinMap PInteger PInteger)) -mapTestFails = unTermCont $ do - (val, _) <- TermCont $ ptryFrom $ pforgetData sampleMap - pure val - -sampleMap :: Term _ (PAsData (PBuiltinMap PByteString PInteger)) -sampleMap = - pdata $ - pcons - # (ppairDataBuiltin # (pdata $ pconstant "foo") # (pdata $ pconstant 42)) #$ pcons - # (ppairDataBuiltin # (pdata $ pconstant "bar") # (pdata $ pconstant 41)) - # pnil - ------------------- Sample type with PIsDataRepr ----------------------------------- sampleAB :: Term s (PAsData PAB) From 585fe59cff5e74507b0d58c0e87f3266db852012 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 12 Jul 2022 14:06:32 +0000 Subject: [PATCH 562/584] Put some tests inside `contains` test group Thanks Chase --- plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs index b8dac8ba0..97709dcb1 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/IntervalSpec.hs @@ -43,11 +43,11 @@ spec = do "constants" @\ do "always" @| palways @PInteger @-> psucceeds "never" @| pnever @PInteger @-> psucceeds - "always" @| pcontains # palways @PInteger # i1 @-> passert - "never" @| pcontains # pnever @PInteger # i1 @-> passertNot "contains" @\ do "in interval" @| pcontains # i2 # i4 @-> passert "out interval" @| pcontains # i4 # i2 @-> passertNot + "always" @| pcontains # palways @PInteger # i1 @-> passert + "never" @| pcontains # pnever @PInteger # i1 @-> passertNot "member" @\ do "[b,c], a < b" @| pmember # pconstantData 1 # i3 @-> passertNot "[b,c], a = b" @| pmember # pconstantData 2 # i3 @-> passert From e1f1936175fef5ed44dfaff0107bb3ad2899e729 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Tue, 12 Jul 2022 14:12:28 +0000 Subject: [PATCH 563/584] Fix goldens Entirely my fault --- plutarch-test/goldens/data-verif.bench.golden | 2 -- plutarch-test/goldens/data-verif.uplc.eval.golden | 2 -- plutarch-test/goldens/data-verif.uplc.golden | 2 -- .../goldens/extra.intervalutils.fixtures.bench.golden | 4 ++-- .../goldens/extra.intervalutils.fixtures.uplc.eval.golden | 4 ++-- .../goldens/extra.intervalutils.fixtures.uplc.golden | 4 ++-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/plutarch-test/goldens/data-verif.bench.golden b/plutarch-test/goldens/data-verif.bench.golden index 6c157b645..19aa9d003 100644 --- a/plutarch-test/goldens/data-verif.bench.golden +++ b/plutarch-test/goldens/data-verif.bench.golden @@ -1,7 +1,6 @@ erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":911716,"exBudgetMemory":612,"scriptSizeBytes":123} erroneous.[String] /= [Integer] {"exBudgetCPU":467623,"exBudgetMemory":388,"scriptSizeBytes":101} erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":304406,"exBudgetMemory":356,"scriptSizeBytes":128} -erroneous.Map Int String /= Map Int Int {"exBudgetCPU":733650,"exBudgetMemory":548,"scriptSizeBytes":165} erroneous.PDataSum constr 2 {"exBudgetCPU":700994,"exBudgetMemory":230,"scriptSizeBytes":197} erroneous.PDataSum wrong record type {"exBudgetCPU":990483,"exBudgetMemory":232,"scriptSizeBytes":256} working.(String, String) == (String, String) {"exBudgetCPU":4806613,"exBudgetMemory":14428,"scriptSizeBytes":123} @@ -9,7 +8,6 @@ working.[String] == [String] {"exBudgetCPU":4994603,"exBudgetMemory":16904,"scri working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":128} -working.Map Int String == Map Int String {"exBudgetCPU":7666648,"exBudgetMemory":23744,"scriptSizeBytes":165} working.PDataSum constr 0 {"exBudgetCPU":3276445,"exBudgetMemory":10722,"scriptSizeBytes":256} working.PDataSum constr 1 {"exBudgetCPU":3841934,"exBudgetMemory":11924,"scriptSizeBytes":256} working.recover PWrapInt {"exBudgetCPU":460390,"exBudgetMemory":1065,"scriptSizeBytes":15} diff --git a/plutarch-test/goldens/data-verif.uplc.eval.golden b/plutarch-test/goldens/data-verif.uplc.eval.golden index 7a6315f76..007b57c6d 100644 --- a/plutarch-test/goldens/data-verif.uplc.eval.golden +++ b/plutarch-test/goldens/data-verif.uplc.eval.golden @@ -1,7 +1,6 @@ erroneous.(String, Integer) /= (String, String) (program 1.0.0 error) erroneous.[String] /= [Integer] (program 1.0.0 error) erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 error) -erroneous.Map Int String /= Map Int Int (program 1.0.0 error) erroneous.PDataSum constr 2 (program 1.0.0 error) erroneous.PDataSum wrong record type (program 1.0.0 error) working.(String, String) == (String, String) (program 1.0.0 #d8799f43666f6f43626172ff) @@ -9,7 +8,6 @@ working.[String] == [String] (program 1.0.0 #9f43666f6f43626172ff) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 #9f07182aff) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 #9f07182aff) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 #9f4362617a182aff) -working.Map Int String == Map Int String (program 1.0.0 #a243666f6f182a436261721829) working.PDataSum constr 0 (program 1.0.0 #d8799f0543666f6fff) working.PDataSum constr 1 (program 1.0.0 #d87a9f0543666f6fff) working.recover PWrapInt (program 1.0.0 True) diff --git a/plutarch-test/goldens/data-verif.uplc.golden b/plutarch-test/goldens/data-verif.uplc.golden index 3219beff8..07fd431c3 100644 --- a/plutarch-test/goldens/data-verif.uplc.golden +++ b/plutarch-test/goldens/data-verif.uplc.golden @@ -1,7 +1,6 @@ erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i8) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay (force (i12 "list is longer than zero" (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i4)) (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unBData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87b9f0543666f6fff)) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) @@ -9,7 +8,6 @@ working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -working.Map Int String == Map Int String (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unBData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d8799f0543666f6fff)) working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) working.recover PWrapInt (program 1.0.0 (equalsInteger 42 (unIData (iData 42)))) diff --git a/plutarch-test/goldens/extra.intervalutils.fixtures.bench.golden b/plutarch-test/goldens/extra.intervalutils.fixtures.bench.golden index 1cb99a739..3eb6b59a3 100644 --- a/plutarch-test/goldens/extra.intervalutils.fixtures.bench.golden +++ b/plutarch-test/goldens/extra.intervalutils.fixtures.bench.golden @@ -1,9 +1,9 @@ constants.always {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":34} constants.never {"exBudgetCPU":23100,"exBudgetMemory":200,"scriptSizeBytes":34} -constants.always {"exBudgetCPU":18925489,"exBudgetMemory":56043,"scriptSizeBytes":566} -constants.never {"exBudgetCPU":15555211,"exBudgetMemory":45859,"scriptSizeBytes":566} contains.in interval {"exBudgetCPU":25338906,"exBudgetMemory":72519,"scriptSizeBytes":558} contains.out interval {"exBudgetCPU":20362113,"exBudgetMemory":58635,"scriptSizeBytes":557} +contains.always {"exBudgetCPU":18925489,"exBudgetMemory":56043,"scriptSizeBytes":566} +contains.never {"exBudgetCPU":15555211,"exBudgetMemory":45859,"scriptSizeBytes":566} member.[b,c], a < b {"exBudgetCPU":19885479,"exBudgetMemory":57171,"scriptSizeBytes":567} member.[b,c], a = b {"exBudgetCPU":28443010,"exBudgetMemory":79782,"scriptSizeBytes":561} member.[b,c], a > b, a < c {"exBudgetCPU":24862272,"exBudgetMemory":71055,"scriptSizeBytes":567} diff --git a/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.eval.golden b/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.eval.golden index 56e53089a..ff1e4456c 100644 --- a/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.eval.golden +++ b/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.eval.golden @@ -1,9 +1,9 @@ constants.always (program 1.0.0 #d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff) constants.never (program 1.0.0 #d8799fd8799fd87b80d87a80ffd8799fd87980d87a80ffff) -constants.always (program 1.0.0 True) -constants.never (program 1.0.0 False) contains.in interval (program 1.0.0 True) contains.out interval (program 1.0.0 False) +contains.always (program 1.0.0 True) +contains.never (program 1.0.0 False) member.[b,c], a < b (program 1.0.0 False) member.[b,c], a = b (program 1.0.0 True) member.[b,c], a > b, a < c (program 1.0.0 True) diff --git a/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.golden b/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.golden index bcdf2b1da..ba22911b5 100644 --- a/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.golden +++ b/plutarch-test/goldens/extra.intervalutils.fixtures.uplc.golden @@ -1,9 +1,9 @@ constants.always (program 1.0.0 #d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff) constants.never (program 1.0.0 #d8799fd8799fd87b80d87a80ffd8799fd87980d87a80ffff) -constants.always (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) #d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff ((\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> constrData 0 (i25 i2 (i25 i1 i26))) (constrData 0 (i23 i2 (i23 i22 i24))) (constrData 0 (i23 i1 (i23 i22 i24)))) (constrData 1 (i21 i2 i22)) (constrData 1 (i21 i1 i22))) #01 #02)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d87a80) (force mkCons)) [ ])) -constants.never (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) #d8799fd8799fd87b80d87a80ffd8799fd87980d87a80ffff ((\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> constrData 0 (i25 i2 (i25 i1 i26))) (constrData 0 (i23 i2 (i23 i22 i24))) (constrData 0 (i23 i1 (i23 i22 i24)))) (constrData 1 (i21 i2 i22)) (constrData 1 (i21 i1 i22))) #01 #02)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d87a80) (force mkCons)) [ ])) contains.in interval (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) (i18 #03 #05) (i18 i24 i24)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 1 (i6 i2 i7)) (constrData 1 (i6 i1 i7)))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ]) #04)) contains.out interval (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) (i19 i18 i18) (i19 #03 #05)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #04) (\i0 -> \i0 -> i3 (constrData 1 (i6 i2 i7)) (constrData 1 (i6 i1 i7)))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ])) +contains.always (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) #d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff ((\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> constrData 0 (i25 i2 (i25 i1 i26))) (constrData 0 (i23 i2 (i23 i22 i24))) (constrData 0 (i23 i1 (i23 i22 i24)))) (constrData 1 (i21 i2 i22)) (constrData 1 (i21 i1 i22))) #01 #02)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d87a80) (force mkCons)) [ ])) +contains.never (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) #d8799fd8799fd87b80d87a80ffd8799fd87980d87a80ffff ((\i0 -> \i0 -> (\i0 -> \i0 -> (\i0 -> \i0 -> constrData 0 (i25 i2 (i25 i1 i26))) (constrData 0 (i23 i2 (i23 i22 i24))) (constrData 0 (i23 i1 (i23 i22 i24)))) (constrData 1 (i21 i2 i22)) (constrData 1 (i21 i1 i22))) #01 #02)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) #d87a80) (force mkCons)) [ ])) member.[b,c], a < b (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (i6 (i18 (i19 i2)) (i18 (i19 i1))) (delay (i6 (i18 (i19 (i20 i1))) (i18 (i19 (i20 i2))))))) (i20 i2)) (i19 i2)) ((\i0 -> i21 i1 i1) (constrData 1 (i23 i2 i24)))) #01 ((\i0 -> \i0 -> i20 (constrData 1 (i23 i2 i24)) (constrData 1 (i23 i1 i24))) #02 #04)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ])) member.[b,c], a = b (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (i5 (i17 (i18 i2)) (i17 (i18 i1))) (delay (i5 (i17 (i18 (i19 i1))) (i17 (i18 (i19 i2))))))) (i19 i2)) (i18 i2)) ((\i0 -> i20 i1 i1) (constrData 1 (i22 i24 i23)))) ((\i0 -> i19 (constrData 1 (i22 i24 i23)) (constrData 1 (i22 i1 i23))) #04)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ]) #02)) member.[b,c], a > b, a < c (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (i6 (i18 (i19 i2)) (i18 (i19 i1))) (delay (i6 (i18 (i19 (i20 i1))) (i18 (i19 (i20 i2))))))) (i20 i2)) (i19 i2)) ((\i0 -> i21 i1 i1) (constrData 1 (i23 i2 i24)))) #03 ((\i0 -> \i0 -> i20 (constrData 1 (i23 i2 i24)) (constrData 1 (i23 i1 i24))) #02 #04)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i15 (force (i11 (force (i7 i2 (delay i1))) (delay (force (i7 (i9 i2) (delay (i9 i1))))))) (delay (i10 i4 i3)) (delay (i14 i4 i3)))) (i15 (i18 (i19 i4)))) (i14 (i17 (i18 i4)))) (i16 i2)) (i15 i2))) (\i0 -> \i0 -> i10 i2 i1 i3)) (delay False)) (\i0 -> i7 i1 False True)) (\i0 -> \i0 -> force (i3 (i6 i2 i1) (delay (i5 i2 i1))))) (\i0 -> i5 i1 i2)) (delay True)) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i7 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 0 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay (force (i7 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 1 i2) (delay ((\i0 -> equalsInteger (unIData (i15 i5)) i1) (unIData (i14 i1)))) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i10 (equalsInteger 2 i2) (delay True) (delay False))) (i16 i2)) (i10 i1)) (unConstrData i4)))))))) (i13 i2)) (i7 i1)) (unConstrData i2))) (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> force (i6 (equalsInteger 0 i2) (delay True) (delay (force (i6 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 0 i2) (delay False) (delay (force (i9 (equalsInteger 2 i2) (delay True) (delay (lessThanInteger (unIData (i13 i4)) (unIData (i13 i1))))))))) (i15 i2)) (i9 i1)) (unConstrData i4))) (delay ((\i0 -> (\i0 -> (\i0 -> force (i9 (equalsInteger 2 i2) (delay True) (delay False))) (i15 i2)) (i9 i1)) (unConstrData i4)))))))) (i12 i2)) (i6 i1)) (unConstrData i2))) (force ifThenElse)) (\i0 -> equalsInteger (i2 (unConstrData i1)) 1)) (force (force fstPair))) i3) (force headList)) (force tailList)) (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> \i0 -> i3 (constrData 0 (i5 i2 (i5 i4 i6))) (constrData 0 (i5 i1 (i5 i4 i6))))) (\i0 -> \i0 -> constrData 0 (i4 i2 (i4 i1 i5)))) #d87a80) (force mkCons)) [ ])) From 8a5973ef3ce32d2e72037ce5db037513954e3782 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 12 Jul 2022 21:15:06 +0530 Subject: [PATCH 564/584] Use `PPositive` rather than `PNonZero` for `PRational` --- Plutarch/NonZero.hs | 78 ------------------ Plutarch/Positive.hs | 79 +++++++++++++++++++ Plutarch/Rational.hs | 16 ++-- plutarch-test/goldens/data-verif.bench.golden | 10 +-- plutarch-test/goldens/data-verif.uplc.golden | 10 +-- plutarch-test/goldens/rational.bench.golden | 42 +++++----- plutarch-test/goldens/rational.uplc.golden | 42 +++++----- plutarch-test/goldens/show.bench.golden | 2 +- plutarch-test/goldens/show.uplc.golden | 2 +- plutarch.cabal | 2 +- 10 files changed, 142 insertions(+), 141 deletions(-) delete mode 100644 Plutarch/NonZero.hs create mode 100644 Plutarch/Positive.hs diff --git a/Plutarch/NonZero.hs b/Plutarch/NonZero.hs deleted file mode 100644 index c0d8944f2..000000000 --- a/Plutarch/NonZero.hs +++ /dev/null @@ -1,78 +0,0 @@ -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE UndecidableInstances #-} - -module Plutarch.NonZero (PNonZero, pnonZero, ptryNonZero) where - -import Data.Functor.Const (Const) -import GHC.Generics (Generic) - -import Plutarch.Bool (PEq, POrd, pif, (#==)) -import Plutarch.Builtin (PAsData, PData, PIsData, pdata) -import Plutarch.Integer (PInteger, PIntegral) - -import Plutarch.Maybe (PMaybe (PJust, PNothing)) - -import Plutarch ( - DerivePlutusType (DPTStrat), - PlutusType, - PlutusTypeNewtype, - Term, - TermCont (runTermCont), - pcon, - phoistAcyclic, - plam, - plet, - pthrow, - pto, - (#), - (#$), - type (:-->), - ) -import Plutarch.Num (PNum (pfromInteger, (#-))) -import Plutarch.Show (PShow) -import Plutarch.TermCont (tcont) -import Plutarch.Trace (ptraceError) -import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom'), ptryFrom) - -newtype PNonZero s = PNonZero (Term s PInteger) - deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd, PIntegral, PShow) -instance DerivePlutusType PNonZero where type DPTStrat _ = PlutusTypeNewtype - -instance PNum PNonZero where - x #- y = ptryNonZero #$ pto x #- pto y - - pfromInteger 0 = pthrow "pnonZero.pfromInteger: encountered 0" - pfromInteger x = pcon $ PNonZero $ pfromInteger x - -instance PTryFrom PInteger PNonZero where - type PTryFromExcess PInteger PNonZero = Const () - ptryFrom' opq = runTermCont $ pure (ptryNonZero # opq, ()) - -newtype Flip f a b = Flip (f b a) deriving stock (Generic) - -instance PTryFrom PData (PAsData PNonZero) where - type PTryFromExcess PData (PAsData PNonZero) = Flip Term PNonZero - ptryFrom' opq = runTermCont $ do - (_, i) <- tcont $ ptryFrom @(PAsData PInteger) opq - res <- tcont . plet $ ptryNonZero # i - resData <- tcont . plet $ pdata res - pure (resData, res) - --- | Build a 'PNonZero' from a 'PInteger'. Yields 'PNothing' if argument is zero. -pnonZero :: Term s (PInteger :--> PMaybe PNonZero) -pnonZero = phoistAcyclic $ - plam $ \i -> - pif - (i #== 0) - (pcon PNothing) - $ pcon . PJust . pcon $ PNonZero i - --- | Partial version of 'pnonZero'. Errors if argument is zero. -ptryNonZero :: Term s (PInteger :--> PNonZero) -ptryNonZero = phoistAcyclic $ - plam $ \i -> - pif - (i #== 0) - (ptraceError "pnonZero: building with 0") - $ pcon $ PNonZero i diff --git a/Plutarch/Positive.hs b/Plutarch/Positive.hs new file mode 100644 index 000000000..ceb587c92 --- /dev/null +++ b/Plutarch/Positive.hs @@ -0,0 +1,79 @@ +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE UndecidableInstances #-} + +module Plutarch.Positive (PPositive, ppositive, ptryPositive) where + +import Data.Functor.Const (Const) +import GHC.Generics (Generic) + +import Plutarch.Bool (PEq, POrd, pif, (#<=)) +import Plutarch.Builtin (PAsData, PData, PIsData, pdata) +import Plutarch.Integer (PInteger, PIntegral) + +import Plutarch.Maybe (PMaybe (PJust, PNothing)) + +import Plutarch ( + DerivePlutusType (DPTStrat), + PlutusType, + PlutusTypeNewtype, + Term, + TermCont (runTermCont), + pcon, + phoistAcyclic, + plam, + plet, + pthrow, + pto, + (#), + (#$), + type (:-->), + ) +import Plutarch.Num (PNum (pfromInteger, (#-))) +import Plutarch.Show (PShow) +import Plutarch.TermCont (tcont) +import Plutarch.Trace (ptraceError) +import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom'), ptryFrom) + +newtype PPositive s = PPositive (Term s PInteger) + deriving stock (Generic) + deriving anyclass (PlutusType, PIsData, PEq, POrd, PIntegral, PShow) +instance DerivePlutusType PPositive where type DPTStrat _ = PlutusTypeNewtype + +instance PNum PPositive where + x #- y = ptryPositive #$ pto x #- pto y + + pfromInteger x + | x <= 0 = pthrow "PPositive.pfromInteger: encountered non positive" + | otherwise = pcon $ PPositive $ pfromInteger x + +instance PTryFrom PInteger PPositive where + type PTryFromExcess PInteger PPositive = Const () + ptryFrom' opq = runTermCont $ pure (ptryPositive # opq, ()) + +newtype Flip f a b = Flip (f b a) deriving stock (Generic) + +instance PTryFrom PData (PAsData PPositive) where + type PTryFromExcess PData (PAsData PPositive) = Flip Term PPositive + ptryFrom' opq = runTermCont $ do + (_, i) <- tcont $ ptryFrom @(PAsData PInteger) opq + res <- tcont . plet $ ptryPositive # i + resData <- tcont . plet $ pdata res + pure (resData, res) + +-- | Build a 'PPositive' from a 'PInteger'. Yields 'PNothing' if argument is zero. +ppositive :: Term s (PInteger :--> PMaybe PPositive) +ppositive = phoistAcyclic $ + plam $ \i -> + pif + (i #<= 0) + (pcon PNothing) + $ pcon . PJust . pcon $ PPositive i + +-- | Partial version of 'PPositive'. Errors if argument is zero. +ptryPositive :: Term s (PInteger :--> PPositive) +ptryPositive = phoistAcyclic $ + plam $ \i -> + pif + (i #<= 0) + (ptraceError "ptryPositive: building with non positive") + $ pcon $ PPositive i diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 21d16594d..c977a5e86 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -50,9 +50,9 @@ import Plutarch.Builtin ( import Plutarch.Integer (PInteger, pdiv, pmod) import Plutarch.Lift (pconstant) import Plutarch.List (pcons, phead, plength, pnil, ptail) -import Plutarch.NonZero (PNonZero, ptryNonZero) import Plutarch.Num (PNum, pabs, pfromInteger, pnegate, psignum, (#*), (#+), (#-)) import Plutarch.Pair (PPair (PPair)) +import Plutarch.Positive (PPositive, ptryPositive) import Plutarch.Show (PShow, pshow, pshow') import Plutarch.TermCont (tcont, unTermCont) import Plutarch.Trace (ptraceError) @@ -65,7 +65,7 @@ class PFractional (a :: PType) where pfromRational :: Term s (PRational :--> a) data PRational s - = PRational (Term s PInteger) (Term s PNonZero) + = PRational (Term s PInteger) (Term s PPositive) deriving stock (Generic) deriving anyclass (PlutusType, PEq) @@ -109,14 +109,14 @@ instance PIsData PRational where newtype Flip f a b = Flip (f b a) deriving stock (Generic) --- | NOTE: This instance produces a verified 'PNonZero' as the excess output. +-- | NOTE: This instance produces a verified 'PPositive' as the excess output. instance PTryFrom PData (PAsData PRational) where - type PTryFromExcess PData (PAsData PRational) = Flip Term PNonZero + type PTryFromExcess PData (PAsData PRational) = Flip Term PPositive ptryFrom' opq = runTermCont $ do (_, ld) <- tcont $ ptryFrom @(PAsData (PBuiltinList PData)) opq tcont $ \f -> pif (plength # ld #== 2) (f ()) (ptraceError "ptryFrom(PRational): data list length should be 2") (_, denm) <- tcont $ ptryFrom @(PAsData PInteger) $ phead #$ ptail # ld - res <- tcont . plet $ ptryNonZero # denm + res <- tcont . plet $ ptryPositive # denm pure (punsafeCoerce opq, res) instance POrd PRational where @@ -217,14 +217,14 @@ instance PFractional PRational where phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational xn xd) -> - pcon $ PRational (pto xd) $ ptryNonZero # xn + pcon $ PRational (pto xd) $ ptryPositive # xn x' #/ y' = phoistAcyclic ( plam $ \x y -> unTermCont $ do PRational xn xd <- tcont $ pmatch x PRational yn yd <- tcont $ pmatch y - denm <- tcont . plet $ ptryNonZero #$ pto xd * yn + denm <- tcont . plet $ ptryPositive #$ pto xd * yn pure $ preduce #$ pcon $ PRational (xn * pto yd) denm ) # x' @@ -267,7 +267,7 @@ pmax = phoistAcyclic $ plam $ \a b -> pif (a #<= b) b a pnumerator :: Term s (PRational :--> PInteger) pnumerator = phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational n _) -> n -pdenominator :: Term s (PRational :--> PNonZero) +pdenominator :: Term s (PRational :--> PPositive) pdenominator = phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational _ d) -> d pfromInteger :: Term s (PInteger :--> PRational) diff --git a/plutarch-test/goldens/data-verif.bench.golden b/plutarch-test/goldens/data-verif.bench.golden index 11377ff09..2be87d191 100644 --- a/plutarch-test/goldens/data-verif.bench.golden +++ b/plutarch-test/goldens/data-verif.bench.golden @@ -4,13 +4,13 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int {"exBudgetCPU":733650,"exBudgetMemory":548,"scriptSizeBytes":165} erroneous.PDataSum constr 2 {"exBudgetCPU":700994,"exBudgetMemory":230,"scriptSizeBytes":197} erroneous.PDataSum wrong record type {"exBudgetCPU":990483,"exBudgetMemory":232,"scriptSizeBytes":256} -erroneous.[ByteString] (with length == 2) /= PRational {"exBudgetCPU":1656457,"exBudgetMemory":554,"scriptSizeBytes":231} -erroneous.[Integer] (with length == 0) /= PRational {"exBudgetCPU":761999,"exBudgetMemory":230,"scriptSizeBytes":193} -erroneous.[Integer] (with length == 3) /= PRational {"exBudgetCPU":2227517,"exBudgetMemory":524,"scriptSizeBytes":239} -erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational {"exBudgetCPU":2156288,"exBudgetMemory":524,"scriptSizeBytes":225} +erroneous.[ByteString] (with length == 2) /= PRational {"exBudgetCPU":1656457,"exBudgetMemory":554,"scriptSizeBytes":246} +erroneous.[Integer] (with length == 0) /= PRational {"exBudgetCPU":761999,"exBudgetMemory":230,"scriptSizeBytes":208} +erroneous.[Integer] (with length == 3) /= PRational {"exBudgetCPU":2227517,"exBudgetMemory":524,"scriptSizeBytes":254} +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational {"exBudgetCPU":2152752,"exBudgetMemory":524,"scriptSizeBytes":240} working.(String, String) == (String, String) {"exBudgetCPU":4806613,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":4994603,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.[Integer] (with length == 2) == PRational {"exBudgetCPU":9654221,"exBudgetMemory":28350,"scriptSizeBytes":385} +working.[Integer] (with length == 2) == PRational {"exBudgetCPU":9650685,"exBudgetMemory":28350,"scriptSizeBytes":400} working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":128} diff --git a/plutarch-test/goldens/data-verif.uplc.golden b/plutarch-test/goldens/data-verif.uplc.golden index 19d330b46..b4eef5ef1 100644 --- a/plutarch-test/goldens/data-verif.uplc.golden +++ b/plutarch-test/goldens/data-verif.uplc.golden @@ -4,13 +4,13 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i8) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay (force (i12 "list is longer than zero" (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i4)) (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unBData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87b9f0543666f6fff)) -erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (bData i9) i10))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 (bData i4) (i5 (bData i6) i7))))) (force ifThenElse)) (force tailList)) (force trace)) #41) (force mkCons)) #2b) [ ])) -erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData i7) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData i4))) (force ifThenElse)) (force tailList)) (force trace)) [ ])) -erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i9 i7 (i9 i8 (i9 i10 i11)))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i4 (i6 i5 (i6 i7 i8)))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) #07) (force mkCons)) #00) [ ])) -erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 i7 (i8 i9 i10))) (force (i3 (equalsInteger i1 0) (delay (force (i5 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 i4 (i5 i6 i7))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) (force mkCons)) #00) [ ])) +erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (bData i9) i10))) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 (bData i4) (i5 (bData i6) i7))))) (force ifThenElse)) (force tailList)) (force trace)) #41) (force mkCons)) #2b) [ ])) +erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData i7) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData i4))) (force ifThenElse)) (force tailList)) (force trace)) [ ])) +erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i9 i7 (i9 i8 (i9 i10 i11)))) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i4 (i6 i5 (i6 i7 i8)))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) #07) (force mkCons)) #00) [ ])) +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 i7 (i8 i9 i10))) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 i4 (i5 i6 i7))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) (force mkCons)) #00) [ ])) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.[Integer] (with length == 2) == PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i7 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> force (i4 (equalsInteger i1 (unIData i10)) (delay (force (i4 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (unIData (i8 (i9 i2)))) (unIData (i7 i1))) (unListData i1)) (listData (i9 i8 (i9 i10 i11)))) ((\i0 -> \i0 -> i1 i2 i3) (unIData i8))) (delay ()) (delay (force (i7 "drat should be as expected" (delay error))))))) (delay (force (i7 "non-zero should be as expected" (delay error)))))) (force (i3 (equalsInteger i1 0) (delay (force (i6 "pnonZero: building with 0" (delay error)))) (delay i1)))) (unIData (i3 (i4 i1))))) (delay (force (i5 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i5 (i6 i7 i8))))) (force ifThenElse)) (force headList)) (force tailList)) (force trace)) #182a) (force mkCons)) #181f) [ ])) +working.[Integer] (with length == 2) == PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i7 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> force (i4 (equalsInteger i1 (unIData i10)) (delay (force (i4 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (unIData (i8 (i9 i2)))) (unIData (i7 i1))) (unListData i1)) (listData (i9 i8 (i9 i10 i11)))) ((\i0 -> \i0 -> i1 i2 i3) (unIData i8))) (delay ()) (delay (force (i7 "drat should be as expected" (delay error))))))) (delay (force (i7 "non-zero should be as expected" (delay error)))))) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i6 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (i3 (i4 i1))))) (delay (force (i5 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i5 (i6 i7 i8))))) (force ifThenElse)) (force headList)) (force tailList)) (force trace)) #182a) (force mkCons)) #181f) [ ])) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/rational.bench.golden b/plutarch-test/goldens/rational.bench.golden index 57bcdf69e..6c944bf47 100644 --- a/plutarch-test/goldens/rational.bench.golden +++ b/plutarch-test/goldens/rational.bench.golden @@ -1,24 +1,24 @@ literal {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} -ops.+ {"exBudgetCPU":33573901,"exBudgetMemory":84401,"scriptSizeBytes":378} -ops.- {"exBudgetCPU":33573901,"exBudgetMemory":84401,"scriptSizeBytes":378} -ops.* {"exBudgetCPU":58113426,"exBudgetMemory":142977,"scriptSizeBytes":437} -ops.harmonic-sum {"exBudgetCPU":85294919,"exBudgetMemory":207655,"scriptSizeBytes":441} -ops.multi-product {"exBudgetCPU":96083895,"exBudgetMemory":237989,"scriptSizeBytes":463} -compare {"exBudgetCPU":27193475,"exBudgetMemory":69077,"scriptSizeBytes":363} -round.5/3 {"exBudgetCPU":17926406,"exBudgetMemory":39749,"scriptSizeBytes":369} -round.4/3 {"exBudgetCPU":16470457,"exBudgetMemory":36646,"scriptSizeBytes":369} -round.-5/2 {"exBudgetCPU":17727920,"exBudgetMemory":39249,"scriptSizeBytes":383} -round.-1/4 {"exBudgetCPU":16837934,"exBudgetMemory":37348,"scriptSizeBytes":383} -truncate.5/4 {"exBudgetCPU":13897101,"exBudgetMemory":33539,"scriptSizeBytes":320} -truncate.7/4 {"exBudgetCPU":15353050,"exBudgetMemory":36642,"scriptSizeBytes":320} -truncate.1/4 {"exBudgetCPU":12441152,"exBudgetMemory":30436,"scriptSizeBytes":320} -truncate.-7/4 {"exBudgetCPU":17474953,"exBudgetMemory":40849,"scriptSizeBytes":334} -properFraction.-1/2 {"exBudgetCPU":40971082,"exBudgetMemory":103120,"scriptSizeBytes":504} -properFraction.-3/2 {"exBudgetCPU":42794508,"exBudgetMemory":106925,"scriptSizeBytes":506} -properFraction.-4/3 {"exBudgetCPU":42794508,"exBudgetMemory":106925,"scriptSizeBytes":506} +ops.+ {"exBudgetCPU":33566829,"exBudgetMemory":84401,"scriptSizeBytes":393} +ops.- {"exBudgetCPU":33566829,"exBudgetMemory":84401,"scriptSizeBytes":393} +ops.* {"exBudgetCPU":58106354,"exBudgetMemory":142977,"scriptSizeBytes":452} +ops.harmonic-sum {"exBudgetCPU":85280775,"exBudgetMemory":207655,"scriptSizeBytes":456} +ops.multi-product {"exBudgetCPU":96066215,"exBudgetMemory":237989,"scriptSizeBytes":478} +compare {"exBudgetCPU":27186403,"exBudgetMemory":69077,"scriptSizeBytes":378} +round.5/3 {"exBudgetCPU":17922870,"exBudgetMemory":39749,"scriptSizeBytes":384} +round.4/3 {"exBudgetCPU":16466921,"exBudgetMemory":36646,"scriptSizeBytes":384} +round.-5/2 {"exBudgetCPU":17724384,"exBudgetMemory":39249,"scriptSizeBytes":398} +round.-1/4 {"exBudgetCPU":16834398,"exBudgetMemory":37348,"scriptSizeBytes":398} +truncate.5/4 {"exBudgetCPU":13893565,"exBudgetMemory":33539,"scriptSizeBytes":335} +truncate.7/4 {"exBudgetCPU":15349514,"exBudgetMemory":36642,"scriptSizeBytes":335} +truncate.1/4 {"exBudgetCPU":12437616,"exBudgetMemory":30436,"scriptSizeBytes":335} +truncate.-7/4 {"exBudgetCPU":17471417,"exBudgetMemory":40849,"scriptSizeBytes":349} +properFraction.-1/2 {"exBudgetCPU":40964010,"exBudgetMemory":103120,"scriptSizeBytes":519} +properFraction.-3/2 {"exBudgetCPU":42787436,"exBudgetMemory":106925,"scriptSizeBytes":521} +properFraction.-4/3 {"exBudgetCPU":42787436,"exBudgetMemory":106925,"scriptSizeBytes":521} data.id.0.5 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} data.id.2 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} -data.id.11/3 {"exBudgetCPU":13900637,"exBudgetMemory":33539,"scriptSizeBytes":274} -div by 0.1/0 {"exBudgetCPU":594827,"exBudgetMemory":136,"scriptSizeBytes":274} -div by 0.recip 0 {"exBudgetCPU":501931,"exBudgetMemory":134,"scriptSizeBytes":75} -div by 0.1/(1-1) {"exBudgetCPU":9194401,"exBudgetMemory":20168,"scriptSizeBytes":353} \ No newline at end of file +data.id.11/3 {"exBudgetCPU":13897101,"exBudgetMemory":33539,"scriptSizeBytes":289} +div by 0.1/0 {"exBudgetCPU":591291,"exBudgetMemory":136,"scriptSizeBytes":289} +div by 0.recip 0 {"exBudgetCPU":498395,"exBudgetMemory":134,"scriptSizeBytes":90} +div by 0.1/(1-1) {"exBudgetCPU":9190865,"exBudgetMemory":20168,"scriptSizeBytes":368} \ No newline at end of file diff --git a/plutarch-test/goldens/rational.uplc.golden b/plutarch-test/goldens/rational.uplc.golden index 4a57770e1..72a238079 100644 --- a/plutarch-test/goldens/rational.uplc.golden +++ b/plutarch-test/goldens/rational.uplc.golden @@ -1,24 +1,24 @@ literal (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) -ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 6)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 9)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 10))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (equalsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "pnonZero: building with 0")) +ops.+ (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +ops.- (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +ops.* (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i9 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2))))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +ops.harmonic-sum (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (i1 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (addInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3))))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +ops.multi-product (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (i1 (i2 (i1 (i2 (i1 (i2 (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5)) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 6)) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i8 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (multiplyInteger i4 i2)))))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +compare (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> lessThanInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 9)) (i1 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 10))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +round.5/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-5/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +round.-1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> addInteger i2 (force (i8 (equalsInteger (modInteger i3 2) 1) (delay (force (i8 (lessThanInteger (divideInteger i3 2) i1) (delay 1) (delay 0)))) (delay (force (i8 (equalsInteger (divideInteger i3 2) i1) (delay (modInteger i2 2)) (delay (force (i8 (lessThanInteger i1 (divideInteger i3 2)) (delay 0) (delay 1)))))))))) (modInteger i3 i2)) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 5) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) data.id.0.5 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) data.id.2 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) -data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (equalsInteger i2 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0))) -div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i15 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (i12 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) \ No newline at end of file +data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.1/0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) +div by 0.recip 0 (program 1.0.0 ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i3 i2) (force (force ifThenElse (lessThanEqualsInteger i2 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 0))) +div by 0.1/(1-1) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i15 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i7 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i11 (equalsInteger i2 0) (delay 0) (delay (force (i11 (lessThanEqualsInteger i2 0) (delay (i12 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i8 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i5 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i4 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1))) \ No newline at end of file diff --git a/plutarch-test/goldens/show.bench.golden b/plutarch-test/goldens/show.bench.golden index 24a27bd4d..a0407ff6d 100644 --- a/plutarch-test/goldens/show.bench.golden +++ b/plutarch-test/goldens/show.bench.golden @@ -33,4 +33,4 @@ builtinlist.nil {"exBudgetCPU":2756985,"exBudgetMemory":11043,"scriptSizeBytes": builtinlist.1,2,3 {"exBudgetCPU":26137058,"exBudgetMemory":60484,"scriptSizeBytes":392} pair.int-str {"exBudgetCPU":34865639,"exBudgetMemory":80705,"scriptSizeBytes":454} pair.int-list {"exBudgetCPU":42325700,"exBudgetMemory":93314,"scriptSizeBytes":434} -rational.1/2 {"exBudgetCPU":24865887,"exBudgetMemory":59194,"scriptSizeBytes":553} \ No newline at end of file +rational.1/2 {"exBudgetCPU":24862351,"exBudgetMemory":59194,"scriptSizeBytes":568} \ No newline at end of file diff --git a/plutarch-test/goldens/show.uplc.golden b/plutarch-test/goldens/show.uplc.golden index 8c09cf958..cd10b85e0 100644 --- a/plutarch-test/goldens/show.uplc.golden +++ b/plutarch-test/goldens/show.uplc.golden @@ -33,4 +33,4 @@ builtinlist.nil (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> builtinlist.1,2,3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> appendString "[" (appendString (i4 (\i0 -> \i0 -> force (i4 i1 (delay i8) (delay ((\i0 -> force (i5 i1 (delay (i6 (i24 i2))) (delay (appendString (i6 (i24 i2)) (appendString ", " (i3 (i25 i2))))))) (i24 i1))))) i1) "]")) [1,2,3]) (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) pair.int-str (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i17 (appendString (i18 (\i0 -> \i0 -> appendString (force (i21 (lessThanInteger i1 0) (delay "-") (delay ""))) ((\i0 -> (\i0 -> force (i23 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))) i2) (appendString i17 (appendString i20 (appendString (decodeUtf8 (i18 (\i0 -> \i0 -> (\i0 -> (\i0 -> force (i23 (equalsInteger i1 0) (delay i3) (delay ((\i0 -> (\i0 -> i4 i2 i1) (sliceByteString 1 (subtractInteger i2 1) i4)) (indexByteString i3 0))))) (lengthOfByteString i2)) (\i0 -> \i0 -> force (i23 (equalsInteger i2 34) (delay (consByteString 92 (consByteString i2 (i4 i1)))) (delay (consByteString i2 (i4 i1)))))) (encodeUtf8 i1))) i20))))))) ((\i0 -> \i0 -> i1 i2 "hello") 42)) (\i0 -> force (i16 (equalsInteger i1 0) (delay i2) (delay (force (i16 (equalsInteger i1 1) (delay i3) (delay (force (i16 (equalsInteger i1 2) (delay i4) (delay (force (i16 (equalsInteger i1 3) (delay i5) (delay (force (i16 (equalsInteger i1 4) (delay i6) (delay (force (i16 (equalsInteger i1 5) (delay i7) (delay (force (i16 (equalsInteger i1 6) (delay i8) (delay (force (i16 (equalsInteger i1 7) (delay i9) (delay (force (i16 (equalsInteger i1 8) (delay i10) (delay (force (i16 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i5 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) " ") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force ifThenElse)) "\"")) pair.int-list (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString "PPair" (appendString i4 (appendString (i6 i2) (appendString i4 (appendString "[" (appendString (i7 (\i0 -> \i0 -> force (i7 i1 (delay i11) (delay ((\i0 -> force (i8 i1 (delay (i9 (i27 i2))) (delay (appendString (i9 (i27 i2)) (appendString ", " (i3 (i28 i2))))))) (i27 i1))))) i1) "]"))))))) ((\i0 -> \i0 -> i1 i2 [1,2,3]) 42)) " ") (force (force chooseList))) (i1 (\i0 -> \i0 -> appendString (force (i18 (lessThanInteger i1 0) (delay i4) (delay i5))) ((\i0 -> (\i0 -> force (i20 (equalsInteger i2 0) (delay (i8 i1)) (delay ((\i0 -> appendString i1 (i9 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) "-") "") (\i0 -> force (i13 (equalsInteger i1 0) (delay i2) (delay (force (i13 (equalsInteger i1 1) (delay i3) (delay (force (i13 (equalsInteger i1 2) (delay i4) (delay (force (i13 (equalsInteger i1 3) (delay i5) (delay (force (i13 (equalsInteger i1 4) (delay i6) (delay (force (i13 (equalsInteger i1 5) (delay i7) (delay (force (i13 (equalsInteger i1 6) (delay i8) (delay (force (i13 (equalsInteger i1 7) (delay i9) (delay (force (i13 (equalsInteger i1 8) (delay i10) (delay (force (i13 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> force (i2 (lessThanEqualsInteger i1 (i3 1)) (delay (i3 i1)) (delay i1)))) (force ifThenElse)) (\i0 -> subtractInteger 0 i1)) (force headList)) (force tailList))) -rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i29 (equalsInteger i2 0) (delay 0) (delay (force (i29 (lessThanEqualsInteger i2 0) (delay (i28 1)) (delay 1))))))) ((\i0 -> (\i0 -> i27 (\i0 -> \i0 -> \i0 -> force (i33 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i27 i2)) (i26 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i25 (equalsInteger i1 0) (delay (force (force trace "pnonZero: building with 0" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i14 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) "-") "") (\i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (force (i15 (equalsInteger i1 1) (delay i3) (delay (force (i15 (equalsInteger i1 2) (delay i4) (delay (force (i15 (equalsInteger i1 3) (delay i5) (delay (force (i15 (equalsInteger i1 4) (delay i6) (delay (force (i15 (equalsInteger i1 5) (delay i7) (delay (force (i15 (equalsInteger i1 6) (delay i8) (delay (force (i15 (equalsInteger i1 7) (delay i9) (delay (force (i15 (equalsInteger i1 8) (delay i10) (delay (force (i15 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) \ No newline at end of file +rational.1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> appendString (i4 i2) (appendString "/" (i4 i1)))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i29 (equalsInteger i2 0) (delay 0) (delay (force (i29 (lessThanEqualsInteger i2 0) (delay (i28 1)) (delay 1))))))) ((\i0 -> (\i0 -> i27 (\i0 -> \i0 -> \i0 -> force (i33 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i30 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i27 i2)) (i26 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i25 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (i14 (\i0 -> \i0 -> appendString (force (i19 (lessThanInteger i1 0) (delay i3) (delay i4))) ((\i0 -> (\i0 -> force (i21 (equalsInteger i2 0) (delay (i7 i1)) (delay ((\i0 -> appendString i1 (i8 i2)) (i4 i2))))) (remainderInteger (i18 i2) 10)) (quotientInteger (i17 i1) 10))))) "-") "") (\i0 -> force (i15 (equalsInteger i1 0) (delay i2) (delay (force (i15 (equalsInteger i1 1) (delay i3) (delay (force (i15 (equalsInteger i1 2) (delay i4) (delay (force (i15 (equalsInteger i1 3) (delay i5) (delay (force (i15 (equalsInteger i1 4) (delay i6) (delay (force (i15 (equalsInteger i1 5) (delay i7) (delay (force (i15 (equalsInteger i1 6) (delay i8) (delay (force (i15 (equalsInteger i1 7) (delay i9) (delay (force (i15 (equalsInteger i1 8) (delay i10) (delay (force (i15 (equalsInteger i1 9) (delay i11) (delay error))))))))))))))))))))))))))))))) "0") "1") "2") "3") "4") "5") "6") "7") "8") "9") (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) \ No newline at end of file diff --git a/plutarch.cabal b/plutarch.cabal index 757b2919f..795ea97d0 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -126,9 +126,9 @@ library Plutarch.List Plutarch.Maybe Plutarch.Monadic - Plutarch.NonZero Plutarch.Num Plutarch.Pair + Plutarch.Positive Plutarch.Prelude Plutarch.Rational Plutarch.Reducible From c99ec7e40594c82c132e56592338a2b53a6e5274 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 12 Jul 2022 21:21:51 +0530 Subject: [PATCH 565/584] Fix formatting --- Plutarch/Positive.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/Positive.hs b/Plutarch/Positive.hs index ceb587c92..dd5ac1b45 100644 --- a/Plutarch/Positive.hs +++ b/Plutarch/Positive.hs @@ -43,8 +43,8 @@ instance PNum PPositive where x #- y = ptryPositive #$ pto x #- pto y pfromInteger x - | x <= 0 = pthrow "PPositive.pfromInteger: encountered non positive" - | otherwise = pcon $ PPositive $ pfromInteger x + | x <= 0 = pthrow "PPositive.pfromInteger: encountered non positive" + | otherwise = pcon $ PPositive $ pfromInteger x instance PTryFrom PInteger PPositive where type PTryFromExcess PInteger PPositive = Const () From fa14b22150df72f24bb802bcc91060ce3a2e437a Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 13 Jul 2022 14:54:50 +0530 Subject: [PATCH 566/584] Address review comments --- Plutarch/Rational.hs | 30 ++++++++++++++----- plutarch-test/goldens/data-verif.bench.golden | 10 +++---- plutarch-test/goldens/data-verif.uplc.golden | 10 +++---- plutarch-test/goldens/rational.bench.golden | 6 ++-- plutarch-test/goldens/rational.uplc.golden | 6 ++-- 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index c977a5e86..1b48e9501 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -49,7 +49,7 @@ import Plutarch.Builtin ( ) import Plutarch.Integer (PInteger, pdiv, pmod) import Plutarch.Lift (pconstant) -import Plutarch.List (pcons, phead, plength, pnil, ptail) +import Plutarch.List (pcons, phead, pnil, ptail) import Plutarch.Num (PNum, pabs, pfromInteger, pnegate, psignum, (#*), (#+), (#-)) import Plutarch.Pair (PPair (PPair)) import Plutarch.Positive (PPositive, ptryPositive) @@ -67,10 +67,21 @@ class PFractional (a :: PType) where data PRational s = PRational (Term s PInteger) (Term s PPositive) deriving stock (Generic) - deriving anyclass (PlutusType, PEq) + deriving anyclass (PlutusType) instance DerivePlutusType PRational where type DPTStrat _ = PlutusTypeScott +instance PEq PRational where + l' #== r' = + phoistAcyclic + ( plam $ \l r -> + pmatch l $ \(PRational ln ld) -> + pmatch r $ \(PRational rn rd) -> + pto rd * ln #== rn * pto ld + ) + # l' + # r' + instance (PNum a, PFractional a) => Fractional (Term s a) where (/) = (#/) recip x = precip # x @@ -114,8 +125,9 @@ instance PTryFrom PData (PAsData PRational) where type PTryFromExcess PData (PAsData PRational) = Flip Term PPositive ptryFrom' opq = runTermCont $ do (_, ld) <- tcont $ ptryFrom @(PAsData (PBuiltinList PData)) opq - tcont $ \f -> pif (plength # ld #== 2) (f ()) (ptraceError "ptryFrom(PRational): data list length should be 2") - (_, denm) <- tcont $ ptryFrom @(PAsData PInteger) $ phead #$ ptail # ld + ratTail <- tcont . plet $ ptail # ld + tcont $ \f -> pif (ptail # ratTail #== pnil) (f ()) $ ptraceError "ptryFrom(PRational): data list length should be 2" + (_, denm) <- tcont $ ptryFrom @(PAsData PInteger) $ phead # ratTail res <- tcont . plet $ ptryPositive # denm pure (punsafeCoerce opq, res) @@ -157,6 +169,7 @@ instance PNum PRational where # x' # y' + -- TODO (Optimize): Could this be optimized with an impl in terms of `#+`. x' #- y' = phoistAcyclic ( plam $ \x y -> unTermCont $ do @@ -219,6 +232,7 @@ instance PFractional PRational where pmatch x $ \(PRational xn xd) -> pcon $ PRational (pto xd) $ ptryPositive # xn + -- TODO (Optimize): Could this be optimized with an impl in terms of `#*`. x' #/ y' = phoistAcyclic ( plam $ \x y -> unTermCont $ do @@ -238,14 +252,14 @@ preduce = phoistAcyclic $ PRational xn xd' <- tcont $ pmatch x xd <- tcont . plet $ pto xd' r <- tcont . plet $ pgcd # xn # xd - s <- tcont . plet . signum $ xd + s <- tcont . plet $ psignum # xd pure . pcon $ PRational (s * pdiv # xn # r) $ punsafeDowncast $ s * pdiv # xd # r pgcd :: Term s (PInteger :--> PInteger :--> PInteger) pgcd = phoistAcyclic $ plam $ \x' y' -> unTermCont $ do - x <- tcont . plet $ abs x' - y <- tcont . plet $ abs y' + x <- tcont . plet $ pabs # x' + y <- tcont . plet $ pabs # y' pure $ pgcd' # (pmax # x # y) #$ pmin # x # y -- assumes inputs are non negative and a >= b @@ -271,7 +285,7 @@ pdenominator :: Term s (PRational :--> PPositive) pdenominator = phoistAcyclic $ plam $ \x -> pmatch x $ \(PRational _ d) -> d pfromInteger :: Term s (PInteger :--> PRational) -pfromInteger = phoistAcyclic $ plam $ \n -> pcon $ PRational n $ punsafeDowncast 1 +pfromInteger = phoistAcyclic $ plam $ \n -> pcon $ PRational n 1 pround :: Term s (PRational :--> PInteger) pround = phoistAcyclic $ diff --git a/plutarch-test/goldens/data-verif.bench.golden b/plutarch-test/goldens/data-verif.bench.golden index 2be87d191..dce79edfe 100644 --- a/plutarch-test/goldens/data-verif.bench.golden +++ b/plutarch-test/goldens/data-verif.bench.golden @@ -4,13 +4,13 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int {"exBudgetCPU":733650,"exBudgetMemory":548,"scriptSizeBytes":165} erroneous.PDataSum constr 2 {"exBudgetCPU":700994,"exBudgetMemory":230,"scriptSizeBytes":197} erroneous.PDataSum wrong record type {"exBudgetCPU":990483,"exBudgetMemory":232,"scriptSizeBytes":256} -erroneous.[ByteString] (with length == 2) /= PRational {"exBudgetCPU":1656457,"exBudgetMemory":554,"scriptSizeBytes":246} -erroneous.[Integer] (with length == 0) /= PRational {"exBudgetCPU":761999,"exBudgetMemory":230,"scriptSizeBytes":208} -erroneous.[Integer] (with length == 3) /= PRational {"exBudgetCPU":2227517,"exBudgetMemory":524,"scriptSizeBytes":254} -erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational {"exBudgetCPU":2152752,"exBudgetMemory":524,"scriptSizeBytes":240} +erroneous.[ByteString] (with length == 2) /= PRational {"exBudgetCPU":1682971,"exBudgetMemory":486,"scriptSizeBytes":210} +erroneous.[Integer] (with length == 0) /= PRational {"exBudgetCPU":125996,"exBudgetMemory":196,"scriptSizeBytes":172} +erroneous.[Integer] (with length == 3) /= PRational {"exBudgetCPU":1872200,"exBudgetMemory":422,"scriptSizeBytes":217} +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational {"exBudgetCPU":2179266,"exBudgetMemory":456,"scriptSizeBytes":203} working.(String, String) == (String, String) {"exBudgetCPU":4806613,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":4994603,"exBudgetMemory":16904,"scriptSizeBytes":114} -working.[Integer] (with length == 2) == PRational {"exBudgetCPU":9650685,"exBudgetMemory":28350,"scriptSizeBytes":400} +working.[Integer] (with length == 2) == PRational {"exBudgetCPU":7549502,"exBudgetMemory":19484,"scriptSizeBytes":355} working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":128} diff --git a/plutarch-test/goldens/data-verif.uplc.golden b/plutarch-test/goldens/data-verif.uplc.golden index b4eef5ef1..670979984 100644 --- a/plutarch-test/goldens/data-verif.uplc.golden +++ b/plutarch-test/goldens/data-verif.uplc.golden @@ -4,13 +4,13 @@ erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := erroneous.Map Int String /= Map Int Int (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> mapData (i6 (mkPairData (bData i5) (iData 42)) (i6 (mkPairData (bData i7) (iData 41)) i8))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i10) (delay (i8 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> (\i0 -> mkPairData (i6 i3) (i5 i3)) (unIData (i4 i2))) (unIData (i4 i1))) i1)) (unMapData (mapData (i4 (mkPairData (bData i3) (iData 42)) (i4 (mkPairData (bData i5) (iData 41)) i6))))) (force (force sndPair))) (force (force fstPair))) #666f6f) (force mkCons)) #626172) [ ])) erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i8) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay (force (i12 "list is longer than zero" (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i4)) (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unBData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87b9f0543666f6fff)) -erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 (bData i7) (i8 (bData i9) i10))) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 (bData i4) (i5 (bData i6) i7))))) (force ifThenElse)) (force tailList)) (force trace)) #41) (force mkCons)) #2b) [ ])) -erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData i7) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData i4))) (force ifThenElse)) (force tailList)) (force trace)) [ ])) -erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i9 i7 (i9 i8 (i9 i10 i11)))) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i4 (i6 i5 (i6 i7 i8)))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) #07) (force mkCons)) #00) [ ])) -erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i6 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> listData (i8 i7 (i8 i9 i10))) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList (i3 i1))))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i5 i4 (i5 i6 i7))))) (force ifThenElse)) (force tailList)) (force trace)) #182a) (force mkCons)) #00) [ ])) +erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 (equalsData (listData (i5 i1)) (listData i9)) (delay ((\i0 -> (\i0 -> listData (i9 (bData i8) (i9 (bData i10) i11))) (force (i4 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList i1)))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (i4 i1)) (unListData (listData (i5 (bData i4) (i5 (bData i6) i7))))) (force ifThenElse)) (force trace)) (force tailList)) #41) (force mkCons)) #2b) [ ])) +erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 (equalsData (listData (i5 i1)) (listData i6)) (delay ((\i0 -> (\i0 -> listData i8) (force (i4 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList i1)))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (i4 i1)) (unListData (listData i4))) (force ifThenElse)) (force trace)) (force tailList)) [ ])) +erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 (equalsData (listData (i5 i1)) (listData i10)) (delay ((\i0 -> (\i0 -> listData (i10 i8 (i10 i9 (i10 i11 i12)))) (force (i4 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList i1)))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (i4 i1)) (unListData (listData (i6 i4 (i6 i5 (i6 i7 i8)))))) (force ifThenElse)) (force trace)) (force tailList)) #182a) #07) (force mkCons)) #00) [ ])) +erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 (equalsData (listData (i5 i1)) (listData i9)) (delay ((\i0 -> (\i0 -> listData (i9 i8 (i9 i10 i11))) (force (i4 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList i1)))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (i4 i1)) (unListData (listData (i5 i4 (i5 i6 i7))))) (force ifThenElse)) (force trace)) (force tailList)) #182a) (force mkCons)) #00) [ ])) working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) -working.[Integer] (with length == 2) == PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i2 (equalsInteger ((\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (force (force chooseList) i1 (delay i2) (delay (i3 (addInteger i2 1) (i7 i1))))) 0 i1) 2) (delay ((\i0 -> (\i0 -> force (i4 (equalsInteger i1 (unIData i10)) (delay (force (i4 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force ((\i0 -> \i0 -> i12 i2 i1 (delay False)) (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (unIData (i8 (i9 i2)))) (unIData (i7 i1))) (unListData i1)) (listData (i9 i8 (i9 i10 i11)))) ((\i0 -> \i0 -> i1 i2 i3) (unIData i8))) (delay ()) (delay (force (i7 "drat should be as expected" (delay error))))))) (delay (force (i7 "non-zero should be as expected" (delay error)))))) (force (i3 (lessThanEqualsInteger i1 0) (delay (force (i6 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (i3 (i4 i1))))) (delay (force (i5 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (unListData (listData (i6 i5 (i6 i7 i8))))) (force ifThenElse)) (force headList)) (force tailList)) (force trace)) #182a) (force mkCons)) #181f) [ ])) +working.[Integer] (with length == 2) == PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 (equalsData (listData (i6 i1)) (listData i10)) (delay ((\i0 -> (\i0 -> force (i5 (equalsInteger i1 (unIData i11)) (delay (force (i5 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (unIData (i9 (i11 i2)))) (unIData (i8 i1))) (unListData i1)) (listData (i10 i9 (i10 i11 i12)))) ((\i0 -> \i0 -> i1 i2 i3) (unIData i9))) (delay ()) (delay (force (i7 "drat should be as expected" (delay error))))))) (delay (force (i7 "non-zero should be as expected" (delay error)))))) (force (i4 (lessThanEqualsInteger i1 0) (delay (force (i6 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (i4 i1)))) (delay (force (i5 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (i5 i1)) (unListData (listData (i6 i5 (i6 i7 i8))))) (force ifThenElse)) (force headList)) (force trace)) (force tailList)) #182a) (force mkCons)) #181f) [ ])) working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) diff --git a/plutarch-test/goldens/rational.bench.golden b/plutarch-test/goldens/rational.bench.golden index 6c944bf47..977e089bf 100644 --- a/plutarch-test/goldens/rational.bench.golden +++ b/plutarch-test/goldens/rational.bench.golden @@ -13,9 +13,9 @@ truncate.5/4 {"exBudgetCPU":13893565,"exBudgetMemory":33539,"scriptSizeBytes":33 truncate.7/4 {"exBudgetCPU":15349514,"exBudgetMemory":36642,"scriptSizeBytes":335} truncate.1/4 {"exBudgetCPU":12437616,"exBudgetMemory":30436,"scriptSizeBytes":335} truncate.-7/4 {"exBudgetCPU":17471417,"exBudgetMemory":40849,"scriptSizeBytes":349} -properFraction.-1/2 {"exBudgetCPU":40964010,"exBudgetMemory":103120,"scriptSizeBytes":519} -properFraction.-3/2 {"exBudgetCPU":42787436,"exBudgetMemory":106925,"scriptSizeBytes":521} -properFraction.-4/3 {"exBudgetCPU":42787436,"exBudgetMemory":106925,"scriptSizeBytes":521} +properFraction.-1/2 {"exBudgetCPU":40492313,"exBudgetMemory":101522,"scriptSizeBytes":513} +properFraction.-3/2 {"exBudgetCPU":42315739,"exBudgetMemory":105327,"scriptSizeBytes":515} +properFraction.-4/3 {"exBudgetCPU":42315739,"exBudgetMemory":105327,"scriptSizeBytes":515} data.id.0.5 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} data.id.2 {"exBudgetCPU":161100,"exBudgetMemory":800,"scriptSizeBytes":17} data.id.11/3 {"exBudgetCPU":13897101,"exBudgetMemory":33539,"scriptSizeBytes":289} diff --git a/plutarch-test/goldens/rational.uplc.golden b/plutarch-test/goldens/rational.uplc.golden index 72a238079..2ec5f55dd 100644 --- a/plutarch-test/goldens/rational.uplc.golden +++ b/plutarch-test/goldens/rational.uplc.golden @@ -13,9 +13,9 @@ truncate.5/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> ( truncate.7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) truncate.1/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) truncate.-7/4 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> force (i7 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i7 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1))) ((\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i5 i2))) ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 7) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4)))) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) -properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) -properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) -properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i12 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i18 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i18 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force (i3 (equalsInteger i2 (i14 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> force (i8 (equalsInteger i4 i2) (delay (equalsInteger i3 i1)))))) (i5 (i6 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> \i0 -> i15 i2 i1 i3)) (delay False)) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +properFraction.-1/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i10 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 0) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +properFraction.-3/2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i10 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) +properFraction.-4/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) ((\i0 -> i3 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> i10 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i4 i2)) (subtractInteger (multiplyInteger i4 i1) (multiplyInteger i2 i3)))))) ((\i0 -> \i0 -> i1 i3 i2) 1))) (i1 (\i0 -> \i0 -> (\i0 -> force (i16 (lessThanEqualsInteger 0 i3) (delay i1) (delay (addInteger i1 (force (i16 (equalsInteger (modInteger i3 i2) 0) (delay 0) (delay 1))))))) (divideInteger i2 i1)))) (i1 (i2 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 4) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3))) (\i0 -> \i0 -> force ((\i0 -> \i0 -> i16 i2 i1 (delay False)) (equalsInteger i2 (i12 1)) (delay ((\i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) (i3 (i4 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 1) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)))))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> \i0 -> i1 i2 i3) (i12 i2)))) (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> i8 ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) (i15 (multiplyInteger i3 i2)))))) (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i13 (equalsInteger i2 0) (delay 0) (delay (force (i13 (lessThanEqualsInteger i2 0) (delay (i11 1)) (delay 1))))))) (i4 i2 i1)))) (\i0 -> \i0 -> (\i0 -> (\i0 -> i5 (i7 i2 i1) (i8 i2 i1)) (i8 i2)) (i7 i2))) (i1 (\i0 -> \i0 -> \i0 -> force (i10 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (\i0 -> \i0 -> force (i7 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2)))) (\i0 -> \i0 -> force (i6 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (\i0 -> force (i4 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (\i0 -> force (i2 (lessThanEqualsInteger i1 0) (delay (force (i3 i4 (delay error)))) (delay i1)))) (force ifThenElse)) (force trace)) "ptryPositive: building with non positive")) data.id.0.5 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 2) 1)) data.id.2 (program 1.0.0 ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 2)) data.id.11/3 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> (\i0 -> (\i0 -> i1 (\i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (multiplyInteger i2 (divideInteger i4 i3))) (multiplyInteger i1 (divideInteger i4 i2))) (force (i14 (equalsInteger i2 0) (delay 0) (delay (force (i14 (lessThanEqualsInteger i2 0) (delay (i13 1)) (delay 1))))))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> \i0 -> force (i18 (equalsInteger i1 0) (delay i2) (delay (i3 i1 (modInteger i2 i1))))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i1) (delay i2))) (force (i15 (lessThanEqualsInteger i2 i1) (delay i2) (delay i1)))) (i12 i2)) (i11 i2)))) ((\i0 -> \i0 -> i1 i2 i3) (multiplyInteger i5 i2))) ((\i0 -> force (i10 (lessThanEqualsInteger i1 0) (delay (force (force trace "ptryPositive: building with non positive" (delay error)))) (delay i1))) (multiplyInteger i3 i2))))) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 11) ((\i0 -> (\i0 -> \i0 -> i1 i3 i2) 1) 3)) (\i0 -> force (i3 (lessThanEqualsInteger i1 (i2 1)) (delay (i2 i1)) (delay i1)))) (\i0 -> subtractInteger 0 i1)) (force ifThenElse))) From 9d482e217be15324e80b2b424a0e0ff32050d72f Mon Sep 17 00:00:00 2001 From: Daniel Farrelly Date: Wed, 13 Jul 2022 13:15:09 +0100 Subject: [PATCH 567/584] Update `PTryFrom` instances for Plutarch 1.2 --- Plutarch/Api/V1/Address.hs | 9 ++- Plutarch/Api/V1/AssocMap.hs | 40 ++++++++++- Plutarch/Api/V1/Crypto.hs | 18 ++--- Plutarch/Api/V1/Maybe.hs | 3 + Plutarch/Api/V1/Scripts.hs | 12 ++++ Plutarch/Api/V1/Tx.hs | 25 ++++++- Plutarch/Api/V1/Value.hs | 69 ++++++++++++++++++- .../common/Plutarch/Test/Property/Gen.hs | 8 ++- .../plutarch-base/Plutarch/ApiSpec.hs | 1 - 9 files changed, 165 insertions(+), 20 deletions(-) diff --git a/Plutarch/Api/V1/Address.hs b/Plutarch/Api/V1/Address.hs index c99cafb91..783e71f7e 100644 --- a/Plutarch/Api/V1/Address.hs +++ b/Plutarch/Api/V1/Address.hs @@ -28,11 +28,12 @@ data PCredential (s :: S) = PPubKeyCredential (Term s (PDataRecord '["_0" ':= PPubKeyHash])) | PScriptCredential (Term s (PDataRecord '["_0" ':= PValidatorHash])) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, POrd, PTryFrom PData) instance DerivePlutusType (PCredential) where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PCredential where type PLifted PCredential = Plutus.Credential deriving via (DerivePConstantViaData Plutus.Credential PCredential) instance PConstantDecl Plutus.Credential +instance PTryFrom PData (PAsData PCredential) data PStakingCredential (s :: S) = PStakingHash (Term s (PDataRecord '["_0" ':= PCredential])) @@ -47,11 +48,12 @@ data PStakingCredential (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, POrd, PTryFrom PData) instance DerivePlutusType PStakingCredential where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PStakingCredential where type PLifted PStakingCredential = Plutus.StakingCredential deriving via (DerivePConstantViaData Plutus.StakingCredential PStakingCredential) instance PConstantDecl Plutus.StakingCredential +instance PTryFrom PData (PAsData PStakingCredential) newtype PAddress (s :: S) = PAddress @@ -64,8 +66,9 @@ newtype PAddress (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd, PTryFrom PData) instance DerivePlutusType (PAddress) where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PAddress where type PLifted PAddress = Plutus.Address deriving via (DerivePConstantViaData Plutus.Address PAddress) instance PConstantDecl Plutus.Address +instance PTryFrom PData (PAsData PAddress) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 52f758101..3bf73016d 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -46,7 +46,14 @@ import qualified PlutusTx.AssocMap as PlutusMap import qualified PlutusTx.Monoid as PlutusTx import qualified PlutusTx.Semigroup as PlutusTx -import Plutarch.Builtin (pasMap, pdataImpl, pforgetData, pfromDataImpl, ppairDataBuiltin) +import Plutarch.Builtin ( + Flip, + pasMap, + pdataImpl, + pforgetData, + pfromDataImpl, + ppairDataBuiltin + ) import Plutarch.Internal (punsafeBuiltin) import Plutarch.Internal.Witness (witness) import Plutarch.Lift ( @@ -57,9 +64,10 @@ import Plutarch.Lift ( PUnsafeLiftDecl, pconstantFromRepr, pconstantToRepr, - ) + ) import qualified Plutarch.List as List import Plutarch.Prelude hiding (pall, pany, pfilter, pmap, pnull, psingleton) +import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom')) import Plutarch.Show (PShow) import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import qualified PlutusCore as PLC @@ -113,6 +121,34 @@ instance y' <- Plutus.fromData y Just (x', y') +instance + ( PTryFrom PData (PAsData k) + , PTryFrom PData (PAsData v) + ) => + PTryFrom PData (PAsData (PMap 'Unsorted k v)) + where + type PTryFromExcess PData (PAsData (PMap 'Unsorted k v)) = Flip Term (PMap 'Unsorted k v) + ptryFrom' opq = runTermCont $ do + opq' <- tcont . plet $ pasMap # opq + unwrapped <- tcont . plet $ List.pmap # ptryFromPair # opq' + pure (punsafeCoerce opq, pcon . PMap $ unwrapped) + where + ptryFromPair :: Term s (PBuiltinPair PData PData :--> PBuiltinPair (PAsData k) (PAsData v)) + ptryFromPair = plam $ \p -> + ppairDataBuiltin # ptryFrom (pfstBuiltin # p) fst + # ptryFrom (psndBuiltin # p) fst + +instance (POrd k, PIsData k, PIsData v, + PTryFrom PData (PAsData k), + PTryFrom PData (PAsData v) + ) => + PTryFrom PData (PAsData (PMap 'Sorted k v)) where + type PTryFromExcess PData (PAsData (PMap 'Sorted k v)) = Flip Term (PMap 'Sorted k v) + ptryFrom' opq = runTermCont $ do + (opq', _) <- tcont $ ptryFrom @(PAsData (PMap 'Unsorted k v)) opq + unwrapped <- tcont $ plet . papp passertSorted . pfromData $ opq' + pure (punsafeCoerce opq, unwrapped) + -- | Tests whether the map is empty. pnull :: Term s (PMap _ k v :--> PBool) pnull = plam (\map -> List.pnull # pto map) diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index b31f5952f..947f22101 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -1,5 +1,5 @@ -{-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Api.V1.Crypto ( @@ -23,14 +23,6 @@ import Plutarch.Prelude import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom')) import Plutarch.Unsafe (punsafeCoerce) -instance PTryFrom PData (PAsData PPubKeyHash) where - type PTryFromExcess PData (PAsData PPubKeyHash) = Flip Term PPubKeyHash - ptryFrom' opq = runTermCont $ do - (wrapped :: Term _ (PAsData PByteString), unwrapped :: Term _ PByteString) <- - tcont $ ptryFrom @(PAsData PByteString) opq - tcont $ \f -> pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "a PubKeyHash should be 28 bytes long") - pure (punsafeCoerce wrapped, pcon . PPubKeyHash $ unwrapped) - newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PEq, POrd) @@ -42,6 +34,14 @@ deriving via instance PConstantDecl Plutus.PubKeyHash +instance PTryFrom PData (PAsData PPubKeyHash) where + type PTryFromExcess PData (PAsData PPubKeyHash) = Flip Term PPubKeyHash + ptryFrom' opq = runTermCont $ do + unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) opq snd + tcont $ \f -> + pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "a PubKeyHash must be 28 bytes long") + pure (punsafeCoerce opq, pcon . PPubKeyHash $ unwrapped) + newtype PubKey = PubKey {getPubKey :: Plutus.LedgerBytes} deriving stock (Eq, Ord, Show) diff --git a/Plutarch/Api/V1/Maybe.hs b/Plutarch/Api/V1/Maybe.hs index 33d4810a8..e15fcb167 100644 --- a/Plutarch/Api/V1/Maybe.hs +++ b/Plutarch/Api/V1/Maybe.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -24,6 +25,8 @@ data PMaybeData a (s :: S) deriving anyclass (PlutusType, PIsData, PEq) instance DerivePlutusType (PMaybeData a) where type DPTStrat _ = PlutusTypeData +instance PTryFrom PData a => PTryFrom PData (PMaybeData a) +instance PTryFrom PData a => PTryFrom PData (PAsData (PMaybeData a)) instance PLiftData a => PUnsafeLiftDecl (PMaybeData a) where type PLifted (PMaybeData a) = Maybe (PLifted a) diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index c392afe99..8aff3c77e 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -15,6 +16,7 @@ module Plutarch.Api.V1.Scripts ( import qualified PlutusLedgerApi.V1 as Plutus import qualified PlutusLedgerApi.V1.Scripts as Plutus +import Plutarch.Builtin (Flip) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), PConstantDecl, @@ -22,6 +24,8 @@ import Plutarch.Lift ( PUnsafeLiftDecl, ) import Plutarch.Prelude +import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom')) +import Plutarch.Unsafe (punsafeCoerce) newtype PDatum (s :: S) = PDatum (Term s PData) deriving stock (Generic) @@ -80,6 +84,14 @@ deriving via instance PConstantDecl Plutus.ValidatorHash +instance PTryFrom PData (PAsData PValidatorHash) where + type PTryFromExcess PData (PAsData PValidatorHash) = Flip Term PValidatorHash + ptryFrom' opq = runTermCont $ do + unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) opq snd + tcont $ \f -> + pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "a ValidatorHash must be 28 bytes long") + pure (punsafeCoerce opq, pcon . PValidatorHash $ unwrapped) + newtype PMintingPolicyHash (s :: S) = PMintingPolicyHash (Term s PByteString) deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PEq, POrd) diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index ad6d199bf..fdb5b9831 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -10,6 +11,7 @@ module Plutarch.Api.V1.Tx ( import qualified PlutusLedgerApi.V1 as Plutus +import Data.Bifunctor (first) import Plutarch.Api.V1.Address (PAddress) import Plutarch.Api.V1.Maybe (PMaybeData) import Plutarch.Api.V1.Scripts (PDatumHash) @@ -18,6 +20,7 @@ import Plutarch.Api.V1.Value ( KeyGuarantees (Sorted), PValue, ) +import Plutarch.Builtin (Flip, pasConstr) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, @@ -28,6 +31,8 @@ import Plutarch.Lift ( PUnsafeLiftDecl, ) import Plutarch.Prelude +import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom')) +import Plutarch.Unsafe (punsafeCoerce) newtype PTxId (s :: S) = PTxId (Term s (PDataRecord '["_0" ':= PByteString])) @@ -38,6 +43,23 @@ instance DerivePlutusType PTxId where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId deriving via (DerivePConstantViaData Plutus.TxId PTxId) instance PConstantDecl Plutus.TxId +instance PTryFrom PData PTxId where + type PTryFromExcess PData PTxId = Flip Term PTxId + ptryFrom' opq cont = ptryFrom @(PAsData PTxId) opq (cont . first punsafeCoerce) + +instance PTryFrom PData (PAsData PTxId) where + type PTryFromExcess PData (PAsData PTxId) = Flip Term PTxId + ptryFrom' opq = runTermCont $ do + opq' <- tcont . plet $ pasConstr # opq + dataBs <- tcont $ \f -> + pif (pfstBuiltin # opq' #== 0 #&& plength # (psndBuiltin # opq') #== 1) + (f $ phead #$ psndBuiltin # opq') + (ptraceError "bad TxId constructor") + unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) dataBs snd + tcont $ \f -> + pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "a TxId must be 28 bytes long") + pure (punsafeCoerce opq, pcon . PTxId $ pdcons # pdata unwrapped # pdnil) + -- | Reference to a transaction output with a index referencing which of the outputs is being referred to. newtype PTxOutRef (s :: S) = PTxOutRef @@ -50,12 +72,13 @@ newtype PTxOutRef (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd, PTryFrom PData) instance DerivePlutusType PTxOutRef where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxOutRef where type PLifted PTxOutRef = Plutus.TxOutRef deriving via (DerivePConstantViaData Plutus.TxOutRef PTxOutRef) instance PConstantDecl Plutus.TxOutRef +instance PTryFrom PData (PAsData PTxOutRef) -- | A input of the pending transaction. newtype PTxInInfo (s :: S) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index ee9dc4ecb..5589aa56c 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -52,9 +52,10 @@ module Plutarch.Api.V1.Value ( import qualified PlutusLedgerApi.V1 as Plutus -import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted, Unsorted), PMap) +import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted, Unsorted), PMap (..)) import qualified Plutarch.Api.V1.AssocMap as AssocMap import Plutarch.Bool (pand', pif') +import Plutarch.Builtin (Flip) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), @@ -63,6 +64,7 @@ import Plutarch.Lift ( PUnsafeLiftDecl, ) import qualified Plutarch.List as List +import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom')) import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import qualified PlutusTx.Monoid as PlutusTx import qualified PlutusTx.Semigroup as PlutusTx @@ -80,11 +82,28 @@ deriving via instance PConstantDecl Plutus.TokenName +instance PTryFrom PData (PAsData PTokenName) where + type PTryFromExcess PData (PAsData PTokenName) = Flip Term PTokenName + ptryFrom' opq = runTermCont $ do + unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) opq snd + tcont $ \f -> + pif (plengthBS # unwrapped #<= 32) (f ()) (ptraceError "a TokenName must be at most 32 Bytes long") + pure (punsafeCoerce opq, pcon . PTokenName $ unwrapped) + newtype PCurrencySymbol (s :: S) = PCurrencySymbol (Term s PByteString) deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PEq, POrd) instance DerivePlutusType PCurrencySymbol where type DPTStrat _ = PlutusTypeNewtype +instance PTryFrom PData (PAsData PCurrencySymbol) where + type PTryFromExcess PData (PAsData PCurrencySymbol) = Flip Term PCurrencySymbol + ptryFrom' opq = runTermCont $ do + unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) opq snd + len <- tcont . plet $ plengthBS # unwrapped + tcont $ \f -> + pif (len #== 0 #|| len #== 28) (f ()) (ptraceError "a CurrencySymbol must be 28 bytes long or empty") + pure (punsafeCoerce opq, pcon . PCurrencySymbol $ unwrapped) + instance PUnsafeLiftDecl PCurrencySymbol where type PLifted PCurrencySymbol = Plutus.CurrencySymbol deriving via (DerivePConstantViaBuiltin Plutus.CurrencySymbol PCurrencySymbol PByteString) @@ -162,6 +181,37 @@ instance where inv a = punsafeCoerce $ PlutusTx.inv (punsafeCoerce a :: Term s (PValue 'Sorted 'NoGuarantees)) +instance PTryFrom PData (PAsData (PValue 'Unsorted 'NoGuarantees)) +instance PTryFrom PData (PAsData (PValue 'Sorted 'NoGuarantees)) + +instance PTryFrom PData (PAsData (PValue 'Sorted 'Positive)) where + type PTryFromExcess PData (PAsData (PValue 'Sorted 'Positive)) = Flip Term (PValue 'Sorted 'Positive) + ptryFrom' opq = runTermCont $ do + (opq', _) <- tcont $ ptryFrom @(PAsData (PValue 'Sorted 'NoGuarantees)) opq + unwrapped <- tcont . plet . papp passertPositive . pfromData $ opq' + pure (punsafeCoerce opq, unwrapped) + +instance PTryFrom PData (PAsData (PValue 'Unsorted 'Positive)) where + type PTryFromExcess PData (PAsData (PValue 'Unsorted 'Positive)) = Flip Term (PValue 'Unsorted 'Positive) + ptryFrom' opq = runTermCont $ do + (opq', _) <- tcont $ ptryFrom @(PAsData (PValue 'Unsorted 'NoGuarantees)) opq + unwrapped <- tcont . plet . papp passertPositive . pfromData $ opq' + pure (punsafeCoerce opq, unwrapped) + +instance PTryFrom PData (PAsData (PValue 'Sorted 'NonZero)) where + type PTryFromExcess PData (PAsData (PValue 'Sorted 'NonZero)) = Flip Term (PValue 'Sorted 'NonZero) + ptryFrom' opq = runTermCont $ do + (opq', _) <- tcont $ ptryFrom @(PAsData (PValue 'Sorted 'NoGuarantees)) opq + unwrapped <- tcont . plet . papp passertNonZero . pfromData $ opq' + pure (punsafeCoerce opq, unwrapped) + +instance PTryFrom PData (PAsData (PValue 'Unsorted 'NonZero)) where + type PTryFromExcess PData (PAsData (PValue 'Unsorted 'NonZero)) = Flip Term (PValue 'Unsorted 'NonZero) + ptryFrom' opq = runTermCont $ do + (opq', _) <- tcont $ ptryFrom @(PAsData (PValue 'Unsorted 'NoGuarantees)) opq + unwrapped <- tcont . plet . papp passertNonZero . pfromData $ opq' + pure (punsafeCoerce opq, unwrapped) + -- | Construct a constant singleton 'PValue' containing only the given quantity of the given currency. pconstantSingleton :: ClosedTerm PCurrencySymbol -> @@ -351,7 +401,7 @@ passertSorted = phoistAcyclic $ (pcon $ PValue $ AssocMap.passertSorted # pto value) -- | Assert all amounts in the value are positive. -passertPositive :: Term s (PValue 'Sorted 'NonZero :--> PValue 'Sorted 'Positive) +passertPositive :: forall kg ag s. Term s (PValue kg ag :--> PValue kg 'Positive) passertPositive = phoistAcyclic $ plam $ \value -> pif @@ -362,6 +412,21 @@ passertPositive = phoistAcyclic $ (punsafeDowncast $ pto value) (ptraceError "Negative amount in Value") +passertNonZero :: forall kg ag. ClosedTerm (PValue kg ag :--> PValue kg 'NonZero) +passertNonZero = plam $ \val -> + pif (outer #$ pto . pto $ val) (punsafeCoerce val) (ptraceError "Zero amount in Value") + where + outer :: ClosedTerm (PBuiltinList (PBuiltinPair (PAsData PCurrencySymbol) (PAsData (PMap k PTokenName PInteger))) :--> PBool) + outer = pfix #$ plam $ \self m -> + pmatch m $ \case + PCons x xs -> inner # (pto . pfromData $ psndBuiltin # x) #&& self # xs + PNil -> pcon PTrue + inner :: ClosedTerm (PBuiltinList (PBuiltinPair (PAsData PTokenName) (PAsData PInteger)) :--> PBool) + inner = pfix #$ plam $ \self m -> + pmatch m $ \case + PCons x xs -> pnot # (psndBuiltin # x #== pconstantData 0) #&& self # xs + PNil -> pcon PTrue + -- | Forget the knowledge of value's positivity. pforgetPositive :: Term s (PValue 'Sorted 'Positive) -> Term s (PValue k a) pforgetPositive = punsafeCoerce diff --git a/plutarch-test/common/Plutarch/Test/Property/Gen.hs b/plutarch-test/common/Plutarch/Test/Property/Gen.hs index 3faa5e1db..df1c86150 100644 --- a/plutarch-test/common/Plutarch/Test/Property/Gen.hs +++ b/plutarch-test/common/Plutarch/Test/Property/Gen.hs @@ -8,7 +8,7 @@ module Plutarch.Test.Property.Gen ( bsOfLength, ) where -import Control.Monad (MonadPlus, liftM2, mfilter) +import Control.Monad (MonadPlus, liftM2, mfilter, join) import Data.List (nub, sortOn) import Data.Ratio ((%)) @@ -23,6 +23,7 @@ import Test.Tasty.QuickCheck ( Positive (getPositive), arbitrary, choose, + elements, listOf1, oneof, vectorOf, @@ -56,7 +57,10 @@ instance Arbitrary BuiltinByteString where arbitrary = toBuiltin @ByteString <$> arbitrary instance Arbitrary CurrencySymbol where - arbitrary = CurrencySymbol <$> arbitrary + arbitrary = + let arbitrary' = + join $ fmap (toBuiltin @ByteString) . bsOfLength <$> elements [0, 28] + in CurrencySymbol <$> arbitrary' instance Arbitrary Value where arbitrary = diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index de5f335a0..794703055 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -45,7 +45,6 @@ import Plutarch.Builtin (pasConstr, pforgetData) import Plutarch.Prelude import Plutarch.Test import Plutarch.Test.Property.Gen () -import Plutarch.TryFrom (PTryFrom, ptryFrom) import Test.Hspec import Test.Tasty.QuickCheck (Property, property, (===)) From 160cce0f53165eb59720f4b7d767314b34e9459e Mon Sep 17 00:00:00 2001 From: Emily Martins Date: Thu, 14 Jul 2022 22:49:26 +0200 Subject: [PATCH 568/584] Drop `PAsData` from TxInfo where it is redundant --- CHANGELOG.md | 8 ++++++++ Plutarch/Api/V1/Contexts.hs | 6 +++--- Plutarch/Api/V2/Contexts.hs | 8 ++++---- Plutarch/Builtin.hs | 16 +++++++--------- plutarch-extra/Plutarch/Extra/Api.hs | 8 ++++---- .../conditional/Plutarch/TryFromSpec.hs | 14 +++++++------- plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 2 +- .../plutarch-extra/Plutarch/Extra/ApiSpec.hs | 14 +++++++++----- 8 files changed, 43 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f1237617..f0edc1f81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ # Unreleased +- Changed fields of `PTxInfo` whose only representation is data to not be wrapped by `PAsData`. + + Module: `Plutarch.Api.V1.Contexts`; `Plutarch.Api.V2.Contexts` + +- Added `plistData` builtin function wrapper. + + Module: `Plutarch.Builtin` + - Added `PEq` superclass constraint to `POrd` Included by [#326](https://github.com/Plutonomicon/plutarch/pull/326) diff --git a/Plutarch/Api/V1/Contexts.hs b/Plutarch/Api/V1/Contexts.hs index f6fea8955..8ceb15375 100644 --- a/Plutarch/Api/V1/Contexts.hs +++ b/Plutarch/Api/V1/Contexts.hs @@ -42,11 +42,11 @@ newtype PTxInfo (s :: S) ( Term s ( PDataRecord - '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- Transaction inputs - , "outputs" ':= PBuiltinList (PAsData PTxOut) -- Transaction outputs + '[ "inputs" ':= PBuiltinList PTxInInfo -- Transaction inputs + , "outputs" ':= PBuiltinList PTxOut -- Transaction outputs , "fee" ':= PValue 'Sorted 'Positive -- The fee paid by this transaction. , "mint" ':= PValue 'Sorted 'NoGuarantees -- The value minted by the transaction. - , "dcert" ':= PBuiltinList (PAsData PDCert) -- Digests of the certificates included in this transaction. + , "dcert" ':= PBuiltinList PDCert -- Digests of the certificates included in this transaction. , "wdrl" ':= PBuiltinList (PAsData (PTuple PStakingCredential PInteger)) -- Staking withdrawals , "validRange" ':= PPOSIXTimeRange -- The valid range for the transaction. , "signatories" ':= PBuiltinList (PAsData PPubKeyHash) -- Signatories attesting that they all signed the tx. diff --git a/Plutarch/Api/V2/Contexts.hs b/Plutarch/Api/V2/Contexts.hs index b6aa37bd1..44db1320d 100644 --- a/Plutarch/Api/V2/Contexts.hs +++ b/Plutarch/Api/V2/Contexts.hs @@ -50,12 +50,12 @@ newtype PTxInfo (s :: S) ( Term s ( PDataRecord - '[ "inputs" ':= PBuiltinList (PAsData PTxInInfo) -- Transaction inputs - , "referenceInputs" ':= PBuiltinList (PAsData PTxInInfo) - , "outputs" ':= PBuiltinList (PAsData PTxOut) -- Transaction outputs + '[ "inputs" ':= PBuiltinList PTxInInfo -- Transaction inputs + , "referenceInputs" ':= PBuiltinList PTxInInfo + , "outputs" ':= PBuiltinList PTxOut -- Transaction outputs , "fee" ':= V1.PValue 'V1.Sorted 'V1.Positive -- The fee paid by this transaction. , "mint" ':= V1.PValue 'V1.Sorted 'V1.NoGuarantees -- The value minted by the transaction. - , "dcert" ':= PBuiltinList (PAsData V1.PDCert) -- Digests of the certificates included in this transaction. + , "dcert" ':= PBuiltinList V1.PDCert -- Digests of the certificates included in this transaction. , "wdrl" ':= V1.PMap 'V1.Unsorted V1.PStakingCredential PInteger -- Staking withdrawals , "validRange" ':= V1.PPOSIXTimeRange -- The valid range for the transaction. , "signatories" ':= PBuiltinList (PAsData V1.PPubKeyHash) -- Signatories attesting that they all signed the tx. diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index bdc1f2f1d..b01ca4932 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -10,6 +10,7 @@ module Plutarch.Builtin ( pasMap, pasList, pasInt, + plistData, pconstantData, pconstrBuiltin, pasByteStr, @@ -93,7 +94,7 @@ import Plutarch.List ( ) import Plutarch.Show (PShow (pshow'), pshow) import Plutarch.TermCont (TermCont (runTermCont), tcont, unTermCont) -import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast) +import Plutarch.TryFrom (PSubtype, PTryFrom, PTryFromExcess, ptryFrom, ptryFrom', pupcast, pupcastF) import Plutarch.Unit (PUnit) import Plutarch.Unsafe (punsafeBuiltin, punsafeCoerce, punsafeDowncast) import qualified PlutusCore as PLC @@ -234,6 +235,9 @@ pasConstr = punsafeBuiltin PLC.UnConstrData pasMap :: Term s (PData :--> PBuiltinList (PBuiltinPair PData PData)) pasMap = punsafeBuiltin PLC.UnMapData +plistData :: Term s (PBuiltinList PData :--> PData) +plistData = punsafeBuiltin PLC.ListData + pasList :: Term s (PData :--> PBuiltinList PData) pasList = punsafeBuiltin PLC.UnListData @@ -318,21 +322,15 @@ instance PIsData PData where pfromDataImpl = pupcast pdataImpl = id -instance PIsData (PBuiltinList (PAsData a)) where +instance forall (a :: PType). PSubtype PData a => PIsData (PBuiltinList a) where pfromDataImpl x = punsafeCoerce $ pasList # pforgetData x - pdataImpl x = punsafeBuiltin PLC.ListData # x + pdataImpl x = plistData # pupcastF @PData @a (Proxy @PBuiltinList) x newtype Helper2 f a s = Helper2 (Term s (PAsData (f a))) deriving stock (Generic) deriving anyclass (PlutusType) instance DerivePlutusType (Helper2 f a) where type DPTStrat _ = PlutusTypeNewtype -instance PIsData (PBuiltinList PData) where - pfromDataImpl = pforgetData' @PData (Proxy @PBuiltinList) . pfromData . pto . prememberData (Proxy @(Helper2 PBuiltinList)) . pcon . Helper2 - - -- pdataImpl = coerce (pforgetData' @PData (Proxy @(Helper2 PBuiltinList))) . pdata . (prememberData (Proxy @PBuiltinList)) - pdataImpl = punsafeCoerce . pdata . prememberData (Proxy @PBuiltinList) -- FIXME - instance PIsData PInteger where pfromDataImpl x = pasInt # pforgetData x pdataImpl x = punsafeBuiltin PLC.IData # x diff --git a/plutarch-extra/Plutarch/Extra/Api.hs b/plutarch-extra/Plutarch/Extra/Api.hs index a5db768a6..92c812bc7 100644 --- a/plutarch-extra/Plutarch/Extra/Api.hs +++ b/plutarch-extra/Plutarch/Extra/Api.hs @@ -34,7 +34,7 @@ import Plutarch.Prelude pure $ ptraceError "not a spending tx" @ -} -pgetContinuingOutputs :: Term s (PBuiltinList (PAsData PTxInInfo) :--> PBuiltinList (PAsData PTxOut) :--> PTxOutRef :--> PBuiltinList (PAsData PTxOut)) +pgetContinuingOutputs :: Term s (PBuiltinList PTxInInfo :--> PBuiltinList PTxOut :--> PTxOutRef :--> PBuiltinList PTxOut) pgetContinuingOutputs = phoistAcyclic $ plam $ \inputs outputs outRef -> pmatch (pfindOwnInput # inputs # outRef) $ \case @@ -45,7 +45,7 @@ pgetContinuingOutputs = phoistAcyclic $ PNothing -> ptraceError "can't get any continuing outputs" where - matches :: Term s (PAddress :--> PAsData PTxOut :--> PBool) + matches :: Term s (PAddress :--> PTxOut :--> PBool) matches = phoistAcyclic $ plam $ \adr txOut -> adr #== pfield @"address" # txOut @@ -67,12 +67,12 @@ pgetContinuingOutputs = phoistAcyclic $ pure $ ptraceError "not a spending tx" @ -} -pfindOwnInput :: Term s (PBuiltinList (PAsData PTxInInfo) :--> PTxOutRef :--> PMaybe (PAsData PTxInInfo)) +pfindOwnInput :: Term s (PBuiltinList PTxInInfo :--> PTxOutRef :--> PMaybe PTxInInfo) pfindOwnInput = phoistAcyclic $ plam $ \inputs outRef -> pfind # (matches # outRef) # inputs where - matches :: Term s (PTxOutRef :--> PAsData PTxInInfo :--> PBool) + matches :: Term s (PTxOutRef :--> PTxInInfo :--> PBool) matches = phoistAcyclic $ plam $ \outref txininfo -> outref #== pfield @"outRef" # txininfo diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index fec9e8365..3dd68cfe4 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -342,7 +342,7 @@ validator = phoistAcyclic $ data' :: Term _ (PBuiltinList (PAsData (PTuple PDatumHash PDatum))) data' = pfield @"datums" # txInfo - outputs :: Term _ (PBuiltinList (PAsData PTxOut)) + outputs :: Term _ (PBuiltinList PTxOut) outputs = pfield @"outputs" # txInfo -- find the list of the outputs @@ -365,9 +365,9 @@ validator = phoistAcyclic $ singleOutput :: Term _ PBool singleOutput = pnull #$ ptail #$ pfilter # pred # outputs where - pred :: Term _ (PAsData PTxOut :--> PBool) + pred :: Term _ (PTxOut :--> PBool) pred = plam $ \out -> unTermCont $ do - pure $ pfield @"address" # out #== (pdata $ ownAddress) + pure $ pfield @"address" # pdata out #== pdata ownAddress -- make sure that after filtering the outputs, only one output -- remains @@ -382,18 +382,18 @@ validator = phoistAcyclic $ pure $ pif isValid (popaque $ pcon PUnit) (ptraceError "not valid") -pfindOwnInput :: Term s (PScriptContext :--> PMaybe (PAsData PTxInInfo)) +pfindOwnInput :: Term s (PScriptContext :--> PMaybe PTxInInfo) pfindOwnInput = phoistAcyclic $ plam $ \ctx' -> unTermCont $ do ctx <- tcont $ pletFields @["txInfo", "purpose"] ctx' PSpending txoutRef <- tcont $ pmatch $ ctx.purpose - let txInInfos :: Term _ (PBuiltinList (PAsData PTxInInfo)) + let txInInfos :: Term _ (PBuiltinList PTxInInfo) txInInfos = pfield @"inputs" #$ ctx.txInfo target :: Term _ PTxOutRef target = pfield @"_0" # txoutRef - pred :: Term _ (PAsData PTxInInfo :--> PBool) + pred :: Term _ (PTxInInfo :--> PBool) pred = plam $ \actual -> - target #== pfield @"outRef" # pfromData actual + target #== pfield @"outRef" # actual pure $ pfind # pred # txInInfos ------------- Helpers -------------------------------------------------------- diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index 4e5efd938..2e4175531 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -362,7 +362,7 @@ getCredentials ctx = Get the hash of the Credential in an input, treating PubKey & ValidatorHash identically. -} -inputCredentialHash :: Term s (PAsData PTxInInfo :--> PData) +inputCredentialHash :: Term s (PTxInInfo :--> PData) inputCredentialHash = phoistAcyclic $ plam $ \inp -> diff --git a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs index 9d36000f9..50b4f3182 100644 --- a/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs +++ b/plutarch-test/plutarch-extra/Plutarch/Extra/ApiSpec.hs @@ -27,23 +27,27 @@ spec = do pure perror ) @-> \res -> - passert $ (pfromData $ pfromJust # res) #== pconstant inp + passert (pfromJust # res #== pconstant inp) "pgetContinuingOutputs" @| ( unTermCont $ do ctxF <- tcont $ pletFields @["txInfo", "purpose"] ctx pmatchC (getField @"purpose" ctxF) >>= \case PSpending outRef' -> do let outRef = pfield @"_0" # outRef' - inputs = pfield @"inputs" # (getField @"txInfo" ctxF) - outputs = pfield @"outputs" # (getField @"txInfo" ctxF) + inputs = pfield @"inputs" #$ getField @"txInfo" ctxF + outputs = pfield @"outputs" #$ getField @"txInfo" ctxF pure $ pgetContinuingOutputs # inputs # outputs # outRef _ -> pure perror ) @-> \txOuts -> - passert $ (pmap # plam pfromData # txOuts) #== pconstant validOutputs0 + passert $ txOuts #== pconstant validOutputs0 "pparseDatum" - @| ( pparseDatum @(PBuiltinList (PAsData PInteger)) # pconstant "d0" # (pfield @"datums" #$ pfield @"txInfo" # ctx) + @| ( pparseDatum @(PBuiltinList (PAsData PInteger)) + # pconstant "d0" + #$ pfield @"datums" + #$ pfield @"txInfo" + # ctx ) @-> \res -> passert $ res #== pcon (PJust $ pdata $ d0DatTerm) From 3574284f81d6d8a565b34560d9db145e47a9deda Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 19 Jul 2022 17:14:14 +0530 Subject: [PATCH 569/584] Partial ordering relations and type sig fixes --- Plutarch/Api/V1/AssocMap.hs | 36 ++++----- Plutarch/Api/V1/Value.hs | 148 +++++++++++++++++++++++++++++++++--- 2 files changed, 152 insertions(+), 32 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 52f758101..b7874a79c 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -67,6 +67,7 @@ import qualified PlutusCore as PLC import Prelude hiding (all, any, filter, lookup, null) import Data.Proxy (Proxy (Proxy)) +import Data.Traversable (for) data KeyGuarantees = Sorted | Unsorted @@ -108,17 +109,17 @@ instance type PConstanted (PlutusMap.Map k v) = PMap 'Unsorted (PConstanted k) (PConstanted v) pconstantToRepr m = (\(x, y) -> (Plutus.toData x, Plutus.toData y)) <$> PlutusMap.toList m pconstantFromRepr m = fmap PlutusMap.fromList $ - flip traverse m $ \(x, y) -> do + for m $ \(x, y) -> do x' <- Plutus.fromData x y' <- Plutus.fromData y Just (x', y') -- | Tests whether the map is empty. -pnull :: Term s (PMap _ k v :--> PBool) +pnull :: Term s (PMap any k v :--> PBool) pnull = plam (\map -> List.pnull # pto map) -- | Look up the given key in a 'PMap'. -plookup :: (PIsData k, PIsData v) => Term s (k :--> PMap _ k v :--> PMaybe v) +plookup :: (PIsData k, PIsData v) => Term s (k :--> PMap any k v :--> PMaybe v) plookup = phoistAcyclic $ plam $ \key -> plookupDataWith @@ -126,17 +127,16 @@ plookup = phoistAcyclic $ # pdata key -- | Look up the given key data in a 'PMap'. -plookupData :: (PIsData k, PIsData v) => Term s (PAsData k :--> PMap _ k v :--> PMaybe (PAsData v)) +plookupData :: Term s (PAsData k :--> PMap any k v :--> PMaybe (PAsData v)) plookupData = plookupDataWith # phoistAcyclic (plam $ \pair -> pcon $ PJust $ psndBuiltin # pair) -- | Look up the given key data in a 'PMap', applying the given function to the found key-value pair. plookupDataWith :: - (PIsData k, PIsData v) => Term s ( (PBuiltinPair (PAsData k) (PAsData v) :--> PMaybe x) :--> PAsData k - :--> PMap _ k v + :--> PMap any k v :--> PMaybe x ) plookupDataWith = phoistAcyclic $ @@ -152,22 +152,20 @@ plookupDataWith = phoistAcyclic $ # pto map -- | Look up the given key in a 'PMap', returning the default value if the key is absent. -pfindWithDefault :: (PIsData k, PIsData v) => Term s (v :--> k :--> PMap _ k v :--> v) +pfindWithDefault :: (PIsData k, PIsData v) => Term s (v :--> k :--> PMap any k v :--> v) pfindWithDefault = phoistAcyclic $ plam $ \def key -> foldAtData # pdata key # def # plam pfromData {- | Look up the given key in a 'PMap'; return the default if the key is absent or apply the argument function to the value data if present. -} -pfoldAt :: (PIsData k, PIsData v) => Term s (k :--> r :--> (PAsData v :--> r) :--> PMap _ k v :--> r) +pfoldAt :: PIsData k => Term s (k :--> r :--> (PAsData v :--> r) :--> PMap any k v :--> r) pfoldAt = phoistAcyclic $ plam $ \key -> foldAtData # pdata key {- | Look up the given key data in a 'PMap'; return the default if the key is absent or apply the argument function to the value data if present. -} -foldAtData :: - (PIsData k, PIsData v) => - Term s (PAsData k :--> r :--> (PAsData v :--> r) :--> PMap _ k v :--> r) +foldAtData :: Term s (PAsData k :--> r :--> (PAsData v :--> r) :--> PMap any k v :--> r) foldAtData = phoistAcyclic $ plam $ \key def apply map -> precList @@ -323,8 +321,8 @@ instance DerivePlutusType (MapUnionCarrier k v) where type DPTStrat _ = PlutusTy mapUnionCarrier :: (POrd k, PIsData k) => Term s ((PAsData v :--> PAsData v :--> PAsData v) :--> MapUnionCarrier k v :--> MapUnionCarrier k v) mapUnionCarrier = phoistAcyclic $ plam \combine self -> - let mergeInsert = (pmatch self \(MapUnionCarrier {mergeInsert}) -> mergeInsert) - merge = (pmatch self \(MapUnionCarrier {merge}) -> merge) + let mergeInsert = pmatch self \(MapUnionCarrier {mergeInsert}) -> mergeInsert + merge = pmatch self \(MapUnionCarrier {merge}) -> merge in pcon $ MapUnionCarrier { merge = plam $ \xs ys -> pmatch xs $ \case @@ -378,9 +376,7 @@ punionWithData = phoistAcyclic $ pcon $ PMap $ (pmatch (mapUnion # combine) \(MapUnionCarrier {merge}) -> merge) # pto x # pto y -- | Difference of two maps. Return elements of the first map not existing in the second map. -pdifference :: - (PIsData k, PIsData a, PIsData b) => - Term s (PMap g k a :--> PMap _ k b :--> PMap g k a) +pdifference :: PIsData k => Term s (PMap g k a :--> PMap any k b :--> PMap g k a) pdifference = phoistAcyclic $ plam $ \left right -> pcon . PMap $ @@ -388,22 +384,22 @@ pdifference = phoistAcyclic $ ( \self x xs -> plet (self # xs) $ \xs' -> pfoldAt - # (pfromData $ pfstBuiltin # x) + # pfromData (pfstBuiltin # x) # (pcons # x # xs') - # (plam $ const xs') + # plam (const xs') # right ) (const pnil) # pto left -- | Tests if all values in the map satisfy the given predicate. -pall :: PIsData v => Term s ((v :--> PBool) :--> PMap _ k v :--> PBool) +pall :: PIsData v => Term s ((v :--> PBool) :--> PMap any k v :--> PBool) pall = phoistAcyclic $ plam $ \pred map -> List.pall # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map -- | Tests if anu value in the map satisfies the given predicate. -pany :: PIsData v => Term s ((v :--> PBool) :--> PMap _ k v :--> PBool) +pany :: PIsData v => Term s ((v :--> PBool) :--> PMap any k v :--> PBool) pany = phoistAcyclic $ plam $ \pred map -> List.pany # plam (\pair -> pred #$ pfromData $ psndBuiltin # pair) # pto map diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index acb261b67..6dc1c7cbf 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -35,6 +35,9 @@ module Plutarch.Api.V1.Value ( punionWith, punionWithData, + -- * Partial ordering operations + pcheckBinRel, + -- * Lookups pvalueOf, plovelaceValueOf, @@ -116,6 +119,26 @@ instance PEq (PValue 'Sorted 'Positive) where instance PEq (PValue 'Sorted 'NonZero) where a #== b = pto a #== pto b +{- | Partial ordering implementation for sorted 'PValue' with 'Positive' amounts. + +Use 'pcheckBinRel' if 'AmountGuarantees' is 'NoGuarantees'. +-} +instance POrd (PValue 'Sorted 'Positive) where + a #< b = pforgetPositive @_ @'Sorted @'NonZero a #< pforgetPositive b + a #<= b = pforgetPositive @_ @'Sorted @'NonZero a #<= pforgetPositive b + +{- | Partial ordering implementation for sorted 'PValue' with 'NonZero' amounts. + +Use 'pcheckBinRel' if 'AmountGuarantees' is 'NoGuarantees'. +-} +instance POrd (PValue 'Sorted 'NonZero) where + a #< b = f # a # b + where + f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (\x y -> pfromData x #< pfromData y) + a #<= b = f # a # b + where + f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (\x y -> pfromData x #<= pfromData y) + instance PEq (PValue 'Sorted 'NoGuarantees) where a #== b = AssocMap.pall # (AssocMap.pall # plam (#== 0)) # pto (punionWith # plam (-) # a # b) @@ -161,6 +184,105 @@ instance where inv a = punsafeCoerce $ PlutusTx.inv (punsafeCoerce a :: Term s (PValue 'Sorted 'NoGuarantees)) +-- | Check whether a binary relation holds over 2 sorted 'PValue's. +pcheckBinRel :: + Term + s + ( (PAsData PInteger :--> PAsData PInteger :--> PBool) + :--> PValue 'Sorted any0 + :--> PValue 'Sorted any1 + :--> PBool + ) +pcheckBinRel = phoistAcyclic $ + plam $ \f m1 m2 -> + let inner = pfix #$ plam $ \self l1 l2 -> + pelimList + ( \x xs -> + pelimList + ( \y ys -> unTermCont $ do + v1dat <- tcont . plet $ psndBuiltin # x + v2dat <- tcont . plet $ psndBuiltin # y + k1 <- tcont . plet $ pfromData $ pfstBuiltin # x + k2 <- tcont . plet $ pfromData $ pfstBuiltin # y + pure $ + pif + (k1 #< k2) + (pinnerCheckBinRel # f # pfromData v1dat # AssocMap.pempty #&& self # xs # l2) + $ pif + (k1 #== k2) + ( pinnerCheckBinRel # f # pfromData v1dat # pfromData v2dat #&& self + # xs + # ys + ) + $ pinnerCheckBinRel # f # AssocMap.pempty # pfromData v2dat #&& self + # l1 + # ys + ) + ( pinnerCheckBinRel # f # pfromData (psndBuiltin # x) # AssocMap.pempty + #&& pall + # plam + ( \p -> + let v1dat = psndBuiltin # p + in pinnerCheckBinRel # f # pfromData v1dat # AssocMap.pempty + ) + # xs + ) + l2 + ) + ( pall + # plam + ( \p -> + let v1dat = psndBuiltin # p + in pinnerCheckBinRel # f # AssocMap.pempty # pfromData v1dat + ) + # l2 + ) + l1 + in inner # pto (pto $ pto m1) # pto (pto $ pto m2) + where + dat0 :: ClosedTerm (PAsData PInteger) + dat0 = pconstantData 0 + pinnerCheckBinRel :: + ClosedTerm + ( (PAsData PInteger :--> PAsData PInteger :--> PBool) + :--> ( PMap 'Sorted PTokenName PInteger + :--> (PMap 'Sorted PTokenName PInteger :--> PBool) + ) + ) + pinnerCheckBinRel = phoistAcyclic $ + plam $ \f m1 m2 -> + let inner = pfix #$ plam $ \self l1 l2 -> + pelimList + ( \x xs -> + let k1dat = pfstBuiltin # x + v1dat = psndBuiltin # x + in pelimList + ( \y ys -> + let k2dat = pfstBuiltin # y + v2dat = psndBuiltin # y + in unTermCont $ do + k1 <- tcont . plet $ pfromData k1dat + k2 <- tcont . plet $ pfromData k2dat + pure $ + pif + (k1 #< k2) + (f # v1dat # dat0 #&& self # xs # l2) + $ pif + (k1 #== k2) + (f # v1dat # v2dat #&& self # xs # ys) + $ f # dat0 # v2dat #&& self # l1 # ys + ) + ( f # v1dat # dat0 + #&& pall + # plam (\p -> f # (psndBuiltin # p) # dat0) + # xs + ) + l2 + ) + (pall # plam (\p -> f # dat0 #$ psndBuiltin # p) # l2) + l1 + in inner # pto m1 # pto m2 + -- | Construct a constant singleton 'PValue' containing only the given quantity of the given currency. pconstantSingleton :: ClosedTerm PCurrencySymbol -> @@ -216,7 +338,7 @@ psingletonData = phoistAcyclic $ ) -- | Get the quantity of the given currency in the 'PValue'. -pvalueOf :: Term s (PValue _ _ :--> PCurrencySymbol :--> PTokenName :--> PInteger) +pvalueOf :: Term s (PValue anyKey anyAmount :--> PCurrencySymbol :--> PTokenName :--> PInteger) pvalueOf = phoistAcyclic $ plam $ \value symbol token -> AssocMap.pfoldAt @@ -276,7 +398,7 @@ plovelaceValueOf = phoistAcyclic $ PNil -> 0 PCons x _ -> pif' # (pfstBuiltin # x #== padaSymbolData) - # (pfromData $ psndBuiltin #$ phead #$ pto $ pfromData $ psndBuiltin # x) + # pfromData (psndBuiltin #$ phead #$ pto $ pfromData $ psndBuiltin # x) # 0 {- | Combine two 'PValue's applying the given function to any pair of @@ -286,14 +408,14 @@ plovelaceValueOf = phoistAcyclic $ punionWith :: Term s - ( (PInteger :--> PInteger :--> PInteger) :--> PValue 'Sorted _ :--> PValue 'Sorted _ + ( (PInteger :--> PInteger :--> PInteger) :--> PValue 'Sorted any0 :--> PValue 'Sorted any1 :--> PValue 'Sorted 'NoGuarantees ) punionWith = phoistAcyclic $ plam $ \combine x y -> pcon . PValue $ AssocMap.punionWith - # (plam $ \x y -> AssocMap.punionWith # combine # x # y) + # plam (\x y -> AssocMap.punionWith # combine # x # y) # pto x # pto y @@ -305,20 +427,20 @@ punionWithData :: Term s ( (PAsData PInteger :--> PAsData PInteger :--> PAsData PInteger) - :--> PValue 'Sorted _ - :--> PValue 'Sorted _ + :--> PValue 'Sorted any0 + :--> PValue 'Sorted any1 :--> PValue 'Sorted 'NoGuarantees ) punionWithData = phoistAcyclic $ plam $ \combine x y -> pcon . PValue $ AssocMap.punionWith - # (plam $ \x y -> AssocMap.punionWithData # combine # x # y) + # plam (\x y -> AssocMap.punionWithData # combine # x # y) # pto x # pto y -- | Normalize the argument to contain no zero quantity nor empty token map. -pnormalize :: Term s (PValue 'Sorted _ :--> PValue 'Sorted 'NonZero) +pnormalize :: Term s (PValue 'Sorted any :--> PValue 'Sorted 'NonZero) pnormalize = phoistAcyclic $ plam $ \value -> pcon . PValue $ @@ -334,12 +456,12 @@ pnormalize = phoistAcyclic $ pif (intData #== zeroData) (pcon PNothing) (pcon $ PJust intData) -- | Assert the value is properly sorted and normalized. -passertSorted :: Term s (PValue _ _ :--> PValue 'Sorted 'NonZero) +passertSorted :: forall anyKey anyAmount s. Term s (PValue anyKey anyAmount :--> PValue 'Sorted 'NonZero) passertSorted = phoistAcyclic $ plam $ \value -> pif ( AssocMap.pany - # ( plam $ + # plam ( \submap -> AssocMap.pnull # (AssocMap.passertSorted # submap) #|| AssocMap.pany # plam (#== 0) # submap @@ -347,7 +469,9 @@ passertSorted = phoistAcyclic $ # pto value ) (ptraceError "Abnormal Value") - (pcon $ PValue $ AssocMap.passertSorted # pto value) + (let valueMap :: Term _ (PMap anyKey PCurrencySymbol (PMap 'Sorted PTokenName PInteger)) + = punsafeCoerce $ pto value + in pcon $ PValue $ AssocMap.passertSorted # valueMap) -- | Assert all amounts in the value are positive. passertPositive :: Term s (PValue 'Sorted 'NonZero :--> PValue 'Sorted 'Positive) @@ -355,7 +479,7 @@ passertPositive = phoistAcyclic $ plam $ \value -> pif ( AssocMap.pall - # (plam $ \submap -> AssocMap.pall # plam (0 #<) # submap) + # plam (\submap -> AssocMap.pall # plam (0 #<) # submap) # pto value ) (punsafeDowncast $ pto value) From 13547f4eca6ce5bb2a63a4ae3e56c85550bf2752 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 20 Jul 2022 12:45:01 +0530 Subject: [PATCH 570/584] Minor changes --- Plutarch/Api/V1/Value.hs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 6dc1c7cbf..fd8c03f2c 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -124,8 +124,12 @@ instance PEq (PValue 'Sorted 'NonZero) where Use 'pcheckBinRel' if 'AmountGuarantees' is 'NoGuarantees'. -} instance POrd (PValue 'Sorted 'Positive) where - a #< b = pforgetPositive @_ @'Sorted @'NonZero a #< pforgetPositive b - a #<= b = pforgetPositive @_ @'Sorted @'NonZero a #<= pforgetPositive b + a #< b = a' #< pforgetPositive b + where + a' = pforgetPositive a :: Term _ (PValue 'Sorted 'NonZero) + a #<= b = a' #<= pforgetPositive b + where + a' = pforgetPositive a :: Term _ (PValue 'Sorted 'NonZero) {- | Partial ordering implementation for sorted 'PValue' with 'NonZero' amounts. @@ -238,7 +242,7 @@ pcheckBinRel = phoistAcyclic $ # l2 ) l1 - in inner # pto (pto $ pto m1) # pto (pto $ pto m2) + in inner # (pto . pto $ pto m1) # (pto . pto $ pto m2) where dat0 :: ClosedTerm (PAsData PInteger) dat0 = pconstantData 0 @@ -456,22 +460,20 @@ pnormalize = phoistAcyclic $ pif (intData #== zeroData) (pcon PNothing) (pcon $ PJust intData) -- | Assert the value is properly sorted and normalized. -passertSorted :: forall anyKey anyAmount s. Term s (PValue anyKey anyAmount :--> PValue 'Sorted 'NonZero) +passertSorted :: Term s (PValue anyKey anyAmount :--> PValue 'Sorted 'NonZero) passertSorted = phoistAcyclic $ plam $ \value -> pif ( AssocMap.pany - # plam ( - \submap -> - AssocMap.pnull # (AssocMap.passertSorted # submap) - #|| AssocMap.pany # plam (#== 0) # submap + # plam + ( \submap -> + AssocMap.pnull # (AssocMap.passertSorted # submap) + #|| AssocMap.pany # plam (#== 0) # submap ) # pto value ) (ptraceError "Abnormal Value") - (let valueMap :: Term _ (PMap anyKey PCurrencySymbol (PMap 'Sorted PTokenName PInteger)) - = punsafeCoerce $ pto value - in pcon $ PValue $ AssocMap.passertSorted # valueMap) + . pcon . PValue $ AssocMap.passertSorted #$ punsafeCoerce $ pto value -- | Assert all amounts in the value are positive. passertPositive :: Term s (PValue 'Sorted 'NonZero :--> PValue 'Sorted 'Positive) From 4364bd0ad60bc8e854b71afe8d8d8864af308a23 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 20 Jul 2022 14:09:56 +0530 Subject: [PATCH 571/584] More CSE in `pcheckBinRel` --- Plutarch/Api/V1/AssocMap.hs | 56 ++++++++++++++++++ Plutarch/Api/V1/Value.hs | 115 ++++-------------------------------- 2 files changed, 69 insertions(+), 102 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index b7874a79c..c7e88ad0d 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -39,6 +39,9 @@ module Plutarch.Api.V1.AssocMap ( pdifference, punionWith, punionWithData, + + -- * Partial order operations + pcheckBinRel, ) where import qualified PlutusLedgerApi.V1 as Plutus @@ -60,6 +63,7 @@ import Plutarch.Lift ( ) import qualified Plutarch.List as List import Plutarch.Prelude hiding (pall, pany, pfilter, pmap, pnull, psingleton) +import qualified Plutarch.Prelude as PPrelude import Plutarch.Show (PShow) import Plutarch.Unsafe (punsafeCoerce, punsafeDowncast) import qualified PlutusCore as PLC @@ -454,3 +458,55 @@ pmapData = phoistAcyclic $ ) (const pnil) # pto map + +{- | Given a comparison function and a "zero" value, check whether a binary relation holds over +2 sorted 'PMap's. + +This is primarily intended to be used with 'PValue'. +-} +pcheckBinRel :: + forall k v s. + (POrd k, PIsData k, PIsData v) => + Term + s + ( (v :--> v :--> PBool) + :--> v + :--> PMap 'Sorted k v + :--> PMap 'Sorted k v + :--> PBool + ) +pcheckBinRel = phoistAcyclic $ + plam $ \f z m1 m2 -> + let inner = pfix #$ plam $ \self l1 l2 -> + pelimList + ( \x xs -> + plet (pfromData $ psndBuiltin # x) $ \v1 -> + pelimList + ( \y ys -> unTermCont $ do + v2 <- tcont . plet . pfromData $ psndBuiltin # y + k1 <- tcont . plet $ pfromData $ pfstBuiltin # x + k2 <- tcont . plet $ pfromData $ pfstBuiltin # y + pure $ + pif + (k1 #== k2) + ( f # v1 # v2 #&& self + # xs + # ys + ) + $ pif + (k1 #< k2) + (f # v1 # z #&& self # xs # l2) + $ f # z # v2 #&& self + # l1 + # ys + ) + ( f # v1 # z + #&& PPrelude.pall + # plam (\p -> f # pfromData (psndBuiltin # p) # z) + # xs + ) + l2 + ) + (PPrelude.pall # plam (\p -> f # z #$ pfromData $ psndBuiltin # p) # l2) + l1 + in inner # pto m1 # pto m2 diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index fd8c03f2c..97683c4df 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -138,10 +138,10 @@ Use 'pcheckBinRel' if 'AmountGuarantees' is 'NoGuarantees'. instance POrd (PValue 'Sorted 'NonZero) where a #< b = f # a # b where - f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (\x y -> pfromData x #< pfromData y) + f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (#<) a #<= b = f # a # b where - f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (\x y -> pfromData x #<= pfromData y) + f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (#<=) instance PEq (PValue 'Sorted 'NoGuarantees) where a #== b = AssocMap.pall # (AssocMap.pall # plam (#== 0)) # pto (punionWith # plam (-) # a # b) @@ -188,105 +188,6 @@ instance where inv a = punsafeCoerce $ PlutusTx.inv (punsafeCoerce a :: Term s (PValue 'Sorted 'NoGuarantees)) --- | Check whether a binary relation holds over 2 sorted 'PValue's. -pcheckBinRel :: - Term - s - ( (PAsData PInteger :--> PAsData PInteger :--> PBool) - :--> PValue 'Sorted any0 - :--> PValue 'Sorted any1 - :--> PBool - ) -pcheckBinRel = phoistAcyclic $ - plam $ \f m1 m2 -> - let inner = pfix #$ plam $ \self l1 l2 -> - pelimList - ( \x xs -> - pelimList - ( \y ys -> unTermCont $ do - v1dat <- tcont . plet $ psndBuiltin # x - v2dat <- tcont . plet $ psndBuiltin # y - k1 <- tcont . plet $ pfromData $ pfstBuiltin # x - k2 <- tcont . plet $ pfromData $ pfstBuiltin # y - pure $ - pif - (k1 #< k2) - (pinnerCheckBinRel # f # pfromData v1dat # AssocMap.pempty #&& self # xs # l2) - $ pif - (k1 #== k2) - ( pinnerCheckBinRel # f # pfromData v1dat # pfromData v2dat #&& self - # xs - # ys - ) - $ pinnerCheckBinRel # f # AssocMap.pempty # pfromData v2dat #&& self - # l1 - # ys - ) - ( pinnerCheckBinRel # f # pfromData (psndBuiltin # x) # AssocMap.pempty - #&& pall - # plam - ( \p -> - let v1dat = psndBuiltin # p - in pinnerCheckBinRel # f # pfromData v1dat # AssocMap.pempty - ) - # xs - ) - l2 - ) - ( pall - # plam - ( \p -> - let v1dat = psndBuiltin # p - in pinnerCheckBinRel # f # AssocMap.pempty # pfromData v1dat - ) - # l2 - ) - l1 - in inner # (pto . pto $ pto m1) # (pto . pto $ pto m2) - where - dat0 :: ClosedTerm (PAsData PInteger) - dat0 = pconstantData 0 - pinnerCheckBinRel :: - ClosedTerm - ( (PAsData PInteger :--> PAsData PInteger :--> PBool) - :--> ( PMap 'Sorted PTokenName PInteger - :--> (PMap 'Sorted PTokenName PInteger :--> PBool) - ) - ) - pinnerCheckBinRel = phoistAcyclic $ - plam $ \f m1 m2 -> - let inner = pfix #$ plam $ \self l1 l2 -> - pelimList - ( \x xs -> - let k1dat = pfstBuiltin # x - v1dat = psndBuiltin # x - in pelimList - ( \y ys -> - let k2dat = pfstBuiltin # y - v2dat = psndBuiltin # y - in unTermCont $ do - k1 <- tcont . plet $ pfromData k1dat - k2 <- tcont . plet $ pfromData k2dat - pure $ - pif - (k1 #< k2) - (f # v1dat # dat0 #&& self # xs # l2) - $ pif - (k1 #== k2) - (f # v1dat # v2dat #&& self # xs # ys) - $ f # dat0 # v2dat #&& self # l1 # ys - ) - ( f # v1dat # dat0 - #&& pall - # plam (\p -> f # (psndBuiltin # p) # dat0) - # xs - ) - l2 - ) - (pall # plam (\p -> f # dat0 #$ psndBuiltin # p) # l2) - l1 - in inner # pto m1 # pto m2 - -- | Construct a constant singleton 'PValue' containing only the given quantity of the given currency. pconstantSingleton :: ClosedTerm PCurrencySymbol -> @@ -473,7 +374,9 @@ passertSorted = phoistAcyclic $ # pto value ) (ptraceError "Abnormal Value") - . pcon . PValue $ AssocMap.passertSorted #$ punsafeCoerce $ pto value + . pcon + . PValue + $ AssocMap.passertSorted #$ punsafeCoerce $ pto value -- | Assert all amounts in the value are positive. passertPositive :: Term s (PValue 'Sorted 'NonZero :--> PValue 'Sorted 'Positive) @@ -502,3 +405,11 @@ zeroData = pdata 0 pmapAmounts :: Term s ((PInteger :--> PInteger) :--> PValue k a :--> PValue k 'NoGuarantees) pmapAmounts = phoistAcyclic $ plam $ \f v -> pcon $ PValue $ AssocMap.pmap # plam (AssocMap.pmap # f #) # pto v + +{- | Given an amount comparison function, check whether a binary relation holds over +2 sorted 'PValue's. +-} +pcheckBinRel :: Term s ((PInteger :--> PInteger :--> PBool) :--> PValue 'Sorted any0 :--> PValue 'Sorted any1 :--> PBool) +pcheckBinRel = phoistAcyclic $ + plam $ \f v1 v2 -> + AssocMap.pcheckBinRel # (AssocMap.pcheckBinRel # f # 0) # AssocMap.pempty # pto v1 # pto v2 From 96a58ef020826aeb331ae2e47bb3ae4739548e9f Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 20 Jul 2022 19:26:32 +0530 Subject: [PATCH 572/584] Eta reduction for `pcheckBinRel` --- Plutarch/Api/V1/AssocMap.hs | 4 ++-- Plutarch/Api/V1/Value.hs | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index c7e88ad0d..d8ea6761a 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -484,8 +484,8 @@ pcheckBinRel = phoistAcyclic $ pelimList ( \y ys -> unTermCont $ do v2 <- tcont . plet . pfromData $ psndBuiltin # y - k1 <- tcont . plet $ pfromData $ pfstBuiltin # x - k2 <- tcont . plet $ pfromData $ pfstBuiltin # y + k1 <- tcont . plet . pfromData $ pfstBuiltin # x + k2 <- tcont . plet . pfromData $ pfstBuiltin # y pure $ pif (k1 #== k2) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 97683c4df..914d724d5 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -411,5 +411,9 @@ pmapAmounts = phoistAcyclic $ -} pcheckBinRel :: Term s ((PInteger :--> PInteger :--> PBool) :--> PValue 'Sorted any0 :--> PValue 'Sorted any1 :--> PBool) pcheckBinRel = phoistAcyclic $ - plam $ \f v1 v2 -> - AssocMap.pcheckBinRel # (AssocMap.pcheckBinRel # f # 0) # AssocMap.pempty # pto v1 # pto v2 + plam $ \f -> + subReduction2 $ + AssocMap.pcheckBinRel # (AssocMap.pcheckBinRel # f # 0) # AssocMap.pempty + where + subReduction2 :: Term s (PInner a :--> PInner b :--> c) -> Term s (a :--> b :--> c) + subReduction2 = punsafeCoerce From ebc94bff30eb30effa60722a582c6ab0be7732f7 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Wed, 20 Jul 2022 20:06:21 +0530 Subject: [PATCH 573/584] Fix parens wrapping on prettifier Also add some more docs --- Plutarch/Pretty.hs | 38 +++++++++++++++---------------- Plutarch/Pretty/Internal/Types.hs | 29 +++++++++++++---------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/Plutarch/Pretty.hs b/Plutarch/Pretty.hs index 19b0261d5..70c708d9c 100644 --- a/Plutarch/Pretty.hs +++ b/Plutarch/Pretty.hs @@ -37,18 +37,16 @@ import Plutarch.Pretty.Internal.TermUtils ( pattern IfThenElseLikeAST, ) import Plutarch.Pretty.Internal.Types ( - PrettyCursor (AppliedOver, Applying, Normal, UnaryArg), + PrettyCursor (Normal, Special), PrettyMonad, PrettyState (PrettyState, ps'cursor, ps'nameMap), - appliedCursor, - applyingCursor, builtinFunAtRef, forkState, insertBindings, insertName, nameOfRef, normalizeCursor, - unaryCursor, + specializeCursor, ) -- | 'prettyTerm' for pre-compiled 'Script's. @@ -231,8 +229,6 @@ prettyUPLC uplc = runST $ do (doc, _) <- runReaderT (go uplc) stGen `runStateT` PrettyState mempty mempty Normal pure doc where - prettyUnaryParens unaryOp t = modify normalizeCursor *> go t <&> (\x -> unaryOp <> PP.parens x) - go :: Term DeBruijn DefaultUni DefaultFun () -> PrettyMonad s (PP.Doc ()) go (Constant _ c) = pure $ prettyConstant c go (Builtin _ b) = pure $ PP.pretty b @@ -250,28 +246,25 @@ prettyUPLC uplc = runST $ do Var () (DeBruijn (builtinFunAtRef ps'nameMap -> Just PLC.IfThenElse)) -> prettyIfThenElse (forkState . go) cond trueBranch falseBranch _ -> case ast of - Force _ t@Apply {} -> prettyUnaryParens "!" t + Force _ t@Apply {} -> modify specializeCursor *> go t <&> ("!" <>) _ -> error "impossible: IfThenElseLikeAST" - go (Force _ t@Apply {}) = prettyUnaryParens "!" t - go (Force _ t@LamAbs {}) = prettyUnaryParens "!" t - go (Force _ t) = modify unaryCursor *> go t <&> ("!" <>) - go (Delay _ t@Apply {}) = prettyUnaryParens "~" t - go (Delay _ t@LamAbs {}) = prettyUnaryParens "~" t - go (Delay _ t) = modify unaryCursor *> go t <&> ("~" <>) + go (Force _ t) = modify specializeCursor *> go t <&> ("!" <>) + go (Delay _ t) = modify specializeCursor *> go t <&> ("~" <>) go (LamAbs _ _ t') = do - currState <- get + currState@PrettyState {ps'cursor} <- get let (depth, bodyTerm) = unwrapLamAbs 0 t' names <- traverse (const freshVarName) [0 .. depth] -- Add all the new names to the nameMap, starting with 0 index. put $ insertBindings names currState modify' normalizeCursor funcBody <- forkState $ go bodyTerm - pure . PP.parens . PP.hang indentWidth $ + pure . parensOnCursor ps'cursor . PP.hang indentWidth $ PP.sep [ "\\" <> PP.hsep (reverse $ map PP.pretty names) <+> "->" , funcBody ] go (Apply _ (LamAbs _ _ t) firstArg) = do + PrettyState {ps'cursor} <- get let (restArgs, coreF) = unwrapBindings [] t helper (name, expr) = do modify' normalizeCursor @@ -290,7 +283,7 @@ prettyUPLC uplc = runST $ do modify' (insertName newName) $> PP.flatAlt PP.hardline "; " <> bindingDoc modify' normalizeCursor coreExprDoc <- go coreF - pure $ + pure . parensOnCursor ps'cursor $ PP.align $ PP.vsep [ "let" <+> PP.align (firstBindingDoc <> restBindingDoc) @@ -300,9 +293,9 @@ prettyUPLC uplc = runST $ do PrettyState {ps'cursor} <- get let (l, f) = unwrapApply [] t args = l <> [arg] - functionDoc <- forkState $ modify' applyingCursor *> go f - argsDoc <- modify' appliedCursor *> traverse (forkState . go) args - (if ps'cursor == AppliedOver then pure . PP.parens else pure) $ + functionDoc <- forkState $ modify' specializeCursor *> go f + argsDoc <- modify' specializeCursor *> traverse (forkState . go) args + pure . parensOnCursor ps'cursor $ PP.hang indentWidth $ PP.sep $ functionDoc : argsDoc prettyIfThenElse :: @@ -317,5 +310,10 @@ prettyIfThenElse cont cond trueBranch falseBranch = do condAst <- cont cond trueAst <- cont trueBranch falseAst <- cont falseBranch - (if ps'cursor `elem` [Applying, AppliedOver, UnaryArg] then pure . PP.parens else pure) $ + pure . parensOnCursor ps'cursor $ PP.hang indentWidth $ PP.vsep ["if" <+> condAst, "then" <+> trueAst, "else" <+> falseAst] + +-- | Wrap prettification result parens depending on cursor state. +parensOnCursor :: PrettyCursor -> PP.Doc ann -> PP.Doc ann +parensOnCursor cursor = do + if cursor == Special then PP.parens else id diff --git a/Plutarch/Pretty/Internal/Types.hs b/Plutarch/Pretty/Internal/Types.hs index b1f5a173d..e069849ae 100644 --- a/Plutarch/Pretty/Internal/Types.hs +++ b/Plutarch/Pretty/Internal/Types.hs @@ -4,9 +4,7 @@ module Plutarch.Pretty.Internal.Types ( PrettyMonad, forkState, normalizeCursor, - unaryCursor, - applyingCursor, - appliedCursor, + specializeCursor, memorizeName, insertName, insertBindings, @@ -31,7 +29,20 @@ import UntypedPlutusCore (DefaultFun, Index) import Plutarch.Pretty.Internal.Config (forcedPrefix) -data PrettyCursor = Normal | Applying | AppliedOver | UnaryArg +{- | Notifies the prettifier what "state" the cursor currently is, so it can decide +whether or not to wrap the target expression in parens. + +Normal indicates no parens wrapping is necessary, even for complex expressions. + +Special indicates complex expressions should be wrapped in parens. + +Usually, "Special" just hints at one of three states: + +1. Applying - The expression is being applied like a function. +2. Applied - The expression is being applied as a function argument. +3. Unary arg - The expression is being used as an argument to a high arity unary operator (~ and !). +-} +data PrettyCursor = Normal | Special deriving stock (Bounded, Enum, Eq, Show) data PrettyState = PrettyState @@ -48,14 +59,8 @@ forkState x = get >>= (\s -> x <* put s) normalizeCursor :: PrettyState -> PrettyState normalizeCursor x = x {ps'cursor = Normal} -unaryCursor :: PrettyState -> PrettyState -unaryCursor x = x {ps'cursor = UnaryArg} - -applyingCursor :: PrettyState -> PrettyState -applyingCursor x = x {ps'cursor = Applying} - -appliedCursor :: PrettyState -> PrettyState -appliedCursor x = x {ps'cursor = AppliedOver} +specializeCursor :: PrettyState -> PrettyState +specializeCursor x = x {ps'cursor = Special} memorizeName :: Text -> PrettyState -> PrettyState memorizeName n x@PrettyState {ps'names} = x {ps'names = Set.insert n ps'names} From a8564db5c6b1090fe001006b6531ca6f5eeef9ee Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 22 Jul 2022 17:27:26 +0530 Subject: [PATCH 574/584] Add `PPartialOrd` --- Plutarch/Bool.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 718a190b9..575632311 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -5,6 +5,7 @@ module Plutarch.Bool ( PBool (..), PEq (..), POrd (..), + PPartialOrd (..), pif, pif', pnot, @@ -86,6 +87,15 @@ class PEq t => POrd t where default (#<) :: (POrd (PInner t)) => Term s t -> Term s t -> Term s PBool x #< y = pto x #< pto y +-- | Partial ordering relation. +class PPartialOrd t where + pleq :: Term s t -> Term s t -> Term s PBool + default pleq :: (PPartialOrd (PInner t)) => Term s t -> Term s t -> Term s PBool + x `pleq` y = pto x `pleq` pto y + ple :: Term s t -> Term s t -> Term s PBool + default ple :: (PPartialOrd (PInner t)) => Term s t -> Term s t -> Term s PBool + x `ple` y = pto x `ple` pto y + infix 4 #<= infix 4 #< From 3852f3a7c4e9c72e1951a3bce530615633720392 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 22 Jul 2022 17:28:18 +0530 Subject: [PATCH 575/584] Remove `POrd` instance of PValue Add `PPartialOrd` instance instead --- Plutarch/Api/V1/Value.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 914d724d5..a03e19ac6 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -56,7 +56,7 @@ import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted, Unsorted), PMap) import qualified Plutarch.Api.V1.AssocMap as AssocMap -import Plutarch.Bool (pand', pif') +import Plutarch.Bool (PPartialOrd (ple, pleq), pand', pif') import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), @@ -123,11 +123,11 @@ instance PEq (PValue 'Sorted 'NonZero) where Use 'pcheckBinRel' if 'AmountGuarantees' is 'NoGuarantees'. -} -instance POrd (PValue 'Sorted 'Positive) where - a #< b = a' #< pforgetPositive b +instance PPartialOrd (PValue 'Sorted 'Positive) where + a `ple` b = a' `ple` pforgetPositive b where a' = pforgetPositive a :: Term _ (PValue 'Sorted 'NonZero) - a #<= b = a' #<= pforgetPositive b + a `pleq` b = a' `pleq` pforgetPositive b where a' = pforgetPositive a :: Term _ (PValue 'Sorted 'NonZero) @@ -135,11 +135,11 @@ instance POrd (PValue 'Sorted 'Positive) where Use 'pcheckBinRel' if 'AmountGuarantees' is 'NoGuarantees'. -} -instance POrd (PValue 'Sorted 'NonZero) where - a #< b = f # a # b +instance PPartialOrd (PValue 'Sorted 'NonZero) where + a `ple` b = f # a # b where f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (#<) - a #<= b = f # a # b + a `pleq` b = f # a # b where f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (#<=) From 410c1d2956ccb5c63eef57545cb09c6e295fa325 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 22 Jul 2022 17:29:49 +0530 Subject: [PATCH 576/584] Fixity declaration for `PPartialOrd` methods --- Plutarch/Bool.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 575632311..283b47dc5 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -87,6 +87,9 @@ class PEq t => POrd t where default (#<) :: (POrd (PInner t)) => Term s t -> Term s t -> Term s PBool x #< y = pto x #< pto y +infix 4 #<= +infix 4 #< + -- | Partial ordering relation. class PPartialOrd t where pleq :: Term s t -> Term s t -> Term s PBool @@ -96,8 +99,8 @@ class PPartialOrd t where default ple :: (PPartialOrd (PInner t)) => Term s t -> Term s t -> Term s PBool x `ple` y = pto x `ple` pto y -infix 4 #<= -infix 4 #< +infix 4 `pleq` +infix 4 `ple` instance PEq PBool where x #== y' = plet y' $ \y -> pif' # x # y #$ pnot # y From af335796938cfe3ecc826fff5fd1a491b3bfcb8a Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Tue, 26 Jul 2022 15:21:56 +0530 Subject: [PATCH 577/584] `PPartialOrd` and `POrd` rehaul --- Plutarch/Api/V1/Address.hs | 10 ++++---- Plutarch/Api/V1/Crypto.hs | 2 +- Plutarch/Api/V1/DCert.hs | 2 +- Plutarch/Api/V1/Interval.hs | 8 +++---- Plutarch/Api/V1/Maybe.hs | 4 +++- Plutarch/Api/V1/Scripts.hs | 12 +++++----- Plutarch/Api/V1/Time.hs | 2 +- Plutarch/Api/V1/Tx.hs | 4 ++-- Plutarch/Api/V1/Value.hs | 14 +++++------ Plutarch/Bool.hs | 22 +++++++----------- Plutarch/ByteString.hs | 6 +++-- Plutarch/DataRepr/Internal.hs | 23 +++++++++++++++---- Plutarch/Integer.hs | 6 +++-- Plutarch/Positive.hs | 4 ++-- Plutarch/Prelude.hs | 3 ++- Plutarch/Rational.hs | 6 +++-- Plutarch/Show.hs | 2 +- Plutarch/Unit.hs | 6 +++-- .../conditional/Plutarch/TryFromSpec.hs | 4 ++-- .../plutarch-base/Plutarch/POrdSpec.hs | 2 +- .../plutarch-base/Plutarch/SpecTypes.hs | 2 +- 21 files changed, 81 insertions(+), 63 deletions(-) diff --git a/Plutarch/Api/V1/Address.hs b/Plutarch/Api/V1/Address.hs index 19bb4363d..d64582905 100644 --- a/Plutarch/Api/V1/Address.hs +++ b/Plutarch/Api/V1/Address.hs @@ -27,8 +27,8 @@ data PCredential (s :: S) = PPubKeyCredential (Term s (PDataRecord '["_0" ':= PPubKeyHash])) | PScriptCredential (Term s (PDataRecord '["_0" ':= PValidatorHash])) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) -instance DerivePlutusType (PCredential) where type DPTStrat _ = PlutusTypeData + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) +instance DerivePlutusType PCredential where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PCredential where type PLifted PCredential = Plutus.Credential deriving via (DerivePConstantViaData Plutus.Credential PCredential) instance PConstantDecl Plutus.Credential @@ -46,7 +46,7 @@ data PStakingCredential (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PStakingCredential where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PStakingCredential where type PLifted PStakingCredential = Plutus.StakingCredential @@ -63,8 +63,8 @@ newtype PAddress (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) -instance DerivePlutusType (PAddress) where type DPTStrat _ = PlutusTypeData + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, PPartialOrd, POrd) +instance DerivePlutusType PAddress where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PAddress where type PLifted PAddress = Plutus.Address deriving via (DerivePConstantViaData Plutus.Address PAddress) instance PConstantDecl Plutus.Address diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index 6c9b9d772..c24100502 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -21,7 +21,7 @@ import Plutarch.Prelude newtype PPubKeyHash (s :: S) = PPubKeyHash (Term s PByteString) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PPubKeyHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PPubKeyHash where type PLifted PPubKeyHash = Plutus.PubKeyHash diff --git a/Plutarch/Api/V1/DCert.hs b/Plutarch/Api/V1/DCert.hs index 099832e9a..e293ca536 100644 --- a/Plutarch/Api/V1/DCert.hs +++ b/Plutarch/Api/V1/DCert.hs @@ -40,7 +40,7 @@ data PDCert (s :: S) | PDCertGenesis (Term s (PDataRecord '[])) | PDCertMir (Term s (PDataRecord '[])) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PDCert where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PDCert where type PLifted PDCert = Plutus.DCert diff --git a/Plutarch/Api/V1/Interval.hs b/Plutarch/Api/V1/Interval.hs index ae7e66086..2a80bb309 100644 --- a/Plutarch/Api/V1/Interval.hs +++ b/Plutarch/Api/V1/Interval.hs @@ -35,7 +35,7 @@ newtype PInterval a (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, PPartialOrd, POrd) instance DerivePlutusType (PInterval a) where type DPTStrat _ = PlutusTypeData instance @@ -60,7 +60,7 @@ newtype PLowerBound a (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, PPartialOrd, POrd) instance DerivePlutusType (PLowerBound a) where type DPTStrat _ = PlutusTypeData instance @@ -85,7 +85,7 @@ newtype PUpperBound a (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, PPartialOrd, POrd) instance DerivePlutusType (PUpperBound a) where type DPTStrat _ = PlutusTypeData data PExtended a (s :: S) @@ -93,7 +93,7 @@ data PExtended a (s :: S) | PFinite (Term s (PDataRecord '["_0" ':= a])) | PPosInf (Term s (PDataRecord '[])) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType (PExtended a) where type DPTStrat _ = PlutusTypeData instance diff --git a/Plutarch/Api/V1/Maybe.hs b/Plutarch/Api/V1/Maybe.hs index 33d4810a8..10040849a 100644 --- a/Plutarch/Api/V1/Maybe.hs +++ b/Plutarch/Api/V1/Maybe.hs @@ -34,10 +34,12 @@ deriving via PConstantData a => PConstantDecl (Maybe a) -- Have to manually write this instance because the constructor id ordering is screwed for 'Maybe'.... -instance (PIsData a, POrd a) => POrd (PMaybeData a) where +instance (PIsData a, POrd a) => PPartialOrd (PMaybeData a) where x #< y = _pmaybeLT False (#<) # x # y x #<= y = _pmaybeLT True (#<=) # x # y +instance (PIsData a, POrd a) => POrd (PMaybeData a) + _pmaybeLT :: Bool -> ( forall s rec. diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index c392afe99..94bd701c5 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -41,7 +41,7 @@ deriving via (DerivePConstantViaBuiltin Plutus.Redeemer PRedeemer PData) instanc newtype PDatumHash (s :: S) = PDatumHash (Term s PByteString) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PDatumHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PDatumHash where type PLifted PDatumHash = Plutus.DatumHash @@ -49,7 +49,7 @@ deriving via (DerivePConstantViaBuiltin Plutus.DatumHash PDatumHash PByteString) newtype PStakeValidatorHash (s :: S) = PStakeValidatorHash (Term s PByteString) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PStakeValidatorHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PStakeValidatorHash where type PLifted PStakeValidatorHash = Plutus.StakeValidatorHash @@ -60,7 +60,7 @@ deriving via newtype PRedeemerHash (s :: S) = PRedeemerHash (Term s PByteString) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PRedeemerHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PRedeemerHash where type PLifted PRedeemerHash = Plutus.RedeemerHash @@ -71,7 +71,7 @@ deriving via newtype PValidatorHash (s :: S) = PValidatorHash (Term s PByteString) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PValidatorHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PValidatorHash where type PLifted PValidatorHash = Plutus.ValidatorHash @@ -82,7 +82,7 @@ deriving via newtype PMintingPolicyHash (s :: S) = PMintingPolicyHash (Term s PByteString) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PMintingPolicyHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PMintingPolicyHash where type PLifted PMintingPolicyHash = Plutus.MintingPolicyHash @@ -93,7 +93,7 @@ deriving via newtype PScriptHash (s :: S) = PScriptHash (Term s PByteString) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PScriptHash where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PScriptHash where type PLifted PScriptHash = Plutus.ScriptHash diff --git a/Plutarch/Api/V1/Time.hs b/Plutarch/Api/V1/Time.hs index b538582b5..65c0b6d2f 100644 --- a/Plutarch/Api/V1/Time.hs +++ b/Plutarch/Api/V1/Time.hs @@ -21,7 +21,7 @@ import Plutarch.Prelude newtype PPOSIXTime (s :: S) = PPOSIXTime (Term s PInteger) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd, PIntegral, PNum) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd, PIntegral, PNum) instance DerivePlutusType PPOSIXTime where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PPOSIXTime where type PLifted PPOSIXTime = Plutus.POSIXTime diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index ad6d199bf..bf287229c 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -32,7 +32,7 @@ import Plutarch.Prelude newtype PTxId (s :: S) = PTxId (Term s (PDataRecord '["_0" ':= PByteString])) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, PPartialOrd, POrd) instance DerivePlutusType PTxId where type DPTStrat _ = PlutusTypeData instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId @@ -50,7 +50,7 @@ newtype PTxOutRef (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PDataFields, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PDataFields, PEq, PPartialOrd, POrd) instance DerivePlutusType PTxOutRef where type DPTStrat _ = PlutusTypeData diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index a03e19ac6..da9bf9505 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -56,7 +56,7 @@ import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted, Unsorted), PMap) import qualified Plutarch.Api.V1.AssocMap as AssocMap -import Plutarch.Bool (PPartialOrd (ple, pleq), pand', pif') +import Plutarch.Bool (pand', pif') import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), @@ -73,7 +73,7 @@ import Plutarch.Prelude hiding (psingleton) newtype PTokenName (s :: S) = PTokenName (Term s PByteString) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PTokenName where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PTokenName where type PLifted PTokenName = Plutus.TokenName @@ -84,7 +84,7 @@ deriving via newtype PCurrencySymbol (s :: S) = PCurrencySymbol (Term s PByteString) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PCurrencySymbol where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PCurrencySymbol where type PLifted PCurrencySymbol = Plutus.CurrencySymbol @@ -124,10 +124,10 @@ instance PEq (PValue 'Sorted 'NonZero) where Use 'pcheckBinRel' if 'AmountGuarantees' is 'NoGuarantees'. -} instance PPartialOrd (PValue 'Sorted 'Positive) where - a `ple` b = a' `ple` pforgetPositive b + a #< b = a' #< pforgetPositive b where a' = pforgetPositive a :: Term _ (PValue 'Sorted 'NonZero) - a `pleq` b = a' `pleq` pforgetPositive b + a #<= b = a' #<= pforgetPositive b where a' = pforgetPositive a :: Term _ (PValue 'Sorted 'NonZero) @@ -136,10 +136,10 @@ instance PPartialOrd (PValue 'Sorted 'Positive) where Use 'pcheckBinRel' if 'AmountGuarantees' is 'NoGuarantees'. -} instance PPartialOrd (PValue 'Sorted 'NonZero) where - a `ple` b = f # a # b + a #< b = f # a # b where f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (#<) - a `pleq` b = f # a # b + a #<= b = f # a # b where f = phoistAcyclic $ pcheckBinRel #$ phoistAcyclic $ plam (#<=) diff --git a/Plutarch/Bool.hs b/Plutarch/Bool.hs index 283b47dc5..7ca06bb79 100644 --- a/Plutarch/Bool.hs +++ b/Plutarch/Bool.hs @@ -4,8 +4,8 @@ module Plutarch.Bool ( PBool (..), PEq (..), - POrd (..), PPartialOrd (..), + POrd, pif, pif', pnot, @@ -79,7 +79,8 @@ class PEq t where infix 4 #== -class PEq t => POrd t where +-- | Partial ordering relation. +class PEq t => PPartialOrd t where (#<=) :: Term s t -> Term s t -> Term s PBool default (#<=) :: (POrd (PInner t)) => Term s t -> Term s t -> Term s PBool x #<= y = pto x #<= pto y @@ -90,25 +91,18 @@ class PEq t => POrd t where infix 4 #<= infix 4 #< --- | Partial ordering relation. -class PPartialOrd t where - pleq :: Term s t -> Term s t -> Term s PBool - default pleq :: (PPartialOrd (PInner t)) => Term s t -> Term s t -> Term s PBool - x `pleq` y = pto x `pleq` pto y - ple :: Term s t -> Term s t -> Term s PBool - default ple :: (PPartialOrd (PInner t)) => Term s t -> Term s t -> Term s PBool - x `ple` y = pto x `ple` pto y - -infix 4 `pleq` -infix 4 `ple` +-- | Total ordering relation. +class PPartialOrd t => POrd t instance PEq PBool where x #== y' = plet y' $ \y -> pif' # x # y #$ pnot # y -instance POrd PBool where +instance PPartialOrd PBool where x #< y = pif' # x # pconstant False # y x #<= y = pif' # x # y # pconstant True +instance POrd PBool + {- | Strict version of 'pif'. Emits slightly less code. -} diff --git a/Plutarch/ByteString.hs b/Plutarch/ByteString.hs index d0b369a8d..4cc00d678 100644 --- a/Plutarch/ByteString.hs +++ b/Plutarch/ByteString.hs @@ -18,7 +18,7 @@ import Data.Char (toLower) import Data.Word (Word8) import GHC.Generics (Generic) import GHC.Stack (HasCallStack) -import Plutarch.Bool (PEq, POrd, (#<), (#<=), (#==)) +import Plutarch.Bool (PEq, POrd, PPartialOrd, (#<), (#<=), (#==)) import Plutarch.Integer (PInteger) import Plutarch.Internal (Term, (:-->)) import Plutarch.Internal.Newtype (PlutusTypeNewtype) @@ -48,10 +48,12 @@ deriving via (DerivePConstantDirect ByteString PByteString) instance PConstantDe instance PEq PByteString where x #== y = punsafeBuiltin PLC.EqualsByteString # x # y -instance POrd PByteString where +instance PPartialOrd PByteString where x #<= y = punsafeBuiltin PLC.LessThanEqualsByteString # x # y x #< y = punsafeBuiltin PLC.LessThanByteString # x # y +instance POrd PByteString + instance Semigroup (Term s PByteString) where x <> y = punsafeBuiltin PLC.AppendByteString # x # y diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 77c93c025..89f1542fb 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -74,7 +74,7 @@ import Plutarch ( (#$), type (:-->), ) -import Plutarch.Bool (PBool, PEq, POrd, pif, (#<), (#<=), (#==)) +import Plutarch.Bool (PBool, PEq, POrd, PPartialOrd, pif, (#<), (#<=), (#==)) import Plutarch.Builtin ( PAsData, PBuiltinList, @@ -168,11 +168,13 @@ instance PEq (PDataRecord xs) where -- Lexicographic ordering based 'Ord' instances for 'PDataRecord'. -instance POrd (PDataRecord '[]) where +instance PPartialOrd (PDataRecord '[]) where _ #<= _ = pconstant True _ #< _ = pconstant False -instance (POrd x, PIsData x) => POrd (PDataRecord '[label ':= x]) where +instance POrd (PDataRecord '[]) + +instance (POrd x, PIsData x) => PPartialOrd (PDataRecord '[label ':= x]) where l1 #< l2 = unTermCont $ do PDCons x _ <- tcont $ pmatch l1 PDCons y _ <- tcont $ pmatch l2 @@ -185,7 +187,12 @@ instance (POrd x, PIsData x) => POrd (PDataRecord '[label ':= x]) where pure $ pfromData x #<= pfromData y -instance (SListI xs, POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd (PDataRecord ((label ':= x) ': x' ': xs)) where +instance (POrd x, PIsData x) => POrd (PDataRecord '[label ':= x]) + +instance + (SListI xs, POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => + PPartialOrd (PDataRecord ((label ':= x) ': x' ': xs)) + where l1 #< l2 = unTermCont $ do PDCons x xs <- tcont $ pmatch l1 PDCons y ys <- tcont $ pmatch l2 @@ -204,6 +211,10 @@ instance (SListI xs, POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => POrd ( pure $ pif (a #< b) (pconstant True) $ pif (a #== b) (xs #<= ys) $ pconstant False +instance + (SListI xs, POrd x, PIsData x, POrd (PDataRecord (x' ': xs))) => + POrd (PDataRecord ((label ':= x) ': x' ': xs)) + {- | Cons a field to a data record. You can specify the label to associate with the field using type applications- @@ -318,7 +329,7 @@ instance PIsData (PDataSum defs) where instance PEq (PDataSum defs) where x #== y = pdata x #== pdata y -instance All (Compose POrd PDataRecord) defs => POrd (PDataSum defs) where +instance All (Compose POrd PDataRecord) defs => PPartialOrd (PDataSum defs) where x' #< y' = f # x' # y' where f :: Term s (PDataSum defs :--> PDataSum defs :--> PBool) @@ -328,6 +339,8 @@ instance All (Compose POrd PDataRecord) defs => POrd (PDataSum defs) where f :: Term s (PDataSum defs :--> PDataSum defs :--> PBool) f = phoistAcyclic $ plam $ \x y -> pmatchLT x y mkLTEHandler +instance All (Compose POrd PDataRecord) defs => POrd (PDataSum defs) + -- | If there is only a single variant, then we can safely extract it. punDataSum :: Term s (PDataSum '[def] :--> PDataRecord def) punDataSum = phoistAcyclic $ diff --git a/Plutarch/Integer.hs b/Plutarch/Integer.hs index 2e3a69048..10aeaec1e 100644 --- a/Plutarch/Integer.hs +++ b/Plutarch/Integer.hs @@ -5,7 +5,7 @@ module Plutarch.Integer (PInteger, PIntegral (..)) where import GHC.Generics (Generic) -import Plutarch.Bool (PEq, POrd, pif, (#<), (#<=), (#==)) +import Plutarch.Bool (PEq, POrd, PPartialOrd, pif, (#<), (#<=), (#==)) import Plutarch.Internal ( Term, phoistAcyclic, @@ -59,10 +59,12 @@ instance PIntegral PInteger where instance PEq PInteger where x #== y = punsafeBuiltin PLC.EqualsInteger # x # y -instance POrd PInteger where +instance PPartialOrd PInteger where x #<= y = punsafeBuiltin PLC.LessThanEqualsInteger # x # y x #< y = punsafeBuiltin PLC.LessThanInteger # x # y +instance POrd PInteger + instance PNum PInteger where x #+ y = punsafeBuiltin PLC.AddInteger # x # y x #- y = punsafeBuiltin PLC.SubtractInteger # x # y diff --git a/Plutarch/Positive.hs b/Plutarch/Positive.hs index dd5ac1b45..45e96367b 100644 --- a/Plutarch/Positive.hs +++ b/Plutarch/Positive.hs @@ -6,7 +6,7 @@ module Plutarch.Positive (PPositive, ppositive, ptryPositive) where import Data.Functor.Const (Const) import GHC.Generics (Generic) -import Plutarch.Bool (PEq, POrd, pif, (#<=)) +import Plutarch.Bool (PEq, POrd, PPartialOrd, pif, (#<=)) import Plutarch.Builtin (PAsData, PData, PIsData, pdata) import Plutarch.Integer (PInteger, PIntegral) @@ -36,7 +36,7 @@ import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom'), ptryFrom) newtype PPositive s = PPositive (Term s PInteger) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd, PIntegral, PShow) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd, PIntegral, PShow) instance DerivePlutusType PPositive where type DPTStrat _ = PlutusTypeNewtype instance PNum PPositive where diff --git a/Plutarch/Prelude.hs b/Plutarch/Prelude.hs index eb88d4c89..ad2cba234 100644 --- a/Plutarch/Prelude.hs +++ b/Plutarch/Prelude.hs @@ -45,7 +45,8 @@ module Plutarch.Prelude ( -- * Booleans and boolean functions PBool (..), PEq ((#==)), - POrd ((#<=), (#<)), + PPartialOrd ((#<=), (#<)), + POrd, pif, pnot, (#&&), diff --git a/Plutarch/Rational.hs b/Plutarch/Rational.hs index 1b48e9501..2531d90a0 100644 --- a/Plutarch/Rational.hs +++ b/Plutarch/Rational.hs @@ -34,7 +34,7 @@ import Plutarch ( (#$), type (:-->), ) -import Plutarch.Bool (PEq, POrd, pif, (#<), (#<=), (#==)) +import Plutarch.Bool (PEq, POrd, PPartialOrd, pif, (#<), (#<=), (#==)) import Plutarch.Builtin ( PAsData, PBuiltinList, @@ -131,7 +131,7 @@ instance PTryFrom PData (PAsData PRational) where res <- tcont . plet $ ptryPositive # denm pure (punsafeCoerce opq, res) -instance POrd PRational where +instance PPartialOrd PRational where l' #<= r' = phoistAcyclic ( plam $ \l r -> unTermCont $ do @@ -152,6 +152,8 @@ instance POrd PRational where # l' # r' +instance POrd PRational + instance PNum PRational where x' #+ y' = phoistAcyclic diff --git a/Plutarch/Show.hs b/Plutarch/Show.hs index b95da7297..68aa6ff6e 100644 --- a/Plutarch/Show.hs +++ b/Plutarch/Show.hs @@ -26,7 +26,7 @@ import Generics.SOP ( hmap, ) import Generics.SOP.GGP (gdatatypeInfo) -import Plutarch.Bool (PBool, PEq ((#==)), POrd ((#<)), pif) +import Plutarch.Bool (PBool, PEq, pif, (#<), (#==)) import Plutarch.ByteString (PByteString, pconsBS, pindexBS, plengthBS, psliceBS) import Plutarch.Integer (PInteger, PIntegral (pquot, prem)) import Plutarch.Internal ( diff --git a/Plutarch/Unit.hs b/Plutarch/Unit.hs index bb2b7b5c6..26a1e1892 100644 --- a/Plutarch/Unit.hs +++ b/Plutarch/Unit.hs @@ -5,7 +5,7 @@ module Plutarch.Unit (PUnit (..)) where import Plutarch (Term, pcon, plet) -import Plutarch.Bool (PBool (PFalse, PTrue), PEq, POrd, (#<), (#<=), (#==)) +import Plutarch.Bool (PBool (PFalse, PTrue), PEq, POrd, PPartialOrd, (#<), (#<=), (#==)) import Plutarch.Internal.PlutusType (PInner, PlutusType, pcon', pmatch') import Plutarch.Lift ( DerivePConstantDirect (DerivePConstantDirect), @@ -29,10 +29,12 @@ instance PlutusType PUnit where instance PEq PUnit where x #== y = plet x \_ -> plet y \_ -> pcon PTrue -instance POrd PUnit where +instance PPartialOrd PUnit where x #<= y = plet x \_ -> plet y \_ -> pcon PTrue x #< y = plet x \_ -> plet y \_ -> pcon PFalse +instance POrd PUnit + instance Semigroup (Term s PUnit) where x <> y = plet x \_ -> plet y \_ -> pcon PUnit diff --git a/plutarch-test/conditional/Plutarch/TryFromSpec.hs b/plutarch-test/conditional/Plutarch/TryFromSpec.hs index 3dd68cfe4..a70ca8fac 100644 --- a/plutarch-test/conditional/Plutarch/TryFromSpec.hs +++ b/plutarch-test/conditional/Plutarch/TryFromSpec.hs @@ -300,7 +300,7 @@ fullCheck = unTermCont $ fst <$> TermCont (ptryFrom $ pforgetData sampleStructur newtype PNatural (s :: S) = PMkNatural (Term s PInteger) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PNatural where type DPTStrat _ = PlutusTypeNewtype -- | partial @@ -440,6 +440,6 @@ theField = unTermCont $ do newtype PWrapInt (s :: S) = PWrapInt (Term s PInteger) deriving stock (Generic) - deriving anyclass (PlutusType, PEq, POrd) + deriving anyclass (PlutusType, PEq, PPartialOrd, POrd) instance DerivePlutusType PWrapInt where type DPTStrat _ = PlutusTypeNewtype instance PTryFrom PData (PAsData PWrapInt) diff --git a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs index 03f8a57ac..7414b6e28 100644 --- a/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/POrdSpec.hs @@ -130,7 +130,7 @@ peqIso a b = plift (pconstant @p a #== pconstant b) `shouldBe` (a == b) newtype PAddress' s = PAddress' (Term s PAddress) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) instance DerivePlutusType PAddress' where type DPTStrat _ = PlutusTypeNewtype instance PUnsafeLiftDecl PAddress' where type PLifted PAddress' = Address' diff --git a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs index 41a9cd503..bb4d83970 100644 --- a/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs +++ b/plutarch-test/plutarch-base/Plutarch/SpecTypes.hs @@ -37,7 +37,7 @@ newtype PTriplet (a :: PType) (s :: S) ) ) deriving stock (Generic) - deriving anyclass (PlutusType, PIsData, PEq, POrd, PDataFields) + deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd, PDataFields) instance DerivePlutusType (PTriplet a) where type DPTStrat _ = PlutusTypeData From 0ecac889c8cfc3e5440af3d70ea5a6fc8fe846e3 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 29 Jul 2022 00:48:39 +0530 Subject: [PATCH 578/584] Fix some `PValue` type sigs --- Plutarch/Api/V1/Value.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 84033304e..92b41196c 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -457,11 +457,11 @@ passertNonZero = plam $ \val -> PNil -> pcon PTrue -- | Forget the knowledge of value's positivity. -pforgetPositive :: Term s (PValue 'Sorted 'Positive) -> Term s (PValue k a) +pforgetPositive :: Term s (PValue k 'Positive) -> Term s (PValue k a) pforgetPositive = punsafeCoerce -- | Forget the knowledge of all value's guarantees. -pforgetSorted :: Term s (PValue 'Sorted a) -> Term s (PValue k b) +pforgetSorted :: Term s (PValue 'Sorted a) -> Term s (PValue k a) pforgetSorted = punsafeCoerce zeroData :: ClosedTerm (PAsData PInteger) From 3180ae4b5b3accf47eee879cc3f603ddd3ff3cec Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 29 Jul 2022 00:56:47 +0530 Subject: [PATCH 579/584] `ptryFrom` error convention --- Plutarch/Api/V1/Crypto.hs | 2 +- Plutarch/Api/V1/Scripts.hs | 2 +- Plutarch/Api/V1/Time.hs | 2 +- Plutarch/Api/V1/Tx.hs | 4 +-- Plutarch/Api/V1/Value.hs | 4 +-- Plutarch/DataRepr/Internal.hs | 2 +- plutarch-test/goldens/data-verif.bench.golden | 28 +++++++++---------- plutarch-test/goldens/data-verif.uplc.golden | 28 +++++++++---------- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index 08f184389..9d15c9f23 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -39,7 +39,7 @@ instance PTryFrom PData (PAsData PPubKeyHash) where ptryFrom' opq = runTermCont $ do unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) opq snd tcont $ \f -> - pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "a PubKeyHash must be 28 bytes long") + pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "ptryFrom(PPubKeyHash): must be 28 bytes long") pure (punsafeCoerce opq, pcon . PPubKeyHash $ unwrapped) newtype PubKey = PubKey {getPubKey :: Plutus.LedgerBytes} diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index 05ef5d4c6..2917083d9 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -89,7 +89,7 @@ instance PTryFrom PData (PAsData PValidatorHash) where ptryFrom' opq = runTermCont $ do unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) opq snd tcont $ \f -> - pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "a ValidatorHash must be 28 bytes long") + pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "ptryFrom(PValidatorHash): must be 28 bytes long") pure (punsafeCoerce opq, pcon . PValidatorHash $ unwrapped) newtype PMintingPolicyHash (s :: S) = PMintingPolicyHash (Term s PByteString) diff --git a/Plutarch/Api/V1/Time.hs b/Plutarch/Api/V1/Time.hs index 03d21d736..f8be9fe47 100644 --- a/Plutarch/Api/V1/Time.hs +++ b/Plutarch/Api/V1/Time.hs @@ -41,5 +41,5 @@ instance PTryFrom PData (PAsData PPOSIXTime) where ptryFrom' opq = runTermCont $ do (wrapped :: Term _ (PAsData PInteger), unwrapped :: Term _ PInteger) <- tcont $ ptryFrom @(PAsData PInteger) opq - tcont $ \f -> pif (0 #<= unwrapped) (f ()) (ptraceError "POSIXTime must always be positive") + tcont $ \f -> pif (0 #<= unwrapped) (f ()) (ptraceError "ptryFrom(POSIXTime): must be positive") pure (punsafeCoerce wrapped, pcon $ PPOSIXTime unwrapped) diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 7cdf62c95..69a476ffc 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -55,10 +55,10 @@ instance PTryFrom PData (PAsData PTxId) where pif (pfstBuiltin # opq' #== 0 #&& plength # (psndBuiltin # opq') #== 1) (f $ phead #$ psndBuiltin # opq') - (ptraceError "bad TxId constructor") + (ptraceError "ptryFrom(TxId): bad constructor") unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) dataBs snd tcont $ \f -> - pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "a TxId must be 28 bytes long") + pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "ptryFrom(TxId): must be 28 bytes long") pure (punsafeCoerce opq, pcon . PTxId $ pdcons # pdata unwrapped # pdnil) -- | Reference to a transaction output with a index referencing which of the outputs is being referred to. diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 92b41196c..123d9ea2b 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -90,7 +90,7 @@ instance PTryFrom PData (PAsData PTokenName) where ptryFrom' opq = runTermCont $ do unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) opq snd tcont $ \f -> - pif (plengthBS # unwrapped #<= 32) (f ()) (ptraceError "a TokenName must be at most 32 Bytes long") + pif (plengthBS # unwrapped #<= 32) (f ()) (ptraceError "ptryFrom(TokenName): must be at most 32 Bytes long") pure (punsafeCoerce opq, pcon . PTokenName $ unwrapped) newtype PCurrencySymbol (s :: S) = PCurrencySymbol (Term s PByteString) @@ -104,7 +104,7 @@ instance PTryFrom PData (PAsData PCurrencySymbol) where unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) opq snd len <- tcont . plet $ plengthBS # unwrapped tcont $ \f -> - pif (len #== 0 #|| len #== 28) (f ()) (ptraceError "a CurrencySymbol must be 28 bytes long or empty") + pif (len #== 0 #|| len #== 28) (f ()) (ptraceError "ptryFrom(CurrencySymbol): must be 28 bytes long or empty") pure (punsafeCoerce opq, pcon . PCurrencySymbol $ unwrapped) instance PUnsafeLiftDecl PCurrencySymbol where type PLifted PCurrencySymbol = Plutus.CurrencySymbol diff --git a/Plutarch/DataRepr/Internal.hs b/Plutarch/DataRepr/Internal.hs index 89f1542fb..48ceff01d 100644 --- a/Plutarch/DataRepr/Internal.hs +++ b/Plutarch/DataRepr/Internal.hs @@ -600,7 +600,7 @@ instance PTryFrom (PBuiltinList PData) (PDataRecord '[]) where ptryFrom' opq = runTermCont $ do _ <- tcont . plet . pforce $ - pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "list is longer than zero") + pchooseListBuiltin # opq # pdelay (pcon PUnit) # pdelay (ptraceError "ptryFrom(PDataRecord[]): list is longer than zero") pure (pdnil, HRecGeneric HNil) type family UnHRecP (x :: PType) :: [(Symbol, PType)] where diff --git a/plutarch-test/goldens/data-verif.bench.golden b/plutarch-test/goldens/data-verif.bench.golden index ef7ed6d26..a4bf20d66 100644 --- a/plutarch-test/goldens/data-verif.bench.golden +++ b/plutarch-test/goldens/data-verif.bench.golden @@ -1,8 +1,8 @@ erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":911716,"exBudgetMemory":612,"scriptSizeBytes":123} erroneous.[String] /= [Integer] {"exBudgetCPU":467623,"exBudgetMemory":388,"scriptSizeBytes":101} -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":304406,"exBudgetMemory":356,"scriptSizeBytes":128} -erroneous.PDataSum constr 2 {"exBudgetCPU":700994,"exBudgetMemory":230,"scriptSizeBytes":197} -erroneous.PDataSum wrong record type {"exBudgetCPU":990483,"exBudgetMemory":232,"scriptSizeBytes":256} +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } {"exBudgetCPU":304406,"exBudgetMemory":356,"scriptSizeBytes":153} +erroneous.PDataSum constr 2 {"exBudgetCPU":700994,"exBudgetMemory":230,"scriptSizeBytes":222} +erroneous.PDataSum wrong record type {"exBudgetCPU":990483,"exBudgetMemory":232,"scriptSizeBytes":282} erroneous.[ByteString] (with length == 2) /= PRational {"exBudgetCPU":1682971,"exBudgetMemory":486,"scriptSizeBytes":210} erroneous.[Integer] (with length == 0) /= PRational {"exBudgetCPU":125996,"exBudgetMemory":196,"scriptSizeBytes":172} erroneous.[Integer] (with length == 3) /= PRational {"exBudgetCPU":1872200,"exBudgetMemory":422,"scriptSizeBytes":217} @@ -10,25 +10,25 @@ erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational {"exBudg working.(String, String) == (String, String) {"exBudgetCPU":4806613,"exBudgetMemory":14428,"scriptSizeBytes":123} working.[String] == [String] {"exBudgetCPU":4994603,"exBudgetMemory":16904,"scriptSizeBytes":114} working.[Integer] (with length == 2) == PRational {"exBudgetCPU":7549502,"exBudgetMemory":19484,"scriptSizeBytes":355} -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} -working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":122} -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":128} -working.PDataSum constr 0 {"exBudgetCPU":3276445,"exBudgetMemory":10722,"scriptSizeBytes":256} -working.PDataSum constr 1 {"exBudgetCPU":3841934,"exBudgetMemory":11924,"scriptSizeBytes":256} +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":147} +working.A { test := Integer, test2 := Integer } == [Integer] {"exBudgetCPU":2950183,"exBudgetMemory":9876,"scriptSizeBytes":147} +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":153} +working.PDataSum constr 0 {"exBudgetCPU":3276445,"exBudgetMemory":10722,"scriptSizeBytes":282} +working.PDataSum constr 1 {"exBudgetCPU":3841934,"exBudgetMemory":11924,"scriptSizeBytes":282} working.recover PWrapInt {"exBudgetCPU":460390,"exBudgetMemory":1065,"scriptSizeBytes":15} -recovering a record partially vs completely.partially {"exBudgetCPU":2860826,"exBudgetMemory":9644,"scriptSizeBytes":124} -recovering a record partially vs completely.completely {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":128} +recovering a record partially vs completely.partially {"exBudgetCPU":2860826,"exBudgetMemory":9644,"scriptSizeBytes":149} +recovering a record partially vs completely.completely {"exBudgetCPU":3007046,"exBudgetMemory":10176,"scriptSizeBytes":153} removing the data wrapper.erroneous.(String, Integer) /= (String, String) {"exBudgetCPU":899579,"exBudgetMemory":612,"scriptSizeBytes":117} removing the data wrapper.erroneous.[String] /= [Integer] {"exBudgetCPU":479760,"exBudgetMemory":388,"scriptSizeBytes":114} removing the data wrapper.working.(String, String) == (String, String) {"exBudgetCPU":4806613,"exBudgetMemory":14428,"scriptSizeBytes":123} removing the data wrapper.working.[String] == [String] {"exBudgetCPU":4994603,"exBudgetMemory":16904,"scriptSizeBytes":114} removing the data wrapper.partial checks.check whole structure {"exBudgetCPU":167380333,"exBudgetMemory":531268,"scriptSizeBytes":1524} removing the data wrapper.partial checks.check structure partly {"exBudgetCPU":44823600,"exBudgetMemory":145544,"scriptSizeBytes":1494} -removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":3700361,"exBudgetMemory":12008,"scriptSizeBytes":142} -removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":419232,"exBudgetMemory":420,"scriptSizeBytes":142} -removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":3442374,"exBudgetMemory":10849,"scriptSizeBytes":132} +removing the data wrapper.recovering a nested record.succeeds {"exBudgetCPU":3700361,"exBudgetMemory":12008,"scriptSizeBytes":167} +removing the data wrapper.recovering a nested record.fails {"exBudgetCPU":419232,"exBudgetMemory":420,"scriptSizeBytes":167} +removing the data wrapper.recovering a nested record.sample usage contains the right value {"exBudgetCPU":3442374,"exBudgetMemory":10849,"scriptSizeBytes":157} example.concatenate two lists, legal {"exBudgetCPU":40490231,"exBudgetMemory":108115,"scriptSizeBytes":893} example.concatenate two lists, illegal (list too short) {"exBudgetCPU":34624552,"exBudgetMemory":84921,"scriptSizeBytes":886} example.concatenate two lists, illegal (wrong elements in list) {"exBudgetCPU":40012573,"exBudgetMemory":105147,"scriptSizeBytes":893} example.concatenate two lists, illegal (more than one output) {"exBudgetCPU":26315696,"exBudgetMemory":63576,"scriptSizeBytes":914} -example2.recovering a record succeeds {"exBudgetCPU":4617699,"exBudgetMemory":14942,"scriptSizeBytes":341} \ No newline at end of file +example2.recovering a record succeeds {"exBudgetCPU":4617699,"exBudgetMemory":14942,"scriptSizeBytes":366} \ No newline at end of file diff --git a/plutarch-test/goldens/data-verif.uplc.golden b/plutarch-test/goldens/data-verif.uplc.golden index 136707e12..a76911a68 100644 --- a/plutarch-test/goldens/data-verif.uplc.golden +++ b/plutarch-test/goldens/data-verif.uplc.golden @@ -1,8 +1,8 @@ erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unIData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i3 (iData 3) (i2 (iData 4)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i2 (iData 3) (i1 (iData 4))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i8) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay (force (i12 "list is longer than zero" (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i4)) (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) -erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unBData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87b9f0543666f6fff)) +erroneous.A { test := Integer, test2 := Integer } /= { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "ptryFrom(PDataRecord[]): list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +erroneous.PDataSum constr 2 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i8) (force (force ifThenElse (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (force (force chooseList) i1 (delay ()) (delay (force (i12 "ptryFrom(PDataRecord[]): list is longer than zero" (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (i6 i3)) (unIData i1)) (i5 i1))) (delay (force (i6 "reached end of sum while still not having found the constructor" (delay error))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i4)) (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) +erroneous.PDataSum wrong record type (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unBData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "ptryFrom(PDataRecord[]): list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87b9f0543666f6fff)) erroneous.[ByteString] (with length == 2) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 (equalsData (listData (i5 i1)) (listData i9)) (delay ((\i0 -> (\i0 -> listData (i9 (bData i8) (i9 (bData i10) i11))) (force (i4 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList i1)))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (i4 i1)) (unListData (listData (i5 (bData i4) (i5 (bData i6) i7))))) (force ifThenElse)) (force trace)) (force tailList)) #41) (force mkCons)) #2b) [ ])) erroneous.[Integer] (with length == 0) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 (equalsData (listData (i5 i1)) (listData i6)) (delay ((\i0 -> (\i0 -> listData i8) (force (i4 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList i1)))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (i4 i1)) (unListData (listData i4))) (force ifThenElse)) (force trace)) (force tailList)) [ ])) erroneous.[Integer] (with length == 3) /= PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 (equalsData (listData (i5 i1)) (listData i10)) (delay ((\i0 -> (\i0 -> listData (i10 i8 (i10 i9 (i10 i11 i12)))) (force (i4 (lessThanEqualsInteger i1 0) (delay (force (i5 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (force headList i1)))) (delay (force (i4 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (i4 i1)) (unListData (listData (i6 i4 (i6 i5 (i6 i7 i8)))))) (force ifThenElse)) (force trace)) (force tailList)) #182a) #07) (force mkCons)) #00) [ ])) @@ -10,25 +10,25 @@ erroneous.[Integer] (with length == 2, with 0 denominator) /= PRational (program working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) working.[Integer] (with length == 2) == PRational (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i3 (equalsData (listData (i6 i1)) (listData i10)) (delay ((\i0 -> (\i0 -> force (i5 (equalsInteger i1 (unIData i11)) (delay (force (i5 ((\i0 -> \i0 -> i2 (\i0 -> \i0 -> i3 (\i0 -> \i0 -> equalsInteger (multiplyInteger i1 i4) (multiplyInteger i2 i3)))) ((\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> i1 i3 i2) (unIData (i9 (i11 i2)))) (unIData (i8 i1))) (unListData i1)) (listData (i10 i9 (i10 i11 i12)))) ((\i0 -> \i0 -> i1 i2 i3) (unIData i9))) (delay ()) (delay (force (i7 "drat should be as expected" (delay error))))))) (delay (force (i7 "non-zero should be as expected" (delay error)))))) (force (i4 (lessThanEqualsInteger i1 0) (delay (force (i6 "ptryPositive: building with non positive" (delay error)))) (delay i1)))) (unIData (i4 i1)))) (delay (force (i5 "ptryFrom(PRational): data list length should be 2" (delay error)))))) (i5 i1)) (unListData (listData (i6 i5 (i6 i7 i8))))) (force ifThenElse)) (force headList)) (force trace)) (force tailList)) #182a) (force mkCons)) #181f) [ ])) -working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) -working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) -working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d8799f0543666f6fff)) -working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) +working.A { test := Integer, test2 := Integer } == { test := Integer, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "ptryFrom(PDataRecord[]): list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := Integer, test2 := Integer } == [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 7) (i11 (iData 42) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "ptryFrom(PDataRecord[]): list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 7) (i3 (iData 42) i4))))) (force tailList)) (force headList)) (force mkCons)) [ ])) +working.A { test := String, test2 := Integer } == { test := String, test2 := Integer } (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i12 (bData i11) (i12 (iData 42) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "ptryFrom(PDataRecord[]): list is longer than zero" (delay error))))))) (i7 i3)) (unIData i1)) (i6 i1)) (i4 i3)) (unBData i1)) (i3 i1)) (unListData (listData (i4 (bData i3) (i4 (iData 42) i5))))) (force tailList)) (force headList)) #62617a) (force mkCons)) [ ])) +working.PDataSum constr 0 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "ptryFrom(PDataRecord[]): list is longer than zero") (force tailList)) (force headList)) (force trace)) #d8799f0543666f6fff)) +working.PDataSum constr 1 (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i11) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i11 i1 (delay ()) (delay (force (i15 i12 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData i7)) (force ifThenElse)) (force (force chooseList))) "ptryFrom(PDataRecord[]): list is longer than zero") (force tailList)) (force headList)) (force trace)) #d87a9f0543666f6fff)) working.recover PWrapInt (program 1.0.0 (equalsInteger 42 (unIData (iData 42)))) -recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (iData 3) (i10 (bData i11) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i6 i2)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) -recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 3) (i11 (bData i12) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "list is longer than zero" (delay error))))))) (i7 i3)) (unBData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.partially (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i10 (iData 3) (i10 (bData i11) i12))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "ptryFrom(PDataRecord[]): list is longer than zero" (delay error))))))) (i6 i2)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) +recovering a record partially vs completely.completely (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i11 (iData 3) (i11 (bData i12) i13))) (force (force (force chooseList) i1 (delay ()) (delay (force (force trace "ptryFrom(PDataRecord[]): list is longer than zero" (delay error))))))) (i7 i3)) (unBData i1)) (i6 i1)) (i4 i3)) (unIData i1)) (i3 i1)) (unListData (listData (i3 (iData 3) (i3 (bData i4) i5))))) (force tailList)) (force headList)) (force mkCons)) #62617a) [ ])) removing the data wrapper.erroneous.(String, Integer) /= (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (iData 42) (bData i9))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (iData 42) (bData i7))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #626172)) removing the data wrapper.erroneous.[String] /= [Integer] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #62617a)) removing the data wrapper.working.(String, String) == (String, String) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i4 (mkPairData (bData i9) (bData i10))) (mkPairData ((\i0 -> i5 i2) (unBData (i4 i1))) ((\i0 -> i7 i2) (unBData (i6 i1))))) ((\i0 -> (\i0 -> mkPairData (i3 i1) (i3 (force tailList i1))) (i6 (unConstrData i1))) (i2 (mkPairData (bData i7) (bData i8))))) (force headList)) (\i0 -> constrData 0 (i3 (i2 i1) (i3 (i4 i1) i5)))) (force (force fstPair))) (force mkCons)) (force (force sndPair))) [ ]) #666f6f) #626172)) removing the data wrapper.working.[String] == [String] (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i4 (bData i2) (i3 (bData i6)))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i7) (delay (i6 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unBData i1)) (unListData (listData (i3 (bData i1) (i2 (bData i5))))))) #666f6f) (\i0 -> i2 i1 i3)) (force mkCons)) [ ]) #626172)) removing the data wrapper.partial checks.check whole structure (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i7 (listData (i7 (listData (i8 (iData 1) (i8 (iData 2) (i8 (iData 3) (i8 (iData 4) (i8 (iData 5) (i8 (iData 6) (i8 (iData 7) (i8 (iData 8) (i8 (iData 9) (i8 (iData 10) (i8 (iData 11) (i8 (iData 12) (i8 (iData 13) (i8 (iData 14) (i8 (iData 15) (i8 (iData 16) (i8 (iData 17) (i8 (iData 18) (i8 (iData 19) (i8 (iData 20) (i8 (iData 21) (i8 (iData 22) (i8 (iData 23) (i8 (iData 24) (i8 (iData 25) (i8 (iData 26) (i8 (iData 27) (i8 (iData 28) (i8 (iData 29) (i8 (iData 30) (i8 (iData 31) (i8 (iData 32) (i8 (iData 33) (i8 (iData 34) (i8 (iData 35) (i8 (iData 36) (i8 (iData 37) (i8 (iData 38) (i8 (iData 39) (i8 (iData 40) (i8 (iData 41) (i8 (iData 42) (i8 (iData 43) (i8 (iData 44) (i8 (iData 45) (i8 (iData 46) (i8 (iData 47) (i8 (iData 48) (i8 (iData 49) (i8 (iData 50) (i8 (iData 51) (i8 (iData 52) (i8 (iData 53) (i8 (iData 54) (i8 (iData 55) (i8 (iData 56) (i8 (iData 57) (i8 (iData 58) (i8 (iData 59) (i8 (iData 60) (i8 (iData 61) (i8 (iData 62) (i8 (iData 63) (i8 (iData 64) (i8 (iData 65) (i8 (iData 66) (i8 (iData 67) (i8 (iData 68) (i8 (iData 69) (i8 (iData 70) (i8 (iData 71) (i8 (iData 72) (i8 (iData 73) (i8 (iData 74) (i8 (iData 75) (i8 (iData 76) (i8 (iData 77) (i8 (iData 78) (i8 (iData 79) (i8 (iData 80) (i8 (iData 81) (i8 (iData 82) (i8 (iData 83) (i8 (iData 84) (i8 (iData 85) (i8 (iData 86) (i8 (iData 87) (i8 (iData 88) (i8 (iData 89) (i8 (iData 90) (i8 (iData 91) (i8 (iData 92) (i8 (iData 93) (i8 (iData 94) (i8 (iData 95) (i8 (iData 96) (i8 (iData 97) (i8 (iData 98) (i8 (iData 99) (i8 (iData 100) i9))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (i1 (\i0 -> (\i0 -> i2) (i2 (\i0 -> (\i0 -> i2) (i3 (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (unListData i1))) (unListData (listData (i6 (listData (i6 (listData (i7 (iData 1) (i7 (iData 2) (i7 (iData 3) (i7 (iData 4) (i7 (iData 5) (i7 (iData 6) (i7 (iData 7) (i7 (iData 8) (i7 (iData 9) (i7 (iData 10) (i7 (iData 11) (i7 (iData 12) (i7 (iData 13) (i7 (iData 14) (i7 (iData 15) (i7 (iData 16) (i7 (iData 17) (i7 (iData 18) (i7 (iData 19) (i7 (iData 20) (i7 (iData 21) (i7 (iData 22) (i7 (iData 23) (i7 (iData 24) (i7 (iData 25) (i7 (iData 26) (i7 (iData 27) (i7 (iData 28) (i7 (iData 29) (i7 (iData 30) (i7 (iData 31) (i7 (iData 32) (i7 (iData 33) (i7 (iData 34) (i7 (iData 35) (i7 (iData 36) (i7 (iData 37) (i7 (iData 38) (i7 (iData 39) (i7 (iData 40) (i7 (iData 41) (i7 (iData 42) (i7 (iData 43) (i7 (iData 44) (i7 (iData 45) (i7 (iData 46) (i7 (iData 47) (i7 (iData 48) (i7 (iData 49) (i7 (iData 50) (i7 (iData 51) (i7 (iData 52) (i7 (iData 53) (i7 (iData 54) (i7 (iData 55) (i7 (iData 56) (i7 (iData 57) (i7 (iData 58) (i7 (iData 59) (i7 (iData 60) (i7 (iData 61) (i7 (iData 62) (i7 (iData 63) (i7 (iData 64) (i7 (iData 65) (i7 (iData 66) (i7 (iData 67) (i7 (iData 68) (i7 (iData 69) (i7 (iData 70) (i7 (iData 71) (i7 (iData 72) (i7 (iData 73) (i7 (iData 74) (i7 (iData 75) (i7 (iData 76) (i7 (iData 77) (i7 (iData 78) (i7 (iData 79) (i7 (iData 80) (i7 (iData 81) (i7 (iData 82) (i7 (iData 83) (i7 (iData 84) (i7 (iData 85) (i7 (iData 86) (i7 (iData 87) (i7 (iData 88) (i7 (iData 89) (i7 (iData 90) (i7 (iData 91) (i7 (iData 92) (i7 (iData 93) (i7 (iData 94) (i7 (iData 95) (i7 (iData 96) (i7 (iData 97) (i7 (iData 98) (i7 (iData 99) (i7 (iData 100) i8)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 (\i0 -> \i0 -> force (i5 i1 (delay i10) (delay (i9 (i3 (i6 i1)) (i2 (i7 i1)))))))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) removing the data wrapper.partial checks.check structure partly (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i2 (listData (i2 (listData (i3 (iData 1) (i3 (iData 2) (i3 (iData 3) (i3 (iData 4) (i3 (iData 5) (i3 (iData 6) (i3 (iData 7) (i3 (iData 8) (i3 (iData 9) (i3 (iData 10) (i3 (iData 11) (i3 (iData 12) (i3 (iData 13) (i3 (iData 14) (i3 (iData 15) (i3 (iData 16) (i3 (iData 17) (i3 (iData 18) (i3 (iData 19) (i3 (iData 20) (i3 (iData 21) (i3 (iData 22) (i3 (iData 23) (i3 (iData 24) (i3 (iData 25) (i3 (iData 26) (i3 (iData 27) (i3 (iData 28) (i3 (iData 29) (i3 (iData 30) (i3 (iData 31) (i3 (iData 32) (i3 (iData 33) (i3 (iData 34) (i3 (iData 35) (i3 (iData 36) (i3 (iData 37) (i3 (iData 38) (i3 (iData 39) (i3 (iData 40) (i3 (iData 41) (i3 (iData 42) (i3 (iData 43) (i3 (iData 44) (i3 (iData 45) (i3 (iData 46) (i3 (iData 47) (i3 (iData 48) (i3 (iData 49) (i3 (iData 50) (i3 (iData 51) (i3 (iData 52) (i3 (iData 53) (i3 (iData 54) (i3 (iData 55) (i3 (iData 56) (i3 (iData 57) (i3 (iData 58) (i3 (iData 59) (i3 (iData 60) (i3 (iData 61) (i3 (iData 62) (i3 (iData 63) (i3 (iData 64) (i3 (iData 65) (i3 (iData 66) (i3 (iData 67) (i3 (iData 68) (i3 (iData 69) (i3 (iData 70) (i3 (iData 71) (i3 (iData 72) (i3 (iData 73) (i3 (iData 74) (i3 (iData 75) (i3 (iData 76) (i3 (iData 77) (i3 (iData 78) (i3 (iData 79) (i3 (iData 80) (i3 (iData 81) (i3 (iData 82) (i3 (iData 83) (i3 (iData 84) (i3 (iData 85) (i3 (iData 86) (i3 (iData 87) (i3 (iData 88) (i3 (iData 89) (i3 (iData 90) (i3 (iData 91) (i3 (iData 92) (i3 (iData 93) (i3 (iData 94) (i3 (iData 95) (i3 (iData 96) (i3 (iData 97) (i3 (iData 98) (i3 (iData 99) (i3 (iData 100) i4))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (force (force chooseList) i1 (delay i6) (delay (i5 (i3 (force headList i1)) (i2 (force tailList i1))))))) (\i0 -> (\i0 -> i2) (unListData i1)) (unListData (listData (i1 (listData (i1 (listData (i2 (iData 1) (i2 (iData 2) (i2 (iData 3) (i2 (iData 4) (i2 (iData 5) (i2 (iData 6) (i2 (iData 7) (i2 (iData 8) (i2 (iData 9) (i2 (iData 10) (i2 (iData 11) (i2 (iData 12) (i2 (iData 13) (i2 (iData 14) (i2 (iData 15) (i2 (iData 16) (i2 (iData 17) (i2 (iData 18) (i2 (iData 19) (i2 (iData 20) (i2 (iData 21) (i2 (iData 22) (i2 (iData 23) (i2 (iData 24) (i2 (iData 25) (i2 (iData 26) (i2 (iData 27) (i2 (iData 28) (i2 (iData 29) (i2 (iData 30) (i2 (iData 31) (i2 (iData 32) (i2 (iData 33) (i2 (iData 34) (i2 (iData 35) (i2 (iData 36) (i2 (iData 37) (i2 (iData 38) (i2 (iData 39) (i2 (iData 40) (i2 (iData 41) (i2 (iData 42) (i2 (iData 43) (i2 (iData 44) (i2 (iData 45) (i2 (iData 46) (i2 (iData 47) (i2 (iData 48) (i2 (iData 49) (i2 (iData 50) (i2 (iData 51) (i2 (iData 52) (i2 (iData 53) (i2 (iData 54) (i2 (iData 55) (i2 (iData 56) (i2 (iData 57) (i2 (iData 58) (i2 (iData 59) (i2 (iData 60) (i2 (iData 61) (i2 (iData 62) (i2 (iData 63) (i2 (iData 64) (i2 (iData 65) (i2 (iData 66) (i2 (iData 67) (i2 (iData 68) (i2 (iData 69) (i2 (iData 70) (i2 (iData 71) (i2 (iData 72) (i2 (iData 73) (i2 (iData 74) (i2 (iData 75) (i2 (iData 76) (i2 (iData 77) (i2 (iData 78) (i2 (iData 79) (i2 (iData 80) (i2 (iData 81) (i2 (iData 82) (i2 (iData 83) (i2 (iData 84) (i2 (iData 85) (i2 (iData 86) (i2 (iData 87) (i2 (iData 88) (i2 (iData 89) (i2 (iData 90) (i2 (iData 91) (i2 (iData 92) (i2 (iData 93) (i2 (iData 94) (i2 (iData 95) (i2 (iData 96) (i2 (iData 97) (i2 (iData 98) (i2 (iData 99) (i2 (iData 100) i3)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (\i0 -> i2 i1 i3)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i15 (listData (i15 (iData 42) i16)) i16)) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unIData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force trace)) "list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i15 (listData (i15 (iData 42) i16)) i16)) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force trace)) "list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) -removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unIData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7))))) (force (force chooseList))) (force trace)) "list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i15 (listData (i15 (iData 42) i16)) i16)) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unIData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force trace)) "ptryFrom(PDataRecord[]): list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.fails (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> listData (i15 (listData (i15 (iData 42) i16)) i16)) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unBData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7)))) (force (force chooseList))) (force trace)) "ptryFrom(PDataRecord[]): list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) +removing the data wrapper.recovering a nested record.sample usage contains the right value (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> equalsInteger 42 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> i5) (force (i9 i1 (delay ()) (delay (force (i10 i11 (delay error))))))) (i11 i7)) (force (i7 i1 (delay ()) (delay (force (i8 i9 (delay error))))))) (i9 i3)) (unIData i1)) (i8 i1)) (unListData i1)) (i6 i1)) (unListData (listData (i6 (listData (i6 (iData 42) i7)) i7))))) (force (force chooseList))) (force trace)) "ptryFrom(PDataRecord[]): list is longer than zero") (force tailList)) (force headList)) (force mkCons)) [ ])) example.concatenate two lists, legal (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (equalsInteger 1 i2) (delay (i14 (\i0 -> \i0 -> \i0 -> force (i18 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i21 (i2 (i19 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i19 i1))) (delay (i3 i2 (i20 i1)))))))) (\i0 -> (\i0 -> \i0 -> equalsData (listData (i15 i2)) (listData (i15 i1))) (i17 i2) (i17 (i13 i1))) ((\i0 -> unListData (i17 (i13 i1))) (i16 i4)))) (delay (force (i19 i11 (delay error)))))) (i12 i2)) (i8 i1)) (unConstrData (i13 (i14 i1)))) (i8 i3) (\i0 -> (\i0 -> force (i16 (force (i16 (force nullList (i15 ((\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i22) (delay ((\i0 -> force (i20 (i4 i1) (delay (i22 i1 (i3 (i19 i2)))) (delay (i3 (i19 i2))))) (i17 i1)))))) (\i0 -> equalsData (i15 (i11 i1)) (i15 i2)) (unListData (i14 (i15 (i10 i3))))))) (delay (equalsData (i14 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i20 "iteration" (delay (force (i19 (equalsByteString (unBData (i17 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 i15 (delay error)))))) (i16 i2)) (i12 i1)) (unConstrData (i17 (i18 (i18 i4)))))) (delay (force (i20 "appended something" (delay i21)) (i17 (i18 i1)) (i3 (i18 i2)))) (delay (force (i20 "called without appending" (delay i3)) (i18 i2)))))))) (i12 (i16 i1)))))) (unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i16 (i16 i1)))))))) (i10 i3)))))) (listData ((\i0 -> \i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay i3) (delay (i22 (i18 i1) (i2 (i19 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i17 "not valid" (delay error)))))) (i9 (i13 (i14 (i9 i1))))) (delay (force (i15 i7 (delay error))))) (i11 (i7 i2))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i18) (delay (i17 (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i14 (lessThanInteger i1 0) (delay (force (i15 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) "Pattern matching failure in TermCont") (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) example.concatenate two lists, illegal (list too short) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (equalsInteger 1 i2) (delay (i14 (\i0 -> \i0 -> \i0 -> force (i18 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i21 (i2 (i19 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i19 i1))) (delay (i3 i2 (i20 i1)))))))) (\i0 -> (\i0 -> \i0 -> equalsData (listData (i15 i2)) (listData (i15 i1))) (i17 i2) (i17 (i13 i1))) ((\i0 -> unListData (i17 (i13 i1))) (i16 i4)))) (delay (force (i19 i11 (delay error)))))) (i12 i2)) (i8 i1)) (unConstrData (i13 (i14 i1)))) (i8 i3) (\i0 -> (\i0 -> force (i16 (force (i16 (force nullList (i15 ((\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i22) (delay ((\i0 -> force (i20 (i4 i1) (delay (i22 i1 (i3 (i19 i2)))) (delay (i3 (i19 i2))))) (i17 i1)))))) (\i0 -> equalsData (i15 (i11 i1)) (i15 i2)) (unListData (i14 (i15 (i10 i3))))))) (delay (equalsData (i14 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i20 "iteration" (delay (force (i19 (equalsByteString (unBData (i17 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 i15 (delay error)))))) (i16 i2)) (i12 i1)) (unConstrData (i17 (i18 (i18 i4)))))) (delay (force (i20 "appended something" (delay i21)) (i17 (i18 i1)) (i3 (i18 i2)))) (delay (force (i20 "called without appending" (delay i3)) (i18 i2)))))))) (i12 (i16 i1)))))) (unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i16 (i16 i1)))))))) (i10 i3)))))) (listData ((\i0 -> \i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay i3) (delay (i22 (i18 i1) (i2 (i19 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i17 "not valid" (delay error)))))) (i9 (i13 (i14 (i9 i1))))) (delay (force (i15 i7 (delay error))))) (i11 (i7 i2))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i18) (delay (i17 (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i14 (lessThanInteger i1 0) (delay (force (i15 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) i12))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) "Pattern matching failure in TermCont") (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) example.concatenate two lists, illegal (wrong elements in list) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (equalsInteger 1 i2) (delay (i14 (\i0 -> \i0 -> \i0 -> force (i18 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i21 (i2 (i19 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i19 i1))) (delay (i3 i2 (i20 i1)))))))) (\i0 -> (\i0 -> \i0 -> equalsData (listData (i15 i2)) (listData (i15 i1))) (i17 i2) (i17 (i13 i1))) ((\i0 -> unListData (i17 (i13 i1))) (i16 i4)))) (delay (force (i19 i11 (delay error)))))) (i12 i2)) (i8 i1)) (unConstrData (i13 (i14 i1)))) (i8 i3) (\i0 -> (\i0 -> force (i16 (force (i16 (force nullList (i15 ((\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i22) (delay ((\i0 -> force (i20 (i4 i1) (delay (i22 i1 (i3 (i19 i2)))) (delay (i3 (i19 i2))))) (i17 i1)))))) (\i0 -> equalsData (i15 (i11 i1)) (i15 i2)) (unListData (i14 (i15 (i10 i3))))))) (delay (equalsData (i14 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i20 "iteration" (delay (force (i19 (equalsByteString (unBData (i17 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 i15 (delay error)))))) (i16 i2)) (i12 i1)) (unConstrData (i17 (i18 (i18 i4)))))) (delay (force (i20 "appended something" (delay i21)) (i17 (i18 i1)) (i3 (i18 i2)))) (delay (force (i20 "called without appending" (delay i3)) (i18 i2)))))))) (i12 (i16 i1)))))) (unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i16 (i16 i1)))))))) (i10 i3)))))) (listData ((\i0 -> \i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay i3) (delay (i22 (i18 i1) (i2 (i19 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i17 "not valid" (delay error)))))) (i9 (i13 (i14 (i9 i1))))) (delay (force (i15 i7 (delay error))))) (i11 (i7 i2))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i18) (delay (i17 (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i14 (lessThanInteger i1 0) (delay (force (i15 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 8) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) "Pattern matching failure in TermCont") (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) example.concatenate two lists, illegal (more than one output) (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> \i0 -> \i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> force (i18 (equalsInteger 1 i2) (delay (i14 (\i0 -> \i0 -> \i0 -> force (i18 i1 (delay (\i0 -> \i0 -> force i1)) (delay (force (i21 (i2 (i19 i1)) (delay ((\i0 -> \i0 -> \i0 -> i2 i3) (i19 i1))) (delay (i3 i2 (i20 i1)))))))) (\i0 -> (\i0 -> \i0 -> equalsData (listData (i15 i2)) (listData (i15 i1))) (i17 i2) (i17 (i13 i1))) ((\i0 -> unListData (i17 (i13 i1))) (i16 i4)))) (delay (force (i19 i11 (delay error)))))) (i12 i2)) (i8 i1)) (unConstrData (i13 (i14 i1)))) (i8 i3) (\i0 -> (\i0 -> force (i16 (force (i16 (force nullList (i15 ((\i0 -> i13 (\i0 -> \i0 -> force (i16 i1 (delay i22) (delay ((\i0 -> force (i20 (i4 i1) (delay (i22 i1 (i3 (i19 i2)))) (delay (i3 (i19 i2))))) (i17 i1)))))) (\i0 -> equalsData (i15 (i11 i1)) (i15 i2)) (unListData (i14 (i15 (i10 i3))))))) (delay (equalsData (i14 (i12 (\i0 -> \i0 -> force (i15 i1 (delay i21) (delay ((\i0 -> force (i20 "iteration" (delay (force (i19 (equalsByteString (unBData (i17 i1)) ((\i0 -> (\i0 -> (\i0 -> force (i22 (equalsInteger 0 i2) (delay (unBData (i20 i1))) (delay (force (i23 i15 (delay error)))))) (i16 i2)) (i12 i1)) (unConstrData (i17 (i18 (i18 i4)))))) (delay (force (i20 "appended something" (delay i21)) (i17 (i18 i1)) (i3 (i18 i2)))) (delay (force (i20 "called without appending" (delay i3)) (i18 i2)))))))) (i12 (i16 i1)))))) (unListData (i14 ((\i0 -> i16 (i16 (i16 (i16 (i16 (i16 (i16 (i16 i1)))))))) (i10 i3)))))) (listData ((\i0 -> \i0 -> i14 (\i0 -> \i0 -> force (i17 i1 (delay i3) (delay (i22 (i18 i1) (i2 (i19 i1)))))) i2) (unListData i7) i4)))) (delay False))) (delay ()) (delay (force (i17 "not valid" (delay error)))))) (i9 (i13 (i14 (i9 i1))))) (delay (force (i15 i7 (delay error))))) (i11 (i7 i2))) ((\i0 -> i9 (\i0 -> \i0 -> force (i12 i1 (delay i18) (delay (i17 (i3 (i13 i1)) (i2 (i14 i1))))))) (\i0 -> (\i0 -> (\i0 -> i3) (force (i14 (lessThanInteger i1 0) (delay (force (i15 "could not make natural" (delay error)))) (delay i1)))) (unIData i1)) (unListData i2))) (listData (i11 (iData 1) (i11 (iData 2) (i11 (iData 3) (i11 (iData 4) (i11 (iData 5) i12)))))) (listData (i11 (iData 6) (i11 (iData 7) (i11 (iData 8) (i11 (iData 9) (i11 (iData 10) i12)))))) #d8799fd8799f9fd8799fd8799fd8799f41a0ff00ffd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffffff9fd8799fd8799fd87a9f41a1ffd87a80ffa0d8799f41d0ffffd8799fd8799fd87a9f41a1ffd87a80ffa0d87a80ffffa0a141c0a149736f6d65746f6b656e018080d8799fd8799fd87980d87a80ffd8799fd87b80d87a80ffff9f45ab01fe235c4312301443abcdefff9fd8799f41d09f0102030405060708090affffffd8799f41b0ffffd87a9fd8799fd8799f41a0ff00ffffff) (force (force fstPair))) "Pattern matching failure in TermCont") (\i0 -> i2 (unConstrData i1))) (force (force sndPair))) (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1)))) (force (force chooseList))) (force headList)) (force tailList)) (force ifThenElse)) (force trace)) (force mkCons)) [ ])) -example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i11 (iData 4) (i11 (bData i12) i13))) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i12 i1 (delay ()) (delay (force (i15 i11 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i12 i1 (delay ()) (delay (force (i15 i11 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i10 i1 (delay i16) (delay (i14 (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData (constrData 0 (i7 (iData 4) (i7 (bData i8) i9))))) (force ifThenElse)) "list is longer than zero") (force (force chooseList))) (force tailList)) (force headList)) (force trace)) (force mkCons)) #666f6f) [ ])) \ No newline at end of file +example2.recovering a record succeeds (program 1.0.0 ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> constrData 0 (i11 (iData 4) (i11 (bData i12) i13))) (force (i4 (equalsInteger 0 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i12 i1 (delay ()) (delay (force (i15 i11 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) (unIData i1)) (i8 i1))) (delay (force (i4 (equalsInteger 1 i2) (delay ((\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> (\i0 -> ()) (force (i12 i1 (delay ()) (delay (force (i15 i11 (delay error))))))) (i12 i3)) (unBData i1)) (i11 i1)) (i9 i3)) ((\i0 -> (\i0 -> (\i0 -> i2 (\i0 -> i2 i2 i1)) (\i0 -> i2 (\i0 -> i2 i2 i1))) (\i0 -> \i0 -> force (i10 i1 (delay i16) (delay (i14 (i3 (i12 i1)) (i2 (i11 i1))))))) (\i0 -> (\i0 -> i2) (unIData i1)) (unListData i1))) (i8 i1))) (delay (force (i9 "reached end of sum while still not having found the constructor" (delay error)))))))))) (force (force sndPair) i2)) (force (force fstPair) i1)) (unConstrData (constrData 0 (i7 (iData 4) (i7 (bData i8) i9))))) (force ifThenElse)) "ptryFrom(PDataRecord[]): list is longer than zero") (force (force chooseList))) (force tailList)) (force headList)) (force trace)) (force mkCons)) #666f6f) [ ])) \ No newline at end of file From d67e1ce66caf3dbc1b2e2ed0b5d52797a281acec Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Fri, 29 Jul 2022 01:02:17 +0530 Subject: [PATCH 580/584] Fix test suite compilation --- plutarch-test/plutarch-base/Plutarch/ApiSpec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs index c92aaef8d..77176f6b3 100644 --- a/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs +++ b/plutarch-test/plutarch-base/Plutarch/ApiSpec.hs @@ -93,7 +93,7 @@ spec = do toSymbolicValue n = PValue.pconstantPositiveSingleton (pconstant $ fromString $ "c" <> showHex n "") (pconstant "token") 1 "singleton" @| pmint @-> \p -> - plift (PValue.pforgetPositive p) @?= mint + plift (PValue.pforgetSorted $ PValue.pforgetPositive p) @?= mint "singletonData" @| PValue.psingletonData # pdata (pconstant "c0") # pdata (pconstant "sometoken") # pdata 1 @-> \p -> plift (PValue.pforgetSorted p) @?= mint From 7bfb370abbb863f9b04fbff5741b59cc0a93e723 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sat, 30 Jul 2022 00:03:21 +0530 Subject: [PATCH 581/584] Improve `PTxId` `PTryFrom` instance --- Plutarch/Api/V1/Tx.hs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 69a476ffc..1b0bd0ca5 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -44,22 +44,23 @@ instance PUnsafeLiftDecl PTxId where type PLifted PTxId = Plutus.TxId deriving via (DerivePConstantViaData Plutus.TxId PTxId) instance PConstantDecl Plutus.TxId instance PTryFrom PData PTxId where - type PTryFromExcess PData PTxId = Flip Term PTxId + type PTryFromExcess PData PTxId = Flip Term PByteString ptryFrom' opq cont = ptryFrom @(PAsData PTxId) opq (cont . first punsafeCoerce) instance PTryFrom PData (PAsData PTxId) where - type PTryFromExcess PData (PAsData PTxId) = Flip Term PTxId + type PTryFromExcess PData (PAsData PTxId) = Flip Term PByteString ptryFrom' opq = runTermCont $ do opq' <- tcont . plet $ pasConstr # opq - dataBs <- tcont $ \f -> - pif - (pfstBuiltin # opq' #== 0 #&& plength # (psndBuiltin # opq') #== 1) - (f $ phead #$ psndBuiltin # opq') - (ptraceError "ptryFrom(TxId): bad constructor") + tcont $ \f -> + pif (pfstBuiltin # opq' #== 0) (f ()) $ ptraceError "ptryFrom(TxId): invalid constructor id" + flds <- tcont . plet $ psndBuiltin # opq' + let dataBs = phead # flds + tcont $ \f -> + pif (pnil #== ptail # flds) (f ()) $ ptraceError "ptryFrom(TxId): constructor fields len > 1" unwrapped <- tcont . plet $ ptryFrom @(PAsData PByteString) dataBs snd tcont $ \f -> - pif (plengthBS # unwrapped #== 28) (f ()) (ptraceError "ptryFrom(TxId): must be 28 bytes long") - pure (punsafeCoerce opq, pcon . PTxId $ pdcons # pdata unwrapped # pdnil) + pif (plengthBS # unwrapped #== 28) (f ()) $ ptraceError "ptryFrom(TxId): must be 28 bytes long" + pure (punsafeCoerce opq, unwrapped) -- | Reference to a transaction output with a index referencing which of the outputs is being referred to. newtype PTxOutRef (s :: S) From 77bbe609d35d430d747472f094ee16bb4cb8fa05 Mon Sep 17 00:00:00 2001 From: chase <44284917+TotallyNotChase@users.noreply.github.com> Date: Sat, 30 Jul 2022 00:04:22 +0530 Subject: [PATCH 582/584] Remove `Flip` export and define inline everywhere --- Plutarch/Api/V1/AssocMap.hs | 3 ++- Plutarch/Api/V1/Crypto.hs | 3 ++- Plutarch/Api/V1/Scripts.hs | 3 ++- Plutarch/Api/V1/Time.hs | 3 ++- Plutarch/Api/V1/Tx.hs | 4 +++- Plutarch/Api/V1/Value.hs | 3 ++- Plutarch/Builtin.hs | 1 - 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Plutarch/Api/V1/AssocMap.hs b/Plutarch/Api/V1/AssocMap.hs index 1e13f0bf6..29010c9aa 100644 --- a/Plutarch/Api/V1/AssocMap.hs +++ b/Plutarch/Api/V1/AssocMap.hs @@ -50,7 +50,6 @@ import qualified PlutusTx.Monoid as PlutusTx import qualified PlutusTx.Semigroup as PlutusTx import Plutarch.Builtin ( - Flip, pasMap, pdataImpl, pforgetData, @@ -85,6 +84,8 @@ data KeyGuarantees = Sorted | Unsorted type PBuiltinListOfPairs k v = PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)) +newtype Flip f a b = Flip (f b a) deriving stock (Generic) + type role PMap nominal nominal nominal nominal newtype PMap (keysort :: KeyGuarantees) (k :: PType) (v :: PType) (s :: S) = PMap (Term s (PBuiltinList (PBuiltinPair (PAsData k) (PAsData v)))) deriving stock (Generic) diff --git a/Plutarch/Api/V1/Crypto.hs b/Plutarch/Api/V1/Crypto.hs index 9d15c9f23..1cc2acf46 100644 --- a/Plutarch/Api/V1/Crypto.hs +++ b/Plutarch/Api/V1/Crypto.hs @@ -12,7 +12,6 @@ import qualified PlutusLedgerApi.V1 as Plutus import Data.Coerce (coerce) import Plutarch.Api.Internal.Hashing (hashLedgerBytes) -import Plutarch.Builtin (Flip) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), PConstantDecl, @@ -45,5 +44,7 @@ instance PTryFrom PData (PAsData PPubKeyHash) where newtype PubKey = PubKey {getPubKey :: Plutus.LedgerBytes} deriving stock (Eq, Ord, Show) +newtype Flip f a b = Flip (f b a) deriving stock (Generic) + pubKeyHash :: PubKey -> Plutus.PubKeyHash pubKeyHash = coerce hashLedgerBytes diff --git a/Plutarch/Api/V1/Scripts.hs b/Plutarch/Api/V1/Scripts.hs index 2917083d9..b332ec649 100644 --- a/Plutarch/Api/V1/Scripts.hs +++ b/Plutarch/Api/V1/Scripts.hs @@ -16,7 +16,6 @@ module Plutarch.Api.V1.Scripts ( import qualified PlutusLedgerApi.V1 as Plutus import qualified PlutusLedgerApi.V1.Scripts as Plutus -import Plutarch.Builtin (Flip) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), PConstantDecl, @@ -113,3 +112,5 @@ deriving via (DerivePConstantViaBuiltin Plutus.ScriptHash PScriptHash PByteString) instance PConstantDecl Plutus.ScriptHash + +newtype Flip f a b = Flip (f b a) deriving stock (Generic) diff --git a/Plutarch/Api/V1/Time.hs b/Plutarch/Api/V1/Time.hs index f8be9fe47..fd169ba1b 100644 --- a/Plutarch/Api/V1/Time.hs +++ b/Plutarch/Api/V1/Time.hs @@ -11,7 +11,6 @@ import Plutarch.Num (PNum) import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.Interval (PInterval) -import Plutarch.Builtin (Flip) import Plutarch.Lift ( DerivePConstantViaNewtype (DerivePConstantViaNewtype), PConstantDecl, @@ -36,6 +35,8 @@ deriving via type PPOSIXTimeRange = PInterval PPOSIXTime +newtype Flip f a b = Flip (f b a) deriving stock (Generic) + instance PTryFrom PData (PAsData PPOSIXTime) where type PTryFromExcess PData (PAsData PPOSIXTime) = Flip Term PPOSIXTime ptryFrom' opq = runTermCont $ do diff --git a/Plutarch/Api/V1/Tx.hs b/Plutarch/Api/V1/Tx.hs index 1b0bd0ca5..370ba7ca2 100644 --- a/Plutarch/Api/V1/Tx.hs +++ b/Plutarch/Api/V1/Tx.hs @@ -20,7 +20,7 @@ import Plutarch.Api.V1.Value ( KeyGuarantees (Sorted), PValue, ) -import Plutarch.Builtin (Flip, pasConstr) +import Plutarch.Builtin (pasConstr) import Plutarch.DataRepr ( DerivePConstantViaData (DerivePConstantViaData), PDataFields, @@ -34,6 +34,8 @@ import Plutarch.Prelude import Plutarch.TryFrom (PTryFrom (PTryFromExcess, ptryFrom')) import Plutarch.Unsafe (punsafeCoerce) +newtype Flip f a b = Flip (f b a) deriving stock (Generic) + newtype PTxId (s :: S) = PTxId (Term s (PDataRecord '["_0" ':= PByteString])) deriving stock (Generic) diff --git a/Plutarch/Api/V1/Value.hs b/Plutarch/Api/V1/Value.hs index 123d9ea2b..4cb776729 100644 --- a/Plutarch/Api/V1/Value.hs +++ b/Plutarch/Api/V1/Value.hs @@ -58,7 +58,6 @@ import qualified PlutusLedgerApi.V1 as Plutus import Plutarch.Api.V1.AssocMap (KeyGuarantees (Sorted, Unsorted), PMap (..)) import qualified Plutarch.Api.V1.AssocMap as AssocMap import Plutarch.Bool (pand', pif') -import Plutarch.Builtin (Flip) import Plutarch.Lift ( DerivePConstantViaBuiltin (DerivePConstantViaBuiltin), DerivePConstantViaNewtype (DerivePConstantViaNewtype), @@ -74,6 +73,8 @@ import qualified PlutusTx.Semigroup as PlutusTx import Plutarch.Prelude hiding (psingleton) +newtype Flip f a b = Flip (f b a) deriving stock (Generic) + newtype PTokenName (s :: S) = PTokenName (Term s PByteString) deriving stock (Generic) deriving anyclass (PlutusType, PIsData, PEq, PPartialOrd, POrd) diff --git a/Plutarch/Builtin.hs b/Plutarch/Builtin.hs index 080bdb710..b01ca4932 100644 --- a/Plutarch/Builtin.hs +++ b/Plutarch/Builtin.hs @@ -3,7 +3,6 @@ {-# OPTIONS_GHC -Wno-orphans #-} module Plutarch.Builtin ( - Flip, PData, pfstBuiltin, psndBuiltin, From a89859ee3e94f131323b2daec626fd2bbd70d781 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 1 Aug 2022 18:52:30 +0000 Subject: [PATCH 583/584] 1.2 --- CHANGELOG.md | 4 ++-- plutarch-extra/plutarch-extra.cabal | 4 ++-- plutarch-test/plutarch-test.cabal | 4 ++-- plutarch.cabal | 5 +++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0edc1f81..5fedddf5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ # Revision history for plutarch -# Unreleased +# 1.2 (WIP changelog) - Changed fields of `PTxInfo` whose only representation is data to not be wrapped by `PAsData`. Module: `Plutarch.Api.V1.Contexts`; `Plutarch.Api.V2.Contexts` - + - Added `plistData` builtin function wrapper. Module: `Plutarch.Builtin` diff --git a/plutarch-extra/plutarch-extra.cabal b/plutarch-extra/plutarch-extra.cabal index e293ca434..2e25039bb 100644 --- a/plutarch-extra/plutarch-extra.cabal +++ b/plutarch-extra/plutarch-extra.cabal @@ -1,6 +1,6 @@ -cabal-version: 2.4 +cabal-version: 3.0 name: plutarch-extra -version: 1.1.0 +version: 1.2.0 common c default-language: Haskell2010 diff --git a/plutarch-test/plutarch-test.cabal b/plutarch-test/plutarch-test.cabal index 6c2656c0d..ac8f0e0b0 100644 --- a/plutarch-test/plutarch-test.cabal +++ b/plutarch-test/plutarch-test.cabal @@ -1,6 +1,6 @@ -cabal-version: 2.4 +cabal-version: 3.0 name: plutarch-test -version: 1.1.0 +version: 1.2.0 common c default-language: Haskell2010 diff --git a/plutarch.cabal b/plutarch.cabal index 66988a737..651acbeb7 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -1,9 +1,10 @@ -cabal-version: 2.4 +cabal-version: 3.0 name: plutarch -version: 1.1.0 +version: 1.2.0 author: Las Safin license: MIT extra-source-files: README.md +tested-with: GHC == 9.2.3 common c default-language: Haskell2010 From 45b7c77a9ee9bd6c7dc25ddebcc3d12c58c4c3a2 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Mon, 1 Aug 2022 19:20:57 +0000 Subject: [PATCH 584/584] Format --- plutarch.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plutarch.cabal b/plutarch.cabal index 651acbeb7..54c0e53a0 100644 --- a/plutarch.cabal +++ b/plutarch.cabal @@ -4,7 +4,7 @@ version: 1.2.0 author: Las Safin license: MIT extra-source-files: README.md -tested-with: GHC == 9.2.3 +tested-with: GHC ==9.2.3 common c default-language: Haskell2010